@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,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type TableInputProps } from '../TableInput/TableInput';
|
|
3
3
|
import { type DefaultFormatterOptions } from './utils';
|
|
4
|
-
type OmittedTableInputProps = 'value' | 'onChange';
|
|
4
|
+
type OmittedTableInputProps = 'value' | 'onChange' | 'onBlur' | 'defaultValue';
|
|
5
5
|
export interface TableNumberInputProps extends Omit<TableInputProps, OmittedTableInputProps> {
|
|
6
6
|
value: number | null;
|
|
7
|
-
|
|
7
|
+
onBlur?: (e: React.FocusEvent<HTMLInputElement>, value: number | null) => void;
|
|
8
|
+
onChange?: (value: number | null) => void;
|
|
8
9
|
allowNegative?: boolean;
|
|
9
10
|
allowDecimal?: boolean;
|
|
10
11
|
decimalSeparator?: string;
|
|
@@ -13,5 +14,5 @@ export interface TableNumberInputProps extends Omit<TableInputProps, OmittedTabl
|
|
|
13
14
|
formatter?: (value: number | null) => string;
|
|
14
15
|
suffix?: string;
|
|
15
16
|
}
|
|
16
|
-
export declare const TableNumberInput: React.
|
|
17
|
+
export declare const TableNumberInput: React.MemoExoticComponent<React.ForwardRefExoticComponent<TableNumberInputProps & React.RefAttributes<HTMLDivElement>>>;
|
|
17
18
|
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, useEffect, useRef
|
|
2
|
+
import { forwardRef, memo, useCallback, useEffect, useRef } from "react";
|
|
3
|
+
import { mergeRefs } from "../../../../common/react/mergeRefs.js";
|
|
3
4
|
import { REGEX_COPY_PASTE_KEYS, RESERVED_CODES, RESERVED_KEYS } from "../../../../utils/index.js";
|
|
4
5
|
import { TableInput } from "../TableInput/TableInput.js";
|
|
5
6
|
import { getRegex, numberFormatter, parser, sanitize } from "./utils.js";
|
|
6
7
|
import TableNumberInput_module from "./TableNumberInput.module.js";
|
|
7
|
-
const TableNumberInput = ({ value, allowNegative = true, allowDecimal = true, decimalSeparator, maximumFractionDigits = 2, defaultFormatterOptions, formatter, suffix, onBlur, onChange,
|
|
8
|
+
const TableNumberInput = /*#__PURE__*/ memo(/*#__PURE__*/ forwardRef(({ value, allowNegative = true, allowDecimal = true, decimalSeparator, maximumFractionDigits = 2, defaultFormatterOptions, formatter, suffix, onBlur, onChange, onKeyDown, onPaste, inputRef: inputRefProp, ...rest }, ref)=>{
|
|
8
9
|
const inputRef = useRef(null);
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const handleFormat = useCallback((value)=>formatter ? formatter(value) : numberFormatter({
|
|
10
|
+
const timeoutRef = useRef();
|
|
11
|
+
const getFormattedValue = useCallback((value)=>formatter ? formatter(value) : numberFormatter({
|
|
12
12
|
value,
|
|
13
13
|
allowDecimal,
|
|
14
14
|
suffix,
|
|
@@ -19,7 +19,7 @@ const TableNumberInput = ({ value, allowNegative = true, allowDecimal = true, de
|
|
|
19
19
|
formatter,
|
|
20
20
|
suffix
|
|
21
21
|
]);
|
|
22
|
-
const
|
|
22
|
+
const getSanitizedValue = useCallback((input)=>sanitize({
|
|
23
23
|
input,
|
|
24
24
|
allowNegative,
|
|
25
25
|
allowDecimal,
|
|
@@ -29,7 +29,7 @@ const TableNumberInput = ({ value, allowNegative = true, allowDecimal = true, de
|
|
|
29
29
|
allowNegative,
|
|
30
30
|
suffix
|
|
31
31
|
]);
|
|
32
|
-
const
|
|
32
|
+
const getParsedValue = useCallback((input)=>parser({
|
|
33
33
|
input,
|
|
34
34
|
allowNegative,
|
|
35
35
|
allowDecimal,
|
|
@@ -43,48 +43,27 @@ const TableNumberInput = ({ value, allowNegative = true, allowDecimal = true, de
|
|
|
43
43
|
maximumFractionDigits,
|
|
44
44
|
suffix
|
|
45
45
|
]);
|
|
46
|
-
useEffect(()=>{
|
|
47
|
-
if (!isFocused) {
|
|
48
|
-
const formatted = handleFormat(value);
|
|
49
|
-
setDisplayValue(formatted);
|
|
50
|
-
}
|
|
51
|
-
}, [
|
|
52
|
-
handleFormat,
|
|
53
|
-
isFocused,
|
|
54
|
-
value
|
|
55
|
-
]);
|
|
56
|
-
const handleFocus = useCallback((e)=>{
|
|
57
|
-
setIsFocused(true);
|
|
58
|
-
onFocus?.(e);
|
|
59
|
-
}, [
|
|
60
|
-
onFocus
|
|
61
|
-
]);
|
|
62
46
|
const handleBlur = useCallback((e)=>{
|
|
63
|
-
|
|
64
|
-
const
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
if (
|
|
68
|
-
setDisplayValue(formatted);
|
|
69
|
-
onBlur?.(e);
|
|
47
|
+
const sanitizedValue = getSanitizedValue(e.target.value);
|
|
48
|
+
const parsedValue = getParsedValue(sanitizedValue);
|
|
49
|
+
const formatted = getFormattedValue(parsedValue);
|
|
50
|
+
onBlur?.(e, parsedValue);
|
|
51
|
+
if (inputRef.current) inputRef.current.value = formatted;
|
|
70
52
|
}, [
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
onBlur
|
|
75
|
-
onChange,
|
|
76
|
-
value
|
|
53
|
+
getFormattedValue,
|
|
54
|
+
getSanitizedValue,
|
|
55
|
+
getParsedValue,
|
|
56
|
+
onBlur
|
|
77
57
|
]);
|
|
78
58
|
const handleChange = useCallback((e)=>{
|
|
79
59
|
const rawInput = e.target.value;
|
|
80
|
-
const sanitizedValue =
|
|
81
|
-
const parsedValue =
|
|
82
|
-
|
|
83
|
-
onChange(parsedValue);
|
|
60
|
+
const sanitizedValue = getSanitizedValue(rawInput);
|
|
61
|
+
const parsedValue = getParsedValue(sanitizedValue);
|
|
62
|
+
onChange?.(parsedValue);
|
|
84
63
|
}, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
64
|
+
getParsedValue,
|
|
65
|
+
getSanitizedValue,
|
|
66
|
+
onChange
|
|
88
67
|
]);
|
|
89
68
|
const handleKeyDown = useCallback((e)=>{
|
|
90
69
|
const { key, ctrlKey, metaKey, code } = e;
|
|
@@ -109,32 +88,42 @@ const TableNumberInput = ({ value, allowNegative = true, allowDecimal = true, de
|
|
|
109
88
|
const end = input.selectionEnd || 0;
|
|
110
89
|
const currentValue = input.value;
|
|
111
90
|
const newValue = currentValue.substring(0, start) + pasteData + currentValue.substring(end);
|
|
112
|
-
const sanitizedValue =
|
|
113
|
-
|
|
114
|
-
setDisplayValue(sanitizedValue);
|
|
115
|
-
onChange(parsedValue);
|
|
91
|
+
const sanitizedValue = getSanitizedValue(newValue);
|
|
92
|
+
inputRef.current.value = sanitizedValue;
|
|
116
93
|
const newCursorPos = start + sanitizedValue.length;
|
|
117
|
-
|
|
94
|
+
clearTimeout(timeoutRef.current);
|
|
95
|
+
timeoutRef.current = setTimeout(()=>{
|
|
118
96
|
input.setSelectionRange(newCursorPos, newCursorPos);
|
|
119
97
|
}, 0);
|
|
120
98
|
onPaste?.(e);
|
|
121
99
|
}, [
|
|
122
|
-
|
|
123
|
-
handlerParse,
|
|
124
|
-
onChange,
|
|
100
|
+
getSanitizedValue,
|
|
125
101
|
onPaste
|
|
126
102
|
]);
|
|
103
|
+
useEffect(()=>{
|
|
104
|
+
if (inputRef.current) inputRef.current.value = getFormattedValue(value);
|
|
105
|
+
}, [
|
|
106
|
+
getFormattedValue,
|
|
107
|
+
value
|
|
108
|
+
]);
|
|
109
|
+
useEffect(()=>()=>{
|
|
110
|
+
clearTimeout(timeoutRef.current);
|
|
111
|
+
}, []);
|
|
112
|
+
const formattedValue = getFormattedValue(value);
|
|
127
113
|
return /*#__PURE__*/ jsx(TableInput, {
|
|
128
|
-
|
|
114
|
+
ref: ref,
|
|
115
|
+
inputRef: mergeRefs([
|
|
116
|
+
inputRefProp ?? null,
|
|
117
|
+
inputRef
|
|
118
|
+
]),
|
|
119
|
+
defaultValue: formattedValue,
|
|
129
120
|
inputClassName: TableNumberInput_module.input,
|
|
130
|
-
value: displayValue,
|
|
131
121
|
onChange: handleChange,
|
|
132
|
-
onFocus: handleFocus,
|
|
133
122
|
onBlur: handleBlur,
|
|
134
123
|
onKeyDown: handleKeyDown,
|
|
135
124
|
onPaste: handlePaste,
|
|
136
125
|
...rest
|
|
137
126
|
});
|
|
138
|
-
};
|
|
127
|
+
}));
|
|
139
128
|
TableNumberInput.displayName = 'TableNumberInput';
|
|
140
129
|
export { TableNumberInput };
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import { type ButtonHTMLAttributes, type FC } from 'react';
|
|
2
|
-
|
|
2
|
+
import { type IHasTestId } from '../../../../../common';
|
|
3
|
+
type Props = ButtonHTMLAttributes<HTMLButtonElement> & IHasTestId;
|
|
4
|
+
export declare const ActionButton: FC<Props>;
|
|
5
|
+
export {};
|
|
@@ -2,9 +2,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
import { cn } from "../../../../../common/index.js";
|
|
4
4
|
import ActionButton_module from "./ActionButton.module.js";
|
|
5
|
-
const ActionButton = /*#__PURE__*/ memo(({ className, ...
|
|
6
|
-
...
|
|
7
|
-
className: cn(ActionButton_module.button, className)
|
|
5
|
+
const ActionButton = /*#__PURE__*/ memo(({ className, testId, ...restProps })=>/*#__PURE__*/ jsx("button", {
|
|
6
|
+
...restProps,
|
|
7
|
+
className: cn(ActionButton_module.button, className),
|
|
8
|
+
"data-test-id": testId
|
|
8
9
|
}));
|
|
9
10
|
ActionButton.displayName = 'ActionButton';
|
|
10
11
|
export { ActionButton };
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
-
import React, { type ForwardedRef, type ReactNode } from 'react';
|
|
2
|
-
import { type SelectProps } from '../../../../components/Select/Select';
|
|
1
|
+
import React, { type ForwardedRef, type MouseEventHandler, type MutableRefObject, type ReactNode } from 'react';
|
|
2
|
+
import { type SelectProps as BaseSelectProps, type SelectRef } from '../../../../components/Select/Select';
|
|
3
3
|
import { type TableInputProps } from '../TableInput/TableInput';
|
|
4
|
-
type RenderInput<T = unknown> = NonNullable<
|
|
5
|
-
type RenderActionsOptions<T> = Pick<Parameters<RenderInput>[0], 'clearHandler' | 'toggleHandler'> & Pick<
|
|
4
|
+
type RenderInput<T = unknown> = NonNullable<BaseSelectProps<T>['renderInput']>;
|
|
5
|
+
type RenderActionsOptions<T> = Pick<Parameters<RenderInput>[0], 'clearHandler' | 'toggleHandler'> & Pick<BaseSelectProps<T>, 'value'>;
|
|
6
6
|
type OmittedSelectProps = 'children' | 'fullWidth' | 'helpComponent' | 'info' | 'inputProps' | 'label' | 'renderActions' | 'renderInput' | 'required' | 'searchable' | 'variant';
|
|
7
|
-
type
|
|
8
|
-
|
|
7
|
+
type SelectProps<T> = Omit<BaseSelectProps<T>, OmittedSelectProps>;
|
|
8
|
+
type PickedTableInputProps = 'className' | 'inputRef' | 'onBlur' | 'onChange' | 'onClick' | 'onFocus' | 'onKeyDown' | 'onKeyUp';
|
|
9
|
+
type InputProps = Pick<TableInputProps, PickedTableInputProps> & {
|
|
10
|
+
ref?: MutableRefObject<HTMLDivElement | null> | ((element: HTMLDivElement | null) => void);
|
|
11
|
+
};
|
|
12
|
+
export interface TableSelectProps<T = unknown> extends SelectProps<T> {
|
|
9
13
|
name?: string;
|
|
10
|
-
inputProps?:
|
|
14
|
+
inputProps?: InputProps;
|
|
11
15
|
renderActions?: (options: RenderActionsOptions<T>) => ReactNode;
|
|
16
|
+
customOnArrowBtnClick?: MouseEventHandler<HTMLDivElement>;
|
|
12
17
|
}
|
|
13
|
-
declare const TableSelectComponent: <T = unknown>(props: TableSelectProps<T>, ref: ForwardedRef<
|
|
18
|
+
declare const TableSelectComponent: <T = unknown>(props: TableSelectProps<T>, ref: ForwardedRef<SelectRef<T>>) => JSX.Element;
|
|
14
19
|
export declare const TableSelect: (<T>(props: TableSelectProps<T> & {
|
|
15
|
-
ref?: ForwardedRef<
|
|
20
|
+
ref?: ForwardedRef<SelectRef<T>>;
|
|
16
21
|
}) => ReturnType<typeof TableSelectComponent>) & {
|
|
17
|
-
ActionButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement
|
|
22
|
+
ActionButton: React.FC<React.ButtonHTMLAttributes<HTMLButtonElement> & import("../../../../common").IHasTestId>;
|
|
18
23
|
displayName: string;
|
|
19
24
|
};
|
|
20
25
|
export {};
|
|
@@ -6,7 +6,7 @@ import { Down12Icon, RemoveClose12Icon } from "../../../../icon/index.js";
|
|
|
6
6
|
import { TableInput } from "../TableInput/TableInput.js";
|
|
7
7
|
import { ActionButton } from "./ActionButton/ActionButton.js";
|
|
8
8
|
import TableSelect_module from "./TableSelect.module.js";
|
|
9
|
-
const TableSelectComponent = ({ inputProps, name, renderActions, ...selectProps }, ref)=>{
|
|
9
|
+
const TableSelectComponent = ({ inputProps, name, renderActions, customOnArrowBtnClick, ...selectProps }, ref)=>{
|
|
10
10
|
const inputRef = useRef(null);
|
|
11
11
|
const actionsRenderer = ({ clearHandler, toggleHandler })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
12
12
|
children: [
|
|
@@ -37,6 +37,7 @@ const TableSelectComponent = ({ inputProps, name, renderActions, ...selectProps
|
|
|
37
37
|
!selectProps.disabled && /*#__PURE__*/ jsx("div", {
|
|
38
38
|
className: cn(TableSelect_module.actionButton, TableSelect_module.interactiveOnly),
|
|
39
39
|
onClick: (event)=>{
|
|
40
|
+
if (customOnArrowBtnClick) return void customOnArrowBtnClick(event);
|
|
40
41
|
event.stopPropagation();
|
|
41
42
|
inputRef.current?.focus();
|
|
42
43
|
toggleHandler();
|
|
@@ -60,23 +61,25 @@ const TableSelectComponent = ({ inputProps, name, renderActions, ...selectProps
|
|
|
60
61
|
name: name,
|
|
61
62
|
placeholder: selectProps.placeholder,
|
|
62
63
|
onChange: (event)=>{
|
|
63
|
-
inputProps?.onChange?.(event);
|
|
64
64
|
searchHandler(event.target.value);
|
|
65
|
+
inputProps?.onChange?.(event);
|
|
65
66
|
},
|
|
66
67
|
onClick: (event)=>{
|
|
67
|
-
inputProps?.onClick?.(event);
|
|
68
68
|
openHandler();
|
|
69
|
+
inputProps?.onClick?.(event);
|
|
69
70
|
},
|
|
70
71
|
onKeyUp: (event)=>{
|
|
71
|
-
inputProps?.onKeyUp?.(event);
|
|
72
72
|
inputKeyUpHandler(event);
|
|
73
|
+
inputProps?.onKeyUp?.(event);
|
|
73
74
|
},
|
|
74
75
|
onKeyDown: inputProps?.onKeyDown,
|
|
76
|
+
onBlur: inputProps?.onBlur,
|
|
77
|
+
onFocus: inputProps?.onFocus,
|
|
75
78
|
ref: (element)=>{
|
|
76
79
|
triggerRef.current = element;
|
|
77
|
-
if (!ref) return;
|
|
78
|
-
if ('function' == typeof ref) return void ref(element);
|
|
79
|
-
ref.current = element;
|
|
80
|
+
if (!inputProps?.ref) return;
|
|
81
|
+
if ('function' == typeof inputProps.ref) return void inputProps.ref(element);
|
|
82
|
+
inputProps.ref.current = element;
|
|
80
83
|
},
|
|
81
84
|
inputRef: (element)=>{
|
|
82
85
|
inputRef.current = element;
|
|
@@ -91,6 +94,7 @@ const TableSelectComponent = ({ inputProps, name, renderActions, ...selectProps
|
|
|
91
94
|
return /*#__PURE__*/ jsx(Select, {
|
|
92
95
|
searchable: true,
|
|
93
96
|
renderInput: inputRenderer,
|
|
97
|
+
ref: ref,
|
|
94
98
|
...selectProps
|
|
95
99
|
});
|
|
96
100
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { EditableCellWrapper, type EditableCellWrapperProps, } from './EditableCellWrapper';
|
|
1
2
|
export { RowActionsMenu, type RowActionsMenuItem, type RowActionsMenuProps, } from './RowActionsMenu';
|
|
2
3
|
export { TableInput, type TableInputProps } from './TableInput';
|
|
3
4
|
export { numberFormatter, TableNumberInput, type TableNumberInputProps, } from './TableNumberInput';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { AutoCompleteCell, type AutoCompleteCellProps, } from './AutoCompleteCell';
|
|
2
2
|
export { BooleanCell } from './BooleanCell';
|
|
3
3
|
export { CheckboxCell } from './CheckboxCell';
|
|
4
|
-
export { numberFormatter, RowActionsMenu, type RowActionsMenuItem, type RowActionsMenuProps, TableInput, type TableInputProps, TableNumberInput, type TableNumberInputProps, TableSelect, type TableSelectProps, } from './components';
|
|
4
|
+
export { EditableCellWrapper, type EditableCellWrapperProps, numberFormatter, RowActionsMenu, type RowActionsMenuItem, type RowActionsMenuProps, TableInput, type TableInputProps, TableNumberInput, type TableNumberInputProps, TableSelect, type TableSelectProps, } from './components';
|
|
5
5
|
export { DateCell } from './DateCell';
|
|
6
6
|
export { DecimalCell } from './DecimalCell';
|
|
7
7
|
export { ETableFillCellValues, getBackgroundColorByFillState, getFillState, getTranslationPostfixByFillState, isFillStateWithTooltip, } from './DecimalCell/DecimalCell.helpers';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { AutoCompleteCell } from "./AutoCompleteCell/index.js";
|
|
2
2
|
export { BooleanCell } from "./BooleanCell/index.js";
|
|
3
3
|
export { CheckboxCell } from "./CheckboxCell/index.js";
|
|
4
|
-
export { RowActionsMenu, TableInput, TableNumberInput, TableSelect, numberFormatter } from "./components/index.js";
|
|
4
|
+
export { EditableCellWrapper, RowActionsMenu, TableInput, TableNumberInput, TableSelect, numberFormatter } from "./components/index.js";
|
|
5
5
|
export { DateCell } from "./DateCell/index.js";
|
|
6
6
|
export { DecimalCell } from "./DecimalCell/index.js";
|
|
7
7
|
export { ETableFillCellValues, getBackgroundColorByFillState, getFillState, getTranslationPostfixByFillState, isFillStateWithTooltip } from "./DecimalCell/DecimalCell.helpers.js";
|
|
@@ -3,7 +3,7 @@ import { memo } from "react";
|
|
|
3
3
|
import { HeaderBuilder } from "./components/index.js";
|
|
4
4
|
import { getColumnDefMeta } from "./utils/index.js";
|
|
5
5
|
const PlainTextHeaderComponent = ({ column })=>{
|
|
6
|
-
const { displayName, customHintText, hintZIndex, forceShowTooltip = false, className, testId, isScrollToDropdownDisabled, btnClassName } = getColumnDefMeta(column);
|
|
6
|
+
const { displayName, customHintText, hintZIndex, forceShowTooltip = false, className, testId, isScrollToDropdownDisabled, btnClassName, displayNamePosition = 'left' } = getColumnDefMeta(column);
|
|
7
7
|
return /*#__PURE__*/ jsx(HeaderBuilder, {
|
|
8
8
|
sortDirection: false,
|
|
9
9
|
displayName: displayName,
|
|
@@ -15,7 +15,8 @@ const PlainTextHeaderComponent = ({ column })=>{
|
|
|
15
15
|
className: className,
|
|
16
16
|
textOnly: true,
|
|
17
17
|
isScrollToDropdownDisabled: isScrollToDropdownDisabled,
|
|
18
|
-
btnClass: btnClassName
|
|
18
|
+
btnClass: btnClassName,
|
|
19
|
+
displayNamePosition: displayNamePosition
|
|
19
20
|
});
|
|
20
21
|
};
|
|
21
22
|
const PlainTextHeader = /*#__PURE__*/ memo(PlainTextHeaderComponent);
|
|
@@ -4,16 +4,20 @@ import { cn } from "../../../../../common/css/cn.js";
|
|
|
4
4
|
import { Down12Icon, Filter12Icon } from "../../../../../icon/index.js";
|
|
5
5
|
import { EllipsisText } from "../../EllipsisText/EllipsisText.js";
|
|
6
6
|
import DropdownArrowBtn_module from "./DropdownArrowBtn.module.js";
|
|
7
|
-
const DropdownArrowBtn = /*#__PURE__*/ memo(/*#__PURE__*/ forwardRef(({ name, isActive, isFiltered, disabled, onFocus, iconContainerClassName, className, testId, ...rest }, ref)=>{
|
|
7
|
+
const DropdownArrowBtn = /*#__PURE__*/ memo(/*#__PURE__*/ forwardRef(({ name, isActive, isFiltered, disabled, onFocus, iconContainerClassName, className, testId, onClick, ...rest }, ref)=>{
|
|
8
8
|
const handleFocus = (e)=>{
|
|
9
9
|
if (onFocus) onFocus(e);
|
|
10
10
|
};
|
|
11
|
+
const handOnClick = (e)=>{
|
|
12
|
+
if (onClick && !disabled) onClick(e);
|
|
13
|
+
};
|
|
11
14
|
return /*#__PURE__*/ jsxs("div", {
|
|
12
15
|
ref: ref,
|
|
13
16
|
"aria-disabled": disabled,
|
|
14
17
|
onFocus: handleFocus,
|
|
15
18
|
tabIndex: 0,
|
|
16
19
|
className: cn(DropdownArrowBtn_module.buttonContainer, className),
|
|
20
|
+
onClick: handOnClick,
|
|
17
21
|
...rest,
|
|
18
22
|
children: [
|
|
19
23
|
/*#__PURE__*/ jsx(EllipsisText, {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes, type MutableRefObject, type PropsWithChildren, type Ref } from 'react';
|
|
2
2
|
interface Props<V> extends Omit<HTMLAttributes<HTMLDivElement>, 'onSelect'> {
|
|
3
3
|
value?: V;
|
|
4
|
-
onSelect?: (value
|
|
4
|
+
onSelect?: (value?: V) => void;
|
|
5
5
|
}
|
|
6
6
|
export declare const OptionComponent: <V = undefined>({ children, className, value, onSelect, ...rest }: PropsWithChildren<Props<V>>, ref: MutableRefObject<HTMLDivElement> | null) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
type OptionWithRef = <V = undefined>(p: PropsWithChildren<Props<V>> & {
|
|
@@ -3,8 +3,8 @@ import { forwardRef } from "react";
|
|
|
3
3
|
import { cn } from "../../../../../common/css/cn.js";
|
|
4
4
|
import Option_module from "./Option.module.js";
|
|
5
5
|
const OptionComponent = ({ children, className, value, onSelect, ...rest }, ref)=>{
|
|
6
|
-
const handleSelectOption = ()=>{
|
|
7
|
-
onSelect?.(value);
|
|
6
|
+
const handleSelectOption = (e)=>{
|
|
7
|
+
if (0 === e.button) onSelect?.(value);
|
|
8
8
|
};
|
|
9
9
|
return /*#__PURE__*/ jsx("div", {
|
|
10
10
|
className: cn(Option_module.option, className),
|
|
@@ -5,11 +5,19 @@
|
|
|
5
5
|
color: var(--dark-grey-dark-900);
|
|
6
6
|
white-space: nowrap;
|
|
7
7
|
background: none;
|
|
8
|
-
|
|
8
|
+
border-radius: 8px;
|
|
9
|
+
align-items: center;
|
|
10
|
+
gap: 8px;
|
|
11
|
+
padding: 6px 12px;
|
|
9
12
|
font-size: 14px;
|
|
13
|
+
display: flex;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
.option-oFVuH3:hover {
|
|
13
|
-
background: var(--light-grey-
|
|
17
|
+
background: var(--light-grey-100);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.option-oFVuH3:active {
|
|
21
|
+
background-color: #f1f4f8;
|
|
14
22
|
}
|
|
15
23
|
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import React, { type FC, type PropsWithChildren } from 'react';
|
|
2
|
-
type
|
|
1
|
+
import React, { type FC, type PropsWithChildren, type ReactNode } from 'react';
|
|
2
|
+
type RenderDropdownContentOptions = {
|
|
3
|
+
closeDropdown: () => void;
|
|
4
|
+
};
|
|
5
|
+
type CustomOnClickArgs = {
|
|
6
|
+
defaultOnClick: () => void;
|
|
7
|
+
};
|
|
8
|
+
export type HeaderBuilderProps = {
|
|
3
9
|
sortDirection: false | 'asc' | 'desc';
|
|
4
10
|
btnClass?: string;
|
|
5
11
|
isFiltered?: boolean;
|
|
@@ -14,7 +20,11 @@ type Props = {
|
|
|
14
20
|
testId?: string;
|
|
15
21
|
textOnly?: boolean;
|
|
16
22
|
className?: string;
|
|
23
|
+
/** @deprecated удалён т.к. функционал не работал */
|
|
17
24
|
isScrollToDropdownDisabled?: boolean;
|
|
25
|
+
isDisabled?: boolean;
|
|
26
|
+
renderDropdownContent?: (options: RenderDropdownContentOptions) => ReactNode;
|
|
27
|
+
customOnClick?: (options: CustomOnClickArgs) => () => void;
|
|
18
28
|
};
|
|
19
|
-
export declare const HeaderBuilder: FC<PropsWithChildren<
|
|
29
|
+
export declare const HeaderBuilder: FC<PropsWithChildren<HeaderBuilderProps>>;
|
|
20
30
|
export {};
|
|
@@ -1,116 +1,91 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useCallback, useEffect, useMemo, useRef
|
|
2
|
+
import { memo, useCallback, useEffect, useMemo, useRef } from "react";
|
|
3
3
|
import { cn } from "../../../../common/css/cn.js";
|
|
4
|
-
import {
|
|
5
|
-
import { useId } from "../../../../hooks/useId/index.js";
|
|
4
|
+
import { Dropdown, useDropdown } from "../../../../components/Dropdown/Dropdown.js";
|
|
6
5
|
import { OverflowHint } from "../../../base/index.js";
|
|
7
|
-
import { isFullyVisibleX } from "../../../utils/index.js";
|
|
8
6
|
import { DATEPICKER_PORTAL_ID } from "../../constants/index.js";
|
|
9
|
-
import { Dropdown } from "../Dropdown/Dropdown.js";
|
|
10
7
|
import { DropdownArrowBtn } from "../Dropdown/DropdownArrowBtn/DropdownArrowBtn.js";
|
|
11
8
|
import { EllipsisText } from "../EllipsisText/EllipsisText.js";
|
|
12
9
|
import { ArrowIcon } from "./ArrowIcon.js";
|
|
13
10
|
import HeaderBuilder_module from "./HeaderBuilder.module.js";
|
|
14
11
|
const HeaderBuilder = /*#__PURE__*/ memo(({ children, sortDirection, btnClass, isFiltered, displayName, displayNamePosition = 'left', isNeedHint = true, dropdownStyle = {
|
|
15
12
|
width: 260
|
|
16
|
-
}, portalSelector, customHintText, hintZIndex, forceShowTooltip, testId, textOnly = false, className,
|
|
17
|
-
const [dropdownAlignment, setDropdownAlignment] = useState('left');
|
|
18
|
-
const [showDropdown, setShowDropdown] = useState(false);
|
|
19
|
-
const dropdownRef = useRef(null);
|
|
13
|
+
}, portalSelector, customHintText, hintZIndex, forceShowTooltip, testId, textOnly = false, className, isDisabled, renderDropdownContent, customOnClick })=>{
|
|
20
14
|
const buttonRef = useRef(null);
|
|
21
15
|
const displayNameRef = useRef(null);
|
|
22
16
|
const parentRef = useRef(null);
|
|
23
|
-
const
|
|
24
|
-
const hideDropdown = ()=>{
|
|
25
|
-
setShowDropdown(false);
|
|
26
|
-
setDropdownAlignment(null);
|
|
27
|
-
};
|
|
28
|
-
const handleClickOutside = (e)=>{
|
|
29
|
-
if (buttonRef.current?.contains(e.target) || document.querySelector(`#${DATEPICKER_PORTAL_ID}`)?.contains(e.target) || !showDropdown) return;
|
|
30
|
-
hideDropdown();
|
|
31
|
-
};
|
|
32
|
-
useClickOutside(handleClickOutside, dropdownRef);
|
|
17
|
+
const { open, handleClose, handleToggle, triggerAriaProps, dropdownAriaProps, dropdownRef } = useDropdown();
|
|
33
18
|
useEffect(()=>{
|
|
34
|
-
|
|
35
|
-
setShowDropdown(false);
|
|
36
|
-
setDropdownAlignment(null);
|
|
37
|
-
};
|
|
38
|
-
window.addEventListener('resize', close);
|
|
19
|
+
window.addEventListener('resize', handleClose);
|
|
39
20
|
return ()=>{
|
|
40
|
-
window.removeEventListener('resize',
|
|
21
|
+
window.removeEventListener('resize', handleClose);
|
|
41
22
|
};
|
|
42
|
-
}, [
|
|
23
|
+
}, [
|
|
24
|
+
handleClose
|
|
25
|
+
]);
|
|
43
26
|
const dataSortDirection = useMemo(()=>sortDirection && {
|
|
44
27
|
'data-sort-direction': sortDirection
|
|
45
28
|
}, [
|
|
46
29
|
sortDirection
|
|
47
30
|
]);
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (!isScrollToDropdownDisabled) parentRef.current.scrollIntoView({
|
|
61
|
-
behavior: 'smooth'
|
|
62
|
-
});
|
|
63
|
-
const headerRect = parentRef.current.getBoundingClientRect();
|
|
64
|
-
headerRect.width < dropdownRect.width ? setDropdownAlignment(alignmentByDropdownCord) : setDropdownAlignment('left');
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
});
|
|
69
|
-
if (!willBeOpened) setDropdownAlignment('left');
|
|
70
|
-
return willBeOpened;
|
|
31
|
+
const handleOnClick = useMemo(()=>customOnClick ? customOnClick({
|
|
32
|
+
defaultOnClick: handleToggle
|
|
33
|
+
}) : handleToggle, [
|
|
34
|
+
customOnClick,
|
|
35
|
+
handleToggle
|
|
36
|
+
]);
|
|
37
|
+
const component = useMemo(()=>{
|
|
38
|
+
const label = /*#__PURE__*/ jsx(EllipsisText, {
|
|
39
|
+
ref: displayNameRef,
|
|
40
|
+
"data-test-id": testId ? `${testId}-header-text` : 'header-text',
|
|
41
|
+
title: "",
|
|
42
|
+
children: displayName
|
|
71
43
|
});
|
|
72
|
-
|
|
73
|
-
|
|
44
|
+
const containerClassName = cn(HeaderBuilder_module.header, 'right' === displayNamePosition && HeaderBuilder_module.right, textOnly ? HeaderBuilder_module.plainText : btnClass, className);
|
|
45
|
+
return /*#__PURE__*/ jsx("div", {
|
|
74
46
|
ref: parentRef,
|
|
75
47
|
"data-test-id": testId ? `${testId}-header` : 'header',
|
|
76
48
|
children: textOnly ? /*#__PURE__*/ jsx("div", {
|
|
77
|
-
className:
|
|
78
|
-
children:
|
|
79
|
-
ref: displayNameRef,
|
|
80
|
-
title: "",
|
|
81
|
-
children: displayName
|
|
82
|
-
})
|
|
49
|
+
className: containerClassName,
|
|
50
|
+
children: label
|
|
83
51
|
}) : /*#__PURE__*/ jsx(DropdownArrowBtn, {
|
|
84
52
|
...dataSortDirection,
|
|
85
|
-
|
|
53
|
+
...triggerAriaProps,
|
|
54
|
+
className: containerClassName,
|
|
55
|
+
disabled: isDisabled,
|
|
86
56
|
isFiltered: isFiltered,
|
|
87
57
|
ref: buttonRef,
|
|
88
58
|
testId: testId,
|
|
89
|
-
name:
|
|
90
|
-
|
|
91
|
-
title: "",
|
|
92
|
-
"data-test-id": testId ? `${testId}-header-text` : 'header-text',
|
|
93
|
-
children: displayName
|
|
94
|
-
}),
|
|
95
|
-
onClick: handleToggleDropdown,
|
|
96
|
-
"aria-controls": dropdownId,
|
|
97
|
-
"aria-expanded": showDropdown,
|
|
98
|
-
"aria-haspopup": "menu",
|
|
59
|
+
name: label,
|
|
60
|
+
onClick: handleOnClick,
|
|
99
61
|
iconContainerClassName: HeaderBuilder_module.iconContainerClassName
|
|
100
62
|
})
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
displayNamePosition,
|
|
104
|
-
className,
|
|
63
|
+
});
|
|
64
|
+
}, [
|
|
105
65
|
btnClass,
|
|
66
|
+
className,
|
|
67
|
+
dataSortDirection,
|
|
106
68
|
displayName,
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
69
|
+
displayNamePosition,
|
|
70
|
+
handleOnClick,
|
|
71
|
+
isDisabled,
|
|
110
72
|
isFiltered,
|
|
111
|
-
showDropdown,
|
|
112
73
|
testId,
|
|
113
|
-
textOnly
|
|
74
|
+
textOnly,
|
|
75
|
+
triggerAriaProps
|
|
76
|
+
]);
|
|
77
|
+
const portalElement = useMemo(()=>document.querySelector(portalSelector ?? 'body'), [
|
|
78
|
+
portalSelector
|
|
79
|
+
]);
|
|
80
|
+
const shouldIgnoreOutsideInteraction = useCallback((target)=>{
|
|
81
|
+
const targetElement = target instanceof Element ? target : target.parentElement;
|
|
82
|
+
return Boolean(targetElement?.closest(`#${DATEPICKER_PORTAL_ID}`));
|
|
83
|
+
}, []);
|
|
84
|
+
const zIndex = useMemo(()=>{
|
|
85
|
+
const zIndexNumber = Number(dropdownStyle?.zIndex);
|
|
86
|
+
return isNaN(zIndexNumber) ? void 0 : zIndexNumber;
|
|
87
|
+
}, [
|
|
88
|
+
dropdownStyle?.zIndex
|
|
114
89
|
]);
|
|
115
90
|
return /*#__PURE__*/ jsxs("div", {
|
|
116
91
|
children: [
|
|
@@ -122,15 +97,21 @@ const HeaderBuilder = /*#__PURE__*/ memo(({ children, sortDirection, btnClass, i
|
|
|
122
97
|
forceShowTooltip: forceShowTooltip,
|
|
123
98
|
children: component
|
|
124
99
|
}) : component,
|
|
125
|
-
|
|
126
|
-
|
|
100
|
+
/*#__PURE__*/ jsx(Dropdown, {
|
|
101
|
+
...dropdownAriaProps,
|
|
127
102
|
ref: dropdownRef,
|
|
128
|
-
buttonRef: buttonRef,
|
|
129
|
-
align: dropdownAlignment ?? void 0,
|
|
130
103
|
style: dropdownStyle,
|
|
131
|
-
|
|
104
|
+
zIndex: zIndex,
|
|
132
105
|
testId: testId,
|
|
133
|
-
|
|
106
|
+
open: open,
|
|
107
|
+
triggerRef: buttonRef,
|
|
108
|
+
portalElement: portalElement,
|
|
109
|
+
onClose: handleClose,
|
|
110
|
+
className: HeaderBuilder_module.dropdownContainer,
|
|
111
|
+
shouldIgnoreOutsideInteraction: shouldIgnoreOutsideInteraction,
|
|
112
|
+
children: renderDropdownContent ? renderDropdownContent({
|
|
113
|
+
closeDropdown: handleClose
|
|
114
|
+
}) : children
|
|
134
115
|
}),
|
|
135
116
|
Boolean(sortDirection) && /*#__PURE__*/ jsx("div", {
|
|
136
117
|
className: HeaderBuilder_module.wrapper,
|