@infomaximum/ui-kit 0.15.9 → 0.16.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/dist/components/ConfigProvider/ConfigProvider.js +4 -2
- package/dist/components/ConfigProvider/ConfigProvider.types.d.ts +2 -3
- package/dist/components/ConfigProvider/contexts/ConfigContext.d.ts +2 -2
- package/dist/components/ConfigProvider/contexts/ConfigContext.types.d.ts +3 -1
- package/dist/components/ConfigProvider/contexts/index.d.ts +2 -1
- package/dist/components/ConfigProvider/hooks/useConfig/useConfig.d.ts +2 -2
- package/dist/components/ConfigProvider/index.d.ts +1 -1
- package/dist/components/Empty/Empty.js +3 -1
- package/dist/components/Empty/Empty.types.d.ts +5 -0
- package/dist/components/Radio/components/RadioInternal/RadioInternal.types.d.ts +1 -1
- package/dist/components/Table/Table.d.ts +7 -0
- package/dist/components/Table/Table.js +218 -0
- package/dist/components/Table/Table.styles.d.ts +12 -0
- package/dist/components/Table/Table.styles.js +62 -0
- package/dist/components/Table/Table.tokens.d.ts +19 -0
- package/dist/components/Table/Table.tokens.js +20 -0
- package/dist/components/Table/Table.types.d.ts +48 -0
- package/dist/components/Table/components/Body/Body.d.ts +5 -0
- package/dist/components/Table/components/Body/Body.js +56 -0
- package/dist/components/Table/components/Body/Body.styles.d.ts +4 -0
- package/dist/components/Table/components/Body/Body.styles.js +6 -0
- package/dist/components/Table/components/Body/Body.types.d.ts +6 -0
- package/dist/components/Table/components/Body/components/BodyCell/BodyCell.d.ts +3 -0
- package/dist/components/Table/components/Body/components/BodyCell/BodyCell.js +117 -0
- package/dist/components/Table/components/Body/components/BodyCell/BodyCell.styles.d.ts +27 -0
- package/dist/components/Table/components/Body/components/BodyCell/BodyCell.styles.js +32 -0
- package/dist/components/Table/components/Body/components/BodyCell/BodyCell.types.d.ts +12 -0
- package/dist/components/Table/components/Body/components/BodyColGroup/BodyColGroup.d.ts +3 -0
- package/dist/components/Table/components/Body/components/BodyColGroup/BodyColGroup.js +35 -0
- package/dist/components/Table/components/Body/components/BodyColGroup/BodyColGroup.types.d.ts +2 -0
- package/dist/components/Table/components/Body/components/BodyRow/BodyRow.d.ts +3 -0
- package/dist/components/Table/components/Body/components/BodyRow/BodyRow.js +41 -0
- package/dist/components/Table/components/Body/components/BodyRow/BodyRow.types.d.ts +8 -0
- package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.d.ts +3 -0
- package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.js +33 -0
- package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.styles.d.ts +10 -0
- package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.styles.js +14 -0
- package/dist/components/Table/components/Body/components/MeasureCell/MeasureCell.types.d.ts +6 -0
- package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.d.ts +5 -0
- package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.js +87 -0
- package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.types.d.ts +2 -0
- package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.utils.d.ts +4 -0
- package/dist/components/Table/components/Body/components/MeasureRow/MeasureRow.utils.js +13 -0
- package/dist/components/Table/components/Cell/Cell.d.ts +3 -0
- package/dist/components/Table/components/Cell/Cell.js +25 -0
- package/dist/components/Table/components/Cell/Cell.styles.d.ts +28 -0
- package/dist/components/Table/components/Cell/Cell.styles.js +31 -0
- package/dist/components/Table/components/Cell/Cell.types.d.ts +16 -0
- package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.d.ts +3 -0
- package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.js +69 -0
- package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.styles.d.ts +15 -0
- package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.styles.js +26 -0
- package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.types.d.ts +2 -0
- package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.utils.d.ts +7 -0
- package/dist/components/Table/components/EmptyDataRow/EmptyDataRow.utils.js +17 -0
- package/dist/components/Table/components/FixedHeader/FixedHeader.d.ts +2 -0
- package/dist/components/Table/components/FixedHeader/FixedHeader.js +25 -0
- package/dist/components/Table/components/FixedHeader/FixedHeader.types.d.ts +6 -0
- package/dist/components/Table/components/FixedHeader/components/FixedHeaderColGroup/FixedHeaderColGroup.d.ts +3 -0
- package/dist/components/Table/components/FixedHeader/components/FixedHeaderColGroup/FixedHeaderColGroup.js +33 -0
- package/dist/components/Table/components/FixedHeader/components/FixedHeaderColGroup/FixedHeaderColGroup.types.d.ts +2 -0
- package/dist/components/Table/components/Header/Header.d.ts +3 -0
- package/dist/components/Table/components/Header/Header.js +23 -0
- package/dist/components/Table/components/Header/Header.styles.d.ts +4 -0
- package/dist/components/Table/components/Header/Header.styles.js +6 -0
- package/dist/components/Table/components/Header/Header.types.d.ts +15 -0
- package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.d.ts +3 -0
- package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.js +63 -0
- package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.styles.d.ts +21 -0
- package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.styles.js +25 -0
- package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.types.d.ts +6 -0
- package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.utils.d.ts +2 -0
- package/dist/components/Table/components/Header/components/HeaderCell/HeaderCell.utils.js +4 -0
- package/dist/components/Table/components/Header/components/HeaderRow/HeaderRow.d.ts +3 -0
- package/dist/components/Table/components/Header/components/HeaderRow/HeaderRow.js +34 -0
- package/dist/components/Table/components/Header/components/HeaderRow/HeaderRow.styles.d.ts +6 -0
- package/dist/components/Table/components/Header/components/HeaderRow/HeaderRow.styles.js +8 -0
- package/dist/components/Table/components/Header/components/HeaderRow/HeaderRow.types.d.ts +6 -0
- package/dist/components/Table/components/Header/utils/index.d.ts +1 -0
- package/dist/components/Table/components/Header/utils/parseHeaderRows/parseHeaderRows.d.ts +4 -0
- package/dist/components/Table/components/Header/utils/parseHeaderRows/parseHeaderRows.js +50 -0
- package/dist/components/Table/contexts/index.d.ts +3 -0
- package/dist/components/Table/contexts/tableContext/TableContext.d.ts +3 -0
- package/dist/components/Table/contexts/tableContext/TableContext.js +21 -0
- package/dist/components/Table/contexts/tableContext/TableContext.types.d.ts +27 -0
- package/dist/components/Table/contexts/tableContext/useTableContext/useTableContext.d.ts +2 -0
- package/dist/components/Table/contexts/tableContext/useTableContext/useTableContext.js +8 -0
- package/dist/components/Table/features/tableExpand/components/DefaultExpandIcon/DefaultExpandIcon.d.ts +3 -0
- package/dist/components/Table/features/tableExpand/components/DefaultExpandIcon/DefaultExpandIcon.js +23 -0
- package/dist/components/Table/features/tableExpand/components/DefaultExpandIcon/DefaultExpandIcon.styles.d.ts +19 -0
- package/dist/components/Table/features/tableExpand/components/DefaultExpandIcon/DefaultExpandIcon.styles.js +22 -0
- package/dist/components/Table/features/tableExpand/components/DefaultExpandIcon/DefaultExpandIcon.types.d.ts +3 -0
- package/dist/components/Table/features/tableExpand/components/ExpandIconWrapper/ExpandIconWrapper.d.ts +3 -0
- package/dist/components/Table/features/tableExpand/components/ExpandIconWrapper/ExpandIconWrapper.js +24 -0
- package/dist/components/Table/features/tableExpand/components/ExpandIconWrapper/ExpandIconWrapper.types.d.ts +5 -0
- package/dist/components/Table/features/tableExpand/contexts/index.d.ts +3 -0
- package/dist/components/Table/features/tableExpand/contexts/tableExpandedContext/TableExpandedContext.d.ts +2 -0
- package/dist/components/Table/features/tableExpand/contexts/tableExpandedContext/TableExpandedContext.js +9 -0
- package/dist/components/Table/features/tableExpand/contexts/tableExpandedContext/TableExpandedContext.types.d.ts +7 -0
- package/dist/components/Table/features/tableExpand/contexts/tableExpandedContext/useTableExpandedContext/useTableExpandedContext.d.ts +1 -0
- package/dist/components/Table/features/tableExpand/contexts/tableExpandedContext/useTableExpandedContext/useTableExpandedContext.js +8 -0
- package/dist/components/Table/features/tableExpand/hooks/index.d.ts +2 -0
- package/dist/components/Table/features/tableExpand/hooks/useBodyExpand/useBodyExpand.d.ts +6 -0
- package/dist/components/Table/features/tableExpand/hooks/useBodyExpand/useBodyExpand.js +38 -0
- package/dist/components/Table/features/tableExpand/hooks/useBodyExpand/useBodyExpand.types.d.ts +3 -0
- package/dist/components/Table/features/tableExpand/hooks/useTableExpand/useTableExpand.d.ts +8 -0
- package/dist/components/Table/features/tableExpand/hooks/useTableExpand/useTableExpand.js +26 -0
- package/dist/components/Table/features/tableExpand/hooks/useTableExpand/useTableExpand.types.d.ts +3 -0
- package/dist/components/Table/features/tableExpand/index.d.ts +4 -0
- package/dist/components/Table/features/tableExpand/types.d.ts +16 -0
- package/dist/components/Table/features/tableRowSelection/components/CheckboxCellContentWrapper/CheckboxCellContentWrapper.d.ts +3 -0
- package/dist/components/Table/features/tableRowSelection/components/CheckboxCellContentWrapper/CheckboxCellContentWrapper.js +78 -0
- package/dist/components/Table/features/tableRowSelection/components/CheckboxCellContentWrapper/CheckboxCellContentWrapper.types.d.ts +4 -0
- package/dist/components/Table/features/tableRowSelection/components/CheckboxCellContentWrapper/CheckboxCellContentWrapper.utils.d.ts +3 -0
- package/dist/components/Table/features/tableRowSelection/components/CheckboxCellContentWrapper/CheckboxCellContentWrapper.utils.js +20 -0
- package/dist/components/Table/features/tableRowSelection/components/HeaderCheckboxCellContentWrapper/HeaderCheckboxCellContentWrapper.d.ts +2 -0
- package/dist/components/Table/features/tableRowSelection/components/HeaderCheckboxCellContentWrapper/HeaderCheckboxCellContentWrapper.js +73 -0
- package/dist/components/Table/features/tableRowSelection/components/HeaderCheckboxCellContentWrapper/HeaderCheckboxCellContentWrapper.types.d.ts +5 -0
- package/dist/components/Table/features/tableRowSelection/components/RadioCellContentWrapper/RadioCellContentWrapper.d.ts +3 -0
- package/dist/components/Table/features/tableRowSelection/components/RadioCellContentWrapper/RadioCellContentWrapper.js +43 -0
- package/dist/components/Table/features/tableRowSelection/components/RadioCellContentWrapper/RadioCellContentWrapper.types.d.ts +4 -0
- package/dist/components/Table/features/tableRowSelection/contexts/index.d.ts +3 -0
- package/dist/components/Table/features/tableRowSelection/contexts/tableRowSelectionContext/TableRowSelectionContext.d.ts +2 -0
- package/dist/components/Table/features/tableRowSelection/contexts/tableRowSelectionContext/TableRowSelectionContext.js +20 -0
- package/dist/components/Table/features/tableRowSelection/contexts/tableRowSelectionContext/TableRowSelectionContext.types.d.ts +18 -0
- package/dist/components/Table/features/tableRowSelection/contexts/tableRowSelectionContext/useTableRowSelectionContext/useTableRowSelectionContext.d.ts +1 -0
- package/dist/components/Table/features/tableRowSelection/contexts/tableRowSelectionContext/useTableRowSelectionContext/useTableRowSelectionContext.js +8 -0
- package/dist/components/Table/features/tableRowSelection/hooks/index.d.ts +4 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useMultipleSelect/useMultipleSelect.d.ts +2 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useMultipleSelect/useMultipleSelect.js +32 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useMultipleSelect/useMultipleSelect.types.d.ts +4 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useTableRowSelection/useTableRowSelection.d.ts +19 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useTableRowSelection/useTableRowSelection.js +126 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useTableRowSelection/useTableRowSelection.types.d.ts +8 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useTableRowSelection/useTableRowSelection.utils.d.ts +2 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useTableRowSelection/useTableRowSelection.utils.js +13 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.d.ts +6 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.js +59 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.types.d.ts +3 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.utils.d.ts +1 -0
- package/dist/components/Table/features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.utils.js +12 -0
- package/dist/components/Table/features/tableRowSelection/index.d.ts +5 -0
- package/dist/components/Table/features/tableRowSelection/styles.d.ts +16 -0
- package/dist/components/Table/features/tableRowSelection/styles.js +25 -0
- package/dist/components/Table/features/tableRowSelection/types.d.ts +24 -0
- package/dist/components/Table/features/tableRowSelection/utils/const.d.ts +1 -0
- package/dist/components/Table/features/tableRowSelection/utils/const.js +4 -0
- package/dist/components/Table/features/tableRowSelection/utils/index.d.ts +1 -0
- package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.d.ts +3 -0
- package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.js +75 -0
- package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.styles.d.ts +7 -0
- package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.styles.js +9 -0
- package/dist/components/Table/features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.types.d.ts +6 -0
- package/dist/components/Table/features/tableSort/components/SortButton/SortButton.d.ts +2 -0
- package/dist/components/Table/features/tableSort/components/SortButton/SortButton.js +27 -0
- package/dist/components/Table/features/tableSort/components/SortButton/SortButton.styles.d.ts +17 -0
- package/dist/components/Table/features/tableSort/components/SortButton/SortButton.styles.js +20 -0
- package/dist/components/Table/features/tableSort/components/SortButton/SortButton.types.d.ts +4 -0
- package/dist/components/Table/features/tableSort/hooks/index.d.ts +5 -0
- package/dist/components/Table/features/tableSort/hooks/useHeaderCellSort/useHeaderCellSort.d.ts +6 -0
- package/dist/components/Table/features/tableSort/hooks/useHeaderCellSort/useHeaderCellSort.js +47 -0
- package/dist/components/Table/features/tableSort/hooks/useHeaderCellSort/useHeaderCellSort.types.d.ts +7 -0
- package/dist/components/Table/features/tableSort/hooks/useHeaderCellSort/useHeaderCellSort.utils.d.ts +2 -0
- package/dist/components/Table/features/tableSort/hooks/useHeaderCellSort/useHeaderCellSort.utils.js +9 -0
- package/dist/components/Table/features/tableSort/hooks/useSortState/useSortState.d.ts +5 -0
- package/dist/components/Table/features/tableSort/hooks/useSortState/useSortState.js +39 -0
- package/dist/components/Table/features/tableSort/hooks/useSortState/useSortState.types.d.ts +4 -0
- package/dist/components/Table/features/tableSort/hooks/useTableSort/useTableSort.d.ts +9 -0
- package/dist/components/Table/features/tableSort/hooks/useTableSort/useTableSort.js +54 -0
- package/dist/components/Table/features/tableSort/hooks/useTableSort/useTableSort.types.d.ts +14 -0
- package/dist/components/Table/features/tableSort/hooks/useTransformColumns/useTransformColumns.d.ts +5 -0
- package/dist/components/Table/features/tableSort/hooks/useTransformColumns/useTransformColumns.js +47 -0
- package/dist/components/Table/features/tableSort/hooks/useTransformColumns/useTransformColumns.styles.d.ts +6 -0
- package/dist/components/Table/features/tableSort/hooks/useTransformColumns/useTransformColumns.styles.js +8 -0
- package/dist/components/Table/features/tableSort/icons/ArrowFilled.d.ts +2 -0
- package/dist/components/Table/features/tableSort/icons/ArrowFilled.js +12 -0
- package/dist/components/Table/features/tableSort/icons/index.d.ts +1 -0
- package/dist/components/Table/features/tableSort/index.d.ts +5 -0
- package/dist/components/Table/features/tableSort/types.d.ts +10 -0
- package/dist/components/Table/features/tableSort/utils/const.d.ts +4 -0
- package/dist/components/Table/features/tableSort/utils/const.js +8 -0
- package/dist/components/Table/features/tableSort/utils/getSortFunction/getSortFunction.d.ts +2 -0
- package/dist/components/Table/features/tableSort/utils/getSortFunction/getSortFunction.js +9 -0
- package/dist/components/Table/features/tableSort/utils/getSortFunction/index.d.ts +1 -0
- package/dist/components/Table/features/tableSort/utils/getSortedData/getSortedData.d.ts +3 -0
- package/dist/components/Table/features/tableSort/utils/getSortedData/getSortedData.js +48 -0
- package/dist/components/Table/features/tableSort/utils/getSortedData/index.d.ts +1 -0
- package/dist/components/Table/features/tableSort/utils/index.d.ts +2 -0
- package/dist/components/Table/features/tableStaticContext/contexts/index.d.ts +1 -0
- package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.d.ts +21 -0
- package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.js +29 -0
- package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/TableStaticContext.types.d.ts +24 -0
- package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.d.ts +2 -0
- package/dist/components/Table/features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js +8 -0
- package/dist/components/Table/features/tableStaticContext/hocs/index.d.ts +1 -0
- package/dist/components/Table/features/tableStaticContext/hocs/withTableStaticContext.d.ts +3 -0
- package/dist/components/Table/features/tableStaticContext/hocs/withTableStaticContext.js +15 -0
- package/dist/components/Table/features/tableStaticContext/index.d.ts +2 -0
- package/dist/components/Table/features/typedEventBus/hooks.d.ts +3 -0
- package/dist/components/Table/features/typedEventBus/hooks.js +8 -0
- package/dist/components/Table/features/typedEventBus/index.d.ts +2 -0
- package/dist/components/Table/features/typedEventBus/types.d.ts +22 -0
- package/dist/components/Table/forStories/components.d.ts +2 -0
- package/dist/components/Table/forStories/example_1.d.ts +11 -0
- package/dist/components/Table/forStories/example_2.d.ts +11 -0
- package/dist/components/Table/forStories/example_3.d.ts +10 -0
- package/dist/components/Table/forStories/example_4.d.ts +10 -0
- package/dist/components/Table/forStories/example_5.d.ts +9 -0
- package/dist/components/Table/forStories/example_6.d.ts +9 -0
- package/dist/components/Table/forStories/example_7.d.ts +9 -0
- package/dist/components/Table/forStories/index.d.ts +7 -0
- package/dist/components/Table/hooks/useBodyCellRender/index.d.ts +1 -0
- package/dist/components/Table/hooks/useBodyCellRender/useBodyCellRender.d.ts +4 -0
- package/dist/components/Table/hooks/useBodyCellRender/useBodyCellRender.js +27 -0
- package/dist/components/Table/hooks/useBodyCellRender/useBodyCellRender.types.d.ts +7 -0
- package/dist/components/Table/hooks/useBodyFlattenData/index.d.ts +1 -0
- package/dist/components/Table/hooks/useBodyFlattenData/useBodyFlattenData.d.ts +5 -0
- package/dist/components/Table/hooks/useBodyFlattenData/useBodyFlattenData.js +31 -0
- package/dist/components/Table/hooks/useBodyFlattenData/useBodyFlattenData.types.d.ts +11 -0
- package/dist/components/Table/hooks/useBodyFlattenData/useBodyFlattenData.utils.d.ts +3 -0
- package/dist/components/Table/hooks/useBodyFlattenData/useBodyFlattenData.utils.js +19 -0
- package/dist/components/Table/hooks/useCellFixedInfo/index.d.ts +3 -0
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.d.ts +12 -0
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.js +117 -0
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.styles.d.ts +26 -0
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.styles.js +33 -0
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.types.d.ts +19 -0
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.utils.d.ts +9 -0
- package/dist/components/Table/hooks/useCellFixedInfo/useCellFixedInfo.utils.js +75 -0
- package/dist/components/Table/hooks/useCellHover/index.d.ts +1 -0
- package/dist/components/Table/hooks/useCellHover/useCellHover.d.ts +8 -0
- package/dist/components/Table/hooks/useCellHover/useCellHover.js +34 -0
- package/dist/components/Table/hooks/useCellHover/useCellHover.types.d.ts +5 -0
- package/dist/components/Table/hooks/useCellHover/useCellHover.utils.d.ts +1 -0
- package/dist/components/Table/hooks/useCellHover/useCellHover.utils.js +7 -0
- package/dist/components/Table/hooks/useTableColumns/index.d.ts +1 -0
- package/dist/components/Table/hooks/useTableColumns/useTableColumns.d.ts +7 -0
- package/dist/components/Table/hooks/useTableColumns/useTableColumns.js +39 -0
- package/dist/components/Table/hooks/useTableColumns/useTableColumns.types.d.ts +4 -0
- package/dist/components/Table/hooks/useTableColumns/useTableColumns.utils.d.ts +2 -0
- package/dist/components/Table/hooks/useTableColumns/useTableColumns.utils.js +24 -0
- package/dist/components/Table/hooks/useTableComponents/index.d.ts +1 -0
- package/dist/components/Table/hooks/useTableComponents/useTableComponents.d.ts +6 -0
- package/dist/components/Table/hooks/useTableComponents/useTableComponents.js +14 -0
- package/dist/components/Table/hooks/useTableComponents/useTableComponents.types.d.ts +3 -0
- package/dist/components/Table/hooks/useTableVisualParamsChange/index.d.ts +1 -0
- package/dist/components/Table/hooks/useTableVisualParamsChange/types.d.ts +4 -0
- package/dist/components/Table/hooks/useTableVisualParamsChange/useTableVisualParamsChange.d.ts +12 -0
- package/dist/components/Table/hooks/useTableVisualParamsChange/useTableVisualParamsChange.js +116 -0
- package/dist/components/Table/hooks/useTableVisualParamsChange/utils.d.ts +3 -0
- package/dist/components/Table/hooks/useTableVisualParamsChange/utils.js +35 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/Table/interfaces/tableColumns.types.d.ts +45 -0
- package/dist/components/Table/interfaces/tableComponents.types.d.ts +28 -0
- package/dist/components/Table/utils/getRowKey/getRowKey.d.ts +2 -0
- package/dist/components/Table/utils/getRowKey/getRowKey.js +4 -0
- package/dist/components/Table/utils/getRowKey/index.d.ts +2 -0
- package/dist/components/Table/utils/getRowKey/types.d.ts +2 -0
- package/dist/components/Table/utils/index.d.ts +2 -0
- package/dist/components/Table/utils/ref/index.d.ts +1 -0
- package/dist/components/Table/utils/ref/ref.d.ts +5 -0
- package/dist/components/Table/utils/ref/ref.js +16 -0
- package/dist/components/Table/utils/ref/types.d.ts +10 -0
- package/dist/hooks/useEvent/index.d.ts +1 -0
- package/dist/hooks/useEvent/useEvent.d.ts +2 -0
- package/dist/hooks/useEvent/useEvent.js +9 -0
- package/dist/hooks/useEvent/useEvent.types.d.ts +1 -0
- package/dist/hooks/useFirstMount/index.d.ts +1 -0
- package/dist/hooks/useFirstMount/useFirstMount.d.ts +1 -0
- package/dist/hooks/useFirstMount/useFirstMount.js +12 -0
- package/dist/hooks/useStatic/index.d.ts +1 -0
- package/dist/hooks/useStatic/useStatic.d.ts +1 -0
- package/dist/hooks/useStatic/useStatic.js +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/utils/eventBus/context/EventBusContext.d.ts +2 -0
- package/dist/utils/eventBus/context/EventBusContext.js +5 -0
- package/dist/utils/eventBus/context/EventBusContext.types.d.ts +5 -0
- package/dist/utils/eventBus/eventBus.d.ts +10 -0
- package/dist/utils/eventBus/eventBus.js +47 -0
- package/dist/utils/eventBus/hocs/withEventBus/index.d.ts +1 -0
- package/dist/utils/eventBus/hocs/withEventBus/withEventBus.d.ts +2 -0
- package/dist/utils/eventBus/hocs/withEventBus/withEventBus.js +15 -0
- package/dist/utils/eventBus/hooks/useEmitter/useEmitter.d.ts +2 -0
- package/dist/utils/eventBus/hooks/useEmitter/useEmitter.js +8 -0
- package/dist/utils/eventBus/hooks/useEventBus/useEventBus.d.ts +3 -0
- package/dist/utils/eventBus/hooks/useEventBus/useEventBus.js +12 -0
- package/dist/utils/eventBus/hooks/useSubscribe/useSubscribe.d.ts +3 -0
- package/dist/utils/eventBus/hooks/useSubscribe/useSubscribe.js +18 -0
- package/dist/utils/eventBus/index.d.ts +6 -0
- package/dist/utils/eventBus/provider/EventBusProvider.d.ts +3 -0
- package/dist/utils/eventBus/provider/EventBusProvider.js +16 -0
- package/dist/utils/eventBus/provider/EventBusProvider.types.d.ts +6 -0
- package/dist/utils/eventBus/types.d.ts +6 -0
- package/package.json +7 -6
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DefaultRecord, TableProps } from '../Table.types';
|
|
2
|
+
interface DataType extends DefaultRecord {
|
|
3
|
+
name: string;
|
|
4
|
+
age?: number;
|
|
5
|
+
address?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const columns: TableProps<DataType>["columns"];
|
|
8
|
+
export declare const data: readonly DataType[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DefaultRecord, TableProps } from '../Table.types';
|
|
2
|
+
interface DataType extends DefaultRecord {
|
|
3
|
+
name: string;
|
|
4
|
+
age: number;
|
|
5
|
+
address: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const columns: TableProps<DataType>["columns"];
|
|
8
|
+
export declare const data: DataType[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DefaultRecord, TableProps } from '../Table.types';
|
|
2
|
+
interface DataType extends DefaultRecord {
|
|
3
|
+
name: string;
|
|
4
|
+
age: number;
|
|
5
|
+
address: string;
|
|
6
|
+
}
|
|
7
|
+
export declare const columns: TableProps<DataType>["columns"];
|
|
8
|
+
export declare const data: readonly DataType[];
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { columns as columns1, data as data1 } from './example_1';
|
|
2
|
+
export { columns as columns2, data as data2, getCheckboxProps as getCheckboxProps2, } from './example_2';
|
|
3
|
+
export { columns as columns3, data as data3 } from './example_3';
|
|
4
|
+
export { columns as columns4 } from './example_4';
|
|
5
|
+
export { columns as columns5, data as data5 } from './example_5';
|
|
6
|
+
export { columns as columns6, data as data6 } from './example_6';
|
|
7
|
+
export { columns as columns7, data as data7 } from './example_7';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useBodyCellRender } from './useBodyCellRender';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { get } from "lodash-es";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
const useBodyCellRender = (options) => {
|
|
4
|
+
const {
|
|
5
|
+
record,
|
|
6
|
+
dataIndex,
|
|
7
|
+
renderIndex,
|
|
8
|
+
render
|
|
9
|
+
} = options;
|
|
10
|
+
const children = useMemo(() => {
|
|
11
|
+
let value;
|
|
12
|
+
if (dataIndex) {
|
|
13
|
+
value = get(record, dataIndex);
|
|
14
|
+
}
|
|
15
|
+
let result = value;
|
|
16
|
+
if (render) {
|
|
17
|
+
result = render(value, record, renderIndex);
|
|
18
|
+
}
|
|
19
|
+
return result;
|
|
20
|
+
}, [record, dataIndex, renderIndex, render]);
|
|
21
|
+
return {
|
|
22
|
+
children
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
useBodyCellRender
|
|
27
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { BodyCellProps } from '../../components/Body/components/BodyCell/BodyCell.types';
|
|
2
|
+
export interface UseBodyCellRenderOptions<Record> {
|
|
3
|
+
record: BodyCellProps<Record>["record"];
|
|
4
|
+
dataIndex: BodyCellProps<Record>["column"]["dataIndex"];
|
|
5
|
+
renderIndex: BodyCellProps<Record>["renderIndex"];
|
|
6
|
+
render: BodyCellProps<Record>["column"]["render"];
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useBodyFlattenData } from './useBodyFlattenData';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FlattedData, UseBodyFlattenDataOptions } from './useBodyFlattenData.types';
|
|
2
|
+
import { DefaultRecord } from 'components/Table/Table.types';
|
|
3
|
+
export declare const useBodyFlattenData: <Record extends DefaultRecord>(options: UseBodyFlattenDataOptions<Record>) => {
|
|
4
|
+
flattedData: FlattedData<Record>[];
|
|
5
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { fillRecords } from "./useBodyFlattenData.utils.js";
|
|
3
|
+
import { getRowKey } from "../../utils/getRowKey/getRowKey.js";
|
|
4
|
+
const useBodyFlattenData = (options) => {
|
|
5
|
+
const {
|
|
6
|
+
data,
|
|
7
|
+
expandedKeys
|
|
8
|
+
} = options;
|
|
9
|
+
const flattedData = useMemo(() => {
|
|
10
|
+
if (expandedKeys.size) {
|
|
11
|
+
const list = [];
|
|
12
|
+
for (let i = 0; i < data.length; i += 1) {
|
|
13
|
+
const record = data[i];
|
|
14
|
+
fillRecords(list, record, 0, expandedKeys, i);
|
|
15
|
+
}
|
|
16
|
+
return list;
|
|
17
|
+
}
|
|
18
|
+
return data.map((item, index) => ({
|
|
19
|
+
record: item,
|
|
20
|
+
indent: 0,
|
|
21
|
+
index,
|
|
22
|
+
rowKey: getRowKey(item)
|
|
23
|
+
}));
|
|
24
|
+
}, [data, expandedKeys]);
|
|
25
|
+
return {
|
|
26
|
+
flattedData
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export {
|
|
30
|
+
useBodyFlattenData
|
|
31
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Key } from 'components/Table/Table.types';
|
|
2
|
+
export interface UseBodyFlattenDataOptions<Record> {
|
|
3
|
+
data: Record[];
|
|
4
|
+
expandedKeys: Set<Key>;
|
|
5
|
+
}
|
|
6
|
+
export interface FlattedData<Record> {
|
|
7
|
+
record: Record;
|
|
8
|
+
indent: number;
|
|
9
|
+
index: number;
|
|
10
|
+
rowKey: Key;
|
|
11
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefaultRecord, Key } from 'components/Table/Table.types';
|
|
2
|
+
import { FlattedData } from './useBodyFlattenData.types';
|
|
3
|
+
export declare function fillRecords<Record extends DefaultRecord>(list: FlattedData<Record>[], record: Record, indent: number, expandedKeys: Set<Key>, index: number): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { getRowKey } from "../../utils/getRowKey/getRowKey.js";
|
|
2
|
+
function fillRecords(list, record, indent, expandedKeys, index) {
|
|
3
|
+
const key = getRowKey(record);
|
|
4
|
+
list.push({
|
|
5
|
+
record,
|
|
6
|
+
indent,
|
|
7
|
+
index,
|
|
8
|
+
rowKey: key
|
|
9
|
+
});
|
|
10
|
+
const expanded = expandedKeys.has(key);
|
|
11
|
+
if (record && Array.isArray(record.children) && expanded) {
|
|
12
|
+
for (let i = 0; i < record.children.length; i += 1) {
|
|
13
|
+
fillRecords(list, record.children[i], indent + 1, expandedKeys, i);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
fillRecords
|
|
19
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { UseCellFixedInfoOptions } from './useCellFixedInfo.types';
|
|
2
|
+
export declare const useCellFixedInfo: (options: UseCellFixedInfoOptions) => {
|
|
3
|
+
isFixStart: boolean;
|
|
4
|
+
isFixEnd: boolean;
|
|
5
|
+
fixStart: number | null;
|
|
6
|
+
fixEnd: number | null;
|
|
7
|
+
zIndexReverse: number;
|
|
8
|
+
fixedStartShadow: boolean;
|
|
9
|
+
fixedEndShadow: boolean;
|
|
10
|
+
showFixStartShadow: boolean;
|
|
11
|
+
showFixEndShadow: boolean;
|
|
12
|
+
};
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { useState, useRef } from "react";
|
|
2
|
+
import { isNumber } from "lodash-es";
|
|
3
|
+
import { getCellFixedMinimalInfo, getCellFixedInfo } from "./useCellFixedInfo.utils.js";
|
|
4
|
+
import { useTableContext } from "../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
5
|
+
import { useSubscribe } from "../../features/typedEventBus/hooks.js";
|
|
6
|
+
import { updateRefValue, getRefValue } from "../../utils/ref/ref.js";
|
|
7
|
+
const useCellFixedInfo = (options) => {
|
|
8
|
+
const {
|
|
9
|
+
colStart,
|
|
10
|
+
colEnd
|
|
11
|
+
} = options;
|
|
12
|
+
const {
|
|
13
|
+
flattedColumns,
|
|
14
|
+
isAllColumnsFixedStart
|
|
15
|
+
} = useTableContext();
|
|
16
|
+
const [fixStart, setFixStart] = useState(null);
|
|
17
|
+
const [fixEnd, setFixEnd] = useState(null);
|
|
18
|
+
const isFixStart = isNumber(fixStart) && !isAllColumnsFixedStart;
|
|
19
|
+
const isFixEnd = isNumber(fixEnd) && !isAllColumnsFixedStart;
|
|
20
|
+
const [fixedStartShadow, setFixedStartShadow] = useState(false);
|
|
21
|
+
const [fixedEndShadow, setFixedEndShadow] = useState(false);
|
|
22
|
+
const [zIndexReverse, setZIndexReverse] = useState(0);
|
|
23
|
+
const [showFixStartShadow, setShowFixStartShadow] = useState(false);
|
|
24
|
+
const [showFixEndShadow, setShowFixEndShadow] = useState(false);
|
|
25
|
+
const infoRef = useRef({
|
|
26
|
+
fixStart: null,
|
|
27
|
+
fixEnd: null,
|
|
28
|
+
fixedStartShadow: false,
|
|
29
|
+
fixedEndShadow: false,
|
|
30
|
+
offsetFixedStartShadow: 0,
|
|
31
|
+
offsetFixedEndShadow: 0,
|
|
32
|
+
zIndex: 0,
|
|
33
|
+
zIndexReverse: 0,
|
|
34
|
+
showStartShadow: false,
|
|
35
|
+
showEndShadow: false
|
|
36
|
+
});
|
|
37
|
+
const {
|
|
38
|
+
skipSubscribe
|
|
39
|
+
} = getCellFixedMinimalInfo(colStart, colEnd, flattedColumns);
|
|
40
|
+
useSubscribe("table-visual-params:change", (value) => {
|
|
41
|
+
const {
|
|
42
|
+
measureCellsInfo,
|
|
43
|
+
horizontalScrollPositionRange
|
|
44
|
+
} = value;
|
|
45
|
+
if (measureCellsInfo) {
|
|
46
|
+
const {
|
|
47
|
+
fixStart: fixStart3,
|
|
48
|
+
fixEnd: fixEnd3,
|
|
49
|
+
fixedStartShadow: fixedStartShadow3,
|
|
50
|
+
fixedEndShadow: fixedEndShadow3,
|
|
51
|
+
offsetFixedStartShadow,
|
|
52
|
+
offsetFixedEndShadow,
|
|
53
|
+
zIndex,
|
|
54
|
+
zIndexReverse: zIndexReverse3
|
|
55
|
+
} = getCellFixedInfo(colStart, colEnd, flattedColumns, measureCellsInfo);
|
|
56
|
+
updateRefValue(infoRef, {
|
|
57
|
+
fixStart: fixStart3,
|
|
58
|
+
fixEnd: fixEnd3,
|
|
59
|
+
fixedStartShadow: fixedStartShadow3,
|
|
60
|
+
fixedEndShadow: fixedEndShadow3,
|
|
61
|
+
offsetFixedStartShadow,
|
|
62
|
+
offsetFixedEndShadow,
|
|
63
|
+
zIndex,
|
|
64
|
+
zIndexReverse: zIndexReverse3
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (horizontalScrollPositionRange) {
|
|
68
|
+
const [absScroll, scrollWidth] = horizontalScrollPositionRange;
|
|
69
|
+
const {
|
|
70
|
+
fixStart: fixStart3,
|
|
71
|
+
fixEnd: fixEnd3,
|
|
72
|
+
fixedStartShadow: fixedStartShadow3,
|
|
73
|
+
fixedEndShadow: fixedEndShadow3,
|
|
74
|
+
offsetFixedStartShadow,
|
|
75
|
+
offsetFixedEndShadow
|
|
76
|
+
} = getRefValue(infoRef);
|
|
77
|
+
const isFixStart2 = isNumber(fixStart3) && !isAllColumnsFixedStart;
|
|
78
|
+
const isFixEnd2 = isNumber(fixEnd3) && !isAllColumnsFixedStart;
|
|
79
|
+
const showStartShadow2 = Number(isFixStart2 && fixedStartShadow3 && absScroll) - offsetFixedStartShadow >= 1;
|
|
80
|
+
const showEndShadow2 = Number(isFixEnd2 && fixedEndShadow3 && scrollWidth - absScroll) - offsetFixedEndShadow > 1;
|
|
81
|
+
updateRefValue(infoRef, {
|
|
82
|
+
showStartShadow: showStartShadow2,
|
|
83
|
+
showEndShadow: showEndShadow2
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const {
|
|
87
|
+
fixStart: fixStart2,
|
|
88
|
+
fixEnd: fixEnd2,
|
|
89
|
+
fixedStartShadow: fixedStartShadow2,
|
|
90
|
+
fixedEndShadow: fixedEndShadow2,
|
|
91
|
+
zIndexReverse: zIndexReverse2,
|
|
92
|
+
showStartShadow,
|
|
93
|
+
showEndShadow
|
|
94
|
+
} = getRefValue(infoRef);
|
|
95
|
+
setFixStart(fixStart2);
|
|
96
|
+
setFixEnd(fixEnd2);
|
|
97
|
+
setFixedStartShadow(fixedStartShadow2);
|
|
98
|
+
setFixedEndShadow(fixedEndShadow2);
|
|
99
|
+
setZIndexReverse(zIndexReverse2);
|
|
100
|
+
setShowFixStartShadow(showStartShadow);
|
|
101
|
+
setShowFixEndShadow(showEndShadow);
|
|
102
|
+
}, skipSubscribe, [colStart, colEnd, isAllColumnsFixedStart, flattedColumns], true);
|
|
103
|
+
return {
|
|
104
|
+
isFixStart,
|
|
105
|
+
isFixEnd,
|
|
106
|
+
fixStart,
|
|
107
|
+
fixEnd,
|
|
108
|
+
zIndexReverse,
|
|
109
|
+
fixedStartShadow,
|
|
110
|
+
fixedEndShadow,
|
|
111
|
+
showFixStartShadow,
|
|
112
|
+
showFixEndShadow
|
|
113
|
+
};
|
|
114
|
+
};
|
|
115
|
+
export {
|
|
116
|
+
useCellFixedInfo
|
|
117
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { useCellFixedInfo } from './useCellFixedInfo';
|
|
2
|
+
import { Key } from 'components/Table/Table.types';
|
|
3
|
+
export declare const getFixedCellStyle: ({ columnKey, isFixStart, isFixEnd, fixStart, fixEnd, zIndexReverse, fixedStartShadow, fixedEndShadow, showFixStartShadow, showFixEndShadow, }: ReturnType<typeof useCellFixedInfo> & {
|
|
4
|
+
columnKey: Key;
|
|
5
|
+
}) => ({
|
|
6
|
+
readonly position: "relative" | "sticky" | undefined;
|
|
7
|
+
readonly zIndex: number | undefined;
|
|
8
|
+
readonly insetInlineStart: number | undefined;
|
|
9
|
+
readonly insetInlineEnd: number | undefined;
|
|
10
|
+
readonly "::after"?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
readonly "::after": {
|
|
13
|
+
readonly content: "''";
|
|
14
|
+
readonly position: "absolute";
|
|
15
|
+
readonly top: 0;
|
|
16
|
+
readonly bottom: -1;
|
|
17
|
+
readonly insetInlineStart: "100%" | undefined;
|
|
18
|
+
readonly insetInlineEnd: "100%" | undefined;
|
|
19
|
+
readonly width: 10;
|
|
20
|
+
readonly boxShadow: "inset 10px 0 8px -8px rgba(5, 5, 5, 0.06)" | "inset -10px 0 8px -8px rgba(5, 5, 5, 0.06)" | undefined;
|
|
21
|
+
};
|
|
22
|
+
readonly position?: undefined;
|
|
23
|
+
readonly zIndex?: undefined;
|
|
24
|
+
readonly insetInlineStart?: undefined;
|
|
25
|
+
readonly insetInlineEnd?: undefined;
|
|
26
|
+
} | undefined)[];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { isNumber } from "lodash-es";
|
|
2
|
+
import { selectionColumnKey } from "../../features/tableRowSelection/utils/const.js";
|
|
3
|
+
const getFixedCellStyle = ({
|
|
4
|
+
columnKey,
|
|
5
|
+
isFixStart,
|
|
6
|
+
isFixEnd,
|
|
7
|
+
fixStart,
|
|
8
|
+
fixEnd,
|
|
9
|
+
zIndexReverse,
|
|
10
|
+
fixedStartShadow,
|
|
11
|
+
fixedEndShadow,
|
|
12
|
+
showFixStartShadow,
|
|
13
|
+
showFixEndShadow
|
|
14
|
+
}) => [{
|
|
15
|
+
position: isFixStart || isFixEnd ? "sticky" : columnKey === selectionColumnKey ? "relative" : void 0,
|
|
16
|
+
zIndex: (isFixStart || isFixEnd) && zIndexReverse !== 0 ? zIndexReverse + 2 : void 0,
|
|
17
|
+
insetInlineStart: isFixStart && isNumber(fixStart) ? fixStart : void 0,
|
|
18
|
+
insetInlineEnd: isFixEnd && isNumber(fixEnd) ? fixEnd : void 0
|
|
19
|
+
}, fixedStartShadow || fixedEndShadow ? {
|
|
20
|
+
"::after": {
|
|
21
|
+
content: "''",
|
|
22
|
+
position: "absolute",
|
|
23
|
+
top: 0,
|
|
24
|
+
bottom: -1,
|
|
25
|
+
insetInlineStart: fixedStartShadow ? "100%" : void 0,
|
|
26
|
+
insetInlineEnd: fixedEndShadow ? "100%" : void 0,
|
|
27
|
+
width: 10,
|
|
28
|
+
boxShadow: showFixStartShadow ? "inset 10px 0 8px -8px rgba(5, 5, 5, 0.06)" : showFixEndShadow ? "inset -10px 0 8px -8px rgba(5, 5, 5, 0.06)" : void 0
|
|
29
|
+
}
|
|
30
|
+
} : void 0];
|
|
31
|
+
export {
|
|
32
|
+
getFixedCellStyle
|
|
33
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UseCellFixedInfoOptions {
|
|
2
|
+
colStart: number;
|
|
3
|
+
colEnd: number;
|
|
4
|
+
}
|
|
5
|
+
export interface FixedInfo {
|
|
6
|
+
fixStart: number | null;
|
|
7
|
+
fixEnd: number | null;
|
|
8
|
+
fixedStartShadow: boolean;
|
|
9
|
+
fixedEndShadow: boolean;
|
|
10
|
+
offsetFixedStartShadow: number;
|
|
11
|
+
offsetFixedEndShadow: number;
|
|
12
|
+
zIndex: number;
|
|
13
|
+
zIndexReverse: number;
|
|
14
|
+
}
|
|
15
|
+
export interface StickyOffsets {
|
|
16
|
+
start: readonly number[];
|
|
17
|
+
end: readonly number[];
|
|
18
|
+
widths: readonly number[];
|
|
19
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { FixedInfo, StickyOffsets } from './useCellFixedInfo.types';
|
|
2
|
+
export declare function getCellFixedMinimalInfo(colStart: number, colEnd: number, columns: readonly {
|
|
3
|
+
fixed?: "start" | "end";
|
|
4
|
+
}[]): {
|
|
5
|
+
skipSubscribe: boolean;
|
|
6
|
+
};
|
|
7
|
+
export declare function getCellFixedInfo(colStart: number, colEnd: number, columns: readonly {
|
|
8
|
+
fixed?: "start" | "end";
|
|
9
|
+
}[], stickyOffsets: StickyOffsets): FixedInfo;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
function isFixedStart(column) {
|
|
2
|
+
return column.fixed === "start";
|
|
3
|
+
}
|
|
4
|
+
function isFixedEnd(column) {
|
|
5
|
+
return column.fixed === "end";
|
|
6
|
+
}
|
|
7
|
+
function getCellFixedMinimalInfo(colStart, colEnd, columns) {
|
|
8
|
+
const startColumn = columns[colStart] || {};
|
|
9
|
+
const endColumn = columns[colEnd] || {};
|
|
10
|
+
let fixStart = false;
|
|
11
|
+
let fixEnd = false;
|
|
12
|
+
if (isFixedStart(startColumn) && isFixedStart(endColumn)) {
|
|
13
|
+
fixStart = true;
|
|
14
|
+
} else if (isFixedEnd(endColumn) && isFixedEnd(startColumn)) {
|
|
15
|
+
fixEnd = true;
|
|
16
|
+
}
|
|
17
|
+
return {
|
|
18
|
+
skipSubscribe: !(fixStart || fixEnd)
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function getCellFixedInfo(colStart, colEnd, columns, stickyOffsets) {
|
|
22
|
+
const startColumn = columns[colStart] || {};
|
|
23
|
+
const endColumn = columns[colEnd] || {};
|
|
24
|
+
let fixStart = null;
|
|
25
|
+
let fixEnd = null;
|
|
26
|
+
if (isFixedStart(startColumn) && isFixedStart(endColumn)) {
|
|
27
|
+
fixStart = stickyOffsets.start[colStart];
|
|
28
|
+
} else if (isFixedEnd(endColumn) && isFixedEnd(startColumn)) {
|
|
29
|
+
fixEnd = stickyOffsets.end[colEnd];
|
|
30
|
+
}
|
|
31
|
+
let fixedStartShadow = false;
|
|
32
|
+
let fixedEndShadow = false;
|
|
33
|
+
let zIndex = 0;
|
|
34
|
+
let zIndexReverse = 0;
|
|
35
|
+
if (fixStart !== null) {
|
|
36
|
+
fixedStartShadow = !columns[colEnd + 1] || !isFixedStart(columns[colEnd + 1]);
|
|
37
|
+
zIndex = columns.length * 2 - colStart;
|
|
38
|
+
zIndexReverse = columns.length + colStart;
|
|
39
|
+
}
|
|
40
|
+
if (fixEnd !== null) {
|
|
41
|
+
fixedEndShadow = !columns[colStart - 1] || !isFixedEnd(columns[colStart - 1]);
|
|
42
|
+
zIndex = colEnd;
|
|
43
|
+
zIndexReverse = columns.length - colEnd;
|
|
44
|
+
}
|
|
45
|
+
let offsetFixedStartShadow = 0;
|
|
46
|
+
let offsetFixedEndShadow = 0;
|
|
47
|
+
if (fixedStartShadow) {
|
|
48
|
+
for (let i = 0; i < colStart; i += 1) {
|
|
49
|
+
if (!isFixedStart(columns[i])) {
|
|
50
|
+
offsetFixedStartShadow += stickyOffsets.widths[i] || 0;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (fixedEndShadow) {
|
|
55
|
+
for (let i = columns.length - 1; i > colEnd; i -= 1) {
|
|
56
|
+
if (!isFixedEnd(columns[i])) {
|
|
57
|
+
offsetFixedEndShadow += stickyOffsets.widths[i] || 0;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
fixStart,
|
|
63
|
+
fixEnd,
|
|
64
|
+
fixedStartShadow,
|
|
65
|
+
fixedEndShadow,
|
|
66
|
+
offsetFixedStartShadow,
|
|
67
|
+
offsetFixedEndShadow,
|
|
68
|
+
zIndex,
|
|
69
|
+
zIndexReverse
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
getCellFixedInfo,
|
|
74
|
+
getCellFixedMinimalInfo
|
|
75
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useCellHover } from './useCellHover';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { useRef, useState } from "react";
|
|
2
|
+
import { isInHoverRange } from "./useCellHover.utils.js";
|
|
3
|
+
import { useSubscribe, useEmitter } from "../../features/typedEventBus/hooks.js";
|
|
4
|
+
const useCellHover = (options) => {
|
|
5
|
+
const {
|
|
6
|
+
index,
|
|
7
|
+
rowSpan,
|
|
8
|
+
skipSubscribe
|
|
9
|
+
} = options;
|
|
10
|
+
const hoverIdRef = useRef(0);
|
|
11
|
+
const [isHovered, setHovered] = useState(false);
|
|
12
|
+
useSubscribe("cell:hover", (value) => {
|
|
13
|
+
const {
|
|
14
|
+
start,
|
|
15
|
+
end
|
|
16
|
+
} = value;
|
|
17
|
+
hoverIdRef.current += 1;
|
|
18
|
+
const currentId = hoverIdRef.current;
|
|
19
|
+
queueMicrotask(() => {
|
|
20
|
+
if (currentId === hoverIdRef.current) {
|
|
21
|
+
const val = isInHoverRange(index, rowSpan, start, end);
|
|
22
|
+
setHovered(val);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}, skipSubscribe, [index, rowSpan]);
|
|
26
|
+
const emitCellHover = useEmitter("cell:hover");
|
|
27
|
+
return {
|
|
28
|
+
isHovered,
|
|
29
|
+
emitCellHover
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
useCellHover
|
|
34
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const isInHoverRange: (cellStartRow: number, cellRowSpan: number, startRow: number, endRow: number) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useTableColumns } from './useTableColumns';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { UseTableColumnsOptions } from './useTableColumns.types';
|
|
2
|
+
import { DefaultRecord } from 'components/Table/Table.types';
|
|
3
|
+
export declare const useTableColumns: <Record extends DefaultRecord>(options: UseTableColumnsOptions<Record>) => {
|
|
4
|
+
columns: (import('../../interfaces/tableColumns.types').ColumnWithChildren<Record> | import('../../interfaces/tableColumns.types').Column<Record>)[];
|
|
5
|
+
flattedColumns: import('../../interfaces/tableColumns.types').Column<Record>[];
|
|
6
|
+
isAllColumnsFixedStart: boolean;
|
|
7
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { flatColumns } from "./useTableColumns.utils.js";
|
|
3
|
+
import { useTransformColumns } from "../../features/tableRowSelection/hooks/useTransformColumns/useTransformColumns.js";
|
|
4
|
+
import { useTransformColumns as useTransformColumns$1 } from "../../features/tableSort/hooks/useTransformColumns/useTransformColumns.js";
|
|
5
|
+
const emptyColumnKey = "__EMPTY_COLUMN";
|
|
6
|
+
const useTableColumns = (options) => {
|
|
7
|
+
const {
|
|
8
|
+
columns: columnsProp,
|
|
9
|
+
rowSelection
|
|
10
|
+
} = options;
|
|
11
|
+
const {
|
|
12
|
+
transformColumns: rowSelectionTransformColumns
|
|
13
|
+
} = useTransformColumns({
|
|
14
|
+
rowSelection
|
|
15
|
+
});
|
|
16
|
+
const {
|
|
17
|
+
transformColumns: sorterTransformColumns
|
|
18
|
+
} = useTransformColumns$1();
|
|
19
|
+
const columns = useMemo(() => {
|
|
20
|
+
const transformers = [sorterTransformColumns, rowSelectionTransformColumns];
|
|
21
|
+
const resultColumns = transformers.reduce((transformedColumns, transformer) => transformer(transformedColumns), [...columnsProp]);
|
|
22
|
+
if (!resultColumns.length) {
|
|
23
|
+
resultColumns.push({
|
|
24
|
+
key: emptyColumnKey
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return resultColumns;
|
|
28
|
+
}, [columnsProp, rowSelectionTransformColumns, sorterTransformColumns]);
|
|
29
|
+
const flattedColumns = useMemo(() => flatColumns(columns), [columns]);
|
|
30
|
+
const isAllColumnsFixedStart = useMemo(() => flattedColumns.every((col) => col.fixed === "start"), [flattedColumns]);
|
|
31
|
+
return {
|
|
32
|
+
columns,
|
|
33
|
+
flattedColumns,
|
|
34
|
+
isAllColumnsFixedStart
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
export {
|
|
38
|
+
useTableColumns
|
|
39
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { UseTransformColumnsOptions } from 'components/Table/features/tableRowSelection';
|
|
2
|
+
import { DefaultRecord, TableProps } from '../../Table.types';
|
|
3
|
+
export interface UseTableColumnsOptions<Record extends DefaultRecord> extends Pick<TableProps<Record>, "columns">, UseTransformColumnsOptions<Record> {
|
|
4
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const flatColumns = (columns) => {
|
|
2
|
+
return columns.reduce((acc, column) => {
|
|
3
|
+
const {
|
|
4
|
+
fixed
|
|
5
|
+
} = column;
|
|
6
|
+
const subColumns = "children" in column ? column.children : [];
|
|
7
|
+
if (subColumns.length > 0) {
|
|
8
|
+
return [...acc, ...flatColumns(subColumns).map((subColumn) => {
|
|
9
|
+
const clonedSubColumn = {
|
|
10
|
+
...subColumn
|
|
11
|
+
};
|
|
12
|
+
const resultFixed = subColumn.fixed ?? fixed;
|
|
13
|
+
if (resultFixed) {
|
|
14
|
+
clonedSubColumn.fixed = resultFixed;
|
|
15
|
+
}
|
|
16
|
+
return clonedSubColumn;
|
|
17
|
+
})];
|
|
18
|
+
}
|
|
19
|
+
return [...acc, column];
|
|
20
|
+
}, []);
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
flatColumns
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useTableComponents } from './useTableComponents';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PropertyPath } from 'lodash-es';
|
|
2
|
+
import { UseTableComponentsOptions } from './useTableComponents.types';
|
|
3
|
+
import { CustomizedComponent } from 'components/Table/interfaces/tableComponents.types';
|
|
4
|
+
export declare const useTableComponents: (options: UseTableComponentsOptions) => {
|
|
5
|
+
getComponent: <T extends CustomizedComponent>(path: PropertyPath, defaultComponent: T) => T;
|
|
6
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useCallback } from "react";
|
|
2
|
+
import { get } from "lodash-es";
|
|
3
|
+
const useTableComponents = (options) => {
|
|
4
|
+
const {
|
|
5
|
+
components
|
|
6
|
+
} = options;
|
|
7
|
+
const getComponent = useCallback((path, defaultComponent) => get(components, path, defaultComponent), [components]);
|
|
8
|
+
return {
|
|
9
|
+
getComponent
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export {
|
|
13
|
+
useTableComponents
|
|
14
|
+
};
|