-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feature Branch] Add support for EuiRange in a dropdown with input (#…
…2179) * Compressed EuiRange step 1: Decrease overall height of the range when compressed * Compressed EuiRange step 2: - Attempt at single range compressed input with popover - Fixes z-indexes being too high - Fix up widths * Compressed EuiRange step 3: Dual range now supports dropdown style * Fix for delimited * Fix full-width delimited * Added `controlOnly` prop to EuiFieldNumber * Finalize styles of input only ranges - Needed some fixes to EuiFormControlLayoutDelimited * Open popover on focus * dual range respond to resize events when in showInputOnly mode * use callback instead of resizeObserver * ie11 focus fix * use focusout instead of blur
- Loading branch information
Showing
31 changed files
with
903 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import React, { Component, Fragment } from 'react'; | ||
|
||
import { EuiRange, EuiSpacer, EuiDualRange } from '../../../../src/components'; | ||
|
||
import makeId from '../../../../src/components/form/form_row/make_id'; | ||
|
||
export default class extends Component { | ||
constructor(props) { | ||
super(props); | ||
|
||
this.levels = [ | ||
{ | ||
min: 0, | ||
max: 20, | ||
color: 'danger', | ||
}, | ||
{ | ||
min: 20, | ||
max: 100, | ||
color: 'success', | ||
}, | ||
]; | ||
|
||
this.state = { | ||
value: '20', | ||
dualValue: [20, 100], | ||
}; | ||
} | ||
|
||
onChange = e => { | ||
this.setState({ | ||
value: e.target.value, | ||
}); | ||
}; | ||
|
||
onDualChange = value => { | ||
this.setState({ | ||
dualValue: value, | ||
}); | ||
}; | ||
|
||
render() { | ||
return ( | ||
<Fragment> | ||
<EuiRange | ||
id={makeId()} | ||
value={this.state.value} | ||
onChange={this.onChange} | ||
showInput="inputWithPopover" | ||
showLabels | ||
/> | ||
|
||
<EuiSpacer size="xl" /> | ||
|
||
<EuiDualRange | ||
id={makeId()} | ||
value={this.state.dualValue} | ||
onChange={this.onDualChange} | ||
showInput="inputWithPopover" | ||
showLabels | ||
levels={this.levels} | ||
/> | ||
|
||
<EuiSpacer size="xl" /> | ||
|
||
<EuiRange | ||
id={makeId()} | ||
value={this.state.value} | ||
onChange={this.onChange} | ||
compressed | ||
showInput="inputWithPopover" | ||
showLabels | ||
/> | ||
|
||
<EuiSpacer size="xl" /> | ||
|
||
<EuiDualRange | ||
id={makeId()} | ||
value={this.state.dualValue} | ||
onChange={this.onDualChange} | ||
compressed | ||
showInput="inputWithPopover" | ||
showLabels | ||
levels={this.levels} | ||
readOnly | ||
/> | ||
</Fragment> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.