@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,117 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Fragment } from "react";
|
|
3
|
+
import { Cell } from "../../../Cell/Cell.js";
|
|
4
|
+
import { useCellHover } from "../../../../hooks/useCellHover/useCellHover.js";
|
|
5
|
+
import { useBodyCellRender } from "../../../../hooks/useBodyCellRender/useBodyCellRender.js";
|
|
6
|
+
import { useCellFixedInfo } from "../../../../hooks/useCellFixedInfo/useCellFixedInfo.js";
|
|
7
|
+
import { getFixedCellStyle } from "../../../../hooks/useCellFixedInfo/useCellFixedInfo.styles.js";
|
|
8
|
+
import { bodyCellStyle, getBorderedBodyCellStyle, nonHeaderBorderedBodyCellStyle, getCellInnerWrapperStyle } from "./BodyCell.styles.js";
|
|
9
|
+
import { useTheme } from "../../../../../../hooks/useTheme/useTheme.js";
|
|
10
|
+
import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
11
|
+
import { ExpandIconWrapper } from "../../../../features/tableExpand/components/ExpandIconWrapper/ExpandIconWrapper.js";
|
|
12
|
+
const BodyCellComponent = (props) => {
|
|
13
|
+
var _a;
|
|
14
|
+
const {
|
|
15
|
+
column,
|
|
16
|
+
record,
|
|
17
|
+
index,
|
|
18
|
+
colIndex,
|
|
19
|
+
rowKey,
|
|
20
|
+
intent,
|
|
21
|
+
renderIndex,
|
|
22
|
+
isRowSelected
|
|
23
|
+
} = props;
|
|
24
|
+
const {
|
|
25
|
+
rowScope,
|
|
26
|
+
dataIndex,
|
|
27
|
+
render
|
|
28
|
+
} = column;
|
|
29
|
+
const theme = useTheme();
|
|
30
|
+
const {
|
|
31
|
+
getComponent,
|
|
32
|
+
isSomeRecordHasChildren,
|
|
33
|
+
indentSize,
|
|
34
|
+
expandIconColumnIndex,
|
|
35
|
+
bordered,
|
|
36
|
+
tableTokens,
|
|
37
|
+
showHeader
|
|
38
|
+
} = useTableContext();
|
|
39
|
+
const {
|
|
40
|
+
isFixStart,
|
|
41
|
+
isFixEnd,
|
|
42
|
+
fixStart,
|
|
43
|
+
fixEnd,
|
|
44
|
+
zIndexReverse,
|
|
45
|
+
fixedStartShadow,
|
|
46
|
+
fixedEndShadow,
|
|
47
|
+
showFixStartShadow,
|
|
48
|
+
showFixEndShadow
|
|
49
|
+
} = useCellFixedInfo({
|
|
50
|
+
colStart: colIndex,
|
|
51
|
+
colEnd: colIndex
|
|
52
|
+
});
|
|
53
|
+
const {
|
|
54
|
+
rowSpan: cellRowSpan,
|
|
55
|
+
colSpan: cellColSpan,
|
|
56
|
+
onMouseEnter: cellOnMouseEnter,
|
|
57
|
+
onMouseLeave: cellOnMouseLeave,
|
|
58
|
+
css: cellCss,
|
|
59
|
+
...restAdditionalCellProps
|
|
60
|
+
} = ((_a = column.onCell) == null ? void 0 : _a.call(column, record, index)) || {};
|
|
61
|
+
const notRenderedCell = cellColSpan === 0 || cellRowSpan === 0;
|
|
62
|
+
const rowSpan = cellRowSpan ?? 1;
|
|
63
|
+
const prefixNode = colIndex === expandIconColumnIndex && isSomeRecordHasChildren && /* @__PURE__ */ jsx(ExpandIconWrapper, { rowKey, record, expandable: record && Boolean(record.children) });
|
|
64
|
+
const {
|
|
65
|
+
isHovered,
|
|
66
|
+
emitCellHover
|
|
67
|
+
} = useCellHover({
|
|
68
|
+
index,
|
|
69
|
+
rowSpan,
|
|
70
|
+
skipSubscribe: notRenderedCell
|
|
71
|
+
});
|
|
72
|
+
const {
|
|
73
|
+
children
|
|
74
|
+
} = useBodyCellRender({
|
|
75
|
+
record,
|
|
76
|
+
dataIndex,
|
|
77
|
+
renderIndex,
|
|
78
|
+
render
|
|
79
|
+
});
|
|
80
|
+
const handleMouseEnter = (e) => {
|
|
81
|
+
emitCellHover({
|
|
82
|
+
start: index,
|
|
83
|
+
end: index + rowSpan - 1
|
|
84
|
+
});
|
|
85
|
+
cellOnMouseEnter == null ? void 0 : cellOnMouseEnter(e);
|
|
86
|
+
};
|
|
87
|
+
const handleMouseLeave = (e) => {
|
|
88
|
+
emitCellHover({
|
|
89
|
+
start: -1,
|
|
90
|
+
end: -1
|
|
91
|
+
});
|
|
92
|
+
cellOnMouseLeave == null ? void 0 : cellOnMouseLeave(e);
|
|
93
|
+
};
|
|
94
|
+
const CellInnerWrapper = prefixNode ? "div" : Fragment;
|
|
95
|
+
return /* @__PURE__ */ jsx(Cell, { component: rowScope ? getComponent(["body", "cell"], "th") : getComponent(["body", "cell"], "td"), align: column.align, ellipsis: column.ellipsis, bordered, tableTokens, css: [bodyCellStyle(tableTokens), bordered ? getBorderedBodyCellStyle(bordered) : void 0, bordered && !showHeader ? nonHeaderBorderedBodyCellStyle(tableTokens) : void 0, ...getFixedCellStyle({
|
|
96
|
+
columnKey: column.key,
|
|
97
|
+
isFixStart,
|
|
98
|
+
isFixEnd,
|
|
99
|
+
fixStart,
|
|
100
|
+
fixEnd,
|
|
101
|
+
zIndexReverse,
|
|
102
|
+
fixedStartShadow,
|
|
103
|
+
fixedEndShadow,
|
|
104
|
+
showFixStartShadow,
|
|
105
|
+
showFixEndShadow
|
|
106
|
+
}), cellCss, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9Cb2R5L2NvbXBvbmVudHMvQm9keUNlbGwvQm9keUNlbGwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTRHTSIsImZpbGUiOiIvYnVpbGRzL2Zyb250ZW5kL2xpYnMvdWkta2l0L3NyYy9jb21wb25lbnRzL1RhYmxlL2NvbXBvbmVudHMvQm9keS9jb21wb25lbnRzL0JvZHlDZWxsL0JvZHlDZWxsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEZyYWdtZW50LCB0eXBlIE1vdXNlRXZlbnRIYW5kbGVyIH0gZnJvbSBcInJlYWN0XCI7XG5pbXBvcnQgdHlwZSB7IEJvZHlDZWxsUHJvcHMgfSBmcm9tIFwiLi9Cb2R5Q2VsbC50eXBlc1wiO1xuaW1wb3J0IHsgQ2VsbCB9IGZyb20gXCIuLi8uLi8uLi9DZWxsL0NlbGxcIjtcbmltcG9ydCB7IHVzZUNlbGxIb3ZlciB9IGZyb20gXCJjb21wb25lbnRzL1RhYmxlL2hvb2tzL3VzZUNlbGxIb3ZlclwiO1xuaW1wb3J0IHsgdXNlQm9keU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gICAgICAgIHNob3dGaXhTdGFydFNoYWRvdyxcbiAgICAgICAgICBzaG93Rml4RW5kU2hhZG93LFxuICAgICAgICB9KSxcbiAgICAgICAgY2VsbENzcyxcbiAgICAgIF19XG4gICAgICByb3dTcGFuPXtjZWxsUm93U3Bhbn1cbiAgICAgIGNvbFNwYW49e2NlbGxDb2xTcGFufVxuICAgICAgb25Nb3VzZUVudGVyPXtoYW5kbGVNb3VzZUVudGVyfVxuICAgICAgb25Nb3VzZUxlYXZlPXtoYW5kbGVNb3VzZUxlYXZlfVxuICAgICAgey4uLnJlc3RBZGRpdGlvbmFsQ2VsbFByb3BzfVxuICAgICAgc2NvcGU9e3Jvd1Njb3BlfVxuICAgICAgaXNIb3ZlcmVkPXtpc0hvdmVyZWR9XG4gICAgICBpc1Jvd1NlbGVjdGVkPXtpc1Jvd1NlbGVjdGVkfVxuICAgID5cbiAgICAgIDxDZWxsSW5uZXJXcmFwcGVyXG4gICAgICAgIHsuLi4ocHJlZml4Tm9kZVxuICAgICAgICAgID8ge1xuICAgICAgICAgICAgICBcImRhdGEtaW5kZW50LWxldmVsXCI6IGludGVudCxcbiAgICAgICAgICAgICAgY3NzOiBnZXRDZWxsSW5uZXJXcmFwcGVyU3R5bGUoaW5kZW50U2l6ZSwgaW50ZW50KSh0aGVtZSksXG4gICAgICAgICAgICB9XG4gICAgICAgICAgOiB7fSl9XG4gICAgICA+XG4gICAgICAgIHtwcmVmaXhOb2RlfVxuICAgICAgICB7Y2hpbGRyZW59XG4gICAgICA8L0NlbGxJbm5lcldyYXBwZXI+XG4gICAgPC9DZWxsPlxuICApO1xufTtcblxuZXhwb3J0IGNvbnN0IEJvZHlDZWxsID0gQm9keUNlbGxDb21wb25lbnQ7XG4iXX0= */"], rowSpan: cellRowSpan, colSpan: cellColSpan, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, ...restAdditionalCellProps, scope: rowScope, isHovered, isRowSelected, children: /* @__PURE__ */ jsxs(CellInnerWrapper, { ...prefixNode ? {
|
|
107
|
+
"data-indent-level": intent,
|
|
108
|
+
css: getCellInnerWrapperStyle(indentSize, intent)(theme)
|
|
109
|
+
} : {}, children: [
|
|
110
|
+
prefixNode,
|
|
111
|
+
children
|
|
112
|
+
] }) });
|
|
113
|
+
};
|
|
114
|
+
const BodyCell = BodyCellComponent;
|
|
115
|
+
export {
|
|
116
|
+
BodyCell
|
|
117
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TableTokens } from 'components/Table/Table.tokens';
|
|
2
|
+
import { BorderedConfig } from 'components/Table/Table.types';
|
|
3
|
+
import { Theme } from 'themes';
|
|
4
|
+
export declare const getCellInnerWrapperStyle: (indentSize: number, intent: number) => (theme: Theme) => {
|
|
5
|
+
display: string;
|
|
6
|
+
columnGap: 4;
|
|
7
|
+
marginLeft: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const bodyCellStyle: (tableTokens: TableTokens) => {
|
|
10
|
+
borderColor: "#E5E5E5";
|
|
11
|
+
backgroundColor: "#FFFFFF";
|
|
12
|
+
};
|
|
13
|
+
export declare const getBorderedBodyCellStyle: (borderedConfig: Required<BorderedConfig>) => {
|
|
14
|
+
":last-of-type": {
|
|
15
|
+
borderInlineEndWidth: number;
|
|
16
|
+
};
|
|
17
|
+
":first-of-type"?: {
|
|
18
|
+
borderInlineStartWidth: number;
|
|
19
|
+
} | undefined;
|
|
20
|
+
borderInlineEndWidth: number;
|
|
21
|
+
};
|
|
22
|
+
export declare const nonHeaderBorderedBodyCellStyle: (tableTokens: TableTokens) => {
|
|
23
|
+
"tr:first-of-type > &": {
|
|
24
|
+
paddingTop: number;
|
|
25
|
+
borderTopWidth: number;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
const getCellInnerWrapperStyle = (indentSize, intent) => (theme) => ({
|
|
2
|
+
display: "flex",
|
|
3
|
+
columnGap: theme.spaceXS,
|
|
4
|
+
marginLeft: indentSize * intent
|
|
5
|
+
});
|
|
6
|
+
const bodyCellStyle = (tableTokens) => ({
|
|
7
|
+
borderColor: tableTokens.tableRowBorder,
|
|
8
|
+
backgroundColor: tableTokens.tableRowBg
|
|
9
|
+
});
|
|
10
|
+
const getBorderedBodyCellStyle = (borderedConfig) => ({
|
|
11
|
+
borderInlineEndWidth: 1,
|
|
12
|
+
...borderedConfig.firstColumnCellInlineStart ? {
|
|
13
|
+
":first-of-type": {
|
|
14
|
+
borderInlineStartWidth: 1
|
|
15
|
+
}
|
|
16
|
+
} : {},
|
|
17
|
+
":last-of-type": {
|
|
18
|
+
borderInlineEndWidth: borderedConfig.lastColumnCellInlineEnd ? 1 : 0
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
const nonHeaderBorderedBodyCellStyle = (tableTokens) => ({
|
|
22
|
+
"tr:first-of-type > &": {
|
|
23
|
+
paddingTop: tableTokens.tableCellPaddingVertical - 1,
|
|
24
|
+
borderTopWidth: 1
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
export {
|
|
28
|
+
bodyCellStyle,
|
|
29
|
+
getBorderedBodyCellStyle,
|
|
30
|
+
getCellInnerWrapperStyle,
|
|
31
|
+
nonHeaderBorderedBodyCellStyle
|
|
32
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Column } from 'components/Table/interfaces/tableColumns.types';
|
|
2
|
+
import { Key } from 'components/Table/Table.types';
|
|
3
|
+
export interface BodyCellProps<Record> {
|
|
4
|
+
column: Column<Record>;
|
|
5
|
+
record: Record;
|
|
6
|
+
index: number;
|
|
7
|
+
colIndex: number;
|
|
8
|
+
rowKey: Key;
|
|
9
|
+
intent: number;
|
|
10
|
+
renderIndex: number;
|
|
11
|
+
isRowSelected: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
4
|
+
const BodyColGroupComponent = () => {
|
|
5
|
+
const {
|
|
6
|
+
tableLayout,
|
|
7
|
+
flattedColumns
|
|
8
|
+
} = useTableContext();
|
|
9
|
+
const flattedColumnsLength = flattedColumns.length;
|
|
10
|
+
const cols = useMemo(() => {
|
|
11
|
+
const result = [];
|
|
12
|
+
let mustInsert = false;
|
|
13
|
+
for (let i = flattedColumnsLength - 1; i >= 0; i -= 1) {
|
|
14
|
+
const column = flattedColumns[i];
|
|
15
|
+
const width = column.width;
|
|
16
|
+
let minWidth;
|
|
17
|
+
if (column && tableLayout === "auto") {
|
|
18
|
+
minWidth = column.minWidth;
|
|
19
|
+
}
|
|
20
|
+
if (width || minWidth || mustInsert) {
|
|
21
|
+
result.unshift(/* @__PURE__ */ jsx("col", { style: {
|
|
22
|
+
width,
|
|
23
|
+
minWidth
|
|
24
|
+
} }, i));
|
|
25
|
+
mustInsert = true;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}, [flattedColumns, flattedColumnsLength, tableLayout]);
|
|
30
|
+
return cols.length > 0 && /* @__PURE__ */ jsx("colgroup", { children: cols });
|
|
31
|
+
};
|
|
32
|
+
const BodyColGroup = BodyColGroupComponent;
|
|
33
|
+
export {
|
|
34
|
+
BodyColGroup
|
|
35
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { BodyRowProps } from './BodyRow.types';
|
|
2
|
+
import { DefaultRecord } from 'components/Table/Table.types';
|
|
3
|
+
export declare const BodyRow: import('react').MemoExoticComponent<(<Record extends DefaultRecord>(props: BodyRowProps<Record>) => import("@emotion/react/jsx-runtime").JSX.Element)>;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { memo, useState } from "react";
|
|
3
|
+
import { BodyCell } from "../BodyCell/BodyCell.js";
|
|
4
|
+
import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
5
|
+
import { useTableStaticContext } from "../../../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
|
|
6
|
+
import { getRefValue } from "../../../../utils/ref/ref.js";
|
|
7
|
+
import { useSubscribe } from "../../../../features/typedEventBus/hooks.js";
|
|
8
|
+
const BodyRowComponent = (props) => {
|
|
9
|
+
const {
|
|
10
|
+
record,
|
|
11
|
+
index,
|
|
12
|
+
rowKey,
|
|
13
|
+
intent,
|
|
14
|
+
renderIndex
|
|
15
|
+
} = props;
|
|
16
|
+
const {
|
|
17
|
+
getComponent,
|
|
18
|
+
flattedColumns,
|
|
19
|
+
onRow
|
|
20
|
+
} = useTableContext();
|
|
21
|
+
const staticContextRef = useTableStaticContext();
|
|
22
|
+
const BodyRowComponent2 = getComponent(["body", "row"], "tr");
|
|
23
|
+
const [isRowSelected, setRowSelected] = useState(() => {
|
|
24
|
+
const staticSelectedKeySet = getRefValue(staticContextRef, "staticSelectedKeySet");
|
|
25
|
+
return staticSelectedKeySet.has(rowKey);
|
|
26
|
+
});
|
|
27
|
+
useSubscribe("row:select", (value) => {
|
|
28
|
+
const {
|
|
29
|
+
selectedKeySet
|
|
30
|
+
} = value;
|
|
31
|
+
setRowSelected(selectedKeySet.has(rowKey));
|
|
32
|
+
}, false, [rowKey]);
|
|
33
|
+
const rowProps = onRow == null ? void 0 : onRow(record, index);
|
|
34
|
+
return /* @__PURE__ */ jsx(BodyRowComponent2, { ...rowProps, "data-row-key": rowKey, children: flattedColumns.map((column, colIndex) => {
|
|
35
|
+
return /* @__PURE__ */ jsx(BodyCell, { colIndex, column, record, index, rowKey, intent, renderIndex, isRowSelected }, colIndex);
|
|
36
|
+
}) });
|
|
37
|
+
};
|
|
38
|
+
const BodyRow = memo(BodyRowComponent);
|
|
39
|
+
export {
|
|
40
|
+
BodyRow
|
|
41
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useRef, useLayoutEffect } from "react";
|
|
3
|
+
import ResizeObserver from "rc-resize-observer";
|
|
4
|
+
import { measureCellStyle, titleWrapperStyle } from "./MeasureCell.styles.js";
|
|
5
|
+
import { useTableStaticContext } from "../../../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
|
|
6
|
+
import { getRefValue } from "../../../../utils/ref/ref.js";
|
|
7
|
+
const MeasureCellComponent = (props) => {
|
|
8
|
+
const {
|
|
9
|
+
columnKey,
|
|
10
|
+
title
|
|
11
|
+
} = props;
|
|
12
|
+
const staticContextRef = useTableStaticContext();
|
|
13
|
+
const tdRef = useRef(null);
|
|
14
|
+
useLayoutEffect(() => {
|
|
15
|
+
const td = tdRef.current;
|
|
16
|
+
const colsWidthsMap = getRefValue(staticContextRef, "colsWidthsMap");
|
|
17
|
+
if (!td) {
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
const {
|
|
21
|
+
width
|
|
22
|
+
} = td.getBoundingClientRect();
|
|
23
|
+
colsWidthsMap.set(columnKey, width);
|
|
24
|
+
return () => {
|
|
25
|
+
colsWidthsMap.delete(columnKey);
|
|
26
|
+
};
|
|
27
|
+
}, [columnKey, staticContextRef]);
|
|
28
|
+
return /* @__PURE__ */ jsx(ResizeObserver, { data: columnKey, children: /* @__PURE__ */ jsx("td", { ref: tdRef, css: measureCellStyle, children: /* @__PURE__ */ jsx("div", { css: titleWrapperStyle, children: title }) }) });
|
|
29
|
+
};
|
|
30
|
+
const MeasureCell = MeasureCellComponent;
|
|
31
|
+
export {
|
|
32
|
+
MeasureCell
|
|
33
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useMemo, useCallback, useLayoutEffect, useRef } from "react";
|
|
3
|
+
import { MeasureCell } from "../MeasureCell/MeasureCell.js";
|
|
4
|
+
import ResizeObserver from "rc-resize-observer";
|
|
5
|
+
import { useEvent } from "../../../../../../hooks/useEvent/useEvent.js";
|
|
6
|
+
import { getColumnsKeys } from "./MeasureRow.utils.js";
|
|
7
|
+
import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
8
|
+
import { useTableStaticContext } from "../../../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
|
|
9
|
+
import { useEmitter } from "../../../../features/typedEventBus/hooks.js";
|
|
10
|
+
import { getRefValue, updateRefValue } from "../../../../utils/ref/ref.js";
|
|
11
|
+
const MeasureRowComponent = () => {
|
|
12
|
+
const {
|
|
13
|
+
flattedColumns
|
|
14
|
+
} = useTableContext();
|
|
15
|
+
const staticContextRef = useTableStaticContext();
|
|
16
|
+
const emitTableVisualParamsChange = useEvent(useEmitter("table-visual-params:change"));
|
|
17
|
+
const colsKeys = useMemo(() => getColumnsKeys(flattedColumns), [flattedColumns]);
|
|
18
|
+
const updateMeasureCellsInfo = useCallback((resizeInfo) => {
|
|
19
|
+
const colsWidthsMap = getRefValue(staticContextRef, "colsWidthsMap");
|
|
20
|
+
resizeInfo.forEach(({
|
|
21
|
+
data,
|
|
22
|
+
size
|
|
23
|
+
}) => {
|
|
24
|
+
const {
|
|
25
|
+
offsetWidth
|
|
26
|
+
} = size;
|
|
27
|
+
if (!colsWidthsMap.has(data)) {
|
|
28
|
+
colsWidthsMap.set(data, offsetWidth);
|
|
29
|
+
}
|
|
30
|
+
if (offsetWidth !== colsWidthsMap.get(data)) {
|
|
31
|
+
colsWidthsMap.set(data, offsetWidth);
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const colWidths = colsKeys.map((columnKey) => colsWidthsMap.get(columnKey) ?? -1);
|
|
35
|
+
const columnCount = flattedColumns.length;
|
|
36
|
+
const getOffsets = (startIndex, endIndex, offset) => {
|
|
37
|
+
const offsets = [];
|
|
38
|
+
let total = 0;
|
|
39
|
+
for (let i = startIndex; i !== endIndex; i += offset) {
|
|
40
|
+
offsets.push(total);
|
|
41
|
+
if (flattedColumns[i].fixed) {
|
|
42
|
+
total += colWidths[i] || 0;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return offsets;
|
|
46
|
+
};
|
|
47
|
+
const startOffsets = getOffsets(0, columnCount, 1);
|
|
48
|
+
const endOffsets = getOffsets(columnCount - 1, -1, -1).reverse();
|
|
49
|
+
const measureCellsInfo = {
|
|
50
|
+
start: startOffsets,
|
|
51
|
+
end: endOffsets,
|
|
52
|
+
widths: colWidths
|
|
53
|
+
};
|
|
54
|
+
updateRefValue(staticContextRef, {
|
|
55
|
+
measureCellsInfo
|
|
56
|
+
});
|
|
57
|
+
return measureCellsInfo;
|
|
58
|
+
}, [colsKeys, flattedColumns, staticContextRef]);
|
|
59
|
+
useLayoutEffect(() => {
|
|
60
|
+
const isTableFirstMount = getRefValue(staticContextRef, "isTableFirstMount");
|
|
61
|
+
const measureCellsInfo = updateMeasureCellsInfo([]);
|
|
62
|
+
if (isTableFirstMount) {
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
emitTableVisualParamsChange({
|
|
66
|
+
measureCellsInfo
|
|
67
|
+
});
|
|
68
|
+
}, [emitTableVisualParamsChange, staticContextRef, updateMeasureCellsInfo]);
|
|
69
|
+
const firstCallRef = useRef(true);
|
|
70
|
+
const handleBatchResize = useCallback((resizeInfo) => {
|
|
71
|
+
if (firstCallRef.current) {
|
|
72
|
+
firstCallRef.current = false;
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
const measureCellsInfo = updateMeasureCellsInfo(resizeInfo);
|
|
76
|
+
emitTableVisualParamsChange({
|
|
77
|
+
measureCellsInfo
|
|
78
|
+
});
|
|
79
|
+
}, [emitTableVisualParamsChange, updateMeasureCellsInfo]);
|
|
80
|
+
return /* @__PURE__ */ jsx("tr", { "aria-hidden": "true", children: /* @__PURE__ */ jsx(ResizeObserver.Collection, { onBatchResize: handleBatchResize, children: flattedColumns.map((flattedColumn) => {
|
|
81
|
+
return /* @__PURE__ */ jsx(MeasureCell, { columnKey: flattedColumn.key, title: flattedColumn.title }, flattedColumn.key);
|
|
82
|
+
}) }) });
|
|
83
|
+
};
|
|
84
|
+
const MeasureRow = MeasureRowComponent;
|
|
85
|
+
export {
|
|
86
|
+
MeasureRow
|
|
87
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { getCellStyle, getCellBackgroundStyle, ellipsisStyle } from "./Cell.styles.js";
|
|
3
|
+
const CellComponent = (props) => {
|
|
4
|
+
const {
|
|
5
|
+
component: Component,
|
|
6
|
+
colSpan,
|
|
7
|
+
rowSpan,
|
|
8
|
+
children,
|
|
9
|
+
isHovered,
|
|
10
|
+
isRowSelected,
|
|
11
|
+
align,
|
|
12
|
+
bordered,
|
|
13
|
+
tableTokens,
|
|
14
|
+
ellipsis,
|
|
15
|
+
...rest
|
|
16
|
+
} = props;
|
|
17
|
+
if (colSpan === 0 || rowSpan === 0) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsx(Component, { colSpan: colSpan === 1 ? void 0 : colSpan, rowSpan: rowSpan === 1 ? void 0 : rowSpan, ...rest, css: [getCellStyle(tableTokens, bordered), getCellBackgroundStyle(tableTokens, isRowSelected, isHovered), ellipsis ? ellipsisStyle : void 0, process.env.NODE_ENV === "production" ? "" : ";label:CellComponent;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9DZWxsL0NlbGwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTRCTSIsImZpbGUiOiIvYnVpbGRzL2Zyb250ZW5kL2xpYnMvdWkta2l0L3NyYy9jb21wb25lbnRzL1RhYmxlL2NvbXBvbmVudH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AgICAgICBlbGxpcHNpcyA/IGVsbGlwc2lzU3R5bGUgOiB1bmRlZmluZWQsXG4gICAgICBdfVxuICAgID5cbiAgICAgIHtjaGlsZHJlbn1cbiAgICA8L0NvbXBvbmVudD5cbiAgKTtcbn07XG5cbmV4cG9ydCBjb25zdCBDZWxsID0gQ2VsbENvbXBvbmVudDtcbiJdfQ== */"], children });
|
|
21
|
+
};
|
|
22
|
+
const Cell = CellComponent;
|
|
23
|
+
export {
|
|
24
|
+
Cell
|
|
25
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { TableTokens } from 'components/Table/Table.tokens';
|
|
2
|
+
import { BorderedConfig } from 'components/Table/Table.types';
|
|
3
|
+
export declare const getCellStyle: (tableTokens: TableTokens, bordered?: false | Required<BorderedConfig>) => {
|
|
4
|
+
readonly boxSizing: "border-box";
|
|
5
|
+
readonly padding: 0;
|
|
6
|
+
readonly borderWidth: 0;
|
|
7
|
+
readonly borderStyle: "solid";
|
|
8
|
+
readonly borderBottomWidth: 1;
|
|
9
|
+
readonly paddingTop: 8;
|
|
10
|
+
readonly paddingBottom: number;
|
|
11
|
+
readonly paddingInline: number;
|
|
12
|
+
readonly ":first-of-type": {
|
|
13
|
+
readonly paddingInlineStart: number;
|
|
14
|
+
};
|
|
15
|
+
readonly ":last-of-type": {
|
|
16
|
+
readonly paddingInlineEnd: number;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const getCellBackgroundStyle: (tableTokens: TableTokens, isRowSelected: boolean | undefined, isHovered: boolean | undefined) => {
|
|
20
|
+
"&": {
|
|
21
|
+
backgroundColor: "#F0F0F0" | "#C3F4ED" | "#E1FAF6" | undefined;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare const ellipsisStyle: {
|
|
25
|
+
textOverflow: string;
|
|
26
|
+
whiteSpace: string;
|
|
27
|
+
overflow: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const getCellStyle = (tableTokens, bordered) => ({
|
|
2
|
+
boxSizing: "border-box",
|
|
3
|
+
padding: 0,
|
|
4
|
+
borderWidth: 0,
|
|
5
|
+
borderStyle: "solid",
|
|
6
|
+
borderBottomWidth: 1,
|
|
7
|
+
paddingTop: tableTokens.tableCellPaddingVertical,
|
|
8
|
+
paddingBottom: tableTokens.tableCellPaddingVertical - 1,
|
|
9
|
+
paddingInline: bordered ? tableTokens.tableCellPaddingHorizontal - 1 : tableTokens.tableCellPaddingHorizontal,
|
|
10
|
+
":first-of-type": {
|
|
11
|
+
paddingInlineStart: bordered && bordered.firstColumnCellInlineStart ? tableTokens.tableCellPaddingHorizontal - 1 : tableTokens.tableCellPaddingHorizontal
|
|
12
|
+
},
|
|
13
|
+
":last-of-type": {
|
|
14
|
+
paddingInlineEnd: bordered && bordered.lastColumnCellInlineEnd ? tableTokens.tableCellPaddingHorizontal - 1 : tableTokens.tableCellPaddingHorizontal
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const getCellBackgroundStyle = (tableTokens, isRowSelected, isHovered) => ({
|
|
18
|
+
"&": {
|
|
19
|
+
backgroundColor: isRowSelected && isHovered ? tableTokens.tableRowSelectedBgHover : isRowSelected ? tableTokens.tableRowSelectedBg : isHovered ? tableTokens.tableRowBgHover : void 0
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const ellipsisStyle = {
|
|
23
|
+
textOverflow: "ellipsis",
|
|
24
|
+
whiteSpace: "nowrap",
|
|
25
|
+
overflow: "hidden"
|
|
26
|
+
};
|
|
27
|
+
export {
|
|
28
|
+
ellipsisStyle,
|
|
29
|
+
getCellBackgroundStyle,
|
|
30
|
+
getCellStyle
|
|
31
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ComponentType, CSSProperties, PropsWithChildren, TdHTMLAttributes, ThHTMLAttributes } from 'react';
|
|
2
|
+
import { CellEllipsisType, ScopeType } from '../../interfaces/tableColumns.types';
|
|
3
|
+
import { TableTokens } from 'components/Table/Table.tokens';
|
|
4
|
+
import { BorderedConfig } from 'components/Table/Table.types';
|
|
5
|
+
export interface CellProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, "align">, Omit<TdHTMLAttributes<HTMLTableCellElement>, "align">, PropsWithChildren {
|
|
6
|
+
component: "th" | "td" | ComponentType<JSX.IntrinsicElements["td"] | JSX.IntrinsicElements["th"]>;
|
|
7
|
+
colSpan?: number;
|
|
8
|
+
rowSpan?: number;
|
|
9
|
+
scope?: ScopeType;
|
|
10
|
+
isHovered?: boolean;
|
|
11
|
+
isRowSelected?: boolean;
|
|
12
|
+
align?: CSSProperties["textAlign"];
|
|
13
|
+
ellipsis?: CellEllipsisType;
|
|
14
|
+
bordered?: false | Required<BorderedConfig>;
|
|
15
|
+
tableTokens: TableTokens;
|
|
16
|
+
}
|