@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
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type HTMLAttributes, type PropsWithChildren } from 'react';
|
|
2
|
+
import type { Row as TanstackRow } from '@tanstack/react-table';
|
|
3
|
+
import type { WithRowClickLink } from '../../types';
|
|
4
|
+
type Props<T extends WithRowClickLink> = {
|
|
5
|
+
row: TanstackRow<T>;
|
|
6
|
+
knownSize?: number;
|
|
7
|
+
} & HTMLAttributes<HTMLTableRowElement>;
|
|
8
|
+
declare const RowComponent: {
|
|
9
|
+
<T extends WithRowClickLink>({ children, knownSize, row, ...restProps }: PropsWithChildren<Props<T>>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const Row: typeof RowComponent;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo } from "react";
|
|
3
|
+
import { cn } from "../../../../common/css/cn.js";
|
|
4
|
+
import { TableRowSize } from "../../../types/index.js";
|
|
5
|
+
import { ROW_HEIGHT_COMFORT, ROW_HEIGHT_COMPACT } from "../../constants.js";
|
|
6
|
+
import { useRowContext, useTableContext } from "../../hooks/index.js";
|
|
7
|
+
import { DraggableRow } from "../DraggableRow/DraggableRow.js";
|
|
8
|
+
import Row_module from "./Row.module.js";
|
|
9
|
+
const RowComponent = ({ children, knownSize, row, ...restProps })=>{
|
|
10
|
+
const isSelected = row.getIsSelected();
|
|
11
|
+
const { rowSize } = useTableContext();
|
|
12
|
+
const { getRowHighlightColor, enableRowOrdering, draggingZIndex } = useRowContext();
|
|
13
|
+
const highlightColor = getRowHighlightColor?.(row);
|
|
14
|
+
const isCompact = rowSize === TableRowSize.Compact;
|
|
15
|
+
const className = cn(Row_module.row, isSelected && Row_module.selected, highlightColor && Row_module[`highlighted-row-${highlightColor}`]);
|
|
16
|
+
const dataKnownSize = knownSize ?? (isCompact ? ROW_HEIGHT_COMPACT : ROW_HEIGHT_COMFORT);
|
|
17
|
+
if (enableRowOrdering) return /*#__PURE__*/ jsx(DraggableRow, {
|
|
18
|
+
...restProps,
|
|
19
|
+
row: row,
|
|
20
|
+
className: className,
|
|
21
|
+
"data-id": row.id,
|
|
22
|
+
"data-index": row.index,
|
|
23
|
+
"data-known-size": dataKnownSize,
|
|
24
|
+
"data-selected": isSelected,
|
|
25
|
+
draggingZIndex: draggingZIndex,
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
28
|
+
return /*#__PURE__*/ jsx("tr", {
|
|
29
|
+
...restProps,
|
|
30
|
+
className: className,
|
|
31
|
+
"data-id": row.id,
|
|
32
|
+
"data-index": row.index,
|
|
33
|
+
"data-known-size": dataKnownSize,
|
|
34
|
+
"data-selected": isSelected,
|
|
35
|
+
children: children
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
RowComponent.displayName = 'Row';
|
|
39
|
+
const Row = /*#__PURE__*/ memo(RowComponent);
|
|
40
|
+
export { Row };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import "./Row_module.css";
|
|
2
|
+
const Row_module = {
|
|
3
|
+
row: "row-TWHYq_",
|
|
4
|
+
selected: "selected-JM5M4l",
|
|
5
|
+
"highlighted-row-orange": "highlighted-row-orange-MscAbR",
|
|
6
|
+
highlightedRowOrange: "highlighted-row-orange-MscAbR",
|
|
7
|
+
"highlighted-row-red": "highlighted-row-red-cE3oyl",
|
|
8
|
+
highlightedRowRed: "highlighted-row-red-cE3oyl",
|
|
9
|
+
"highlighted-row-green": "highlighted-row-green-ZtbUsd",
|
|
10
|
+
highlightedRowGreen: "highlighted-row-green-ZtbUsd",
|
|
11
|
+
"highlighted-row-blue": "highlighted-row-blue-ua66B5",
|
|
12
|
+
highlightedRowBlue: "highlighted-row-blue-ua66B5"
|
|
13
|
+
};
|
|
14
|
+
export default Row_module;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
.
|
|
1
|
+
.row-TWHYq_ {
|
|
2
2
|
cursor: pointer;
|
|
3
3
|
position: relative;
|
|
4
4
|
}
|
|
5
5
|
|
|
6
|
-
.
|
|
6
|
+
.row-TWHYq_:not(.selected-JM5M4l):hover, .row-TWHYq_:not(.selected-JM5M4l):focus-within {
|
|
7
7
|
background-color: var(--bgd-secondary, #f1f4f9);
|
|
8
8
|
--input-table-background: var(--bgd-white, #fff);
|
|
9
9
|
--input-table-border: var(--border-normal, #d1d6df);
|
|
10
10
|
--select-table-actions-display: flex;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
.selected-
|
|
13
|
+
.selected-JM5M4l {
|
|
14
14
|
--input-table-background: var(--bgd-white, #fff);
|
|
15
15
|
--input-table-border: var(--border-normal, #d1d6df);
|
|
16
16
|
--select-table-actions-display: flex;
|
|
17
17
|
background-color: #dff0fe;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
.highlighted-row-orange-
|
|
20
|
+
.highlighted-row-orange-MscAbR {
|
|
21
21
|
background-color: var(--status-orange-01-bg);
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.highlighted-row-red-
|
|
24
|
+
.highlighted-row-red-cE3oyl {
|
|
25
25
|
background-color: var(--status-red-01-bg);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.highlighted-row-green-
|
|
28
|
+
.highlighted-row-green-ZtbUsd {
|
|
29
29
|
background-color: var(--status-green-01-bg);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
.highlighted-row-blue-
|
|
32
|
+
.highlighted-row-blue-ua66B5 {
|
|
33
33
|
background-color: var(--status-blue-02-bg);
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
|
-
import type { Row } from '@tanstack/react-table';
|
|
3
|
-
type
|
|
4
|
-
|
|
2
|
+
import type { Row as TanstackRow } from '@tanstack/react-table';
|
|
3
|
+
import type { WithRowClickLink } from '../../types';
|
|
4
|
+
type Props<T extends WithRowClickLink> = {
|
|
5
|
+
row: TanstackRow<T>;
|
|
5
6
|
};
|
|
6
7
|
declare const SubRowsComponent: {
|
|
7
|
-
<T>({ row }: PropsWithChildren<Props<T>>): import("react/jsx-runtime").JSX.Element | null;
|
|
8
|
+
<T extends WithRowClickLink>({ row, }: PropsWithChildren<Props<T>>): import("react/jsx-runtime").JSX.Element | null;
|
|
8
9
|
displayName: string;
|
|
9
10
|
};
|
|
10
11
|
export declare const SubRows: typeof SubRowsComponent;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { memo } from "react";
|
|
3
|
+
import { Row } from "../Row/Row.js";
|
|
3
4
|
import { TableCell } from "../TableCell/TableCell.js";
|
|
4
|
-
import { TableRow } from "../TableRow/TableRow.js";
|
|
5
5
|
import { TableSpacerCell } from "../TableSpacerCell/TableSpacerCell.js";
|
|
6
6
|
const SubRowsComponent = ({ row })=>{
|
|
7
7
|
if (!row.getIsExpanded() || !row.subRows || 0 === row.subRows.length) return null;
|
|
8
8
|
return /*#__PURE__*/ jsx(Fragment, {
|
|
9
|
-
children: row.subRows.map((subRow)=>/*#__PURE__*/ jsxs(
|
|
9
|
+
children: row.subRows.map((subRow)=>/*#__PURE__*/ jsxs(Row, {
|
|
10
10
|
row: subRow,
|
|
11
11
|
children: [
|
|
12
12
|
subRow.getVisibleCells().map((cell)=>/*#__PURE__*/ jsx(TableCell, {
|
|
@@ -16,7 +16,7 @@ const SubRowsComponent = ({ row })=>{
|
|
|
16
16
|
variant: "body"
|
|
17
17
|
})
|
|
18
18
|
]
|
|
19
|
-
}, subRow.id))
|
|
19
|
+
}, `${row.id}.${subRow.id}`))
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
SubRowsComponent.displayName = 'SubRows';
|
|
@@ -3,6 +3,7 @@ import { flexRender } from "@tanstack/react-table";
|
|
|
3
3
|
import { getColumnWidthStyles } from "../../utils/index.js";
|
|
4
4
|
import TableCell_module from "./TableCell.module.js";
|
|
5
5
|
const TableCell = ({ cell, children, ...restProps })=>{
|
|
6
|
+
const colId = cell?.column.columnDef.id;
|
|
6
7
|
const style = cell ? getColumnWidthStyles({
|
|
7
8
|
column: cell.column
|
|
8
9
|
}) : {};
|
|
@@ -10,6 +11,7 @@ const TableCell = ({ cell, children, ...restProps })=>{
|
|
|
10
11
|
...restProps,
|
|
11
12
|
className: TableCell_module.tableCell,
|
|
12
13
|
style: style,
|
|
14
|
+
"data-id": colId,
|
|
13
15
|
children: cell ? flexRender(cell.column.columnDef.cell, cell.getContext()) : children
|
|
14
16
|
});
|
|
15
17
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from 'react';
|
|
2
|
-
import type { Row } from '@tanstack/react-table';
|
|
3
|
-
import type
|
|
4
|
-
import { TableRowSize } from '../../../types';
|
|
2
|
+
import type { Row as TanstackRow } from '@tanstack/react-table';
|
|
3
|
+
import { type TableRowSizeValue } from '../../../types';
|
|
5
4
|
import type { WithRowClickLink } from '../../types';
|
|
6
5
|
type Props<T extends WithRowClickLink> = {
|
|
7
|
-
rows:
|
|
6
|
+
rows: TanstackRow<T>[];
|
|
8
7
|
activeRowId?: string | null;
|
|
9
8
|
className?: string;
|
|
10
|
-
rowSize:
|
|
9
|
+
rowSize: TableRowSizeValue;
|
|
11
10
|
style?: CSSProperties;
|
|
12
|
-
renderRowContent?: (row:
|
|
11
|
+
renderRowContent?: (row: TanstackRow<T>) => ReactNode;
|
|
13
12
|
};
|
|
14
13
|
declare const TableDragOverlayComponent: {
|
|
15
14
|
<T extends WithRowClickLink>({ rows, activeRowId, className, rowSize, style, renderRowContent, }: Props<T>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,8 +2,8 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { memo } from "react";
|
|
3
3
|
import { DragOverlay } from "@dnd-kit/core";
|
|
4
4
|
import { cn } from "../../../../common/css/cn.js";
|
|
5
|
+
import { Row } from "../Row/Row.js";
|
|
5
6
|
import { TableCell } from "../TableCell/TableCell.js";
|
|
6
|
-
import { TableRow } from "../TableRow/TableRow.js";
|
|
7
7
|
import { TableSpacerCell } from "../TableSpacerCell/TableSpacerCell.js";
|
|
8
8
|
import Table_module from "../../Table.module.js";
|
|
9
9
|
import TableDragOverlay_module from "./TableDragOverlay.module.js";
|
|
@@ -15,7 +15,7 @@ const TableDragOverlayComponent = ({ rows, activeRowId, className, rowSize, styl
|
|
|
15
15
|
className: cn(Table_module.table, TableDragOverlay_module.overlayTable, className ?? ''),
|
|
16
16
|
"data-row-height": rowSize,
|
|
17
17
|
children: /*#__PURE__*/ jsx("tbody", {
|
|
18
|
-
children: /*#__PURE__*/ jsx(
|
|
18
|
+
children: /*#__PURE__*/ jsx(Row, {
|
|
19
19
|
row: activeRow,
|
|
20
20
|
"data-is-dragging": true,
|
|
21
21
|
children: renderRowContent ? /*#__PURE__*/ jsx(TableCell, {
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import type {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
type Props<T> = {
|
|
7
|
-
row: Row<T>;
|
|
8
|
-
dndConfig?: DnDConfig;
|
|
9
|
-
getRowHighlightColor?: (row: Row<T>) => HighlightedRowColor | undefined;
|
|
10
|
-
} & HTMLAttributes<HTMLTableRowElement>;
|
|
11
|
-
declare const TableRowComponent: {
|
|
12
|
-
<T>({ row, children, dndConfig, getRowHighlightColor, ...restProps }: PropsWithChildren<Props<T>>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
displayName: string;
|
|
1
|
+
import type { Row as TanstackRow } from '@tanstack/react-table';
|
|
2
|
+
import type { WithRowClickLink } from '../../types';
|
|
3
|
+
type Props<T extends WithRowClickLink> = {
|
|
4
|
+
row: TanstackRow<T>;
|
|
5
|
+
knownSize?: number;
|
|
14
6
|
};
|
|
15
|
-
export declare const TableRow:
|
|
7
|
+
export declare const TableRow: <T extends WithRowClickLink>({ row, knownSize, }: Props<T>) => import("react/jsx-runtime").JSX.Element;
|
|
16
8
|
export {};
|
|
@@ -1,27 +1,36 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
1
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Fragment as external_react_Fragment } from "react";
|
|
3
|
+
import { useRowContext } from "../../hooks/useRowContext.js";
|
|
4
|
+
import { Row } from "../Row/Row.js";
|
|
5
|
+
import { SubRows } from "../SubRows/SubRows.js";
|
|
6
|
+
import { TableCell } from "../TableCell/TableCell.js";
|
|
7
|
+
import { TableSpacerCell } from "../TableSpacerCell/TableSpacerCell.js";
|
|
8
|
+
const TableRow = ({ row, knownSize })=>{
|
|
9
|
+
const { getRowClickHandler, renderRowContent } = useRowContext();
|
|
10
|
+
return /*#__PURE__*/ jsxs(external_react_Fragment, {
|
|
11
|
+
children: [
|
|
12
|
+
/*#__PURE__*/ jsx(Row, {
|
|
13
|
+
row: row,
|
|
14
|
+
onClick: getRowClickHandler(row),
|
|
15
|
+
knownSize: knownSize,
|
|
16
|
+
children: renderRowContent ? /*#__PURE__*/ jsx(TableCell, {
|
|
17
|
+
colSpan: row.getVisibleCells().length + 1,
|
|
18
|
+
children: renderRowContent(row)
|
|
19
|
+
}) : /*#__PURE__*/ jsxs(Fragment, {
|
|
20
|
+
children: [
|
|
21
|
+
row.getVisibleCells().map((cell)=>/*#__PURE__*/ jsx(TableCell, {
|
|
22
|
+
cell: cell
|
|
23
|
+
}, cell.id)),
|
|
24
|
+
/*#__PURE__*/ jsx(TableSpacerCell, {
|
|
25
|
+
variant: "body"
|
|
26
|
+
})
|
|
27
|
+
]
|
|
28
|
+
})
|
|
29
|
+
}),
|
|
30
|
+
/*#__PURE__*/ jsx(SubRows, {
|
|
31
|
+
row: row
|
|
32
|
+
})
|
|
33
|
+
]
|
|
34
|
+
}, row.id);
|
|
24
35
|
};
|
|
25
|
-
TableRowComponent.displayName = 'TableRow';
|
|
26
|
-
const TableRow = /*#__PURE__*/ memo(TableRowComponent);
|
|
27
36
|
export { TableRow };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type TableVirtuosoProps } from 'react-virtuoso';
|
|
3
|
+
import type { Row } from '@tanstack/react-table';
|
|
4
|
+
import type { WithRowClickLink } from '../../types';
|
|
5
|
+
type OmittedTableVirtuosoProps = 'components' | 'computeItemKey' | 'context' | 'data' | 'fixedFooterContent' | 'fixedHeaderContent' | 'itemContent' | 'itemsRendered' | 'rows';
|
|
6
|
+
export type VirtualTableProps<T extends WithRowClickLink> = Omit<TableVirtuosoProps<Row<T>, unknown>, OmittedTableVirtuosoProps> & {
|
|
7
|
+
footerContent: ReactNode | null;
|
|
8
|
+
};
|
|
9
|
+
export declare const VirtualTable: <T extends WithRowClickLink>({ footerContent, overscan, ...props }: VirtualTableProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useMemo } from "react";
|
|
3
|
+
import { TableVirtuoso } from "react-virtuoso";
|
|
4
|
+
import { cn } from "../../../../common/index.js";
|
|
5
|
+
import { useTableContext } from "../../hooks/index.js";
|
|
6
|
+
import { getTableColumnIds } from "../../utils/index.js";
|
|
7
|
+
import { HeaderContent } from "../Header/HeaderContent.js";
|
|
8
|
+
import { VirtualTableRow } from "./VirtualTableRow.js";
|
|
9
|
+
import Table_module from "../../Table.module.js";
|
|
10
|
+
import Body_module from "../Body/Body.module.js";
|
|
11
|
+
const getComponents = ()=>({
|
|
12
|
+
Table: (props)=>{
|
|
13
|
+
const { rowSize, className } = useTableContext();
|
|
14
|
+
return /*#__PURE__*/ jsx("table", {
|
|
15
|
+
...props,
|
|
16
|
+
"data-row-height": rowSize,
|
|
17
|
+
className: cn(Table_module.table, className ?? '')
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
TableHead: /*#__PURE__*/ forwardRef((props, ref)=>{
|
|
21
|
+
const { headerStyle } = useTableContext();
|
|
22
|
+
return /*#__PURE__*/ jsx("thead", {
|
|
23
|
+
...props,
|
|
24
|
+
ref: ref,
|
|
25
|
+
className: Table_module.thead,
|
|
26
|
+
style: headerStyle
|
|
27
|
+
});
|
|
28
|
+
}),
|
|
29
|
+
TableBody: /*#__PURE__*/ forwardRef(({ className, children, ...props }, ref)=>{
|
|
30
|
+
const { isLoading } = useTableContext();
|
|
31
|
+
return /*#__PURE__*/ jsx("tbody", {
|
|
32
|
+
...props,
|
|
33
|
+
ref: ref,
|
|
34
|
+
className: cn(isLoading && Body_module.active, className),
|
|
35
|
+
children: children
|
|
36
|
+
});
|
|
37
|
+
}),
|
|
38
|
+
TableRow: ({ item, 'data-known-size': knownSize, context })=>{
|
|
39
|
+
const { columnIds, columnVisibility, rowSelection } = context;
|
|
40
|
+
const isSelected = !!rowSelection[item.id];
|
|
41
|
+
return /*#__PURE__*/ jsx(VirtualTableRow, {
|
|
42
|
+
columnVisibility: columnVisibility,
|
|
43
|
+
knownSize: knownSize,
|
|
44
|
+
row: item,
|
|
45
|
+
isSelected: isSelected,
|
|
46
|
+
columnIds: columnIds
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
TableFoot: /*#__PURE__*/ forwardRef((props, ref)=>/*#__PURE__*/ jsx("tfoot", {
|
|
50
|
+
...props,
|
|
51
|
+
ref: ref,
|
|
52
|
+
className: Table_module.tfoot,
|
|
53
|
+
style: void 0
|
|
54
|
+
}))
|
|
55
|
+
});
|
|
56
|
+
const VirtualTable = ({ footerContent, overscan = 5, ...props })=>{
|
|
57
|
+
const { table } = useTableContext();
|
|
58
|
+
const { rows } = table.getRowModel();
|
|
59
|
+
const { columnVisibility, rowSelection } = table.getState();
|
|
60
|
+
const columnIds = getTableColumnIds(table);
|
|
61
|
+
const context = {
|
|
62
|
+
columnIds,
|
|
63
|
+
columnVisibility,
|
|
64
|
+
rowSelection
|
|
65
|
+
};
|
|
66
|
+
const components = useMemo(()=>getComponents(), []);
|
|
67
|
+
return /*#__PURE__*/ jsx(TableVirtuoso, {
|
|
68
|
+
data: rows,
|
|
69
|
+
overscan: overscan,
|
|
70
|
+
computeItemKey: (i, row)=>row.id,
|
|
71
|
+
fixedHeaderContent: ()=>/*#__PURE__*/ jsx(HeaderContent, {}),
|
|
72
|
+
fixedFooterContent: ()=>footerContent,
|
|
73
|
+
components: components,
|
|
74
|
+
context: context,
|
|
75
|
+
...props
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
export { VirtualTable };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Row, VisibilityState } from '@tanstack/react-table';
|
|
2
|
+
import type { WithRowClickLink } from '../../types';
|
|
3
|
+
type Props<T extends WithRowClickLink> = {
|
|
4
|
+
row: Row<T>;
|
|
5
|
+
knownSize?: number;
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
columnVisibility: VisibilityState;
|
|
8
|
+
columnIds: string[];
|
|
9
|
+
};
|
|
10
|
+
export declare const VirtualTableRow: <T extends WithRowClickLink>(props: Props<T>) => JSX.Element;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import react from "react";
|
|
3
|
+
import { compareColumnIds } from "../../utils/index.js";
|
|
4
|
+
import { TableRow } from "../TableRow/TableRow.js";
|
|
5
|
+
const VirtualTableRowComponent = ({ row, knownSize })=>/*#__PURE__*/ jsx(TableRow, {
|
|
6
|
+
row: row,
|
|
7
|
+
knownSize: knownSize
|
|
8
|
+
});
|
|
9
|
+
function areEqual(prevProps, nextProps) {
|
|
10
|
+
const isRowsEqual = prevProps.row === nextProps.row;
|
|
11
|
+
const isSelectionEqual = prevProps.isSelected === nextProps.isSelected;
|
|
12
|
+
const isKnownSizeEqual = prevProps.knownSize === nextProps.knownSize;
|
|
13
|
+
const isColumnVisibilityEqual = prevProps.columnVisibility === nextProps.columnVisibility;
|
|
14
|
+
const isColumnsListEqual = compareColumnIds(prevProps.columnIds, nextProps.columnIds);
|
|
15
|
+
return isRowsEqual && isSelectionEqual && isKnownSizeEqual && isColumnVisibilityEqual && isColumnsListEqual;
|
|
16
|
+
}
|
|
17
|
+
const VirtualTableRow = /*#__PURE__*/ react.memo(VirtualTableRowComponent, areEqual);
|
|
18
|
+
export { VirtualTableRow };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Body } from './Body/Body';
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { FooterContent } from './Footer/FooterContent';
|
|
3
|
+
export { HeaderContent } from './Header/HeaderContent';
|
|
4
4
|
export { TableDragOverlay } from './TableDragOverlay/TableDragOverlay';
|
|
5
|
-
export {
|
|
5
|
+
export { TableRow } from './TableRow/TableRow';
|
|
6
6
|
export { TotalsToggle, type TotalsToggleLocale } from './TotalsToggle';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Body } from "./Body/Body.js";
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
2
|
+
export { FooterContent } from "./Footer/FooterContent.js";
|
|
3
|
+
export { HeaderContent } from "./Header/HeaderContent.js";
|
|
4
4
|
export { TableDragOverlay } from "./TableDragOverlay/TableDragOverlay.js";
|
|
5
5
|
export { TableRow } from "./TableRow/TableRow.js";
|
|
6
6
|
export { TotalsToggle } from "./TotalsToggle/index.js";
|
|
@@ -2,5 +2,6 @@ export { useColumnResizeHandler } from './useColumnResizeHandler';
|
|
|
2
2
|
export { useColumnSizes } from './useColumnSizes';
|
|
3
3
|
export { useIntersection } from './useIntersection';
|
|
4
4
|
export { useRect } from './useRect';
|
|
5
|
+
export { RowContextProvider, useRowContext } from './useRowContext';
|
|
5
6
|
export { TableContext, TableContextProvider, useTableContext, } from './useTableContext';
|
|
6
7
|
export { useTableHeight } from './useTableHeight';
|
|
@@ -2,5 +2,6 @@ export { useColumnResizeHandler } from "./useColumnResizeHandler.js";
|
|
|
2
2
|
export { useColumnSizes } from "./useColumnSizes.js";
|
|
3
3
|
export { useIntersection } from "./useIntersection.js";
|
|
4
4
|
export { useRect } from "./useRect.js";
|
|
5
|
+
export { RowContextProvider, useRowContext } from "./useRowContext.js";
|
|
5
6
|
export { TableContext, TableContextProvider, useTableContext } from "./useTableContext.js";
|
|
6
7
|
export { useTableHeight } from "./useTableHeight.js";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type MouseEventHandler, type PropsWithChildren } from 'react';
|
|
2
|
+
import type { Row } from '@tanstack/react-table';
|
|
3
|
+
import type { TableProps } from '../Table';
|
|
4
|
+
import { type DnDConfig, type WithRowClickLink } from '../types';
|
|
5
|
+
type PickedRowProps = 'getRowHighlightColor' | 'onRowClick' | 'rowClickCallOrder' | 'renderRowContent';
|
|
6
|
+
interface IRowContextProviderProps<T extends WithRowClickLink> extends Pick<TableProps<T>, PickedRowProps> {
|
|
7
|
+
draggingZIndex?: DnDConfig['draggingZIndex'];
|
|
8
|
+
enableRowOrdering?: DnDConfig['enableRowOrdering'];
|
|
9
|
+
}
|
|
10
|
+
interface IRowContext<T extends WithRowClickLink> extends Omit<IRowContextProviderProps<T>, 'onRowClick'> {
|
|
11
|
+
getRowClickHandler: (row: Row<T>) => MouseEventHandler<HTMLTableRowElement>;
|
|
12
|
+
}
|
|
13
|
+
export declare const RowContext: import("react").Context<IRowContext<any> | null>;
|
|
14
|
+
export declare const useRowContext: <T extends WithRowClickLink>() => IRowContext<T>;
|
|
15
|
+
export declare const RowContextProvider: <T extends WithRowClickLink>({ children, getRowHighlightColor, onRowClick: onRowClickFromElement, rowClickCallOrder, renderRowContent, draggingZIndex, enableRowOrdering, }: PropsWithChildren<IRowContextProviderProps<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useMemo } from "react";
|
|
3
|
+
import { RowClickCallOrder } from "../types.js";
|
|
4
|
+
const RowContext = /*#__PURE__*/ createContext(null);
|
|
5
|
+
const useRowContext = ()=>{
|
|
6
|
+
const context = useContext(RowContext);
|
|
7
|
+
if (!context) throw new Error('useRowContext must be used within a <RowContext.Provider>');
|
|
8
|
+
return context;
|
|
9
|
+
};
|
|
10
|
+
const RowContextProvider = ({ children, getRowHighlightColor, onRowClick: onRowClickFromElement, rowClickCallOrder, renderRowContent, draggingZIndex, enableRowOrdering })=>{
|
|
11
|
+
const getRowClickHandler = useCallback((row)=>(e)=>{
|
|
12
|
+
const cellText = document.getSelection();
|
|
13
|
+
if (cellText && 'Range' === cellText.type) e.stopPropagation();
|
|
14
|
+
const onRowClickFromData = 'function' == typeof row.original?.onRowClick ? row.original.onRowClick : ()=>{};
|
|
15
|
+
if (rowClickCallOrder === RowClickCallOrder.Default) {
|
|
16
|
+
onRowClickFromElement?.(row);
|
|
17
|
+
onRowClickFromData();
|
|
18
|
+
} else {
|
|
19
|
+
onRowClickFromData();
|
|
20
|
+
onRowClickFromElement?.(row);
|
|
21
|
+
}
|
|
22
|
+
}, [
|
|
23
|
+
onRowClickFromElement,
|
|
24
|
+
rowClickCallOrder
|
|
25
|
+
]);
|
|
26
|
+
const props = useMemo(()=>({
|
|
27
|
+
enableRowOrdering,
|
|
28
|
+
draggingZIndex,
|
|
29
|
+
getRowHighlightColor,
|
|
30
|
+
getRowClickHandler,
|
|
31
|
+
renderRowContent
|
|
32
|
+
}), [
|
|
33
|
+
enableRowOrdering,
|
|
34
|
+
draggingZIndex,
|
|
35
|
+
getRowHighlightColor,
|
|
36
|
+
getRowClickHandler,
|
|
37
|
+
renderRowContent
|
|
38
|
+
]);
|
|
39
|
+
return /*#__PURE__*/ jsx(RowContext.Provider, {
|
|
40
|
+
value: props,
|
|
41
|
+
children: children
|
|
42
|
+
});
|
|
43
|
+
};
|
|
44
|
+
export { RowContext, RowContextProvider, useRowContext };
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { type PropsWithChildren } from 'react';
|
|
1
|
+
import { type CSSProperties, type PropsWithChildren } from 'react';
|
|
2
2
|
import { type ColumnSizingState, type Table } from '@tanstack/react-table';
|
|
3
|
+
import { type TableRowSizeValue } from '../../types';
|
|
3
4
|
interface TableContext<T> {
|
|
4
5
|
table: Table<T>;
|
|
5
6
|
onResizeColumn?: (sizing: ColumnSizingState) => void;
|
|
7
|
+
rowSize?: TableRowSizeValue;
|
|
8
|
+
className?: string;
|
|
9
|
+
isLoading: boolean;
|
|
10
|
+
headerStyle?: CSSProperties;
|
|
6
11
|
}
|
|
7
12
|
export declare const TableContext: import("react").Context<TableContext<any> | null>;
|
|
8
13
|
export declare const useTableContext: <T>() => TableContext<T>;
|
|
9
|
-
export declare const TableContextProvider: <T>({ children,
|
|
14
|
+
export declare const TableContextProvider: <T>({ children, className, headerStyle, isLoading, onResizeColumn, rowSize, table, }: PropsWithChildren<TableContext<T>>) => import("react/jsx-runtime").JSX.Element;
|
|
10
15
|
export {};
|
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createContext, useContext, useMemo } from "react";
|
|
3
|
+
import { TableRowSize } from "../../types/index.js";
|
|
3
4
|
const TableContext = /*#__PURE__*/ createContext(null);
|
|
4
5
|
const useTableContext = ()=>{
|
|
5
6
|
const context = useContext(TableContext);
|
|
6
7
|
if (!context) throw new Error('useTableContext must be used within a <TableContext.Provider>');
|
|
7
8
|
return context;
|
|
8
9
|
};
|
|
9
|
-
const TableContextProvider = ({ children,
|
|
10
|
+
const TableContextProvider = ({ children, className, headerStyle, isLoading, onResizeColumn, rowSize = TableRowSize.Comfort, table })=>{
|
|
10
11
|
const props = useMemo(()=>({
|
|
11
12
|
table,
|
|
12
|
-
onResizeColumn
|
|
13
|
+
onResizeColumn,
|
|
14
|
+
rowSize,
|
|
15
|
+
className,
|
|
16
|
+
isLoading,
|
|
17
|
+
headerStyle
|
|
13
18
|
}), [
|
|
19
|
+
className,
|
|
20
|
+
headerStyle,
|
|
21
|
+
isLoading,
|
|
22
|
+
onResizeColumn,
|
|
23
|
+
rowSize,
|
|
14
24
|
table
|
|
15
25
|
]);
|
|
16
26
|
return /*#__PURE__*/ jsx(TableContext.Provider, {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type
|
|
1
|
+
export { type TotalsToggleLocale } from './components';
|
|
2
2
|
export type { TableProps } from './Table';
|
|
3
3
|
export { Table } from './Table';
|
|
4
|
-
export type { DnDConfig, TFooterToggleConfig, WithRowClickLink } from './types';
|
|
4
|
+
export type { DnDConfig, HighlightedRowColor, TFooterToggleConfig, WithRowClickLink, } from './types';
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import type { ValueOf } from '../../common/types';
|
|
1
2
|
export type DnDConfig = {
|
|
2
3
|
enableRowOrdering: boolean;
|
|
3
4
|
dataIds: string[];
|
|
4
|
-
onDragEnd: (oldIndex: number, newIndex: number) => void;
|
|
5
|
+
onDragEnd: (oldIndex: number, newIndex: number, rowId: string) => void;
|
|
5
6
|
draggingZIndex?: number;
|
|
6
7
|
};
|
|
7
8
|
export type TFooterToggleConfig = {
|
|
@@ -12,3 +13,9 @@ export type TFooterToggleConfig = {
|
|
|
12
13
|
export type WithRowClickLink = {
|
|
13
14
|
onRowClick?: () => void;
|
|
14
15
|
};
|
|
16
|
+
export declare const RowClickCallOrder: {
|
|
17
|
+
readonly Default: "default";
|
|
18
|
+
readonly Reverse: "reverse";
|
|
19
|
+
};
|
|
20
|
+
export type RowClickCallOrderValue = ValueOf<typeof RowClickCallOrder>;
|
|
21
|
+
export type HighlightedRowColor = 'orange' | 'red' | 'green' | 'blue';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const compareColumnIds: (arr1: string[], arr2: string[]) => boolean;
|