@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,117 @@
|
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useRef } from "react";
|
|
3
|
+
import { getOptionalTestId } from "../../../common/index.js";
|
|
4
|
+
import { mergeRefs } from "../../../common/react/mergeRefs.js";
|
|
5
|
+
import { useValueBlock } from "../../LabelValue/hooks/useValueBlock.js";
|
|
6
|
+
import { ValueBlockWrapper } from "../../LabelValue/ValueBlockWrapper.js";
|
|
7
|
+
import { ValueIcon } from "../../LabelValue/ValueIcon.js";
|
|
8
|
+
import { ValueText } from "../../LabelValue/ValueText.js";
|
|
9
|
+
import { ValueTextWithHint } from "../../LabelValue/ValueTextWithHint.js";
|
|
10
|
+
import LabelValueLinkValueBlock_module from "./LabelValueLinkValueBlock.module.js";
|
|
11
|
+
const getValueTextVariant = (args)=>{
|
|
12
|
+
if (args.error) return 'critical';
|
|
13
|
+
if (args.disabled) return 'primary';
|
|
14
|
+
return 'buttonPrimary';
|
|
15
|
+
};
|
|
16
|
+
const LabelValueLinkValueBlock = /*#__PURE__*/ forwardRef((props, forwardedRef)=>{
|
|
17
|
+
const forceHintShowRef = useRef(null);
|
|
18
|
+
const { isValueHintForceDisplayed, valueBlockInnerRef, valueTooltip, handleBlur, handleFocus, onHintVisibilityChange, icon, isHintVisible } = useValueBlock({
|
|
19
|
+
value: props.value,
|
|
20
|
+
forceHideTooltip: props.forceHideTooltip,
|
|
21
|
+
onBlur: props.onBlur,
|
|
22
|
+
onFocus: props.onFocus,
|
|
23
|
+
error: props.error,
|
|
24
|
+
isCustomValueBlock: !!props.valueBlockContent,
|
|
25
|
+
renderIcon: props.renderIcon,
|
|
26
|
+
disabled: props.disabled,
|
|
27
|
+
forceHintShowRef
|
|
28
|
+
});
|
|
29
|
+
const eventHandlers = {
|
|
30
|
+
onFocus: handleFocus,
|
|
31
|
+
onBlur: handleBlur
|
|
32
|
+
};
|
|
33
|
+
const defaultKeyDownHandlers = {
|
|
34
|
+
onKeyUp: props.onValueKeyUp,
|
|
35
|
+
onKeyDown: props.onValueKeyDown
|
|
36
|
+
};
|
|
37
|
+
const handleOpenLink = (e)=>{
|
|
38
|
+
if ('Space' === e.code || 'Enter' === e.code) {
|
|
39
|
+
e.preventDefault();
|
|
40
|
+
window.open(props.value, '_blank');
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
const isLinkDisabled = props.isDefaultValue || props.error;
|
|
44
|
+
const keyDownHandlers = isLinkDisabled ? defaultKeyDownHandlers : {
|
|
45
|
+
onKeyDown: handleOpenLink
|
|
46
|
+
};
|
|
47
|
+
const valueText = /*#__PURE__*/ jsx(ValueText, {
|
|
48
|
+
...keyDownHandlers,
|
|
49
|
+
...eventHandlers,
|
|
50
|
+
as: "a",
|
|
51
|
+
target: "_blank",
|
|
52
|
+
className: LabelValueLinkValueBlock_module.valueText,
|
|
53
|
+
tabIndex: icon ? 0 : -1,
|
|
54
|
+
ref: mergeRefs([
|
|
55
|
+
valueTooltip.ref,
|
|
56
|
+
forwardedRef,
|
|
57
|
+
valueBlockInnerRef
|
|
58
|
+
]),
|
|
59
|
+
colorVariant: getValueTextVariant({
|
|
60
|
+
disabled: props.disabled && props.isDefaultValue,
|
|
61
|
+
error: props.error,
|
|
62
|
+
isEmpty: props.isEmpty
|
|
63
|
+
}),
|
|
64
|
+
testId: props.testId,
|
|
65
|
+
href: props.isDefaultValue || props.error ? void 0 : props.value,
|
|
66
|
+
onClick: (e)=>{
|
|
67
|
+
if (props.error) return;
|
|
68
|
+
if (!props.isDefaultValue && !props.disabled) e.stopPropagation();
|
|
69
|
+
},
|
|
70
|
+
value: props.value,
|
|
71
|
+
onMouseDown: (e)=>e.preventDefault()
|
|
72
|
+
});
|
|
73
|
+
const valueIcon = /*#__PURE__*/ jsx(ValueIcon, {
|
|
74
|
+
...props.isDefaultValue ? {} : defaultKeyDownHandlers,
|
|
75
|
+
children: icon
|
|
76
|
+
});
|
|
77
|
+
const isShowLabelTooltip = ()=>(props.isNeedShowLabelTooltip?.() && isValueHintForceDisplayed) ?? false;
|
|
78
|
+
if (props.valueBlockContent) return props.valueBlockContent({
|
|
79
|
+
valueNode: /*#__PURE__*/ jsxs(Fragment, {
|
|
80
|
+
children: [
|
|
81
|
+
valueText,
|
|
82
|
+
valueIcon
|
|
83
|
+
]
|
|
84
|
+
}),
|
|
85
|
+
isLabelOverflow: props.needShowLabelTooltip ?? false,
|
|
86
|
+
valueBlockRef: forwardedRef,
|
|
87
|
+
onBlur: handleBlur,
|
|
88
|
+
onFocus: handleFocus,
|
|
89
|
+
onKeyDown: (event)=>props.onValueKeyDown?.(event),
|
|
90
|
+
onKeyUp: (event)=>props.onValueKeyUp?.(event),
|
|
91
|
+
getIsLabelOverflow: isShowLabelTooltip
|
|
92
|
+
});
|
|
93
|
+
const wrapperHandlers = !icon && keyDownHandlers;
|
|
94
|
+
const disableFocus = props.isDefaultValue && props.disabled;
|
|
95
|
+
return /*#__PURE__*/ jsxs(ValueBlockWrapper, {
|
|
96
|
+
testId: getOptionalTestId(props.testId, 'value-block'),
|
|
97
|
+
tabIndex: icon || disableFocus ? -1 : 0,
|
|
98
|
+
ref: forceHintShowRef,
|
|
99
|
+
...wrapperHandlers,
|
|
100
|
+
...eventHandlers,
|
|
101
|
+
children: [
|
|
102
|
+
/*#__PURE__*/ jsx(ValueTextWithHint, {
|
|
103
|
+
isHintVisible: isHintVisible,
|
|
104
|
+
label: props.label,
|
|
105
|
+
value: props.value,
|
|
106
|
+
onHintVisibilityChange: onHintVisibilityChange,
|
|
107
|
+
testId: props.testId,
|
|
108
|
+
hintTextClassName: LabelValueLinkValueBlock_module.hintText,
|
|
109
|
+
isShowLabelTooltip: isShowLabelTooltip,
|
|
110
|
+
children: valueText
|
|
111
|
+
}),
|
|
112
|
+
icon ? valueIcon : null
|
|
113
|
+
]
|
|
114
|
+
});
|
|
115
|
+
});
|
|
116
|
+
LabelValueLinkValueBlock.displayName = 'LabelValueLinkValueBlock';
|
|
117
|
+
export { LabelValueLinkValueBlock };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const normalizeLinkValue: (value?: string) => string | undefined;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const PROTOCOL = {
|
|
2
|
+
HTTPS: 'https://',
|
|
3
|
+
HTTP: 'http://'
|
|
4
|
+
};
|
|
5
|
+
const normalizeLinkValue = (value)=>{
|
|
6
|
+
if (!value) return value;
|
|
7
|
+
if (value.startsWith(PROTOCOL.HTTP) || value.startsWith(PROTOCOL.HTTPS)) return value;
|
|
8
|
+
return `${PROTOCOL.HTTPS}${value}`;
|
|
9
|
+
};
|
|
10
|
+
export { normalizeLinkValue };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ChangeEvent, type ChangeEventHandler } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Локальное значение поля в дропдауне для ссылки: синх с пропом и нормализация при сабмите.
|
|
4
|
+
*/
|
|
5
|
+
type Props = {
|
|
6
|
+
value: string | undefined;
|
|
7
|
+
onChange?: ChangeEventHandler<HTMLInputElement>;
|
|
8
|
+
};
|
|
9
|
+
export declare const useLinkDropdownValue: ({ value, onChange }: Props) => {
|
|
10
|
+
dropdownValue: string | undefined;
|
|
11
|
+
handleChange: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
12
|
+
submitNormalized: () => void;
|
|
13
|
+
synchronize: () => void;
|
|
14
|
+
};
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useCallback, useState } from "react";
|
|
2
|
+
import { normalizeLinkValue } from "./normalizeLinkValue.js";
|
|
3
|
+
const useLinkDropdownValue = ({ value, onChange })=>{
|
|
4
|
+
const [dropdownValue, setDropdownValue] = useState(value);
|
|
5
|
+
const synchronize = useCallback(()=>{
|
|
6
|
+
setDropdownValue(normalizeLinkValue(value));
|
|
7
|
+
}, [
|
|
8
|
+
value
|
|
9
|
+
]);
|
|
10
|
+
const handleChange = useCallback((event)=>{
|
|
11
|
+
setDropdownValue(event.target.value ?? '');
|
|
12
|
+
onChange?.(event);
|
|
13
|
+
}, [
|
|
14
|
+
onChange
|
|
15
|
+
]);
|
|
16
|
+
const submitNormalized = ()=>{
|
|
17
|
+
setDropdownValue(normalizeLinkValue(dropdownValue));
|
|
18
|
+
};
|
|
19
|
+
return {
|
|
20
|
+
dropdownValue,
|
|
21
|
+
handleChange,
|
|
22
|
+
submitNormalized,
|
|
23
|
+
synchronize
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export { useLinkDropdownValue };
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useRef } from "react";
|
|
3
3
|
import { cn } from "../../../common/css/index.js";
|
|
4
4
|
import { mergeRefs } from "../../../common/react/mergeRefs.js";
|
|
5
|
-
import { Info } from "../../Info/Info.js";
|
|
5
|
+
import { Info } from "../../_shared/Info/Info.js";
|
|
6
6
|
import { Label } from "../../Label/Label.js";
|
|
7
7
|
import { useId } from "../../../hooks/index.js";
|
|
8
8
|
import { Edit12Icon, RemoveClose12Icon } from "../../../icon/index.js";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
2
|
import { type ISelectOption, type SelectProps } from '../Select/Select';
|
|
3
|
-
import { type SharedLabelValueProps
|
|
3
|
+
import { type SharedLabelValueProps } from '../LabelValue/LabelValue';
|
|
4
|
+
import type { ValueBlockContentArgs } from '../LabelValue/types';
|
|
4
5
|
import { type LabelValueRenderDropdownContantOptions } from './DropdownContent';
|
|
5
6
|
export interface SelectValueBlockContentArgs<T = unknown> extends ValueBlockContentArgs {
|
|
6
7
|
value?: ISelectOption<T>;
|
|
7
8
|
}
|
|
8
|
-
type PickedSelectProps<T> = Pick<SelectProps<T>, 'renderOption' | 'addButtonText' | 'dropdownZIndex' | 'dropdownClassName' | 'dropdownStyle' | 'dropdownOffsetX' | 'dropdownOffsetY' | 'emptyText' | 'isLoading' | 'isSearchDebounced' | 'searchDebounceTimeout' | 'loadingText' | 'optionClassName' | 'value' | 'options' | '
|
|
9
|
+
type PickedSelectProps<T> = Pick<SelectProps<T>, 'renderOption' | 'addButtonText' | 'dropdownZIndex' | 'dropdownClassName' | 'dropdownStyle' | 'dropdownOffsetX' | 'dropdownOffsetY' | 'emptyText' | 'isLoading' | 'isSearchDebounced' | 'searchDebounceTimeout' | 'loadingText' | 'optionClassName' | 'value' | 'options' | 'isOptionEllipsis' | 'onDropdownToggle' | 'closeOnSelect' | 'isOptionEllipsis'>;
|
|
9
10
|
export interface LabelValueSelectProps<T = unknown> extends Omit<SharedLabelValueProps, 'onChange' | 'onDropdownClose'>, PickedSelectProps<T> {
|
|
10
11
|
onChange?: (option: ISelectOption<T>) => void;
|
|
11
12
|
dropdownEmptyText?: string;
|
|
@@ -13,6 +14,7 @@ export interface LabelValueSelectProps<T = unknown> extends Omit<SharedLabelValu
|
|
|
13
14
|
placeholder?: string;
|
|
14
15
|
disableSearch?: boolean;
|
|
15
16
|
archiveText?: string;
|
|
17
|
+
isArchived?: boolean;
|
|
16
18
|
valueBlockContent?: (args: SelectValueBlockContentArgs<T>) => ReactNode;
|
|
17
19
|
onEditClick?: (searchText: string) => void;
|
|
18
20
|
onCreateClick?: (searchText: string) => void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FC, type ReactNode } from 'react';
|
|
2
|
+
import type { IHasTestId } from '../../common';
|
|
3
|
+
export interface LayoutProps extends IHasTestId {
|
|
4
|
+
header?: ReactNode;
|
|
5
|
+
contentHeader?: ReactNode;
|
|
6
|
+
aside?: ReactNode;
|
|
7
|
+
content?: ReactNode;
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
stickyContentHeader?: boolean;
|
|
10
|
+
showLargePaddingBottom?: boolean;
|
|
11
|
+
bgColor?: 'white';
|
|
12
|
+
}
|
|
13
|
+
export declare const Layout: FC<LayoutProps>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { cn } from "../../common/index.js";
|
|
4
|
+
import Layout_module from "./Layout.module.js";
|
|
5
|
+
const Layout = ({ testId, header = null, contentHeader = null, aside = null, content = null, fullWidth = false, stickyContentHeader = false, showLargePaddingBottom = false, bgColor })=>/*#__PURE__*/ jsxs("div", {
|
|
6
|
+
className: cn(Layout_module.mainWrap, bgColor && Layout_module[bgColor]),
|
|
7
|
+
"data-test-id": testId,
|
|
8
|
+
children: [
|
|
9
|
+
/*#__PURE__*/ jsx("header", {
|
|
10
|
+
className: Layout_module.header,
|
|
11
|
+
"data-test-id": testId ? `${testId}-header` : void 0,
|
|
12
|
+
children: header
|
|
13
|
+
}),
|
|
14
|
+
/*#__PURE__*/ jsxs("div", {
|
|
15
|
+
className: cn(Layout_module.body, fullWidth && Layout_module.bodyFull, showLargePaddingBottom && Layout_module.pBLarge),
|
|
16
|
+
children: [
|
|
17
|
+
contentHeader && /*#__PURE__*/ jsx("header", {
|
|
18
|
+
className: cn(Layout_module.contentHeader, stickyContentHeader && Layout_module.stickyContentHeader),
|
|
19
|
+
"data-test-id": testId ? `${testId}-contentHeader` : void 0,
|
|
20
|
+
children: contentHeader
|
|
21
|
+
}),
|
|
22
|
+
/*#__PURE__*/ jsxs("div", {
|
|
23
|
+
className: Layout_module.main,
|
|
24
|
+
children: [
|
|
25
|
+
aside && /*#__PURE__*/ jsx("aside", {
|
|
26
|
+
className: Layout_module.aside,
|
|
27
|
+
"data-test-id": testId ? `${testId}-aside` : void 0,
|
|
28
|
+
children: aside
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ jsx("main", {
|
|
31
|
+
className: Layout_module.content,
|
|
32
|
+
"data-test-id": testId ? `${testId}-content` : void 0,
|
|
33
|
+
children: content
|
|
34
|
+
})
|
|
35
|
+
]
|
|
36
|
+
})
|
|
37
|
+
]
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
export { Layout };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./Layout_module.css";
|
|
2
|
+
const Layout_module = {
|
|
3
|
+
mainWrap: "mainWrap-JLBf3u",
|
|
4
|
+
white: "white-nNMpTy",
|
|
5
|
+
header: "header-kLeLQu",
|
|
6
|
+
body: "body-PmmRSC",
|
|
7
|
+
bodyFull: "bodyFull-mcyirc",
|
|
8
|
+
pBLarge: "pBLarge-fg0fvb",
|
|
9
|
+
contentHeader: "contentHeader-pB7tPR",
|
|
10
|
+
stickyContentHeader: "stickyContentHeader-PISsux",
|
|
11
|
+
main: "main-rrgu1Q",
|
|
12
|
+
aside: "aside-ztLelP",
|
|
13
|
+
content: "content-XWW4aN"
|
|
14
|
+
};
|
|
15
|
+
export default Layout_module;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
.mainWrap-JLBf3u {
|
|
2
|
+
--layout-bg-color: var(--bgd-secondary);
|
|
3
|
+
background-color: var(--layout-bg-color);
|
|
4
|
+
box-sizing: border-box;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
flex: 1;
|
|
7
|
+
align-items: center;
|
|
8
|
+
width: 100%;
|
|
9
|
+
min-width: 1200px;
|
|
10
|
+
min-height: 100dvh;
|
|
11
|
+
display: flex;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.white-nNMpTy {
|
|
15
|
+
--layout-bg-color: var(--bgd-white);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.header-kLeLQu {
|
|
19
|
+
background-color: var(--layout-bg-color);
|
|
20
|
+
z-index: 3;
|
|
21
|
+
box-sizing: border-box;
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.body-PmmRSC {
|
|
26
|
+
box-sizing: border-box;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
flex: 1;
|
|
29
|
+
width: 100%;
|
|
30
|
+
max-width: 1640px;
|
|
31
|
+
padding: 0 20px 32px;
|
|
32
|
+
display: flex;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.bodyFull-mcyirc {
|
|
36
|
+
max-width: 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.pBLarge-fg0fvb {
|
|
40
|
+
padding-bottom: 100px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.contentHeader-pB7tPR {
|
|
44
|
+
background-color: var(--layout-bg-color);
|
|
45
|
+
flex-direction: row;
|
|
46
|
+
width: 100%;
|
|
47
|
+
padding: 20px 0;
|
|
48
|
+
display: flex;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.stickyContentHeader-PISsux {
|
|
52
|
+
z-index: 2;
|
|
53
|
+
position: sticky;
|
|
54
|
+
top: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.main-rrgu1Q {
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
flex: 1;
|
|
60
|
+
gap: 20px;
|
|
61
|
+
width: 100%;
|
|
62
|
+
display: flex;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.aside-ztLelP {
|
|
66
|
+
flex-direction: column;
|
|
67
|
+
width: 280px;
|
|
68
|
+
display: flex;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.content-XWW4aN {
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
flex: 1;
|
|
74
|
+
gap: 20px;
|
|
75
|
+
display: flex;
|
|
76
|
+
}
|
|
77
|
+
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
export type
|
|
1
|
+
import { ClickableTag, type ClickableTagValue, type PolymorphicClickableProps } from '../_shared/utils/polymorphicClickableTypes';
|
|
2
|
+
import type { TextAtomProps } from '../Text/Text.atom';
|
|
3
|
+
export type LinkOwnProps = TextAtomProps & {
|
|
4
4
|
disabled?: boolean;
|
|
5
5
|
};
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
} & React.RefAttributes<HTMLAnchorElement>>;
|
|
6
|
+
export type LinkProps<As extends ClickableTagValue = typeof ClickableTag.a> = PolymorphicClickableProps<LinkOwnProps, As>;
|
|
7
|
+
export declare const Link: import("../_shared/utils/polymorphicClickableTypes").ClickableComponent<LinkOwnProps, "a">;
|
|
@@ -1,22 +1,48 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { createElement } from "react";
|
|
3
3
|
import { cn } from "../../common/css/cn.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { ClickableTag, polymorphicClickableRef } from "../_shared/utils/polymorphicClickableTypes.js";
|
|
5
|
+
import { TextVariant } from "../Text/Text.js";
|
|
6
|
+
import { getClassByVariant } from "../Text/tokens/variants/textVariant.js";
|
|
6
7
|
import Link_module from "./Link.module.js";
|
|
7
|
-
|
|
8
|
+
import Text_atom_module from "../Text/Text.atom.module.js";
|
|
9
|
+
const ClickableTextAtom = polymorphicClickableRef((props, ref)=>{
|
|
10
|
+
const { as: elementProp = ClickableTag.a, variant = TextVariant.body, preline, testId, className, children, ...restProps } = props;
|
|
11
|
+
const element = elementProp;
|
|
12
|
+
return /*#__PURE__*/ createElement(element, {
|
|
13
|
+
'data-test-id': testId,
|
|
14
|
+
className: cn(Text_atom_module.text, getClassByVariant(variant), preline && Text_atom_module.preLine, className),
|
|
15
|
+
ref,
|
|
16
|
+
...restProps
|
|
17
|
+
}, children);
|
|
18
|
+
});
|
|
19
|
+
ClickableTextAtom.displayName = 'ClickableTextAtom';
|
|
20
|
+
const Link = polymorphicClickableRef((props, ref)=>{
|
|
21
|
+
const { as: elementProp = ClickableTag.a, variant = TextVariant.body, className, children, disabled, onClick, href, ...rest } = props;
|
|
22
|
+
const element = elementProp;
|
|
23
|
+
const isAnchor = element === ClickableTag.a;
|
|
8
24
|
const handleClick = (e)=>{
|
|
9
|
-
if (disabled)
|
|
25
|
+
if (disabled) {
|
|
26
|
+
if (isAnchor) e.preventDefault();
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
10
29
|
if ('function' != typeof onClick) return;
|
|
11
30
|
return onClick(e);
|
|
12
31
|
};
|
|
13
|
-
|
|
14
|
-
...restProps,
|
|
32
|
+
const tagSpecificProps = isAnchor ? {
|
|
15
33
|
href: disabled ? void 0 : href,
|
|
34
|
+
'aria-disabled': disabled || void 0
|
|
35
|
+
} : {
|
|
36
|
+
type: rest.type ?? 'button',
|
|
37
|
+
disabled
|
|
38
|
+
};
|
|
39
|
+
return /*#__PURE__*/ jsx(ClickableTextAtom, {
|
|
40
|
+
...rest,
|
|
41
|
+
...tagSpecificProps,
|
|
16
42
|
ref: ref,
|
|
17
43
|
variant: variant,
|
|
18
|
-
as:
|
|
19
|
-
className: cn(Link_module.link, disabled && Link_module.linkDisabled, className),
|
|
44
|
+
as: element,
|
|
45
|
+
className: cn(Link_module.link, !isAnchor && Link_module.linkButtonReset, disabled && Link_module.linkDisabled, className),
|
|
20
46
|
onClick: handleClick,
|
|
21
47
|
children: children
|
|
22
48
|
});
|
|
@@ -12,6 +12,15 @@
|
|
|
12
12
|
color: var(--product-blue-600);
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
.linkButtonReset-Q4HSqs {
|
|
16
|
+
cursor: pointer;
|
|
17
|
+
text-align: inherit;
|
|
18
|
+
background: none;
|
|
19
|
+
border: none;
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
15
24
|
.linkDisabled-TARqlL:hover, .linkDisabled-TARqlL:active, .linkDisabled-TARqlL {
|
|
16
25
|
color: #797979;
|
|
17
26
|
text-decoration: none;
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
width: 420px;
|
|
34
34
|
max-height: 428px;
|
|
35
35
|
margin: 0;
|
|
36
|
-
padding:
|
|
36
|
+
padding: 4px;
|
|
37
37
|
list-style: none;
|
|
38
38
|
position: absolute;
|
|
39
39
|
overflow: hidden auto;
|
|
@@ -51,12 +51,8 @@
|
|
|
51
51
|
padding: 0;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.lognex-uikit-mentions-dropdown-menu-item:not(:last-child) {
|
|
55
|
-
margin-bottom: 4px;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
54
|
.lognex-uikit-mentions-dropdown-menu-item-active {
|
|
59
|
-
background-color: var(--
|
|
55
|
+
background-color: var(--elements-bg-hover, #f1f4f9);
|
|
60
56
|
border-radius: 8px;
|
|
61
57
|
}
|
|
62
58
|
|
|
@@ -11,7 +11,7 @@ import { useTextField } from "../../hooks/useTextField/useTextField.js";
|
|
|
11
11
|
import { Mentions } from "./Mentions/Mentions.js";
|
|
12
12
|
import Textfield_module from "../Textfield/Textfield.module.js";
|
|
13
13
|
import { cn } from "../../common/index.js";
|
|
14
|
-
const MentionsTextfield = /*#__PURE__*/ forwardRef(({ testId, tabIndex, className, label, info, required, error, help, disabled, resize, style, value, limit, showCounterLimit, autoVerticalResize = false, resetHeightOnClear = false, minHeight: minHeightProp, maxHeight, rows, size = TextfieldSize.M, onFocus, onBlur, onChange, onMainBtnClick, onEmojiBtnClick, isFileBtnVisible, mainBtnIcon, emojiBtnIcon, fileBtnIcon, fileUploaderProps, resizeTop = false, resizeBottom = false, fitContentHeightOnInit = false, actionsBar, ...textfieldProps }, forwardedRef)=>{
|
|
14
|
+
const MentionsTextfield = /*#__PURE__*/ forwardRef(({ testId, tabIndex, className, label, info, required, error, help, disabled, resize, style, value, limit, showCounterLimit, autoVerticalResize = false, resetHeightOnClear = false, minHeight: minHeightProp, maxHeight, rows, size = TextfieldSize.M, onFocus, onBlur, onChange, onMainBtnClick, onEmojiBtnClick, isFileBtnVisible, mainBtnIcon, emojiBtnIcon, fileBtnIcon, fileUploaderProps, resizeTop = false, resizeBottom = false, fitContentHeightOnInit = false, actionsBar, helpProps, ...textfieldProps }, forwardedRef)=>{
|
|
15
15
|
const textfieldId = useId(textfieldProps.id);
|
|
16
16
|
const ref = useRef(null);
|
|
17
17
|
const innerRef = forwardedRef || ref;
|
|
@@ -44,6 +44,7 @@ const MentionsTextfield = /*#__PURE__*/ forwardRef(({ testId, tabIndex, classNam
|
|
|
44
44
|
info: info,
|
|
45
45
|
hasHelp: !!help,
|
|
46
46
|
size: size,
|
|
47
|
+
helpProps: helpProps,
|
|
47
48
|
children: /*#__PURE__*/ jsx(InnerContainer, {
|
|
48
49
|
withHelp: !!help,
|
|
49
50
|
popup: help,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type IHasTestId } from '../../../common/types';
|
|
2
|
+
interface AllSelectedChipProps extends IHasTestId {
|
|
3
|
+
label: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const AllSelectedChip: (props: AllSelectedChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../common/css/cn.js";
|
|
3
|
+
import { Chip } from "../../Chip/Chip.js";
|
|
4
|
+
import AllSelectedChip_module from "./AllSelectedChip.module.js";
|
|
5
|
+
const AllSelectedChip = (props)=>/*#__PURE__*/ jsx(Chip, {
|
|
6
|
+
selected: true,
|
|
7
|
+
label: props.label,
|
|
8
|
+
disabled: props.disabled,
|
|
9
|
+
tabIndex: -1,
|
|
10
|
+
className: cn(props.className, AllSelectedChip_module.nonInteractive),
|
|
11
|
+
testId: props.testId
|
|
12
|
+
});
|
|
13
|
+
export { AllSelectedChip };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { type Key, type KeyboardEventHandler, type ReactNode, type Ref } from 'react';
|
|
2
|
-
import { type DropdownItem, type RenderSelectedItem } from '../types';
|
|
2
|
+
import { type AllSelectedChipTextVariant, type DropdownItem, type GetAllSelectedChipText, type RenderSelectedItem } from '../types';
|
|
3
3
|
export interface RenderContentParams {
|
|
4
4
|
options: ReactNode;
|
|
5
5
|
input: ReactNode;
|
|
@@ -20,6 +20,17 @@ export interface MultiselectDropdownContentProps<T extends Key, DTO = any> {
|
|
|
20
20
|
* @example (count) => `выбрано ${count} элементов`
|
|
21
21
|
*/
|
|
22
22
|
getManyItemsChipText?: (itemsCount: number) => string;
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* коллбэк для определения текста для невлезающих элементов, отображаемого в строке поиска
|
|
26
|
+
* при выборе большого количества элементов
|
|
27
|
+
*
|
|
28
|
+
* @param itemsCount количество оставшихся элементов которые не влезли
|
|
29
|
+
* @example (count) => `еще ${count}...`
|
|
30
|
+
*/
|
|
31
|
+
getOtherText?: (itemsCount: number) => string;
|
|
32
|
+
allSelectedChipTextVariant?: AllSelectedChipTextVariant;
|
|
33
|
+
getAllSelectedChipText?: GetAllSelectedChipText;
|
|
23
34
|
/**
|
|
24
35
|
*
|
|
25
36
|
* коллбэк для определения текста, отображаемого при остутствии элемента при фильтрации
|