@moysklad/uikit 30.4.0 → 31.20.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/README.md +9 -4
- package/dist/colorVariables.css +23 -1
- package/dist/components/AutoComplete/AutoComplete.js +2 -2
- package/dist/components/BentoBlock/BentoBlock.d.ts +15 -0
- package/dist/components/BentoBlock/BentoBlock.js +20 -0
- package/dist/components/BentoBlock/BentoBlock.module.js +9 -0
- package/dist/components/BentoBlock/BentoBlock_module.css +50 -0
- package/dist/components/BentoBlock/consts.d.ts +14 -0
- package/dist/components/BentoBlock/consts.js +15 -0
- package/dist/components/Button/Button.d.ts +5 -2
- package/dist/components/Button/Button.js +28 -19
- package/dist/components/Button/Button_module.css +16 -14
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/DateRange/ArrowButton/ArrowButton.module.js +6 -0
- package/dist/components/DateRange/ArrowButton/ArrowButton_module.css +26 -0
- package/dist/components/DateRange/ArrowButton/index.d.ts +8 -0
- package/dist/components/DateRange/ArrowButton/index.js +23 -0
- package/dist/components/DateRange/Calendar/index.d.ts +12 -0
- package/dist/components/DateRange/Calendar/index.js +22 -0
- package/dist/components/DateRange/DateRange.d.ts +6 -0
- package/dist/components/DateRange/DateRange.js +51 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger.d.ts +44 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger.js +128 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger.module.js +19 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger/DateRangeDefaultTrigger_module.css +170 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger.module.js +12 -0
- package/dist/components/DateRange/DateRangeDefaultTrigger_module.css +43 -0
- package/dist/components/DateRange/DateRangeInput/DateRangeInput.d.ts +4 -0
- package/dist/components/DateRange/DateRangeInput/DateRangeInput.js +69 -0
- package/dist/components/DateRange/Day/Day.module.js +16 -0
- package/dist/components/DateRange/Day/Day_module.css +80 -0
- package/dist/components/DateRange/Day/index.d.ts +12 -0
- package/dist/components/DateRange/Day/index.js +39 -0
- package/dist/components/DateRange/DropdownContent/DropdownContent.module.js +10 -0
- package/dist/components/DateRange/DropdownContent/DropdownContent_module.css +34 -0
- package/dist/components/DateRange/DropdownContent/index.d.ts +24 -0
- package/dist/components/DateRange/DropdownContent/index.js +132 -0
- package/dist/components/DateRange/InputContent/InputContent.module.js +9 -0
- package/dist/components/DateRange/InputContent/InputContent_module.css +31 -0
- package/dist/components/DateRange/InputContent/index.d.ts +12 -0
- package/dist/components/DateRange/InputContent/index.js +59 -0
- package/dist/components/DateRange/Month/Month.module.js +7 -0
- package/dist/components/DateRange/Month/Month_module.css +17 -0
- package/dist/components/DateRange/Month/index.d.ts +15 -0
- package/dist/components/DateRange/Month/index.js +158 -0
- package/dist/components/DateRange/Month/utils.d.ts +2 -0
- package/dist/components/DateRange/Month/utils.js +8 -0
- package/dist/components/DateRange/MonthHeader/MonthHeader.module.js +5 -0
- package/dist/components/DateRange/MonthHeader/MonthHeader_module.css +10 -0
- package/dist/components/DateRange/MonthHeader/index.d.ts +5 -0
- package/dist/components/DateRange/MonthHeader/index.js +26 -0
- package/dist/components/DateRange/MonthList/MonthList.module.js +7 -0
- package/dist/components/DateRange/MonthList/MonthList_module.css +25 -0
- package/dist/components/DateRange/MonthList/index.d.ts +11 -0
- package/dist/components/DateRange/MonthList/index.js +91 -0
- package/dist/components/DateRange/PeriodVariantList/PeriodVariantList.module.js +9 -0
- package/dist/components/DateRange/PeriodVariantList/PeriodVariantList_module.css +18 -0
- package/dist/components/DateRange/PeriodVariantList/index.d.ts +18 -0
- package/dist/components/DateRange/PeriodVariantList/index.js +83 -0
- package/dist/components/DateRange/SideMenu/SideMenu.module.js +6 -0
- package/dist/components/DateRange/SideMenu/SideMenu_module.css +18 -0
- package/dist/components/DateRange/SideMenu/index.d.ts +13 -0
- package/dist/components/DateRange/SideMenu/index.js +73 -0
- package/dist/components/DateRange/TooltipedText/index.d.ts +8 -0
- package/dist/components/DateRange/TooltipedText/index.js +30 -0
- package/dist/components/DateRange/Year/Year.module.js +11 -0
- package/dist/components/DateRange/Year/Year_module.css +60 -0
- package/dist/components/DateRange/Year/index.d.ts +8 -0
- package/dist/components/DateRange/Year/index.js +47 -0
- package/dist/components/DateRange/YearsList/YearsList.module.js +5 -0
- package/dist/components/DateRange/YearsList/YearsList_module.css +15 -0
- package/dist/components/DateRange/YearsList/index.d.ts +12 -0
- package/dist/components/DateRange/YearsList/index.js +47 -0
- package/dist/components/DateRange/consts.d.ts +20 -0
- package/dist/components/DateRange/consts.js +81 -0
- package/dist/components/DateRange/formatDateRangeValue.d.ts +24 -0
- package/dist/components/DateRange/formatDateRangeValue.js +116 -0
- package/dist/components/DateRange/hooks/useCalendar.d.ts +13 -0
- package/dist/components/DateRange/hooks/useCalendar.js +88 -0
- package/dist/components/DateRange/hooks/useDateRange.d.ts +392 -0
- package/dist/components/DateRange/hooks/useDateRange.js +36 -0
- package/dist/components/DateRange/hooks/useDateRangeDropdown.d.ts +47 -0
- package/dist/components/DateRange/hooks/useDateRangeDropdown.js +117 -0
- package/dist/components/DateRange/hooks/useDateRangeValue.d.ts +56 -0
- package/dist/components/DateRange/hooks/useDateRangeValue.js +173 -0
- package/dist/components/DateRange/hooks/useMaskInput.d.ts +18 -0
- package/dist/components/DateRange/hooks/useMaskInput.js +169 -0
- package/dist/components/DateRange/hooks/useMonthList.d.ts +12 -0
- package/dist/components/DateRange/hooks/useMonthList.js +80 -0
- package/dist/components/DateRange/hooks/useSideMenu.d.ts +14 -0
- package/dist/components/DateRange/hooks/useSideMenu.js +113 -0
- package/dist/components/DateRange/index.d.ts +1 -0
- package/dist/components/DateRange/index.js +1 -0
- package/dist/components/DateRange/locale/en-US.d.ts +2 -0
- package/dist/components/DateRange/locale/en-US.js +82 -0
- package/dist/components/DateRange/locale/index.d.ts +4 -0
- package/dist/components/DateRange/locale/index.js +3 -0
- package/dist/components/DateRange/locale/ru-RU.d.ts +2 -0
- package/dist/components/DateRange/locale/ru-RU.js +82 -0
- package/dist/components/DateRange/locale/types.d.ts +9 -0
- package/dist/components/DateRange/locale/types.js +7 -0
- package/dist/components/DateRange/locale/useLocale.d.ts +8 -0
- package/dist/components/DateRange/locale/useLocale.js +31 -0
- package/dist/components/DateRange/props.d.ts +39 -0
- package/dist/components/DateRange/props.js +0 -0
- package/dist/components/DateRange/types.d.ts +126 -0
- package/dist/components/DateRange/types.js +13 -0
- package/dist/components/DateRange/utils.d.ts +33 -0
- package/dist/components/DateRange/utils.js +105 -0
- package/dist/components/Datepicker/Datepicker.d.ts +3 -1
- package/dist/components/Datepicker/Datepicker.js +4 -2
- package/dist/components/EditableDate/DropdownContent/DropdownContent.d.ts +9 -0
- package/dist/components/EditableDate/DropdownContent/DropdownContent.js +36 -0
- package/dist/components/EditableDate/EditableDate.d.ts +9 -0
- package/dist/components/EditableDate/EditableDate.js +142 -0
- package/dist/components/EditableDate/EditableDate.module.js +7 -0
- package/dist/components/EditableDate/EditableDate_module.css +32 -0
- package/dist/components/EditableTitle/EditableTitle.d.ts +7 -2
- package/dist/components/EditableTitle/EditableTitle.js +63 -31
- package/dist/components/EditableTitle/EditableTitle.module.js +1 -0
- package/dist/components/EditableTitle/EditableTitle_module.css +6 -0
- package/dist/components/EmptyState/EmptyState.d.ts +1 -1
- package/dist/components/EmptyStateLarge/EmptyStateLarge_module.css +2 -2
- package/dist/components/Help/Help_module.css +1 -1
- package/dist/components/Informer/Informer.d.ts +37 -0
- package/dist/components/Informer/Informer.js +36 -0
- package/dist/components/Informer/Informer.module.js +7 -0
- package/dist/components/Informer/Informer_module.css +24 -0
- package/dist/components/Input/Input.js +10 -5
- package/dist/components/Input/components/InfoBlock.d.ts +3 -1
- package/dist/components/Input/components/InfoBlock.js +7 -4
- package/dist/components/InputUnit/InputUnit.js +4 -4
- package/dist/components/LabelValue/LabelValue.d.ts +14 -10
- package/dist/components/LabelValue/LabelValue.js +46 -25
- package/dist/components/LabelValue/LabelValue.module.js +10 -4
- package/dist/components/LabelValue/LabelValue_module.css +53 -19
- package/dist/components/LabelValue/ValueBlock/ValueBlock.d.ts +2 -0
- package/dist/components/LabelValue/ValueBlock/ValueBlock.js +82 -0
- package/dist/components/LabelValue/ValueBlockWrapper.d.ts +5 -0
- package/dist/components/LabelValue/ValueBlockWrapper.js +13 -0
- package/dist/components/LabelValue/ValueIcon.d.ts +4 -0
- package/dist/components/LabelValue/ValueIcon.js +9 -0
- package/dist/components/LabelValue/ValueText.d.ts +10 -0
- package/dist/components/LabelValue/ValueText.js +24 -0
- package/dist/components/LabelValue/ValueTextWithHint.d.ts +12 -0
- package/dist/components/LabelValue/ValueTextWithHint.js +29 -0
- package/dist/components/LabelValue/hooks/useValueBlock.d.ts +29 -0
- package/dist/components/LabelValue/hooks/useValueBlock.js +72 -0
- package/dist/components/LabelValue/{ValueBlock/index.d.ts → types.d.ts} +8 -4
- package/dist/components/LabelValue/types.js +0 -0
- package/dist/components/LabelValueDate/LabelValueDate.js +2 -2
- package/dist/components/LabelValueFile/DeleteButton/DeleteButton.d.ts +9 -0
- package/dist/components/LabelValueFile/DeleteButton/DeleteButton.js +17 -0
- package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon.d.ts +7 -0
- package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon.js +15 -0
- package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon.module.js +6 -0
- package/dist/components/LabelValueFile/FilePreviewIcon/FilePreviewIcon_module.css +10 -0
- package/dist/components/LabelValueFile/ImagePreview/ImagePreview.d.ts +8 -0
- package/dist/components/LabelValueFile/ImagePreview/ImagePreview.js +53 -0
- package/dist/components/LabelValueFile/ImagePreview/ImagePreview.module.js +6 -0
- package/dist/components/LabelValueFile/ImagePreview/ImagePreview_module.css +13 -0
- package/dist/components/LabelValueFile/LabelValueFile.d.ts +7 -0
- package/dist/components/LabelValueFile/LabelValueFile.js +42 -0
- package/dist/components/LabelValueFile/LabelValueFile.module.js +12 -0
- package/dist/components/LabelValueFile/LabelValueFile_module.css +57 -0
- package/dist/components/LabelValueFile/ValueBlock/ValueBlock.d.ts +15 -0
- package/dist/components/LabelValueFile/ValueBlock/ValueBlock.js +130 -0
- package/dist/components/LabelValueFile/ValueBlock/ValueBlock.module.js +7 -0
- package/dist/components/LabelValueFile/ValueBlock/ValueBlock_module.css +17 -0
- package/dist/components/LabelValueInput/DropdownConnent/DropdownContent.d.ts +2 -0
- package/dist/components/LabelValueInput/DropdownConnent/DropdownContent.js +2 -0
- package/dist/components/LabelValueLink/LabelValueLink.d.ts +2 -0
- package/dist/components/LabelValueLink/LabelValueLink.js +76 -0
- package/dist/components/LabelValueLink/LabelValueLink.module.js +6 -0
- package/dist/components/LabelValueLink/LabelValueLink_module.css +11 -0
- package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock.d.ts +2 -0
- package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock.js +117 -0
- package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock.module.js +6 -0
- package/dist/components/LabelValueLink/ValueBlock/LabelValueLinkValueBlock_module.css +8 -0
- package/dist/components/LabelValueLink/normalizeLinkValue.d.ts +1 -0
- package/dist/components/LabelValueLink/normalizeLinkValue.js +10 -0
- package/dist/components/LabelValueLink/useLinkDropdownValue.d.ts +15 -0
- package/dist/components/LabelValueLink/useLinkDropdownValue.js +26 -0
- package/dist/components/LabelValueSelect/Input/index.js +1 -1
- package/dist/components/LabelValueSelect/LabelValueSelect.d.ts +4 -2
- package/dist/components/Layout/Layout.d.ts +13 -0
- package/dist/components/Layout/Layout.js +41 -0
- package/dist/components/Layout/Layout.module.js +15 -0
- package/dist/components/Layout/Layout_module.css +77 -0
- package/dist/components/Link/Link.d.ts +5 -6
- package/dist/components/Link/Link.js +35 -9
- package/dist/components/Link/Link.module.js +1 -0
- package/dist/components/Link/Link_module.css +9 -0
- package/dist/components/MentionsTextfield/Mentions/style.css +2 -6
- package/dist/components/MentionsTextfield/MentionsTextfield.js +2 -1
- package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip.d.ts +8 -0
- package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip.js +13 -0
- package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip.module.js +5 -0
- package/dist/components/Multiselect/AllSelectedChip/AllSelectedChip_module.css +9 -0
- package/dist/components/Multiselect/DropdownContent/MultiselectDropdownContent.d.ts +12 -1
- package/dist/components/Multiselect/DropdownContent/MultiselectDropdownContent.js +20 -15
- package/dist/components/Multiselect/Input/Input.d.ts +6 -2
- package/dist/components/Multiselect/Input/Input.js +18 -4
- package/dist/components/Multiselect/Multiselect.d.ts +4 -2
- package/dist/components/Multiselect/Multiselect.js +14 -2
- package/dist/components/Multiselect/ShortDropdownContent/ShortDropdownContent.js +2 -1
- package/dist/components/Multiselect/TextField/MultiselectTextField.d.ts +5 -1
- package/dist/components/Multiselect/TextField/MultiselectTextField.js +15 -2
- package/dist/components/Multiselect/lib/consts.d.ts +1 -1
- package/dist/components/Multiselect/lib/consts.js +1 -1
- package/dist/components/Multiselect/lib/helpers.d.ts +24 -0
- package/dist/components/Multiselect/lib/helpers.js +15 -0
- package/dist/components/Multiselect/types.d.ts +2 -0
- package/dist/components/Panel/Panel.d.ts +34 -0
- package/dist/components/Panel/Panel.js +39 -0
- package/dist/components/Panel/Panel.module.js +6 -0
- package/dist/components/Panel/Panel_module.css +17 -0
- package/dist/components/Radiobutton/Radiobutton.js +1 -1
- package/dist/components/Radiobutton/Radiobutton_module.css +5 -0
- package/dist/components/SearchInput/SearchInput_module.css +1 -1
- package/dist/components/Select/ArchivedInputValue/ArchivedInputValue.d.ts +3 -4
- package/dist/components/Select/ArchivedInputValue/ArchivedInputValue.js +19 -24
- package/dist/components/Select/ArchivedInputValue/ArchivedInputValue.module.js +1 -2
- package/dist/components/Select/ArchivedInputValue/ArchivedInputValue_module.css +5 -12
- package/dist/components/Select/Combobox/Combobox.d.ts +3 -1
- package/dist/components/Select/Combobox/Combobox.js +19 -8
- package/dist/components/Select/Combobox/Combobox.module.js +4 -3
- package/dist/components/Select/Combobox/Combobox_module.css +15 -9
- package/dist/components/Select/OptionsList/OptionsList.d.ts +3 -1
- package/dist/components/Select/OptionsList/OptionsList.js +37 -21
- package/dist/components/Select/OptionsList/OptionsList.module.js +2 -0
- package/dist/components/Select/OptionsList/OptionsList_module.css +15 -0
- package/dist/components/Select/Select.d.ts +2 -3
- package/dist/components/Select/Select.js +17 -7
- package/dist/components/Select/Select_module.css +5 -0
- package/dist/components/Select/ShortVariant/ShortVariant.js +1 -1
- package/dist/components/StatusBadge/StatusBadge.d.ts +28 -0
- package/dist/components/StatusBadge/StatusBadge.js +167 -0
- package/dist/components/StatusBadge/StatusBadge.module.js +37 -0
- package/dist/components/StatusBadge/StatusBadge_module.css +149 -0
- package/dist/components/StatusBadge/utils/StatusBadgeColor.d.ts +21 -0
- package/dist/components/StatusBadge/utils/StatusBadgeColor.js +20 -0
- package/dist/components/StatusBadge/utils/getStatusBadgeColor.d.ts +2 -0
- package/dist/components/StatusBadge/utils/getStatusBadgeColor.js +8 -0
- package/dist/components/Textfield/Textfield.d.ts +7 -2
- package/dist/components/Textfield/Textfield.js +2 -1
- package/dist/components/Textfield/components/Container/Container.d.ts +2 -0
- package/dist/components/Textfield/components/Container/Container.js +17 -6
- package/dist/components/Textfield/components/Container/Container.module.js +2 -1
- package/dist/components/Textfield/components/Container/Container_module.css +4 -0
- package/dist/components/Toggle/Toggle.js +1 -1
- package/dist/components/ViewersStack/ViewersStack.js +5 -3
- package/dist/components/_shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent.d.ts +12 -0
- package/dist/components/{LabelValueDate/DropdownContent/index.js → _shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent.js} +10 -10
- package/dist/components/_shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent.module.js +9 -0
- package/dist/components/{LabelValueDate/DropdownContent/DropdownContent_module.css → _shared/CustomDatepickerDropdownContent/CustomDatepickerDropdownContent_module.css} +6 -6
- package/dist/components/_shared/FieldLabel/FieldLabel.d.ts +18 -0
- package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel.js +19 -12
- package/dist/components/_shared/FieldLabel/FieldLabel.module.js +11 -0
- package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel_module.css +8 -8
- package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton.d.ts +1 -1
- package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton.js +2 -2
- package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton.module.js +1 -1
- package/dist/components/{FieldLabel → _shared/FieldLabel}/components/HelpButton_module.css +1 -1
- package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow.d.ts +1 -1
- package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow.js +1 -1
- package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow.module.js +3 -3
- package/dist/components/{FieldRow → _shared/FieldRow}/FieldRow_module.css +3 -3
- package/dist/components/{Info → _shared/Info}/Info.d.ts +3 -1
- package/dist/components/{Info → _shared/Info}/Info.js +9 -6
- package/dist/components/_shared/Info/Info.module.js +9 -0
- package/dist/components/{Info → _shared/Info}/Info_module.css +6 -6
- package/dist/components/_shared/Info/types/index.d.ts +6 -0
- package/dist/components/_shared/Info/types/index.js +5 -0
- package/dist/components/{InputClear → _shared/InputClear}/InputClear.d.ts +1 -1
- package/dist/components/{InputClear → _shared/InputClear}/InputClear.js +2 -2
- package/dist/components/{InputClear → _shared/InputClear}/InputClear.module.js +3 -3
- package/dist/components/{InputClear → _shared/InputClear}/InputClear_module.css +5 -5
- package/dist/components/_shared/utils/polymorphicClickableTypes.d.ts +17 -0
- package/dist/components/_shared/utils/polymorphicClickableTypes.js +7 -0
- package/dist/data-grid/Filters/DateRangeFilter/DropdownContent/index.js +3 -3
- package/dist/data-grid/Filters/DateRangeFilter/InputContent/index.js +29 -26
- package/dist/data-grid/Filters/DateRangeFilter/PeriodVariantList/index.js +5 -3
- package/dist/data-grid/Filters/DateRangeFilter/Year/index.js +3 -3
- package/dist/data-grid/Filters/DateRangeFilter/consts.js +6 -6
- package/dist/data-grid/Filters/DateRangeFilter/hooks/useMaskInput.js +6 -6
- package/dist/data-grid/Filters/DateRangeFilter/hooks/useSideMenu.js +1 -4
- package/dist/data-grid/Filters/DateRangeFilter/types.d.ts +68 -56
- package/dist/data-grid/Filters/FiltersContainer/FiltersContainer.js +2 -1
- package/dist/data-grid/Filters/FiltersContainer/utils/useRenderParams.d.ts +1 -0
- package/dist/data-grid/Filters/FiltersContainer/utils/useRenderParams.js +14 -6
- package/dist/data-grid/Filters/MultiselectFilter/MultiselectFilter.js +2 -2
- package/dist/data-grid/Filters/OutlineInput/OutlineInput.js +2 -2
- package/dist/data-grid/Filters/OutlineInput/OutlineInput_module.css +1 -1
- package/dist/data-grid/Table/Table_module.css +0 -1
- package/dist/data-grid/cells/ImageCell/ImageMiniature/ImageMiniature_module.css +1 -1
- package/dist/data-grid/cells/components/TableNumberInput/TableNumberInput.d.ts +1 -0
- package/dist/data-grid/cells/components/TableNumberInput/TableNumberInput.js +17 -5
- package/dist/data-grid/cells/components/TableSelect/TableSelect.js +3 -2
- package/dist/data-grid/headers/components/Dropdown/Dropdown.d.ts +3 -0
- package/dist/data-grid/headers/components/HeaderBuilder/HeaderBuilder.js +1 -0
- package/dist/data-grid/index.d.ts +0 -4
- package/dist/data-grid/locale/en-US.js +68 -56
- package/dist/data-grid/locale/ru-RU.js +68 -56
- package/dist/data-grid/locale/useLocale.d.ts +6 -1
- package/dist/data-grid/locale/useLocale.js +14 -5
- package/dist/hooks/useIsElementOverflowing/index.d.ts +1 -0
- package/dist/hooks/useIsElementOverflowing/index.js +8 -2
- package/dist/hooks/useOverflowHint/index.d.ts +7 -0
- package/dist/hooks/useOverflowHint/index.js +16 -0
- package/dist/hooks/useTextField/useTextField.d.ts +1 -1
- package/dist/icon/components/MsLogo12Icon.d.ts +8 -0
- package/dist/icon/components/MsLogo12Icon.js +28 -0
- package/dist/icon/components/MsLogo16Icon.d.ts +8 -0
- package/dist/icon/components/MsLogo16Icon.js +26 -0
- package/dist/icon/components/MsLogo20Icon.d.ts +8 -0
- package/dist/icon/components/MsLogo20Icon.js +28 -0
- package/dist/icon/components/Phone12Icon.d.ts +8 -0
- package/dist/icon/components/Phone12Icon.js +18 -0
- package/dist/icon/components/Phone16Icon.d.ts +8 -0
- package/dist/icon/components/Phone16Icon.js +17 -0
- package/dist/icon/components/Phone20Icon.d.ts +8 -0
- package/dist/icon/components/Phone20Icon.js +18 -0
- package/dist/icon/index.d.ts +6 -0
- package/dist/icon/index.js +6 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.js +8 -0
- package/dist/utils/checkIsArchivedValue.d.ts +2 -0
- package/dist/utils/checkIsArchivedValue.js +5 -0
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.js +1 -0
- package/package.json +70 -13
- package/dist/components/FieldLabel/FieldLabel.d.ts +0 -17
- package/dist/components/FieldLabel/FieldLabel.module.js +0 -11
- package/dist/components/Info/Info.module.js +0 -9
- package/dist/components/LabelValue/ValueBlock/index.js +0 -138
- package/dist/components/LabelValue/hooks/useTooltip.d.ts +0 -8
- package/dist/components/LabelValue/hooks/useTooltip.js +0 -16
- package/dist/components/LabelValueDate/DropdownContent/DropdownContent.module.js +0 -9
- package/dist/components/LabelValueDate/DropdownContent/index.d.ts +0 -12
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.d.ts +0 -7
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.js +0 -27
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.module.js +0 -8
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory_module.css +0 -25
- package/dist/components/MentionsTextfield/OptionForStory/index.d.ts +0 -1
- package/dist/components/MentionsTextfield/OptionForStory/index.js +0 -1
- package/dist/components/Textfield/components/Label/Label.d.ts +0 -11
- package/dist/components/Textfield/components/Label/Label.js +0 -38
- package/dist/components/Textfield/components/Label/Label.module.js +0 -7
- package/dist/components/Textfield/components/Label/Label_module.css +0 -17
- package/dist/components/Textfield/components/Label/index.d.ts +0 -1
- package/dist/components/Textfield/components/Label/index.js +0 -1
- /package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel.constants.d.ts +0 -0
- /package/dist/components/{FieldLabel → _shared/FieldLabel}/FieldLabel.constants.js +0 -0
- /package/dist/components/{FieldLabel → _shared/FieldLabel}/components/index.d.ts +0 -0
- /package/dist/components/{FieldLabel → _shared/FieldLabel}/components/index.js +0 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo, useState } from "react";
|
|
3
|
+
import { Virtuoso } from "react-virtuoso";
|
|
4
|
+
import { differenceInMonths, eachMonthOfInterval, getMonth, getYear } from "date-fns";
|
|
5
|
+
import { cn } from "../../../common/css/index.js";
|
|
6
|
+
import { Month } from "../Month/index.js";
|
|
7
|
+
import { MonthHeader } from "../MonthHeader/index.js";
|
|
8
|
+
import { getCorrectInterval, getFirstDayOfMonth, getPeriodValue, getRangeDates, isDayValue, isRangeValue, isValuePeriod, isWeekValue } from "../utils.js";
|
|
9
|
+
import MonthList_module from "./MonthList.module.js";
|
|
10
|
+
const getDateToScroll = (options)=>{
|
|
11
|
+
if (isValuePeriod(options.value)) {
|
|
12
|
+
const { startDate, endDate } = getPeriodValue(options.value);
|
|
13
|
+
if (startDate && endDate) return endDate;
|
|
14
|
+
}
|
|
15
|
+
if (isDayValue(options) && options.value) return options.value;
|
|
16
|
+
return new Date();
|
|
17
|
+
};
|
|
18
|
+
const MonthList = (props)=>{
|
|
19
|
+
const [hoverDate, setHoverDate] = useState();
|
|
20
|
+
const [hoveredWeekFirstDay, setHoveredWeekFirstDay] = useState();
|
|
21
|
+
const monthFirstDays = eachMonthOfInterval({
|
|
22
|
+
start: props.minDate,
|
|
23
|
+
end: props.maxDate
|
|
24
|
+
});
|
|
25
|
+
const currentDateIndex = useMemo(()=>{
|
|
26
|
+
const dateToScroll = getDateToScroll(props.value);
|
|
27
|
+
return differenceInMonths(dateToScroll, monthFirstDays[0]);
|
|
28
|
+
}, []);
|
|
29
|
+
useEffect(()=>{
|
|
30
|
+
if (!isRangeValue(props.value)) return void setHoverDate(void 0);
|
|
31
|
+
const { startDate, endDate } = getRangeDates(props.value);
|
|
32
|
+
if (startDate && endDate) setHoverDate(void 0);
|
|
33
|
+
}, [
|
|
34
|
+
props.value
|
|
35
|
+
]);
|
|
36
|
+
const selectedInterval = useMemo(()=>{
|
|
37
|
+
if (!isRangeValue(props.value) && !isWeekValue(props.value)) return null;
|
|
38
|
+
const { startDate, endDate } = getRangeDates(props.value);
|
|
39
|
+
if (!startDate && !endDate) return null;
|
|
40
|
+
const selectedStartDate = startDate ?? hoverDate;
|
|
41
|
+
const selectedEndDate = endDate ?? hoverDate;
|
|
42
|
+
if (!selectedStartDate || !selectedEndDate) return {
|
|
43
|
+
startDateOfInterval: selectedStartDate,
|
|
44
|
+
endDateOfInterval: selectedEndDate
|
|
45
|
+
};
|
|
46
|
+
const [startDateOfInterval, endDateOfInterval] = getCorrectInterval(selectedStartDate, selectedEndDate);
|
|
47
|
+
return {
|
|
48
|
+
startDateOfInterval,
|
|
49
|
+
endDateOfInterval
|
|
50
|
+
};
|
|
51
|
+
}, [
|
|
52
|
+
hoverDate,
|
|
53
|
+
props.value
|
|
54
|
+
]);
|
|
55
|
+
return /*#__PURE__*/ jsx(Virtuoso, {
|
|
56
|
+
ref: props.virtuosoRef,
|
|
57
|
+
className: MonthList_module.scrollContainer,
|
|
58
|
+
style: {
|
|
59
|
+
height: '300px'
|
|
60
|
+
},
|
|
61
|
+
totalCount: monthFirstDays.length,
|
|
62
|
+
initialTopMostItemIndex: {
|
|
63
|
+
index: currentDateIndex,
|
|
64
|
+
align: 'center'
|
|
65
|
+
},
|
|
66
|
+
itemContent: (index)=>{
|
|
67
|
+
const monthFirstDay = monthFirstDays[index];
|
|
68
|
+
const month = getMonth(monthFirstDay) + 1;
|
|
69
|
+
const year = getYear(monthFirstDay);
|
|
70
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
71
|
+
className: cn(MonthList_module.month, 0 === index && MonthList_module.first),
|
|
72
|
+
children: [
|
|
73
|
+
/*#__PURE__*/ jsx(MonthHeader, {
|
|
74
|
+
date: getFirstDayOfMonth(year, month)
|
|
75
|
+
}),
|
|
76
|
+
/*#__PURE__*/ jsx(Month, {
|
|
77
|
+
selectedInterval: selectedInterval,
|
|
78
|
+
value: props.value,
|
|
79
|
+
month: month,
|
|
80
|
+
year: year,
|
|
81
|
+
hoverWeekFirstDay: hoveredWeekFirstDay,
|
|
82
|
+
onChangeHoverDate: setHoverDate,
|
|
83
|
+
onChangeHoverWeekFirstDay: setHoveredWeekFirstDay,
|
|
84
|
+
onSelectDate: props.onSelectDate
|
|
85
|
+
})
|
|
86
|
+
]
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
export { MonthList };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import "./PeriodVariantList_module.css";
|
|
2
|
+
const PeriodVariantList_module = {
|
|
3
|
+
optionContainer: "optionContainer-Y526xG",
|
|
4
|
+
option: "option-f1EC38",
|
|
5
|
+
selectDayButtons: "selectDayButtons-HBKcPU",
|
|
6
|
+
chip: "chip-ZZhKZB",
|
|
7
|
+
active: "active-YPxsPe"
|
|
8
|
+
};
|
|
9
|
+
export default PeriodVariantList_module;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.optionContainer-Y526xG {
|
|
2
|
+
padding: 6px 12px;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.option-f1EC38, .selectDayButtons-HBKcPU {
|
|
6
|
+
align-items: center;
|
|
7
|
+
gap: 8px;
|
|
8
|
+
display: flex;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.chip-ZZhKZB {
|
|
12
|
+
background-color: var(--elements-chips-normal, #c9d3dd66);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.chip-ZZhKZB.active-YPxsPe {
|
|
16
|
+
background-color: var(--elements-chips-normal-current, #bfddf7bf);
|
|
17
|
+
}
|
|
18
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ISelectOption } from '../../Select/Select';
|
|
2
|
+
import { type DayQuickFilter } from '../types';
|
|
3
|
+
export interface PeriodVariantListProps {
|
|
4
|
+
variants: ISelectOption[];
|
|
5
|
+
value?: ISelectOption;
|
|
6
|
+
quickFilter?: DayQuickFilter[];
|
|
7
|
+
yesterdaySelected?: boolean;
|
|
8
|
+
todaySelected?: boolean;
|
|
9
|
+
tomorrowSelected?: boolean;
|
|
10
|
+
onSelect?: (variant: ISelectOption) => void;
|
|
11
|
+
onClickYestardayButton?: () => void;
|
|
12
|
+
onClickTodayButton?: () => void;
|
|
13
|
+
onClickTomorrowButton?: () => void;
|
|
14
|
+
}
|
|
15
|
+
export interface PeriodVariantListRef {
|
|
16
|
+
focusOnFirstItem: () => void;
|
|
17
|
+
}
|
|
18
|
+
export declare const PeriodVariantList: import("react").ForwardRefExoticComponent<PeriodVariantListProps & import("react").RefAttributes<PeriodVariantListRef>>;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useImperativeHandle, useRef } from "react";
|
|
3
|
+
import { cn } from "../../../common/css/index.js";
|
|
4
|
+
import { Chip } from "../../Chip/Chip.js";
|
|
5
|
+
import { Radiobutton } from "../../Radiobutton/Radiobutton.js";
|
|
6
|
+
import { CalendarVariant, KEYBOARD_ACTIVATION_KEYS } from "../consts.js";
|
|
7
|
+
import { useLocale } from "../locale/index.js";
|
|
8
|
+
import { DEFAULT_QUICK_FILTER } from "../types.js";
|
|
9
|
+
import PeriodVariantList_module from "./PeriodVariantList.module.js";
|
|
10
|
+
const PeriodVariantList = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
11
|
+
const locale = useLocale('DateRange');
|
|
12
|
+
const quickFilters = props.quickFilter ?? DEFAULT_QUICK_FILTER;
|
|
13
|
+
const handleOptionKeyDown = (event, variant)=>{
|
|
14
|
+
if (KEYBOARD_ACTIVATION_KEYS.includes(event.key)) props.onSelect?.(variant);
|
|
15
|
+
};
|
|
16
|
+
const firstOptionRef = useRef(null);
|
|
17
|
+
useImperativeHandle(ref, ()=>({
|
|
18
|
+
focusOnFirstItem: ()=>firstOptionRef.current?.focus()
|
|
19
|
+
}));
|
|
20
|
+
const getQuickFilterChipProps = (filter)=>{
|
|
21
|
+
const chipPropsByFilter = {
|
|
22
|
+
yesterday: {
|
|
23
|
+
isActive: props.yesterdaySelected ?? false,
|
|
24
|
+
onClick: ()=>props.onClickYestardayButton?.(),
|
|
25
|
+
label: locale.translate.dayQuickFilters.yesterday
|
|
26
|
+
},
|
|
27
|
+
today: {
|
|
28
|
+
isActive: props.todaySelected ?? false,
|
|
29
|
+
onClick: ()=>props.onClickTodayButton?.(),
|
|
30
|
+
label: locale.translate.dayQuickFilters.today
|
|
31
|
+
},
|
|
32
|
+
tomorrow: {
|
|
33
|
+
isActive: props.tomorrowSelected ?? false,
|
|
34
|
+
onClick: ()=>props.onClickTomorrowButton?.(),
|
|
35
|
+
label: locale.translate.dayQuickFilters.tomorrow
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
return chipPropsByFilter[filter];
|
|
39
|
+
};
|
|
40
|
+
return props.variants.map((variant, index)=>/*#__PURE__*/ jsx("li", {
|
|
41
|
+
onClick: ()=>{
|
|
42
|
+
props.onSelect?.(variant);
|
|
43
|
+
},
|
|
44
|
+
className: PeriodVariantList_module.optionContainer,
|
|
45
|
+
children: /*#__PURE__*/ jsxs("div", {
|
|
46
|
+
className: PeriodVariantList_module.option,
|
|
47
|
+
children: [
|
|
48
|
+
/*#__PURE__*/ jsx(Radiobutton, {
|
|
49
|
+
ref: 0 === index ? firstOptionRef : void 0,
|
|
50
|
+
checked: props.value?.value === variant.value,
|
|
51
|
+
onClick: (event)=>{
|
|
52
|
+
event.stopPropagation();
|
|
53
|
+
},
|
|
54
|
+
onKeyDown: (event)=>{
|
|
55
|
+
handleOptionKeyDown(event, variant);
|
|
56
|
+
},
|
|
57
|
+
children: variant.label
|
|
58
|
+
}),
|
|
59
|
+
variant.value === CalendarVariant.day && quickFilters.length > 0 && /*#__PURE__*/ jsx("div", {
|
|
60
|
+
style: {
|
|
61
|
+
display: 'flex'
|
|
62
|
+
},
|
|
63
|
+
className: PeriodVariantList_module.selectDayButtons,
|
|
64
|
+
onClick: (event)=>{
|
|
65
|
+
event.stopPropagation();
|
|
66
|
+
},
|
|
67
|
+
children: quickFilters.map((filter)=>{
|
|
68
|
+
const chipProps = getQuickFilterChipProps(filter);
|
|
69
|
+
return /*#__PURE__*/ jsx(Chip, {
|
|
70
|
+
className: cn(PeriodVariantList_module.chip, chipProps.isActive && PeriodVariantList_module.active),
|
|
71
|
+
isActive: chipProps.isActive,
|
|
72
|
+
onClick: chipProps.onClick,
|
|
73
|
+
small: true,
|
|
74
|
+
children: chipProps.label
|
|
75
|
+
}, filter);
|
|
76
|
+
})
|
|
77
|
+
})
|
|
78
|
+
]
|
|
79
|
+
})
|
|
80
|
+
}, variant.value));
|
|
81
|
+
});
|
|
82
|
+
PeriodVariantList.displayName = 'PeriodVariantList';
|
|
83
|
+
export { PeriodVariantList };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
.variantsList-AMTuu3 {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 10px 4px;
|
|
4
|
+
list-style-type: none;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
.divider-HQ6F5g {
|
|
8
|
+
padding: 8px 12px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.divider-HQ6F5g:after {
|
|
12
|
+
background-color: var(--border-normal, #d1d6df);
|
|
13
|
+
content: "";
|
|
14
|
+
width: 100%;
|
|
15
|
+
height: 1px;
|
|
16
|
+
display: block;
|
|
17
|
+
}
|
|
18
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type Ref } from 'react';
|
|
2
|
+
import { type PeriodVariantListRef } from '../PeriodVariantList';
|
|
3
|
+
import type { DateRangeFeatureProps, DateRangeValue, DateSelectVariant } from '../types';
|
|
4
|
+
interface SideMenuProps extends DateRangeFeatureProps {
|
|
5
|
+
value: DateRangeValue;
|
|
6
|
+
variantsListRef?: Ref<PeriodVariantListRef>;
|
|
7
|
+
onChangeVariant?: (variant: DateSelectVariant) => void;
|
|
8
|
+
onClickYestardayButton?: () => void;
|
|
9
|
+
onClickTodayButton?: () => void;
|
|
10
|
+
onClickTomorrowButton?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare const SideMenu: (props: SideMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { addDays, isSameDay, subDays } from "date-fns";
|
|
4
|
+
import { getAdditionalCalendarVariants, getCalendarVariants } from "../consts.js";
|
|
5
|
+
import { useLocale } from "../locale/index.js";
|
|
6
|
+
import { PeriodVariantList } from "../PeriodVariantList/index.js";
|
|
7
|
+
import { isDayValue } from "../utils.js";
|
|
8
|
+
import SideMenu_module from "./SideMenu.module.js";
|
|
9
|
+
const isYesterdayValue = (options)=>{
|
|
10
|
+
if (!isDayValue(options) || !options.value) return false;
|
|
11
|
+
return isSameDay(subDays(new Date(), 1), options.value);
|
|
12
|
+
};
|
|
13
|
+
const isTomorrowValue = (options)=>{
|
|
14
|
+
if (!isDayValue(options) || !options.value) return false;
|
|
15
|
+
return isSameDay(addDays(new Date(), 1), options.value);
|
|
16
|
+
};
|
|
17
|
+
const isTodayValue = (options)=>{
|
|
18
|
+
if (!isDayValue(options) || !options.value) return false;
|
|
19
|
+
return isSameDay(new Date(), options.value);
|
|
20
|
+
};
|
|
21
|
+
const SideMenu = (props)=>{
|
|
22
|
+
const locale = useLocale('DateRange');
|
|
23
|
+
const features = {
|
|
24
|
+
withPeriod: props.withPeriod,
|
|
25
|
+
withAnyDate: props.withAnyDate,
|
|
26
|
+
withNoDate: props.withNoDate
|
|
27
|
+
};
|
|
28
|
+
const calendarVariants = getCalendarVariants(locale, features);
|
|
29
|
+
const additionalCalendarVariants = getAdditionalCalendarVariants(locale, features);
|
|
30
|
+
const selectedCalendarMode = props.value.type;
|
|
31
|
+
const selectedVariant = useMemo(()=>[
|
|
32
|
+
...calendarVariants,
|
|
33
|
+
...additionalCalendarVariants
|
|
34
|
+
].find((variant)=>variant.value === selectedCalendarMode), [
|
|
35
|
+
additionalCalendarVariants,
|
|
36
|
+
calendarVariants,
|
|
37
|
+
selectedCalendarMode
|
|
38
|
+
]);
|
|
39
|
+
const handleSelectVariant = (option)=>{
|
|
40
|
+
props.onChangeVariant?.(option.value);
|
|
41
|
+
};
|
|
42
|
+
return /*#__PURE__*/ jsxs("ul", {
|
|
43
|
+
className: SideMenu_module.variantsList,
|
|
44
|
+
children: [
|
|
45
|
+
/*#__PURE__*/ jsx(PeriodVariantList, {
|
|
46
|
+
ref: props.variantsListRef,
|
|
47
|
+
value: selectedVariant,
|
|
48
|
+
variants: calendarVariants,
|
|
49
|
+
quickFilter: props.quickFilter,
|
|
50
|
+
onSelect: handleSelectVariant,
|
|
51
|
+
onClickTodayButton: props.onClickTodayButton,
|
|
52
|
+
onClickYestardayButton: props.onClickYestardayButton,
|
|
53
|
+
onClickTomorrowButton: props.onClickTomorrowButton,
|
|
54
|
+
yesterdaySelected: isYesterdayValue(props.value),
|
|
55
|
+
todaySelected: isTodayValue(props.value),
|
|
56
|
+
tomorrowSelected: isTomorrowValue(props.value)
|
|
57
|
+
}),
|
|
58
|
+
additionalCalendarVariants.length > 0 && /*#__PURE__*/ jsxs(Fragment, {
|
|
59
|
+
children: [
|
|
60
|
+
/*#__PURE__*/ jsx("div", {
|
|
61
|
+
className: SideMenu_module.divider
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ jsx(PeriodVariantList, {
|
|
64
|
+
value: selectedVariant,
|
|
65
|
+
variants: additionalCalendarVariants,
|
|
66
|
+
onSelect: handleSelectVariant
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
export { SideMenu };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { Hint } from "../../Hint/Hint.js";
|
|
4
|
+
import { Text, TextColor, TextTag } from "../../Text/Text.js";
|
|
5
|
+
const TooltipedText = (props)=>{
|
|
6
|
+
const bodyTextRef = useRef(null);
|
|
7
|
+
const [isShowHint, setIsShowHint] = useState(false);
|
|
8
|
+
useEffect(()=>{
|
|
9
|
+
if (!bodyTextRef.current) return void setIsShowHint(false);
|
|
10
|
+
setIsShowHint(bodyTextRef.current?.clientWidth < bodyTextRef.current?.scrollWidth);
|
|
11
|
+
}, [
|
|
12
|
+
props.children
|
|
13
|
+
]);
|
|
14
|
+
return /*#__PURE__*/ jsx(Hint, {
|
|
15
|
+
zIndex: props.tooltipZIndex ?? 3,
|
|
16
|
+
trigger: isShowHint ? 'hover' : [],
|
|
17
|
+
overlay: /*#__PURE__*/ jsx(Text.Body, {
|
|
18
|
+
colorToken: TextColor.invert,
|
|
19
|
+
children: props.tooltipText ?? props.children
|
|
20
|
+
}),
|
|
21
|
+
placement: "top",
|
|
22
|
+
children: /*#__PURE__*/ jsx(Text.Body, {
|
|
23
|
+
ref: bodyTextRef,
|
|
24
|
+
className: props.className,
|
|
25
|
+
as: TextTag.span,
|
|
26
|
+
children: props.children
|
|
27
|
+
})
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
export { TooltipedText };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import "./Year_module.css";
|
|
2
|
+
const Year_module = {
|
|
3
|
+
yearWrapper: "yearWrapper-aWYUOF",
|
|
4
|
+
header: "header-W7bT62",
|
|
5
|
+
year: "year-QQyr67",
|
|
6
|
+
month: "month-qcQBFx",
|
|
7
|
+
current: "current-VqC3bQ",
|
|
8
|
+
selected: "selected-Y2hnss",
|
|
9
|
+
monthText: "monthText-BsHwbr"
|
|
10
|
+
};
|
|
11
|
+
export default Year_module;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
.yearWrapper-aWYUOF {
|
|
2
|
+
flex-direction: column;
|
|
3
|
+
gap: 4px;
|
|
4
|
+
margin-bottom: 8px;
|
|
5
|
+
display: flex;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.header-W7bT62 {
|
|
9
|
+
color: var(--text-primary, #091739);
|
|
10
|
+
justify-content: center;
|
|
11
|
+
padding: 6px 4px 6px 16px;
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.year-QQyr67 {
|
|
16
|
+
color: var(--text-primary, #091739);
|
|
17
|
+
grid-template-columns: repeat(3, 1fr);
|
|
18
|
+
row-gap: 4px;
|
|
19
|
+
padding-left: 16px;
|
|
20
|
+
padding-right: 4px;
|
|
21
|
+
display: grid;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.month-qcQBFx {
|
|
25
|
+
cursor: pointer;
|
|
26
|
+
border-radius: 8px;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
align-items: center;
|
|
29
|
+
padding: 6px 0;
|
|
30
|
+
display: flex;
|
|
31
|
+
position: relative;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.month-qcQBFx.current-VqC3bQ:after {
|
|
35
|
+
background-color: var(--elements-accent, #036ce5);
|
|
36
|
+
content: "";
|
|
37
|
+
border-radius: 4px;
|
|
38
|
+
width: 4px;
|
|
39
|
+
height: 4px;
|
|
40
|
+
position: absolute;
|
|
41
|
+
bottom: 4px;
|
|
42
|
+
left: 35px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.month-qcQBFx:hover {
|
|
46
|
+
outline: 1px solid var(--border-accent, #036ce5);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.month-qcQBFx.selected-Y2hnss {
|
|
50
|
+
background-color: var(--button-primary-normal, #036ce5);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.month-qcQBFx.selected-Y2hnss .monthText-BsHwbr {
|
|
54
|
+
color: var(--invert-text);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.month-qcQBFx.selected-Y2hnss.current-VqC3bQ:after {
|
|
58
|
+
background-color: var(--invert-text, #fff);
|
|
59
|
+
}
|
|
60
|
+
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { format, isSameMonth, startOfDay } from "date-fns";
|
|
3
|
+
import { cn } from "../../../common/index.js";
|
|
4
|
+
import { Text } from "../../Text/Text.js";
|
|
5
|
+
import { useLocaleContext } from "../../../context/contexts/index.js";
|
|
6
|
+
import { LocaleKey, useLocale } from "../locale/index.js";
|
|
7
|
+
import { capitalizeFirstLetter, getFormatOptions, getRangeDates, isMonthValue, mapYearMonths } from "../utils.js";
|
|
8
|
+
import Year_module from "./Year.module.js";
|
|
9
|
+
const Year = (props)=>{
|
|
10
|
+
const { locale } = useLocaleContext();
|
|
11
|
+
const translates = useLocale('DateRange', LocaleKey.Locale);
|
|
12
|
+
const year = props.year.getFullYear();
|
|
13
|
+
const isSelectedMonth = (monthStartDate)=>{
|
|
14
|
+
if (!isMonthValue(props.value)) return false;
|
|
15
|
+
const { startDate } = getRangeDates(props.value);
|
|
16
|
+
return startDate && isSameMonth(startDate, monthStartDate);
|
|
17
|
+
};
|
|
18
|
+
return /*#__PURE__*/ jsxs("div", {
|
|
19
|
+
className: Year_module.yearWrapper,
|
|
20
|
+
children: [
|
|
21
|
+
/*#__PURE__*/ jsx("div", {
|
|
22
|
+
className: Year_module.header,
|
|
23
|
+
children: /*#__PURE__*/ jsx(Text.Body, {
|
|
24
|
+
children: year
|
|
25
|
+
})
|
|
26
|
+
}),
|
|
27
|
+
/*#__PURE__*/ jsx("div", {
|
|
28
|
+
className: Year_module.year,
|
|
29
|
+
children: mapYearMonths(year, (date)=>{
|
|
30
|
+
const isSelected = isSelectedMonth(date);
|
|
31
|
+
const isCurrentMonth = isSameMonth(new Date(), date);
|
|
32
|
+
return /*#__PURE__*/ jsx("div", {
|
|
33
|
+
className: cn(Year_module.month, isCurrentMonth && Year_module.current, isSelected && Year_module.selected),
|
|
34
|
+
onClick: ()=>{
|
|
35
|
+
props.onSelectDate?.(startOfDay(date));
|
|
36
|
+
},
|
|
37
|
+
children: /*#__PURE__*/ jsx(Text.Body, {
|
|
38
|
+
className: Year_module.monthText,
|
|
39
|
+
children: capitalizeFirstLetter(format(date, translates.format.monthCalendarFormat, getFormatOptions(locale)))
|
|
40
|
+
})
|
|
41
|
+
}, +date);
|
|
42
|
+
})
|
|
43
|
+
})
|
|
44
|
+
]
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
export { Year };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
.scrollContainer-uO8xiZ {
|
|
2
|
+
width: 252px;
|
|
3
|
+
margin-right: 4px;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.scrollContainer-uO8xiZ::-webkit-scrollbar {
|
|
7
|
+
width: 8px;
|
|
8
|
+
padding: 0 4px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.scrollContainer-uO8xiZ::-webkit-scrollbar-thumb {
|
|
12
|
+
background-color: var(--border-normal, #d1d6df);
|
|
13
|
+
border-radius: 8px;
|
|
14
|
+
}
|
|
15
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import { type VirtuosoHandle } from 'react-virtuoso';
|
|
3
|
+
import type { DateRangeValue } from '../types';
|
|
4
|
+
interface YearsListProps {
|
|
5
|
+
virtuosoRef?: RefObject<VirtuosoHandle>;
|
|
6
|
+
minDate: Date;
|
|
7
|
+
maxDate: Date;
|
|
8
|
+
value: DateRangeValue;
|
|
9
|
+
onSelectDate?: (date: Date) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare const YearsList: (props: YearsListProps) => import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Virtuoso } from "react-virtuoso";
|
|
3
|
+
import { eachYearOfInterval } from "date-fns";
|
|
4
|
+
import { getRangeDates, isMonthValue } from "../utils.js";
|
|
5
|
+
import { Year } from "../Year/index.js";
|
|
6
|
+
import YearsList_module from "./YearsList.module.js";
|
|
7
|
+
const getDateToScroll = (value)=>{
|
|
8
|
+
if (isMonthValue(value)) {
|
|
9
|
+
const { startDate } = getRangeDates(value);
|
|
10
|
+
if (startDate) return startDate;
|
|
11
|
+
}
|
|
12
|
+
return new Date();
|
|
13
|
+
};
|
|
14
|
+
const getYearToScrollIndex = (value, minDate)=>{
|
|
15
|
+
const dateToScroll = getDateToScroll(value);
|
|
16
|
+
const yearToScroll = dateToScroll.getFullYear();
|
|
17
|
+
const minYear = minDate.getFullYear();
|
|
18
|
+
return yearToScroll - minYear;
|
|
19
|
+
};
|
|
20
|
+
const YearsList = (props)=>{
|
|
21
|
+
const yearFirstDays = eachYearOfInterval({
|
|
22
|
+
start: props.minDate,
|
|
23
|
+
end: props.maxDate
|
|
24
|
+
});
|
|
25
|
+
const currentYearIndex = getYearToScrollIndex(props.value, props.minDate);
|
|
26
|
+
return /*#__PURE__*/ jsx(Virtuoso, {
|
|
27
|
+
ref: props.virtuosoRef,
|
|
28
|
+
style: {
|
|
29
|
+
height: '300px'
|
|
30
|
+
},
|
|
31
|
+
className: YearsList_module.scrollContainer,
|
|
32
|
+
totalCount: yearFirstDays.length,
|
|
33
|
+
initialTopMostItemIndex: {
|
|
34
|
+
index: currentYearIndex,
|
|
35
|
+
align: 'center'
|
|
36
|
+
},
|
|
37
|
+
itemContent: (index)=>{
|
|
38
|
+
const yearFirstDate = yearFirstDays[index];
|
|
39
|
+
return /*#__PURE__*/ jsx(Year, {
|
|
40
|
+
year: yearFirstDate,
|
|
41
|
+
value: props.value,
|
|
42
|
+
onSelectDate: props.onSelectDate
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
};
|
|
47
|
+
export { YearsList };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { DateRangeFeatureProps, DateRangeLocale, DateSelectVariant } from './types';
|
|
2
|
+
export declare const CalendarVariant: Record<DateSelectVariant, DateSelectVariant>;
|
|
3
|
+
export declare const DATES_DELIMETER = " \u2014 ";
|
|
4
|
+
export declare const FOCUSED_WIDTH_WITHOUT_TIME = 252;
|
|
5
|
+
export declare const FOCUSED_WIDTH_WITH_TIME = 308;
|
|
6
|
+
export declare const FOCUSED_WIDTH_WITH_TIME_EN = 316;
|
|
7
|
+
export declare const DEFAULT_HINT_Z_INDEX = 3;
|
|
8
|
+
export declare const KEYBOARD_ACTIVATION_KEYS: string[];
|
|
9
|
+
export declare const NAVIGATION_VARIANTS: readonly [DateSelectVariant, DateSelectVariant, DateSelectVariant];
|
|
10
|
+
export declare const INPUT_CONTENT_VARIANTS: readonly [DateSelectVariant, DateSelectVariant, DateSelectVariant, DateSelectVariant, DateSelectVariant];
|
|
11
|
+
export declare const NON_CALENDAR_VARIANTS: readonly [DateSelectVariant, DateSelectVariant];
|
|
12
|
+
export declare const getCalendarVariants: (locale: DateRangeLocale, features?: DateRangeFeatureProps) => {
|
|
13
|
+
value: DateSelectVariant;
|
|
14
|
+
label: string;
|
|
15
|
+
}[];
|
|
16
|
+
export declare const getAdditionalCalendarVariants: (locale: DateRangeLocale, features?: DateRangeFeatureProps) => {
|
|
17
|
+
value: DateSelectVariant;
|
|
18
|
+
label: string;
|
|
19
|
+
}[];
|
|
20
|
+
export declare const getDefaultVariant: (features?: DateRangeFeatureProps) => DateSelectVariant;
|