UNPKG

@wix/design-system

Version:

@wix/design-system

110 lines (107 loc) 5.13 kB
### className - type: string - description: Specifies a CSS class name to be appended to the components root element. - internal ### dataHook - type: string - description: Applies a data-hook HTML attribute that can be used in the tests ### disabled - type: boolean - description: Specifies whether component is disabled ### border - type: "none" | "standard" | "round" | "bottomLine" - description: Control the border style of input ### onChange - type: ({ date }: { date: Date | null; }) => void - description: Defines a callback function which is called on every time value changes ### onInvalid - type: () => void - description: Defines a callback function which is called on cases when invalid time is typed or confirmed with an action. - return {{ validationType: 'formatError' | 'outOfBoundsError', value: string }} - `validationType` - type 'formatError'is set when value is in the wrong time format - type 'outOfBoundsError' is set when `excludePastTimes` or `filterTime` is used and value does not match the filters - `value` - is set to current input value ### placeholder - type: string - description: Sets a placeholder message to display ### prefix - type: ReactNode - description: Pass a component you want to show as the prefix of the input, e.g., text, icon ### readOnly - type: boolean - description: Specifies whether input is read only ### size - type: "tiny" | "small" | "medium" | "large" - description: Controls the size of the input ### status - type: "loading" | "error" | "warning" - description: Specify the status of a field ### statusMessage - type: ReactNode - description: Defines the message to display on status icon hover. If not given or empty there will be no tooltip. ### invalidMessage - type: string - description: Enables internal validation and defines a message to display when user types invalid time value ### step - type: number - description: Specifies the interval between time values shown in dropdown - default: 15 ### suffix - type: ReactNode - description: Pass a component you want to show as the suffix of the input, e.g., text, icon ### locale - type: "th" | "tr" | "id" | "no" | "en" | "en-US" | "en-GB" | "en-AU" | "en-CA" | "ar" | "bg" | "ca" | "zh" | "zh-TW" | "zh-HK" | "zh-MO" | "cs" | "da" | "nl" | "fi" | "fr" | "fr-CA" | "fr-CH" | "fr-BE" | "de" | "de-CH" | "de-AT" | "el" | "he" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "ms" | "nb" | "nn" | "pl" | "pt-BR" | "pt" | "ro" | "ru" | "sk" | "sl" | "es" | "es-419" | "es-AR" | "es-MX" | "es-US" | "sv" | "tl" | "uk" | "vi" - description: Sets locale and formats time according to it ### timeStyle - type: "short" | "long" - description: Specifies what time formatting style to use when calling `format()` ### value - type: null | Date - description: Specifies the current value of the input ### width - type: string | number | string & {} - description: Controls the width of the component. `auto` will resize the input to match width of its contents, while `100%` will take up the full parent container width. ### popoverProps - type: PopoverCommonProps - description: Allows to pass all common popover props. ### onFocus - type: FocusEventHandler - description: Defines a standard input `onFocus` callback ### onBlur - type: FocusEventHandler - description: Defines a standard input `onBlur` callback ### autoSelect - type: boolean - description: Specifies whether input is auto selected on focus ### excludePastTimes - type: boolean - description: Specify whether past time slots should be shown or not ### filterTime - type: (time: Date) => boolean - description: Specify selectable time slots: * `param` {Date} `value` - a time to check * `return` {boolean} - true if `value` should be shown in time slots dropdown, false otherwise ### disableKeyboardType - type: boolean - description: No description ### disableAutoComplete - type: boolean - description: Disables the auto-suggest UX (closest-time pre-fill, suggestion autofill, mid-typing format validation). The dropdown still works as a picker. Use when integrating an external input mask. Format errors surface on blur. ### hideStatusSuffix - type: boolean - description: Specifies whether status suffix is hidden. ### inputRef - type: null | (instance: HTMLInputElement | null) => void | RefObject<HTMLInputElement> - description: Ref to the underlying `<input>` DOM element. Accepts callback and object refs. Use for input masking libraries. Memoize callback refs to avoid reattaching. ### customInput - type: null | string | number | false | true | Function | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal - description: Render a custom component in place of the default `<input>`. Must be a `React.forwardRef` component that forwards the ref to a real `<input>`. ### ref - type: null | string | (instance: TimeInputImperativeActions | null) => void | RefObject<TimeInputImperativeActions> - description: Allows getting a ref to the component instance. Once the component unmounts, React will set `ref.current` to `null` (or call the ref with `null` if you passed a callback ref).