@synerise/ds-table 1.9.11 → 1.9.13
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/CHANGELOG.md +8 -0
- package/dist/Cell/Action/ActionCell.d.ts +2 -2
- package/dist/Cell/Action/ActionCell.js +15 -18
- package/dist/Cell/Action/ActionCell.styles.d.ts +2 -2
- package/dist/Cell/Action/ActionCell.styles.js +10 -11
- package/dist/Cell/Action/ActionCell.types.d.ts +2 -2
- package/dist/Cell/Action/ActionCell.types.js +1 -1
- package/dist/Cell/AvatarLabel/AvatarLabel.d.ts +2 -2
- package/dist/Cell/AvatarLabel/AvatarLabel.js +32 -43
- package/dist/Cell/AvatarLabel/AvatarLabel.styles.d.ts +13 -13
- package/dist/Cell/AvatarLabel/AvatarLabel.styles.js +27 -28
- package/dist/Cell/AvatarLabel/AvatarLabel.types.d.ts +2 -2
- package/dist/Cell/AvatarLabel/AvatarLabel.types.js +1 -1
- package/dist/Cell/Copyable/Copyable.styles.d.ts +2 -2
- package/dist/Cell/Copyable/Copyable.styles.js +9 -15
- package/dist/Cell/Copyable/Copyable.types.d.ts +1 -1
- package/dist/Cell/Copyable/Copyable.types.js +1 -1
- package/dist/Cell/Copyable/CopyableCell.d.ts +2 -2
- package/dist/Cell/Copyable/CopyableCell.js +23 -27
- package/dist/Cell/Editable/EditableCell.d.ts +2 -2
- package/dist/Cell/Editable/EditableCell.js +26 -39
- package/dist/Cell/Editable/EditableCell.styles.d.ts +2 -2
- package/dist/Cell/Editable/EditableCell.styles.js +9 -7
- package/dist/Cell/Editable/EditableCell.types.d.ts +1 -1
- package/dist/Cell/Editable/EditableCell.types.js +1 -1
- package/dist/Cell/FlagLabel/FlagLabelCell.d.ts +2 -2
- package/dist/Cell/FlagLabel/FlagLabelCell.js +15 -14
- package/dist/Cell/FlagLabel/FlagLabelCell.styles.d.ts +1 -1
- package/dist/Cell/FlagLabel/FlagLabelCell.styles.js +6 -3
- package/dist/Cell/FlagLabel/FlagLabelCell.types.d.ts +2 -2
- package/dist/Cell/FlagLabel/FlagLabelCell.types.js +1 -1
- package/dist/Cell/IconLabel/IconLabel.d.ts +2 -2
- package/dist/Cell/IconLabel/IconLabel.js +14 -15
- package/dist/Cell/IconLabel/IconLabel.styles.d.ts +1 -1
- package/dist/Cell/IconLabel/IconLabel.styles.js +7 -6
- package/dist/Cell/IconLabel/IconLabel.types.d.ts +3 -3
- package/dist/Cell/IconLabel/IconLabel.types.js +1 -1
- package/dist/Cell/IconTooltipCell/IconTooltipCell.d.ts +2 -2
- package/dist/Cell/IconTooltipCell/IconTooltipCell.js +18 -23
- package/dist/Cell/IconTooltipCell/IconTooltipCell.styles.d.ts +2 -2
- package/dist/Cell/IconTooltipCell/IconTooltipCell.styles.js +9 -11
- package/dist/Cell/IconTooltipCell/IconTooltipCell.types.d.ts +4 -4
- package/dist/Cell/IconTooltipCell/IconTooltipCell.types.js +1 -1
- package/dist/Cell/InputNumber/InputNumberCell.d.ts +2 -2
- package/dist/Cell/InputNumber/InputNumberCell.js +10 -17
- package/dist/Cell/InputNumber/InputNumberCell.styles.d.ts +1 -1
- package/dist/Cell/InputNumber/InputNumberCell.styles.js +9 -5
- package/dist/Cell/InputNumber/InputNumberCell.types.d.ts +2 -2
- package/dist/Cell/InputNumber/InputNumberCell.types.js +1 -1
- package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.d.ts +3 -3
- package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.js +29 -40
- package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.styles.d.ts +3 -3
- package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.styles.js +11 -8
- package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.types.d.ts +2 -2
- package/dist/Cell/LabelsWithShowMore/LabelsWithShowMore.types.js +1 -1
- package/dist/Cell/LabelsWithShowMore/Modal/Modal.d.ts +2 -2
- package/dist/Cell/LabelsWithShowMore/Modal/Modal.js +35 -64
- package/dist/Cell/LabelsWithShowMore/Modal/Modal.types.d.ts +3 -3
- package/dist/Cell/LabelsWithShowMore/Modal/Modal.types.js +1 -1
- package/dist/Cell/Star/StarCell.d.ts +45 -45
- package/dist/Cell/Star/StarCell.js +25 -31
- package/dist/Cell/Star/StarCell.styles.d.ts +2 -2
- package/dist/Cell/Star/StarCell.styles.js +11 -9
- package/dist/Cell/Star/StarCell.types.d.ts +2 -2
- package/dist/Cell/Star/StarCell.types.js +1 -1
- package/dist/Cell/StatusLabel/StatusLabel.d.ts +2 -2
- package/dist/Cell/StatusLabel/StatusLabel.js +17 -19
- package/dist/Cell/StatusLabel/StatusLabel.styles.d.ts +2 -2
- package/dist/Cell/StatusLabel/StatusLabel.styles.js +9 -9
- package/dist/Cell/StatusLabel/StatusLabel.types.d.ts +3 -3
- package/dist/Cell/StatusLabel/StatusLabel.types.js +1 -1
- package/dist/Cell/TagIcon/TagIcon.d.ts +2 -2
- package/dist/Cell/TagIcon/TagIcon.js +9 -13
- package/dist/Cell/TagIcon/TagIcon.styles.d.ts +1 -1
- package/dist/Cell/TagIcon/TagIcon.styles.js +7 -6
- package/dist/Cell/TagIcon/TagIcon.types.d.ts +2 -2
- package/dist/Cell/TagIcon/TagIcon.types.js +1 -1
- package/dist/Cell/TagsGroup/TagsGroup.d.ts +2 -2
- package/dist/Cell/TagsGroup/TagsGroup.js +22 -39
- package/dist/Cell/TagsGroup/TagsGroup.styles.d.ts +2 -2
- package/dist/Cell/TagsGroup/TagsGroup.styles.js +30 -9
- package/dist/Cell/TagsGroup/TagsGroup.types.d.ts +2 -2
- package/dist/Cell/TagsGroup/TagsGroup.types.js +1 -1
- package/dist/Cell/index.d.ts +12 -12
- package/dist/Cell/index.js +28 -14
- package/dist/ColumnSortMenu/SortIcons.d.ts +2 -2
- package/dist/ColumnSortMenu/SortIcons.js +26 -38
- package/dist/ColumnSortMenu/SortRender.styles.d.ts +34 -34
- package/dist/ColumnSortMenu/SortRender.styles.js +13 -10
- package/dist/ColumnSortMenu/SortRenderer.d.ts +2 -2
- package/dist/ColumnSortMenu/SortRenderer.js +74 -108
- package/dist/ColumnSortMenu/TitleWithSort.d.ts +2 -2
- package/dist/ColumnSortMenu/TitleWithSort.js +19 -16
- package/dist/ColumnSortMenu/columnWithSortButtons.d.ts +1 -2
- package/dist/ColumnSortMenu/columnWithSortButtons.js +26 -43
- package/dist/ColumnSortMenu/groupedColumnsSort.d.ts +3 -3
- package/dist/ColumnSortMenu/groupedColumnsSort.js +33 -28
- package/dist/ColumnSortMenu/replaceSortButtons.d.ts +1 -1
- package/dist/ColumnSortMenu/replaceSortButtons.js +14 -15
- package/dist/ColumnSortMenu/useSortState.d.ts +1 -1
- package/dist/ColumnSortMenu/useSortState.js +95 -93
- package/dist/DefaultTable/DefaultTable.d.ts +2 -2
- package/dist/DefaultTable/DefaultTable.js +147 -148
- package/dist/FilterTrigger/FilterTrigger.d.ts +2 -2
- package/dist/FilterTrigger/FilterTrigger.js +42 -67
- package/dist/FilterTrigger/FilterTrigger.styles.d.ts +53 -53
- package/dist/FilterTrigger/FilterTrigger.styles.js +19 -32
- package/dist/FilterTrigger/FilterTrigger.types.d.ts +1 -1
- package/dist/FilterTrigger/FilterTrigger.types.js +1 -1
- package/dist/GroupTable/GroupTable.d.ts +3 -4
- package/dist/GroupTable/GroupTable.js +97 -118
- package/dist/GroupTable/GroupTable.styles.d.ts +25 -25
- package/dist/GroupTable/GroupTable.styles.js +40 -37
- package/dist/GroupTable/GroupTable.types.d.ts +1 -1
- package/dist/GroupTable/GroupTable.types.js +9 -6
- package/dist/GroupTable/GroupTableBody/GroupTableBody.d.ts +1 -1
- package/dist/GroupTable/GroupTableBody/GroupTableBody.js +83 -107
- package/dist/GroupTable/GroupTableBody/GroupTableBody.types.d.ts +3 -3
- package/dist/GroupTable/GroupTableBody/GroupTableBody.types.js +1 -1
- package/dist/GroupTable/GroupTableHeader/GroupTableHeader.d.ts +1 -1
- package/dist/GroupTable/GroupTableHeader/GroupTableHeader.js +25 -28
- package/dist/GroupTable/GroupTableHeader/GroupTableHeader.types.js +1 -1
- package/dist/InfiniteScroll/BackToTopButton.d.ts +2 -2
- package/dist/InfiniteScroll/BackToTopButton.js +7 -15
- package/dist/InfiniteScroll/BackToTopButton.styles.d.ts +34 -34
- package/dist/InfiniteScroll/BackToTopButton.styles.js +11 -9
- package/dist/InfiniteScroll/ErrorItem.d.ts +1 -1
- package/dist/InfiniteScroll/ErrorItem.js +19 -23
- package/dist/InfiniteScroll/ErrorItem.styles.d.ts +1 -1
- package/dist/InfiniteScroll/ErrorItem.styles.js +6 -3
- package/dist/InfiniteScroll/InfiniteLoaderItem.d.ts +2 -2
- package/dist/InfiniteScroll/InfiniteLoaderItem.js +33 -28
- package/dist/InfiniteScroll/InfiniteLoaderItem.styles.d.ts +1 -1
- package/dist/InfiniteScroll/InfiniteLoaderItem.styles.js +7 -4
- package/dist/InfiniteScroll/InfiniteLoaderItem.types.d.ts +1 -1
- package/dist/InfiniteScroll/InfiniteLoaderItem.types.js +1 -1
- package/dist/InfiniteScroll/LoadingItem.d.ts +1 -1
- package/dist/InfiniteScroll/LoadingItem.js +10 -10
- package/dist/InfiniteScroll/NoMoreItem.d.ts +1 -1
- package/dist/InfiniteScroll/NoMoreItem.js +10 -10
- package/dist/InfiniteScroll/OuterListElement.d.ts +1 -1
- package/dist/InfiniteScroll/OuterListElement.js +45 -58
- package/dist/InfiniteScroll/constants.js +4 -1
- package/dist/InfiniteScroll/utils.d.ts +1 -1
- package/dist/InfiniteScroll/utils.js +15 -12
- package/dist/ItemsMenu/ItemsMenu.d.ts +2 -2
- package/dist/ItemsMenu/ItemsMenu.js +7 -6
- package/dist/ItemsMenu/ItemsMenu.styles.d.ts +1 -1
- package/dist/ItemsMenu/ItemsMenu.styles.js +6 -3
- package/dist/ItemsMenu/ItemsMenu.types.d.ts +1 -1
- package/dist/ItemsMenu/ItemsMenu.types.js +1 -1
- package/dist/RowSelection/RowSelectionColumn.d.ts +3 -3
- package/dist/RowSelection/RowSelectionColumn.js +77 -81
- package/dist/RowSelection/RowSelectionColumn.types.d.ts +3 -3
- package/dist/RowSelection/RowSelectionColumn.types.js +1 -1
- package/dist/RowSelection/index.js +4 -1
- package/dist/Table.d.ts +2 -4
- package/dist/Table.js +94 -129
- package/dist/Table.styles.d.ts +23 -23
- package/dist/Table.styles.js +86 -110
- package/dist/Table.types.d.ts +7 -7
- package/dist/Table.types.js +1 -1
- package/dist/TableHeader/TableHeader.d.ts +2 -2
- package/dist/TableHeader/TableHeader.js +91 -129
- package/dist/TableHeader/TableHeader.types.d.ts +2 -2
- package/dist/TableHeader/TableHeader.types.js +1 -1
- package/dist/TableHeader/TableLimit/TableLimit.d.ts +2 -2
- package/dist/TableHeader/TableLimit/TableLimit.js +44 -36
- package/dist/TableHeader/TableLimit/TableLimit.styles.d.ts +4 -4
- package/dist/TableHeader/TableLimit/TableLimit.styles.js +15 -13
- package/dist/TableHeader/TableLimit/TableLimit.types.d.ts +3 -3
- package/dist/TableHeader/TableLimit/TableLimit.types.js +1 -1
- package/dist/TableHeader/TableLimit/index.js +4 -2
- package/dist/TableHeader/TableSelection.d.ts +2 -2
- package/dist/TableHeader/TableSelection.js +163 -180
- package/dist/TableHeader/TableSelection.types.d.ts +1 -1
- package/dist/TableHeader/TableSelection.types.js +1 -1
- package/dist/TreeTable/TreeTable.d.ts +2 -3
- package/dist/TreeTable/TreeTable.js +51 -78
- package/dist/TreeTable/TreeTable.styles.d.ts +5 -5
- package/dist/TreeTable/TreeTable.styles.js +21 -20
- package/dist/VirtualTable/VirtualTable.d.ts +3 -3
- package/dist/VirtualTable/VirtualTable.js +342 -411
- package/dist/VirtualTable/VirtualTable.styles.d.ts +8 -8
- package/dist/VirtualTable/VirtualTable.styles.js +30 -40
- package/dist/VirtualTable/VirtualTable.types.d.ts +4 -4
- package/dist/VirtualTable/VirtualTable.types.js +1 -1
- package/dist/VirtualTable/VirtualTableRow.d.ts +4 -4
- package/dist/VirtualTable/VirtualTableRow.js +103 -111
- package/dist/VirtualTable/constants.js +8 -3
- package/dist/assets/style/index-tn0RQdqM.css +0 -0
- package/dist/constants/Table.constants.js +11 -6
- package/dist/constants/TableSkeleton.constants.d.ts +1 -1
- package/dist/constants/TableSkeleton.constants.js +48 -100
- package/dist/hooks/useBulkSelection/index.js +4 -1
- package/dist/hooks/useBulkSelection/useBulkSelection.d.ts +1 -1
- package/dist/hooks/useBulkSelection/useBulkSelection.js +55 -40
- package/dist/hooks/useRowKey/index.js +4 -1
- package/dist/hooks/useRowKey/useRowKey.js +11 -11
- package/dist/hooks/useRowStar/index.js +4 -2
- package/dist/hooks/useRowStar/useRowStar.d.ts +1 -1
- package/dist/hooks/useRowStar/useRowStar.js +54 -62
- package/dist/hooks/useRowStar/useRowStar.types.d.ts +2 -2
- package/dist/hooks/useRowStar/useRowStar.types.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +18 -9
- package/dist/modules.d.js +1 -1
- package/dist/modules.d.ts +0 -0
- package/dist/utils/calculateColumnWidths.d.ts +1 -1
- package/dist/utils/calculateColumnWidths.js +17 -16
- package/dist/utils/calculatePixels.js +11 -12
- package/dist/utils/columnWithCellTooltip.d.ts +1 -1
- package/dist/utils/columnWithCellTooltip.js +18 -15
- package/dist/utils/getChildrenColumnName.js +6 -3
- package/dist/utils/getRecordSelectionStatus.d.ts +1 -1
- package/dist/utils/getRecordSelectionStatus.js +11 -7
- package/dist/utils/getSkeletonProps.d.ts +1 -1
- package/dist/utils/getSkeletonProps.js +26 -36
- package/dist/utils/getValueFromPath.js +9 -6
- package/dist/utils/index.js +23 -9
- package/dist/utils/isGrouped.d.ts +1 -1
- package/dist/utils/isGrouped.js +6 -3
- package/dist/utils/isRecordSelectable.d.ts +1 -1
- package/dist/utils/isRecordSelectable.js +10 -6
- package/dist/utils/locale.d.ts +3 -3
- package/dist/utils/locale.js +115 -111
- package/package.json +31 -31
- package/dist/Cell/TagsGroup/TagsGroup.spec.d.ts +0 -1
- package/dist/ColumnSortMenu/__spec__/groupedColumnsSort.spec.d.ts +0 -1
- package/dist/VirtualTable/VirtualTable.spec.d.ts +0 -1
- package/dist/utils/__specs__/getValueFromPath.spec.d.ts +0 -1
package/dist/Table.js
CHANGED
|
@@ -1,148 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { useIntl } from
|
|
4
|
-
import Button from
|
|
5
|
-
import { useDataFormat } from
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
1
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
3
|
+
import { useIntl } from "react-intl";
|
|
4
|
+
import Button from "@synerise/ds-button";
|
|
5
|
+
import { useDataFormat } from "@synerise/ds-core";
|
|
6
|
+
import Icon, { AngleLeftS, AngleRightS } from "@synerise/ds-icon";
|
|
7
|
+
import Skeleton from "@synerise/ds-skeleton";
|
|
8
|
+
import DefaultTable from "./DefaultTable/DefaultTable.js";
|
|
9
|
+
import GroupTable from "./GroupTable/GroupTable.js";
|
|
10
|
+
import { TableWrapper } from "./Table.styles.js";
|
|
11
|
+
import TableHeader from "./TableHeader/TableHeader.js";
|
|
12
|
+
import { ITEM_RENDER_TYPE, SELECTION_ALL, SELECTION_INVERT } from "./constants/Table.constants.js";
|
|
13
|
+
import "unit-to-px";
|
|
14
|
+
import { getChildrenColumnName } from "./utils/getChildrenColumnName.js";
|
|
15
|
+
import { getSkeletonProps } from "./utils/getSkeletonProps.js";
|
|
16
|
+
import "ramda";
|
|
17
|
+
import { isGrouped } from "./utils/isGrouped.js";
|
|
18
|
+
import { useTableLocale, TableLocaleContext } from "./utils/locale.js";
|
|
14
19
|
import "./style/index.css";
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
loading
|
|
20
|
-
selection
|
|
21
|
-
itemsMenu
|
|
22
|
-
cellSize
|
|
23
|
-
dataSource
|
|
24
|
-
dataSourceFull
|
|
25
|
-
dataSourceTotalCount
|
|
26
|
-
roundedHeader
|
|
27
|
-
filters
|
|
28
|
-
searchComponent
|
|
29
|
-
filterComponent
|
|
30
|
-
rowKey
|
|
31
|
-
headerWithBorderTop
|
|
32
|
-
hideTitleBar
|
|
33
|
-
grouped
|
|
34
|
-
pagination
|
|
35
|
-
locale
|
|
36
|
-
headerButton
|
|
37
|
-
hideColumnNames
|
|
38
|
-
renderSelectionTitle
|
|
39
|
-
hideTitlePart
|
|
40
|
-
disableColumnNamesLineBreak
|
|
41
|
-
expandable
|
|
42
|
-
columns
|
|
43
|
-
skeletonProps
|
|
44
|
-
isCounterLoading
|
|
45
|
-
renderCustomCounter
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
20
|
+
const DSTable = (props) => {
|
|
21
|
+
const intl = useIntl();
|
|
22
|
+
const {
|
|
23
|
+
title,
|
|
24
|
+
loading,
|
|
25
|
+
selection,
|
|
26
|
+
itemsMenu,
|
|
27
|
+
cellSize,
|
|
28
|
+
dataSource,
|
|
29
|
+
dataSourceFull,
|
|
30
|
+
dataSourceTotalCount,
|
|
31
|
+
roundedHeader,
|
|
32
|
+
filters,
|
|
33
|
+
searchComponent,
|
|
34
|
+
filterComponent,
|
|
35
|
+
rowKey,
|
|
36
|
+
headerWithBorderTop,
|
|
37
|
+
hideTitleBar,
|
|
38
|
+
grouped,
|
|
39
|
+
pagination,
|
|
40
|
+
locale,
|
|
41
|
+
headerButton,
|
|
42
|
+
hideColumnNames,
|
|
43
|
+
renderSelectionTitle,
|
|
44
|
+
hideTitlePart,
|
|
45
|
+
disableColumnNamesLineBreak,
|
|
46
|
+
expandable,
|
|
47
|
+
columns,
|
|
48
|
+
skeletonProps,
|
|
49
|
+
isCounterLoading,
|
|
50
|
+
renderCustomCounter
|
|
51
|
+
} = props;
|
|
52
|
+
const tableLocale = useTableLocale(intl, locale);
|
|
53
|
+
const {
|
|
54
|
+
formatValue
|
|
55
|
+
} = useDataFormat();
|
|
56
|
+
const renderHeader = useCallback(() => {
|
|
57
|
+
const size = selection && selection?.selectedRowKeys && selection?.selectedRowKeys.length;
|
|
58
|
+
const data = grouped && isGrouped(dataSource) ? dataSource?.reduce((items, group) => {
|
|
52
59
|
if (group.rows) {
|
|
53
|
-
|
|
60
|
+
const merged = [...items, ...group.rows];
|
|
54
61
|
return merged;
|
|
55
62
|
}
|
|
56
|
-
|
|
63
|
+
const result = [...items];
|
|
57
64
|
return result;
|
|
58
65
|
}, []) : dataSource;
|
|
59
|
-
|
|
60
|
-
return !hideTitleBar ?
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
renderCustomCounter: renderCustomCounter,
|
|
77
|
-
renderSelectionTitle: renderSelectionTitle,
|
|
78
|
-
hideTitlePart: hideTitlePart,
|
|
79
|
-
childrenColumnName: getChildrenColumnName(expandable == null ? void 0 : expandable.childrenColumnName),
|
|
80
|
-
isLoading: loading
|
|
81
|
-
}) : /*#__PURE__*/React.createElement(React.Fragment, null);
|
|
82
|
-
}, [selection, grouped, dataSource, dataSourceTotalCount, dataSourceFull, hideTitleBar, headerWithBorderTop, title, filters, itemsMenu, searchComponent, filterComponent, headerButton, rowKey, tableLocale, renderCustomCounter, renderSelectionTitle, hideTitlePart, expandable == null ? void 0 : expandable.childrenColumnName, loading, isCounterLoading]);
|
|
83
|
-
var footerPagination = useMemo(function () {
|
|
84
|
-
return _extends({
|
|
85
|
-
showTotal: function showTotal(total, range) {
|
|
86
|
-
var _tableLocale$paginati, _tableLocale$paginati2;
|
|
87
|
-
return !hideTitlePart ? /*#__PURE__*/React.createElement("span", null, /*#__PURE__*/React.createElement("strong", null, formatValue(range[0])), "-", /*#__PURE__*/React.createElement("strong", null, formatValue(range[1])), " of", ' ', /*#__PURE__*/React.createElement("strong", null, formatValue(total)), ' ', grouped ? tableLocale == null || (_tableLocale$paginati = tableLocale.pagination) == null ? void 0 : _tableLocale$paginati.groups : tableLocale == null || (_tableLocale$paginati2 = tableLocale.pagination) == null ? void 0 : _tableLocale$paginati2.items) : /*#__PURE__*/React.createElement("div", {
|
|
88
|
-
style: {
|
|
89
|
-
width: '150px'
|
|
90
|
-
}
|
|
91
|
-
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
92
|
-
size: "M"
|
|
93
|
-
}));
|
|
94
|
-
},
|
|
66
|
+
const totalCount = dataSourceTotalCount || dataSource?.length || dataSourceFull?.length;
|
|
67
|
+
return !hideTitleBar ? /* @__PURE__ */ jsx(TableHeader, { withBorderTop: headerWithBorderTop, selectedRows: size, title, filters, itemsMenu, selection, dataSource: data, dataSourceFull, dataSourceTotalCount: totalCount, isCounterLoading, searchComponent, filterComponent, headerButton, rowKey, locale: tableLocale, renderCustomCounter, renderSelectionTitle, hideTitlePart, childrenColumnName: getChildrenColumnName(expandable?.childrenColumnName), isLoading: loading }) : /* @__PURE__ */ jsx(Fragment, {});
|
|
68
|
+
}, [selection, grouped, dataSource, dataSourceTotalCount, dataSourceFull, hideTitleBar, headerWithBorderTop, title, filters, itemsMenu, searchComponent, filterComponent, headerButton, rowKey, tableLocale, renderCustomCounter, renderSelectionTitle, hideTitlePart, expandable?.childrenColumnName, loading, isCounterLoading]);
|
|
69
|
+
const footerPagination = useMemo(() => {
|
|
70
|
+
return {
|
|
71
|
+
showTotal: (total, range) => !hideTitlePart ? /* @__PURE__ */ jsxs("span", { children: [
|
|
72
|
+
/* @__PURE__ */ jsx("strong", { children: formatValue(range[0]) }),
|
|
73
|
+
"-",
|
|
74
|
+
/* @__PURE__ */ jsx("strong", { children: formatValue(range[1]) }),
|
|
75
|
+
" of",
|
|
76
|
+
" ",
|
|
77
|
+
/* @__PURE__ */ jsx("strong", { children: formatValue(total) }),
|
|
78
|
+
" ",
|
|
79
|
+
grouped ? tableLocale?.pagination?.groups : tableLocale?.pagination?.items
|
|
80
|
+
] }) : /* @__PURE__ */ jsx("div", { style: {
|
|
81
|
+
width: "150px"
|
|
82
|
+
}, children: /* @__PURE__ */ jsx(Skeleton, { size: "M" }) }),
|
|
95
83
|
columnWidth: 72,
|
|
96
|
-
itemRender:
|
|
84
|
+
itemRender: (page, type, originalElement) => {
|
|
97
85
|
if (type === ITEM_RENDER_TYPE.prev) {
|
|
98
|
-
return
|
|
99
|
-
mode: "single-icon",
|
|
100
|
-
type: "ghost"
|
|
101
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
102
|
-
component: /*#__PURE__*/React.createElement(AngleLeftS, null)
|
|
103
|
-
}));
|
|
86
|
+
return /* @__PURE__ */ jsx(Button, { mode: "single-icon", type: "ghost", children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleLeftS, {}) }) });
|
|
104
87
|
}
|
|
105
88
|
if (type === ITEM_RENDER_TYPE.next) {
|
|
106
|
-
return
|
|
107
|
-
mode: "single-icon",
|
|
108
|
-
type: "ghost"
|
|
109
|
-
}, /*#__PURE__*/React.createElement(Icon, {
|
|
110
|
-
component: /*#__PURE__*/React.createElement(AngleRightS, null)
|
|
111
|
-
}));
|
|
89
|
+
return /* @__PURE__ */ jsx(Button, { mode: "single-icon", type: "ghost", children: /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(AngleRightS, {}) }) });
|
|
112
90
|
}
|
|
113
91
|
return originalElement;
|
|
114
|
-
}
|
|
115
|
-
|
|
92
|
+
},
|
|
93
|
+
...pagination
|
|
94
|
+
};
|
|
116
95
|
}, [pagination, formatValue, grouped, tableLocale, hideTitlePart]);
|
|
117
|
-
|
|
118
|
-
|
|
96
|
+
const tableContent = useMemo(() => {
|
|
97
|
+
const extraProps = loading ? getSkeletonProps(skeletonProps, columns) : {
|
|
119
98
|
pagination: pagination ? footerPagination : false
|
|
120
99
|
};
|
|
121
|
-
return
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
},
|
|
125
|
-
tableLayout: "fixed"
|
|
126
|
-
}, props, {
|
|
127
|
-
locale: tableLocale,
|
|
128
|
-
title: renderHeader
|
|
129
|
-
}, extraProps));
|
|
100
|
+
return /* @__PURE__ */ jsx(DefaultTable, { scroll: {
|
|
101
|
+
x: "auto"
|
|
102
|
+
}, tableLayout: "fixed", ...props, locale: tableLocale, title: renderHeader, ...extraProps });
|
|
130
103
|
}, [columns, footerPagination, loading, pagination, props, renderHeader, skeletonProps, tableLocale]);
|
|
131
|
-
return
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
hideColumnNames: hideColumnNames,
|
|
136
|
-
disableColumnNamesLineBreak: disableColumnNamesLineBreak
|
|
137
|
-
}, !loading && grouped && dataSource != null && dataSource.length ?
|
|
138
|
-
/*#__PURE__*/
|
|
139
|
-
// @ts-expect-error type 'T' does not satisfy the constraint 'GroupType<T>'.
|
|
140
|
-
React.createElement(GroupTable, _extends({}, props, {
|
|
141
|
-
locale: tableLocale,
|
|
142
|
-
title: renderHeader,
|
|
143
|
-
pagination: dataSource != null && dataSource.length && pagination ? footerPagination : false
|
|
144
|
-
})) : tableContent));
|
|
104
|
+
return /* @__PURE__ */ jsx(TableLocaleContext.Provider, { value: tableLocale, children: /* @__PURE__ */ jsx(TableWrapper, { className: `ds-table ds-table-cell-size-${cellSize} ${roundedHeader ? "ds-table-rounded" : ""}`, hideColumnNames, disableColumnNamesLineBreak, children: !loading && grouped && dataSource?.length ? (
|
|
105
|
+
// @ts-expect-error type 'T' does not satisfy the constraint 'GroupType<T>'.
|
|
106
|
+
/* @__PURE__ */ jsx(GroupTable, { ...props, locale: tableLocale, title: renderHeader, pagination: dataSource?.length && pagination ? footerPagination : false })
|
|
107
|
+
) : tableContent }) });
|
|
145
108
|
};
|
|
146
109
|
DSTable.SELECTION_ALL = SELECTION_ALL;
|
|
147
110
|
DSTable.SELECTION_INVERT = SELECTION_INVERT;
|
|
148
|
-
export
|
|
111
|
+
export {
|
|
112
|
+
DSTable as default
|
|
113
|
+
};
|
package/dist/Table.styles.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import Menu from '@synerise/ds-menu';
|
|
2
|
-
export declare const Header: import(
|
|
1
|
+
import { default as Menu } from '@synerise/ds-menu';
|
|
2
|
+
export declare const Header: import('styled-components').StyledComponent<"div", any, {
|
|
3
3
|
withBorderTop?: boolean;
|
|
4
4
|
}, never>;
|
|
5
|
-
export declare const Size: import(
|
|
6
|
-
export declare const TitleContainer: import(
|
|
7
|
-
export declare const TitlePartEllipsis: import(
|
|
8
|
-
size?: import(
|
|
9
|
-
ellipsis?: import(
|
|
10
|
-
children?: import(
|
|
5
|
+
export declare const Size: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
6
|
+
export declare const TitleContainer: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
7
|
+
export declare const TitlePartEllipsis: import('styled-components').StyledComponent<({ size, className, children, ellipsis, style, }: {
|
|
8
|
+
size?: import('@synerise/ds-typography').TextSize;
|
|
9
|
+
ellipsis?: import('@synerise/ds-typography/dist/Ellipsis').EllipsisProps;
|
|
10
|
+
children?: import('react').ReactNode;
|
|
11
11
|
className?: string;
|
|
12
|
-
style?: import(
|
|
12
|
+
style?: import('react').CSSProperties;
|
|
13
13
|
}) => React.JSX.Element, any, {}, never>;
|
|
14
|
-
export declare const TitlePart: import(
|
|
15
|
-
export declare const TitleSeparator: import(
|
|
16
|
-
export declare const Left: import(
|
|
17
|
-
export declare const Right: import(
|
|
18
|
-
export declare const RightSideWrapper: import(
|
|
19
|
-
export declare const Icon: import(
|
|
20
|
-
export declare const Input: import(
|
|
14
|
+
export declare const TitlePart: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
15
|
+
export declare const TitleSeparator: import('styled-components').StyledComponent<"span", any, {}, never>;
|
|
16
|
+
export declare const Left: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
17
|
+
export declare const Right: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
18
|
+
export declare const RightSideWrapper: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
19
|
+
export declare const Icon: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
20
|
+
export declare const Input: import('styled-components').StyledComponent<"div", any, {
|
|
21
21
|
isOpen?: boolean;
|
|
22
22
|
}, never>;
|
|
23
|
-
export declare const InputWrapper: import(
|
|
23
|
+
export declare const InputWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
24
24
|
isOpen?: boolean;
|
|
25
25
|
searchValue: string | undefined;
|
|
26
26
|
}, never>;
|
|
27
|
-
export declare const Selection: import(
|
|
28
|
-
export declare const SelectionMenu: import(
|
|
29
|
-
export declare const Spinner: import(
|
|
30
|
-
export declare const TableWrapper: import(
|
|
27
|
+
export declare const Selection: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
28
|
+
export declare const SelectionMenu: import('styled-components').StyledComponent<typeof Menu, any, {}, never>;
|
|
29
|
+
export declare const Spinner: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
30
|
+
export declare const TableWrapper: import('styled-components').StyledComponent<"div", any, {
|
|
31
31
|
hideColumnNames?: boolean;
|
|
32
32
|
disableColumnNamesLineBreak?: boolean;
|
|
33
33
|
}, never>;
|
|
34
|
-
export declare const Skeleton: import(
|
|
34
|
+
export declare const Skeleton: import('styled-components').StyledComponent<({ size, numberOfSkeletons, width, height, className, }: import('@synerise/ds-skeleton').SkeletonProps) => React.JSX.Element, any, {
|
|
35
35
|
skeletonWidth?: string;
|
|
36
36
|
}, never>;
|
|
37
|
-
export declare const TableSkeletonCell: import(
|
|
37
|
+
export declare const TableSkeletonCell: import('styled-components').StyledComponent<"div", any, {
|
|
38
38
|
height?: number;
|
|
39
39
|
width?: string;
|
|
40
40
|
}, never>;
|
package/dist/Table.styles.js
CHANGED
|
@@ -1,155 +1,131 @@
|
|
|
1
|
-
import styled, { keyframes } from
|
|
2
|
-
import { CheckboxWrapper } from
|
|
3
|
-
import { IconContainer } from
|
|
4
|
-
import Menu from
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
|
|
1
|
+
import styled, { keyframes } from "styled-components";
|
|
2
|
+
import { CheckboxWrapper } from "@synerise/ds-checkbox/dist/Checkbox.styles";
|
|
3
|
+
import { IconContainer } from "@synerise/ds-icon";
|
|
4
|
+
import Menu from "@synerise/ds-menu";
|
|
5
|
+
import Skeleton$1 from "@synerise/ds-skeleton";
|
|
6
|
+
import { macro, Text } from "@synerise/ds-typography";
|
|
7
|
+
const Header = /* @__PURE__ */ styled.div.withConfig({
|
|
8
8
|
displayName: "Tablestyles__Header",
|
|
9
9
|
componentId: "sc-dacfhr-0"
|
|
10
|
-
})(["background:#ffffff;padding:20px 24px;display:flex;justify-content:space-between;border-top:", ";border-bottom:1px solid ", ";"],
|
|
11
|
-
|
|
12
|
-
}, function (props) {
|
|
13
|
-
return props.theme.palette['grey-200'];
|
|
14
|
-
});
|
|
15
|
-
export var Size = styled.div.withConfig({
|
|
10
|
+
})(["background:#ffffff;padding:20px 24px;display:flex;justify-content:space-between;border-top:", ";border-bottom:1px solid ", ";"], (props) => props.withBorderTop ? `1px solid ${props.theme.palette["grey-200"]}` : "0", (props) => props.theme.palette["grey-200"]);
|
|
11
|
+
const Size = /* @__PURE__ */ styled.div.withConfig({
|
|
16
12
|
displayName: "Tablestyles__Size",
|
|
17
13
|
componentId: "sc-dacfhr-1"
|
|
18
14
|
})(["", ";color:#fff;b{", ";color:inherit;}"], macro.medium, macro.h400);
|
|
19
|
-
|
|
15
|
+
const TitleContainer = /* @__PURE__ */ styled.div.withConfig({
|
|
20
16
|
displayName: "Tablestyles__TitleContainer",
|
|
21
17
|
componentId: "sc-dacfhr-2"
|
|
22
|
-
})(["display:flex;max-width:100%;min-width:0;align-items:center;", ";color:", ";padding:0 24px 0 0;strong{font-weight:500;}"], macro.small,
|
|
23
|
-
|
|
24
|
-
});
|
|
25
|
-
export var TitlePartEllipsis = styled(Text).withConfig({
|
|
18
|
+
})(["display:flex;max-width:100%;min-width:0;align-items:center;", ";color:", ";padding:0 24px 0 0;strong{font-weight:500;}"], macro.small, (props) => props.theme.palette["grey-700"]);
|
|
19
|
+
const TitlePartEllipsis = /* @__PURE__ */ styled(Text).withConfig({
|
|
26
20
|
displayName: "Tablestyles__TitlePartEllipsis",
|
|
27
21
|
componentId: "sc-dacfhr-3"
|
|
28
22
|
})(["font-weight:500;"]);
|
|
29
|
-
|
|
23
|
+
const TitlePart = /* @__PURE__ */ styled.span.withConfig({
|
|
30
24
|
displayName: "Tablestyles__TitlePart",
|
|
31
25
|
componentId: "sc-dacfhr-4"
|
|
32
26
|
})(["display:flex;align-items:center;gap:4px;"]);
|
|
33
|
-
|
|
27
|
+
const TitleSeparator = /* @__PURE__ */ styled.span.withConfig({
|
|
34
28
|
displayName: "Tablestyles__TitleSeparator",
|
|
35
29
|
componentId: "sc-dacfhr-5"
|
|
36
|
-
})(["display:inline-block;vertical-align:middle;flex-shrink:0;width:1px;height:16px;margin:1px 12px 0px 12px;background:", ";"],
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
export var Left = styled.div.withConfig({
|
|
30
|
+
})(["display:inline-block;vertical-align:middle;flex-shrink:0;width:1px;height:16px;margin:1px 12px 0px 12px;background:", ";"], ({
|
|
31
|
+
theme
|
|
32
|
+
}) => theme.palette["grey-200"]);
|
|
33
|
+
const Left = /* @__PURE__ */ styled.div.withConfig({
|
|
41
34
|
displayName: "Tablestyles__Left",
|
|
42
35
|
componentId: "sc-dacfhr-6"
|
|
43
36
|
})(["display:flex;align-items:center;min-width:0;"]);
|
|
44
|
-
|
|
37
|
+
const Right = /* @__PURE__ */ styled.div.withConfig({
|
|
45
38
|
displayName: "Tablestyles__Right",
|
|
46
39
|
componentId: "sc-dacfhr-7"
|
|
47
40
|
})(["display:flex;align-items:center;justify-content:flex-start;gap:8px;> *{min-width:32px;}&&& .ds-button.btn-search{min-width:unset;}"]);
|
|
48
|
-
|
|
41
|
+
const RightSideWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
49
42
|
displayName: "Tablestyles__RightSideWrapper",
|
|
50
43
|
componentId: "sc-dacfhr-8"
|
|
51
44
|
})([""]);
|
|
52
|
-
|
|
45
|
+
const Icon = /* @__PURE__ */ styled.div.withConfig({
|
|
53
46
|
displayName: "Tablestyles__Icon",
|
|
54
47
|
componentId: "sc-dacfhr-9"
|
|
55
48
|
})(["transition:all 0.5s ease;position:absolute;left:4px;z-index:1;"]);
|
|
56
|
-
|
|
49
|
+
const Input = /* @__PURE__ */ styled.div.withConfig({
|
|
57
50
|
displayName: "Tablestyles__Input",
|
|
58
51
|
componentId: "sc-dacfhr-10"
|
|
59
52
|
})(["transition:all 0.2s ease;overflow:hidden;position:relative;right:0;> div{margin:0;}"]);
|
|
60
|
-
|
|
53
|
+
const InputWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
61
54
|
displayName: "Tablestyles__InputWrapper",
|
|
62
55
|
componentId: "sc-dacfhr-11"
|
|
63
|
-
})(["", ";transition:all 0.5s ease;position:relative;display:flex;align-items:center;direction:ltr;", "{opacity:", ";width:", ";}&{input{padding-left:32px;", ";}}.search-input{width:0;}"],
|
|
64
|
-
|
|
65
|
-
}, Input, function (props) {
|
|
66
|
-
return props.searchValue || props.isOpen ? '1 !important' : '0';
|
|
67
|
-
}, function (props) {
|
|
68
|
-
return props.searchValue || props.isOpen ? 'auto' : '0';
|
|
69
|
-
}, function (props) {
|
|
70
|
-
return props.searchValue !== '' || props.isOpen ? "cursor: initial!important;" : 'cursor: pointer!important';
|
|
71
|
-
});
|
|
72
|
-
export var Selection = styled.div.withConfig({
|
|
56
|
+
})(["", ";transition:all 0.5s ease;position:relative;display:flex;align-items:center;direction:ltr;", "{opacity:", ";width:", ";}&{input{padding-left:32px;", ";}}.search-input{width:0;}"], (props) => props.searchValue !== "" || props.isOpen ? `width: 100%` : "width: 30px", Input, (props) => props.searchValue || props.isOpen ? "1 !important" : "0", (props) => props.searchValue || props.isOpen ? "auto" : "0", (props) => props.searchValue !== "" || props.isOpen ? `cursor: initial!important;` : "cursor: pointer!important");
|
|
57
|
+
const Selection = /* @__PURE__ */ styled.div.withConfig({
|
|
73
58
|
displayName: "Tablestyles__Selection",
|
|
74
59
|
componentId: "sc-dacfhr-12"
|
|
75
|
-
})(["display:flex;align-items:center;justify-content:flex-start;max-width:64px;margin-right:24px;border-radius:3px;&:hover{background-color:", ";}.ant-btn.ds-button:first-of-type{border-top-right-radius:0;border-bottom-right-radius:0;}.ant-btn.ds-button:last-of-type{border-top-left-radius:0;border-bottom-left-radius:0;}", "{padding:0;}"],
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
export var SelectionMenu = styled(Menu).withConfig({
|
|
60
|
+
})(["display:flex;align-items:center;justify-content:flex-start;max-width:64px;margin-right:24px;border-radius:3px;&:hover{background-color:", ";}.ant-btn.ds-button:first-of-type{border-top-right-radius:0;border-bottom-right-radius:0;}.ant-btn.ds-button:last-of-type{border-top-left-radius:0;border-bottom-left-radius:0;}", "{padding:0;}"], ({
|
|
61
|
+
theme
|
|
62
|
+
}) => theme.palette["grey-100"], CheckboxWrapper);
|
|
63
|
+
const SelectionMenu = /* @__PURE__ */ styled(Menu).withConfig({
|
|
80
64
|
displayName: "Tablestyles__SelectionMenu",
|
|
81
65
|
componentId: "sc-dacfhr-13"
|
|
82
66
|
})(["padding:8px;"]);
|
|
83
|
-
|
|
84
|
-
|
|
67
|
+
const spinnerAnimation = /* @__PURE__ */ keyframes(["from{transform:rotateZ(0deg);}to{transform:rotateZ(360deg);}"]);
|
|
68
|
+
const Spinner = /* @__PURE__ */ styled.div.withConfig({
|
|
85
69
|
displayName: "Tablestyles__Spinner",
|
|
86
70
|
componentId: "sc-dacfhr-14"
|
|
87
|
-
})(["position:absolute !important;top:0;left:0;width:100%;height:100%;margin:0;border-radius:inherit;display:flex;align-items:center;justify-content:center;background-color:rgba(255,255,255,0.6);z-index:10;", "{animation:", " 1s forwards linear infinite;svg{color:", ";fill:", ";}}"], IconContainer, spinnerAnimation,
|
|
88
|
-
|
|
89
|
-
}, function (props) {
|
|
90
|
-
return props.theme.palette['blue-600'];
|
|
91
|
-
});
|
|
92
|
-
export var TableWrapper = styled.div.withConfig({
|
|
71
|
+
})(["position:absolute !important;top:0;left:0;width:100%;height:100%;margin:0;border-radius:inherit;display:flex;align-items:center;justify-content:center;background-color:rgba(255,255,255,0.6);z-index:10;", "{animation:", " 1s forwards linear infinite;svg{color:", ";fill:", ";}}"], IconContainer, spinnerAnimation, (props) => props.theme.palette["blue-600"], (props) => props.theme.palette["blue-600"]);
|
|
72
|
+
const TableWrapper = /* @__PURE__ */ styled.div.withConfig({
|
|
93
73
|
displayName: "Tablestyles__TableWrapper",
|
|
94
74
|
componentId: "sc-dacfhr-15"
|
|
95
|
-
})(["table{.ant-table-thead{", ";}}.ant-table-wrapper .ant-table{z-index:1;}.ant-table .ant-table-cell.ant-table-selection-column,.ant-table .ant-table-cell.ds-table-star-column{padding:0 8px 0 24px;& > button{display:inline-block;}}.ant-table .ant-table-cell.ant-table-selection-column + .ant-table-cell.ds-table-star-column{padding-left:0;}.ant-table .ant-table-thead th{transition:background 0.3s,border-color 0.3s;background-color:", ";border-bottom-color:", ";&.ant-table-column-has-sorters{cursor:default;}&.ant-table-column-has-sorters:hover{background-color:", ";border-bottom:2px solid ", ";> *{margin-bottom:-1px;}}> *{display:flex;width:100%;}[class^='ant-table-column-sorters']{width:100%;}&.ant-table-column-sort{background-color:", ";border-bottom:2px solid ", ";&:hover{background-color:", ";border-bottom:2px solid ", ";}& > [class^='ant-table-column-sorters']{overflow:hidden;}> *{margin-bottom:-1px;}}&.ant-table-cell-ellipsis.ant-table-column-has-sorters{overflow:visible;}&:not(.ds-table-column-sort){.ds-table-column-sorter{margin-left:8px;}}&.ds-table-active-column{background-color:", ";border-bottom:2px solid ", ";cursor:default;&:hover{background-color:", ";border-bottom:2px solid ", ";}.ant-table-column-sorter{display:none;}> *{margin-bottom:-1px;}}}.ant-table tr.ant-table-row:not(:hover) td.ant-table-column-sort{background-color:", ";}.ant-table .ant-table-column-sorter{margin-left:8px;max-width:32px;min-width:32px;}.ant-table-cell .ds-sort-dropdown-button{opacity:0;}.ant-table-cell:hover .ds-sort-dropdown-button,.ant-table-cell.ant-table-column-sort .ds-sort-dropdown-button{opacity:1;}.ant-table-wrapper.virtual-table.virtual-table-infinite-scroll .ant-table .ant-table-header{box-shadow:0 4px 12px 0 rgba(35,41,54,0.04);}.virtual-table:not(.with-sticky-header) .ant-table-container{overflow:auto hidden;}.virtual-table .virtual-table-row:not(:hover) .virtual-table-cell.ant-table-column-sort{background-color:", ";}& .ant-table .ant-table-cell-scrollbar{box-shadow:none;}& .ant-table th.ant-table-cell{white-space:", ";}&&& .ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not( .ant-table-row-expand-icon-cell ):not([colspan])::before{position:relative;}"],
|
|
96
|
-
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
},
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
},
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
},
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
var theme = _ref10.theme;
|
|
126
|
-
return theme.palette['yellow-400'];
|
|
127
|
-
}, function (_ref11) {
|
|
128
|
-
var theme = _ref11.theme;
|
|
129
|
-
return theme.palette['yellow-100'];
|
|
130
|
-
}, function (_ref12) {
|
|
131
|
-
var theme = _ref12.theme;
|
|
132
|
-
return theme.palette['yellow-600'];
|
|
133
|
-
}, function (_ref13) {
|
|
134
|
-
var theme = _ref13.theme;
|
|
135
|
-
return theme.palette['blue-050'];
|
|
136
|
-
}, function (_ref14) {
|
|
137
|
-
var theme = _ref14.theme;
|
|
138
|
-
return theme.palette['blue-050'];
|
|
139
|
-
}, function (props) {
|
|
140
|
-
return props.disableColumnNamesLineBreak ? 'nowrap' : 'normal';
|
|
141
|
-
});
|
|
142
|
-
export var Skeleton = styled(DSSkeleton).withConfig({
|
|
75
|
+
})(["table{.ant-table-thead{", ";}}.ant-table-wrapper .ant-table{z-index:1;}.ant-table .ant-table-cell.ant-table-selection-column,.ant-table .ant-table-cell.ds-table-star-column{padding:0 8px 0 24px;& > button{display:inline-block;}}.ant-table .ant-table-cell.ant-table-selection-column + .ant-table-cell.ds-table-star-column{padding-left:0;}.ant-table .ant-table-thead th{transition:background 0.3s,border-color 0.3s;background-color:", ";border-bottom-color:", ";&.ant-table-column-has-sorters{cursor:default;}&.ant-table-column-has-sorters:hover{background-color:", ";border-bottom:2px solid ", ";> *{margin-bottom:-1px;}}> *{display:flex;width:100%;}[class^='ant-table-column-sorters']{width:100%;}&.ant-table-column-sort{background-color:", ";border-bottom:2px solid ", ";&:hover{background-color:", ";border-bottom:2px solid ", ";}& > [class^='ant-table-column-sorters']{overflow:hidden;}> *{margin-bottom:-1px;}}&.ant-table-cell-ellipsis.ant-table-column-has-sorters{overflow:visible;}&:not(.ds-table-column-sort){.ds-table-column-sorter{margin-left:8px;}}&.ds-table-active-column{background-color:", ";border-bottom:2px solid ", ";cursor:default;&:hover{background-color:", ";border-bottom:2px solid ", ";}.ant-table-column-sorter{display:none;}> *{margin-bottom:-1px;}}}.ant-table tr.ant-table-row:not(:hover) td.ant-table-column-sort{background-color:", ";}.ant-table .ant-table-column-sorter{margin-left:8px;max-width:32px;min-width:32px;}.ant-table-cell .ds-sort-dropdown-button{opacity:0;}.ant-table-cell:hover .ds-sort-dropdown-button,.ant-table-cell.ant-table-column-sort .ds-sort-dropdown-button{opacity:1;}.ant-table-wrapper.virtual-table.virtual-table-infinite-scroll .ant-table .ant-table-header{box-shadow:0 4px 12px 0 rgba(35,41,54,0.04);}.virtual-table:not(.with-sticky-header) .ant-table-container{overflow:auto hidden;}.virtual-table .virtual-table-row:not(:hover) .virtual-table-cell.ant-table-column-sort{background-color:", ";}& .ant-table .ant-table-cell-scrollbar{box-shadow:none;}& .ant-table th.ant-table-cell{white-space:", ";}&&& .ant-table-thead > tr > th:not(:last-child):not(.ant-table-selection-column):not( .ant-table-row-expand-icon-cell ):not([colspan])::before{position:relative;}"], (props) => props.hideColumnNames ? "display: none" : "", ({
|
|
76
|
+
theme
|
|
77
|
+
}) => theme.palette.white, ({
|
|
78
|
+
theme
|
|
79
|
+
}) => theme.palette["grey-300"], ({
|
|
80
|
+
theme
|
|
81
|
+
}) => theme.palette["grey-050"], ({
|
|
82
|
+
theme
|
|
83
|
+
}) => theme.palette["grey-400"], ({
|
|
84
|
+
theme
|
|
85
|
+
}) => theme.palette["blue-050"], ({
|
|
86
|
+
theme
|
|
87
|
+
}) => theme.palette["blue-400"], ({
|
|
88
|
+
theme
|
|
89
|
+
}) => theme.palette["blue-100"], ({
|
|
90
|
+
theme
|
|
91
|
+
}) => theme.palette["blue-600"], ({
|
|
92
|
+
theme
|
|
93
|
+
}) => theme.palette["yellow-050"], ({
|
|
94
|
+
theme
|
|
95
|
+
}) => theme.palette["yellow-400"], ({
|
|
96
|
+
theme
|
|
97
|
+
}) => theme.palette["yellow-100"], ({
|
|
98
|
+
theme
|
|
99
|
+
}) => theme.palette["yellow-600"], ({
|
|
100
|
+
theme
|
|
101
|
+
}) => theme.palette["blue-050"], ({
|
|
102
|
+
theme
|
|
103
|
+
}) => theme.palette["blue-050"], (props) => props.disableColumnNamesLineBreak ? "nowrap" : "normal");
|
|
104
|
+
const Skeleton = /* @__PURE__ */ styled(Skeleton$1).withConfig({
|
|
143
105
|
displayName: "Tablestyles__Skeleton",
|
|
144
106
|
componentId: "sc-dacfhr-16"
|
|
145
|
-
})(["padding:0;", ""],
|
|
146
|
-
|
|
147
|
-
});
|
|
148
|
-
export var TableSkeletonCell = styled.div.withConfig({
|
|
107
|
+
})(["padding:0;", ""], (props) => props.skeletonWidth && `width: ${props.skeletonWidth};`);
|
|
108
|
+
const TableSkeletonCell = /* @__PURE__ */ styled.div.withConfig({
|
|
149
109
|
displayName: "Tablestyles__TableSkeletonCell",
|
|
150
110
|
componentId: "sc-dacfhr-17"
|
|
151
|
-
})(["display:flex;height:", ";width:", ";align-items:center;justify-content:flex-start;"],
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
111
|
+
})(["display:flex;height:", ";width:", ";align-items:center;justify-content:flex-start;"], (props) => props.height ? `${props.height}px` : "auto", (props) => `${props.width}` || "50%");
|
|
112
|
+
export {
|
|
113
|
+
Header,
|
|
114
|
+
Icon,
|
|
115
|
+
Input,
|
|
116
|
+
InputWrapper,
|
|
117
|
+
Left,
|
|
118
|
+
Right,
|
|
119
|
+
RightSideWrapper,
|
|
120
|
+
Selection,
|
|
121
|
+
SelectionMenu,
|
|
122
|
+
Size,
|
|
123
|
+
Skeleton,
|
|
124
|
+
Spinner,
|
|
125
|
+
TableSkeletonCell,
|
|
126
|
+
TableWrapper,
|
|
127
|
+
TitleContainer,
|
|
128
|
+
TitlePart,
|
|
129
|
+
TitlePartEllipsis,
|
|
130
|
+
TitleSeparator
|
|
131
|
+
};
|
package/dist/Table.types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
1
|
+
import { ColumnType, TableProps } from 'antd/lib/table';
|
|
2
|
+
import { ColumnTitleProps, TableLocale, TableRowSelection } from 'antd/lib/table/interface';
|
|
3
|
+
import { SELECTION_ALL, SELECTION_INVERT } from 'constants/Table.constants';
|
|
4
|
+
import { Key, ReactNode, Ref } from 'react';
|
|
5
|
+
import { TooltipProps } from '@synerise/ds-tooltip';
|
|
6
|
+
import { LiteralStringUnion } from '@synerise/ds-utils';
|
|
7
|
+
import { GroupType } from './GroupTable/GroupTable.types';
|
|
8
8
|
export type RowStar<T> = {
|
|
9
9
|
className?: string;
|
|
10
10
|
starredRowKeys: string[];
|
package/dist/Table.types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { Props } from './TableHeader.types';
|
|
3
3
|
declare const TableHeader: <T extends object>({ title, filters, searchComponent, filterComponent, selectedRows, itemsMenu, selection, dataSource, dataSourceFull, dataSourceTotalCount, isCounterLoading, rowKey, withBorderTop, headerButton, locale, renderSelectionTitle, renderCustomCounter, hideTitlePart, childrenColumnName, isLoading, }: Props<T>) => React.JSX.Element;
|
|
4
4
|
export default TableHeader;
|