From 24b8713410a88c6b994b55ce28dbc0ce39cf3acf Mon Sep 17 00:00:00 2001 From: Cee Chen Date: Tue, 6 Feb 2024 12:45:29 -0800 Subject: [PATCH] Update `EuiSuperDatePicker` to pass down min interval prop to underlying component --- .../__snapshots__/quick_select_popover.test.tsx.snap | 1 + .../date_picker/super_date_picker/super_date_picker.tsx | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/src/components/date_picker/super_date_picker/quick_select_popover/__snapshots__/quick_select_popover.test.tsx.snap b/src/components/date_picker/super_date_picker/quick_select_popover/__snapshots__/quick_select_popover.test.tsx.snap index c1be9589f98..54dbcc3c5cb 100644 --- a/src/components/date_picker/super_date_picker/quick_select_popover/__snapshots__/quick_select_popover.test.tsx.snap +++ b/src/components/date_picker/super_date_picker/quick_select_popover/__snapshots__/quick_select_popover.test.tsx.snap @@ -350,6 +350,7 @@ exports[`EuiQuickSelectPanels customQuickSelectPanels should render custom panel class="euiFieldNumber euiFieldNumber--fullWidth euiFieldNumber--compressed" data-test-subj="superDatePickerRefreshIntervalInput" disabled="" + min="0" step="any" type="number" value="0" diff --git a/src/components/date_picker/super_date_picker/super_date_picker.tsx b/src/components/date_picker/super_date_picker/super_date_picker.tsx index ab94d756605..d7db318dd59 100644 --- a/src/components/date_picker/super_date_picker/super_date_picker.tsx +++ b/src/components/date_picker/super_date_picker/super_date_picker.tsx @@ -148,6 +148,11 @@ export type EuiSuperDatePickerProps = CommonProps & { * @default 1000 */ refreshInterval?: Milliseconds; + /** + * Minimum refresh interval in milliseconds + * @default 0 + */ + refreshMinInterval?: Milliseconds; /** * By default, refresh interval units will be rounded up to next largest unit of time * (for example, 90 seconds will become 2m). @@ -497,6 +502,7 @@ export class EuiSuperDatePickerInternal extends Component< timeOptions, dateFormat, refreshInterval, + refreshMinInterval, refreshIntervalUnits, isPaused, isDisabled, @@ -511,6 +517,7 @@ export class EuiSuperDatePickerInternal extends Component< const autoRefreshAppend: EuiFormControlLayoutProps['append'] = !isPaused ? (