|
@@ -881,70 +881,70 @@ function Demo() {
|
|
|
|
|
|
## API Reference
|
|
|
|
|
|
-| Properties | Instructions | Type | Default | Version |
|
|
|
-|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|---------|------------|
|
|
|
-| autoAdjustOverflow | Whether the floating layer automatically adjusts its direction when it is blocked | boolean | true | **0.34.0** |
|
|
|
-| autoFocus | Automatic access to focus | boolean | false | **1.10.0** |
|
|
|
-| autoSwitchDate | When the year and month are changed through the left and right buttons and the drop-down menu at the top of the panel, the date is automatically switched. Only valid for `date` type. | boolean | true | **1.13.0** |
|
|
|
-| bottomSlot | Render the bottom extra area | ReactNode | | **1.22.0** |
|
|
|
-| borderless | borderless mode >=2.33.0 | boolean | |
|
|
|
-| className | Class name | string | - | |
|
|
|
-| clearIcon | Can be used to customize the clear button, valid when showClear is true | ReactNode | | **2.25.0** |
|
|
|
-| defaultOpen | Panel displays or hides by default | boolean | false | |
|
|
|
-| defaultPickerValue | Default panel date | ValueType | | |
|
|
|
-| defaultValue | Default value | ValueType | | | |
|
|
|
-| density | Density of picker panel, one of `default`, `compact` | string | default | **1.17.0** |
|
|
|
-| disabled | Is it disabled? | boolean | false | |
|
|
|
-| disabledDate | The date is prohibited from the judgment method, and the date is prohibited when returned to true. Options parameter supported after 1.9.0, rangeEnd supported after 1.29 and rangeInputFocus is supported since 2.22 | <ApiType detail='(date: Date, options: { rangeStart: string, rangeEnd: string, rangeInputFocus: "rangeStart" \| "rangeEnd" \| false }) => boolean'>(date, options) => boolean</ApiType> | () = > false | |
|
|
|
-| disabledTime | Time prohibition configuration, the return value will be transparently passed to [`TimePicker`](/en-US/input/timepicker#API_Reference) as a parameter | <ApiType detail='(date: Date \| Date[], panelType?: string) => ({ disabledHours:() => number[], disabledMinutes: (hour: number) => number[], disabledSeconds: (hour: number, minute: number) => number[] })'>(date, panelType) => object</ApiType> | () => false | **0.36.0** |
|
|
|
-| disabledTimePicker | Disable time selection or not. | boolean | **0.32.0** |
|
|
|
-| dropdownClassName | CSS classname for drop-down menu | string | | **1.13.0** |
|
|
|
+| Properties | Instructions | Type | Default | Version |
|
|
|
+|--------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|---------|------------|
|
|
|
+| autoAdjustOverflow | Whether the floating layer automatically adjusts its direction when it is blocked | boolean | true | **0.34.0** |
|
|
|
+| autoFocus | Automatic access to focus | boolean | false | **1.10.0** |
|
|
|
+| autoSwitchDate | When the year and month are changed through the left and right buttons and the drop-down menu at the top of the panel, the date is automatically switched. Only valid for `date` type. | boolean | true | **1.13.0** |
|
|
|
+| bottomSlot | Render the bottom extra area | ReactNode | | **1.22.0** |
|
|
|
+| borderless | borderless mode >=2.33.0 | boolean | |
|
|
|
+| className | Class name | string | - | |
|
|
|
+| clearIcon | Can be used to customize the clear button, valid when showClear is true | ReactNode | | **2.25.0** |
|
|
|
+| defaultOpen | Panel displays or hides by default | boolean | false | |
|
|
|
+| defaultPickerValue | Default panel date | ValueType | | |
|
|
|
+| defaultValue | Default value | ValueType | | | |
|
|
|
+| density | Density of picker panel, one of `default`, `compact` | string | default | **1.17.0** |
|
|
|
+| disabled | Is it disabled? | boolean | false | |
|
|
|
+| disabledDate | The date is prohibited from the judgment method, and the date is prohibited when returned to true. Options parameter supported after 1.9.0, rangeEnd supported after 1.29 and rangeInputFocus is supported since 2.22 | <ApiType detail='(date: Date, options: { rangeStart: string, rangeEnd: string, rangeInputFocus: "rangeStart" \| "rangeEnd" \| false }) => boolean'>(date, options) => boolean</ApiType> | () = > false | |
|
|
|
+| disabledTime | Time prohibition configuration, the return value will be transparently passed to [`TimePicker`](/en-US/input/timepicker#API_Reference) as a parameter | <ApiType detail='(date: Date \| Date[], panelType?: string) => ({ disabledHours:() => number[], disabledMinutes: (hour: number) => number[], disabledSeconds: (hour: number, minute: number) => number[] })'>(date, panelType) => object</ApiType> | () => false | **0.36.0** |
|
|
|
+| disabledTimePicker | Disable time selection or not. | boolean | **0.32.0** |
|
|
|
+| dropdownClassName | CSS classname for drop-down menu | string | | **1.13.0** |
|
|
|
| dropdownMargin | Popup layer calculates the size of the safe area when the current direction overflows, used in scenes covered by fixed elements, more detail refer to [issue#549](https://github.com/DouyinFE/semi-design/issues/549), same as Tooltip margin | object\|number | | **2.25.0** |
|
|
|
-| dropdownStyle | Inline style of drop-down menu | object | | **1.13.0** |
|
|
|
-| endDateOffset | When type is dateRange, set the end date of the selected range | (selectedDate?: Date) => Date; | - | **1.10.0** |
|
|
|
-| format | Date string format displayed in the input box | string | Corresponding to type: For details, see [Date and Time Format](#Date%20and%20Time%20Format) | |
|
|
|
-| getPopupContainer | Specifies the parent DOM, and the bullet layer will be rendered to the DOM, you need to set 'position: relative` | function():HTMLElement | () = > document.body |
|
|
|
-| inputReadOnly | Is the text box readonly | boolean | false | |
|
|
|
-| insetInput | Whether the input box is embedded in the panel. InsetInputProps type supported after v2.29 | boolean \| <ApiType detail='{ placeholder?: { dateStart?: string; dateEnd?: string; timeStart?: string; timeEnd?: string } }'>InsetInputProps</ApiType> | false | **2.7.0** |
|
|
|
-| inputStyle | Input box style | object | | |
|
|
|
-| insetLabel | Prefix label, lower priority than `prefix` | string\|ReactNode | | |
|
|
|
-| max | When multiple is set to true, the number of selected, non-pass or value is null\|undefined, unlimited. | number | - | |
|
|
|
-| multiple | Whether you can choose multiple, only type = "date" is supported | boolean | false | |
|
|
|
-| needConfirm | Do you need to "confirm selection", only `type= "dateTime"\| "dateTimeRange"` works. | boolean | | **0.18.0** |
|
|
|
-| open | Controlled properties displayed or hidden by panels | boolean | | |
|
|
|
-| placeholder | Input box prompts text | string\|string[] | 'Select date' | |
|
|
|
-| position | Floating layer position, optional value with [Popover #API Reference · position](/en-US/show/popover#API%20Reference) | string | 'bottomLeft' | |
|
|
|
-| prefix | Prefix content | string\|ReactNode | | |
|
|
|
-| presets | Date Time Shortcut | <ApiType detail='Array< { start: BaseValueType, end :BaseValueType, text: string } \| () => { start:B aseValueType, end: BaseValueType, text: string }>'>Array</ApiType> | [] | |
|
|
|
-| preventScroll | Indicates whether the browser should scroll the document to display the newly focused element, acting on the focus method inside the component, excluding the component passed in by the user | boolean | | |
|
|
|
-| presetPosition | Date time shortcut panel position, optional 'left', 'right', 'top', 'bottom' | 'bottom' | **2.18.0** |
|
|
|
-| rangeSeparator | Custom range type picker separator of input trigger | string | '~' | **1.31.0**
|
|
|
-| renderDate | Custom date display content | (dayNumber, fullDate) => ReactNode | - | **1.4.0** |
|
|
|
-| renderFullDate | Custom display date box | (dayNumber, fullDate, dayStatus) => ReactNode | - | **1.4.0** |
|
|
|
-| showClear | Do you show the clear button? | boolean | true | **0.35.0** |
|
|
|
-| size | Size, optional: "small," "default," "large" | string | 'default' | |
|
|
|
-| spacing | The distance between the pop-up layer and the children element | number | 4 | **1.9.0** |
|
|
|
-| startDateOffset | When type is dateRange, set the start date of the selected range | (selectedDate?: Date) => Date; | - | **1.10.0** |
|
|
|
-| startYear | start year of the year scroll panel | number | 100 years before current year | **2.36.0** |
|
|
|
-| endYear | end year of the year scroll panel | number | 100 years after current year | **2.36.0** |
|
|
|
-| syncSwitchMonth | In the scene of range, it supports synchronous switching of the month of the dual panel|boolean|false|**1.28.0**|
|
|
|
-| timePickerOpts | For other parameters that can be transparently passed to the time selector, see [TimePicker·API Reference](/en-US/input/timepicker#API%20Reference) | | object | **1.1.0** |
|
|
|
-| topSlot | Render the top extra area | ReactNode | | **1.22.0** |
|
|
|
-| triggerRender | Custom trigger rendering method | (TriggerRenderProps) => ReactNode | | **0.34.0** |
|
|
|
-| type | Type, optional value: "date", "dateRange", "dateTime", "dateTimeRange", "month", "monthRange" | string | 'date' | |
|
|
|
-| value | Controlled value | ValueType | | |
|
|
|
-| weekStartsOn | Take the day of the week as the first day of the week, 0 for Sunday, 1 for Monday, and so on. | number | 0 | |
|
|
|
-| onBlur | Callback when focus is lost. It is not recommended to use this API in range selection | (event) => void | () => {} | **1.0.0** |
|
|
|
-| onCancel | Cancel the callback when selected, enter the reference as the value of the last confirmed selection, only `type` equals "dateTime"or "dateTimeRange" and `needConfirm` equals true | <ApiType detail='(date: DateType, dateStr: StringType) => void'>(date, dateString) => void</ApiType> | | **0.18.0** |
|
|
|
-| onChange | A callback when the value changes | <ApiType detail='(date: DateType, dateString: StringType) => void'>(date, dateString) => void</ApiType> | | |
|
|
|
-| onClear | A callback when click the clear button | (event) => void | () => {} | **1.16.0** |
|
|
|
-| onClickOutSide | When the pop-up layer is in a display state, click the non-popup layer and trigger callback | () => void | () => {} | **2.31.0** |
|
|
|
-| onConfirm | Confirm the callback at the time of selection, enter the reference as the value of the current selection, only `type` equals "dateTime" or "dateTimeRange" and `needConfirm` equals true | <ApiType detail='(date: DateType, dateStr: StringType) => void'>(date, dateString) => void</ApiType>| | **0.18.0** |
|
|
|
-| onFocus | Callback when focus is obtained. It is not recommended to use this API in range selection | (event) => void | () => {} | **1.0.0** |
|
|
|
-| onOpenChange | Callback when popup open or close | (isOpen) => void | | |
|
|
|
-| onPanelChange | Callback when the year or date of the panel is switched| <ApiType detail='(date: DateType \| DateType[], dateStr: StringType \| StringType[])=>void'>(date, dateStr) => void</ApiType> | |**1.28.0**|
|
|
|
-| onPresetClick | Callback when click preset button | <ApiType detail='(item: Object, e: Event) => void'>(item, e) => void</ApiType> | **1.24.0** |
|
|
|
-| yearAndMonthOpts | Other parameters that can be transparently passed to the year-month selector, see details in [ScrollList#API](/zh-CN/show/scrolllist#ScrollItem)| | object | **2.22.0** |
|
|
|
+| dropdownStyle | Inline style of drop-down menu | object | | **1.13.0** |
|
|
|
+| endDateOffset | When type is dateRange, set the end date of the selected range | (selectedDate?: Date) => Date; | - | **1.10.0** |
|
|
|
+| format | Date string format displayed in the input box | string | Corresponding to type: For details, see [Date and Time Format](#Date%20and%20Time%20Format) | |
|
|
|
+| getPopupContainer | Specifies the parent DOM, and the bullet layer will be rendered to the DOM, you need to set 'position: relative` This will change the DOM tree position, but not the view's rendering position. | function():HTMLElement | () = > document.body |
|
|
|
+| inputReadOnly | Is the text box readonly | boolean | false | |
|
|
|
+| insetInput | Whether the input box is embedded in the panel. InsetInputProps type supported after v2.29 | boolean \| <ApiType detail='{ placeholder?: { dateStart?: string; dateEnd?: string; timeStart?: string; timeEnd?: string } }'>InsetInputProps</ApiType> | false | **2.7.0** |
|
|
|
+| inputStyle | Input box style | object | | |
|
|
|
+| insetLabel | Prefix label, lower priority than `prefix` | string\|ReactNode | | |
|
|
|
+| max | When multiple is set to true, the number of selected, non-pass or value is null\|undefined, unlimited. | number | - | |
|
|
|
+| multiple | Whether you can choose multiple, only type = "date" is supported | boolean | false | |
|
|
|
+| needConfirm | Do you need to "confirm selection", only `type= "dateTime"\| "dateTimeRange"` works. | boolean | | **0.18.0** |
|
|
|
+| open | Controlled properties displayed or hidden by panels | boolean | | |
|
|
|
+| placeholder | Input box prompts text | string\|string[] | 'Select date' | |
|
|
|
+| position | Floating layer position, optional value with [Popover #API Reference · position](/en-US/show/popover#API%20Reference) | string | 'bottomLeft' | |
|
|
|
+| prefix | Prefix content | string\|ReactNode | | |
|
|
|
+| presets | Date Time Shortcut | <ApiType detail='Array< { start: BaseValueType, end :BaseValueType, text: string } \| () => { start:B aseValueType, end: BaseValueType, text: string }>'>Array</ApiType> | [] | |
|
|
|
+| preventScroll | Indicates whether the browser should scroll the document to display the newly focused element, acting on the focus method inside the component, excluding the component passed in by the user | boolean | | |
|
|
|
+| presetPosition | Date time shortcut panel position, optional 'left', 'right', 'top', 'bottom' | 'bottom' | **2.18.0** |
|
|
|
+| rangeSeparator | Custom range type picker separator of input trigger | string | '~' | **1.31.0**
|
|
|
+| renderDate | Custom date display content | (dayNumber, fullDate) => ReactNode | - | **1.4.0** |
|
|
|
+| renderFullDate | Custom display date box | (dayNumber, fullDate, dayStatus) => ReactNode | - | **1.4.0** |
|
|
|
+| showClear | Do you show the clear button? | boolean | true | **0.35.0** |
|
|
|
+| size | Size, optional: "small," "default," "large" | string | 'default' | |
|
|
|
+| spacing | The distance between the pop-up layer and the children element | number | 4 | **1.9.0** |
|
|
|
+| startDateOffset | When type is dateRange, set the start date of the selected range | (selectedDate?: Date) => Date; | - | **1.10.0** |
|
|
|
+| startYear | start year of the year scroll panel | number | 100 years before current year | **2.36.0** |
|
|
|
+| endYear | end year of the year scroll panel | number | 100 years after current year | **2.36.0** |
|
|
|
+| syncSwitchMonth | In the scene of range, it supports synchronous switching of the month of the dual panel |boolean|false|**1.28.0**|
|
|
|
+| timePickerOpts | For other parameters that can be transparently passed to the time selector, see [TimePicker·API Reference](/en-US/input/timepicker#API%20Reference) | | object | **1.1.0** |
|
|
|
+| topSlot | Render the top extra area | ReactNode | | **1.22.0** |
|
|
|
+| triggerRender | Custom trigger rendering method | (TriggerRenderProps) => ReactNode | | **0.34.0** |
|
|
|
+| type | Type, optional value: "date", "dateRange", "dateTime", "dateTimeRange", "month", "monthRange" | string | 'date' | |
|
|
|
+| value | Controlled value | ValueType | | |
|
|
|
+| weekStartsOn | Take the day of the week as the first day of the week, 0 for Sunday, 1 for Monday, and so on. | number | 0 | |
|
|
|
+| onBlur | Callback when focus is lost. It is not recommended to use this API in range selection | (event) => void | () => {} | **1.0.0** |
|
|
|
+| onCancel | Cancel the callback when selected, enter the reference as the value of the last confirmed selection, only `type` equals "dateTime"or "dateTimeRange" and `needConfirm` equals true | <ApiType detail='(date: DateType, dateStr: StringType) => void'>(date, dateString) => void</ApiType> | | **0.18.0** |
|
|
|
+| onChange | A callback when the value changes | <ApiType detail='(date: DateType, dateString: StringType) => void'>(date, dateString) => void</ApiType> | | |
|
|
|
+| onClear | A callback when click the clear button | (event) => void | () => {} | **1.16.0** |
|
|
|
+| onClickOutSide | When the pop-up layer is in a display state, click the non-popup layer and trigger callback | () => void | () => {} | **2.31.0** |
|
|
|
+| onConfirm | Confirm the callback at the time of selection, enter the reference as the value of the current selection, only `type` equals "dateTime" or "dateTimeRange" and `needConfirm` equals true | <ApiType detail='(date: DateType, dateStr: StringType) => void'>(date, dateString) => void</ApiType>| | **0.18.0** |
|
|
|
+| onFocus | Callback when focus is obtained. It is not recommended to use this API in range selection | (event) => void | () => {} | **1.0.0** |
|
|
|
+| onOpenChange | Callback when popup open or close | (isOpen) => void | | |
|
|
|
+| onPanelChange | Callback when the year or date of the panel is switched | <ApiType detail='(date: DateType \| DateType[], dateStr: StringType \| StringType[])=>void'>(date, dateStr) => void</ApiType> | |**1.28.0**|
|
|
|
+| onPresetClick | Callback when click preset button | <ApiType detail='(item: Object, e: Event) => void'>(item, e) => void</ApiType> | **1.24.0** |
|
|
|
+| yearAndMonthOpts | Other parameters that can be transparently passed to the year-month selector, see details in [ScrollList#API](/zh-CN/show/scrolllist#ScrollItem) | | object | **2.22.0** |
|
|
|
|
|
|
## Methods
|
|
|
|