@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
|
@@ -3,7 +3,12 @@ type GetColumnWidthProps = {
|
|
|
3
3
|
column: Column<any>;
|
|
4
4
|
};
|
|
5
5
|
export declare const getColumnWidthStyles: ({ column }: GetColumnWidthProps) => {
|
|
6
|
+
display: string;
|
|
7
|
+
minWidth?: undefined;
|
|
8
|
+
width?: undefined;
|
|
9
|
+
} | {
|
|
6
10
|
minWidth: string;
|
|
7
11
|
width: string;
|
|
12
|
+
display?: undefined;
|
|
8
13
|
};
|
|
9
14
|
export {};
|
|
@@ -3,7 +3,10 @@ const optionalDefaultValue = (value)=>void 0 === value ? '' : `, ${value}px`;
|
|
|
3
3
|
const DEFAULT_COLUMN_MIN_SIZE = 80;
|
|
4
4
|
const DEFAULT_COLUMN_MAX_SIZE = 250;
|
|
5
5
|
const getColumnWidthStyles = ({ column })=>{
|
|
6
|
-
const { maxSizeInDefaultView = DEFAULT_COLUMN_MAX_SIZE, minSizeInDefaultView = DEFAULT_COLUMN_MIN_SIZE } = getColumnDefMeta(column);
|
|
6
|
+
const { maxSizeInDefaultView = DEFAULT_COLUMN_MAX_SIZE, minSizeInDefaultView = DEFAULT_COLUMN_MIN_SIZE, isHidden } = getColumnDefMeta(column);
|
|
7
|
+
if (isHidden) return {
|
|
8
|
+
display: 'none'
|
|
9
|
+
};
|
|
7
10
|
const sizeConfig = {
|
|
8
11
|
minWidth: optionalDefaultValue(minSizeInDefaultView),
|
|
9
12
|
maxWidth: optionalDefaultValue(maxSizeInDefaultView)
|
|
@@ -20,7 +20,7 @@ const withDnD = (TableComponent)=>(props)=>{
|
|
|
20
20
|
if (active && over && active.id !== over.id) {
|
|
21
21
|
const oldIndex = dndConfig.dataIds.indexOf(String(active.id));
|
|
22
22
|
const newIndex = dndConfig.dataIds.indexOf(String(over.id));
|
|
23
|
-
dndConfig.onDragEnd(oldIndex, newIndex);
|
|
23
|
+
dndConfig.onDragEnd(oldIndex, newIndex, String(active.id));
|
|
24
24
|
}
|
|
25
25
|
}, [
|
|
26
26
|
dndConfig,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { FC, MouseEvent, PropsWithChildren } from 'react';
|
|
1
|
+
import type { FC, HTMLAttributes, MouseEvent, PropsWithChildren } from 'react';
|
|
2
|
+
import { type IHasTestId } from '../../../common';
|
|
2
3
|
type Props = {
|
|
3
4
|
onClick: (event: MouseEvent<HTMLDivElement>) => void;
|
|
4
5
|
disabled?: boolean;
|
|
5
6
|
colorHex?: string;
|
|
6
7
|
className?: string;
|
|
7
|
-
testId?: string;
|
|
8
8
|
isFocused?: boolean;
|
|
9
|
-
}
|
|
9
|
+
} & IHasTestId & HTMLAttributes<HTMLDivElement>;
|
|
10
10
|
export declare const DropdownItem: FC<PropsWithChildren<Props>>;
|
|
11
11
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { cn } from "../../../common/
|
|
2
|
+
import { cn } from "../../../common/index.js";
|
|
3
3
|
import DropdownItem_module from "./DropdownItem.module.js";
|
|
4
|
-
const DropdownItem = ({ children, onClick, disabled, isFocused, colorHex, className, testId })=>/*#__PURE__*/ jsxs("div", {
|
|
4
|
+
const DropdownItem = ({ children, onClick, disabled, isFocused, colorHex, className, testId, ...restProps })=>/*#__PURE__*/ jsxs("div", {
|
|
5
5
|
onClick: disabled ? void 0 : onClick,
|
|
6
6
|
className: cn(DropdownItem_module.item, isFocused && DropdownItem_module.focused, disabled && DropdownItem_module.disabledItem, className),
|
|
7
|
+
...restProps,
|
|
7
8
|
children: [
|
|
8
9
|
/*#__PURE__*/ jsx("div", {
|
|
9
10
|
className: cn(disabled && DropdownItem_module.overlay)
|
|
@@ -6,5 +6,6 @@ export interface HintProps {
|
|
|
6
6
|
overflowElement: MutableRefObject<HTMLElement | null>;
|
|
7
7
|
parent?: MutableRefObject<HTMLElement | null>;
|
|
8
8
|
forceShowTooltip?: boolean;
|
|
9
|
+
forceHideTooltip?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare const OverflowHint: FC<PropsWithChildren<HintProps>>;
|
|
@@ -4,7 +4,8 @@ import { useCallback, useEffect, useRef, useState } from "react";
|
|
|
4
4
|
import { Hint } from "../../../components/Hint/Hint.js";
|
|
5
5
|
import { Text, TextColor } from "../../../components/Text/Text.js";
|
|
6
6
|
import { isFullyVisibleX, isOverflowed } from "../../utils/index.js";
|
|
7
|
-
|
|
7
|
+
import { getHintTextBasedOnElement } from "./utils.js";
|
|
8
|
+
const OverflowHint = ({ children, hintText: hintTextProp, hintZIndex = 6, overflowElement, parent, forceShowTooltip, forceHideTooltip })=>{
|
|
8
9
|
const DEBOUNCE_TIMEOUT = 500;
|
|
9
10
|
const timeoutRef = useRef(null);
|
|
10
11
|
const overlayRef = useRef(null);
|
|
@@ -21,7 +22,7 @@ const OverflowHint = ({ children, hintText, hintZIndex = 6, overflowElement, par
|
|
|
21
22
|
}
|
|
22
23
|
}, [
|
|
23
24
|
overflowElement,
|
|
24
|
-
|
|
25
|
+
forceShowTooltip
|
|
25
26
|
]);
|
|
26
27
|
const handleMouseLeave = useCallback(()=>{
|
|
27
28
|
setIsHiddenRender(true);
|
|
@@ -54,6 +55,7 @@ const OverflowHint = ({ children, hintText, hintZIndex = 6, overflowElement, par
|
|
|
54
55
|
overflowElement,
|
|
55
56
|
parent
|
|
56
57
|
]);
|
|
58
|
+
const hintText = hintTextProp || getHintTextBasedOnElement(overflowElement.current);
|
|
57
59
|
return /*#__PURE__*/ jsx("div", {
|
|
58
60
|
onMouseEnter: handleMouseEnter,
|
|
59
61
|
onMouseLeave: handleMouseLeave,
|
|
@@ -64,7 +66,7 @@ const OverflowHint = ({ children, hintText, hintZIndex = 6, overflowElement, par
|
|
|
64
66
|
children: hintText
|
|
65
67
|
}),
|
|
66
68
|
zIndex: hintZIndex,
|
|
67
|
-
visible: isVisible,
|
|
69
|
+
visible: isVisible && !forceHideTooltip,
|
|
68
70
|
overlayStyle: {
|
|
69
71
|
visibility: isHiddenRender ? 'hidden' : 'visible'
|
|
70
72
|
},
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getHintTextBasedOnElement: (element: HTMLElement | null) => string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const isHTMLInputElement = (element)=>'value' in element;
|
|
2
|
+
const getHintTextBasedOnElement = (element)=>{
|
|
3
|
+
if (!element) return '';
|
|
4
|
+
const hintText = isHTMLInputElement(element) ? element.value : element.textContent;
|
|
5
|
+
return hintText ?? '';
|
|
6
|
+
};
|
|
7
|
+
export { getHintTextBasedOnElement };
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useCallback, useEffect, useState } from "react";
|
|
3
|
-
import { cn } from "../../../common/index.js";
|
|
4
3
|
import { AutoComplete } from "../../../components/AutoComplete/AutoComplete.js";
|
|
4
|
+
import { EditableCellWrapper } from "../components/EditableCellWrapper/EditableCellWrapper.js";
|
|
5
5
|
import { TableInput } from "../components/index.js";
|
|
6
|
-
import AutoCompleteCell_module from "./AutoCompleteCell.module.js";
|
|
7
6
|
const AutoCompleteCellComponent = ({ cellContext, value, name, options, onBlur, onChange: onChangeProp, onSelectOption, cellClassName, style, ...restProps })=>{
|
|
8
7
|
const { column, row, table } = cellContext;
|
|
9
8
|
const [innerValue, setInnerValue] = useState(value ?? '');
|
|
@@ -27,9 +26,9 @@ const AutoCompleteCellComponent = ({ cellContext, value, name, options, onBlur,
|
|
|
27
26
|
}, [
|
|
28
27
|
onSelectOption
|
|
29
28
|
]);
|
|
30
|
-
return /*#__PURE__*/ jsx(
|
|
29
|
+
return /*#__PURE__*/ jsx(EditableCellWrapper, {
|
|
31
30
|
style: style,
|
|
32
|
-
className:
|
|
31
|
+
className: cellClassName,
|
|
33
32
|
children: /*#__PURE__*/ jsx(AutoComplete, {
|
|
34
33
|
...restProps,
|
|
35
34
|
name: name ?? `${cellContext.column.id}-${cellContext.row.index}`,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.wrapper-wz1Rk0 {
|
|
2
2
|
box-sizing: border-box;
|
|
3
|
-
padding: var(--cell-padding-top, 4px) var(--cell-padding-right,
|
|
3
|
+
padding: var(--cell-padding-top, 4px) var(--cell-padding-right, 8px) var(--cell-padding-bottom, 4px) var(--cell-padding-left, 8px);
|
|
4
4
|
grid-template-columns: auto;
|
|
5
5
|
display: grid;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.wrapper-e80Jgd {
|
|
2
2
|
box-sizing: border-box;
|
|
3
|
-
padding: var(--cell-padding-top, 4px) var(--cell-padding-right,
|
|
3
|
+
padding: var(--cell-padding-top, 4px) var(--cell-padding-right, 8px) var(--cell-padding-bottom, 4px) var(--cell-padding-left, 8px);
|
|
4
4
|
grid-template-columns: auto;
|
|
5
5
|
align-items: center;
|
|
6
6
|
gap: 10px;
|
|
@@ -8,5 +8,6 @@ export interface ImageCellProps extends ImageMiniatureProps {
|
|
|
8
8
|
carouselLoadingLabel?: CarouselProps['loadingLabel'];
|
|
9
9
|
carouselErrorLabel?: CarouselProps['errorLabel'];
|
|
10
10
|
carouselToolbarLabel?: CarouselProps['toolbarLabel'];
|
|
11
|
+
onCloseCarousel?: () => void;
|
|
11
12
|
}
|
|
12
13
|
export declare const ImageCell: FC<ImageCellProps>;
|
|
@@ -5,14 +5,17 @@ import { Carousel } from "../../../components/Carousel/Carousel.js";
|
|
|
5
5
|
import { ImagePreview } from "../../../components/ImagePreview/ImagePreview.js";
|
|
6
6
|
import { ImageMiniature } from "./ImageMiniature/ImageMiniature.js";
|
|
7
7
|
import ImageCell_module from "./ImageCell.module.js";
|
|
8
|
-
const ImageCell = ({ cellClassName, previewSrc, sources, testId, alt, onClick, carouselErrorLabel, carouselLoadingLabel, carouselToolbarLabel, ...rest })=>{
|
|
8
|
+
const ImageCell = ({ cellClassName, previewSrc, sources, testId, alt, onClick, onCloseCarousel, carouselErrorLabel, carouselLoadingLabel, carouselToolbarLabel, ...rest })=>{
|
|
9
9
|
const [isVisibleCarousel, setIsVisibleCarousel] = useState(false);
|
|
10
10
|
const handleShowCarousel = (e)=>{
|
|
11
11
|
if (sources) setIsVisibleCarousel(true);
|
|
12
12
|
onClick?.(e);
|
|
13
13
|
e.stopPropagation();
|
|
14
14
|
};
|
|
15
|
-
const handleCloseCarousel = ()=>
|
|
15
|
+
const handleCloseCarousel = ()=>{
|
|
16
|
+
setIsVisibleCarousel(false);
|
|
17
|
+
onCloseCarousel?.();
|
|
18
|
+
};
|
|
16
19
|
const content = /*#__PURE__*/ jsx(ImageMiniature, {
|
|
17
20
|
alt: alt,
|
|
18
21
|
onClick: handleShowCarousel,
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import type { Row, Table } from '@tanstack/react-table';
|
|
2
2
|
import { type IHasTestId } from '../../../common/types';
|
|
3
|
-
export interface IndexCheckboxDndCellProps<T> extends IHasTestId {
|
|
3
|
+
export interface IndexCheckboxDndCellProps<T, K> extends IHasTestId {
|
|
4
4
|
row: Row<T>;
|
|
5
5
|
table: Table<T>;
|
|
6
6
|
wrapperClassName?: string;
|
|
7
7
|
numberClassName?: string;
|
|
8
8
|
dotsClassName?: string;
|
|
9
|
+
data?: K[];
|
|
9
10
|
}
|
|
10
11
|
export declare const IndexCheckboxDndCell: {
|
|
11
|
-
<T
|
|
12
|
+
<T, K extends {
|
|
13
|
+
id: string;
|
|
14
|
+
} = {
|
|
15
|
+
id: string;
|
|
16
|
+
}>({ row, table, testId, wrapperClassName, numberClassName, dotsClassName, data, }: IndexCheckboxDndCellProps<T, K>): import("react/jsx-runtime").JSX.Element;
|
|
12
17
|
displayName: string;
|
|
13
18
|
};
|
|
@@ -7,8 +7,8 @@ import { Text, TextTag } from "../../../components/Text/Text.js";
|
|
|
7
7
|
import { DragNDrop12Icon } from "../../../icon/index.js";
|
|
8
8
|
import { useMassRowSelection } from "../../hooks/index.js";
|
|
9
9
|
import IndexCheckboxDndCell_module from "./IndexCheckboxDndCell.module.js";
|
|
10
|
-
const IndexCheckboxDndCell = ({ row, table, testId, wrapperClassName, numberClassName, dotsClassName })=>{
|
|
11
|
-
const { toggleSelected, getIsSelected, index } = row;
|
|
10
|
+
const IndexCheckboxDndCell = ({ row, table, testId, wrapperClassName, numberClassName, dotsClassName, data })=>{
|
|
11
|
+
const { toggleSelected, getIsSelected, index, id } = row;
|
|
12
12
|
const { rows } = table.getRowModel();
|
|
13
13
|
const onCheckboxClick = useMassRowSelection({
|
|
14
14
|
rowIdx: index,
|
|
@@ -16,9 +16,11 @@ const IndexCheckboxDndCell = ({ row, table, testId, wrapperClassName, numberClas
|
|
|
16
16
|
toggleSelected
|
|
17
17
|
});
|
|
18
18
|
const { attributes, listeners } = useSortable({
|
|
19
|
-
id
|
|
19
|
+
id
|
|
20
20
|
});
|
|
21
|
-
const formattedRowIndex = useMemo(()=>Intl.NumberFormat('ru').format(index + 1), [
|
|
21
|
+
const formattedRowIndex = useMemo(()=>Intl.NumberFormat('ru').format(data ? data.findIndex((el)=>el.id === id) + 1 : index + 1), [
|
|
22
|
+
data,
|
|
23
|
+
id,
|
|
22
24
|
index
|
|
23
25
|
]);
|
|
24
26
|
return /*#__PURE__*/ jsxs("div", {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useEffect, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { EditableCellWrapper } from "../components/EditableCellWrapper/EditableCellWrapper.js";
|
|
4
4
|
import { TableInput } from "../components/TableInput/TableInput.js";
|
|
5
|
-
import InputCell_module from "./InputCell.module.js";
|
|
6
5
|
const InputCellComponent = ({ cellContext, value, onBlur, onChange, cellClassName, style, ...inputProps })=>{
|
|
7
6
|
const { column, row, table } = cellContext;
|
|
8
7
|
const [innerValue, setInnerValue] = useState(value);
|
|
@@ -19,9 +18,9 @@ const InputCellComponent = ({ cellContext, value, onBlur, onChange, cellClassNam
|
|
|
19
18
|
setInnerValue(e.target.value);
|
|
20
19
|
onChange?.(e, row.index, column.id);
|
|
21
20
|
};
|
|
22
|
-
return /*#__PURE__*/ jsx(
|
|
21
|
+
return /*#__PURE__*/ jsx(EditableCellWrapper, {
|
|
23
22
|
style: style,
|
|
24
|
-
className:
|
|
23
|
+
className: cellClassName,
|
|
25
24
|
children: /*#__PURE__*/ jsx(TableInput, {
|
|
26
25
|
value: innerValue,
|
|
27
26
|
onChange: handleChange,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.wrapper-NvSmS6 {
|
|
2
2
|
box-sizing: border-box;
|
|
3
|
-
padding: var(--cell-padding-top, 4px) var(--cell-padding-right,
|
|
3
|
+
padding: var(--cell-padding-top, 4px) var(--cell-padding-right, 8px) var(--cell-padding-bottom, 4px) var(--cell-padding-left, 8px);
|
|
4
4
|
grid-template-columns: auto;
|
|
5
5
|
display: grid;
|
|
6
6
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.archiveable-mNwVU4 {
|
|
2
2
|
box-sizing: border-box;
|
|
3
|
-
padding: var(--cell-padding-top, 4px) var(--cell-padding-right,
|
|
3
|
+
padding: var(--cell-padding-top, 4px) var(--cell-padding-right, 8px) var(--cell-padding-bottom, 4px) var(--cell-padding-left, 8px);
|
|
4
4
|
grid-template-columns: auto auto;
|
|
5
5
|
justify-content: space-between;
|
|
6
6
|
align-items: center;
|
|
@@ -64,6 +64,7 @@ const NameCell = /*#__PURE__*/ memo(({ code, label, testId, isArchived, isDisabl
|
|
|
64
64
|
isDisabled,
|
|
65
65
|
isTextCollapsible,
|
|
66
66
|
label,
|
|
67
|
+
labelVariant,
|
|
67
68
|
linkProps,
|
|
68
69
|
nameClassName,
|
|
69
70
|
testId,
|
|
@@ -93,8 +94,10 @@ const NameCell = /*#__PURE__*/ memo(({ code, label, testId, isArchived, isDisabl
|
|
|
93
94
|
}),
|
|
94
95
|
menuProps?.showMenu && /*#__PURE__*/ jsx("div", {
|
|
95
96
|
className: NameCell_module.box,
|
|
97
|
+
onClick: (e)=>e.stopPropagation(),
|
|
96
98
|
children: /*#__PURE__*/ jsx(RowActionsMenu, {
|
|
97
99
|
menuItems: menuProps.menuItems,
|
|
100
|
+
disabled: menuProps.disabled,
|
|
98
101
|
renderDropDownContent: menuProps.renderDropDownContent,
|
|
99
102
|
buttonIcon: menuProps.buttonIcon,
|
|
100
103
|
dropdownClassName: menuProps.dropdownClassName,
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
overflow: visible;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
tr:hover > td > .wrapper-svgw8n .
|
|
71
|
+
tr:hover > td > .wrapper-svgw8n .label-cqqVn5, tr:focus-within > td > .wrapper-svgw8n .label-cqqVn5, tr:hover > td > .wrapper-svgw8n .label-cqqVn5 .disabled-MSSU6e, tr:focus-within > td > .wrapper-svgw8n .label-cqqVn5 .disabled-MSSU6e {
|
|
72
72
|
color: var(--button-primary-hover, #0b7cff);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
-
tr:hover > td > .wrapper-svgw8n .
|
|
75
|
+
tr:hover > td > .wrapper-svgw8n .label-cqqVn5.archived-fkYGc8, tr:focus-within > td > .wrapper-svgw8n .label-cqqVn5.archived-fkYGc8 {
|
|
76
76
|
color: var(--text-tertiary, #9fa7af);
|
|
77
77
|
}
|
|
78
78
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { memo, useContext, useEffect, useState } from "react";
|
|
3
|
-
import { cn } from "../../../common/index.js";
|
|
2
|
+
import { memo, useContext, useEffect, useMemo, useState } from "react";
|
|
4
3
|
import { LocaleContext } from "../../../context/index.js";
|
|
4
|
+
import { EditableCellWrapper } from "../components/EditableCellWrapper/EditableCellWrapper.js";
|
|
5
5
|
import { TableNumberInput } from "../components/TableNumberInput/TableNumberInput.js";
|
|
6
|
-
import NumberInputCell_module from "./NumberInputCell.module.js";
|
|
7
6
|
const NumberInputCellComponent = ({ cellContext, value, onBlur, onChange, cellClassName, style, defaultFormatterOptions, ...inputProps })=>{
|
|
8
7
|
const { column, row, table } = cellContext;
|
|
9
8
|
const { locale } = useContext(LocaleContext);
|
|
@@ -13,29 +12,32 @@ const NumberInputCellComponent = ({ cellContext, value, onBlur, onChange, cellCl
|
|
|
13
12
|
}, [
|
|
14
13
|
value
|
|
15
14
|
]);
|
|
16
|
-
const handleBlur = (e)=>{
|
|
17
|
-
if (innerValue !== value) table.options.meta?.updateData?.(row.index, column.id,
|
|
18
|
-
onBlur?.(e,
|
|
15
|
+
const handleBlur = (e, newValue)=>{
|
|
16
|
+
if (innerValue !== value) table.options.meta?.updateData?.(row.index, column.id, newValue);
|
|
17
|
+
onBlur?.(e, newValue, row.index, column.id);
|
|
19
18
|
};
|
|
20
19
|
const handleChange = (newValue)=>{
|
|
21
20
|
setInnerValue(newValue);
|
|
22
21
|
onChange?.(newValue, row.index, column.id);
|
|
23
22
|
};
|
|
24
|
-
const finalDefaultFormatterOptions = defaultFormatterOptions ? {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
const finalDefaultFormatterOptions = useMemo(()=>defaultFormatterOptions ? {
|
|
24
|
+
...defaultFormatterOptions,
|
|
25
|
+
locale: defaultFormatterOptions.locale ?? locale
|
|
26
|
+
} : {
|
|
27
|
+
locale
|
|
28
|
+
}, [
|
|
29
|
+
defaultFormatterOptions,
|
|
28
30
|
locale
|
|
29
|
-
|
|
30
|
-
return /*#__PURE__*/ jsx(
|
|
31
|
+
]);
|
|
32
|
+
return /*#__PURE__*/ jsx(EditableCellWrapper, {
|
|
31
33
|
style: style,
|
|
32
|
-
className:
|
|
34
|
+
className: cellClassName,
|
|
33
35
|
children: /*#__PURE__*/ jsx(TableNumberInput, {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
...inputProps,
|
|
37
|
+
value: value ?? null,
|
|
36
38
|
onBlur: handleBlur,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
+
onChange: handleChange,
|
|
40
|
+
defaultFormatterOptions: finalDefaultFormatterOptions
|
|
39
41
|
})
|
|
40
42
|
});
|
|
41
43
|
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { memo, useEffect, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { EditableCellWrapper } from "../components/EditableCellWrapper/EditableCellWrapper.js";
|
|
4
4
|
import { TableSelect } from "../components/TableSelect/TableSelect.js";
|
|
5
|
-
import SelectCell_module from "./SelectCell.module.js";
|
|
6
5
|
const SelectCellComponent = ({ context, dropdownStyle = {
|
|
7
6
|
maxHeight: '320px'
|
|
8
7
|
}, options, onChange, onClear, style, cellClassName, value, ...selectProps })=>{
|
|
@@ -23,9 +22,9 @@ const SelectCellComponent = ({ context, dropdownStyle = {
|
|
|
23
22
|
table.options.meta?.updateData?.(row.index, column.id, void 0);
|
|
24
23
|
onClear?.(row.index, column.id);
|
|
25
24
|
};
|
|
26
|
-
return /*#__PURE__*/ jsx(
|
|
25
|
+
return /*#__PURE__*/ jsx(EditableCellWrapper, {
|
|
27
26
|
style: style,
|
|
28
|
-
className:
|
|
27
|
+
className: cellClassName,
|
|
29
28
|
children: /*#__PURE__*/ jsx(TableSelect, {
|
|
30
29
|
value: innerValue,
|
|
31
30
|
options: options,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
.wrapper-cEE6lz {
|
|
2
2
|
box-sizing: border-box;
|
|
3
|
-
padding: var(--cell-padding-top, 4px) var(--cell-padding-right,
|
|
3
|
+
padding: var(--cell-padding-top, 4px) var(--cell-padding-right, 8px) var(--cell-padding-bottom, 4px) var(--cell-padding-left, 8px);
|
|
4
4
|
grid-template-columns: auto auto;
|
|
5
5
|
align-items: center;
|
|
6
6
|
gap: 10px;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, PropsWithChildren } from 'react';
|
|
2
|
+
export type EditableCellWrapperProps = PropsWithChildren<Pick<ComponentPropsWithoutRef<'div'>, 'style' | 'className'>>;
|
|
3
|
+
export declare const EditableCellWrapper: (props: EditableCellWrapperProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from "../../../../common/index.js";
|
|
3
|
+
import EditableCellWrapper_module from "./EditableCellWrapper.module.js";
|
|
4
|
+
const EditableCellWrapper = (props)=>/*#__PURE__*/ jsx("div", {
|
|
5
|
+
className: cn(props.className, EditableCellWrapper_module.wrapper),
|
|
6
|
+
style: props.style,
|
|
7
|
+
children: props.children
|
|
8
|
+
});
|
|
9
|
+
export { EditableCellWrapper };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
.wrapper-
|
|
1
|
+
.wrapper-D0vYd3 {
|
|
2
2
|
box-sizing: border-box;
|
|
3
|
-
padding: var(--cell-padding-top, 4px) var(--cell-padding-right,
|
|
3
|
+
padding: var(--cell-padding-top, 4px) var(--cell-padding-right, 4px) var(--cell-padding-bottom, 4px) var(--cell-padding-left, 4px);
|
|
4
4
|
align-items: center;
|
|
5
5
|
width: 100%;
|
|
6
6
|
display: flex;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EditableCellWrapper, type EditableCellWrapperProps, } from './EditableCellWrapper';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EditableCellWrapper } from "./EditableCellWrapper.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type MutableRefObject, type ReactNode, type RefObject } from 'react';
|
|
1
|
+
import { type HTMLAttributes, type MutableRefObject, type ReactNode, type RefObject } from 'react';
|
|
2
2
|
import { type IHasTestId } from '../../../../common';
|
|
3
3
|
export type RowActionsMenuItem = {
|
|
4
4
|
label: string;
|
|
5
5
|
onClick: () => void;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
-
} & IHasTestId
|
|
7
|
+
} & IHasTestId & HTMLAttributes<HTMLDivElement>;
|
|
8
8
|
type RenderDropdownContentOptions = {
|
|
9
9
|
dropdown: ReactNode;
|
|
10
10
|
triggerRef: MutableRefObject<HTMLElement | null>;
|
|
@@ -17,6 +17,7 @@ export type RowActionsMenuProps = {
|
|
|
17
17
|
buttonIcon?: ReactNode;
|
|
18
18
|
buttonClassName?: string;
|
|
19
19
|
dropdownClassName?: string;
|
|
20
|
+
disabled?: boolean;
|
|
20
21
|
} & IHasTestId;
|
|
21
|
-
export declare const RowActionsMenu: import("react").MemoExoticComponent<({ menuItems, renderDropDownContent, buttonIcon, buttonClassName, dropdownClassName, testId, }: RowActionsMenuProps) => import("react/jsx-runtime").JSX.Element>;
|
|
22
|
+
export declare const RowActionsMenu: import("react").MemoExoticComponent<({ menuItems, renderDropDownContent, buttonIcon, buttonClassName, dropdownClassName, testId, disabled, }: RowActionsMenuProps) => import("react/jsx-runtime").JSX.Element>;
|
|
22
23
|
export {};
|
|
@@ -6,7 +6,7 @@ import { DropdownItem } from "../../../base/DropdownItem/DropdownItem.js";
|
|
|
6
6
|
import { Still20Icon } from "../../../../icon/index.js";
|
|
7
7
|
import { KEY_CODES, KEY_CODES_TO_CLOSE, KEY_CODES_TO_OPEN } from "./consts.js";
|
|
8
8
|
import RowActionsMenu_module from "./RowActionsMenu.module.js";
|
|
9
|
-
const RowActionsMenu = /*#__PURE__*/ memo(({ menuItems, renderDropDownContent, buttonIcon, buttonClassName, dropdownClassName, testId })=>{
|
|
9
|
+
const RowActionsMenu = /*#__PURE__*/ memo(({ menuItems, renderDropDownContent, buttonIcon, buttonClassName, dropdownClassName, testId, disabled })=>{
|
|
10
10
|
const { open, triggerRef, triggerAriaProps, dropdownAriaProps, handleToggle, handleClose: closeDropdown, handleOpen, dropdownRef } = useDropdown();
|
|
11
11
|
const [cursor, setCursor] = useState(null);
|
|
12
12
|
const handleClose = useCallback(()=>{
|
|
@@ -17,17 +17,17 @@ const RowActionsMenu = /*#__PURE__*/ memo(({ menuItems, renderDropDownContent, b
|
|
|
17
17
|
]);
|
|
18
18
|
const menuItemNodes = useMemo(()=>{
|
|
19
19
|
if (0 === menuItems.length) return null;
|
|
20
|
-
return menuItems.map((
|
|
21
|
-
|
|
22
|
-
testId: item.testId ?? `${testId}-row-menu-option`,
|
|
20
|
+
return menuItems.map(({ label, testId: menuItemTestId, onClick, ...restMenuItemProps }, index)=>/*#__PURE__*/ jsx(DropdownItem, {
|
|
21
|
+
testId: menuItemTestId ?? `${testId}-row-menu-option`,
|
|
23
22
|
isFocused: index === cursor,
|
|
24
23
|
onClick: (e)=>{
|
|
25
|
-
|
|
24
|
+
onClick();
|
|
26
25
|
handleClose();
|
|
27
26
|
e.stopPropagation();
|
|
28
27
|
},
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
...restMenuItemProps,
|
|
29
|
+
children: label
|
|
30
|
+
}, label));
|
|
31
31
|
}, [
|
|
32
32
|
menuItems,
|
|
33
33
|
testId,
|
|
@@ -48,7 +48,10 @@ const RowActionsMenu = /*#__PURE__*/ memo(({ menuItems, renderDropDownContent, b
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
if (open) {
|
|
51
|
-
if (KEY_CODES_TO_CLOSE.includes(e.code))
|
|
51
|
+
if (KEY_CODES_TO_CLOSE.includes(e.code)) {
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
handleClose();
|
|
54
|
+
}
|
|
52
55
|
if ((e.code === KEY_CODES.ENTER || e.code === KEY_CODES.SPACE) && null !== cursor) {
|
|
53
56
|
e.preventDefault();
|
|
54
57
|
const { onClick, disabled } = menuItems[cursor];
|
|
@@ -94,11 +97,8 @@ const RowActionsMenu = /*#__PURE__*/ memo(({ menuItems, renderDropDownContent, b
|
|
|
94
97
|
tabIndex: 0,
|
|
95
98
|
"data-test-id": `${testId}-row-menu-button`,
|
|
96
99
|
"data-active": open,
|
|
97
|
-
onKeyDown: handleKeyDown,
|
|
98
|
-
onClick:
|
|
99
|
-
handleToggle();
|
|
100
|
-
e.stopPropagation();
|
|
101
|
-
},
|
|
100
|
+
onKeyDown: disabled ? void 0 : handleKeyDown,
|
|
101
|
+
onClick: disabled ? void 0 : handleToggle,
|
|
102
102
|
ref: (element)=>{
|
|
103
103
|
if (element) triggerRef.current = element;
|
|
104
104
|
},
|
|
@@ -1,13 +1,26 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useRef } from "react";
|
|
2
|
+
import { forwardRef, useCallback, useRef, useState } from "react";
|
|
3
3
|
import { cn } from "../../../../common/index.js";
|
|
4
4
|
import { OverflowHint } from "../../../base/OverflowHint/OverflowHint.js";
|
|
5
5
|
import { useId } from "../../../../hooks/index.js";
|
|
6
6
|
import TableInput_module from "./TableInput.module.js";
|
|
7
|
-
const TableInput = /*#__PURE__*/ forwardRef(({ actions, className, disabled, error, inputClassName, inputRef: inputRefProp, tabIndex, testId, value, ...inputProps }, ref)=>{
|
|
7
|
+
const TableInput = /*#__PURE__*/ forwardRef(({ actions, className, disabled, error, inputClassName, inputRef: inputRefProp, tabIndex, testId, value, onFocus, onBlur, ...inputProps }, ref)=>{
|
|
8
8
|
const inputId = useId(inputProps.id);
|
|
9
9
|
const inputRef = useRef(null);
|
|
10
10
|
const wrapperRef = useRef(null);
|
|
11
|
+
const [isFocused, setIsFocused] = useState(false);
|
|
12
|
+
const handleFocus = useCallback((e)=>{
|
|
13
|
+
setIsFocused(true);
|
|
14
|
+
if (onFocus) onFocus(e);
|
|
15
|
+
}, [
|
|
16
|
+
onFocus
|
|
17
|
+
]);
|
|
18
|
+
const handleBlur = useCallback((e)=>{
|
|
19
|
+
setIsFocused(false);
|
|
20
|
+
if (onBlur) onBlur(e);
|
|
21
|
+
}, [
|
|
22
|
+
onBlur
|
|
23
|
+
]);
|
|
11
24
|
return /*#__PURE__*/ jsx("div", {
|
|
12
25
|
className: TableInput_module.wrapper,
|
|
13
26
|
ref: wrapperRef,
|
|
@@ -16,6 +29,7 @@ const TableInput = /*#__PURE__*/ forwardRef(({ actions, className, disabled, err
|
|
|
16
29
|
hintZIndex: 6,
|
|
17
30
|
overflowElement: inputRef,
|
|
18
31
|
parent: wrapperRef,
|
|
32
|
+
forceHideTooltip: isFocused,
|
|
19
33
|
children: /*#__PURE__*/ jsxs("div", {
|
|
20
34
|
"data-disabled": disabled,
|
|
21
35
|
"data-error": error,
|
|
@@ -39,7 +53,9 @@ const TableInput = /*#__PURE__*/ forwardRef(({ actions, className, disabled, err
|
|
|
39
53
|
},
|
|
40
54
|
tabIndex: tabIndex,
|
|
41
55
|
type: "text",
|
|
42
|
-
value: value
|
|
56
|
+
value: value,
|
|
57
|
+
onFocus: handleFocus,
|
|
58
|
+
onBlur: handleBlur
|
|
43
59
|
}),
|
|
44
60
|
actions ? /*#__PURE__*/ jsx("div", {
|
|
45
61
|
className: TableInput_module.actionsContainer,
|