@synerise/ds-table 1.9.11 → 1.9.12
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 +4 -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
|
@@ -1,134 +1,96 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { useDataFormat } from
|
|
4
|
-
import FilterTrigger from
|
|
5
|
-
import
|
|
6
|
-
import { TableLimit } from
|
|
7
|
-
import TableSelection from
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var tableTotal = dataSourceTotalCount || dataSource.length;
|
|
40
|
-
var _ref2 = selection || {},
|
|
41
|
-
hideSelectAll = _ref2.hideSelectAll;
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { useDataFormat } from "@synerise/ds-core";
|
|
4
|
+
import FilterTrigger from "../FilterTrigger/FilterTrigger.js";
|
|
5
|
+
import { Left, TitleContainer, Skeleton, TitlePart, TitlePartEllipsis, TitleSeparator, Header, Right, RightSideWrapper } from "../Table.styles.js";
|
|
6
|
+
import { TableLimit } from "./TableLimit/TableLimit.js";
|
|
7
|
+
import TableSelection from "./TableSelection.js";
|
|
8
|
+
const TableHeader = ({
|
|
9
|
+
title,
|
|
10
|
+
filters,
|
|
11
|
+
searchComponent,
|
|
12
|
+
filterComponent,
|
|
13
|
+
selectedRows,
|
|
14
|
+
itemsMenu,
|
|
15
|
+
selection,
|
|
16
|
+
dataSource = [],
|
|
17
|
+
dataSourceFull,
|
|
18
|
+
dataSourceTotalCount,
|
|
19
|
+
isCounterLoading,
|
|
20
|
+
rowKey,
|
|
21
|
+
withBorderTop,
|
|
22
|
+
headerButton,
|
|
23
|
+
locale,
|
|
24
|
+
renderSelectionTitle,
|
|
25
|
+
renderCustomCounter,
|
|
26
|
+
hideTitlePart,
|
|
27
|
+
childrenColumnName,
|
|
28
|
+
isLoading
|
|
29
|
+
}) => {
|
|
30
|
+
const {
|
|
31
|
+
formatValue
|
|
32
|
+
} = useDataFormat();
|
|
33
|
+
const hasSelectedItems = useMemo(() => selectedRows && selectedRows > 0 || selection?.globalSelection?.isSelected, [selectedRows, selection?.globalSelection?.isSelected]);
|
|
34
|
+
const renderLeftSide = useMemo(() => {
|
|
35
|
+
const tableTotal = dataSourceTotalCount || dataSource.length;
|
|
36
|
+
const {
|
|
37
|
+
hideSelectAll
|
|
38
|
+
} = selection || {};
|
|
42
39
|
if (selection && selection.limit) {
|
|
43
|
-
return
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
dataSource: dataSource,
|
|
48
|
-
dataSourceFull: dataSourceFull,
|
|
49
|
-
selection: selection,
|
|
50
|
-
locale: locale,
|
|
51
|
-
hasSelectionLimit: true,
|
|
52
|
-
childrenColumnName: childrenColumnName
|
|
53
|
-
}), /*#__PURE__*/React.createElement(TableLimit, {
|
|
54
|
-
total: tableTotal,
|
|
55
|
-
selection: _extends({}, selection, {
|
|
40
|
+
return /* @__PURE__ */ jsxs(Left, { "data-testid": "ds-table-selection", children: [
|
|
41
|
+
selection && !hideSelectAll && /* @__PURE__ */ jsx(TableSelection, { rowKey, dataSource, dataSourceFull, selection, locale, hasSelectionLimit: true, childrenColumnName }),
|
|
42
|
+
/* @__PURE__ */ jsx(TableLimit, { total: tableTotal, selection: {
|
|
43
|
+
...selection,
|
|
56
44
|
limit: selection.limit
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
locale: locale,
|
|
60
|
-
renderCustomCounter: renderCustomCounter,
|
|
61
|
-
isCounterLoading: isCounterLoading
|
|
62
|
-
}));
|
|
45
|
+
}, itemsMenu, locale, renderCustomCounter, isCounterLoading })
|
|
46
|
+
] });
|
|
63
47
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
"
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
description: /*#__PURE__*/React.createElement(React.Fragment, null, title),
|
|
100
|
-
type: 'largeSimple',
|
|
101
|
-
offset: 'small'
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}, /*#__PURE__*/React.createElement(React.Fragment, null, title)), !hideTitlePart && /*#__PURE__*/React.createElement(S.TitleSeparator, null)), !isLoading && !hideTitlePart && /*#__PURE__*/React.createElement(S.TitlePart, null, isCounterLoading ? /*#__PURE__*/React.createElement(S.Skeleton, {
|
|
105
|
-
numberOfSkeletons: 1,
|
|
106
|
-
size: "S",
|
|
107
|
-
skeletonWidth: "100px"
|
|
108
|
-
}) : /*#__PURE__*/React.createElement(React.Fragment, null, renderCustomCounter ? renderCustomCounter({
|
|
109
|
-
count: tableTotal,
|
|
110
|
-
content: counterContent
|
|
111
|
-
}) : counterContent))));
|
|
48
|
+
const selectedItemsCount = selectedRows || tableTotal;
|
|
49
|
+
const counterContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
50
|
+
/* @__PURE__ */ jsx("strong", { children: formatValue(tableTotal) }),
|
|
51
|
+
/* @__PURE__ */ jsx("span", { children: locale?.pagination?.items })
|
|
52
|
+
] });
|
|
53
|
+
return hasSelectedItems ? /* @__PURE__ */ jsxs(Left, { "data-testid": "ds-table-selection", children: [
|
|
54
|
+
selection && !hideSelectAll && /* @__PURE__ */ jsx(TableSelection, { rowKey, dataSource, dataSourceFull, selection, locale, childrenColumnName }),
|
|
55
|
+
renderSelectionTitle ? /* @__PURE__ */ jsx(Fragment, { children: renderSelectionTitle(selection, filters) }) : /* @__PURE__ */ jsx(TitleContainer, { children: isCounterLoading ? /* @__PURE__ */ jsx(Skeleton, { numberOfSkeletons: 1, size: "S", skeletonWidth: "100px" }) : /* @__PURE__ */ jsxs(TitlePart, { children: [
|
|
56
|
+
/* @__PURE__ */ jsx("strong", { children: formatValue(selectedItemsCount) }),
|
|
57
|
+
" ",
|
|
58
|
+
/* @__PURE__ */ jsx("span", { children: locale.selected })
|
|
59
|
+
] }) }),
|
|
60
|
+
itemsMenu
|
|
61
|
+
] }) : /* @__PURE__ */ jsxs(Left, { "data-testid": "ds-table-title", children: [
|
|
62
|
+
selection && !isLoading && !hideSelectAll && /* @__PURE__ */ jsx(TableSelection, { rowKey, dataSource, dataSourceFull, selection, locale, childrenColumnName }),
|
|
63
|
+
/* @__PURE__ */ jsxs(TitleContainer, { children: [
|
|
64
|
+
isLoading && /* @__PURE__ */ jsx("div", { style: {
|
|
65
|
+
width: "100px"
|
|
66
|
+
}, children: /* @__PURE__ */ jsx(Skeleton, { width: "L", numberOfSkeletons: 1, skeletonWidth: "100px" }) }),
|
|
67
|
+
!isLoading && title && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
68
|
+
/* @__PURE__ */ jsx(TitlePartEllipsis, { ellipsis: {
|
|
69
|
+
tooltipProps: {
|
|
70
|
+
description: /* @__PURE__ */ jsx(Fragment, { children: title }),
|
|
71
|
+
type: "largeSimple",
|
|
72
|
+
offset: "small"
|
|
73
|
+
}
|
|
74
|
+
}, children: /* @__PURE__ */ jsx(Fragment, { children: title }) }),
|
|
75
|
+
!hideTitlePart && /* @__PURE__ */ jsx(TitleSeparator, {})
|
|
76
|
+
] }),
|
|
77
|
+
!isLoading && !hideTitlePart && /* @__PURE__ */ jsx(TitlePart, { children: isCounterLoading ? /* @__PURE__ */ jsx(Skeleton, { numberOfSkeletons: 1, size: "S", skeletonWidth: "100px" }) : /* @__PURE__ */ jsx(Fragment, { children: renderCustomCounter ? renderCustomCounter({
|
|
78
|
+
count: tableTotal,
|
|
79
|
+
content: counterContent
|
|
80
|
+
}) : counterContent }) })
|
|
81
|
+
] })
|
|
82
|
+
] });
|
|
112
83
|
}, [selection, selectedRows, dataSourceTotalCount, dataSource, hasSelectedItems, rowKey, dataSourceFull, locale, childrenColumnName, renderSelectionTitle, filters, isCounterLoading, renderCustomCounter, formatValue, itemsMenu, isLoading, title, hideTitlePart]);
|
|
113
|
-
return
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
key: filter.key,
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
selected: filter.selected,
|
|
126
|
-
disabled: filter.disabled
|
|
127
|
-
});
|
|
128
|
-
}), filterComponent && /*#__PURE__*/React.createElement(S.RightSideWrapper, {
|
|
129
|
-
"data-testid": "ds-table-filter-wrapper"
|
|
130
|
-
}, filterComponent), searchComponent && /*#__PURE__*/React.createElement(S.RightSideWrapper, {
|
|
131
|
-
"data-testid": "ds-table-search-wrapper"
|
|
132
|
-
}, searchComponent)));
|
|
84
|
+
return /* @__PURE__ */ jsxs(Header, { withBorderTop, children: [
|
|
85
|
+
renderLeftSide,
|
|
86
|
+
/* @__PURE__ */ jsxs(Right, { children: [
|
|
87
|
+
headerButton,
|
|
88
|
+
filters?.map((filter) => /* @__PURE__ */ jsx(FilterTrigger, { name: filter.key, iconComponent: filter.icon, tooltips: filter.tooltips, openedLabel: filter.openedLabel, handleClear: filter.handleClear, show: filter.show, showList: filter.showList, selected: filter.selected, disabled: filter.disabled }, filter.key)),
|
|
89
|
+
filterComponent && /* @__PURE__ */ jsx(RightSideWrapper, { "data-testid": "ds-table-filter-wrapper", children: filterComponent }),
|
|
90
|
+
searchComponent && /* @__PURE__ */ jsx(RightSideWrapper, { "data-testid": "ds-table-search-wrapper", children: searchComponent })
|
|
91
|
+
] })
|
|
92
|
+
] });
|
|
93
|
+
};
|
|
94
|
+
export {
|
|
95
|
+
TableHeader as default
|
|
133
96
|
};
|
|
134
|
-
export default TableHeader;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { CustomCounterFn, Filter, Locale, RowSelection } from '../Table.types';
|
|
3
3
|
export type Props<T extends object> = {
|
|
4
4
|
title?: ReactNode | (() => ReactNode);
|
|
5
5
|
filters?: Filter[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TableLimitProps } from './TableLimit.types';
|
|
3
3
|
export declare function TableLimit<T extends {
|
|
4
4
|
children?: T[];
|
|
5
5
|
}>({ total, locale, itemsMenu, selection, isCounterLoading, renderCustomCounter, }: TableLimitProps<T>): React.JSX.Element;
|
|
@@ -1,39 +1,47 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import Alert$1 from "@synerise/ds-alert";
|
|
4
|
+
import { useDataFormat } from "@synerise/ds-core";
|
|
5
|
+
import { Skeleton } from "../../Table.styles.js";
|
|
6
|
+
import { Alert, Title, TableLimit as TableLimit$1, ItemsMenu } from "./TableLimit.styles.js";
|
|
7
|
+
function TableLimit({
|
|
8
|
+
total,
|
|
9
|
+
locale,
|
|
10
|
+
itemsMenu,
|
|
11
|
+
selection,
|
|
12
|
+
isCounterLoading,
|
|
13
|
+
renderCustomCounter
|
|
14
|
+
}) {
|
|
15
|
+
const {
|
|
16
|
+
formatValue
|
|
17
|
+
} = useDataFormat();
|
|
18
|
+
const {
|
|
19
|
+
selectedRowKeys,
|
|
20
|
+
limit
|
|
21
|
+
} = selection;
|
|
22
|
+
const selectedRows = useMemo(() => selectedRowKeys.length || 0, [selectedRowKeys]);
|
|
23
|
+
const limitReachedInfo = useMemo(() => limit <= selectedRows && /* @__PURE__ */ jsx(Alert, { children: /* @__PURE__ */ jsx(Alert$1.InlineAlert, { type: "warning", message: locale.selectionLimitWarning }) }), [locale, selectedRows, limit]);
|
|
24
|
+
const selected = useMemo(() => {
|
|
25
|
+
const counterContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
26
|
+
/* @__PURE__ */ jsx("strong", { children: formatValue(total) }),
|
|
27
|
+
" ",
|
|
28
|
+
locale.pagination?.items
|
|
29
|
+
] });
|
|
30
|
+
return selectedRows > 0 ? /* @__PURE__ */ jsxs(Title, { children: [
|
|
31
|
+
/* @__PURE__ */ jsx("strong", { children: `${formatValue(selectedRows)} / ${formatValue(limit)}` }),
|
|
32
|
+
" ",
|
|
33
|
+
locale.selected
|
|
34
|
+
] }) : /* @__PURE__ */ jsx(Title, { children: isCounterLoading ? /* @__PURE__ */ jsx(Skeleton, { numberOfSkeletons: 1, size: "S", skeletonWidth: "100px" }) : /* @__PURE__ */ jsx(Fragment, { children: renderCustomCounter ? renderCustomCounter({
|
|
34
35
|
count: total,
|
|
35
36
|
content: counterContent
|
|
36
|
-
}) : counterContent));
|
|
37
|
+
}) : counterContent }) });
|
|
37
38
|
}, [formatValue, renderCustomCounter, limit, locale.pagination, locale.selected, isCounterLoading, selectedRows, total]);
|
|
38
|
-
return
|
|
39
|
-
|
|
39
|
+
return /* @__PURE__ */ jsxs(TableLimit$1, { children: [
|
|
40
|
+
selected,
|
|
41
|
+
limitReachedInfo,
|
|
42
|
+
selectedRows > 0 && /* @__PURE__ */ jsx(ItemsMenu, { children: itemsMenu })
|
|
43
|
+
] });
|
|
44
|
+
}
|
|
45
|
+
export {
|
|
46
|
+
TableLimit
|
|
47
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const TableLimit: import(
|
|
2
|
-
export declare const Title: import(
|
|
3
|
-
export declare const Alert: import(
|
|
4
|
-
export declare const ItemsMenu: import(
|
|
1
|
+
export declare const TableLimit: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
2
|
+
export declare const Title: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
3
|
+
export declare const Alert: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
4
|
+
export declare const ItemsMenu: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
import { macro } from
|
|
3
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { macro } from "@synerise/ds-typography";
|
|
3
|
+
const TableLimit = /* @__PURE__ */ styled.div.withConfig({
|
|
4
4
|
displayName: "TableLimitstyles__TableLimit",
|
|
5
5
|
componentId: "sc-8y43k7-0"
|
|
6
6
|
})(["display:flex;align-items:center;justify-content:flex-start;"]);
|
|
7
|
-
|
|
7
|
+
const Title = /* @__PURE__ */ styled.div.withConfig({
|
|
8
8
|
displayName: "TableLimitstyles__Title",
|
|
9
9
|
componentId: "sc-8y43k7-1"
|
|
10
|
-
})(["", ";color:", ";strong{font-weight:500;}display:flex;align-items:center;gap:4px;"], macro.small,
|
|
11
|
-
|
|
12
|
-
});
|
|
13
|
-
export var Alert = styled.div.withConfig({
|
|
10
|
+
})(["", ";color:", ";strong{font-weight:500;}display:flex;align-items:center;gap:4px;"], macro.small, (props) => props.theme.palette["grey-700"]);
|
|
11
|
+
const Alert = /* @__PURE__ */ styled.div.withConfig({
|
|
14
12
|
displayName: "TableLimitstyles__Alert",
|
|
15
13
|
componentId: "sc-8y43k7-2"
|
|
16
|
-
})(["position:relative;padding-left:16px;margin-left:16px;&::before{position:absolute;top:4px;left:0;content:'';display:flex;width:1px;height:16px;background:", ";}"],
|
|
17
|
-
|
|
18
|
-
});
|
|
19
|
-
export var ItemsMenu = styled.div.withConfig({
|
|
14
|
+
})(["position:relative;padding-left:16px;margin-left:16px;&::before{position:absolute;top:4px;left:0;content:'';display:flex;width:1px;height:16px;background:", ";}"], (props) => props.theme.palette["grey-200"]);
|
|
15
|
+
const ItemsMenu = /* @__PURE__ */ styled.div.withConfig({
|
|
20
16
|
displayName: "TableLimitstyles__ItemsMenu",
|
|
21
17
|
componentId: "sc-8y43k7-3"
|
|
22
|
-
})(["padding-left:24px;"]);
|
|
18
|
+
})(["padding-left:24px;"]);
|
|
19
|
+
export {
|
|
20
|
+
Alert,
|
|
21
|
+
ItemsMenu,
|
|
22
|
+
TableLimit,
|
|
23
|
+
Title
|
|
24
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { RequiredProps } from '@synerise/ds-utils';
|
|
3
|
+
import { CustomCounterFn, Locale, RowSelection } from '../../Table.types';
|
|
4
4
|
export type TableLimitProps<T extends object> = {
|
|
5
5
|
selection: RequiredProps<RowSelection<T>, 'limit'>;
|
|
6
6
|
total: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { TableSelectionProps } from './TableSelection.types';
|
|
3
3
|
declare const TableSelection: <T extends {
|
|
4
4
|
children?: T[];
|
|
5
5
|
}>({ dataSource, dataSourceFull, selection, rowKey, locale, hasSelectionLimit, childrenColumnName, }: TableSelectionProps<T>) => React.JSX.Element | null;
|