@synerise/ds-table 1.9.10 → 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 +8 -0
- package/README.md +9 -10
- 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 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
export declare const LoadingItem: () => React.JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { useTableLocaleContext } from
|
|
3
|
-
import { Loader } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTableLocaleContext } from "../utils/locale.js";
|
|
3
|
+
import { Loader } from "./InfiniteLoaderItem.styles.js";
|
|
4
|
+
const LoadingItem = () => {
|
|
5
|
+
const tableLocale = useTableLocaleContext();
|
|
6
|
+
return /* @__PURE__ */ jsx(Loader, { size: "M", label: tableLocale.infiniteScrollLoading });
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
LoadingItem
|
|
10
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import { default as React } from 'react';
|
|
2
2
|
export declare const NoMoreItem: () => React.JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Alert from
|
|
3
|
-
import { useTableLocaleContext } from
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
return
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import Alert from "@synerise/ds-alert";
|
|
3
|
+
import { useTableLocaleContext } from "../utils/locale.js";
|
|
4
|
+
const NoMoreItem = () => {
|
|
5
|
+
const tableLocale = useTableLocaleContext();
|
|
6
|
+
return /* @__PURE__ */ jsx(Alert.InlineAlert, { type: "info", message: tableLocale.infiniteScrollNoMoreData });
|
|
7
|
+
};
|
|
8
|
+
export {
|
|
9
|
+
NoMoreItem
|
|
10
|
+
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import React,
|
|
1
|
+
import { default as React, MutableRefObject } from 'react';
|
|
2
2
|
declare const OuterListElement: (containerRef: MutableRefObject<HTMLDivElement | null | undefined>, isSticky: boolean) => React.ForwardRefExoticComponent<React.HTMLAttributes<Element> & React.RefAttributes<HTMLDivElement>>;
|
|
3
3
|
export default OuterListElement;
|
|
@@ -1,60 +1,47 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
useEffect(function () {
|
|
16
|
-
if (containerRef != null && containerRef.current) {
|
|
17
|
-
var headerElement = containerRef.current.querySelector('.ant-table-header');
|
|
18
|
-
headerElement && setHeader(headerElement);
|
|
19
|
-
}
|
|
20
|
-
}, []);
|
|
21
|
-
var onScrollHandler = useCallback(function (event) {
|
|
22
|
-
if (header) {
|
|
23
|
-
header.scrollTo({
|
|
24
|
-
left: event.currentTarget.scrollLeft
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
onScroll && onScroll(event);
|
|
28
|
-
}, [onScroll, header]);
|
|
29
|
-
var onWheelHandler = function onWheelHandler(event) {
|
|
30
|
-
if (header) {
|
|
31
|
-
var _event$currentTarget;
|
|
32
|
-
header.scrollTo({
|
|
33
|
-
left: (_event$currentTarget = event.currentTarget) == null || (_event$currentTarget = _event$currentTarget.parentElement) == null ? void 0 : _event$currentTarget.scrollLeft
|
|
34
|
-
});
|
|
35
|
-
}
|
|
36
|
-
onWheel && onWheel(event);
|
|
37
|
-
};
|
|
38
|
-
if (isSticky) {
|
|
39
|
-
// uses native browser scroll
|
|
40
|
-
var _ref2 = style || {},
|
|
41
|
-
height = _ref2.height,
|
|
42
|
-
rest = _objectWithoutPropertiesLoose(_ref2, _excluded);
|
|
43
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
44
|
-
ref: ref,
|
|
45
|
-
onWheel: onWheelHandler,
|
|
46
|
-
"data-testid": "virtual-table-scrollable-window-sticky",
|
|
47
|
-
style: _extends({}, rest, {
|
|
48
|
-
maxHeight: height
|
|
49
|
-
})
|
|
50
|
-
}, children);
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useState, useEffect, useCallback } from "react";
|
|
3
|
+
import Scrollbar from "@synerise/ds-scrollbar";
|
|
4
|
+
const OuterListElement = (containerRef, isSticky) => forwardRef(({
|
|
5
|
+
onWheel,
|
|
6
|
+
onScroll,
|
|
7
|
+
children,
|
|
8
|
+
style
|
|
9
|
+
}, ref) => {
|
|
10
|
+
const [header, setHeader] = useState(null);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
if (containerRef?.current) {
|
|
13
|
+
const headerElement = containerRef.current.querySelector(".ant-table-header");
|
|
14
|
+
headerElement && setHeader(headerElement);
|
|
51
15
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
16
|
+
}, []);
|
|
17
|
+
const onScrollHandler = useCallback((event) => {
|
|
18
|
+
if (header) {
|
|
19
|
+
header.scrollTo({
|
|
20
|
+
left: event.currentTarget.scrollLeft
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
onScroll && onScroll(event);
|
|
24
|
+
}, [onScroll, header]);
|
|
25
|
+
const onWheelHandler = (event) => {
|
|
26
|
+
if (header) {
|
|
27
|
+
header.scrollTo({
|
|
28
|
+
left: event.currentTarget?.parentElement?.scrollLeft
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
onWheel && onWheel(event);
|
|
32
|
+
};
|
|
33
|
+
if (isSticky) {
|
|
34
|
+
const {
|
|
35
|
+
height,
|
|
36
|
+
...rest
|
|
37
|
+
} = style || {};
|
|
38
|
+
return /* @__PURE__ */ jsx("div", { ref, onWheel: onWheelHandler, "data-testid": "virtual-table-scrollable-window-sticky", style: {
|
|
39
|
+
...rest,
|
|
40
|
+
maxHeight: height
|
|
41
|
+
}, children });
|
|
42
|
+
}
|
|
43
|
+
return /* @__PURE__ */ jsx(Scrollbar, { ref, onScroll: onScrollHandler, absolute: true, maxHeight: style?.height, children });
|
|
44
|
+
});
|
|
45
|
+
export {
|
|
46
|
+
OuterListElement as default
|
|
59
47
|
};
|
|
60
|
-
export default OuterListElement;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InfiniteScrollProps, InfiniteScrollState } from './InfiniteLoaderItem.types';
|
|
2
2
|
export declare const infiniteScrollPropsToState: ({ hasError, hasMore, isLoading, }: InfiniteScrollProps & InfiniteScrollState) => InfiniteScrollState;
|
|
3
3
|
declare const _default: {
|
|
4
4
|
infiniteScrollPropsToState: ({ hasError, hasMore, isLoading, }: InfiniteScrollProps & InfiniteScrollState) => InfiniteScrollState;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
const infiniteScrollPropsToState = ({
|
|
2
|
+
hasError,
|
|
3
|
+
hasMore,
|
|
4
|
+
isLoading
|
|
5
|
+
}) => ({
|
|
6
|
+
hasError,
|
|
7
|
+
hasMore,
|
|
8
|
+
isLoading
|
|
9
|
+
});
|
|
10
|
+
const utils = {
|
|
11
|
+
infiniteScrollPropsToState
|
|
12
|
+
};
|
|
13
|
+
export {
|
|
14
|
+
utils as default,
|
|
15
|
+
infiniteScrollPropsToState
|
|
10
16
|
};
|
|
11
|
-
export default {
|
|
12
|
-
infiniteScrollPropsToState: infiniteScrollPropsToState
|
|
13
|
-
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ItemsMenu as ItemsMenu$1 } from "./ItemsMenu.styles.js";
|
|
3
|
+
const ItemsMenu = ({
|
|
4
|
+
children
|
|
5
|
+
}) => /* @__PURE__ */ jsx(ItemsMenu$1, { children });
|
|
6
|
+
export {
|
|
7
|
+
ItemsMenu as default
|
|
6
8
|
};
|
|
7
|
-
export default ItemsMenu;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ItemsMenu: import(
|
|
1
|
+
export declare const ItemsMenu: import('styled-components').StyledComponent<"div", any, {}, never>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import styled from
|
|
2
|
-
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
const ItemsMenu = /* @__PURE__ */ styled.div.withConfig({
|
|
3
3
|
displayName: "ItemsMenustyles__ItemsMenu",
|
|
4
4
|
componentId: "sc-zmeifj-0"
|
|
5
|
-
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;> *{margin-right:8px;}&:last-child{margin-right:0;}"]);
|
|
5
|
+
})(["display:flex;flex-direction:row;align-items:center;justify-content:flex-start;> *{margin-right:8px;}&:last-child{margin-right:0;}"]);
|
|
6
|
+
export {
|
|
7
|
+
ItemsMenu
|
|
8
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { RowType } from '../Table.types';
|
|
3
|
+
import { RowSelectionProps } from './RowSelectionColumn.types';
|
|
4
4
|
export declare function RowSelectionColumn<T extends object & RowType<T>>({ rowKey, record, limit, independentSelectionExpandedRows, isGlobalAllSelected, selectedRowKeys, selectedRecords, tableLocale, onChange, checkRowSelectionStatus, childrenColumnName, getSelectionTooltipProps, }: RowSelectionProps<T>): React.JSX.Element | null;
|
|
@@ -1,103 +1,99 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { Checkbox } from
|
|
4
|
-
import { useRowKey } from
|
|
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
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useMemo } from "react";
|
|
3
|
+
import { Checkbox } from "@synerise/ds-button";
|
|
4
|
+
import { useRowKey } from "../hooks/useRowKey/useRowKey.js";
|
|
5
|
+
import "unit-to-px";
|
|
6
|
+
import { getRecordSelectionStatus } from "../utils/getRecordSelectionStatus.js";
|
|
7
|
+
import "../Table.styles.js";
|
|
8
|
+
import "@synerise/ds-skeleton";
|
|
9
|
+
import "uuid";
|
|
10
|
+
import "styled-components";
|
|
11
|
+
import "@synerise/ds-typography";
|
|
12
|
+
import "ramda";
|
|
13
|
+
import { isRecordSelectable } from "../utils/isRecordSelectable.js";
|
|
14
|
+
import "../utils/locale.js";
|
|
15
|
+
function RowSelectionColumn({
|
|
16
|
+
rowKey,
|
|
17
|
+
record,
|
|
18
|
+
limit,
|
|
19
|
+
independentSelectionExpandedRows,
|
|
20
|
+
isGlobalAllSelected,
|
|
21
|
+
selectedRowKeys,
|
|
22
|
+
selectedRecords,
|
|
23
|
+
tableLocale,
|
|
24
|
+
onChange,
|
|
25
|
+
checkRowSelectionStatus,
|
|
26
|
+
childrenColumnName,
|
|
27
|
+
getSelectionTooltipProps
|
|
28
|
+
}) {
|
|
29
|
+
const {
|
|
30
|
+
getRowKey
|
|
31
|
+
} = useRowKey(rowKey);
|
|
32
|
+
const recordKey = getRowKey(record);
|
|
33
|
+
const rowChildren = record[childrenColumnName];
|
|
34
|
+
const isSelectable = useCallback((item) => isRecordSelectable(item, checkRowSelectionStatus), [checkRowSelectionStatus]);
|
|
35
|
+
const checkedChildren = useMemo(() => {
|
|
36
|
+
return rowChildren?.filter((child) => {
|
|
37
|
+
const childKey = getRowKey(child);
|
|
29
38
|
return childKey && selectedRowKeys.indexOf(childKey) >= 0 && isSelectable(child);
|
|
30
|
-
})
|
|
39
|
+
}) || [];
|
|
31
40
|
}, [isSelectable, getRowKey, rowChildren, selectedRowKeys]);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}, [getRowKey, isSelectable, rowChildren, selectedRowKeys]);
|
|
38
|
-
var isIndeterminate = useMemo(function () {
|
|
41
|
+
const allChildrenSelected = useMemo(() => !!rowChildren?.filter(isSelectable).every((child) => {
|
|
42
|
+
const childKey = getRowKey(child);
|
|
43
|
+
return childKey && selectedRowKeys.indexOf(childKey) >= 0;
|
|
44
|
+
}), [getRowKey, isSelectable, rowChildren, selectedRowKeys]);
|
|
45
|
+
const isIndeterminate = useMemo(() => {
|
|
39
46
|
if (Array.isArray(rowChildren) && !independentSelectionExpandedRows) {
|
|
40
|
-
|
|
47
|
+
const clickableChildren = rowChildren?.filter(isSelectable);
|
|
41
48
|
return checkedChildren.length > 0 && checkedChildren.length < (clickableChildren.length || 0);
|
|
42
49
|
}
|
|
43
50
|
return false;
|
|
44
51
|
}, [checkedChildren.length, independentSelectionExpandedRows, isSelectable, rowChildren]);
|
|
45
|
-
|
|
52
|
+
const isChecked = useMemo(() => {
|
|
53
|
+
const isRecordChecked = recordKey !== void 0 && selectedRowKeys && selectedRowKeys.indexOf(recordKey) >= 0;
|
|
46
54
|
if (Array.isArray(rowChildren) && !independentSelectionExpandedRows) {
|
|
47
|
-
return
|
|
55
|
+
return isRecordChecked || allChildrenSelected;
|
|
48
56
|
}
|
|
49
|
-
return
|
|
57
|
+
return isRecordChecked;
|
|
50
58
|
}, [allChildrenSelected, independentSelectionExpandedRows, rowChildren, recordKey, selectedRowKeys]);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
59
|
+
const handleSelectionChange = useCallback((isCheckedNext, changedRecord) => {
|
|
60
|
+
let selectedRows = selectedRecords;
|
|
61
|
+
const changedRecordChildren = changedRecord[childrenColumnName];
|
|
54
62
|
if (isCheckedNext) {
|
|
55
63
|
if (Array.isArray(changedRecordChildren) && !independentSelectionExpandedRows) {
|
|
56
|
-
|
|
57
|
-
selectedRows = [
|
|
64
|
+
const clickableChildren = changedRecordChildren.filter(isSelectable);
|
|
65
|
+
selectedRows = [...selectedRows, ...clickableChildren];
|
|
58
66
|
} else {
|
|
59
|
-
selectedRows = [
|
|
67
|
+
selectedRows = [...selectedRows, changedRecord];
|
|
60
68
|
}
|
|
61
69
|
} else if (Array.isArray(changedRecordChildren) && !independentSelectionExpandedRows) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
});
|
|
65
|
-
selectedRows = selectedRows.filter(function (child) {
|
|
66
|
-
return childrenKeys.indexOf(getRowKey(child)) < 0;
|
|
67
|
-
});
|
|
70
|
+
const childrenKeys = changedRecordChildren.filter(isSelectable).map((child) => getRowKey(child));
|
|
71
|
+
selectedRows = selectedRows.filter((child) => childrenKeys.indexOf(getRowKey(child)) < 0);
|
|
68
72
|
} else {
|
|
69
|
-
selectedRows = selectedRows.filter(
|
|
70
|
-
return getRowKey(row) !== recordKey;
|
|
71
|
-
});
|
|
73
|
+
selectedRows = selectedRows.filter((row) => getRowKey(row) !== recordKey);
|
|
72
74
|
}
|
|
73
75
|
selectedRows = Array.from(new Set(selectedRows));
|
|
74
|
-
onChange && onChange(selectedRows.reduce(
|
|
75
|
-
|
|
76
|
-
if (key !==
|
|
77
|
-
return [
|
|
76
|
+
onChange && onChange(selectedRows.reduce((acc, current) => {
|
|
77
|
+
const key = getRowKey(current);
|
|
78
|
+
if (key !== void 0) {
|
|
79
|
+
return [...acc, key];
|
|
78
80
|
}
|
|
79
81
|
return acc;
|
|
80
82
|
}, []), selectedRows);
|
|
81
83
|
}, [getRowKey, independentSelectionExpandedRows, isSelectable, onChange, recordKey, selectedRecords, childrenColumnName]);
|
|
82
|
-
|
|
83
|
-
unavailable
|
|
84
|
-
disabled
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
},
|
|
99
|
-
tooltipProps: _extends({
|
|
100
|
-
title: tableLocale == null ? void 0 : tableLocale.selectRowTooltip
|
|
101
|
-
}, recordTooltip)
|
|
102
|
-
}) : null;
|
|
103
|
-
}
|
|
84
|
+
const {
|
|
85
|
+
unavailable,
|
|
86
|
+
disabled
|
|
87
|
+
} = getRecordSelectionStatus(checkRowSelectionStatus, record);
|
|
88
|
+
const disabledProp = isGlobalAllSelected || !isChecked && Boolean(limit !== void 0 && limit <= selectedRowKeys.length) || disabled;
|
|
89
|
+
const recordTooltip = getSelectionTooltipProps?.(record);
|
|
90
|
+
return recordKey !== void 0 && !unavailable ? /* @__PURE__ */ jsx(Checkbox, { "data-testid": "ds-table-selection-button", checked: isGlobalAllSelected || isChecked, disabled: disabledProp, indeterminate: isIndeterminate, onClick: (event) => {
|
|
91
|
+
event.stopPropagation();
|
|
92
|
+
}, onChange: (isCheckedNext) => !isGlobalAllSelected && handleSelectionChange(isCheckedNext, record), tooltipProps: {
|
|
93
|
+
title: tableLocale?.selectRowTooltip,
|
|
94
|
+
...recordTooltip
|
|
95
|
+
} }, `checkbox-${recordKey}`) : null;
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
RowSelectionColumn
|
|
99
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { TableProps } from 'rc-table/lib/Table';
|
|
2
|
+
import { Key } from 'react';
|
|
3
|
+
import { DSTableProps, RowSelection } from '../Table.types';
|
|
4
4
|
export type RowSelectionProps<T> = {
|
|
5
5
|
rowKey: TableProps<T>['rowKey'];
|
|
6
6
|
independentSelectionExpandedRows?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
|
package/dist/Table.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import '
|
|
3
|
-
import { type DSTableProps } from './Table.types';
|
|
4
|
-
import './style/index.less';
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DSTableProps } from './Table.types';
|
|
5
3
|
declare const DSTable: {
|
|
6
4
|
<T extends object>(props: DSTableProps<T>): React.JSX.Element;
|
|
7
5
|
SELECTION_ALL: string;
|