-
Notifications
You must be signed in to change notification settings - Fork 841
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature Branch] Add support for EuiRange in a dropdown with input #2179
[Feature Branch] Add support for EuiRange in a dropdown with input #2179
Conversation
@thompsongl Could I get your help with this one? I had brought up the idea of creating a service for the pattern of form inputs using custom popovers (to look like dropdowns not popovers). This is one of those use cases. Could we either go ahead and create that service (not that any other component needs to be updated to use it just yet) or could you help me fix the usage here to coincide with the others? |
@cchaos Yep, I can take a real look at it. I'd like to create the service now if the use cases are starting to arrive, but we'll see what's realistic. |
62dc3aa
to
689d79b
Compare
1ee7727
to
9895abf
Compare
This PR is now ready for review, though I do still have to go through the full checklist. Just figured I'd give ya'll a head start. @thompsongl I do need your help working on EuiInputPopover and the focus state handling and readOnly state. I'll get with you next week on that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks and works as expected. The red/green level indicators are less clear without any associated text. Perhaps it's just a simple docs addition to place the Recommended size is 20kb and above.
help text below the input as has been done in other examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The only other point of feedback is that you could add onFocus
handlers to the inputs to have them open the popover. As I mentioned in cchaos#20 (comment), though, I don't think it's necessary for this particular use of EuiInputPopover
.
* Updated form control border color * Slighly more transparent * change sass var name to $euiFormBorderOpaqueColor
…ic#2117) As a layout helper component to create date and number ranges * Added Sass var for `$euiFormControlLayoutGroupInputHeight` and compressed version
- Added truncation example - Added max-height
* Updated compressed visual style in mixin * Compressed updates to from control groups * Fix compressed state overrides * Reduce horizontal padding for compressed * Icons and button icons in input groups * Added a compressed option for from` euiFormControlLayoutPadding` * Added compressed padding for inputs with icons * Fix readonly & compressed input groups * Fix group heights * Update file picker with new compressed styles * Fix delimited compressed and fullwidth styles * Fixed EuiComboBox * Added reduced padding for EuiColorPicker * Fixed date pickers * Variables for border-radius
* Removed padding from compressed form row * Create mixin for `euiTextBreakWord` * Added option for horizontal compressed style Breaking: `compressed` is no longer passed to children * [Docs] Final compressed doc example changes * Fix combobox height * Fixed usages where spacers were needed * Deprecated `displayOnly` for `display: center`
689d79b
to
f917029
Compare
Decrease overall height of the range when compressed # Conflicts: # src/components/form/range/range_highlight.tsx # src/components/form/range/range_levels.tsx # src/components/form/range/range_slider.tsx # src/components/form/range/range_ticks.tsx # src/components/form/range/range_tooltip.tsx # src/components/form/range/range_track.tsx # src/components/form/range/range_wrapper.js
- Attempt at single range compressed input with popover - Fixes z-indexes being too high
- Fix up widths
Dual range now supports dropdown style
- Needed some fixes to EuiFormControlLayoutDelimited
Can’t use mixin, too many overrides/differences
@thompsongl I'm good with that approach. It really is mainly just for quick slides at that point and sliders aren't good for accessibility when trying to get to a specific value. |
I'll open a PR to this branch and let you try it out. |
Keyboard management: cchaos#25 Still trying to figure out how to get the dual range thumbs to be correctly positioned on initial render |
Focus direction
cchaos#26 will get the dual range thumbs correctly positioned. See what you think. |
`EuiDualRange` thumb position on resize
@thompsongl Can you actually checkout Firefox? I keep running into this long running script issue |
Ugh I forgot ResizeObserver uses a fallback in Firefox that won't work for this case. I'll have to find another solution. |
cchaos#27 removes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small stuff. Approved on changes. Nice work.
src/components/form/form_control_layout/_form_control_layout_delimited.scss
Show resolved
Hide resolved
…aos/eui into into-feature/range-dropdowns
use callback instead of resizeObserver
Ok, all the focus stuff should be fixed across browsers now and PR comments addressed. @thompsongl can you do a final review? |
…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
…lastic#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
* [Feature branch] Updated form control border color (#2114) * Updated form control border color * Slighly more transparent * change sass var name to $euiFormBorderOpaqueColor * [Feature branch] Added EuiFormControlLayoutDelimited component (#2117) As a layout helper component to create date and number ranges * Added Sass var for `$euiFormControlLayoutGroupInputHeight` and compressed version * [Feature branch] Compressed EuiSuperSelect dropdown (#2155) - Added truncation example - Added max-height * [Feature Branch] Update compressed form control styles (#2174) * Updated compressed visual style in mixin * Compressed updates to from control groups * Fix compressed state overrides * Reduce horizontal padding for compressed * Icons and button icons in input groups * Added a compressed option for from` euiFormControlLayoutPadding` * Added compressed padding for inputs with icons * Fix readonly & compressed input groups * Fix group heights * Update file picker with new compressed styles * Fix delimited compressed and fullwidth styles * Fixed EuiComboBox * Added reduced padding for EuiColorPicker * Fixed date pickers * Variables for border-radius * [Feature branch] Compressed form rows (#2181) * Removed padding from compressed form row * Create mixin for `euiTextBreakWord` * Added option for horizontal compressed style Breaking: `compressed` is no longer passed to children * [Docs] Final compressed doc example changes * Fix combobox height * Fixed usages where spacers were needed * Deprecated `displayOnly` for `display: center` * Fix snap * Into feature/compressed editor docs (#2295) * Adding a shared component for the different states of each form control * New docs section for compressed * Added `columnCompressedSwitch` to display type of EuiFormRow for better alignment of switch style controls * Account for tooltips as pre/appends * Allow passing a string as the pre/appends and it automatically wraps it in a form label * Made all EuiSuperDatePicker form controls compressed (in popover) * Connection prepend/appends with input via `htmlFor` * Allowing passing of `style` to EuiColorPickerSwatch * Allow an array of strings a pre/append * [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 * Added some display toggles for ranges and ranges with dropdowns to the complex example Has issues * Fix console errors * Some fixes - Ranges use div spacers between slider and input instead of margin - Pre/Appends are restrictred to 50% width and truncated * [feature/compressed-editor-controls] EuiRange + EuiFormRow (#2321) * focus management * add euiformrow to some examples * use prevention flag * Add `controlOnly` prop to EuiFieldText * Update TS defs * Some docs fixes * Fix inherit screen reader ability of EuiRange By moving the id to the input if it exists * Add dual range to complex example
feature/compressed-editor-controls
Adds another option to the
showInput
prop for EuiRange and EuiDualRangeIf you now pass
showInput="only"
, then only the input will show like a normal form control but focusing on the form control will open a dropdown that contains the range slider. This will help compressed forms use the space better without the need for the slider to be inline.Other additions in this PR to get the above working
1. Fixes heights for compressed ranges
Before, the height would stay at 40px, now it compresses down.
2. Fixed z-indexing of range innards
By removing them altogether and relying on DOM order.
3. Added
controlOnly
prop to EuiFieldNumberI'm tired of fighting with nested EuiFormControlLayout components. This was super easy to do and quickly got me to the state I needed without nested overrides.
4. Some fixes to EuiFormControLayoutDelimeter
For disabled state.
Checklist
[ ] Checked for breaking changes and labeled appropriately[ ] A changelog entry exists and is marked appropriatelyWill make one in Feature PR