UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

98 lines (97 loc) 2.9 kB
/** * MSKCC DSM 2021, 2023 */ import { ReactElementLike, ReactNodeArray } from 'prop-types'; import React from 'react'; import { ReactAttr } from '../../types/common'; type ExcludedAttributes = 'value' | 'onChange' | 'locale' | 'children'; export type ReactNodeLike = ReactElementLike | ReactNodeArray | string | number | boolean | null | undefined; export type func = (...args: any[]) => any; interface DatePickerInputProps extends Omit<ReactAttr<HTMLInputElement>, ExcludedAttributes> { /** * value of the autoComplete */ autoComplete?: string; /** * disable warning icon */ disableWarningIcon?: boolean; /** * The type of the date picker: * * * `simple` - Without calendar dropdown. * * `single` - With calendar dropdown and single date. * * `range` - With calendar dropdown and a date range. */ /** * Specify whether or not the input should be disabled */ disabled?: boolean; /** * Provide text that is used alongside the control label for additional help */ helperText?: ReactNodeLike; /** * Specify if the label should be hidden */ hideLabel?: boolean; /** * Specify an id that uniquely identifies the `<input>` */ id: string; /** * Specify whether or not the input should be invalid */ invalid?: boolean; /** * Specify the text to be rendered when the input is invalid */ invalidText?: ReactNodeLike; /** * Provide the text that will be read by a screen reader when visiting this * control */ labelText: ReactNodeLike; /** * Specify an `onChange` handler that is called whenever a change in the * input field has occurred */ onChange?: func; /** * Provide a function to be called when the input field is clicked */ onClick?: func; /** * Provide a regular expression that the input value must match * TODO:need to be rewritten */ pattern?: (props: { [key: string]: any; }, propName: string, componentName: string) => null | any | Error; /** * Specify the placeholder text */ placeholder?: string; /** * whether the DatePicker is to be readOnly */ readOnly?: boolean; /** * Specify the size of the Date Picker Input. Currently supports either `sm`, `md`, or `lg` as an option. */ size?: 'sm' | 'md' | 'lg'; /** * Specify the type of the `<input>` */ type?: string; /** * Specify whether the control is currently in warning state */ warn?: boolean; /** * Provide the text that is displayed when the control is in warning state */ warnText?: ReactNodeLike; } declare const DatePickerInput: React.ForwardRefExoticComponent<DatePickerInputProps & React.RefAttributes<HTMLDivElement>>; export default DatePickerInput;