From 19d7fcb0d91600cbfade505466d2fdf3860b4432 Mon Sep 17 00:00:00 2001 From: Noah Overcash Date: Tue, 25 Mar 2025 11:03:54 -0400 Subject: [PATCH 1/2] [STRIPES-971] Add missing timepicker props --- components/lib/Timepicker/Timepicker.d.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/components/lib/Timepicker/Timepicker.d.ts b/components/lib/Timepicker/Timepicker.d.ts index bf823de..468edf1 100644 --- a/components/lib/Timepicker/Timepicker.d.ts +++ b/components/lib/Timepicker/Timepicker.d.ts @@ -1,8 +1,11 @@ -import { AriaAttributes, ComponentType, ReactNode, Ref } from 'react'; +import { AriaAttributes, ComponentType, InputHTMLAttributes, ReactNode, Ref } from 'react'; import { IntlShape } from 'react-intl'; import { PopperModifiers, PopperPlacement } from '../Popper'; +import { TextFieldProps } from '../TextField'; -export interface TimepickerProps extends AriaAttributes { +export interface TimepickerProps + extends AriaAttributes, + Omit, 'inputRef' | 'onChange'> { /** If the field should auto-focus on mount */ autoFocus?: boolean; /** Disables the input field */ @@ -20,7 +23,9 @@ export interface TimepickerProps extends AriaAttributes { /** Popper modifiers */ modifiers?: PopperModifiers; /** Fired anytime internal state changes */ - onChange?: (e: Event, standardizedTime?: string) => void; + onChange?: (e: Event, standardizedTime: string, inputValue: string) => void; + /** If the user-visible (formatted) output should be passed on change events, or the standard HH:MM:00Z */ + outputBackendValue?: boolean; /** Format a UTC value into the specified timezone */ outputFormatter?: (props: { value: string | undefined; @@ -47,6 +52,8 @@ export interface TimepickerProps extends AriaAttributes { showTimepicker?: boolean; /** Override the default timezone */ timeZone?: string; + /** Outputs values to onChange as seen directly in the input box */ + useInput?: boolean; /** Render to the global overlay, if the dropdown may be cut off due to some containing elements's overflow */ usePortal?: boolean; /** The field's value */ From 09f59a2bdc75406d676e6aa992f4420e5fbc909b Mon Sep 17 00:00:00 2001 From: Noah Overcash Date: Tue, 25 Mar 2025 11:04:22 -0400 Subject: [PATCH 2/2] . --- components/lib/Timepicker/Timepicker.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/lib/Timepicker/Timepicker.d.ts b/components/lib/Timepicker/Timepicker.d.ts index 468edf1..3e476d8 100644 --- a/components/lib/Timepicker/Timepicker.d.ts +++ b/components/lib/Timepicker/Timepicker.d.ts @@ -1,4 +1,4 @@ -import { AriaAttributes, ComponentType, InputHTMLAttributes, ReactNode, Ref } from 'react'; +import { AriaAttributes, ComponentType, ReactNode, Ref } from 'react'; import { IntlShape } from 'react-intl'; import { PopperModifiers, PopperPlacement } from '../Popper'; import { TextFieldProps } from '../TextField';