Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions components/lib/Timepicker/Timepicker.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import { AriaAttributes, ComponentType, 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<TextFieldProps<string>, 'inputRef' | 'onChange'> {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputRef and onChange conflict with our definitions below (and we yank them out of what gets spread to TextField), so we don't want to include those here

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is helpful commentary, @ncovercash . Maybe it belongs as a comment in the source rather than just a comment on the PR?

/** If the field should auto-focus on mount */
autoFocus?: boolean;
/** Disables the input field */
Expand All @@ -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;
Expand All @@ -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 */
Expand Down
Loading