[EuiSuperDatePicker] Support restricted date range#8071
[EuiSuperDatePicker] Support restricted date range#8071tkajtoch merged 4 commits intoelastic:mainfrom
Conversation
💚 Build Succeeded
|
tkajtoch
left a comment
There was a problem hiding this comment.
The changes look and work great!
I noticed something I'd like to improve in the future. The time selector isn't highlighting invalid values, which could create confusion especially when dealing with relatively small date ranges. The same behavior happens in EuiDatePicker, that's why I'm happy to skip it from this PR.
@tkajtoch I agree. It would be a nice UX improvement to directly show invalid times but it's something we should improve on the |
`v97.0.0`⏩`v97.0.0-backport.0` _[Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_ --- # Backport This EUI backport adds a single requested change on top of `v97.0.0` to get it in Kibana before the 8.16 feature freeze: * elastic/eui#8071 The change can be considered a patch release and shouldn't affect any of the existing usages of `EuiSuperDatePicker`
`v97.0.0`⏩`v97.0.0-backport.0` _[Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_ --- # Backport This EUI backport adds a single requested change on top of `v97.0.0` to get it in Kibana before the 8.16 feature freeze: * elastic/eui#8071 The change can be considered a patch release and shouldn't affect any of the existing usages of `EuiSuperDatePicker` (cherry picked from commit e5b0b81)
`v97.0.0-backport.0`⏩`v97.2.0` _[Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_ --- ## [`v97.2.0`](https://github.com/elastic/eui/releases/v97.2.0) - Updated `EuiHeaderLinks` with a new `xxs` gutter size ([#8079](elastic/eui#8079)) **Bug fixes** - Reverted an `EuiDataGrid` regression from [#8015](elastic/eui#8015) which prevented overriding column widths via columns's `initialWidth`s ([#8086](elastic/eui#8086)) ## [`v97.1.0`](https://github.com/elastic/eui/releases/v97.1.0) - Added `columnVisibility.canDragAndDropColumns` on `EuiDataGrid` which enables reordering columns via draggable header cells ([#8015](elastic/eui#8015)) - Updated `EuiHeader`s in dark mode to have a visible border-bottom color ([#8070](elastic/eui#8070)) - Added props `minDate` and `maxDate` on `EuiSuperDatePicker` to support restricting date range selections ([#8071](elastic/eui#8071))
`v97.0.0-backport.0`⏩`v97.2.0` _[Questions? Please see our Kibana upgrade FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)_ --- ## [`v97.2.0`](https://github.com/elastic/eui/releases/v97.2.0) - Updated `EuiHeaderLinks` with a new `xxs` gutter size ([elastic#8079](elastic/eui#8079)) **Bug fixes** - Reverted an `EuiDataGrid` regression from [elastic#8015](elastic/eui#8015) which prevented overriding column widths via columns's `initialWidth`s ([elastic#8086](elastic/eui#8086)) ## [`v97.1.0`](https://github.com/elastic/eui/releases/v97.1.0) - Added `columnVisibility.canDragAndDropColumns` on `EuiDataGrid` which enables reordering columns via draggable header cells ([elastic#8015](elastic/eui#8015)) - Updated `EuiHeader`s in dark mode to have a visible border-bottom color ([elastic#8070](elastic/eui#8070)) - Added props `minDate` and `maxDate` on `EuiSuperDatePicker` to support restricting date range selections ([elastic#8071](elastic/eui#8071)) (cherry picked from commit d7c5608)
Summary
closes #6021
This PR adds support for
minDateandmaxDateprops on EuiSuperDatePicker.These props are aligned with the props already in use on EuiDatePicker to ensure a common API.
The restricted range takes absolute and relative dates into account.
Screen.Recording.2024-10-10.at.21.02.08.mov
QA
Storybook: https://eui.elastic.co/pr_8071/storybook/?path=/story/forms-euisuperdatepicker-euisuperdatepicker--restricted-range
EUI docs: https://eui.elastic.co/pr_8071/#/templates/super-date-picker#restricted-range
General checklist
@defaultif default values are missing) and playground togglesChecked Code Sandbox works for any docs examplesIf applicable, added the breaking change issue label (and filled out the breaking change checklist)If applicable, file an issue to update EUI's Figma library with any corresponding UI changes. (This is an internal repo, if you are external to Elastic, ask a maintainer to submit this request)