@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,81 @@
|
|
|
1
|
+
const CalendarVariant = {
|
|
2
|
+
period: 'period',
|
|
3
|
+
day: 'day',
|
|
4
|
+
week: 'week',
|
|
5
|
+
month: 'month',
|
|
6
|
+
anyDate: 'anyDate',
|
|
7
|
+
noDate: 'noDate'
|
|
8
|
+
};
|
|
9
|
+
const DATES_DELIMETER = ' — ';
|
|
10
|
+
const FOCUSED_WIDTH_WITHOUT_TIME = 252;
|
|
11
|
+
const FOCUSED_WIDTH_WITH_TIME = 308;
|
|
12
|
+
const FOCUSED_WIDTH_WITH_TIME_EN = 316;
|
|
13
|
+
const DEFAULT_HINT_Z_INDEX = 3;
|
|
14
|
+
const KEYBOARD_ACTIVATION_KEYS = [
|
|
15
|
+
'Enter',
|
|
16
|
+
' '
|
|
17
|
+
];
|
|
18
|
+
const NAVIGATION_VARIANTS = [
|
|
19
|
+
CalendarVariant.day,
|
|
20
|
+
CalendarVariant.week,
|
|
21
|
+
CalendarVariant.month
|
|
22
|
+
];
|
|
23
|
+
const INPUT_CONTENT_VARIANTS = [
|
|
24
|
+
CalendarVariant.day,
|
|
25
|
+
CalendarVariant.week,
|
|
26
|
+
CalendarVariant.month,
|
|
27
|
+
CalendarVariant.anyDate,
|
|
28
|
+
CalendarVariant.noDate
|
|
29
|
+
];
|
|
30
|
+
const NON_CALENDAR_VARIANTS = [
|
|
31
|
+
CalendarVariant.anyDate,
|
|
32
|
+
CalendarVariant.noDate
|
|
33
|
+
];
|
|
34
|
+
const calendarVariants = [
|
|
35
|
+
{
|
|
36
|
+
value: CalendarVariant.period,
|
|
37
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.period
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
value: CalendarVariant.day,
|
|
41
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.day
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
value: CalendarVariant.week,
|
|
45
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.week
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
value: CalendarVariant.month,
|
|
49
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.month
|
|
50
|
+
}
|
|
51
|
+
];
|
|
52
|
+
const additionalCalendarVariants = [
|
|
53
|
+
{
|
|
54
|
+
value: CalendarVariant.anyDate,
|
|
55
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.anyDate
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
value: CalendarVariant.noDate,
|
|
59
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.noDate
|
|
60
|
+
}
|
|
61
|
+
];
|
|
62
|
+
const getCalendarVariants = (locale, features)=>calendarVariants.filter((variant)=>{
|
|
63
|
+
if (variant.value === CalendarVariant.period) return features?.withPeriod !== false;
|
|
64
|
+
return true;
|
|
65
|
+
}).map((variant)=>({
|
|
66
|
+
value: variant.value,
|
|
67
|
+
label: variant.labelGetter(locale)
|
|
68
|
+
}));
|
|
69
|
+
const getAdditionalCalendarVariants = (locale, features)=>additionalCalendarVariants.filter((variant)=>{
|
|
70
|
+
if (variant.value === CalendarVariant.anyDate) return features?.withAnyDate !== false;
|
|
71
|
+
if (variant.value === CalendarVariant.noDate) return features?.withNoDate !== false;
|
|
72
|
+
return true;
|
|
73
|
+
}).map((variant)=>({
|
|
74
|
+
value: variant.value,
|
|
75
|
+
label: variant.labelGetter(locale)
|
|
76
|
+
}));
|
|
77
|
+
const getDefaultVariant = (features)=>{
|
|
78
|
+
if (features?.withPeriod !== false) return CalendarVariant.period;
|
|
79
|
+
return CalendarVariant.day;
|
|
80
|
+
};
|
|
81
|
+
export { CalendarVariant, DATES_DELIMETER, DEFAULT_HINT_Z_INDEX, FOCUSED_WIDTH_WITHOUT_TIME, FOCUSED_WIDTH_WITH_TIME, FOCUSED_WIDTH_WITH_TIME_EN, INPUT_CONTENT_VARIANTS, KEYBOARD_ACTIVATION_KEYS, NAVIGATION_VARIANTS, NON_CALENDAR_VARIANTS, getAdditionalCalendarVariants, getCalendarVariants, getDefaultVariant };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { LanguageValue } from '../../context/constants';
|
|
2
|
+
import type { DateRangeLocale, DateRangeValue } from './types';
|
|
3
|
+
export declare const joinFormattedDateRange: (startDate: string, endDate: string) => string;
|
|
4
|
+
export declare const splitFormattedDateRange: (value: string) => {
|
|
5
|
+
startDate: string;
|
|
6
|
+
endDate: string;
|
|
7
|
+
};
|
|
8
|
+
interface LocaleOptions {
|
|
9
|
+
translates: DateRangeLocale;
|
|
10
|
+
formatTranslates: DateRangeLocale;
|
|
11
|
+
lang: LanguageValue;
|
|
12
|
+
}
|
|
13
|
+
export declare const getDateRangePeriodName: (value: DateRangeValue, translates: DateRangeLocale) => string;
|
|
14
|
+
export declare const getDateRangeSliderText: (value: DateRangeValue, localeOptions: LocaleOptions) => {
|
|
15
|
+
text: string;
|
|
16
|
+
tooltipText: string;
|
|
17
|
+
} | null;
|
|
18
|
+
export interface FormatDateRangeValueOptions extends LocaleOptions {
|
|
19
|
+
withTime?: boolean;
|
|
20
|
+
periodFormattedValue?: string;
|
|
21
|
+
emptyPeriodMaskValue?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare const formatDateRangeValue: (value: DateRangeValue, options: FormatDateRangeValueOptions) => string | undefined;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { format, isSameMonth, isToday, isTomorrow, isYesterday } from "date-fns";
|
|
2
|
+
import { DATES_DELIMETER } from "./consts.js";
|
|
3
|
+
import { capitalizeFirstLetter, getFormatOptions, getPeriodValue, getRangeDates, isAnyDateValue, isDayValue, isMonthValue, isNoDateValue, isRangeValue, isValueNullable, isWeekValue } from "./utils.js";
|
|
4
|
+
const joinFormattedDateRange = (startDate, endDate)=>`${startDate}${DATES_DELIMETER}${endDate}`;
|
|
5
|
+
const splitFormattedDateRange = (value)=>{
|
|
6
|
+
const [startDate, endDate] = value.split(DATES_DELIMETER);
|
|
7
|
+
return {
|
|
8
|
+
startDate,
|
|
9
|
+
endDate
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
const removeDots = (str)=>str.replace(/\./g, '');
|
|
13
|
+
const getWeekIntervalText = ({ startDate, endDate }, localeOptions)=>{
|
|
14
|
+
const formatOptions = getFormatOptions(localeOptions.lang);
|
|
15
|
+
if (isSameMonth(startDate, endDate)) {
|
|
16
|
+
const formatedStartDate = format(startDate, localeOptions.formatTranslates.format.slider.week.dateFormat.sameMonth.firstDate, formatOptions);
|
|
17
|
+
const formatedTooltipStartDate = format(startDate, localeOptions.formatTranslates.format.slider.week.tooltipDateFormat.sameMonth.firstDate, formatOptions);
|
|
18
|
+
const formatedEndDate = format(endDate, localeOptions.formatTranslates.format.slider.week.dateFormat.sameMonth.endDate, formatOptions);
|
|
19
|
+
const formatedTooltipEndDate = format(endDate, localeOptions.formatTranslates.format.slider.week.tooltipDateFormat.sameMonth.endDate, formatOptions);
|
|
20
|
+
return {
|
|
21
|
+
text: `${formatedStartDate}–${formatedEndDate}`,
|
|
22
|
+
tooltipText: `${formatedTooltipStartDate}–${formatedTooltipEndDate}`
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const formatedStartDate = format(startDate, localeOptions.formatTranslates.format.slider.week.dateFormat.differentMonth.firstDate, formatOptions);
|
|
26
|
+
const formatedTooltipStartDate = format(startDate, localeOptions.formatTranslates.format.slider.week.tooltipDateFormat.differentMonth.firstDate, formatOptions);
|
|
27
|
+
const formatedEndDate = format(endDate, localeOptions.formatTranslates.format.slider.week.dateFormat.differentMonth.endDate, formatOptions);
|
|
28
|
+
const formatedTooltipEndDate = format(endDate, localeOptions.formatTranslates.format.slider.week.tooltipDateFormat.differentMonth.endDate, formatOptions);
|
|
29
|
+
return {
|
|
30
|
+
text: removeDots(`${formatedStartDate} — ${formatedEndDate}`),
|
|
31
|
+
tooltipText: `${formatedTooltipStartDate} — ${formatedTooltipEndDate}`
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
const getDayText = (options, localeOptions)=>{
|
|
35
|
+
if (!options.value) return localeOptions.translates.translate.slider.day.placeholder;
|
|
36
|
+
return format(options.value, localeOptions.formatTranslates.format.slider.day.dateFormat, getFormatOptions(localeOptions.lang));
|
|
37
|
+
};
|
|
38
|
+
const getWeekText = (options, localeOptions)=>{
|
|
39
|
+
const unselectedTexts = {
|
|
40
|
+
text: localeOptions.translates.translate.slider.week.placeholder,
|
|
41
|
+
tooltipText: localeOptions.translates.translate.slider.week.placeholder
|
|
42
|
+
};
|
|
43
|
+
if (!options.value) return unselectedTexts;
|
|
44
|
+
const { startDate, endDate } = getRangeDates(options);
|
|
45
|
+
if (!startDate || !endDate) return unselectedTexts;
|
|
46
|
+
return getWeekIntervalText({
|
|
47
|
+
startDate,
|
|
48
|
+
endDate
|
|
49
|
+
}, localeOptions);
|
|
50
|
+
};
|
|
51
|
+
const getMonthText = (options, localeOptions)=>{
|
|
52
|
+
const unselectedText = localeOptions.translates.translate.slider.month.placeholder;
|
|
53
|
+
if (!options.value) return unselectedText;
|
|
54
|
+
const { startDate, endDate } = getRangeDates(options);
|
|
55
|
+
if (!startDate || !endDate) return unselectedText;
|
|
56
|
+
const text = format(startDate, localeOptions.formatTranslates.format.slider.month.dateFormat, getFormatOptions(localeOptions.lang));
|
|
57
|
+
return capitalizeFirstLetter(text);
|
|
58
|
+
};
|
|
59
|
+
const getDayPeriodName = (options, translates)=>{
|
|
60
|
+
if (options.value && isToday(options.value)) return translates.translate.dayQuickFilters.today;
|
|
61
|
+
if (options.value && isYesterday(options.value)) return translates.translate.dayQuickFilters.yesterday;
|
|
62
|
+
if (options.value && isTomorrow(options.value)) return translates.translate.dayQuickFilters.tomorrow;
|
|
63
|
+
return translates.translate.slider.day.title;
|
|
64
|
+
};
|
|
65
|
+
const getDateRangePeriodName = (value, translates)=>{
|
|
66
|
+
if (isDayValue(value)) return getDayPeriodName(value, translates);
|
|
67
|
+
if (isWeekValue(value)) return translates.translate.slider.week.title;
|
|
68
|
+
if (isMonthValue(value)) return translates.translate.slider.month.title;
|
|
69
|
+
if (isAnyDateValue(value)) return translates.translate.radiobuttons.anyDate;
|
|
70
|
+
if (isNoDateValue(value)) return translates.translate.radiobuttons.noDate;
|
|
71
|
+
return translates.translate.radiobuttons.period;
|
|
72
|
+
};
|
|
73
|
+
const getDateRangeSliderText = (value, localeOptions)=>{
|
|
74
|
+
if (isDayValue(value)) {
|
|
75
|
+
const text = getDayText(value, localeOptions);
|
|
76
|
+
return {
|
|
77
|
+
text,
|
|
78
|
+
tooltipText: text
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
if (isWeekValue(value)) return getWeekText(value, localeOptions);
|
|
82
|
+
if (isMonthValue(value)) {
|
|
83
|
+
const text = getMonthText(value, localeOptions);
|
|
84
|
+
return {
|
|
85
|
+
text,
|
|
86
|
+
tooltipText: text
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
return null;
|
|
90
|
+
};
|
|
91
|
+
const formatPeriodDates = (startDate, endDate, translates, withTime)=>{
|
|
92
|
+
const formatDate = (date)=>{
|
|
93
|
+
const timeString = format(date, 'HH:mm');
|
|
94
|
+
return `${format(date, translates.format.dateFormat)}${withTime ? ` ${timeString}` : ''}`;
|
|
95
|
+
};
|
|
96
|
+
return joinFormattedDateRange(formatDate(startDate), formatDate(endDate));
|
|
97
|
+
};
|
|
98
|
+
const formatDateRangeValue = (value, options)=>{
|
|
99
|
+
if (isAnyDateValue(value)) return options.translates.translate.radiobuttons.anyDate;
|
|
100
|
+
if (isNoDateValue(value)) return options.translates.translate.radiobuttons.noDate;
|
|
101
|
+
if (isValueNullable(value)) return;
|
|
102
|
+
if (isRangeValue(value)) {
|
|
103
|
+
if (void 0 !== options.periodFormattedValue) {
|
|
104
|
+
const maskValue = options.periodFormattedValue.trim();
|
|
105
|
+
if (!maskValue || maskValue === options.emptyPeriodMaskValue) return;
|
|
106
|
+
return maskValue;
|
|
107
|
+
}
|
|
108
|
+
const { startDate, endDate } = getPeriodValue(value.value);
|
|
109
|
+
if (!startDate || !endDate) return;
|
|
110
|
+
return formatPeriodDates(startDate, endDate, options.translates, options.withTime ?? false);
|
|
111
|
+
}
|
|
112
|
+
if (isDayValue(value)) return getDayText(value, options);
|
|
113
|
+
if (isWeekValue(value)) return getWeekText(value, options).text;
|
|
114
|
+
if (isMonthValue(value)) return getMonthText(value, options);
|
|
115
|
+
};
|
|
116
|
+
export { formatDateRangeValue, getDateRangePeriodName, getDateRangeSliderText, joinFormattedDateRange, splitFormattedDateRange };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { DateRangeValue } from '../types';
|
|
2
|
+
interface UseCalendarArgs {
|
|
3
|
+
minDate?: Date;
|
|
4
|
+
maxDate?: Date;
|
|
5
|
+
value: DateRangeValue;
|
|
6
|
+
onChangeValue?: (value: DateRangeValue) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const useCalendar: (args: UseCalendarArgs) => {
|
|
9
|
+
handlePickDate: (date: Date) => void;
|
|
10
|
+
minDate: Date;
|
|
11
|
+
maxDate: Date;
|
|
12
|
+
};
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { addYears, endOfDay, endOfMonth, endOfWeek, endOfYear, startOfDay, startOfWeek, startOfYear, subYears } from "date-fns";
|
|
2
|
+
import { CalendarVariant } from "../consts.js";
|
|
3
|
+
import { getCorrectInterval, getRangeDates, isDayValue, isMonthValue, isRangeValue, isWeekValue } from "../utils.js";
|
|
4
|
+
const useCalendar = (args)=>{
|
|
5
|
+
const changePeriodValue = (dates)=>{
|
|
6
|
+
const value = {
|
|
7
|
+
type: 'period',
|
|
8
|
+
value: [
|
|
9
|
+
dates.startDate,
|
|
10
|
+
dates.endDate
|
|
11
|
+
]
|
|
12
|
+
};
|
|
13
|
+
args.onChangeValue?.(value);
|
|
14
|
+
};
|
|
15
|
+
const handlePickRangeDate = (date)=>{
|
|
16
|
+
const { startDate, endDate } = getRangeDates(args.value);
|
|
17
|
+
if (endDate && startDate) return void changePeriodValue({
|
|
18
|
+
startDate: date,
|
|
19
|
+
endDate: null
|
|
20
|
+
});
|
|
21
|
+
if (startDate) {
|
|
22
|
+
const [firstDayOfInterval, secondDayOfInterval] = getCorrectInterval(startDate, date);
|
|
23
|
+
changePeriodValue({
|
|
24
|
+
startDate: firstDayOfInterval,
|
|
25
|
+
endDate: endOfDay(secondDayOfInterval)
|
|
26
|
+
});
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
if (endDate) {
|
|
30
|
+
const [firstDayOfInterval, secondDayOfInterval] = getCorrectInterval(endDate, date);
|
|
31
|
+
changePeriodValue({
|
|
32
|
+
startDate: startOfDay(firstDayOfInterval),
|
|
33
|
+
endDate: secondDayOfInterval
|
|
34
|
+
});
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
changePeriodValue({
|
|
38
|
+
startDate: date,
|
|
39
|
+
endDate: null
|
|
40
|
+
});
|
|
41
|
+
};
|
|
42
|
+
const handlePickSingleDay = (date)=>{
|
|
43
|
+
args.onChangeValue?.({
|
|
44
|
+
type: CalendarVariant.day,
|
|
45
|
+
value: date
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
const handlePickWeek = (date)=>{
|
|
49
|
+
const firstDay = startOfWeek(date, {
|
|
50
|
+
weekStartsOn: 1
|
|
51
|
+
});
|
|
52
|
+
const lastDay = endOfWeek(date, {
|
|
53
|
+
weekStartsOn: 1
|
|
54
|
+
});
|
|
55
|
+
args.onChangeValue?.({
|
|
56
|
+
type: CalendarVariant.week,
|
|
57
|
+
value: [
|
|
58
|
+
firstDay,
|
|
59
|
+
lastDay
|
|
60
|
+
]
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
const handlePickMonth = (date)=>{
|
|
64
|
+
const endDate = endOfMonth(date);
|
|
65
|
+
args.onChangeValue?.({
|
|
66
|
+
type: CalendarVariant.month,
|
|
67
|
+
value: [
|
|
68
|
+
date,
|
|
69
|
+
endDate
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
const handlePickDate = (date)=>{
|
|
74
|
+
if (isRangeValue(args.value)) handlePickRangeDate(date);
|
|
75
|
+
if (isDayValue(args.value)) handlePickSingleDay(date);
|
|
76
|
+
if (isWeekValue(args.value)) handlePickWeek(date);
|
|
77
|
+
if (isMonthValue(args.value)) handlePickMonth(date);
|
|
78
|
+
};
|
|
79
|
+
const currentDate = new Date();
|
|
80
|
+
const minDate = args.minDate ? new Date(args.minDate) : startOfYear(subYears(currentDate, 100));
|
|
81
|
+
const maxDate = args.maxDate ? new Date(args.maxDate) : endOfYear(addYears(currentDate, 100));
|
|
82
|
+
return {
|
|
83
|
+
handlePickDate,
|
|
84
|
+
minDate,
|
|
85
|
+
maxDate
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
export { useCalendar };
|