@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,69 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useContext, useState, useMemo } from "react";
|
|
3
|
+
import { isUndefined, isObject, isNumber } from "lodash-es";
|
|
4
|
+
import { getCellStyle, getBorderedCellStyle, emptyWrapperStyle } from "./EmptyDataRow.styles.js";
|
|
5
|
+
import { getEndRangeInfo } from "./EmptyDataRow.utils.js";
|
|
6
|
+
import { ConfigContext } from "../../../ConfigProvider/contexts/ConfigContext.js";
|
|
7
|
+
import { useTableContext } from "../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
8
|
+
import { useTableStaticContext } from "../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
|
|
9
|
+
import { getRefValue } from "../../utils/ref/ref.js";
|
|
10
|
+
import { useSubscribe } from "../../features/typedEventBus/hooks.js";
|
|
11
|
+
import { Empty } from "../../../Empty/Empty.js";
|
|
12
|
+
const EmptyDataRowComponent = () => {
|
|
13
|
+
const {
|
|
14
|
+
renderEmpty
|
|
15
|
+
} = useContext(ConfigContext);
|
|
16
|
+
const {
|
|
17
|
+
flattedColumns,
|
|
18
|
+
bordered,
|
|
19
|
+
tableTokens,
|
|
20
|
+
horizonScroll
|
|
21
|
+
} = useTableContext();
|
|
22
|
+
const staticContextRef = useTableStaticContext();
|
|
23
|
+
const [clientWidth, setClientWidth] = useState(() => {
|
|
24
|
+
const clientWidth2 = getRefValue(staticContextRef, "scrollableTableSectionInfo.clientWidth");
|
|
25
|
+
const verticalScrollBarWidth = getRefValue(staticContextRef, "scrollableTableSectionInfo.verticalScrollBarWidth");
|
|
26
|
+
const {
|
|
27
|
+
hasEndRange
|
|
28
|
+
} = getEndRangeInfo(staticContextRef);
|
|
29
|
+
return hasEndRange ? clientWidth2 + verticalScrollBarWidth : void 0;
|
|
30
|
+
});
|
|
31
|
+
const [cellOverflowX, setCellOverflowX] = useState(() => {
|
|
32
|
+
const {
|
|
33
|
+
hasEndRange
|
|
34
|
+
} = getEndRangeInfo(staticContextRef);
|
|
35
|
+
return hasEndRange ? void 0 : "hidden";
|
|
36
|
+
});
|
|
37
|
+
useSubscribe("table-visual-params:change", (value) => {
|
|
38
|
+
const {
|
|
39
|
+
clientWidth: clientWidth2,
|
|
40
|
+
horizontalScrollPositionRange
|
|
41
|
+
} = value;
|
|
42
|
+
if (isUndefined(clientWidth2) || !horizontalScrollPositionRange) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
const {
|
|
46
|
+
hasEndRange
|
|
47
|
+
} = getEndRangeInfo(horizontalScrollPositionRange);
|
|
48
|
+
setClientWidth(hasEndRange ? clientWidth2 : void 0);
|
|
49
|
+
setCellOverflowX(hasEndRange ? void 0 : "hidden");
|
|
50
|
+
}, false, [], true);
|
|
51
|
+
const empty = useMemo(() => {
|
|
52
|
+
if (renderEmpty) {
|
|
53
|
+
return renderEmpty();
|
|
54
|
+
}
|
|
55
|
+
return /* @__PURE__ */ jsx(Empty, {});
|
|
56
|
+
}, [renderEmpty]);
|
|
57
|
+
const hasInlineBorder = Boolean(bordered && bordered.emptyInline);
|
|
58
|
+
const hasBlockEndBorder = !isObject(bordered) || Boolean(bordered && bordered.emptyBlockEnd);
|
|
59
|
+
return /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { css: [cellOverflowX ? {
|
|
60
|
+
overflowX: cellOverflowX
|
|
61
|
+
} : void 0, getCellStyle(tableTokens, hasBlockEndBorder), bordered ? getBorderedCellStyle(hasInlineBorder) : void 0, process.env.NODE_ENV === "production" ? "" : ";label:EmptyDataRowComponent;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9FbXB0eURhdGFSb3cvRW1wdHlEYXRhUm93LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFrRVEiLCJmaWxlIjoiL2J1aWxkcy9mcm9udGVuZC9saWJzL3VpLWtpdC9zcmMvY29tcG9uZW50cy9UYWJsZS9jb21wb25lbnRzL0VtcHR5RGF0YVJvdy9FbXB0eURhdGFSb3cudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgdXNlQ29udGV4dCwgdXNlTWVtbywgdXNlU3RhdGUsIHR5cGUgQ1NTUHJvcGVydGllcywgdHlwZSBGQyB9I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FbmQpO1xuXG4gIHJldHVybiAoXG4gICAgPHRyPlxuICAgICAgPHRkXG4gICAgICAgIGNzcz17W1xuICAgICAgICAgIGNlbGxPdmVyZmxvd1ggPyB7IG92ZXJmbG93WDogY2VsbE92ZXJmbG93WCB9IDogdW5kZWZpbmVkLFxuICAgICAgICAgIGdldENlbGxTdHlsZSh0YWJsZVRva2VucywgaGFzQmxvY2tFbmRCb3JkZXIpLFxuICAgICAgICAgIGJvcmRlcmVkID8gZ2V0Qm9yZGVyZWRDZWxsU3R5bGUoaGFzSW5saW5lQm9yZGVyKSA6IHVuZGVmaW5lZCxcbiAgICAgICAgXX1cbiAgICAgICAgY29sU3Bhbj17ZmxhdHRlZENvbHVtbnMubGVuZ3RofVxuICAgICAgPlxuICAgICAgICA8ZGl2XG4gICAgICAgICAgc3R5bGU9e1xuICAgICAgICAgICAgaG9yaXpvblNjcm9sbFxuICAgICAgICAgICAgICA/IHtcbiAgICAgICAgICAgICAgICAgIHdpZHRoOlxuICAgICAgICAgICAgICAgICAgICBpc051bWJlcihjbGllbnRXaWR0aCkgJiYgY2xpZW50V2lkdGggPiAwICYmIGhhc0lubGluZUJvcmRlclxuICAgICAgICAgICAgICAgICAgICAgID8gY2xpZW50V2lkdGggLSAyXG4gICAgICAgICAgICAgICAgICAgICAgOiBjbGllbnRXaWR0aCxcbiAgICAgICAgICAgICAgICAgIGxlZnQ6IGhhc0lubGluZUJvcmRlciA/IDEgOiAwLFxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgOiB1bmRlZmluZWRcbiAgICAgICAgICB9XG4gICAgICAgICAgY3NzPXtob3Jpem9uU2Nyb2xsID8gZW1wdHlXcmFwcGVyU3R5bGUgOiB1bmRlZmluZWR9XG4gICAgICAgID5cbiAgICAgICAgICB7ZW1wdHl9XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC90ZD5cbiAgICA8L3RyPlxuICApO1xufTtcblxuZXhwb3J0IGNvbnN0IEVtcHR5RGF0YVJvdyA9IEVtcHR5RGF0YVJvd0NvbXBvbmVudDtcbiJdfQ== */"], colSpan: flattedColumns.length, children: /* @__PURE__ */ jsx("div", { style: horizonScroll ? {
|
|
62
|
+
width: isNumber(clientWidth) && clientWidth > 0 && hasInlineBorder ? clientWidth - 2 : clientWidth,
|
|
63
|
+
left: hasInlineBorder ? 1 : 0
|
|
64
|
+
} : void 0, css: horizonScroll ? emptyWrapperStyle : void 0, children: empty }) }) });
|
|
65
|
+
};
|
|
66
|
+
const EmptyDataRow = EmptyDataRowComponent;
|
|
67
|
+
export {
|
|
68
|
+
EmptyDataRow
|
|
69
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TableTokens } from 'components/Table/Table.tokens';
|
|
2
|
+
export declare const getCellStyle: (tableTokens: TableTokens, hasBlockEndBorder: boolean) => {
|
|
3
|
+
borderBlockEndWidth?: number | undefined;
|
|
4
|
+
padding: number;
|
|
5
|
+
borderStyle: string;
|
|
6
|
+
borderColor: "#E5E5E5";
|
|
7
|
+
borderWidth: number;
|
|
8
|
+
};
|
|
9
|
+
export declare const getBorderedCellStyle: (hasInlineBorder: boolean) => {
|
|
10
|
+
borderInlineStartWidth: number;
|
|
11
|
+
borderInlineEndWidth: number;
|
|
12
|
+
} | undefined;
|
|
13
|
+
export declare const emptyWrapperStyle: {
|
|
14
|
+
readonly position: "sticky";
|
|
15
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const getCellStyle = (tableTokens, hasBlockEndBorder) => ({
|
|
2
|
+
padding: 0,
|
|
3
|
+
borderStyle: "solid",
|
|
4
|
+
borderColor: tableTokens.tableRowBorder,
|
|
5
|
+
borderWidth: 0,
|
|
6
|
+
...hasBlockEndBorder ? {
|
|
7
|
+
borderBlockEndWidth: 1
|
|
8
|
+
} : {}
|
|
9
|
+
});
|
|
10
|
+
const getBorderedCellStyle = (hasInlineBorder) => {
|
|
11
|
+
if (!hasInlineBorder) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
borderInlineStartWidth: 1,
|
|
16
|
+
borderInlineEndWidth: 1
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
const emptyWrapperStyle = {
|
|
20
|
+
position: "sticky"
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
emptyWrapperStyle,
|
|
24
|
+
getBorderedCellStyle,
|
|
25
|
+
getCellStyle
|
|
26
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useTableStaticContext } from 'components/Table/features/tableStaticContext';
|
|
2
|
+
type TableStaticContextValue = ReturnType<typeof useTableStaticContext>;
|
|
3
|
+
type Range = TableStaticContextValue["current"]["scrollableTableSectionInfo"]["horizontalScrollPositionRange"];
|
|
4
|
+
export declare const getEndRangeInfo: (arg: Range | TableStaticContextValue) => {
|
|
5
|
+
hasEndRange: boolean;
|
|
6
|
+
};
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { getRefValue } from "../../utils/ref/ref.js";
|
|
2
|
+
const getEndRangeInfo = (arg) => {
|
|
3
|
+
let range;
|
|
4
|
+
if ("current" in arg) {
|
|
5
|
+
range = getRefValue(arg, "scrollableTableSectionInfo.horizontalScrollPositionRange");
|
|
6
|
+
} else {
|
|
7
|
+
range = arg;
|
|
8
|
+
}
|
|
9
|
+
const endRange = range[1];
|
|
10
|
+
const hasEndRange = endRange > 0;
|
|
11
|
+
return {
|
|
12
|
+
hasEndRange
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
getEndRangeInfo
|
|
17
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx, jsxs } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Header } from "../Header/Header.js";
|
|
4
|
+
import { FixedHeaderColGroup } from "./components/FixedHeaderColGroup/FixedHeaderColGroup.js";
|
|
5
|
+
import { getTableComponentWrapperStyle, getTableComponentStyle } from "../../Table.styles.js";
|
|
6
|
+
import { useTableContext } from "../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
7
|
+
const FixedHeaderComponent = (props, ref) => {
|
|
8
|
+
const {
|
|
9
|
+
scrollX,
|
|
10
|
+
onScroll
|
|
11
|
+
} = props;
|
|
12
|
+
const {
|
|
13
|
+
getComponent,
|
|
14
|
+
tableLayout
|
|
15
|
+
} = useTableContext();
|
|
16
|
+
const HeaderTableComponent = getComponent(["header", "table"], "table");
|
|
17
|
+
return /* @__PURE__ */ jsx("div", { className: "rc-table-header", ref, onScroll, css: getTableComponentWrapperStyle("header"), children: /* @__PURE__ */ jsxs(HeaderTableComponent, { css: getTableComponentStyle("header", tableLayout, scrollX, void 0), children: [
|
|
18
|
+
/* @__PURE__ */ jsx(FixedHeaderColGroup, {}),
|
|
19
|
+
/* @__PURE__ */ jsx(Header, { fixedHeader: true })
|
|
20
|
+
] }) });
|
|
21
|
+
};
|
|
22
|
+
const FixedHeader = forwardRef(FixedHeaderComponent);
|
|
23
|
+
export {
|
|
24
|
+
FixedHeader
|
|
25
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { isNumber } from "lodash-es";
|
|
4
|
+
import { useTableStaticContext } from "../../../../features/tableStaticContext/contexts/tableStaticContext/useTableStaticContext/useTableStaticContext.js";
|
|
5
|
+
import { getRefValue } from "../../../../utils/ref/ref.js";
|
|
6
|
+
import { useSubscribe } from "../../../../features/typedEventBus/hooks.js";
|
|
7
|
+
const FixedHeaderColGroupComponent = () => {
|
|
8
|
+
const staticContextRef = useTableStaticContext();
|
|
9
|
+
const [widths, setWidths] = useState(() => getRefValue(staticContextRef, "measureCellsInfo.widths"));
|
|
10
|
+
const [verticalScrollBarWidth, setVerticalScrollBarWidth] = useState(() => getRefValue(staticContextRef, "scrollableTableSectionInfo.verticalScrollBarWidth"));
|
|
11
|
+
useSubscribe("table-visual-params:change", (value) => {
|
|
12
|
+
const {
|
|
13
|
+
measureCellsInfo,
|
|
14
|
+
verticalScrollBarWidth: verticalScrollBarWidth2
|
|
15
|
+
} = value;
|
|
16
|
+
if (isNumber(verticalScrollBarWidth2)) {
|
|
17
|
+
setVerticalScrollBarWidth(verticalScrollBarWidth2);
|
|
18
|
+
}
|
|
19
|
+
if (measureCellsInfo) {
|
|
20
|
+
const {
|
|
21
|
+
widths: widths2
|
|
22
|
+
} = measureCellsInfo;
|
|
23
|
+
setWidths(widths2);
|
|
24
|
+
}
|
|
25
|
+
}, false, [], true);
|
|
26
|
+
return /* @__PURE__ */ jsx("colgroup", { children: widths.map((width, i, arr) => /* @__PURE__ */ jsx("col", { style: {
|
|
27
|
+
width: arr.length - 1 === i ? width + verticalScrollBarWidth : width
|
|
28
|
+
} }, i)) });
|
|
29
|
+
};
|
|
30
|
+
const FixedHeaderColGroup = FixedHeaderColGroupComponent;
|
|
31
|
+
export {
|
|
32
|
+
FixedHeaderColGroup
|
|
33
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { DefaultRecord } from 'components/Table/Table.types';
|
|
2
|
+
import { HeaderProps } from './Header.types';
|
|
3
|
+
export declare const Header: import('react').MemoExoticComponent<(<Record extends DefaultRecord>(props: HeaderProps) => import("@emotion/react/jsx-runtime").JSX.Element)>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { HeaderRow } from "./components/HeaderRow/HeaderRow.js";
|
|
4
|
+
import { tHeadStyle } from "./Header.styles.js";
|
|
5
|
+
import { useTableContext } from "../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
6
|
+
import { parseHeaderRows } from "./utils/parseHeaderRows/parseHeaderRows.js";
|
|
7
|
+
const HeaderComponent = (props) => {
|
|
8
|
+
const {
|
|
9
|
+
fixedHeader
|
|
10
|
+
} = props;
|
|
11
|
+
const {
|
|
12
|
+
getComponent,
|
|
13
|
+
columns,
|
|
14
|
+
tableTokens
|
|
15
|
+
} = useTableContext();
|
|
16
|
+
const HeaderWrapperComponent = getComponent(["header", "wrapper"], "thead");
|
|
17
|
+
const rows = useMemo(() => parseHeaderRows(columns), [columns]);
|
|
18
|
+
return /* @__PURE__ */ jsx(HeaderWrapperComponent, { css: tHeadStyle(tableTokens), className: "rc-table-thead", children: rows.map((row, rowIndex) => /* @__PURE__ */ jsx(HeaderRow, { index: rowIndex, cells: row, fixedHeader }, rowIndex)) });
|
|
19
|
+
};
|
|
20
|
+
const Header = memo(HeaderComponent);
|
|
21
|
+
export {
|
|
22
|
+
Header
|
|
23
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Column } from 'components/Table/interfaces/tableColumns.types';
|
|
2
|
+
import { DefaultRecord } from 'components/Table/Table.types';
|
|
3
|
+
export interface HeaderProps {
|
|
4
|
+
fixedHeader?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export interface HeaderCell<Record extends DefaultRecord> {
|
|
7
|
+
key: Column<Record>["key"];
|
|
8
|
+
hasSubColumns?: boolean;
|
|
9
|
+
children?: Column<Record>["title"];
|
|
10
|
+
column: Column<Record>;
|
|
11
|
+
rowSpan?: number;
|
|
12
|
+
colSpan: number;
|
|
13
|
+
colStart: number;
|
|
14
|
+
colEnd: number;
|
|
15
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Cell } from "../../../Cell/Cell.js";
|
|
3
|
+
import { useCellFixedInfo } from "../../../../hooks/useCellFixedInfo/useCellFixedInfo.js";
|
|
4
|
+
import { getFixedCellStyle } from "../../../../hooks/useCellFixedInfo/useCellFixedInfo.styles.js";
|
|
5
|
+
import { headerCellStyle, borderedHeaderCellStyle } from "./HeaderCell.styles.js";
|
|
6
|
+
import { getHeaderCellScope } from "./HeaderCell.utils.js";
|
|
7
|
+
import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
8
|
+
const HeaderCellComponent = (props) => {
|
|
9
|
+
var _a;
|
|
10
|
+
const {
|
|
11
|
+
cell
|
|
12
|
+
} = props;
|
|
13
|
+
const {
|
|
14
|
+
children,
|
|
15
|
+
colSpan: cellColSpan,
|
|
16
|
+
rowSpan: cellRowSpan,
|
|
17
|
+
colStart,
|
|
18
|
+
colEnd,
|
|
19
|
+
column
|
|
20
|
+
} = cell;
|
|
21
|
+
const {
|
|
22
|
+
getComponent,
|
|
23
|
+
bordered,
|
|
24
|
+
tableTokens
|
|
25
|
+
} = useTableContext();
|
|
26
|
+
const HeaderCellComponent2 = getComponent(["header", "cell"], "th");
|
|
27
|
+
const {
|
|
28
|
+
colSpan,
|
|
29
|
+
rowSpan,
|
|
30
|
+
css: headerCellCss,
|
|
31
|
+
...restAdditionalHeaderCellProps
|
|
32
|
+
} = ((_a = column.onHeaderCell) == null ? void 0 : _a.call(column, column)) || {};
|
|
33
|
+
const {
|
|
34
|
+
isFixStart,
|
|
35
|
+
isFixEnd,
|
|
36
|
+
fixStart,
|
|
37
|
+
fixEnd,
|
|
38
|
+
zIndexReverse,
|
|
39
|
+
fixedStartShadow,
|
|
40
|
+
fixedEndShadow,
|
|
41
|
+
showFixStartShadow,
|
|
42
|
+
showFixEndShadow
|
|
43
|
+
} = useCellFixedInfo({
|
|
44
|
+
colStart,
|
|
45
|
+
colEnd
|
|
46
|
+
});
|
|
47
|
+
return /* @__PURE__ */ jsx(Cell, { component: HeaderCellComponent2, align: column.align, ellipsis: column.ellipsis, bordered, tableTokens, css: [headerCellStyle(tableTokens), bordered ? borderedHeaderCellStyle(tableTokens, bordered) : void 0, ...getFixedCellStyle({
|
|
48
|
+
columnKey: column.key,
|
|
49
|
+
isFixStart,
|
|
50
|
+
isFixEnd,
|
|
51
|
+
fixStart,
|
|
52
|
+
fixEnd,
|
|
53
|
+
zIndexReverse,
|
|
54
|
+
fixedStartShadow,
|
|
55
|
+
fixedEndShadow,
|
|
56
|
+
showFixStartShadow,
|
|
57
|
+
showFixEndShadow
|
|
58
|
+
}), headerCellCss, process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9IZWFkZXIvY29tcG9uZW50cy9IZWFkZXJDZWxsL0hlYWRlckNlbGwudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJDTSIsImZpbGUiOiIvYnVpbGRzL2Zyb250ZW5kL2xpYnMvdWkta2l0L3NyYy9jb21wb25lbnRzL1RhYmxlL2NvbXBvbmVudHMvSGVhZGVyL2NvbXBvbmVudHMvSGVhZGVyQ2VsbC9IZWFkZXJDZWxsLnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgSGVhZGVyQ2VsbFByb3BzIH0gZnJvbSBcIi4vSGVhZGVyQ2VsbC50eXBlc1wiO1xuaW1wb3J0IHsgQ2VsbCB9IGZyb20gXCIuLi8uLi8uLi9DZWxsL0NlbGxcIjtcbmltcG9ydCB7IHVzZVRhYmxlQ29udGV4dCB9IGZyb20gXCJjb21wb25lbnRzL1RhYmxlL2NvbnRleHRzXCI7XG5pbXBvcnQgeyB1c2VDZWxsRml4ZWRJbmZvLCBnZXRGaXhlZENlbGxTdHlsZSB9IGZyb20gXCJjb21wb25lbnRzL1RhYmxlL2hvb2tzL3VzZUNlbGxGaXhlZEluZm9cIjtcbmltcG9ydCB0eXBlIHsgRGVmYXVsdFJlY29yZCB9IGZyb20gXCJjb21wb25lbnRzL1RhYmxlL1RhYmxlLnR5cGVzXCI7XG5pbXBvcnQgeyBib3JkZXJlZEhlYWRlckNlbGxTdHlsZSwgaGVhZGVyQ2VsbFN0eWxlIH0gZnJvbSBcI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e2dldEhlYWRlckNlbGxTY29wZShjb2x1bW4udGl0bGUsIGNlbGxDb2xTcGFuKX1cbiAgICA+XG4gICAgICB7Y2hpbGRyZW59XG4gICAgPC9DZWxsPlxuICApO1xufTtcblxuZXhwb3J0IGNvbnN0IEhlYWRlckNlbGwgPSBIZWFkZXJDZWxsQ29tcG9uZW50O1xuIl19 */"], ...restAdditionalHeaderCellProps, colSpan: colSpan ?? cellColSpan, rowSpan: rowSpan ?? cellRowSpan, scope: getHeaderCellScope(column.title, cellColSpan), children });
|
|
59
|
+
};
|
|
60
|
+
const HeaderCell = HeaderCellComponent;
|
|
61
|
+
export {
|
|
62
|
+
HeaderCell
|
|
63
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TableTokens } from 'components/Table/Table.tokens';
|
|
2
|
+
import { BorderedConfig } from 'components/Table/Table.types';
|
|
3
|
+
export declare const headerCellStyle: (tableTokens: TableTokens) => {
|
|
4
|
+
readonly fontWeight: 400;
|
|
5
|
+
readonly textAlign: "left";
|
|
6
|
+
readonly borderColor: "#D9D9D9";
|
|
7
|
+
readonly backgroundColor: "#FAFAFA";
|
|
8
|
+
};
|
|
9
|
+
export declare const borderedHeaderCellStyle: (tableTokens: TableTokens, borderedConfig: Required<BorderedConfig>) => {
|
|
10
|
+
"tr:first-of-type > &:last-of-type": {
|
|
11
|
+
borderInlineEndWidth: number;
|
|
12
|
+
};
|
|
13
|
+
"tr:first-of-type > &:first-of-type"?: {
|
|
14
|
+
borderInlineStartWidth: number;
|
|
15
|
+
} | undefined;
|
|
16
|
+
borderInlineEndWidth: number;
|
|
17
|
+
"tr:first-of-type > &": {
|
|
18
|
+
paddingTop: number;
|
|
19
|
+
borderTopWidth: number;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const headerCellStyle = (tableTokens) => ({
|
|
2
|
+
fontWeight: 400,
|
|
3
|
+
textAlign: "left",
|
|
4
|
+
borderColor: tableTokens.tableHeaderBorder,
|
|
5
|
+
backgroundColor: tableTokens.tableHeaderBg
|
|
6
|
+
});
|
|
7
|
+
const borderedHeaderCellStyle = (tableTokens, borderedConfig) => ({
|
|
8
|
+
borderInlineEndWidth: 1,
|
|
9
|
+
"tr:first-of-type > &": {
|
|
10
|
+
paddingTop: tableTokens.tableCellPaddingVertical - 1,
|
|
11
|
+
borderTopWidth: 1
|
|
12
|
+
},
|
|
13
|
+
...borderedConfig.firstColumnCellInlineStart ? {
|
|
14
|
+
"tr:first-of-type > &:first-of-type": {
|
|
15
|
+
borderInlineStartWidth: 1
|
|
16
|
+
}
|
|
17
|
+
} : {},
|
|
18
|
+
"tr:first-of-type > &:last-of-type": {
|
|
19
|
+
borderInlineEndWidth: borderedConfig.lastColumnCellInlineEnd ? 1 : 0
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
export {
|
|
23
|
+
borderedHeaderCellStyle,
|
|
24
|
+
headerCellStyle
|
|
25
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PropsWithChildren } from 'react';
|
|
2
|
+
import { DefaultRecord } from 'components/Table/Table.types';
|
|
3
|
+
import { HeaderCell } from '../../Header.types';
|
|
4
|
+
export interface HeaderCellProps<Record extends DefaultRecord> extends PropsWithChildren {
|
|
5
|
+
cell: HeaderCell<Record>;
|
|
6
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { HeaderCell } from "../HeaderCell/HeaderCell.js";
|
|
3
|
+
import { HeaderCellWithSort } from "../../../../features/tableSort/components/HeaderCellWithSort/HeaderCellWithSort.js";
|
|
4
|
+
import { flickeringFixStyle } from "./HeaderRow.styles.js";
|
|
5
|
+
import { useTableContext } from "../../../../contexts/tableContext/useTableContext/useTableContext.js";
|
|
6
|
+
const HeaderRowComponent = (props) => {
|
|
7
|
+
const {
|
|
8
|
+
cells,
|
|
9
|
+
index,
|
|
10
|
+
fixedHeader
|
|
11
|
+
} = props;
|
|
12
|
+
const {
|
|
13
|
+
getComponent,
|
|
14
|
+
onHeaderRow
|
|
15
|
+
} = useTableContext();
|
|
16
|
+
const HeaderRowComponent2 = getComponent(["header", "row"], "tr");
|
|
17
|
+
const {
|
|
18
|
+
css: headerRowCss,
|
|
19
|
+
...restRowProps
|
|
20
|
+
} = (onHeaderRow == null ? void 0 : onHeaderRow(cells.map((cell) => cell.column), index)) || {};
|
|
21
|
+
return /* @__PURE__ */ jsx(HeaderRowComponent2, { ...restRowProps, css: [fixedHeader && flickeringFixStyle, headerRowCss, process.env.NODE_ENV === "production" ? "" : ";label:HeaderRowComponent;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9IZWFkZXIvY29tcG9uZW50cy9IZWFkZXJSb3cvSGVhZGVyUm93LnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFtQjBDIiwiZmlsZSI6Ii9idWlsZHMvZnJvbnRlbmQvbGlicy91aS1raXQvc3JjL2NvbXBvbmVudHMvVGFibGUvY29tcG9uZW50cy9IZWFkZXIvY29tcG9uZW50cy9IZWFkZXJSb3cvSGVhZGVyUm93LnRzeCIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgSGVhZGVyUm93UHJvcHMgfSBmcm9tIFwiLi9IZWFkZXJSb3cudHlwZXNcIjtcbmltcG9ydCB7IEhlYWRlckNlbGwgfSBmcm9tIFwiLi4vSGVhZGVyQ2VsbC9IZWFkZXJDZWxsXCI7XG5pbXBvcnQgeyBIZWFkZXJDZWxsV2l0aFNvcnQgfSBmcm9tIFwiY29tcG9uZW50cy9UYWJsZS9mZWF0dXJlcy90YWJsZVNvcnQvY29tcG9uZW50cy9IZWFkZXJDZ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AgICAgIGNvbnN0IHsgY29sdW1uIH0gPSBjZWxsO1xuXG4gICAgICAgIGlmIChjb2x1bW4uc29ydGVyKSB7XG4gICAgICAgICAgcmV0dXJuIDxIZWFkZXJDZWxsV2l0aFNvcnQga2V5PXtjZWxsSW5kZXh9IGNlbGw9e2NlbGx9IC8+O1xuICAgICAgICB9XG5cbiAgICAgICAgcmV0dXJuIDxIZWFkZXJDZWxsIGtleT17Y2VsbEluZGV4fSBjZWxsPXtjZWxsfSAvPjtcbiAgICAgIH0pfVxuICAgIDwvSGVhZGVyUm93Q29tcG9uZW50PlxuICApO1xufTtcblxuZXhwb3J0IGNvbnN0IEhlYWRlclJvdyA9IEhlYWRlclJvd0NvbXBvbmVudDtcbiJdfQ== */"], children: cells.map((cell, cellIndex) => {
|
|
22
|
+
const {
|
|
23
|
+
column
|
|
24
|
+
} = cell;
|
|
25
|
+
if (column.sorter) {
|
|
26
|
+
return /* @__PURE__ */ jsx(HeaderCellWithSort, { cell }, cellIndex);
|
|
27
|
+
}
|
|
28
|
+
return /* @__PURE__ */ jsx(HeaderCell, { cell }, cellIndex);
|
|
29
|
+
}) });
|
|
30
|
+
};
|
|
31
|
+
const HeaderRow = HeaderRowComponent;
|
|
32
|
+
export {
|
|
33
|
+
HeaderRow
|
|
34
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { DefaultRecord } from 'components/Table/Table.types';
|
|
2
|
+
import { HeaderCell, HeaderProps } from '../../Header.types';
|
|
3
|
+
export interface HeaderRowProps<Record extends DefaultRecord> extends Pick<HeaderProps, "fixedHeader"> {
|
|
4
|
+
index: number;
|
|
5
|
+
cells: HeaderCell<Record>[];
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { parseHeaderRows } from './parseHeaderRows/parseHeaderRows';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Columns } from 'components/Table/interfaces/tableColumns.types';
|
|
2
|
+
import { DefaultRecord } from 'components/Table/Table.types';
|
|
3
|
+
import { HeaderCell } from '../../Header.types';
|
|
4
|
+
export declare function parseHeaderRows<Record extends DefaultRecord>(rootColumns: Columns<Record>): HeaderCell<Record>[][];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { isNumber } from "lodash-es";
|
|
2
|
+
function parseHeaderRows(rootColumns) {
|
|
3
|
+
const rows = [];
|
|
4
|
+
function fillRowCells(columns, colIndex, rowIndex = 0) {
|
|
5
|
+
rows[rowIndex] = rows[rowIndex] || [];
|
|
6
|
+
let currentColIndex = colIndex;
|
|
7
|
+
const colSpans = columns.map((column) => {
|
|
8
|
+
const cell = {
|
|
9
|
+
key: column.key,
|
|
10
|
+
column,
|
|
11
|
+
colStart: currentColIndex
|
|
12
|
+
};
|
|
13
|
+
if (column.title) {
|
|
14
|
+
cell.children = column.title;
|
|
15
|
+
}
|
|
16
|
+
let colSpan = 1;
|
|
17
|
+
const subColumns = "children" in column ? column.children : [];
|
|
18
|
+
if (subColumns.length > 0) {
|
|
19
|
+
colSpan = fillRowCells(subColumns, currentColIndex, rowIndex + 1).reduce((total, count) => total + count, 0);
|
|
20
|
+
cell.hasSubColumns = true;
|
|
21
|
+
}
|
|
22
|
+
if (isNumber(column.colSpan)) {
|
|
23
|
+
colSpan = column.colSpan;
|
|
24
|
+
}
|
|
25
|
+
if (isNumber(column.rowSpan)) {
|
|
26
|
+
cell.rowSpan = column.rowSpan;
|
|
27
|
+
}
|
|
28
|
+
cell.colSpan = colSpan;
|
|
29
|
+
cell.colEnd = cell.colStart + colSpan - 1;
|
|
30
|
+
rows[rowIndex].push(cell);
|
|
31
|
+
currentColIndex += colSpan;
|
|
32
|
+
return colSpan;
|
|
33
|
+
});
|
|
34
|
+
return colSpans;
|
|
35
|
+
}
|
|
36
|
+
fillRowCells(rootColumns, 0);
|
|
37
|
+
const rowCount = rows.length;
|
|
38
|
+
for (let rowIndex = 0; rowIndex < rowCount; rowIndex += 1) {
|
|
39
|
+
rows[rowIndex].forEach((cell) => {
|
|
40
|
+
if (isNumber(cell.rowSpan) || cell.hasSubColumns) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
cell.rowSpan = rowCount - rowIndex;
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
return rows;
|
|
47
|
+
}
|
|
48
|
+
export {
|
|
49
|
+
parseHeaderRows
|
|
50
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
import { once, identity } from "lodash-es";
|
|
3
|
+
const createTableContext = once(() => {
|
|
4
|
+
return createContext({
|
|
5
|
+
getComponent: identity,
|
|
6
|
+
columns: [],
|
|
7
|
+
flattedColumns: [],
|
|
8
|
+
isAllColumnsFixedStart: false,
|
|
9
|
+
expandIconColumnIndex: 0,
|
|
10
|
+
ExpandIcon: identity,
|
|
11
|
+
indentSize: 0,
|
|
12
|
+
isSomeRecordHasChildren: false,
|
|
13
|
+
sortDirections: [],
|
|
14
|
+
tableLayout: "auto",
|
|
15
|
+
tableTokens: {},
|
|
16
|
+
showHeader: true
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
export {
|
|
20
|
+
createTableContext
|
|
21
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { TableTokens } from 'components/Table/Table.tokens';
|
|
2
|
+
import { useTableExpand } from '../../features/tableExpand';
|
|
3
|
+
import { useTableColumns } from '../../hooks/useTableColumns';
|
|
4
|
+
import { useTableComponents } from '../../hooks/useTableComponents';
|
|
5
|
+
import { BorderedConfig, DefaultRecord, TableProps } from 'components/Table/Table.types';
|
|
6
|
+
type UseTableComponentsReturnType = ReturnType<typeof useTableComponents>;
|
|
7
|
+
type UseTableColumnsReturnType<Record extends DefaultRecord> = ReturnType<typeof useTableColumns<Record>>;
|
|
8
|
+
type UseTableExpandReturnType<Record extends DefaultRecord> = ReturnType<typeof useTableExpand<Record>>;
|
|
9
|
+
export interface TableContextValue<Record extends DefaultRecord> {
|
|
10
|
+
showHeader: TableProps<Record>["showHeader"];
|
|
11
|
+
tableTokens: TableTokens;
|
|
12
|
+
getComponent: UseTableComponentsReturnType["getComponent"];
|
|
13
|
+
columns: UseTableColumnsReturnType<Record>["columns"];
|
|
14
|
+
flattedColumns: UseTableColumnsReturnType<Record>["flattedColumns"];
|
|
15
|
+
isAllColumnsFixedStart: UseTableColumnsReturnType<Record>["isAllColumnsFixedStart"];
|
|
16
|
+
expandIconColumnIndex: UseTableExpandReturnType<Record>["expandIconColumnIndex"];
|
|
17
|
+
ExpandIcon: UseTableExpandReturnType<Record>["ExpandIcon"];
|
|
18
|
+
indentSize: UseTableExpandReturnType<Record>["indentSize"];
|
|
19
|
+
isSomeRecordHasChildren: UseTableExpandReturnType<Record>["isSomeRecordHasChildren"];
|
|
20
|
+
sortDirections: Exclude<TableProps["sortDirections"], undefined>;
|
|
21
|
+
tableLayout: Exclude<TableProps["tableLayout"], undefined>;
|
|
22
|
+
onHeaderRow?: TableProps<Record>["onHeaderRow"];
|
|
23
|
+
onRow?: TableProps<Record>["onRow"];
|
|
24
|
+
bordered?: false | Required<BorderedConfig>;
|
|
25
|
+
horizonScroll?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export {};
|