@moysklad/uikit 28.1.0 → 30.4.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 +3 -0
- package/dist/colorVariables.css +10 -0
- package/dist/components/AutoComplete/AutoComplete.d.ts +4 -2
- package/dist/components/AutoComplete/AutoComplete.js +45 -31
- package/dist/components/Badge/Badge.js +2 -3
- package/dist/components/Badge/Badge_module.css +2 -3
- package/dist/components/BottomSheet/BottomSheet.js +2 -2
- package/dist/components/Breadcrumbs/BreadcrumbItem.d.ts +5 -3
- package/dist/components/Breadcrumbs/BreadcrumbItem.js +39 -8
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +4 -1
- package/dist/components/Breadcrumbs/Breadcrumbs.js +10 -6
- package/dist/components/Button/Button.d.ts +1 -0
- package/dist/components/Button/Button.js +2 -2
- package/dist/components/Button/Button.module.js +1 -0
- package/dist/components/Button/Button_module.css +4 -0
- package/dist/components/Carousel/Carousel.js +5 -4
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Chip/Chip.helpers.js +5 -2
- package/dist/components/Chip/Chip.js +9 -3
- package/dist/components/Chip/Chip.legacy_module.css +2 -2
- package/dist/components/Chip/Chip.types.d.ts +10 -4
- package/dist/components/Chip/Chip_module.css +5 -5
- package/dist/components/Chip/components/ChipLabel.d.ts +3 -1
- package/dist/components/Chip/components/ChipLabel.js +4 -2
- package/dist/components/Chip/components/ChipMainButton.d.ts +3 -4
- package/dist/components/Chip/components/ChipMainButton.js +2 -1
- package/dist/components/Chip/components/ChipRoot.d.ts +3 -2
- package/dist/components/Chip/components/ChipRoot.js +2 -1
- package/dist/components/Dropdown/Dropdown.d.ts +2 -0
- package/dist/components/Dropdown/Dropdown.js +7 -4
- package/dist/components/Dropdown/hooks/usePosition.d.ts +2 -1
- package/dist/components/Dropdown/hooks/usePosition.js +3 -3
- package/dist/components/EditableTitle/EditableTitle.js +1 -1
- package/dist/components/FieldLabel/FieldLabel.constants.d.ts +1 -0
- package/dist/components/FieldLabel/FieldLabel.constants.js +5 -0
- package/dist/components/FieldLabel/FieldLabel.d.ts +17 -0
- package/dist/components/FieldLabel/FieldLabel.js +76 -0
- package/dist/components/FieldLabel/FieldLabel.module.js +11 -0
- package/dist/components/FieldLabel/FieldLabel_module.css +42 -0
- package/dist/components/FieldLabel/components/HelpButton.d.ts +8 -0
- package/dist/components/FieldLabel/components/HelpButton.js +15 -0
- package/dist/components/FieldLabel/components/HelpButton.module.js +5 -0
- package/dist/components/FieldLabel/components/HelpButton_module.css +8 -0
- package/dist/components/FieldLabel/components/index.d.ts +1 -0
- package/dist/components/FieldLabel/components/index.js +1 -0
- package/dist/components/FileUploader/FileUploader.helpers.d.ts +1 -0
- package/dist/components/FileUploader/FileUploader.helpers.js +4 -1
- package/dist/components/FileUploader/FileUploader.js +3 -1
- package/dist/components/FileUploader/FileUploader.types.d.ts +1 -0
- package/dist/components/FileUploader/components/FileUploaderPreview/FileUploaderPreview.js +4 -4
- package/dist/components/Help/Help.d.ts +12 -5
- package/dist/components/Help/Help.js +22 -7
- package/dist/components/Help/Help.module.js +6 -2
- package/dist/components/Help/Help_module.css +36 -8
- package/dist/components/Hint/Hint.js +4 -5
- package/dist/components/Hint/Hint.module.js +2 -3
- package/dist/components/Hint/Hint_module.css +0 -9
- package/dist/components/Info/Info.d.ts +1 -4
- package/dist/components/Info/Info.js +27 -4
- package/dist/components/Info/Info.module.js +4 -1
- package/dist/components/Info/Info_module.css +21 -0
- package/dist/components/Input/Input.d.ts +10 -0
- package/dist/components/Input/Input.js +93 -42
- package/dist/components/Input/Input.module.js +19 -3
- package/dist/components/Input/Input_module.css +156 -19
- package/dist/components/Input/components/InfoBlock.d.ts +12 -0
- package/dist/components/Input/components/InfoBlock.js +29 -0
- package/dist/components/InputClear/InputClear.d.ts +5 -2
- package/dist/components/InputClear/InputClear.js +10 -4
- package/dist/components/InputClear/InputClear.module.js +3 -1
- package/dist/components/InputClear/InputClear_module.css +23 -10
- package/dist/components/InputUnit/InputUnit.d.ts +3 -0
- package/dist/components/InputUnit/InputUnit.js +42 -32
- package/dist/components/InputUnit/InputUnit.module.js +6 -1
- package/dist/components/InputUnit/InputUnit_module.css +27 -29
- package/dist/components/InputUnit/SelectUnit/SelectUnit.d.ts +1 -1
- package/dist/components/InputUnit/SelectUnit/SelectUnit.js +1 -4
- package/dist/components/InputUnit/SelectUnit/SelectUnit.module.js +1 -0
- package/dist/components/InputUnit/SelectUnit/SelectUnitVisible.d.ts +1 -1
- package/dist/components/InputUnit/SelectUnit/SelectUnitVisible.js +7 -2
- package/dist/components/InputUnit/SelectUnit/SelectUnit_module.css +29 -37
- package/dist/components/InputUnit/SelectUnit/type.d.ts +1 -0
- package/dist/components/InputUnit/Unit/Unit.js +1 -2
- package/dist/components/InputUnit/Unit/Unit_module.css +1 -0
- package/dist/components/Label/Label.d.ts +1 -0
- package/dist/components/LabelValue/LabelValue.js +18 -52
- package/dist/components/LabelValue/LabelValue.module.js +0 -3
- package/dist/components/LabelValue/LabelValue_module.css +0 -17
- package/dist/components/LabelValueCheckbox/LabelValueCheckbox.d.ts +10 -0
- package/dist/components/LabelValueCheckbox/LabelValueCheckbox.js +22 -0
- package/dist/components/LabelValueCheckbox/LabelValueCheckbox.module.js +5 -0
- package/dist/components/LabelValueCheckbox/LabelValueCheckbox_module.css +5 -0
- package/dist/components/LabelValueSelect/Input/Input_module.css +1 -3
- package/dist/components/MentionsTextfield/MentionsTextfield.d.ts +1 -1
- package/dist/components/MentionsTextfield/MentionsTextfield.js +41 -25
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.d.ts +7 -0
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.js +27 -0
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory.module.js +8 -0
- package/dist/components/MentionsTextfield/OptionForStory/OptionForStory_module.css +25 -0
- package/dist/components/MentionsTextfield/OptionForStory/index.d.ts +1 -0
- package/dist/components/MentionsTextfield/OptionForStory/index.js +1 -0
- package/dist/components/Multiselect/DropdownContent/MultiselectDropdownContent.js +5 -4
- package/dist/components/Multiselect/Input/Input_module.css +1 -3
- package/dist/components/Multiselect/Multiselect.d.ts +4 -0
- package/dist/components/Select/Combobox/Combobox_module.css +2 -6
- package/dist/components/Select/DropDownWithColors/DropDownWithColors.d.ts +1 -0
- package/dist/components/Select/DropDownWithColors/DropDownWithColors.js +2 -1
- package/dist/components/Select/DropdownActionsContainer/DropdownActionsContainer.d.ts +3 -0
- package/dist/components/Select/DropdownActionsContainer/DropdownActionsContainer.js +17 -0
- package/dist/components/Select/DropdownActionsContainer/DropdownActionsContainer.module.js +6 -0
- package/dist/components/Select/DropdownActionsContainer/DropdownActionsContainer_module.css +12 -0
- package/dist/components/Select/OptionsList/OptionsList.d.ts +2 -1
- package/dist/components/Select/OptionsList/OptionsList.js +3 -2
- package/dist/components/Select/OptionsList/OptionsList_module.css +4 -0
- package/dist/components/Select/Select.d.ts +8 -2
- package/dist/components/Select/Select.js +29 -34
- package/dist/components/Select/Select.module.js +1 -2
- package/dist/components/Select/Select_module.css +2 -14
- package/dist/components/Select/ShortVariant/ShortVariant.d.ts +5 -1
- package/dist/components/Select/ShortVariant/ShortVariant.js +5 -4
- package/dist/components/Select/ShortVariant/ShortVariant.module.js +1 -0
- package/dist/components/Select/ShortVariant/ShortVariant_module.css +5 -1
- package/dist/components/Select/types.d.ts +1 -0
- package/dist/components/Select/useDropdownPadding.d.ts +5 -0
- package/dist/components/Select/useDropdownPadding.js +22 -0
- package/dist/components/Textfield/Textfield.d.ts +18 -2
- package/dist/components/Textfield/Textfield.js +37 -13
- package/dist/components/Textfield/Textfield.module.js +2 -1
- package/dist/components/Textfield/Textfield_module.css +95 -23
- package/dist/components/Textfield/components/ActionButton/ActionButton.d.ts +9 -0
- package/dist/components/Textfield/components/ActionButton/ActionButton.js +12 -0
- package/dist/components/Textfield/components/ActionButton/ActionButton.module.js +9 -0
- package/dist/components/Textfield/components/ActionButton/ActionButton_module.css +54 -0
- package/dist/components/Textfield/components/ActionButton/index.d.ts +1 -0
- package/dist/components/Textfield/components/ActionButton/index.js +1 -0
- package/dist/components/Textfield/components/Container/Container.js +6 -3
- package/dist/components/Textfield/components/Counter/Counter.d.ts +3 -1
- package/dist/components/Textfield/components/Counter/Counter.js +5 -3
- package/dist/components/Textfield/components/Info/Info.d.ts +3 -1
- package/dist/components/Textfield/components/Info/Info.js +9 -4
- package/dist/components/Textfield/components/InnerContainer/InnerContainer.d.ts +3 -6
- package/dist/components/Textfield/components/InnerContainer/InnerContainer.js +2 -8
- package/dist/components/Textfield/components/InputContainer/InputContainer.d.ts +14 -3
- package/dist/components/Textfield/components/InputContainer/InputContainer.js +74 -5
- package/dist/components/Textfield/components/InputContainer/InputContainer.module.js +7 -1
- package/dist/components/Textfield/components/InputContainer/InputContainer_module.css +36 -7
- package/dist/components/Textfield/components/Label/Label.d.ts +2 -0
- package/dist/components/Textfield/components/Label/Label.js +11 -5
- package/dist/components/Textfield/components/Label/Label_module.css +1 -1
- package/dist/components/Textfield/components/ResizeHandle/ResizeHandle.d.ts +10 -0
- package/dist/components/Textfield/components/ResizeHandle/ResizeHandle.js +50 -0
- package/dist/components/Textfield/components/ResizeHandle/ResizeHandle.module.js +7 -0
- package/dist/components/Textfield/components/ResizeHandle/ResizeHandle_module.css +21 -0
- package/dist/components/Textfield/components/ResizeHandle/index.d.ts +1 -0
- package/dist/components/Textfield/components/ResizeHandle/index.js +1 -0
- package/dist/components/Textfield/consts/index.d.ts +2 -0
- package/dist/components/Textfield/consts/index.js +3 -0
- package/dist/components/Textfield/types/index.d.ts +12 -0
- package/dist/components/Textfield/types/index.js +5 -0
- package/dist/components/Textfield/utils/index.d.ts +3 -0
- package/dist/components/Textfield/utils/index.js +8 -0
- package/dist/components/Tooltip/Tooltip.d.ts +4 -1
- package/dist/components/Tooltip/Tooltip.js +9 -9
- package/dist/components/Tooltip/Tooltip.module.js +3 -1
- package/dist/components/Tooltip/Tooltip_module.css +13 -3
- package/dist/components/Tooltip/{consts.d.ts → constants/ArrowAlign.d.ts} +0 -2
- package/dist/components/Tooltip/constants/TooltipBodyColor.d.ts +4 -0
- package/dist/components/Tooltip/constants/TooltipBodyColor.js +5 -0
- package/dist/components/Tooltip/constants/index.d.ts +2 -0
- package/dist/components/Tooltip/constants/index.js +2 -0
- package/dist/components/Tooltip/hooks.d.ts +2 -2
- package/dist/components/Tooltip/hooks.js +1 -1
- package/dist/components/Tooltip/types.d.ts +4 -0
- package/dist/components/Tooltip/types.js +0 -0
- package/dist/components/ViewersStack/ViewersStack.d.ts +13 -0
- package/dist/components/ViewersStack/ViewersStack.js +77 -0
- package/dist/components/ViewersStack/ViewersStack.module.js +7 -0
- package/dist/components/ViewersStack/ViewersStack_module.css +18 -0
- package/dist/components/ViewersStack/components/Avatar/Avatar.d.ts +13 -0
- package/dist/components/ViewersStack/components/Avatar/Avatar.js +35 -0
- package/dist/components/ViewersStack/components/Avatar/Avatar.module.js +13 -0
- package/dist/components/ViewersStack/components/Avatar/Avatar_module.css +45 -0
- package/dist/components/ViewersStack/components/Counter/Counter.d.ts +9 -0
- package/dist/components/ViewersStack/components/Counter/Counter.js +27 -0
- package/dist/components/ViewersStack/components/Counter/Counter.module.js +5 -0
- package/dist/components/ViewersStack/components/Counter/Counter_module.css +20 -0
- package/dist/components/ViewersStack/components/ViewersTooltip/ViewersTooltip.d.ts +15 -0
- package/dist/components/ViewersStack/components/ViewersTooltip/ViewersTooltip.js +41 -0
- package/dist/components/ViewersStack/components/ViewersTooltip/ViewersTooltip.module.js +6 -0
- package/dist/components/ViewersStack/components/ViewersTooltip/ViewersTooltip_module.css +14 -0
- package/dist/components/ViewersStack/components/ViewersTooltipOverlayItem/ViewersTooltipOverlayItem.d.ts +6 -0
- package/dist/components/ViewersStack/components/ViewersTooltipOverlayItem/ViewersTooltipOverlayItem.js +53 -0
- package/dist/components/ViewersStack/components/ViewersTooltipOverlayItem/ViewersTooltipOverlayItem.module.js +7 -0
- package/dist/components/ViewersStack/components/ViewersTooltipOverlayItem/ViewersTooltipOverlayItem_module.css +18 -0
- package/dist/components/ViewersStack/components/common.module.js +7 -0
- package/dist/components/ViewersStack/components/common_module.css +27 -0
- package/dist/components/ViewersStack/types.d.ts +22 -0
- package/dist/components/ViewersStack/types.js +17 -0
- package/dist/components/ViewersStack/utils.d.ts +3 -0
- package/dist/components/ViewersStack/utils.js +17 -0
- package/dist/components/{EditableTitle → _shared/HintWithSkip}/HintWithSkip.d.ts +1 -1
- package/dist/components/{EditableTitle → _shared/HintWithSkip}/HintWithSkip.js +1 -1
- package/dist/data-grid/Table/Table.d.ts +14 -22
- package/dist/data-grid/Table/Table.js +99 -61
- package/dist/data-grid/Table/Table.module.js +2 -0
- package/dist/data-grid/Table/Table_module.css +23 -0
- package/dist/data-grid/Table/components/Body/Body.d.ts +10 -14
- package/dist/data-grid/Table/components/Body/Body.js +11 -47
- package/dist/data-grid/Table/components/DraggableRow/DraggableRow.js +1 -1
- package/dist/data-grid/Table/components/Footer/Footer.module.js +0 -1
- package/dist/data-grid/Table/components/Footer/FooterContent.d.ts +9 -0
- package/dist/data-grid/Table/components/Footer/{Footer.js → FooterContent.js} +4 -5
- package/dist/data-grid/Table/components/Footer/Footer_module.css +0 -5
- package/dist/data-grid/Table/components/Header/Header.module.js +0 -1
- package/dist/data-grid/Table/components/Header/HeaderCell.js +3 -1
- package/dist/data-grid/Table/components/Header/HeaderContent.d.ts +1 -0
- package/dist/data-grid/Table/components/Header/{Header.js → HeaderContent.js} +8 -6
- package/dist/data-grid/Table/components/Header/Header_module.css +0 -15
- package/dist/data-grid/Table/components/Row/Row.d.ts +13 -0
- package/dist/data-grid/Table/components/Row/Row.js +40 -0
- package/dist/data-grid/Table/components/Row/Row.module.js +14 -0
- package/dist/data-grid/Table/components/{TableRow/TableRow_module.css → Row/Row_module.css} +7 -7
- package/dist/data-grid/Table/components/SubRows/SubRows.d.ts +5 -4
- package/dist/data-grid/Table/components/SubRows/SubRows.js +3 -3
- package/dist/data-grid/Table/components/TableCell/TableCell.js +2 -0
- package/dist/data-grid/Table/components/TableDragOverlay/TableDragOverlay.d.ts +5 -6
- package/dist/data-grid/Table/components/TableDragOverlay/TableDragOverlay.js +2 -2
- package/dist/data-grid/Table/components/TableRow/TableRow.d.ts +6 -14
- package/dist/data-grid/Table/components/TableRow/TableRow.js +34 -25
- package/dist/data-grid/Table/components/VirtualTable/VirtualTable.d.ts +10 -0
- package/dist/data-grid/Table/components/VirtualTable/VirtualTable.js +78 -0
- package/dist/data-grid/Table/components/VirtualTable/VirtualTableRow.d.ts +11 -0
- package/dist/data-grid/Table/components/VirtualTable/VirtualTableRow.js +18 -0
- package/dist/data-grid/Table/components/index.d.ts +3 -3
- package/dist/data-grid/Table/components/index.js +2 -2
- package/dist/data-grid/Table/constants.d.ts +2 -0
- package/dist/data-grid/Table/constants.js +3 -1
- package/dist/data-grid/Table/hooks/index.d.ts +1 -0
- package/dist/data-grid/Table/hooks/index.js +1 -0
- package/dist/data-grid/Table/hooks/useRowContext.d.ts +16 -0
- package/dist/data-grid/Table/hooks/useRowContext.js +44 -0
- package/dist/data-grid/Table/hooks/useTableContext.d.ts +7 -2
- package/dist/data-grid/Table/hooks/useTableContext.js +12 -2
- package/dist/data-grid/Table/index.d.ts +2 -2
- package/dist/data-grid/Table/types.d.ts +8 -1
- package/dist/data-grid/Table/types.js +5 -0
- package/dist/data-grid/Table/utils/compareColumnIds.d.ts +1 -0
- package/dist/data-grid/Table/utils/compareColumnIds.js +6 -0
- package/dist/data-grid/Table/utils/getColumnWidthStyles.d.ts +5 -0
- package/dist/data-grid/Table/utils/getColumnWidthStyles.js +4 -1
- package/dist/data-grid/Table/utils/getTableColumnIds.d.ts +3 -0
- package/dist/data-grid/Table/utils/getTableColumnIds.js +5 -0
- package/dist/data-grid/Table/utils/index.d.ts +2 -0
- package/dist/data-grid/Table/utils/index.js +2 -0
- package/dist/data-grid/Table/utils/withDnD.js +1 -1
- package/dist/data-grid/base/DropdownItem/DropdownItem.d.ts +3 -3
- package/dist/data-grid/base/DropdownItem/DropdownItem.js +3 -2
- package/dist/data-grid/base/OverflowHint/OverflowHint.d.ts +1 -0
- package/dist/data-grid/base/OverflowHint/OverflowHint.js +5 -3
- package/dist/data-grid/base/OverflowHint/utils.d.ts +1 -0
- package/dist/data-grid/base/OverflowHint/utils.js +7 -0
- package/dist/data-grid/cells/AutoCompleteCell/AutoCompleteCell.js +3 -4
- package/dist/data-grid/cells/DecimalCell/DecimalCell_module.css +1 -1
- package/dist/data-grid/cells/FileCell/FileCell_module.css +1 -1
- package/dist/data-grid/cells/ImageCell/ImageCell.d.ts +1 -0
- package/dist/data-grid/cells/ImageCell/ImageCell.js +5 -2
- package/dist/data-grid/cells/IndexCheckboxDndCell/IndexCheckboxDndCell.d.ts +7 -2
- package/dist/data-grid/cells/IndexCheckboxDndCell/IndexCheckboxDndCell.js +6 -4
- package/dist/data-grid/cells/InputCell/InputCell.js +3 -4
- package/dist/data-grid/cells/IntegerCell/IntegerCell_module.css +1 -1
- package/dist/data-grid/cells/LinkCell/LinkCell_module.css +1 -1
- package/dist/data-grid/cells/NameCell/NameCell.js +3 -0
- package/dist/data-grid/cells/NameCell/NameCell_module.css +2 -2
- package/dist/data-grid/cells/NumberInputCell/NumberInputCell.js +19 -17
- package/dist/data-grid/cells/SelectCell/SelectCell.js +3 -4
- package/dist/data-grid/cells/TextCell/TextCell_module.css +1 -1
- package/dist/data-grid/cells/ToggleCell/ToggleCell_module.css +1 -1
- package/dist/data-grid/cells/components/EditableCellWrapper/EditableCellWrapper.d.ts +3 -0
- package/dist/data-grid/cells/components/EditableCellWrapper/EditableCellWrapper.js +9 -0
- package/dist/data-grid/cells/components/EditableCellWrapper/EditableCellWrapper.module.js +5 -0
- package/dist/data-grid/cells/{NumberInputCell/NumberInputCell_module.css → components/EditableCellWrapper/EditableCellWrapper_module.css} +2 -2
- package/dist/data-grid/cells/components/EditableCellWrapper/index.d.ts +1 -0
- package/dist/data-grid/cells/components/EditableCellWrapper/index.js +1 -0
- package/dist/data-grid/cells/components/RowActionsMenu/RowActionsMenu.d.ts +4 -3
- package/dist/data-grid/cells/components/RowActionsMenu/RowActionsMenu.js +13 -13
- package/dist/data-grid/cells/components/TableInput/TableInput.js +19 -3
- package/dist/data-grid/cells/components/TableInput/TableInput_module.css +1 -1
- package/dist/data-grid/cells/components/TableNumberInput/TableNumberInput.d.ts +4 -3
- package/dist/data-grid/cells/components/TableNumberInput/TableNumberInput.js +44 -55
- package/dist/data-grid/cells/components/TableSelect/ActionButton/ActionButton.d.ts +4 -1
- package/dist/data-grid/cells/components/TableSelect/ActionButton/ActionButton.js +4 -3
- package/dist/data-grid/cells/components/TableSelect/TableSelect.d.ts +15 -10
- package/dist/data-grid/cells/components/TableSelect/TableSelect.js +11 -7
- package/dist/data-grid/cells/components/index.d.ts +1 -0
- package/dist/data-grid/cells/components/index.js +1 -0
- package/dist/data-grid/cells/index.d.ts +1 -1
- package/dist/data-grid/cells/index.js +1 -1
- package/dist/data-grid/headers/PlainTextHeader.js +3 -2
- package/dist/data-grid/headers/components/Dropdown/DropdownArrowBtn/DropdownArrowBtn.js +5 -1
- package/dist/data-grid/headers/components/Dropdown/Option/Option.d.ts +1 -1
- package/dist/data-grid/headers/components/Dropdown/Option/Option.js +2 -2
- package/dist/data-grid/headers/components/Dropdown/Option/Option_module.css +10 -2
- package/dist/data-grid/headers/components/HeaderBuilder/HeaderBuilder.d.ts +13 -3
- package/dist/data-grid/headers/components/HeaderBuilder/HeaderBuilder.js +64 -83
- package/dist/data-grid/headers/components/HeaderBuilder/HeaderBuilder.module.js +2 -1
- package/dist/data-grid/headers/components/HeaderBuilder/HeaderBuilder_module.css +21 -0
- package/dist/data-grid/headers/components/HeaderSortGroups/components/SortByOption/SortByOption.js +7 -15
- package/dist/data-grid/headers/components/HideColumn/HideColumn.js +8 -13
- package/dist/data-grid/headers/components/ResetFilter/ResetFilter.js +7 -10
- package/dist/data-grid/headers/components/ResetFilter/ResetFilter.module.js +0 -1
- package/dist/data-grid/headers/components/ResetFilter/ResetFilter_module.css +1 -21
- package/dist/data-grid/headers/components/index.d.ts +1 -1
- package/dist/data-grid/headers/index.d.ts +1 -1
- package/dist/data-grid/headers/types/types.d.ts +1 -0
- package/dist/data-grid/types/index.d.ts +1 -0
- package/dist/data-grid/utils/isOverflowed.js +21 -1
- package/dist/hooks/useDebounceCallback/useDebounceCallback.d.ts +2 -0
- package/dist/hooks/useDebounceCallback/useDebounceCallback.js +21 -0
- package/dist/hooks/useDismissOnFocusOutside/index.d.ts +2 -1
- package/dist/hooks/useDismissOnFocusOutside/index.js +4 -3
- package/dist/hooks/useDismissOnOutsideClick/index.d.ts +2 -1
- package/dist/hooks/useDismissOnOutsideClick/index.js +4 -3
- package/dist/hooks/useTextField/useTextField.d.ts +4 -5
- package/dist/hooks/useTextField/useTextField.js +6 -24
- package/dist/hooks/useUnmount/useUnmount.d.ts +1 -0
- package/dist/hooks/useUnmount/useUnmount.js +9 -0
- package/dist/icon/components/MyApps12Icon.d.ts +8 -0
- package/dist/icon/components/MyApps12Icon.js +18 -0
- package/dist/icon/components/MyApps16Icon.d.ts +8 -0
- package/dist/icon/components/MyApps16Icon.js +17 -0
- package/dist/icon/components/MyApps20Icon.d.ts +8 -0
- package/dist/icon/components/MyApps20Icon.js +18 -0
- package/dist/icon/components/Smile12Icon.d.ts +8 -0
- package/dist/icon/components/Smile12Icon.js +17 -0
- package/dist/icon/components/Smile16Icon.d.ts +8 -0
- package/dist/icon/components/Smile16Icon.js +16 -0
- package/dist/icon/components/Smile20Icon.d.ts +8 -0
- package/dist/icon/components/Smile20Icon.js +17 -0
- package/dist/icon/index.d.ts +6 -0
- package/dist/icon/index.js +6 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +3 -1
- package/dist/utils/debounce/debounce.d.ts +10 -0
- package/dist/utils/debounce/debounce.js +73 -0
- package/dist/utils/isRecordEqual/isRecordEqual.d.ts +1 -0
- package/dist/utils/isRecordEqual/isRecordEqual.js +9 -0
- package/dist/utils/utils.d.ts +2 -0
- package/dist/utils/utils.js +2 -0
- package/package.json +22 -3
- package/dist/components/LabelValue/HelpButton/HelpButton.module.js +0 -8
- package/dist/components/LabelValue/HelpButton/HelpButton_module.css +0 -44
- package/dist/components/LabelValue/HelpButton/index.d.ts +0 -8
- package/dist/components/LabelValue/HelpButton/index.js +0 -36
- package/dist/components/Textfield/components/ClearIcon/ClearIcon.d.ts +0 -6
- package/dist/components/Textfield/components/ClearIcon/ClearIcon.js +0 -13
- package/dist/components/Textfield/components/ClearIcon/ClearIcon.module.js +0 -6
- package/dist/components/Textfield/components/ClearIcon/ClearIcon_module.css +0 -11
- package/dist/data-grid/Table/components/Footer/Footer.d.ts +0 -9
- package/dist/data-grid/Table/components/Header/Header.d.ts +0 -8
- package/dist/data-grid/Table/components/TableRow/TableRow.module.js +0 -14
- package/dist/data-grid/cells/AutoCompleteCell/AutoCompleteCell.module.js +0 -5
- package/dist/data-grid/cells/AutoCompleteCell/AutoCompleteCell_module.css +0 -8
- package/dist/data-grid/cells/InputCell/InputCell.module.js +0 -5
- package/dist/data-grid/cells/InputCell/InputCell_module.css +0 -8
- package/dist/data-grid/cells/NumberInputCell/NumberInputCell.module.js +0 -5
- package/dist/data-grid/cells/SelectCell/SelectCell.module.js +0 -8
- package/dist/data-grid/cells/SelectCell/SelectCell_module.css +0 -33
- package/dist/data-grid/headers/components/HeaderSortGroups/components/SortByOption/SortByOption.module.js +0 -7
- package/dist/data-grid/headers/components/HeaderSortGroups/components/SortByOption/SortByOption_module.css +0 -22
- package/dist/data-grid/headers/components/HideColumn/HideColumn.module.js +0 -6
- package/dist/data-grid/headers/components/HideColumn/HideColumn_module.css +0 -20
- /package/dist/components/Tooltip/{consts.js → constants/ArrowAlign.js} +0 -0
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useCallback, useEffect, useImperativeHandle, useState } from "react";
|
|
3
|
-
import lodash_debounce from "lodash.debounce";
|
|
4
3
|
import { cn } from "../../common/css/cn.js";
|
|
5
|
-
import { Dropdown
|
|
4
|
+
import { Dropdown } from "../Dropdown/Dropdown.js";
|
|
6
5
|
import { getListboxTriggerA11y } from "../Dropdown/utils/getListboxTriggerA11y.js";
|
|
6
|
+
import { useDebounceCallback } from "../../hooks/useDebounceCallback/useDebounceCallback.js";
|
|
7
7
|
import { Add16Icon, RemoveClose12Icon } from "../../icon/index.js";
|
|
8
8
|
import { ActionButton } from "./ActionButton/ActionButton.js";
|
|
9
9
|
import { ArchivedInputValue } from "./ArchivedInputValue/ArchivedInputValue.js";
|
|
10
10
|
import { Combobox } from "./Combobox/Combobox.js";
|
|
11
|
+
import { DropdownActionsContainer } from "./DropdownActionsContainer/DropdownActionsContainer.js";
|
|
11
12
|
import { DropDownWithColors } from "./DropDownWithColors/DropDownWithColors.js";
|
|
12
13
|
import { EmptyState } from "./EmptyState/EmptyState.js";
|
|
13
14
|
import { Loading } from "./Loading/Loading.js";
|
|
@@ -16,14 +17,14 @@ import { OptionsList } from "./OptionsList/OptionsList.js";
|
|
|
16
17
|
import { ShortVariant } from "./ShortVariant/ShortVariant.js";
|
|
17
18
|
import { DropdownActionButton } from "./DropdownActionButton/index.js";
|
|
18
19
|
import { KEYBOARD_KEYS } from "./types.js";
|
|
20
|
+
import { useDropdownPadding } from "./useDropdownPadding.js";
|
|
19
21
|
import { SELECT_DROPDOWN_CLOSE_REASON, useSelectDropdown } from "./useSelectDropdown.js";
|
|
20
22
|
import { getFilteredOptions } from "./utils.js";
|
|
21
23
|
import Select_module from "./Select.module.js";
|
|
22
|
-
function SelectInner({ options, value, label, required, testId, disabled, placeholder, searchable = true, error, helperText = '', info = '', helpComponent, clearable = true, fullWidth, emptyText, className, dropdownClassName, dropdownOffsetX, dropdownOffsetY, isDropdownInnerScroll, optionClassName, isOptionEllipsis = true, style, dropdownStyle, dropdownZIndex, inputProps, variant = 'default', disableShortClear = false, hintZIndex = 100, isSearchDebounced = true, searchDebounceTimeout = 300, isLoading = false, loadingText = 'Загрузка...', onSearch, renderActions, renderDropdownContent, renderOption, onChange, onClear, renderValue, onDropdownToggle, renderInput, isDisableEnterSelect = false, isBlurNecessarily = false, isArchived = false, onAddButtonClick, addButtonText = '',
|
|
24
|
+
function SelectInner({ options, value, label, required, testId, disabled, placeholder, searchable = true, error, helperText = '', info = '', helpComponent, clearable = true, fullWidth, emptyText, className, dropdownClassName, dropdownOffsetX, dropdownOffsetY, isDropdownInnerScroll, optionClassName, isOptionEllipsis = true, style, dropdownStyle, dropdownZIndex, inputProps, variant = 'default', disableShortClear = false, hintZIndex = 100, isSearchDebounced = true, searchDebounceTimeout = 300, isLoading = false, loadingText = 'Загрузка...', skipSelectOnTab = false, shortVariantTextClassName, shortVariantContainerClassName, shortVariantIsVisibleFocusOutline, onSearch, renderActions, renderDropdownContent, renderOption, onChange, onClear, renderValue, onDropdownToggle, renderInput, isDisableEnterSelect = false, isBlurNecessarily = false, isArchived = false, onAddButtonClick, addButtonText = '', scrollableOptionsList, isFocusableOptionsList, closeOnSelect = true, renderDropdownActions, onFocus, onBlur, onKeyDown }, ref) {
|
|
23
25
|
const [cursor, setCursor] = useState(null);
|
|
24
26
|
const [searchText, setSearchText] = useState(value?.label ?? '');
|
|
25
27
|
const [newOptions, setNewOptions] = useState([]);
|
|
26
|
-
const [dropdownActionsContainerHeight, setDropdownActionsContainerHeight] = useState(0);
|
|
27
28
|
const showClearButton = clearable && (searchText.length > 0 || value);
|
|
28
29
|
const valueLabel = value?.label ?? '';
|
|
29
30
|
const filteredOptions = getFilteredOptions({
|
|
@@ -32,10 +33,10 @@ function SelectInner({ options, value, label, required, testId, disabled, placeh
|
|
|
32
33
|
newOptions,
|
|
33
34
|
valueLabel
|
|
34
35
|
});
|
|
35
|
-
const
|
|
36
|
-
onSearch
|
|
37
|
-
searchDebounceTimeout
|
|
36
|
+
const handleSearchCb = useCallback((text)=>onSearch?.(text), [
|
|
37
|
+
onSearch
|
|
38
38
|
]);
|
|
39
|
+
const handleDebouncedSearch = useDebounceCallback(handleSearchCb, searchDebounceTimeout);
|
|
39
40
|
const restoreInputFromValue = useCallback(()=>{
|
|
40
41
|
handleDebouncedSearch.cancel?.();
|
|
41
42
|
setSearchText(valueLabel);
|
|
@@ -85,13 +86,9 @@ function SelectInner({ options, value, label, required, testId, disabled, placeh
|
|
|
85
86
|
cursor,
|
|
86
87
|
hasActiveOption: open && null !== cursor && Boolean(filteredOptions[cursor])
|
|
87
88
|
});
|
|
89
|
+
const { scrollPaddings, dropdownActionsContainerRefCb } = useDropdownPadding();
|
|
88
90
|
const getDropdownStyle = ()=>{
|
|
89
91
|
const triggerWidth = triggerRef.current?.getBoundingClientRect()?.width ?? 0;
|
|
90
|
-
const scrollPadding = 4;
|
|
91
|
-
const scrollPaddings = {
|
|
92
|
-
scrollPaddingTop: scrollPadding,
|
|
93
|
-
scrollPaddingBottom: dropdownActionsContainerHeight + scrollPadding
|
|
94
|
-
};
|
|
95
92
|
if (renderDropdownContent) return {
|
|
96
93
|
minWidth: triggerWidth,
|
|
97
94
|
...scrollPaddings
|
|
@@ -131,6 +128,7 @@ function SelectInner({ options, value, label, required, testId, disabled, placeh
|
|
|
131
128
|
if (closeOnSelect) closeDropdown(SELECT_DROPDOWN_CLOSE_REASON.SELECT);
|
|
132
129
|
}, [
|
|
133
130
|
value,
|
|
131
|
+
closeOnSelect,
|
|
134
132
|
onChange,
|
|
135
133
|
closeDropdown
|
|
136
134
|
]);
|
|
@@ -155,9 +153,6 @@ function SelectInner({ options, value, label, required, testId, disabled, placeh
|
|
|
155
153
|
if (e.key === KEYBOARD_KEYS.ESCAPE) restoreInputFromValue();
|
|
156
154
|
inputProps?.onKeyUp?.(e);
|
|
157
155
|
};
|
|
158
|
-
const dropdownActionsContainerRefCb = useCallback((node)=>{
|
|
159
|
-
setDropdownActionsContainerHeight(node?.clientHeight ?? 0);
|
|
160
|
-
}, []);
|
|
161
156
|
const handleInputBlur = useCallback((e)=>{
|
|
162
157
|
if (isBlurNecessarily) inputProps?.onBlur?.(e);
|
|
163
158
|
if (filteredOptions.length && searchText.length) return;
|
|
@@ -277,7 +272,13 @@ function SelectInner({ options, value, label, required, testId, disabled, placeh
|
|
|
277
272
|
style: style,
|
|
278
273
|
disableClear: disableShortClear,
|
|
279
274
|
testId: testId,
|
|
280
|
-
hintZIndex: hintZIndex
|
|
275
|
+
hintZIndex: hintZIndex,
|
|
276
|
+
textClassName: shortVariantTextClassName,
|
|
277
|
+
shortVariantContainerClassName: shortVariantContainerClassName,
|
|
278
|
+
isVisibleFocusOutline: shortVariantIsVisibleFocusOutline,
|
|
279
|
+
onFocus: onFocus,
|
|
280
|
+
onBlur: onBlur,
|
|
281
|
+
onKeyDown: onKeyDown
|
|
281
282
|
}),
|
|
282
283
|
renderInput && renderInput({
|
|
283
284
|
triggerRef,
|
|
@@ -293,8 +294,8 @@ function SelectInner({ options, value, label, required, testId, disabled, placeh
|
|
|
293
294
|
}),
|
|
294
295
|
/*#__PURE__*/ jsxs(Dropdown, {
|
|
295
296
|
...dropdownAriaProps,
|
|
296
|
-
className: dropdownClassName,
|
|
297
|
-
open: open,
|
|
297
|
+
className: cn(Select_module.dropdown, dropdownClassName),
|
|
298
|
+
open: disabled ? false : open,
|
|
298
299
|
triggerRef: triggerRef,
|
|
299
300
|
onClose: closeDropdown,
|
|
300
301
|
testId: testId ? `${testId}-dropdown` : '',
|
|
@@ -326,32 +327,26 @@ function SelectInner({ options, value, label, required, testId, disabled, placeh
|
|
|
326
327
|
value,
|
|
327
328
|
searchHandler: handleSearch,
|
|
328
329
|
inputKeyUpHandler: handleInputKeyUp,
|
|
329
|
-
clearHandler: handleClear
|
|
330
|
+
clearHandler: handleClear,
|
|
331
|
+
isDropdownOpen: open
|
|
330
332
|
}) : /*#__PURE__*/ jsx(Fragment, {
|
|
331
333
|
children: isLoading ? loadingComponent : optionsList
|
|
332
334
|
}),
|
|
333
335
|
!isLoading && !renderDropdownContent && 0 === filteredOptions.length && /*#__PURE__*/ jsx(EmptyState, {
|
|
334
336
|
text: emptyText
|
|
335
337
|
}),
|
|
336
|
-
showDropdownActions && /*#__PURE__*/ jsxs(
|
|
338
|
+
showDropdownActions && /*#__PURE__*/ jsxs(DropdownActionsContainer, {
|
|
337
339
|
ref: dropdownActionsContainerRefCb,
|
|
338
|
-
className: Select_module.dropdownActionsContainer,
|
|
339
340
|
children: [
|
|
340
|
-
/*#__PURE__*/
|
|
341
|
-
|
|
342
|
-
className: Select_module.dropdownActions,
|
|
341
|
+
onAddButtonClick && /*#__PURE__*/ jsxs(DropdownActionButton, {
|
|
342
|
+
onClick: onAddButtonClick,
|
|
343
343
|
children: [
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
children: [
|
|
347
|
-
/*#__PURE__*/ jsx(Add16Icon, {}),
|
|
348
|
-
addButtonText
|
|
349
|
-
]
|
|
350
|
-
}),
|
|
351
|
-
renderDropdownActions?.({
|
|
352
|
-
closeDropdown
|
|
353
|
-
})
|
|
344
|
+
/*#__PURE__*/ jsx(Add16Icon, {}),
|
|
345
|
+
addButtonText
|
|
354
346
|
]
|
|
347
|
+
}),
|
|
348
|
+
renderDropdownActions?.({
|
|
349
|
+
closeDropdown
|
|
355
350
|
})
|
|
356
351
|
]
|
|
357
352
|
})
|
|
@@ -3,7 +3,6 @@ const Select_module = {
|
|
|
3
3
|
container: "container-C2p99t",
|
|
4
4
|
clearAction: "clearAction-sc7Lsp",
|
|
5
5
|
actions: "actions-cQr4nG",
|
|
6
|
-
|
|
7
|
-
dropdownActions: "dropdownActions-O89Lx9"
|
|
6
|
+
dropdown: "dropdown-_J2KVk"
|
|
8
7
|
};
|
|
9
8
|
export default Select_module;
|
|
@@ -15,19 +15,7 @@
|
|
|
15
15
|
display: none;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
.
|
|
19
|
-
|
|
20
|
-
position: sticky;
|
|
21
|
-
bottom: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.dropdownActions-O89Lx9 {
|
|
25
|
-
justify-content: center;
|
|
26
|
-
align-items: center;
|
|
27
|
-
padding: 0 16px 8px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.dropdownActions-O89Lx9 > button {
|
|
31
|
-
width: 100%;
|
|
18
|
+
.dropdown-_J2KVk:focus {
|
|
19
|
+
outline: none;
|
|
32
20
|
}
|
|
33
21
|
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
import { type HTMLAttributes } from 'react';
|
|
1
|
+
import { type HTMLAttributes, type KeyboardEventHandler } from 'react';
|
|
2
2
|
import type { IHasTestId } from '../../../common/types';
|
|
3
3
|
import type { IBaseSelectProps } from '../types';
|
|
4
4
|
interface Props extends IBaseSelectProps, HTMLAttributes<HTMLDivElement>, IHasTestId {
|
|
5
5
|
onClear: () => void;
|
|
6
6
|
disableClear?: boolean;
|
|
7
|
+
textClassName?: string;
|
|
8
|
+
shortVariantContainerClassName?: string;
|
|
9
|
+
onKeyDown?: KeyboardEventHandler<HTMLDivElement>;
|
|
10
|
+
isVisibleFocusOutline?: boolean;
|
|
7
11
|
}
|
|
8
12
|
export declare const ShortVariant: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
|
|
9
13
|
export {};
|
|
@@ -7,13 +7,13 @@ import { Info } from "../../Info/Info.js";
|
|
|
7
7
|
import { Label } from "../../Label/Label.js";
|
|
8
8
|
import { OverflowingHint } from "../OverflowingHint/OverflowingHint.js";
|
|
9
9
|
import ShortVariant_module from "./ShortVariant.module.js";
|
|
10
|
-
const ShortVariant = /*#__PURE__*/ forwardRef(({ testId, value, placeholder, label, helperText, info, error, required, className, disabled, disableClear, hintZIndex = 100, renderValue, onClear, tabIndex, ...otherProps }, ref)=>{
|
|
10
|
+
const ShortVariant = /*#__PURE__*/ forwardRef(({ testId, value, placeholder, label, helperText, info, error, required, className, disabled, textClassName, disableClear, hintZIndex = 100, shortVariantContainerClassName, renderValue, onClear, tabIndex, onKeyDown, isVisibleFocusOutline = true, ...otherProps }, ref)=>{
|
|
11
11
|
const handleClear = (e)=>{
|
|
12
12
|
e.stopPropagation();
|
|
13
13
|
onClear();
|
|
14
14
|
};
|
|
15
15
|
return /*#__PURE__*/ jsxs("div", {
|
|
16
|
-
className: ShortVariant_module.outerContainer,
|
|
16
|
+
className: cn(ShortVariant_module.outerContainer, shortVariantContainerClassName),
|
|
17
17
|
children: [
|
|
18
18
|
/*#__PURE__*/ jsx(Label, {
|
|
19
19
|
label: label,
|
|
@@ -24,9 +24,10 @@ const ShortVariant = /*#__PURE__*/ forwardRef(({ testId, value, placeholder, lab
|
|
|
24
24
|
role: "combobox",
|
|
25
25
|
tabIndex: disabled ? -1 : tabIndex ?? 0,
|
|
26
26
|
"aria-disabled": disabled,
|
|
27
|
-
className: cn(ShortVariant_module.container, className),
|
|
27
|
+
className: cn(ShortVariant_module.container, !isVisibleFocusOutline && ShortVariant_module.focusOutlineNone, className),
|
|
28
28
|
ref: ref,
|
|
29
29
|
"data-test-id": testId,
|
|
30
|
+
onKeyDown: onKeyDown,
|
|
30
31
|
...otherProps,
|
|
31
32
|
children: [
|
|
32
33
|
renderValue ? renderValue({
|
|
@@ -39,7 +40,7 @@ const ShortVariant = /*#__PURE__*/ forwardRef(({ testId, value, placeholder, lab
|
|
|
39
40
|
zIndex: hintZIndex,
|
|
40
41
|
hintText: value ? value.label : placeholder,
|
|
41
42
|
children: (ref)=>/*#__PURE__*/ jsx(Text.Body, {
|
|
42
|
-
className: ShortVariant_module.value,
|
|
43
|
+
className: cn(ShortVariant_module.value, textClassName),
|
|
43
44
|
ref: ref,
|
|
44
45
|
children: value ? value.label : placeholder
|
|
45
46
|
})
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
.container-sh9fLu {
|
|
6
6
|
cursor: pointer;
|
|
7
7
|
align-items: center;
|
|
8
|
-
column-gap:
|
|
8
|
+
column-gap: 4px;
|
|
9
9
|
width: fit-content;
|
|
10
10
|
display: flex;
|
|
11
11
|
}
|
|
@@ -28,6 +28,10 @@
|
|
|
28
28
|
display: flex;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
.focusOutlineNone-j96au6:focus {
|
|
32
|
+
outline: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
31
35
|
.value-W7MA4Q {
|
|
32
36
|
text-overflow: ellipsis;
|
|
33
37
|
white-space: nowrap;
|
|
@@ -50,6 +50,7 @@ export interface IRenderDropdownContentOptions<T = unknown> {
|
|
|
50
50
|
searchHandler: (text: string) => void;
|
|
51
51
|
inputKeyUpHandler: (e: KeyboardEvent<HTMLInputElement>) => void;
|
|
52
52
|
clearHandler: () => void;
|
|
53
|
+
isDropdownOpen: boolean;
|
|
53
54
|
}
|
|
54
55
|
export interface IRenderInputOptions {
|
|
55
56
|
triggerRef: MutableRefObject<HTMLDivElement | null>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useCallback, useMemo, useState } from "react";
|
|
2
|
+
const useDropdownPadding = ()=>{
|
|
3
|
+
const [dropdownActionsContainerHeight, setDropdownActionsContainerHeight] = useState(0);
|
|
4
|
+
const dropdownActionsContainerRefCb = useCallback((node)=>{
|
|
5
|
+
setDropdownActionsContainerHeight(node?.clientHeight ?? 0);
|
|
6
|
+
}, []);
|
|
7
|
+
const scrollPaddings = useMemo(()=>{
|
|
8
|
+
const scrollPadding = 4;
|
|
9
|
+
const scrollPaddings = {
|
|
10
|
+
scrollPaddingTop: scrollPadding,
|
|
11
|
+
scrollPaddingBottom: dropdownActionsContainerHeight + scrollPadding
|
|
12
|
+
};
|
|
13
|
+
return scrollPaddings;
|
|
14
|
+
}, [
|
|
15
|
+
dropdownActionsContainerHeight
|
|
16
|
+
]);
|
|
17
|
+
return {
|
|
18
|
+
scrollPaddings,
|
|
19
|
+
dropdownActionsContainerRefCb
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export { useDropdownPadding };
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode, type TextareaHTMLAttributes } from 'react';
|
|
2
2
|
import type { IHasTabIndex, IHasTestId } from '../../common/types';
|
|
3
|
+
import { type ITextfieldFileUploaderProps, type TextfieldSizeValue } from './types';
|
|
3
4
|
export interface TextfieldProps extends TextareaHTMLAttributes<HTMLTextAreaElement>, IHasTestId, IHasTabIndex {
|
|
4
5
|
name: string;
|
|
5
6
|
className?: string;
|
|
@@ -9,17 +10,32 @@ export interface TextfieldProps extends TextareaHTMLAttributes<HTMLTextAreaEleme
|
|
|
9
10
|
help?: ReactNode;
|
|
10
11
|
error?: boolean;
|
|
11
12
|
disabled?: boolean;
|
|
12
|
-
clearable?: boolean;
|
|
13
13
|
resize?: CSSProperties['resize'];
|
|
14
14
|
limit?: number;
|
|
15
15
|
showCounterLimit?: number;
|
|
16
16
|
autoVerticalResize?: boolean;
|
|
17
17
|
minHeight?: number;
|
|
18
18
|
maxHeight?: number;
|
|
19
|
-
actionsBar?: ReactNode;
|
|
20
19
|
resetHeightOnClear?: boolean;
|
|
21
20
|
fitContentHeightOnInit?: boolean;
|
|
22
21
|
textareaClassName?: string;
|
|
22
|
+
size?: TextfieldSizeValue;
|
|
23
|
+
onMainBtnClick?: () => void;
|
|
24
|
+
onEmojiBtnClick?: () => void;
|
|
25
|
+
mainBtnIcon?: ReactNode;
|
|
26
|
+
emojiBtnIcon?: ReactNode;
|
|
27
|
+
fileBtnIcon?: ReactNode;
|
|
28
|
+
isFileBtnVisible?: boolean;
|
|
29
|
+
fileUploaderProps?: ITextfieldFileUploaderProps;
|
|
30
|
+
resizeTop?: boolean;
|
|
31
|
+
resizeBottom?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Используйте onMainBtnClick, onEmojiBtnClick, isFileBtnVisible вместо
|
|
34
|
+
*/
|
|
35
|
+
actionsBar?: ReactNode;
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated пропс более не поддерживается
|
|
38
|
+
*/
|
|
23
39
|
onClear?: () => void;
|
|
24
40
|
}
|
|
25
41
|
export declare const Textfield: import("react").ForwardRefExoticComponent<TextfieldProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -7,13 +7,16 @@ import { useTextField } from "../../hooks/useTextField/useTextField.js";
|
|
|
7
7
|
import { Container } from "./components/Container/Container.js";
|
|
8
8
|
import { InnerContainer } from "./components/InnerContainer/InnerContainer.js";
|
|
9
9
|
import { InputContainer } from "./components/InputContainer/InputContainer.js";
|
|
10
|
+
import { ResizeHandle } from "./components/ResizeHandle/ResizeHandle.js";
|
|
11
|
+
import { TextfieldSize } from "./types/index.js";
|
|
12
|
+
import { getMinHeight } from "./utils/index.js";
|
|
10
13
|
import Textfield_module from "./Textfield.module.js";
|
|
11
|
-
const Textfield = /*#__PURE__*/ forwardRef(({ testId, tabIndex, className, label, info, required, error, help, disabled,
|
|
14
|
+
const Textfield = /*#__PURE__*/ forwardRef(({ testId, tabIndex, className, label, info, required, error, help, disabled, resize, style, value, limit, showCounterLimit, autoVerticalResize, minHeight: minHeightProp, maxHeight, rows, resetHeightOnClear = false, fitContentHeightOnInit = false, textareaClassName, size = TextfieldSize.M, onFocus, onBlur, onChange, onMainBtnClick, onEmojiBtnClick, isFileBtnVisible = false, mainBtnIcon, emojiBtnIcon, fileBtnIcon, fileUploaderProps, resizeTop = false, resizeBottom = false, actionsBar, ...textfieldProps }, forwardedRef)=>{
|
|
12
15
|
const textfieldId = useId(textfieldProps.id);
|
|
13
16
|
const ref = useRef(null);
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
+
const minHeight = getMinHeight(minHeightProp, size);
|
|
18
|
+
const hasResizeHandles = resizeTop || resizeBottom;
|
|
19
|
+
const { height, setHeight, isFocused, isLimitError, setIsFocused } = useTextField({
|
|
17
20
|
minHeight,
|
|
18
21
|
maxHeight,
|
|
19
22
|
ref,
|
|
@@ -21,8 +24,10 @@ const Textfield = /*#__PURE__*/ forwardRef(({ testId, tabIndex, className, label
|
|
|
21
24
|
autoVerticalResize,
|
|
22
25
|
limit,
|
|
23
26
|
resetHeightOnClear,
|
|
24
|
-
fitContentHeightOnInit
|
|
27
|
+
fitContentHeightOnInit,
|
|
28
|
+
hasResizeHandles
|
|
25
29
|
});
|
|
30
|
+
const effectiveHeight = autoVerticalResize || fitContentHeightOnInit || resetHeightOnClear || hasResizeHandles ? height || void 0 : void 0;
|
|
26
31
|
return /*#__PURE__*/ jsx(Container, {
|
|
27
32
|
textfieldId: textfieldId,
|
|
28
33
|
label: label,
|
|
@@ -36,20 +41,39 @@ const Textfield = /*#__PURE__*/ forwardRef(({ testId, tabIndex, className, label
|
|
|
36
41
|
error: error,
|
|
37
42
|
info: info,
|
|
38
43
|
hasHelp: !!help,
|
|
44
|
+
size: size,
|
|
39
45
|
children: /*#__PURE__*/ jsx(InnerContainer, {
|
|
40
|
-
clearable: clearable,
|
|
41
|
-
value: String(value),
|
|
42
|
-
disabled: disabled,
|
|
43
46
|
withHelp: !!help,
|
|
44
|
-
onClear: handleClear,
|
|
45
47
|
popup: help,
|
|
46
48
|
testId: testId,
|
|
47
49
|
children: /*#__PURE__*/ jsx(InputContainer, {
|
|
48
|
-
clearable: clearable,
|
|
49
50
|
disabled: disabled,
|
|
50
51
|
focused: isFocused,
|
|
51
52
|
error: error || isLimitError,
|
|
52
53
|
actionsBar: actionsBar,
|
|
54
|
+
size: size,
|
|
55
|
+
mainBtnIcon: mainBtnIcon,
|
|
56
|
+
emojiBtnIcon: emojiBtnIcon,
|
|
57
|
+
fileBtnIcon: fileBtnIcon,
|
|
58
|
+
onMainBtnClick: onMainBtnClick,
|
|
59
|
+
onEmojiBtnClick: onEmojiBtnClick,
|
|
60
|
+
isFileBtnVisible: isFileBtnVisible,
|
|
61
|
+
testId: testId,
|
|
62
|
+
fileUploaderProps: fileUploaderProps,
|
|
63
|
+
resizeTopSlot: resizeTop ? /*#__PURE__*/ jsx(ResizeHandle, {
|
|
64
|
+
direction: "top",
|
|
65
|
+
onHeightChange: setHeight,
|
|
66
|
+
startHeight: height || minHeight,
|
|
67
|
+
minHeight: minHeight,
|
|
68
|
+
maxHeight: maxHeight
|
|
69
|
+
}) : null,
|
|
70
|
+
resizeBottomSlot: resizeBottom ? /*#__PURE__*/ jsx(ResizeHandle, {
|
|
71
|
+
direction: "bottom",
|
|
72
|
+
onHeightChange: setHeight,
|
|
73
|
+
startHeight: height || minHeight,
|
|
74
|
+
minHeight: minHeight,
|
|
75
|
+
maxHeight: maxHeight
|
|
76
|
+
}) : null,
|
|
53
77
|
children: /*#__PURE__*/ jsx("textarea", {
|
|
54
78
|
...textfieldProps,
|
|
55
79
|
onChange: onChange,
|
|
@@ -60,11 +84,11 @@ const Textfield = /*#__PURE__*/ forwardRef(({ testId, tabIndex, className, label
|
|
|
60
84
|
forwardedRef
|
|
61
85
|
]),
|
|
62
86
|
"data-test-id": testId ? `${testId}-textfield` : null,
|
|
63
|
-
className: cn(Textfield_module.textarea,
|
|
87
|
+
className: cn(Textfield_module.textarea, Textfield_module[size], textareaClassName),
|
|
64
88
|
disabled: disabled,
|
|
65
89
|
style: {
|
|
66
|
-
resize,
|
|
67
|
-
height:
|
|
90
|
+
resize: hasResizeHandles ? 'none' : resize,
|
|
91
|
+
height: effectiveHeight,
|
|
68
92
|
minHeight,
|
|
69
93
|
...style
|
|
70
94
|
},
|
|
@@ -1,72 +1,144 @@
|
|
|
1
1
|
.textarea-V0PDbc {
|
|
2
|
-
color: var(--
|
|
2
|
+
scrollbar-color: var(--border-normal) #0000;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.textarea-V0PDbc.m-d5lyS7 {
|
|
6
|
+
letter-spacing: 0;
|
|
7
|
+
text-transform: none;
|
|
8
|
+
font-feature-settings: "tnum" on,"lnum" on;
|
|
9
|
+
-webkit-font-smoothing: antialiased;
|
|
10
|
+
color: var(--body-text-color, var(--text-primary, #091739));
|
|
3
11
|
box-sizing: border-box;
|
|
4
12
|
width: 100%;
|
|
5
13
|
resize: inherit;
|
|
6
14
|
background-color: #0000;
|
|
7
15
|
border: none;
|
|
8
|
-
border-radius: 8px;
|
|
9
16
|
outline: none;
|
|
10
|
-
|
|
17
|
+
margin: 0;
|
|
18
|
+
padding: 8px 8px 8px 12px;
|
|
11
19
|
font-family: ALS Hauss, sans-serif;
|
|
12
20
|
font-size: 14px;
|
|
13
|
-
font-style: normal;
|
|
14
21
|
font-weight: 400;
|
|
15
22
|
line-height: 20px;
|
|
16
23
|
display: block;
|
|
17
24
|
}
|
|
18
25
|
|
|
19
|
-
.textarea-V0PDbc.
|
|
20
|
-
padding-right: 36px;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
.textarea-V0PDbc:disabled, .textarea-V0PDbc:disabled:hover, .textarea-V0PDbc:disabled:focus {
|
|
26
|
+
.textarea-V0PDbc.m-d5lyS7:disabled, .textarea-V0PDbc.m-d5lyS7:disabled:hover, .textarea-V0PDbc.m-d5lyS7:disabled:focus {
|
|
24
27
|
color: var(--text-secondary, #5f6d79);
|
|
25
28
|
}
|
|
26
29
|
|
|
27
|
-
.textarea-V0PDbc::placeholder {
|
|
30
|
+
.textarea-V0PDbc.m-d5lyS7::placeholder {
|
|
28
31
|
color: var(--text-tertiary, #9fa7af);
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
.textarea-V0PDbc:focus-within, .textarea-V0PDbc:focus-visible, .textarea-V0PDbc:focus {
|
|
34
|
+
.textarea-V0PDbc.m-d5lyS7:focus-within, .textarea-V0PDbc.m-d5lyS7:focus-visible, .textarea-V0PDbc.m-d5lyS7:focus {
|
|
35
|
+
outline: none;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.textarea-V0PDbc.l-ZsiQBg {
|
|
39
|
+
letter-spacing: 0;
|
|
40
|
+
text-transform: none;
|
|
41
|
+
font-feature-settings: "tnum" on,"lnum" on;
|
|
42
|
+
-webkit-font-smoothing: antialiased;
|
|
43
|
+
color: #091739;
|
|
44
|
+
box-sizing: border-box;
|
|
45
|
+
width: 100%;
|
|
46
|
+
resize: inherit;
|
|
47
|
+
background-color: #0000;
|
|
48
|
+
border: none;
|
|
32
49
|
outline: none;
|
|
50
|
+
margin: 0;
|
|
51
|
+
padding: 8px 8px 8px 12px;
|
|
52
|
+
font-family: ALS Hauss, sans-serif;
|
|
53
|
+
font-size: 16px;
|
|
54
|
+
font-weight: 400;
|
|
55
|
+
line-height: 24px;
|
|
56
|
+
display: block;
|
|
33
57
|
}
|
|
34
58
|
|
|
35
|
-
.
|
|
36
|
-
|
|
59
|
+
.textarea-V0PDbc.l-ZsiQBg:disabled, .textarea-V0PDbc.l-ZsiQBg:disabled:hover, .textarea-V0PDbc.l-ZsiQBg:disabled:focus {
|
|
60
|
+
color: var(--text-secondary, #5f6d79);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.textarea-V0PDbc.l-ZsiQBg::placeholder {
|
|
64
|
+
color: var(--text-tertiary, #9fa7af);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.textarea-V0PDbc.l-ZsiQBg:focus-within, .textarea-V0PDbc.l-ZsiQBg:focus-visible, .textarea-V0PDbc.l-ZsiQBg:focus {
|
|
68
|
+
outline: none;
|
|
37
69
|
}
|
|
38
70
|
|
|
39
|
-
.input-tESIWx textarea {
|
|
40
|
-
|
|
71
|
+
.input-tESIWx.m-d5lyS7 textarea {
|
|
72
|
+
letter-spacing: 0;
|
|
73
|
+
text-transform: none;
|
|
74
|
+
font-feature-settings: "tnum" on,"lnum" on;
|
|
75
|
+
-webkit-font-smoothing: antialiased;
|
|
76
|
+
color: var(--body-text-color, var(--text-primary, #091739));
|
|
41
77
|
box-sizing: border-box;
|
|
42
78
|
width: 100%;
|
|
43
79
|
resize: inherit;
|
|
44
80
|
background-color: #0000;
|
|
45
81
|
border: none;
|
|
46
|
-
border-radius: 8px;
|
|
47
82
|
outline: none;
|
|
48
|
-
|
|
83
|
+
margin: 0;
|
|
84
|
+
padding: 8px 8px 8px 12px;
|
|
49
85
|
font-family: ALS Hauss, sans-serif;
|
|
50
86
|
font-size: 14px;
|
|
51
|
-
font-style: normal;
|
|
52
87
|
font-weight: 400;
|
|
53
88
|
line-height: 20px;
|
|
54
89
|
display: block;
|
|
55
90
|
}
|
|
56
91
|
|
|
57
|
-
.input-tESIWx textarea.
|
|
58
|
-
|
|
92
|
+
.input-tESIWx.m-d5lyS7 textarea:disabled, .input-tESIWx.m-d5lyS7 textarea:disabled:hover, .input-tESIWx.m-d5lyS7 textarea:disabled:focus {
|
|
93
|
+
color: var(--text-secondary, #5f6d79);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.input-tESIWx.m-d5lyS7 textarea::placeholder {
|
|
97
|
+
color: var(--text-tertiary, #9fa7af);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.input-tESIWx.m-d5lyS7 textarea:focus-within, .input-tESIWx.m-d5lyS7 textarea:focus-visible, .input-tESIWx.m-d5lyS7 textarea:focus {
|
|
101
|
+
outline: none;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.input-tESIWx.m-d5lyS7 textarea {
|
|
105
|
+
scrollbar-color: var(--border-normal) #0000;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.input-tESIWx.l-ZsiQBg textarea {
|
|
109
|
+
letter-spacing: 0;
|
|
110
|
+
text-transform: none;
|
|
111
|
+
font-feature-settings: "tnum" on,"lnum" on;
|
|
112
|
+
-webkit-font-smoothing: antialiased;
|
|
113
|
+
color: #091739;
|
|
114
|
+
box-sizing: border-box;
|
|
115
|
+
width: 100%;
|
|
116
|
+
resize: inherit;
|
|
117
|
+
background-color: #0000;
|
|
118
|
+
border: none;
|
|
119
|
+
outline: none;
|
|
120
|
+
margin: 0;
|
|
121
|
+
padding: 8px 8px 8px 12px;
|
|
122
|
+
font-family: ALS Hauss, sans-serif;
|
|
123
|
+
font-size: 16px;
|
|
124
|
+
font-weight: 400;
|
|
125
|
+
line-height: 24px;
|
|
126
|
+
display: block;
|
|
59
127
|
}
|
|
60
128
|
|
|
61
|
-
.input-tESIWx textarea:disabled, .input-tESIWx textarea:disabled:hover, .input-tESIWx textarea:disabled:focus {
|
|
129
|
+
.input-tESIWx.l-ZsiQBg textarea:disabled, .input-tESIWx.l-ZsiQBg textarea:disabled:hover, .input-tESIWx.l-ZsiQBg textarea:disabled:focus {
|
|
62
130
|
color: var(--text-secondary, #5f6d79);
|
|
63
131
|
}
|
|
64
132
|
|
|
65
|
-
.input-tESIWx textarea::placeholder {
|
|
133
|
+
.input-tESIWx.l-ZsiQBg textarea::placeholder {
|
|
66
134
|
color: var(--text-tertiary, #9fa7af);
|
|
67
135
|
}
|
|
68
136
|
|
|
69
|
-
.input-tESIWx textarea:focus-within, .input-tESIWx textarea:focus-visible, .input-tESIWx textarea:focus {
|
|
137
|
+
.input-tESIWx.l-ZsiQBg textarea:focus-within, .input-tESIWx.l-ZsiQBg textarea:focus-visible, .input-tESIWx.l-ZsiQBg textarea:focus {
|
|
70
138
|
outline: none;
|
|
71
139
|
}
|
|
72
140
|
|
|
141
|
+
.input-tESIWx.l-ZsiQBg textarea {
|
|
142
|
+
scrollbar-color: var(--border-normal) #0000;
|
|
143
|
+
}
|
|
144
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type FC, type ReactNode } from 'react';
|
|
2
|
+
import { type TextfieldSizeValue } from '../../types';
|
|
3
|
+
export interface ActionButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
4
|
+
size?: TextfieldSizeValue;
|
|
5
|
+
iconOverride?: ReactNode;
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
variant?: 'primary' | 'filled';
|
|
8
|
+
}
|
|
9
|
+
export declare const ActionButton: FC<ActionButtonProps>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
import { cn } from "../../../../common/index.js";
|
|
4
|
+
import { TextfieldSize } from "../../types/index.js";
|
|
5
|
+
import ActionButton_module from "./ActionButton.module.js";
|
|
6
|
+
const ActionButton = /*#__PURE__*/ memo(({ size = TextfieldSize.M, iconOverride, icon, variant = 'primary', ...otherProps })=>/*#__PURE__*/ jsx("button", {
|
|
7
|
+
className: cn(ActionButton_module.button, ActionButton_module[size], ActionButton_module[variant]),
|
|
8
|
+
...otherProps,
|
|
9
|
+
children: iconOverride ? iconOverride : icon
|
|
10
|
+
}));
|
|
11
|
+
ActionButton.displayName = 'ActionButton';
|
|
12
|
+
export { ActionButton };
|