@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
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
.container-
|
|
1
|
+
.container-Oy3B6y {
|
|
2
2
|
justify-content: flex-start;
|
|
3
3
|
align-items: center;
|
|
4
4
|
gap: 4px;
|
|
5
5
|
display: flex;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.textWithRequiredMark-
|
|
8
|
+
.textWithRequiredMark-RgeNds {
|
|
9
9
|
align-items: center;
|
|
10
10
|
display: flex;
|
|
11
11
|
overflow: hidden;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.labelText-
|
|
14
|
+
.labelText-DXFBW5 {
|
|
15
15
|
flex: 1;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.requiredMark-
|
|
18
|
+
.requiredMark-DNwhjO {
|
|
19
19
|
color: var(--elements-critical, #e50347);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
.overflowText-
|
|
22
|
+
.overflowText-pVcM4P {
|
|
23
23
|
text-overflow: ellipsis;
|
|
24
24
|
white-space: nowrap;
|
|
25
25
|
overflow: hidden;
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.overflowText-
|
|
28
|
+
.overflowText-pVcM4P:after {
|
|
29
29
|
content: "";
|
|
30
30
|
display: block;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
.hint-
|
|
33
|
+
.hint-nBYA67 {
|
|
34
34
|
box-sizing: border-box;
|
|
35
35
|
overflow-wrap: break-word;
|
|
36
36
|
max-width: 300px;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
.hintText-
|
|
39
|
+
.hintText-ZiFJHZ {
|
|
40
40
|
overflow-wrap: break-word;
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "
|
|
3
|
-
import { Help } from "
|
|
2
|
+
import { cn } from "../../../../common/css/cn.js";
|
|
3
|
+
import { Help } from "../../../Help/Help.js";
|
|
4
4
|
import HelpButton_module from "./HelpButton.module.js";
|
|
5
5
|
const HelpButton = ({ size, helpProps, className })=>/*#__PURE__*/ jsx("div", {
|
|
6
6
|
className: cn(HelpButton_module.container, className),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "
|
|
2
|
+
import { cn } from "../../../common/index.js";
|
|
3
3
|
import FieldRow_module from "./FieldRow.module.js";
|
|
4
4
|
const FieldRow = ({ children, helpComponent, className, controlClassName, helpClassName })=>/*#__PURE__*/ jsxs("div", {
|
|
5
5
|
className: cn(FieldRow_module.main, className),
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
.main-
|
|
1
|
+
.main-sxY40U {
|
|
2
2
|
align-items: center;
|
|
3
3
|
width: 100%;
|
|
4
4
|
display: flex;
|
|
5
5
|
position: relative;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
.control-
|
|
8
|
+
.control-H2iwSf {
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
flex: 1;
|
|
11
11
|
display: flex;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.help-
|
|
14
|
+
.help-M7JGK9 {
|
|
15
15
|
flex-direction: column;
|
|
16
16
|
align-items: flex-end;
|
|
17
17
|
width: 32px;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type IHasTestId } from '
|
|
1
|
+
import { type IHasTestId } from '../../../common/types';
|
|
2
|
+
import { type InfoSizeValue } from './types';
|
|
2
3
|
export interface InfoProps extends IHasTestId {
|
|
3
4
|
info?: string;
|
|
4
5
|
error?: boolean;
|
|
@@ -6,5 +7,6 @@ export interface InfoProps extends IHasTestId {
|
|
|
6
7
|
disabled?: boolean;
|
|
7
8
|
isEllipsis?: boolean;
|
|
8
9
|
className?: string;
|
|
10
|
+
size?: InfoSizeValue;
|
|
9
11
|
}
|
|
10
12
|
export declare const Info: import("react").ForwardRefExoticComponent<InfoProps & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useState } from "react";
|
|
3
|
-
import { cn } from "
|
|
4
|
-
import { Hint } from "
|
|
5
|
-
import { Text, TextColor } from "
|
|
6
|
-
import { useIsElementOverflowing } from "
|
|
3
|
+
import { cn } from "../../../common/css/cn.js";
|
|
4
|
+
import { Hint } from "../../Hint/Hint.js";
|
|
5
|
+
import { Text, TextColor, TextVariant } from "../../Text/Text.js";
|
|
6
|
+
import { useIsElementOverflowing } from "../../../hooks/useIsElementOverflowing/index.js";
|
|
7
|
+
import { InfoSize } from "./types/index.js";
|
|
7
8
|
import Info_module from "./Info.module.js";
|
|
8
|
-
const Info = /*#__PURE__*/ forwardRef(({ info, error, warning, disabled, testId, isEllipsis, className }, ref)=>{
|
|
9
|
+
const Info = /*#__PURE__*/ forwardRef(({ info, error, warning, disabled, testId, isEllipsis, className, size = InfoSize.M }, ref)=>{
|
|
9
10
|
const { ref: infoRef, isOverflowing: isOverflowingInfo } = useIsElementOverflowing([
|
|
10
11
|
info
|
|
11
12
|
], isEllipsis ? ref : null);
|
|
@@ -16,7 +17,9 @@ const Info = /*#__PURE__*/ forwardRef(({ info, error, warning, disabled, testId,
|
|
|
16
17
|
if (!disabled && warning) return TextColor.attention;
|
|
17
18
|
return TextColor.secondary;
|
|
18
19
|
};
|
|
19
|
-
const
|
|
20
|
+
const textVariant = size === InfoSize.M ? TextVariant.caption : TextVariant.body;
|
|
21
|
+
const caption = /*#__PURE__*/ jsx(Text, {
|
|
22
|
+
variant: textVariant,
|
|
20
23
|
ref: isEllipsis ? infoRef : void 0,
|
|
21
24
|
className: cn(Info_module.info, isEllipsis ? Info_module.ellipsis : Info_module.wrap, className),
|
|
22
25
|
colorToken: getColor(),
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
.info-
|
|
1
|
+
.info-ZKbH17 {
|
|
2
2
|
margin: 0;
|
|
3
3
|
position: relative;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.wrap-
|
|
6
|
+
.wrap-iIsMFE {
|
|
7
7
|
overflow-wrap: break-word;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
.ellipsis-
|
|
10
|
+
.ellipsis-TRaKmy {
|
|
11
11
|
text-overflow: ellipsis;
|
|
12
12
|
white-space: nowrap;
|
|
13
13
|
max-width: 100%;
|
|
@@ -15,18 +15,18 @@
|
|
|
15
15
|
overflow: hidden;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.ellipsis-
|
|
18
|
+
.ellipsis-TRaKmy:after {
|
|
19
19
|
content: "";
|
|
20
20
|
display: block;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
.hint-
|
|
23
|
+
.hint-GMnBBU {
|
|
24
24
|
box-sizing: border-box;
|
|
25
25
|
overflow-wrap: break-word;
|
|
26
26
|
max-width: 300px;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.hintText-
|
|
29
|
+
.hintText-Y3plcB {
|
|
30
30
|
overflow-wrap: break-word;
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
-
import { type IHasTestId } from '
|
|
2
|
+
import { type IHasTestId } from '../../../common/types';
|
|
3
3
|
interface InputClearProps extends IHasTestId {
|
|
4
4
|
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
5
5
|
onMouseDown?: (event: React.MouseEvent<HTMLButtonElement>) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "
|
|
3
|
-
import { RemoveClose12Icon, RemoveCloseIcon16Icon } from "
|
|
2
|
+
import { cn } from "../../../common/css/cn.js";
|
|
3
|
+
import { RemoveClose12Icon, RemoveCloseIcon16Icon } from "../../../icon/index.js";
|
|
4
4
|
import InputClear_module from "./InputClear.module.js";
|
|
5
5
|
const InputClear = ({ testId, tabIndex, className, onClick, onMouseDown, size = 'M' })=>/*#__PURE__*/ jsx("button", {
|
|
6
6
|
type: "button",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
.main-
|
|
1
|
+
.main-wavOVy {
|
|
2
2
|
all: unset;
|
|
3
3
|
box-sizing: border-box;
|
|
4
4
|
cursor: pointer;
|
|
@@ -11,22 +11,22 @@
|
|
|
11
11
|
display: flex;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
.icon-
|
|
14
|
+
.icon-dcuwJd {
|
|
15
15
|
justify-content: center;
|
|
16
16
|
align-items: center;
|
|
17
17
|
display: flex;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.large-
|
|
20
|
+
.large-crUG9g {
|
|
21
21
|
width: 28px;
|
|
22
22
|
height: 28px;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
.main-
|
|
25
|
+
.main-wavOVy:hover, .main-wavOVy:active {
|
|
26
26
|
color: var(--elements-hover, #091739);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
.main-
|
|
29
|
+
.main-wavOVy:focus-visible {
|
|
30
30
|
color: var(--elements-hover, #091739);
|
|
31
31
|
border: 1px solid var(--border-focused, #091739);
|
|
32
32
|
border-radius: 4px;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type ElementType, type PropsWithoutRef, type ReactElement } from 'react';
|
|
2
|
+
import type { ValueOf } from '../../../common';
|
|
3
|
+
export declare const ClickableTag: {
|
|
4
|
+
readonly a: "a";
|
|
5
|
+
readonly button: "button";
|
|
6
|
+
};
|
|
7
|
+
export type ClickableTagValue = ValueOf<typeof ClickableTag>;
|
|
8
|
+
type MergeProps<Props extends object, As extends ElementType> = Props & Omit<ComponentPropsWithRef<As>, keyof Props>;
|
|
9
|
+
export type PolymorphicClickableProps<Props extends object, As extends ClickableTagValue> = {
|
|
10
|
+
as?: As;
|
|
11
|
+
} & MergeProps<Props, As>;
|
|
12
|
+
export interface ClickableComponent<Props extends object, DefaultAs extends ClickableTagValue> {
|
|
13
|
+
<As extends ClickableTagValue = DefaultAs>(props: PolymorphicClickableProps<Props, As>): ReactElement | null;
|
|
14
|
+
displayName?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const polymorphicClickableRef: <Props extends object, As extends ClickableTagValue>(render: (props: PropsWithoutRef<PolymorphicClickableProps<Props, As>>, ref: ComponentPropsWithRef<As>["ref"]) => ReactElement | null) => ClickableComponent<Props, As>;
|
|
17
|
+
export {};
|
|
@@ -90,7 +90,7 @@ const DropdownContent = (props)=>{
|
|
|
90
90
|
isTimeToggleVisible && /*#__PURE__*/ jsx(Hint, {
|
|
91
91
|
overlay: /*#__PURE__*/ jsx(Text.Body, {
|
|
92
92
|
colorToken: TextColor.invert,
|
|
93
|
-
children: locale.footer.timeSelectionToggleHint
|
|
93
|
+
children: locale.translate.footer.timeSelectionToggleHint
|
|
94
94
|
}),
|
|
95
95
|
trigger: isTimeToggleDisabled ? 'hover' : [],
|
|
96
96
|
overlayClassName: DropdownContent_module.toggleTooltipOverlay,
|
|
@@ -106,7 +106,7 @@ const DropdownContent = (props)=>{
|
|
|
106
106
|
checked: props.withTime,
|
|
107
107
|
disabled: isTimeToggleDisabled,
|
|
108
108
|
onChange: handleChangeTimeSelection,
|
|
109
|
-
label: locale.footer.timeSelectionToggle
|
|
109
|
+
label: locale.translate.footer.timeSelectionToggle
|
|
110
110
|
})
|
|
111
111
|
})
|
|
112
112
|
}),
|
|
@@ -116,7 +116,7 @@ const DropdownContent = (props)=>{
|
|
|
116
116
|
onClick: props.onClearButtonClick,
|
|
117
117
|
children: [
|
|
118
118
|
/*#__PURE__*/ jsx(FilterUpdate20Icon, {}),
|
|
119
|
-
locale.footer.clearFilterButton
|
|
119
|
+
locale.translate.footer.clearFilterButton
|
|
120
120
|
]
|
|
121
121
|
})
|
|
122
122
|
]
|
|
@@ -3,7 +3,7 @@ import { format, isSameMonth, isToday, isYesterday } from "date-fns";
|
|
|
3
3
|
import { cn } from "../../../../common/css/index.js";
|
|
4
4
|
import { Text, TextTag } from "../../../../components/Text/Text.js";
|
|
5
5
|
import { useLocaleContext } from "../../../../context/contexts/index.js";
|
|
6
|
-
import { useLocale } from "../../../locale/index.js";
|
|
6
|
+
import { LocaleKey, useLocale } from "../../../locale/index.js";
|
|
7
7
|
import { Left12Icon, Right12Icon } from "../../../../icon/index.js";
|
|
8
8
|
import { ArrowButton } from "../ArrowButton/index.js";
|
|
9
9
|
import { CalendarVariant } from "../consts.js";
|
|
@@ -14,32 +14,32 @@ const removeDots = (str)=>str.replace(/\./g, '');
|
|
|
14
14
|
const getWeekIntervalText = ({ startDate, endDate }, localeOptions)=>{
|
|
15
15
|
const formatOptions = getFormatOptions(localeOptions.lang);
|
|
16
16
|
if (isSameMonth(startDate, endDate)) {
|
|
17
|
-
const formatedStartDate = format(startDate, localeOptions.
|
|
18
|
-
const formatedTooltipStartDate = format(startDate, localeOptions.
|
|
19
|
-
const formatedEndDate = format(endDate, localeOptions.
|
|
20
|
-
const formatedTooltipEndDate = format(endDate, localeOptions.
|
|
17
|
+
const formatedStartDate = format(startDate, localeOptions.dateFormats.format.slider.week.dateFormat.sameMonth.firstDate, formatOptions);
|
|
18
|
+
const formatedTooltipStartDate = format(startDate, localeOptions.dateFormats.format.slider.week.tooltipDateFormat.sameMonth.firstDate, formatOptions);
|
|
19
|
+
const formatedEndDate = format(endDate, localeOptions.dateFormats.format.slider.week.dateFormat.sameMonth.endDate, formatOptions);
|
|
20
|
+
const formatedTooltipEndDate = format(endDate, localeOptions.dateFormats.format.slider.week.tooltipDateFormat.sameMonth.endDate, formatOptions);
|
|
21
21
|
return {
|
|
22
22
|
text: `${formatedStartDate}–${formatedEndDate}`,
|
|
23
23
|
tooltipText: `${formatedTooltipStartDate}–${formatedTooltipEndDate}`
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
const formatedStartDate = format(startDate, localeOptions.
|
|
27
|
-
const formatedTooltipStartDate = format(startDate, localeOptions.
|
|
28
|
-
const formatedEndDate = format(endDate, localeOptions.
|
|
29
|
-
const formatedTooltipEndDate = format(endDate, localeOptions.
|
|
26
|
+
const formatedStartDate = format(startDate, localeOptions.dateFormats.format.slider.week.dateFormat.differentMonth.firstDate, formatOptions);
|
|
27
|
+
const formatedTooltipStartDate = format(startDate, localeOptions.dateFormats.format.slider.week.tooltipDateFormat.differentMonth.firstDate, formatOptions);
|
|
28
|
+
const formatedEndDate = format(endDate, localeOptions.dateFormats.format.slider.week.dateFormat.differentMonth.endDate, formatOptions);
|
|
29
|
+
const formatedTooltipEndDate = format(endDate, localeOptions.dateFormats.format.slider.week.tooltipDateFormat.differentMonth.endDate, formatOptions);
|
|
30
30
|
return {
|
|
31
31
|
text: removeDots(`${formatedStartDate} — ${formatedEndDate}`),
|
|
32
32
|
tooltipText: `${formatedTooltipStartDate} — ${formatedTooltipEndDate}`
|
|
33
33
|
};
|
|
34
34
|
};
|
|
35
35
|
const getDayText = (options, localeOptions)=>{
|
|
36
|
-
if (!options.value) return localeOptions.
|
|
37
|
-
return format(options.value, localeOptions.
|
|
36
|
+
if (!options.value) return localeOptions.translates.translate.slider.day.placeholder;
|
|
37
|
+
return format(options.value, localeOptions.dateFormats.format.slider.day.dateFormat, getFormatOptions(localeOptions.lang));
|
|
38
38
|
};
|
|
39
39
|
const getWeekText = (options, localeOptions)=>{
|
|
40
40
|
const unselectedTexts = {
|
|
41
|
-
text: localeOptions.
|
|
42
|
-
tooltipText: localeOptions.
|
|
41
|
+
text: localeOptions.translates.translate.slider.week.placeholder,
|
|
42
|
+
tooltipText: localeOptions.translates.translate.slider.week.placeholder
|
|
43
43
|
};
|
|
44
44
|
if (!options.value) return unselectedTexts;
|
|
45
45
|
const { startDate, endDate } = getRangeDates(options);
|
|
@@ -50,11 +50,11 @@ const getWeekText = (options, localeOptions)=>{
|
|
|
50
50
|
}, localeOptions);
|
|
51
51
|
};
|
|
52
52
|
const getMonthText = (options, localeOptions)=>{
|
|
53
|
-
const unselectedText = localeOptions.
|
|
53
|
+
const unselectedText = localeOptions.translates.translate.slider.month.placeholder;
|
|
54
54
|
if (!options.value) return unselectedText;
|
|
55
55
|
const { startDate, endDate } = getRangeDates(options);
|
|
56
56
|
if (!startDate || !endDate) return unselectedText;
|
|
57
|
-
const text = format(startDate, localeOptions.
|
|
57
|
+
const text = format(startDate, localeOptions.dateFormats.format.slider.month.dateFormat, getFormatOptions(localeOptions.lang));
|
|
58
58
|
return capitalizeFirstLetter(text);
|
|
59
59
|
};
|
|
60
60
|
const getPeriodText = (value, localeOptions)=>{
|
|
@@ -76,16 +76,16 @@ const getPeriodText = (value, localeOptions)=>{
|
|
|
76
76
|
return null;
|
|
77
77
|
};
|
|
78
78
|
const getDayPeriodName = (options, locale)=>{
|
|
79
|
-
if (options.value && isToday(options.value)) return locale.dayQuickFilters.today;
|
|
80
|
-
if (options.value && isYesterday(options.value)) return locale.dayQuickFilters.yesterday;
|
|
81
|
-
return locale.slider.day.title;
|
|
79
|
+
if (options.value && isToday(options.value)) return locale.translate.dayQuickFilters.today;
|
|
80
|
+
if (options.value && isYesterday(options.value)) return locale.translate.dayQuickFilters.yesterday;
|
|
81
|
+
return locale.translate.slider.day.title;
|
|
82
82
|
};
|
|
83
83
|
const getPeriodName = (value, locale)=>{
|
|
84
84
|
if (isDayValue(value)) return getDayPeriodName(value, locale);
|
|
85
|
-
if (isWeekValue(value)) return locale.slider.week.title;
|
|
86
|
-
if (isMonthValue(value)) return locale.slider.month.title;
|
|
87
|
-
if (isAnyDateValue(value)) return locale.radiobuttons.anyDate;
|
|
88
|
-
if (isNoDateValue(value)) return locale.radiobuttons.noDate;
|
|
85
|
+
if (isWeekValue(value)) return locale.translate.slider.week.title;
|
|
86
|
+
if (isMonthValue(value)) return locale.translate.slider.month.title;
|
|
87
|
+
if (isAnyDateValue(value)) return locale.translate.radiobuttons.anyDate;
|
|
88
|
+
if (isNoDateValue(value)) return locale.translate.radiobuttons.noDate;
|
|
89
89
|
return null;
|
|
90
90
|
};
|
|
91
91
|
const InputContent = (props)=>{
|
|
@@ -94,11 +94,14 @@ const InputContent = (props)=>{
|
|
|
94
94
|
CalendarVariant.week,
|
|
95
95
|
CalendarVariant.month
|
|
96
96
|
].includes(props.value.type);
|
|
97
|
-
const { lang } = useLocaleContext();
|
|
98
|
-
const
|
|
97
|
+
const { lang, locale } = useLocaleContext();
|
|
98
|
+
const translates = useLocale('DateRangeFilter');
|
|
99
|
+
const dateFormats = useLocale('DateRangeFilter', LocaleKey.Locale);
|
|
99
100
|
const periodText = getPeriodText(props.value, {
|
|
101
|
+
translates,
|
|
102
|
+
lang,
|
|
100
103
|
locale,
|
|
101
|
-
|
|
104
|
+
dateFormats
|
|
102
105
|
});
|
|
103
106
|
return /*#__PURE__*/ jsxs("div", {
|
|
104
107
|
className: cn(InputContent_module.container, showArrowButtons && InputContent_module.withButtons),
|
|
@@ -124,7 +127,7 @@ const InputContent = (props)=>{
|
|
|
124
127
|
children: [
|
|
125
128
|
/*#__PURE__*/ jsx(Text.Body, {
|
|
126
129
|
as: TextTag.span,
|
|
127
|
-
children: getPeriodName(props.value,
|
|
130
|
+
children: getPeriodName(props.value, translates)
|
|
128
131
|
}),
|
|
129
132
|
/*#__PURE__*/ jsx(TooltipedText, {
|
|
130
133
|
className: InputContent_module.periodValue,
|
|
@@ -53,14 +53,16 @@ const PeriodVariantList = /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
|
53
53
|
props.onClickYestardayButton?.();
|
|
54
54
|
},
|
|
55
55
|
small: true,
|
|
56
|
-
children: locale.dayQuickFilters.yesterday
|
|
56
|
+
children: locale.translate.dayQuickFilters.yesterday
|
|
57
57
|
}),
|
|
58
58
|
/*#__PURE__*/ jsx(Chip, {
|
|
59
59
|
className: cn(PeriodVariantList_module.chip, props.todaySelected && PeriodVariantList_module.active),
|
|
60
60
|
isActive: props.todaySelected ?? false,
|
|
61
|
-
onClick:
|
|
61
|
+
onClick: ()=>{
|
|
62
|
+
props.onClickTodayButton?.();
|
|
63
|
+
},
|
|
62
64
|
small: true,
|
|
63
|
-
children: locale.dayQuickFilters.today
|
|
65
|
+
children: locale.translate.dayQuickFilters.today
|
|
64
66
|
})
|
|
65
67
|
]
|
|
66
68
|
})
|
|
@@ -3,12 +3,12 @@ import { format, isSameMonth, startOfDay } from "date-fns";
|
|
|
3
3
|
import { cn } from "../../../../common/index.js";
|
|
4
4
|
import { Text } from "../../../../components/Text/Text.js";
|
|
5
5
|
import { useLocaleContext } from "../../../../context/contexts/index.js";
|
|
6
|
-
import { useLocale } from "../../../locale/index.js";
|
|
6
|
+
import { LocaleKey, useLocale } from "../../../locale/index.js";
|
|
7
7
|
import { capitalizeFirstLetter, getFormatOptions, getRangeDates, isMonthValue } from "../utils.js";
|
|
8
8
|
import Year_module from "./Year.module.js";
|
|
9
9
|
const Year = (props)=>{
|
|
10
10
|
const { lang } = useLocaleContext();
|
|
11
|
-
const locale = useLocale('DateRangeFilter');
|
|
11
|
+
const locale = useLocale('DateRangeFilter', LocaleKey.Locale);
|
|
12
12
|
const year = props.year.getFullYear();
|
|
13
13
|
const isSelectedMonth = (monthStartDate)=>{
|
|
14
14
|
if (!isMonthValue(props.value)) return false;
|
|
@@ -37,7 +37,7 @@ const Year = (props)=>{
|
|
|
37
37
|
},
|
|
38
38
|
children: /*#__PURE__*/ jsx(Text.Body, {
|
|
39
39
|
className: Year_module.monthText,
|
|
40
|
-
children: capitalizeFirstLetter(format(date, locale.monthCalendarFormat, getFormatOptions(lang)))
|
|
40
|
+
children: capitalizeFirstLetter(format(date, locale.format.monthCalendarFormat, getFormatOptions(lang)))
|
|
41
41
|
})
|
|
42
42
|
}, +date);
|
|
43
43
|
})
|
|
@@ -9,19 +9,19 @@ const CalendarVariant = {
|
|
|
9
9
|
const calendarVariants = [
|
|
10
10
|
{
|
|
11
11
|
value: CalendarVariant.period,
|
|
12
|
-
labelGetter: (locale)=>locale.radiobuttons.period
|
|
12
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.period
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
value: CalendarVariant.day,
|
|
16
|
-
labelGetter: (locale)=>locale.radiobuttons.day
|
|
16
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.day
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
value: CalendarVariant.week,
|
|
20
|
-
labelGetter: (locale)=>locale.radiobuttons.week
|
|
20
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.week
|
|
21
21
|
},
|
|
22
22
|
{
|
|
23
23
|
value: CalendarVariant.month,
|
|
24
|
-
labelGetter: (locale)=>locale.radiobuttons.month
|
|
24
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.month
|
|
25
25
|
}
|
|
26
26
|
];
|
|
27
27
|
const getCalendarVariants = (locale)=>calendarVariants.map((variant)=>({
|
|
@@ -31,11 +31,11 @@ const getCalendarVariants = (locale)=>calendarVariants.map((variant)=>({
|
|
|
31
31
|
const additionalCalendarVariants = [
|
|
32
32
|
{
|
|
33
33
|
value: CalendarVariant.anyDate,
|
|
34
|
-
labelGetter: (locale)=>locale.radiobuttons.anyDate
|
|
34
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.anyDate
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
value: CalendarVariant.noDate,
|
|
38
|
-
labelGetter: (locale)=>locale.radiobuttons.noDate
|
|
38
|
+
labelGetter: (locale)=>locale.translate.radiobuttons.noDate
|
|
39
39
|
}
|
|
40
40
|
];
|
|
41
41
|
const getAdditionalCalendarVariants = (locale)=>additionalCalendarVariants.map((variant)=>({
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { useEffect, useState } from "react";
|
|
2
2
|
import { format, isBefore, isEqual, isValid, parse } from "date-fns";
|
|
3
|
-
import { useLocale } from "../../../locale/index.js";
|
|
3
|
+
import { LocaleKey, useLocale } from "../../../locale/index.js";
|
|
4
4
|
import { getEndOfDay, getPeriodValue, getRangeDates as external_utils_js_getRangeDates, getStartOfDay, isRangeValue } from "../utils.js";
|
|
5
5
|
const DATES_DELIMETER = ' — ';
|
|
6
|
-
const getEmptyMask = (withTime, locale)=>withTime ? locale.emptyDate.withTime : locale.emptyDate.withoutTime;
|
|
6
|
+
const getEmptyMask = (withTime, locale)=>withTime ? locale.format.emptyDate.withTime : locale.format.emptyDate.withoutTime;
|
|
7
7
|
const isDateValuesEqual = (value1, value2)=>{
|
|
8
8
|
if (value1 && value2) return isEqual(value1, value2);
|
|
9
9
|
return value1 === value2;
|
|
10
10
|
};
|
|
11
11
|
const useMaskInput = (args)=>{
|
|
12
|
-
const locale = useLocale('DateRangeFilter');
|
|
13
|
-
const getDateFormat = (withTime)=>withTime ? locale.dateWithTimeFormat : locale.dateFormat;
|
|
14
|
-
const inputMask = args.withTime ? `${locale.inputMask.withTime} — ${locale.inputMask.withTime}` : `${locale.inputMask.withoutTime} — ${locale.inputMask.withoutTime}`;
|
|
12
|
+
const locale = useLocale('DateRangeFilter', LocaleKey.Locale);
|
|
13
|
+
const getDateFormat = (withTime)=>withTime ? locale.format.dateWithTimeFormat : locale.format.dateFormat;
|
|
14
|
+
const inputMask = args.withTime ? `${locale.format.inputMask.withTime} — ${locale.format.inputMask.withTime}` : `${locale.format.inputMask.withoutTime} — ${locale.format.inputMask.withoutTime}`;
|
|
15
15
|
const formatDate = (date, withTime)=>{
|
|
16
16
|
const timeString = format(date, 'HH:mm');
|
|
17
|
-
return `${format(date, locale.dateFormat)}${withTime ? ` ${timeString}` : ''}`;
|
|
17
|
+
return `${format(date, locale.format.dateFormat)}${withTime ? ` ${timeString}` : ''}`;
|
|
18
18
|
};
|
|
19
19
|
const getFormatedDate = (date, withTime = false)=>date ? formatDate(date, withTime) : getEmptyMask(withTime, locale);
|
|
20
20
|
const getRangeDates = (options, withTime)=>{
|
|
@@ -51,10 +51,7 @@ const useSideMenu = (args)=>{
|
|
|
51
51
|
});
|
|
52
52
|
break;
|
|
53
53
|
default:
|
|
54
|
-
{
|
|
55
|
-
const unknownVariant = variant;
|
|
56
|
-
console.error(`неизвестный вариант ${unknownVariant}`);
|
|
57
|
-
}
|
|
54
|
+
throw new Error(`неизвестный вариант ${variant}`);
|
|
58
55
|
}
|
|
59
56
|
};
|
|
60
57
|
const yesterdayButtonClickHandler = ()=>{
|