rsuite 5.71.0 → 5.73.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Accordion/styles/index.css +20 -6
- package/Animation/styles/collapse.less +2 -1
- package/Animation/styles/fade.less +1 -1
- package/Animation/styles/index.css +8 -0
- package/Animation/styles/index.less +1 -0
- package/Animation/styles/variables.less +4 -0
- package/AutoComplete/styles/index.css +11 -0
- package/CHANGELOG.md +34 -0
- package/Calendar/styles/index.css +71 -44
- package/Calendar/styles/index.less +54 -28
- package/Cascader/styles/index.css +11 -0
- package/CheckPicker/styles/index.css +11 -1
- package/CheckTree/styles/index.css +11 -0
- package/CheckTreePicker/styles/index.css +11 -0
- package/DatePicker/styles/index.css +89 -49
- package/DatePicker/styles/index.less +8 -5
- package/DateRangePicker/styles/index.css +93 -54
- package/DateRangePicker/styles/index.less +7 -6
- package/InputPicker/styles/index.css +11 -1
- package/MultiCascadeTree/styles/index.css +11 -0
- package/MultiCascader/styles/index.css +11 -0
- package/Pagination/styles/index.css +11 -1
- package/Panel/styles/index.css +20 -6
- package/SelectPicker/styles/index.css +11 -1
- package/TagInput/styles/index.css +11 -1
- package/TagPicker/styles/index.css +11 -1
- package/TimePicker/package.json +7 -0
- package/TimePicker/styles/index.css +4155 -0
- package/TimePicker/styles/index.less +1 -0
- package/TimeRangePicker/package.json +7 -0
- package/TimeRangePicker/styles/index.css +4255 -0
- package/TimeRangePicker/styles/index.less +1 -0
- package/cjs/Calendar/Calendar.d.ts +1 -1
- package/cjs/Calendar/Calendar.js +22 -26
- package/cjs/Calendar/CalendarBody.js +9 -9
- package/cjs/Calendar/CalendarContainer.d.ts +10 -2
- package/cjs/Calendar/CalendarContainer.js +40 -68
- package/cjs/Calendar/CalendarHeader.d.ts +0 -2
- package/cjs/Calendar/CalendarHeader.js +28 -46
- package/cjs/Calendar/{CalendarContext.d.ts → CalendarProvider.d.ts} +3 -22
- package/cjs/Calendar/CalendarProvider.js +13 -0
- package/cjs/Calendar/Grid/Grid.d.ts +6 -0
- package/cjs/Calendar/{Table.js → Grid/Grid.js} +11 -17
- package/{esm/Calendar/TableCell.d.ts → cjs/Calendar/Grid/GridCell.d.ts} +4 -4
- package/cjs/Calendar/{TableCell.js → Grid/GridCell.js} +13 -13
- package/cjs/Calendar/Grid/GridHeaderRow.d.ts +4 -0
- package/cjs/Calendar/{TableHeaderRow.js → Grid/GridHeaderRow.js} +11 -11
- package/cjs/Calendar/Grid/GridRow.d.ts +7 -0
- package/cjs/Calendar/{TableRow.js → Grid/GridRow.js} +21 -21
- package/cjs/Calendar/Grid/index.d.ts +2 -0
- package/cjs/Calendar/Grid/index.js +8 -0
- package/cjs/Calendar/MonthDropdown/MonthDropdown.d.ts +11 -0
- package/cjs/Calendar/{MonthDropdown.js → MonthDropdown/MonthDropdown.js} +19 -25
- package/cjs/Calendar/{MonthDropdownItem.d.ts → MonthDropdown/MonthDropdownItem.d.ts} +1 -1
- package/cjs/Calendar/{MonthDropdownItem.js → MonthDropdown/MonthDropdownItem.js} +11 -11
- package/cjs/Calendar/MonthDropdown/index.d.ts +2 -0
- package/cjs/Calendar/MonthDropdown/index.js +8 -0
- package/cjs/Calendar/TimeDropdown/TimeColumn.d.ts +8 -0
- package/cjs/Calendar/TimeDropdown/TimeColumn.js +27 -0
- package/{esm/Calendar → cjs/Calendar/TimeDropdown}/TimeDropdown.d.ts +2 -25
- package/cjs/Calendar/{TimeDropdown.js → TimeDropdown/TimeDropdown.js} +79 -112
- package/cjs/Calendar/TimeDropdown/index.d.ts +2 -0
- package/cjs/Calendar/TimeDropdown/index.js +8 -0
- package/cjs/Calendar/TimeDropdown/utils/formatWithLeadingZero.d.ts +1 -0
- package/cjs/Calendar/TimeDropdown/utils/formatWithLeadingZero.js +8 -0
- package/cjs/Calendar/TimeDropdown/utils/getClockTime.d.ts +11 -0
- package/cjs/Calendar/TimeDropdown/utils/getClockTime.js +43 -0
- package/cjs/Calendar/TimeDropdown/utils/getTimeLimits.d.ts +11 -0
- package/cjs/Calendar/TimeDropdown/utils/getTimeLimits.js +24 -0
- package/cjs/Calendar/TimeDropdown/utils/index.d.ts +4 -0
- package/cjs/Calendar/TimeDropdown/utils/index.js +23 -0
- package/cjs/Calendar/TimeDropdown/utils/scrollToTime.d.ts +2 -0
- package/cjs/Calendar/TimeDropdown/utils/scrollToTime.js +28 -0
- package/cjs/Calendar/hooks/index.d.ts +3 -0
- package/cjs/Calendar/hooks/index.js +24 -0
- package/cjs/Calendar/hooks/useCalendar.d.ts +2 -0
- package/cjs/Calendar/hooks/useCalendar.js +10 -0
- package/cjs/Calendar/{useCalendarDate.d.ts → hooks/useCalendarDate.d.ts} +1 -2
- package/cjs/Calendar/{useCalendarDate.js → hooks/useCalendarDate.js} +8 -8
- package/cjs/Calendar/hooks/useCalendarState.d.ts +22 -0
- package/cjs/Calendar/hooks/useCalendarState.js +60 -0
- package/cjs/Calendar/index.d.ts +2 -4
- package/cjs/Calendar/index.js +2 -4
- package/cjs/Calendar/types.d.ts +19 -0
- package/cjs/Calendar/types.js +4 -0
- package/cjs/Calendar/{utils.js → utils/getAriaLabel.js} +1 -1
- package/cjs/Calendar/utils/index.d.ts +2 -0
- package/cjs/Calendar/utils/index.js +9 -0
- package/cjs/Calendar/utils/isEveryDateInMonth.d.ts +1 -0
- package/cjs/Calendar/utils/isEveryDateInMonth.js +15 -0
- package/cjs/CascadeTree/TreeView.js +3 -3
- package/cjs/CustomProvider/CustomProvider.d.ts +38 -4
- package/cjs/CustomProvider/CustomProvider.js +20 -6
- package/cjs/DateInput/DateField.js +2 -2
- package/cjs/DateInput/DateInput.js +17 -6
- package/cjs/DateInput/hooks/useDateInputState.js +1 -1
- package/cjs/DatePicker/DatePicker.d.ts +6 -2
- package/cjs/DatePicker/DatePicker.js +58 -67
- package/cjs/DatePicker/utils.js +1 -1
- package/cjs/DateRangeInput/DateRangeInput.js +16 -5
- package/cjs/DateRangePicker/Calendar.d.ts +4 -5
- package/cjs/DateRangePicker/Calendar.js +18 -44
- package/cjs/DateRangePicker/DateRangePicker.d.ts +21 -4
- package/cjs/DateRangePicker/DateRangePicker.js +98 -72
- package/cjs/DateRangePicker/DateRangePickerProvider.d.ts +10 -0
- package/cjs/DateRangePicker/{DateRangePickerContext.js → DateRangePickerProvider.js} +3 -3
- package/cjs/DateRangePicker/hooks/index.d.ts +3 -0
- package/cjs/DateRangePicker/hooks/index.js +11 -0
- package/cjs/DateRangePicker/hooks/useCalendarHandlers.d.ts +17 -0
- package/cjs/DateRangePicker/hooks/useCalendarHandlers.js +43 -0
- package/cjs/DateRangePicker/hooks/useDateDisabled.d.ts +1 -1
- package/cjs/DateRangePicker/hooks/useDateDisabled.js +1 -0
- package/cjs/DateRangePicker/hooks/useDateRangePicker.d.ts +2 -0
- package/cjs/DateRangePicker/hooks/useDateRangePicker.js +10 -0
- package/cjs/DateRangePicker/utils.js +1 -1
- package/cjs/Dropdown/Dropdown.d.ts +1 -1
- package/cjs/Dropdown/DropdownItem.d.ts +1 -1
- package/cjs/Dropdown/DropdownMenu.d.ts +1 -1
- package/cjs/Dropdown/DropdownMenu.js +3 -3
- package/cjs/Dropdown/DropdownToggle.d.ts +1 -1
- package/cjs/FormHelpText/FormHelpText.js +2 -2
- package/cjs/IconButton/IconButton.d.ts +1 -1
- package/cjs/InlineEdit/renderChildren.d.ts +1 -1
- package/cjs/InlineEdit/renderChildren.js +13 -4
- package/cjs/InlineEdit/useFocusEvent.d.ts +2 -2
- package/cjs/InlineEdit/useFocusEvent.js +9 -4
- package/cjs/MultiCascadeTree/TreeView.js +3 -3
- package/cjs/Nav/NavDropdownItem.d.ts +1 -1
- package/cjs/Nav/NavDropdownMenu.d.ts +1 -1
- package/cjs/Nav/NavDropdownMenu.js +3 -3
- package/cjs/Nav/NavItem.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdown.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdownItem.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdownMenu.d.ts +1 -1
- package/cjs/Navbar/NavbarDropdownMenu.js +3 -3
- package/cjs/Navbar/NavbarItem.d.ts +1 -1
- package/cjs/Pagination/Pagination.js +5 -5
- package/cjs/Panel/AccordionButton.js +2 -2
- package/cjs/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
- package/cjs/Sidenav/ExpandedSidenavDropdownItem.d.ts +1 -1
- package/cjs/Sidenav/ExpandedSidenavDropdownMenu.d.ts +1 -1
- package/cjs/Sidenav/SidenavDropdown.d.ts +1 -1
- package/cjs/Sidenav/SidenavDropdownItem.d.ts +1 -1
- package/cjs/Sidenav/SidenavDropdownMenu.d.ts +1 -1
- package/cjs/Sidenav/SidenavItem.d.ts +1 -1
- package/cjs/Sidenav/SidenavToggle.js +3 -3
- package/cjs/Steps/StepItem.d.ts +1 -1
- package/cjs/TimePicker/TimePicker.d.ts +81 -0
- package/cjs/TimePicker/TimePicker.js +31 -0
- package/cjs/TimePicker/index.d.ts +3 -0
- package/cjs/TimePicker/index.js +8 -0
- package/cjs/TimeRangePicker/TimeRangePicker.d.ts +77 -0
- package/cjs/TimeRangePicker/TimeRangePicker.js +23 -0
- package/cjs/TimeRangePicker/index.d.ts +3 -0
- package/cjs/TimeRangePicker/index.js +8 -0
- package/cjs/index.d.ts +4 -0
- package/cjs/index.js +6 -1
- package/cjs/internals/Picker/ListItemGroup.js +1 -1
- package/cjs/internals/Picker/Listbox.js +4 -2
- package/cjs/internals/Picker/PickerIndicator.js +2 -2
- package/cjs/internals/Picker/PickerToggle.d.ts +1 -1
- package/cjs/internals/SearchBox/SearchBox.js +1 -1
- package/cjs/internals/constants/statusIcons.js +7 -7
- package/cjs/internals/hooks/useCustom.js +2 -2
- package/cjs/internals/hooks/useToggleCaret.d.ts +1 -1
- package/cjs/internals/utils/date/extractTimeFormat.d.ts +4 -0
- package/cjs/internals/utils/date/extractTimeFormat.js +12 -0
- package/cjs/internals/utils/date/formatCheck.d.ts +4 -0
- package/cjs/internals/utils/date/formatCheck.js +8 -1
- package/cjs/internals/utils/date/index.d.ts +4 -2
- package/cjs/internals/utils/date/index.js +72 -7
- package/cjs/internals/utils/date/useDateMode.d.ts +16 -0
- package/cjs/internals/utils/date/useDateMode.js +57 -0
- package/cjs/internals/utils/index.d.ts +0 -1
- package/cjs/internals/utils/index.js +1 -4
- package/cjs/locales/ar_EG.d.ts +10 -0
- package/cjs/locales/ar_EG.js +8 -4
- package/cjs/locales/ca_ES.d.ts +10 -0
- package/cjs/locales/ca_ES.js +8 -4
- package/cjs/locales/cs_CZ.d.ts +10 -0
- package/cjs/locales/cs_CZ.js +8 -4
- package/cjs/locales/da_DK.d.ts +10 -0
- package/cjs/locales/da_DK.js +8 -4
- package/cjs/locales/de_DE.d.ts +10 -0
- package/cjs/locales/de_DE.js +8 -4
- package/cjs/locales/en_GB.d.ts +130 -2
- package/cjs/locales/en_GB.js +85 -2
- package/cjs/locales/en_US.d.ts +10 -0
- package/cjs/locales/en_US.js +8 -4
- package/cjs/locales/es_AR.d.ts +10 -0
- package/cjs/locales/es_AR.js +8 -4
- package/cjs/locales/es_ES.d.ts +10 -0
- package/cjs/locales/es_ES.js +8 -4
- package/cjs/locales/fa_IR.d.ts +10 -0
- package/cjs/locales/fa_IR.js +8 -4
- package/cjs/locales/fi_FI.d.ts +10 -0
- package/cjs/locales/fi_FI.js +8 -4
- package/cjs/locales/fr_FR.d.ts +10 -0
- package/cjs/locales/fr_FR.js +8 -4
- package/cjs/locales/hu_HU.d.ts +12 -0
- package/cjs/locales/hu_HU.js +11 -5
- package/cjs/locales/index.d.ts +1 -1
- package/cjs/locales/it_IT.d.ts +10 -0
- package/cjs/locales/it_IT.js +8 -4
- package/cjs/locales/ja_JP.d.ts +10 -0
- package/cjs/locales/ja_JP.js +8 -4
- package/cjs/locales/kk_KZ.d.ts +10 -0
- package/cjs/locales/kk_KZ.js +8 -4
- package/cjs/locales/ko_KR.d.ts +10 -0
- package/cjs/locales/ko_KR.js +8 -4
- package/cjs/locales/ne_NP.d.ts +10 -0
- package/cjs/locales/ne_NP.js +8 -4
- package/cjs/locales/nl_NL.d.ts +10 -0
- package/cjs/locales/nl_NL.js +8 -4
- package/cjs/locales/pt_BR.d.ts +10 -0
- package/cjs/locales/pt_BR.js +8 -4
- package/cjs/locales/ru_RU.d.ts +10 -0
- package/cjs/locales/ru_RU.js +8 -4
- package/cjs/locales/sv_SE.d.ts +10 -0
- package/cjs/locales/sv_SE.js +8 -4
- package/cjs/locales/tr_TR.d.ts +10 -0
- package/cjs/locales/tr_TR.js +8 -4
- package/cjs/locales/zh_CN.d.ts +10 -0
- package/cjs/locales/zh_CN.js +8 -4
- package/cjs/locales/zh_TW.d.ts +10 -0
- package/cjs/locales/zh_TW.js +8 -4
- package/dist/rsuite-no-reset-rtl.css +116 -60
- package/dist/rsuite-no-reset-rtl.min.css +1 -1
- package/dist/rsuite-no-reset-rtl.min.css.map +1 -1
- package/dist/rsuite-no-reset.css +116 -60
- package/dist/rsuite-no-reset.min.css +1 -1
- package/dist/rsuite-no-reset.min.css.map +1 -1
- package/dist/rsuite-rtl.css +116 -60
- package/dist/rsuite-rtl.min.css +1 -1
- package/dist/rsuite-rtl.min.css.map +1 -1
- package/dist/rsuite.css +116 -60
- package/dist/rsuite.js +822 -5375
- package/dist/rsuite.js.map +1 -1
- package/dist/rsuite.min.css +1 -1
- package/dist/rsuite.min.css.map +1 -1
- package/dist/rsuite.min.js +1 -1
- package/dist/rsuite.min.js.map +1 -1
- package/esm/Calendar/Calendar.d.ts +1 -1
- package/esm/Calendar/Calendar.js +21 -23
- package/esm/Calendar/CalendarBody.js +9 -9
- package/esm/Calendar/CalendarContainer.d.ts +10 -2
- package/esm/Calendar/CalendarContainer.js +42 -70
- package/esm/Calendar/CalendarHeader.d.ts +0 -2
- package/esm/Calendar/CalendarHeader.js +29 -47
- package/esm/Calendar/{CalendarContext.d.ts → CalendarProvider.d.ts} +3 -22
- package/esm/Calendar/CalendarProvider.js +9 -0
- package/esm/Calendar/Grid/Grid.d.ts +6 -0
- package/esm/Calendar/{Table.js → Grid/Grid.js} +11 -17
- package/{cjs/Calendar/TableCell.d.ts → esm/Calendar/Grid/GridCell.d.ts} +4 -4
- package/esm/Calendar/{TableCell.js → Grid/GridCell.js} +13 -13
- package/esm/Calendar/Grid/GridHeaderRow.d.ts +4 -0
- package/esm/Calendar/{TableHeaderRow.js → Grid/GridHeaderRow.js} +11 -11
- package/esm/Calendar/Grid/GridRow.d.ts +7 -0
- package/esm/Calendar/{TableRow.js → Grid/GridRow.js} +21 -21
- package/esm/Calendar/Grid/index.d.ts +2 -0
- package/esm/Calendar/Grid/index.js +3 -0
- package/esm/Calendar/MonthDropdown/MonthDropdown.d.ts +11 -0
- package/esm/Calendar/{MonthDropdown.js → MonthDropdown/MonthDropdown.js} +18 -23
- package/esm/Calendar/{MonthDropdownItem.d.ts → MonthDropdown/MonthDropdownItem.d.ts} +1 -1
- package/esm/Calendar/{MonthDropdownItem.js → MonthDropdown/MonthDropdownItem.js} +12 -12
- package/esm/Calendar/MonthDropdown/index.d.ts +2 -0
- package/esm/Calendar/MonthDropdown/index.js +3 -0
- package/esm/Calendar/TimeDropdown/TimeColumn.d.ts +8 -0
- package/esm/Calendar/TimeDropdown/TimeColumn.js +22 -0
- package/{cjs/Calendar → esm/Calendar/TimeDropdown}/TimeDropdown.d.ts +2 -25
- package/esm/Calendar/TimeDropdown/TimeDropdown.js +161 -0
- package/esm/Calendar/TimeDropdown/index.d.ts +2 -0
- package/esm/Calendar/TimeDropdown/index.js +3 -0
- package/esm/Calendar/TimeDropdown/utils/formatWithLeadingZero.d.ts +1 -0
- package/esm/Calendar/TimeDropdown/utils/formatWithLeadingZero.js +4 -0
- package/esm/Calendar/TimeDropdown/utils/getClockTime.d.ts +11 -0
- package/esm/Calendar/TimeDropdown/utils/getClockTime.js +39 -0
- package/esm/Calendar/TimeDropdown/utils/getTimeLimits.d.ts +11 -0
- package/esm/Calendar/TimeDropdown/utils/getTimeLimits.js +20 -0
- package/esm/Calendar/TimeDropdown/utils/index.d.ts +4 -0
- package/esm/Calendar/TimeDropdown/utils/index.js +5 -0
- package/esm/Calendar/TimeDropdown/utils/scrollToTime.d.ts +2 -0
- package/esm/Calendar/TimeDropdown/utils/scrollToTime.js +23 -0
- package/esm/Calendar/hooks/index.d.ts +3 -0
- package/esm/Calendar/hooks/index.js +4 -0
- package/esm/Calendar/hooks/useCalendar.d.ts +2 -0
- package/esm/Calendar/hooks/useCalendar.js +6 -0
- package/esm/Calendar/{useCalendarDate.d.ts → hooks/useCalendarDate.d.ts} +1 -2
- package/esm/Calendar/{useCalendarDate.js → hooks/useCalendarDate.js} +7 -7
- package/esm/Calendar/hooks/useCalendarState.d.ts +22 -0
- package/esm/Calendar/hooks/useCalendarState.js +56 -0
- package/esm/Calendar/index.d.ts +2 -4
- package/esm/Calendar/index.js +2 -3
- package/esm/Calendar/types.d.ts +19 -0
- package/esm/Calendar/types.js +2 -0
- package/esm/Calendar/{utils.js → utils/getAriaLabel.js} +1 -1
- package/esm/Calendar/utils/index.d.ts +2 -0
- package/esm/Calendar/utils/index.js +3 -0
- package/esm/Calendar/utils/isEveryDateInMonth.d.ts +1 -0
- package/esm/Calendar/utils/isEveryDateInMonth.js +11 -0
- package/esm/CascadeTree/TreeView.js +3 -3
- package/esm/CustomProvider/CustomProvider.d.ts +38 -4
- package/esm/CustomProvider/CustomProvider.js +20 -6
- package/esm/DateInput/DateField.js +2 -2
- package/esm/DateInput/DateInput.js +17 -6
- package/esm/DateInput/hooks/useDateInputState.js +1 -1
- package/esm/DatePicker/DatePicker.d.ts +6 -2
- package/esm/DatePicker/DatePicker.js +30 -38
- package/esm/DatePicker/hooks/useFocus.js +1 -1
- package/esm/DatePicker/utils.js +2 -2
- package/esm/DateRangeInput/DateRangeInput.js +16 -5
- package/esm/DateRangePicker/Calendar.d.ts +4 -5
- package/esm/DateRangePicker/Calendar.js +19 -47
- package/esm/DateRangePicker/DateRangePicker.d.ts +21 -4
- package/esm/DateRangePicker/DateRangePicker.js +99 -73
- package/esm/DateRangePicker/DateRangePickerProvider.d.ts +10 -0
- package/esm/DateRangePicker/{DateRangePickerContext.js → DateRangePickerProvider.js} +2 -2
- package/esm/DateRangePicker/hooks/index.d.ts +3 -0
- package/esm/DateRangePicker/hooks/index.js +4 -0
- package/esm/DateRangePicker/hooks/useCalendarHandlers.d.ts +17 -0
- package/esm/DateRangePicker/hooks/useCalendarHandlers.js +38 -0
- package/esm/DateRangePicker/hooks/useDateDisabled.d.ts +1 -1
- package/esm/DateRangePicker/hooks/useDateDisabled.js +1 -1
- package/esm/DateRangePicker/hooks/useDateRangePicker.d.ts +2 -0
- package/esm/DateRangePicker/hooks/useDateRangePicker.js +6 -0
- package/esm/DateRangePicker/utils.js +2 -2
- package/esm/Dropdown/Dropdown.d.ts +1 -1
- package/esm/Dropdown/DropdownItem.d.ts +1 -1
- package/esm/Dropdown/DropdownMenu.d.ts +1 -1
- package/esm/Dropdown/DropdownMenu.js +3 -3
- package/esm/Dropdown/DropdownToggle.d.ts +1 -1
- package/esm/FormHelpText/FormHelpText.js +2 -2
- package/esm/IconButton/IconButton.d.ts +1 -1
- package/esm/InlineEdit/renderChildren.d.ts +1 -1
- package/esm/InlineEdit/renderChildren.js +13 -4
- package/esm/InlineEdit/useFocusEvent.d.ts +2 -2
- package/esm/InlineEdit/useFocusEvent.js +9 -4
- package/esm/MultiCascadeTree/TreeView.js +3 -3
- package/esm/Nav/NavDropdownItem.d.ts +1 -1
- package/esm/Nav/NavDropdownMenu.d.ts +1 -1
- package/esm/Nav/NavDropdownMenu.js +3 -3
- package/esm/Nav/NavItem.d.ts +1 -1
- package/esm/Navbar/NavbarDropdown.d.ts +1 -1
- package/esm/Navbar/NavbarDropdownItem.d.ts +1 -1
- package/esm/Navbar/NavbarDropdownMenu.d.ts +1 -1
- package/esm/Navbar/NavbarDropdownMenu.js +3 -3
- package/esm/Navbar/NavbarItem.d.ts +1 -1
- package/esm/Pagination/Pagination.js +10 -10
- package/esm/Panel/AccordionButton.js +1 -1
- package/esm/Sidenav/ExpandedSidenavDropdown.d.ts +1 -1
- package/esm/Sidenav/ExpandedSidenavDropdownItem.d.ts +1 -1
- package/esm/Sidenav/ExpandedSidenavDropdownMenu.d.ts +1 -1
- package/esm/Sidenav/SidenavDropdown.d.ts +1 -1
- package/esm/Sidenav/SidenavDropdownItem.d.ts +1 -1
- package/esm/Sidenav/SidenavDropdownMenu.d.ts +1 -1
- package/esm/Sidenav/SidenavItem.d.ts +1 -1
- package/esm/Sidenav/SidenavToggle.js +3 -3
- package/esm/Steps/StepItem.d.ts +1 -1
- package/esm/TimePicker/TimePicker.d.ts +81 -0
- package/esm/TimePicker/TimePicker.js +24 -0
- package/esm/TimePicker/index.d.ts +3 -0
- package/esm/TimePicker/index.js +3 -0
- package/esm/TimeRangePicker/TimeRangePicker.d.ts +77 -0
- package/esm/TimeRangePicker/TimeRangePicker.js +18 -0
- package/esm/TimeRangePicker/index.d.ts +3 -0
- package/esm/TimeRangePicker/index.js +3 -0
- package/esm/index.d.ts +4 -0
- package/esm/index.js +2 -0
- package/esm/internals/Picker/ListItemGroup.js +2 -2
- package/esm/internals/Picker/Listbox.js +4 -2
- package/esm/internals/Picker/PickerIndicator.js +1 -1
- package/esm/internals/Picker/PickerToggle.d.ts +1 -1
- package/esm/internals/SearchBox/SearchBox.js +2 -2
- package/esm/internals/constants/statusIcons.js +7 -7
- package/esm/internals/hooks/useCustom.js +1 -1
- package/esm/internals/hooks/useToggleCaret.d.ts +1 -1
- package/esm/internals/utils/date/extractTimeFormat.d.ts +4 -0
- package/esm/internals/utils/date/extractTimeFormat.js +8 -0
- package/esm/internals/utils/date/formatCheck.d.ts +4 -0
- package/esm/internals/utils/date/formatCheck.js +7 -0
- package/esm/internals/utils/date/index.d.ts +4 -2
- package/esm/internals/utils/date/index.js +4 -2
- package/esm/internals/utils/date/useDateMode.d.ts +16 -0
- package/esm/internals/utils/date/useDateMode.js +54 -0
- package/esm/internals/utils/index.d.ts +0 -1
- package/esm/internals/utils/index.js +0 -1
- package/esm/locales/ar_EG.d.ts +10 -0
- package/esm/locales/ar_EG.js +8 -4
- package/esm/locales/ca_ES.d.ts +10 -0
- package/esm/locales/ca_ES.js +8 -4
- package/esm/locales/cs_CZ.d.ts +10 -0
- package/esm/locales/cs_CZ.js +8 -4
- package/esm/locales/da_DK.d.ts +10 -0
- package/esm/locales/da_DK.js +8 -4
- package/esm/locales/de_DE.d.ts +10 -0
- package/esm/locales/de_DE.js +8 -4
- package/esm/locales/en_GB.d.ts +130 -2
- package/esm/locales/en_GB.js +85 -2
- package/esm/locales/en_US.d.ts +10 -0
- package/esm/locales/en_US.js +8 -4
- package/esm/locales/es_AR.d.ts +10 -0
- package/esm/locales/es_AR.js +8 -4
- package/esm/locales/es_ES.d.ts +10 -0
- package/esm/locales/es_ES.js +8 -4
- package/esm/locales/fa_IR.d.ts +10 -0
- package/esm/locales/fa_IR.js +8 -4
- package/esm/locales/fi_FI.d.ts +10 -0
- package/esm/locales/fi_FI.js +8 -4
- package/esm/locales/fr_FR.d.ts +10 -0
- package/esm/locales/fr_FR.js +8 -4
- package/esm/locales/hu_HU.d.ts +12 -0
- package/esm/locales/hu_HU.js +11 -5
- package/esm/locales/index.d.ts +1 -1
- package/esm/locales/it_IT.d.ts +10 -0
- package/esm/locales/it_IT.js +8 -4
- package/esm/locales/ja_JP.d.ts +10 -0
- package/esm/locales/ja_JP.js +8 -4
- package/esm/locales/kk_KZ.d.ts +10 -0
- package/esm/locales/kk_KZ.js +8 -4
- package/esm/locales/ko_KR.d.ts +10 -0
- package/esm/locales/ko_KR.js +8 -4
- package/esm/locales/ne_NP.d.ts +10 -0
- package/esm/locales/ne_NP.js +8 -4
- package/esm/locales/nl_NL.d.ts +10 -0
- package/esm/locales/nl_NL.js +8 -4
- package/esm/locales/pt_BR.d.ts +10 -0
- package/esm/locales/pt_BR.js +8 -4
- package/esm/locales/ru_RU.d.ts +10 -0
- package/esm/locales/ru_RU.js +8 -4
- package/esm/locales/sv_SE.d.ts +10 -0
- package/esm/locales/sv_SE.js +8 -4
- package/esm/locales/tr_TR.d.ts +10 -0
- package/esm/locales/tr_TR.js +8 -4
- package/esm/locales/zh_CN.d.ts +10 -0
- package/esm/locales/zh_CN.js +8 -4
- package/esm/locales/zh_TW.d.ts +10 -0
- package/esm/locales/zh_TW.js +8 -4
- package/internals/Picker/styles/index.less +17 -0
- package/internals/Picker/styles/mixin.less +0 -1
- package/internals/ScrollView/styles/index.less +1 -5
- package/package.json +2 -2
- package/styles/color-modes/dark.less +5 -0
- package/styles/color-modes/high-contrast.less +5 -0
- package/styles/color-modes/light.less +5 -0
- package/styles/common.less +3 -3
- package/styles/variables.less +3 -3
- package/cjs/Calendar/CalendarContext.js +0 -22
- package/cjs/Calendar/MonthDropdown.d.ts +0 -27
- package/cjs/Calendar/Table.d.ts +0 -6
- package/cjs/Calendar/TableHeaderRow.d.ts +0 -4
- package/cjs/Calendar/TableRow.d.ts +0 -7
- package/cjs/Calendar/useCalendarState.d.ts +0 -11
- package/cjs/Calendar/useCalendarState.js +0 -32
- package/cjs/DateRangePicker/DateRangePickerContext.d.ts +0 -10
- package/cjs/internals/utils/date/getReversedTimeMeridian.d.ts +0 -8
- package/cjs/internals/utils/date/getReversedTimeMeridian.js +0 -21
- package/cjs/internals/utils/scrollTopAnimation.d.ts +0 -5
- package/cjs/internals/utils/scrollTopAnimation.js +0 -32
- package/cjs/locales/default.d.ts +0 -120
- package/cjs/locales/default.js +0 -87
- package/esm/Calendar/CalendarContext.js +0 -17
- package/esm/Calendar/MonthDropdown.d.ts +0 -27
- package/esm/Calendar/Table.d.ts +0 -6
- package/esm/Calendar/TableHeaderRow.d.ts +0 -4
- package/esm/Calendar/TableRow.d.ts +0 -7
- package/esm/Calendar/TimeDropdown.js +0 -192
- package/esm/Calendar/useCalendarState.d.ts +0 -11
- package/esm/Calendar/useCalendarState.js +0 -28
- package/esm/DateRangePicker/DateRangePickerContext.d.ts +0 -10
- package/esm/internals/utils/date/getReversedTimeMeridian.d.ts +0 -8
- package/esm/internals/utils/date/getReversedTimeMeridian.js +0 -17
- package/esm/internals/utils/scrollTopAnimation.d.ts +0 -5
- package/esm/internals/utils/scrollTopAnimation.js +0 -27
- package/esm/locales/default.d.ts +0 -120
- package/esm/locales/default.js +0 -82
- package/locales/default/package.json +0 -7
- /package/cjs/Calendar/{utils.d.ts → utils/getAriaLabel.d.ts} +0 -0
- /package/esm/Calendar/{utils.d.ts → utils/getAriaLabel.d.ts} +0 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
export function getTimeLimits(isMeridiem) {
|
|
3
|
+
var HOURS_24H = {
|
|
4
|
+
start: 0,
|
|
5
|
+
end: 23
|
|
6
|
+
};
|
|
7
|
+
var HOURS_12H = {
|
|
8
|
+
start: 0,
|
|
9
|
+
end: 11
|
|
10
|
+
};
|
|
11
|
+
var MINUTES_SECONDS = {
|
|
12
|
+
start: 0,
|
|
13
|
+
end: 59
|
|
14
|
+
};
|
|
15
|
+
return {
|
|
16
|
+
hours: isMeridiem ? HOURS_12H : HOURS_24H,
|
|
17
|
+
minutes: MINUTES_SECONDS,
|
|
18
|
+
seconds: MINUTES_SECONDS
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import getPosition from 'dom-lib/getPosition';
|
|
3
|
+
import scrollTop from 'dom-lib/scrollTop';
|
|
4
|
+
export function scrollToTime(time, row) {
|
|
5
|
+
if (!row) return;
|
|
6
|
+
var scrollToPosition = function scrollToPosition(container, value, type) {
|
|
7
|
+
var node = container.querySelector("[data-key=\"" + type + "-" + value + "\"]");
|
|
8
|
+
if (node) {
|
|
9
|
+
var position = getPosition(node, container);
|
|
10
|
+
if (position) {
|
|
11
|
+
scrollTop(container, position.top);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
Object.entries(time).forEach(function (_ref) {
|
|
16
|
+
var type = _ref[0],
|
|
17
|
+
value = _ref[1];
|
|
18
|
+
var container = row.querySelector("[data-type=\"" + type + "\"]");
|
|
19
|
+
if (container) {
|
|
20
|
+
scrollToPosition(container, value, type);
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
declare const useCalendarDate: (value: Date | null | undefined, defaultDate: Date | undefined) => {
|
|
1
|
+
export declare const useCalendarDate: (value: Date | null | undefined, defaultDate: Date | undefined) => {
|
|
2
2
|
calendarDate: Date;
|
|
3
3
|
setCalendarDate: (date: React.SetStateAction<Date> | undefined) => void;
|
|
4
4
|
resetCalendarDate: (nextValue?: any) => void;
|
|
5
5
|
};
|
|
6
|
-
export default useCalendarDate;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useState, useCallback, useRef } from 'react';
|
|
3
|
-
import { useUpdateEffect } from "
|
|
4
|
-
|
|
3
|
+
import { useUpdateEffect } from "../../internals/hooks/index.js";
|
|
4
|
+
import { startOfToday } from "../../internals/utils/date/index.js";
|
|
5
|
+
export var useCalendarDate = function useCalendarDate(value, defaultDate) {
|
|
5
6
|
var _ref;
|
|
6
7
|
var valueRef = useRef(value);
|
|
7
|
-
var _useState = useState((_ref = value !== null && value !== void 0 ? value : defaultDate) !== null && _ref !== void 0 ? _ref :
|
|
8
|
+
var _useState = useState((_ref = value !== null && value !== void 0 ? value : defaultDate) !== null && _ref !== void 0 ? _ref : startOfToday()),
|
|
8
9
|
calendarDate = _useState[0],
|
|
9
10
|
setValue = _useState[1];
|
|
10
11
|
var setCalendarDate = useCallback(function (date) {
|
|
@@ -17,13 +18,13 @@ var useCalendarDate = function useCalendarDate(value, defaultDate) {
|
|
|
17
18
|
if (nextValue === void 0) {
|
|
18
19
|
nextValue = value;
|
|
19
20
|
}
|
|
20
|
-
setValue((_ref2 = (_nextValue = nextValue) !== null && _nextValue !== void 0 ? _nextValue : defaultDate) !== null && _ref2 !== void 0 ? _ref2 :
|
|
21
|
+
setValue((_ref2 = (_nextValue = nextValue) !== null && _nextValue !== void 0 ? _nextValue : defaultDate) !== null && _ref2 !== void 0 ? _ref2 : startOfToday());
|
|
21
22
|
}, [defaultDate, value]);
|
|
22
23
|
useUpdateEffect(function () {
|
|
23
24
|
var _valueRef$current;
|
|
24
25
|
if ((value === null || value === void 0 ? void 0 : value.valueOf()) !== ((_valueRef$current = valueRef.current) === null || _valueRef$current === void 0 ? void 0 : _valueRef$current.valueOf())) {
|
|
25
26
|
var _ref3;
|
|
26
|
-
setCalendarDate((_ref3 = value !== null && value !== void 0 ? value : defaultDate) !== null && _ref3 !== void 0 ? _ref3 :
|
|
27
|
+
setCalendarDate((_ref3 = value !== null && value !== void 0 ? value : defaultDate) !== null && _ref3 !== void 0 ? _ref3 : startOfToday());
|
|
27
28
|
valueRef.current = value;
|
|
28
29
|
}
|
|
29
30
|
}, [value, defaultDate]);
|
|
@@ -32,5 +33,4 @@ var useCalendarDate = function useCalendarDate(value, defaultDate) {
|
|
|
32
33
|
setCalendarDate: setCalendarDate,
|
|
33
34
|
resetCalendarDate: resetCalendarDate
|
|
34
35
|
};
|
|
35
|
-
};
|
|
36
|
-
export default useCalendarDate;
|
|
36
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare enum CalendarState {
|
|
2
|
+
'TIME' = "TIME",
|
|
3
|
+
'MONTH' = "MONTH"
|
|
4
|
+
}
|
|
5
|
+
export interface CalendarStateProps {
|
|
6
|
+
defaultState?: CalendarState;
|
|
7
|
+
calendarDate: Date;
|
|
8
|
+
onMoveForward?: (date: Date) => void;
|
|
9
|
+
onMoveBackward?: (date: Date) => void;
|
|
10
|
+
onToggleTimeDropdown?: (toggle: boolean) => void;
|
|
11
|
+
onToggleMonthDropdown?: (toggle: boolean) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const useCalendarState: (props: CalendarStateProps) => {
|
|
14
|
+
calendarState: CalendarState | undefined;
|
|
15
|
+
handlers: {
|
|
16
|
+
onMoveForward: (...args: any[]) => any;
|
|
17
|
+
onMoveBackward: (...args: any[]) => any;
|
|
18
|
+
onToggleTimeDropdown: (...args: any[]) => any;
|
|
19
|
+
onToggleMonthDropdown: (...args: any[]) => any;
|
|
20
|
+
};
|
|
21
|
+
reset: () => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { useCallback, useMemo, useState } from 'react';
|
|
3
|
+
import { addMonths } from "../../internals/utils/date/index.js";
|
|
4
|
+
import { useEventCallback } from "../../internals/hooks/index.js";
|
|
5
|
+
export var CalendarState = /*#__PURE__*/function (CalendarState) {
|
|
6
|
+
CalendarState["TIME"] = "TIME";
|
|
7
|
+
CalendarState["MONTH"] = "MONTH";
|
|
8
|
+
return CalendarState;
|
|
9
|
+
}({});
|
|
10
|
+
export var useCalendarState = function useCalendarState(props) {
|
|
11
|
+
var _useState = useState(props.defaultState),
|
|
12
|
+
calendarState = _useState[0],
|
|
13
|
+
setCalendarState = _useState[1];
|
|
14
|
+
var reset = useCallback(function () {
|
|
15
|
+
setCalendarState(undefined);
|
|
16
|
+
}, []);
|
|
17
|
+
var onMoveForward = useEventCallback(function () {
|
|
18
|
+
var _props$onMoveForward;
|
|
19
|
+
(_props$onMoveForward = props.onMoveForward) === null || _props$onMoveForward === void 0 ? void 0 : _props$onMoveForward.call(props, addMonths(props.calendarDate, 1));
|
|
20
|
+
});
|
|
21
|
+
var onMoveBackward = useEventCallback(function () {
|
|
22
|
+
var _props$onMoveBackward;
|
|
23
|
+
(_props$onMoveBackward = props.onMoveBackward) === null || _props$onMoveBackward === void 0 ? void 0 : _props$onMoveBackward.call(props, addMonths(props.calendarDate, -1));
|
|
24
|
+
});
|
|
25
|
+
var onToggleTimeDropdown = useEventCallback(function () {
|
|
26
|
+
var _props$onToggleTimeDr;
|
|
27
|
+
if (calendarState === CalendarState.TIME) {
|
|
28
|
+
reset();
|
|
29
|
+
} else {
|
|
30
|
+
setCalendarState(CalendarState.TIME);
|
|
31
|
+
}
|
|
32
|
+
(_props$onToggleTimeDr = props.onToggleTimeDropdown) === null || _props$onToggleTimeDr === void 0 ? void 0 : _props$onToggleTimeDr.call(props, calendarState !== CalendarState.TIME);
|
|
33
|
+
});
|
|
34
|
+
var onToggleMonthDropdown = useEventCallback(function () {
|
|
35
|
+
var _props$onToggleMonthD;
|
|
36
|
+
if (calendarState === CalendarState.MONTH) {
|
|
37
|
+
reset();
|
|
38
|
+
} else {
|
|
39
|
+
setCalendarState(CalendarState.MONTH);
|
|
40
|
+
}
|
|
41
|
+
(_props$onToggleMonthD = props.onToggleMonthDropdown) === null || _props$onToggleMonthD === void 0 ? void 0 : _props$onToggleMonthD.call(props, calendarState !== CalendarState.MONTH);
|
|
42
|
+
});
|
|
43
|
+
var handlers = useMemo(function () {
|
|
44
|
+
return {
|
|
45
|
+
onMoveForward: onMoveForward,
|
|
46
|
+
onMoveBackward: onMoveBackward,
|
|
47
|
+
onToggleTimeDropdown: onToggleTimeDropdown,
|
|
48
|
+
onToggleMonthDropdown: onToggleMonthDropdown
|
|
49
|
+
};
|
|
50
|
+
}, [onMoveBackward, onMoveForward, onToggleMonthDropdown, onToggleTimeDropdown]);
|
|
51
|
+
return {
|
|
52
|
+
calendarState: calendarState,
|
|
53
|
+
handlers: handlers,
|
|
54
|
+
reset: reset
|
|
55
|
+
};
|
|
56
|
+
};
|
package/esm/Calendar/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import Calendar from './Calendar';
|
|
2
2
|
import CalendarContainer from './CalendarContainer';
|
|
3
|
-
import { CalendarState } from './
|
|
4
|
-
|
|
5
|
-
export { CalendarContainer, CalendarContext, CalendarState };
|
|
6
|
-
export type { CalendarContextValue };
|
|
3
|
+
import { CalendarState } from './hooks';
|
|
4
|
+
export { CalendarContainer, CalendarState };
|
|
7
5
|
export type { CalendarProps } from './Calendar';
|
|
8
6
|
export default Calendar;
|
package/esm/Calendar/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import Calendar from "./Calendar.js";
|
|
3
3
|
import CalendarContainer from "./CalendarContainer.js";
|
|
4
|
-
import { CalendarState } from "./
|
|
5
|
-
|
|
6
|
-
export { CalendarContainer, CalendarContext, CalendarState };
|
|
4
|
+
import { CalendarState } from "./hooks/index.js";
|
|
5
|
+
export { CalendarContainer, CalendarState };
|
|
7
6
|
export default Calendar;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { FixedSizeListProps } from '../internals/Windowing';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the MonthDropdown component.
|
|
5
|
+
*/
|
|
6
|
+
export interface MonthDropdownProps extends Partial<FixedSizeListProps> {
|
|
7
|
+
/**
|
|
8
|
+
* The HTML element or React component to render as the root element of the MonthDropdown.
|
|
9
|
+
*/
|
|
10
|
+
as?: React.ElementType;
|
|
11
|
+
/**
|
|
12
|
+
* The HTML element or React component to render as each item in the MonthDropdown.
|
|
13
|
+
*/
|
|
14
|
+
itemAs?: React.ElementType;
|
|
15
|
+
/**
|
|
16
|
+
* The CSS class name to apply to each item in the MonthDropdown.
|
|
17
|
+
*/
|
|
18
|
+
itemClassName?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isEveryDateInMonth(year: number, month: number, predicate: (date: Date) => boolean): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
import { getDaysInMonth } from "../../internals/utils/date/index.js";
|
|
3
|
+
export function isEveryDateInMonth(year, month, predicate) {
|
|
4
|
+
var days = getDaysInMonth(new Date(year, month));
|
|
5
|
+
for (var i = 1; i <= days; i++) {
|
|
6
|
+
if (!predicate(new Date(year, month, i))) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
return true;
|
|
11
|
+
}
|
|
@@ -9,8 +9,8 @@ import isNil from 'lodash/isNil';
|
|
|
9
9
|
import { shallowEqual, mergeRefs } from "../internals/utils/index.js";
|
|
10
10
|
import { useClassNames, useCustom, useEventCallback } from "../internals/hooks/index.js";
|
|
11
11
|
import { ListItem, useCombobox } from "../internals/Picker/index.js";
|
|
12
|
-
import
|
|
13
|
-
import
|
|
12
|
+
import PagePreviousIcon from '@rsuite/icons/PagePrevious';
|
|
13
|
+
import PageNextIcon from '@rsuite/icons/PageNext';
|
|
14
14
|
import getPosition from 'dom-lib/getPosition';
|
|
15
15
|
import scrollTop from 'dom-lib/scrollTop';
|
|
16
16
|
var emptyArray = [];
|
|
@@ -110,7 +110,7 @@ var TreeView = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
110
110
|
|
|
111
111
|
// Use `value` in keys when If `value` is string or number
|
|
112
112
|
var onlyKey = typeof value === 'number' || typeof value === 'string' ? value : index;
|
|
113
|
-
var Icon = loading ? SpinnerIcon : rtl ?
|
|
113
|
+
var Icon = loading ? SpinnerIcon : rtl ? PagePreviousIcon : PageNextIcon;
|
|
114
114
|
return /*#__PURE__*/React.createElement(ListItem, {
|
|
115
115
|
as: 'li',
|
|
116
116
|
role: "treeitem",
|
|
@@ -102,16 +102,41 @@ export interface CustomValue<T = Locale> {
|
|
|
102
102
|
disableRipple?: boolean;
|
|
103
103
|
}
|
|
104
104
|
export interface CustomProviderProps<T = Locale> extends Partial<CustomValue<T>> {
|
|
105
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* Supported themes
|
|
107
|
+
*/
|
|
106
108
|
theme?: 'light' | 'dark' | 'high-contrast';
|
|
107
|
-
/**
|
|
109
|
+
/**
|
|
110
|
+
* The prefix of the component CSS class
|
|
111
|
+
*/
|
|
108
112
|
classPrefix?: string;
|
|
109
|
-
/**
|
|
113
|
+
/**
|
|
114
|
+
* The prefix of the icon CSS class
|
|
115
|
+
*/
|
|
116
|
+
iconClassPrefix?: string;
|
|
117
|
+
/**
|
|
118
|
+
* Primary content
|
|
119
|
+
*/
|
|
110
120
|
children?: React.ReactNode;
|
|
111
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Sets a container for toast rendering
|
|
123
|
+
*/
|
|
112
124
|
toastContainer?: HTMLElement | (() => HTMLElement | null) | null;
|
|
125
|
+
csp?: {
|
|
126
|
+
/**
|
|
127
|
+
* Content Security Policy nonce
|
|
128
|
+
* https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/nonce
|
|
129
|
+
*/
|
|
130
|
+
nonce?: string;
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Disable inline styles
|
|
134
|
+
* @default false
|
|
135
|
+
*/
|
|
136
|
+
disableInlineStyles?: boolean;
|
|
113
137
|
}
|
|
114
138
|
declare const CustomContext: React.Context<CustomProviderProps<{
|
|
139
|
+
code?: string | undefined;
|
|
115
140
|
common?: {
|
|
116
141
|
loading: string;
|
|
117
142
|
emptyMessage: string;
|
|
@@ -144,11 +169,14 @@ declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
144
169
|
ok: string;
|
|
145
170
|
today: string;
|
|
146
171
|
yesterday: string;
|
|
172
|
+
now: string;
|
|
147
173
|
hours: string;
|
|
148
174
|
minutes: string;
|
|
149
175
|
seconds: string;
|
|
150
176
|
formattedMonthPattern: string;
|
|
151
177
|
formattedDayPattern: string;
|
|
178
|
+
shortDateFormat: string;
|
|
179
|
+
shortTimeFormat: string;
|
|
152
180
|
dateLocale: any;
|
|
153
181
|
} | undefined;
|
|
154
182
|
DatePicker?: {
|
|
@@ -162,11 +190,14 @@ declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
162
190
|
ok: string;
|
|
163
191
|
today: string;
|
|
164
192
|
yesterday: string;
|
|
193
|
+
now: string;
|
|
165
194
|
hours: string;
|
|
166
195
|
minutes: string;
|
|
167
196
|
seconds: string;
|
|
168
197
|
formattedMonthPattern: string;
|
|
169
198
|
formattedDayPattern: string;
|
|
199
|
+
shortDateFormat: string;
|
|
200
|
+
shortTimeFormat: string;
|
|
170
201
|
dateLocale: any;
|
|
171
202
|
} | undefined;
|
|
172
203
|
DateRangePicker?: {
|
|
@@ -181,11 +212,14 @@ declare const CustomContext: React.Context<CustomProviderProps<{
|
|
|
181
212
|
ok: string;
|
|
182
213
|
today: string;
|
|
183
214
|
yesterday: string;
|
|
215
|
+
now: string;
|
|
184
216
|
hours: string;
|
|
185
217
|
minutes: string;
|
|
186
218
|
seconds: string;
|
|
187
219
|
formattedMonthPattern: string;
|
|
188
220
|
formattedDayPattern: string;
|
|
221
|
+
shortDateFormat: string;
|
|
222
|
+
shortTimeFormat: string;
|
|
189
223
|
dateLocale: any;
|
|
190
224
|
} | undefined;
|
|
191
225
|
Picker?: {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
4
|
-
var _excluded = ["children", "classPrefix", "theme", "toastContainer", "disableRipple"];
|
|
5
|
-
import React from 'react';
|
|
4
|
+
var _excluded = ["children", "classPrefix", "iconClassPrefix", "theme", "toastContainer", "disableRipple", "csp", "disableInlineStyles"];
|
|
5
|
+
import React, { useRef, useMemo } from 'react';
|
|
6
|
+
import IconProvider from '@rsuite/icons/IconProvider';
|
|
6
7
|
import { usePortal, useIsomorphicLayoutEffect } from "../internals/hooks/index.js";
|
|
7
8
|
import { getClassNamePrefix, prefix } from "../internals/utils/prefix.js";
|
|
8
9
|
import { addClass, removeClass, canUseDOM } from "../DOMHelper/index.js";
|
|
@@ -19,17 +20,21 @@ var CustomProvider = function CustomProvider(props) {
|
|
|
19
20
|
var children = props.children,
|
|
20
21
|
_props$classPrefix = props.classPrefix,
|
|
21
22
|
classPrefix = _props$classPrefix === void 0 ? getClassNamePrefix() : _props$classPrefix,
|
|
23
|
+
_props$iconClassPrefi = props.iconClassPrefix,
|
|
24
|
+
iconClassPrefix = _props$iconClassPrefi === void 0 ? classPrefix : _props$iconClassPrefi,
|
|
22
25
|
theme = props.theme,
|
|
23
26
|
container = props.toastContainer,
|
|
24
27
|
disableRipple = props.disableRipple,
|
|
28
|
+
csp = props.csp,
|
|
29
|
+
disableInlineStyles = props.disableInlineStyles,
|
|
25
30
|
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
|
26
|
-
var toasters =
|
|
31
|
+
var toasters = useRef(new Map());
|
|
27
32
|
var _usePortal = usePortal({
|
|
28
33
|
container: container,
|
|
29
34
|
waitMount: true
|
|
30
35
|
}),
|
|
31
36
|
Portal = _usePortal.Portal;
|
|
32
|
-
var value =
|
|
37
|
+
var value = useMemo(function () {
|
|
33
38
|
return _extends({
|
|
34
39
|
classPrefix: classPrefix,
|
|
35
40
|
theme: theme,
|
|
@@ -37,6 +42,13 @@ var CustomProvider = function CustomProvider(props) {
|
|
|
37
42
|
disableRipple: disableRipple
|
|
38
43
|
}, rest);
|
|
39
44
|
}, [classPrefix, theme, disableRipple, rest]);
|
|
45
|
+
var iconContext = useMemo(function () {
|
|
46
|
+
return {
|
|
47
|
+
classPrefix: iconClassPrefix,
|
|
48
|
+
csp: csp,
|
|
49
|
+
disableInlineStyles: disableInlineStyles
|
|
50
|
+
};
|
|
51
|
+
}, [iconClassPrefix, csp, disableInlineStyles]);
|
|
40
52
|
useIsomorphicLayoutEffect(function () {
|
|
41
53
|
if (canUseDOM && theme) {
|
|
42
54
|
addClass(document.body, prefix(classPrefix, "theme-" + theme));
|
|
@@ -51,8 +63,10 @@ var CustomProvider = function CustomProvider(props) {
|
|
|
51
63
|
}, [classPrefix, theme]);
|
|
52
64
|
return /*#__PURE__*/React.createElement(CustomContext.Provider, {
|
|
53
65
|
value: value
|
|
66
|
+
}, /*#__PURE__*/React.createElement(IconProvider, {
|
|
67
|
+
value: iconContext
|
|
54
68
|
}, children, /*#__PURE__*/React.createElement(Portal, null, /*#__PURE__*/React.createElement("div", {
|
|
55
|
-
className: "
|
|
69
|
+
className: classPrefix + "toast-provider"
|
|
56
70
|
}, toastPlacements.map(function (placement) {
|
|
57
71
|
return /*#__PURE__*/React.createElement(ToastContainer, {
|
|
58
72
|
key: placement,
|
|
@@ -61,7 +75,7 @@ var CustomProvider = function CustomProvider(props) {
|
|
|
61
75
|
toasters.current.set(placement, _ref);
|
|
62
76
|
}
|
|
63
77
|
});
|
|
64
|
-
}))));
|
|
78
|
+
})))));
|
|
65
79
|
};
|
|
66
80
|
export { CustomContext };
|
|
67
81
|
export default CustomProvider;
|
|
@@ -13,7 +13,7 @@ export var patternMap = {
|
|
|
13
13
|
h: 'hour',
|
|
14
14
|
m: 'minute',
|
|
15
15
|
s: 'second',
|
|
16
|
-
a: '
|
|
16
|
+
a: 'meridiem'
|
|
17
17
|
};
|
|
18
18
|
export var DateField = /*#__PURE__*/function (_Object) {
|
|
19
19
|
function DateField(format, value) {
|
|
@@ -183,7 +183,7 @@ export var useDateField = function useDateField(format, localize, date) {
|
|
|
183
183
|
// Invalid Date. If the type is day and the value is 0, it is considered an invalid date.
|
|
184
184
|
return new Date('');
|
|
185
185
|
}
|
|
186
|
-
if (type === '
|
|
186
|
+
if (type === 'meridiem' && typeof hour === 'number') {
|
|
187
187
|
var newHour = hour > 12 ? hour - 12 : hour + 12;
|
|
188
188
|
type = 'hour';
|
|
189
189
|
value = newHour;
|
|
@@ -20,8 +20,11 @@ import useSelectedState from "./hooks/useSelectedState.js";
|
|
|
20
20
|
* @see https://rsuitejs.com/components/date-input/
|
|
21
21
|
*/
|
|
22
22
|
var DateInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
23
|
+
var _useCustom = useCustom('Calendar'),
|
|
24
|
+
locale = _useCustom.locale,
|
|
25
|
+
parseDate = _useCustom.parseDate;
|
|
23
26
|
var _props$format = props.format,
|
|
24
|
-
formatStr = _props$format === void 0 ?
|
|
27
|
+
formatStr = _props$format === void 0 ? locale.shortDateFormat : _props$format,
|
|
25
28
|
valueProp = props.value,
|
|
26
29
|
defaultValue = props.defaultValue,
|
|
27
30
|
placeholder = props.placeholder,
|
|
@@ -35,9 +38,6 @@ var DateInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
35
38
|
var _useSelectedState = useSelectedState(),
|
|
36
39
|
selectedState = _useSelectedState.selectedState,
|
|
37
40
|
setSelectedState = _useSelectedState.setSelectedState;
|
|
38
|
-
var _useCustom = useCustom('Calendar'),
|
|
39
|
-
locale = _useCustom.locale,
|
|
40
|
-
parseDate = _useCustom.parseDate;
|
|
41
41
|
var dateLocale = locale.dateLocale;
|
|
42
42
|
var _useControlled = useControlled(valueProp, defaultValue),
|
|
43
43
|
value = _useControlled[0],
|
|
@@ -70,11 +70,17 @@ var DateInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
70
70
|
dateString: dateString
|
|
71
71
|
};
|
|
72
72
|
}, [dateField, dateString, formatStr, dateLocale]);
|
|
73
|
+
var setSelectionRange = useInputSelection(inputRef);
|
|
73
74
|
var handleChange = useEventCallback(function (value, event) {
|
|
74
75
|
onChange === null || onChange === void 0 ? void 0 : onChange(value, event);
|
|
75
76
|
setValue(value);
|
|
76
77
|
});
|
|
77
|
-
var
|
|
78
|
+
var handleClear = useEventCallback(function (event) {
|
|
79
|
+
handleChange(null, event);
|
|
80
|
+
setNewDate(null);
|
|
81
|
+
setSelectionRange(0, 0);
|
|
82
|
+
reset();
|
|
83
|
+
});
|
|
78
84
|
var onSegmentChange = useEventCallback(function (event, nextDirection) {
|
|
79
85
|
var input = event.target;
|
|
80
86
|
var key = event.key;
|
|
@@ -142,7 +148,12 @@ var DateInput = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
142
148
|
});
|
|
143
149
|
var onSegmentValueRemove = useEventCallback(function (event) {
|
|
144
150
|
var input = event.target;
|
|
145
|
-
|
|
151
|
+
var value = input.value;
|
|
152
|
+
|
|
153
|
+
// If the text is all selected, clear the value
|
|
154
|
+
if (input.selectionStart === 0 && value && input.selectionEnd === value.length) {
|
|
155
|
+
handleClear(event);
|
|
156
|
+
} else if (selectedState.selectedPattern) {
|
|
146
157
|
var nextState = getInputSelectedState(_extends({}, keyPressOptions, {
|
|
147
158
|
input: input,
|
|
148
159
|
valueOffset: null
|
|
@@ -3,7 +3,7 @@ import { RangeType } from './Toolbar';
|
|
|
3
3
|
import type { FormControlBaseProps, PickerBaseProps, RsRefForwardingComponent } from '../internals/types';
|
|
4
4
|
import type { DatePickerLocale } from '../locales';
|
|
5
5
|
import type { DeprecatedProps } from './types';
|
|
6
|
-
import type { MonthDropdownProps } from '../Calendar/
|
|
6
|
+
import type { MonthDropdownProps } from '../Calendar/types';
|
|
7
7
|
export interface DatePickerProps extends PickerBaseProps<DatePickerLocale>, FormControlBaseProps<Date | null>, DeprecatedProps {
|
|
8
8
|
/**
|
|
9
9
|
* Custom caret component
|
|
@@ -75,9 +75,13 @@ export interface DatePickerProps extends PickerBaseProps<DatePickerLocale>, Form
|
|
|
75
75
|
*/
|
|
76
76
|
showWeekNumbers?: boolean;
|
|
77
77
|
/**
|
|
78
|
-
*
|
|
78
|
+
* @deprecated Use `showMeridiem` instead
|
|
79
79
|
*/
|
|
80
80
|
showMeridian?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Meridiem format for 12-hour time
|
|
83
|
+
*/
|
|
84
|
+
showMeridiem?: boolean;
|
|
81
85
|
/**
|
|
82
86
|
* The props for the Month Dropdown component.
|
|
83
87
|
*/
|