pixelize-design-library 2.2.185 → 2.2.187
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/coverage/clover.xml +638 -0
- package/coverage/coverage-final.json +20 -0
- package/coverage/lcov-report/Table/CompactSelect.tsx.html +379 -0
- package/coverage/lcov-report/Table/Components/ActiveFilters.tsx.html +514 -0
- package/coverage/lcov-report/Table/Components/HeaderActions.tsx.html +373 -0
- package/coverage/lcov-report/Table/Components/Pagination.tsx.html +574 -0
- package/coverage/lcov-report/Table/Components/TableActions.tsx.html +574 -0
- package/coverage/lcov-report/Table/Components/TableBody.tsx.html +1027 -0
- package/coverage/lcov-report/Table/Components/TableFilters.tsx.html +397 -0
- package/coverage/lcov-report/Table/Components/TableHeader.tsx.html +1060 -0
- package/coverage/lcov-report/Table/Components/TableLoading.tsx.html +361 -0
- package/coverage/lcov-report/Table/Components/TableSearch.tsx.html +337 -0
- package/coverage/lcov-report/Table/Components/index.html +266 -0
- package/coverage/lcov-report/Table/Components/useDebounce.ts.html +178 -0
- package/coverage/lcov-report/Table/Components/useTable.ts.html +778 -0
- package/coverage/lcov-report/Table/LeftFilterPane.tsx.html +1810 -0
- package/coverage/lcov-report/Table/SelectOperationControls.tsx.html +178 -0
- package/coverage/lcov-report/Table/Table.tsx.html +1567 -0
- package/coverage/lcov-report/Table/TableProps.tsx.html +658 -0
- package/coverage/lcov-report/Table/TableSettings/ManageColumns.tsx.html +619 -0
- package/coverage/lcov-report/Table/TableSettings/TableFilters.tsx.html +229 -0
- package/coverage/lcov-report/Table/TableSettings/TableSettings.tsx.html +532 -0
- package/coverage/lcov-report/Table/TableSettings/index.html +146 -0
- package/coverage/lcov-report/Table/TableToDo.tsx.html +973 -0
- package/coverage/lcov-report/Table/TextOperationControls.tsx.html +271 -0
- package/coverage/lcov-report/Table/filterTypes.ts.html +97 -0
- package/coverage/lcov-report/Table/index.html +176 -0
- package/coverage/lcov-report/base.css +224 -0
- package/coverage/lcov-report/block-navigation.js +87 -0
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +146 -0
- package/coverage/lcov-report/prettify.css +1 -0
- package/coverage/lcov-report/prettify.js +2 -0
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +210 -0
- package/coverage/lcov.info +1836 -0
- package/debug-storybook.log +72 -0
- package/dist/Assets/defaultLogo.tsx +31 -0
- package/dist/Components/Table/Components/TableBody.js +41 -40
- package/dist/Components/Table/Components/TableHeader.d.ts +1 -1
- package/dist/Components/Table/Components/TableHeader.js +4 -4
- package/dist/Components/Table/Components/useTable.d.ts +3 -1
- package/dist/Components/Table/Components/useTable.js +35 -17
- package/dist/Components/Table/Table.d.ts +1 -1
- package/dist/Components/Table/Table.js +4 -5
- package/dist/Components/Table/TableProps.d.ts +2 -0
- package/dist/Theme/Dark/palette.d.ts +370 -0
- package/dist/Theme/Dark/palette.js +372 -0
- package/package.json +1 -1
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
[14:50:38.093] [INFO] storybook v10.2.16
|
|
2
|
+
[14:50:40.124] [DEBUG] Getting package.json info for /Users/mahesh/Applications/Pixelize/CRM/Micro-Components/package.json...
|
|
3
|
+
[14:50:40.126] [WARN] You are currently using Storybook 10.2.16 but you have packages which are incompatible with it:
|
|
4
|
+
|
|
5
|
+
- @storybook/addon-essentials@8.6.14 which depends on 8.6.14
|
|
6
|
+
Repo: https://github.com/storybookjs/storybook/tree/next/code/addons/essentials
|
|
7
|
+
- @storybook/addon-interactions@8.6.14 which depends on 8.6.14
|
|
8
|
+
Repo: https://github.com/storybookjs/storybook/tree/next/code/addons/interactions
|
|
9
|
+
- @storybook/test@8.6.15 which depends on 8.6.15
|
|
10
|
+
Repo: https://github.com/storybookjs/storybook/tree/next/code/lib/test
|
|
11
|
+
|
|
12
|
+
Please consider updating your packages or contacting the maintainers for compatibility details.
|
|
13
|
+
|
|
14
|
+
For more details on compatibility guidance, see:
|
|
15
|
+
https://github.com/storybookjs/storybook/issues/32836
|
|
16
|
+
[14:50:40.147] [ERROR] [38;2;241;97;97mSB_CORE-SERVER_0002 (CriticalPresetLoadError): Storybook failed to load the following preset: @storybook/react-vite/preset.
|
|
17
|
+
|
|
18
|
+
Please check whether your setup is correct, the Storybook dependencies (and their peer dependencies) are installed correctly and there are no package version clashes.
|
|
19
|
+
|
|
20
|
+
If you believe this is a bug, please open an issue on Github.
|
|
21
|
+
|
|
22
|
+
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '@storybook/react-vite' imported from /Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/_node-chunks/chunk-EBZ4DOUR.js
|
|
23
|
+
at packageResolve (node:internal/modules/esm/resolve:873:9)
|
|
24
|
+
at moduleResolve (node:internal/modules/esm/resolve:946:18)
|
|
25
|
+
at defaultResolve (node:internal/modules/esm/resolve:1188:11)
|
|
26
|
+
at nextResolve (node:internal/modules/esm/hooks:864:28)
|
|
27
|
+
at Hooks.resolve (node:internal/modules/esm/hooks:306:30)
|
|
28
|
+
at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24)
|
|
29
|
+
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:831:20)
|
|
30
|
+
at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
|
|
31
|
+
|
|
32
|
+
More info:
|
|
33
|
+
[39m
|
|
34
|
+
at loadPreset (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/_node-chunks/chunk-UXMBIWPQ.js:10081:13)
|
|
35
|
+
at async Promise.all (index 0)
|
|
36
|
+
at async loadPresets (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/_node-chunks/chunk-UXMBIWPQ.js:10090:73)
|
|
37
|
+
at async getPresets (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/_node-chunks/chunk-UXMBIWPQ.js:10121:23)
|
|
38
|
+
at async buildDevStandalone (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/core-server/index.js:7661:17)
|
|
39
|
+
at async withTelemetry (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/_node-chunks/chunk-CSGMAQQ4.js:218:12)
|
|
40
|
+
at async dev (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/bin/core.js:2734:3)
|
|
41
|
+
at async _Command.<anonymous> (file:///Users/mahesh/.npm/_npx/6fe9a9991b157df1/node_modules/storybook/dist/bin/core.js:2804:92)
|
|
42
|
+
[14:50:40.152] [WARN] Broken build, fix the error above.
|
|
43
|
+
You may need to refresh the browser.
|
|
44
|
+
[14:50:40.159] [WARN] Failed to load preset: {"name":"/Users/mahesh/Applications/Pixelize/CRM/Micro-Components/node_modules/@storybook/addon-essentials/dist/preset.js"} on level 2
|
|
45
|
+
[14:50:40.159] [ERROR] [38;2;241;97;97mError: Cannot find module 'storybook/internal/common'
|
|
46
|
+
Require stack:
|
|
47
|
+
- ./node_modules/@storybook/addon-essentials/dist/preset.js[39m
|
|
48
|
+
at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
|
|
49
|
+
at Module._load (node:internal/modules/cjs/loader:1043:27)
|
|
50
|
+
at Module.require (node:internal/modules/cjs/loader:1298:19)
|
|
51
|
+
at require (node:internal/modules/helpers:182:18)
|
|
52
|
+
at Object.<anonymous> (./node_modules/@storybook/addon-essentials/dist/preset.js:4:14)
|
|
53
|
+
at Module._compile (node:internal/modules/cjs/loader:1529:14)
|
|
54
|
+
at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
|
|
55
|
+
at Module.load (node:internal/modules/cjs/loader:1275:32)
|
|
56
|
+
at Module._load (node:internal/modules/cjs/loader:1096:12)
|
|
57
|
+
at cjsLoader (node:internal/modules/esm/translators:298:15)
|
|
58
|
+
[14:50:40.161] [WARN] Failed to load preset: {"name":"/Users/mahesh/Applications/Pixelize/CRM/Micro-Components/node_modules/@storybook/addon-interactions/dist/preset.js"} on level 2
|
|
59
|
+
[14:50:40.161] [ERROR] [38;2;241;97;97mError: Cannot find module 'storybook/internal/common'
|
|
60
|
+
Require stack:
|
|
61
|
+
- ./node_modules/@storybook/addon-interactions/dist/preset.js[39m
|
|
62
|
+
at Module._resolveFilename (node:internal/modules/cjs/loader:1212:15)
|
|
63
|
+
at Module._load (node:internal/modules/cjs/loader:1043:27)
|
|
64
|
+
at Module.require (node:internal/modules/cjs/loader:1298:19)
|
|
65
|
+
at require (node:internal/modules/helpers:182:18)
|
|
66
|
+
at Object.<anonymous> (./node_modules/@storybook/addon-interactions/dist/preset.js:4:14)
|
|
67
|
+
at Module._compile (node:internal/modules/cjs/loader:1529:14)
|
|
68
|
+
at Module._extensions..js (node:internal/modules/cjs/loader:1613:10)
|
|
69
|
+
at Module.load (node:internal/modules/cjs/loader:1275:32)
|
|
70
|
+
at Module._load (node:internal/modules/cjs/loader:1096:12)
|
|
71
|
+
at cjsLoader (node:internal/modules/esm/translators:298:15)
|
|
72
|
+
[14:50:40.164] [INFO] Storybook collects completely anonymous usage telemetry. We use it to shape Storybook's roadmap and prioritize features. You can learn more, including how to opt out, at https://storybook.js.org/telemetry
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { useCustomTheme } from "../Theme/useCustomTheme";
|
|
3
|
+
|
|
4
|
+
const DefaultLogo = () => {
|
|
5
|
+
const theme = useCustomTheme();
|
|
6
|
+
return (
|
|
7
|
+
<svg
|
|
8
|
+
width="12.09"
|
|
9
|
+
height="15.95"
|
|
10
|
+
viewBox="0 0 31 29"
|
|
11
|
+
fill="none"
|
|
12
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
13
|
+
>
|
|
14
|
+
<path
|
|
15
|
+
d="M30.4999 6.26137V7.81058H15.9761H14.8787V22.8508V28.8862H12.5226C9.6824 28.8862 7.32632 26.4656 7.06812 23.3995C7.06812 23.2381 7.06812 23.0444 7.06812 22.8508V18.3323C7.06812 18.2677 7.06812 18.2032 7.06812 18.1063V15.5889V6.2291C7.06812 2.80793 9.84378 -5.72205e-06 13.2972 -5.72205e-06H24.8517C28.0147 0.355021 30.4676 3.00158 30.4676 6.2291L30.4999 6.26137Z"
|
|
16
|
+
fill={theme.colors.black}
|
|
17
|
+
/>
|
|
18
|
+
<path
|
|
19
|
+
d="M7.10053 23.3672H7.03598C5.16402 23.2381 3.48571 22.4635 2.25926 21.3338C0.871428 20.0428 0 18.2677 0 16.3312V15.6211H7.06825V18.1386C7.06825 18.2032 7.06825 18.2677 7.06825 18.3645V22.883C7.06825 23.0767 7.06825 23.2381 7.06825 23.4317L7.10053 23.3672Z"
|
|
20
|
+
fill={theme.colors.black}
|
|
21
|
+
/>
|
|
22
|
+
<path
|
|
23
|
+
d="M30.4678 12.0063V15.6211V17.1703C30.4678 20.6238 26.272 23.3994 21.0757 23.3994H14.8789V22.8508V15.6211H22.6572V7.81056C22.6895 7.81056 30.5001 7.81056 30.5001 7.81056V11.5868C30.5001 11.7159 30.5001 11.8772 30.5001 12.0063H30.4678Z"
|
|
24
|
+
fill={theme.colors.black}
|
|
25
|
+
/>
|
|
26
|
+
</svg>
|
|
27
|
+
|
|
28
|
+
)
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export default DefaultLogo;
|
|
@@ -44,50 +44,37 @@ var TableLoading_1 = require("./TableLoading");
|
|
|
44
44
|
var TableActions_1 = __importDefault(require("./TableActions"));
|
|
45
45
|
var lucide_react_1 = require("lucide-react");
|
|
46
46
|
var Checkbox_1 = __importDefault(require("../../Checkbox/Checkbox"));
|
|
47
|
+
var EMPTY_SX = {};
|
|
48
|
+
var EMPTY_HOVER = {};
|
|
47
49
|
var TableRow = react_2.default.memo(function (_a) {
|
|
48
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k
|
|
49
|
-
var row = _a.row, rowIndex = _a.rowIndex, index = _a.index, isChecked = _a.isChecked, isExpanded = _a.isExpanded, isContent = _a.isContent, isLink = _a.isLink, isCheckbox = _a.isCheckbox, isLoading = _a.isLoading, isActionFreeze = _a.isActionFreeze, columns = _a.columns,
|
|
50
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
51
|
+
var row = _a.row, rowIndex = _a.rowIndex, index = _a.index, isChecked = _a.isChecked, isExpanded = _a.isExpanded, isContent = _a.isContent, isLink = _a.isLink, isCheckbox = _a.isCheckbox, isLoading = _a.isLoading, isActionFreeze = _a.isActionFreeze, columns = _a.columns, leftOffsets = _a.leftOffsets, noBorders = _a.noBorders, freezedBgColor = _a.freezedBgColor, freezedTextColor = _a.freezedTextColor, theme = _a.theme, borderStyle = _a.borderStyle, hoverStyle = _a.hoverStyle, handleCheckbox = _a.handleCheckbox, onRowClick = _a.onRowClick, toggleRowExpansion = _a.toggleRowExpansion;
|
|
52
|
+
var checkedSx = (0, react_2.useMemo)(function () { return isChecked ? {
|
|
53
|
+
"& td": { backgroundColor: theme.colors.disabled[100] },
|
|
54
|
+
} : EMPTY_SX; }, [isChecked, theme.colors.disabled]);
|
|
55
|
+
var handleCellClick = (0, react_2.useCallback)(function (header) {
|
|
56
|
+
if (!header.node && onRowClick) {
|
|
57
|
+
onRowClick(row, { label: header.label, id: header.id });
|
|
58
|
+
}
|
|
59
|
+
}, [row, onRowClick]);
|
|
50
60
|
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
51
|
-
react_2.default.createElement(react_1.Tr, { opacity: isLoading ? 0.4 : 1, pointerEvents: isLoading ? "none" : "auto", transition: "opacity 0.2s", sx:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
backgroundColor: theme.colors.disabled[100],
|
|
55
|
-
},
|
|
56
|
-
}
|
|
57
|
-
: {} },
|
|
58
|
-
isContent && (react_2.default.createElement(react_1.Td, { w: "6", p: 0, fontSize: 14, backgroundColor: (_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.background) === null || _c === void 0 ? void 0 : _c[50], color: freezedTextColor, position: "sticky", borderBottom: noBorders ? "none" : "0.063rem solid ".concat((_d = theme.colors) === null || _d === void 0 ? void 0 : _d.border[500]), boxSizing: "border-box", left: 0, zIndex: 1, className: "columns sticky-columns" }, !!(row === null || row === void 0 ? void 0 : row.content) && (react_2.default.createElement(react_1.IconButton, { "aria-label": isExpanded ? "Collapse row" : "Expand row", color: (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.gray[600], icon: isExpanded ? (react_2.default.createElement(lucide_react_1.ChevronDown, { fontSize: 16 })) : (react_2.default.createElement(lucide_react_1.ChevronRight, { fontSize: 16 })), _hover: { transform: "scale(1.1)" }, size: "sm", onClick: function () { return toggleRowExpansion(rowIndex); }, variant: "ghost" })))),
|
|
59
|
-
isCheckbox && (react_2.default.createElement(react_1.Td, { w: "6", fontSize: 14, fontWeight: 600, color: (_g = (_f = theme.colors) === null || _f === void 0 ? void 0 : _f.background) === null || _g === void 0 ? void 0 : _g[50], textTransform: "capitalize", backgroundColor: (_j = (_h = theme.colors) === null || _h === void 0 ? void 0 : _h.background) === null || _j === void 0 ? void 0 : _j[50], position: "sticky", borderBottom: noBorders ? "none" : "0.063rem solid ".concat((_k = theme.colors) === null || _k === void 0 ? void 0 : _k.border[500]), boxSizing: "border-box", left: 0, zIndex: 1, className: "columns sticky-columns" },
|
|
61
|
+
react_2.default.createElement(react_1.Tr, { opacity: isLoading ? 0.4 : 1, pointerEvents: isLoading ? "none" : "auto", transition: "opacity 0.2s", sx: checkedSx },
|
|
62
|
+
isContent && (react_2.default.createElement(react_1.Td, { w: "6", p: 0, fontSize: 14, backgroundColor: (_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.background) === null || _c === void 0 ? void 0 : _c[50], color: freezedTextColor, position: "sticky", borderBottom: borderStyle, boxSizing: "border-box", left: 0, zIndex: 1, className: "columns sticky-columns" }, !!(row === null || row === void 0 ? void 0 : row.content) && (react_2.default.createElement(react_1.IconButton, { "aria-label": isExpanded ? "Collapse row" : "Expand row", color: (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.gray[600], icon: isExpanded ? (react_2.default.createElement(lucide_react_1.ChevronDown, { fontSize: 16 })) : (react_2.default.createElement(lucide_react_1.ChevronRight, { fontSize: 16 })), _hover: { transform: "scale(1.1)" }, size: "sm", onClick: function () { return toggleRowExpansion(rowIndex); }, variant: "ghost" })))),
|
|
63
|
+
isCheckbox && (react_2.default.createElement(react_1.Td, { w: "6", fontSize: 14, fontWeight: 600, color: (_f = (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.background) === null || _f === void 0 ? void 0 : _f[50], textTransform: "capitalize", backgroundColor: (_h = (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.background) === null || _h === void 0 ? void 0 : _h[50], position: "sticky", borderBottom: borderStyle, boxSizing: "border-box", left: 0, zIndex: 1, className: "columns sticky-columns" },
|
|
60
64
|
react_2.default.createElement(Checkbox_1.default, { "aria-label": "Select all rows", onChange: function () { return handleCheckbox(row.id); }, isChecked: isChecked }))),
|
|
61
65
|
columns.map(function (header, headerIndex) {
|
|
62
|
-
var _a, _b, _c, _d, _e
|
|
66
|
+
var _a, _b, _c, _d, _e;
|
|
63
67
|
if (header.isHidden)
|
|
64
68
|
return null;
|
|
65
69
|
var isFrozen = header.isFreeze;
|
|
66
|
-
|
|
67
|
-
isFrozen: isFrozen,
|
|
68
|
-
columnWidths: columnWidths,
|
|
69
|
-
headerIndex: headerIndex,
|
|
70
|
-
isCheckbox: isCheckbox,
|
|
71
|
-
header: header,
|
|
72
|
-
row: row,
|
|
73
|
-
freezedBgColor: freezedBgColor,
|
|
74
|
-
index: index,
|
|
75
|
-
theme: theme,
|
|
76
|
-
}).leftOffset;
|
|
77
|
-
return (react_2.default.createElement(react_1.Td, { maxWidth: 500, minWidth: 120, height: 45, key: headerIndex + 1, onClick: function () {
|
|
78
|
-
return !header.node
|
|
79
|
-
? onRowClick === null || onRowClick === void 0 ? void 0 : onRowClick(row, { label: header.label, id: header.id })
|
|
80
|
-
: null;
|
|
81
|
-
}, fontSize: 14, fontWeight: 400, position: isFrozen ? "sticky" : undefined, left: isFrozen ? leftOffset : undefined, zIndex: isFrozen ? 1 : 0, backgroundColor: (_a = theme.colors.background) === null || _a === void 0 ? void 0 : _a[50], textOverflow: "ellipsis", borderBottom: noBorders
|
|
70
|
+
return (react_2.default.createElement(react_1.Td, { maxWidth: 500, minWidth: 120, height: 45, key: headerIndex + 1, onClick: function () { return handleCellClick(header); }, fontSize: 14, fontWeight: 400, position: isFrozen ? "sticky" : undefined, left: isFrozen ? leftOffsets[headerIndex] : undefined, zIndex: isFrozen ? 1 : 0, backgroundColor: (_a = theme.colors.background) === null || _a === void 0 ? void 0 : _a[50], textOverflow: "ellipsis", borderBottom: noBorders
|
|
82
71
|
? "none"
|
|
83
72
|
: "0.063rem solid ".concat((_b = theme.colors) === null || _b === void 0 ? void 0 : _b.gray[isFrozen || isChecked ? 300 : 200]), className: "columns ".concat(isFrozen ? "sticky-columns" : "scrollable-columns"), boxSizing: "border-box", color: (_d = (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.text) === null || _d === void 0 ? void 0 : _d[500], _hover: ((_e = row.cellStyle) === null || _e === void 0 ? void 0 : _e[header.id]) || row.rowStyle
|
|
84
|
-
?
|
|
85
|
-
:
|
|
86
|
-
backgroundColor: (_g = (_f = theme.colors.secondary) === null || _f === void 0 ? void 0 : _f.opacity) === null || _g === void 0 ? void 0 : _g[4],
|
|
87
|
-
} },
|
|
73
|
+
? EMPTY_HOVER
|
|
74
|
+
: hoverStyle },
|
|
88
75
|
react_2.default.createElement(react_1.Box, { display: "block", overflow: "hidden", whiteSpace: "normal", overflowWrap: "break-word" }, (0, table_1.normalizeTableCellValue)(header.node ? header.node(row) : row[header.id]))));
|
|
89
76
|
}),
|
|
90
|
-
isLink && (react_2.default.createElement(react_1.Td, { w: 2, p: 0, fontSize: 14, backgroundColor: (
|
|
77
|
+
isLink && (react_2.default.createElement(react_1.Td, { w: 2, p: 0, fontSize: 14, backgroundColor: (_k = (_j = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _j === void 0 ? void 0 : _j.background) === null || _k === void 0 ? void 0 : _k[50], color: freezedTextColor, position: isActionFreeze ? "sticky" : "relative", borderBottom: borderStyle, boxSizing: "border-box", right: 0, zIndex: 1, className: "columns sticky-columns".concat(isActionFreeze ? "-right" : "") }, (row.onLink || row.onEdit || row.onDelete) && (react_2.default.createElement(TableActions_1.default, { row: row }))))),
|
|
91
78
|
row.content && isExpanded && (react_2.default.createElement(react_1.Tr, null,
|
|
92
79
|
react_2.default.createElement(react_1.Td, { colSpan: columns.length +
|
|
93
80
|
(isCheckbox ? 1 : 0) +
|
|
@@ -96,10 +83,11 @@ var TableRow = react_2.default.memo(function (_a) {
|
|
|
96
83
|
react_2.default.createElement(react_1.Box, { p: 2, bg: theme.colors.white, borderRadius: "md" }, row === null || row === void 0 ? void 0 : row.content(row)))))));
|
|
97
84
|
});
|
|
98
85
|
var TableBody = function (_a) {
|
|
99
|
-
var _b, _c, _d, _e, _f;
|
|
86
|
+
var _b, _c, _d, _e, _f, _g, _h;
|
|
100
87
|
var data = _a.data, isCheckbox = _a.isCheckbox, columns = _a.columns, startRow = _a.startRow, columnWidths = _a.columnWidths, freezedBgColor = _a.freezedBgColor, freezedTextColor = _a.freezedTextColor, noBorders = _a.noBorders, handleCheckbox = _a.handleCheckbox, selections = _a.selections, isLoading = _a.isLoading, onRowClick = _a.onRowClick, isContent = _a.isContent, isLink = _a.isLink, isActionFreeze = _a.isActionFreeze, loadingSkeletonRows = _a.loadingSkeletonRows;
|
|
101
88
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
102
|
-
var
|
|
89
|
+
var _j = (0, react_2.useState)(new Set()), expandedRows = _j[0], setExpandedRows = _j[1];
|
|
90
|
+
var selectionsSet = (0, react_2.useMemo)(function () { return new Set(selections); }, [selections]);
|
|
103
91
|
var toggleRowExpansion = (0, react_2.useCallback)(function (rowIndex) {
|
|
104
92
|
setExpandedRows(function (prev) {
|
|
105
93
|
var newSet = new Set(prev);
|
|
@@ -118,26 +106,39 @@ var TableBody = function (_a) {
|
|
|
118
106
|
(isContent ? 1 : 0) +
|
|
119
107
|
(isLink ? 1 : 0);
|
|
120
108
|
}, [columns, isCheckbox, isContent, isLink]);
|
|
109
|
+
var leftOffsets = (0, react_2.useMemo)(function () {
|
|
110
|
+
var checkboxOffset = isCheckbox ? 50 : 0;
|
|
111
|
+
return columnWidths.map(function (_, idx) {
|
|
112
|
+
return columnWidths.slice(0, idx).reduce(function (sum, w) { return sum + w; }, 0) + checkboxOffset;
|
|
113
|
+
});
|
|
114
|
+
}, [columnWidths, isCheckbox]);
|
|
115
|
+
var borderStyle = (0, react_2.useMemo)(function () { var _a; return noBorders ? "none" : "0.063rem solid ".concat((_a = theme.colors) === null || _a === void 0 ? void 0 : _a.border[500]); }, [noBorders, (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.border]);
|
|
116
|
+
var hoverStyle = (0, react_2.useMemo)(function () {
|
|
117
|
+
var _a, _b;
|
|
118
|
+
return ({
|
|
119
|
+
backgroundColor: (_b = (_a = theme.colors.secondary) === null || _a === void 0 ? void 0 : _a.opacity) === null || _b === void 0 ? void 0 : _b[4],
|
|
120
|
+
});
|
|
121
|
+
}, [(_c = theme.colors.secondary) === null || _c === void 0 ? void 0 : _c.opacity]);
|
|
121
122
|
if (isLoading && data.length === 0) {
|
|
122
123
|
return (react_2.default.createElement(TableLoading_1.TableBodyLoading, { noOfColumns: totalVisibleColumns, borderColor: theme.colors.gray[300], rowsCount: typeof loadingSkeletonRows === "number" ? loadingSkeletonRows : 4 }));
|
|
123
124
|
}
|
|
124
125
|
if (!isLoading && data.length === 0) {
|
|
125
|
-
return (react_2.default.createElement(react_1.Tr, { backgroundColor: (
|
|
126
|
+
return (react_2.default.createElement(react_1.Tr, { backgroundColor: (_d = theme.colors.background) === null || _d === void 0 ? void 0 : _d[50] },
|
|
126
127
|
react_2.default.createElement(react_1.Td, { colSpan: totalVisibleColumns, textAlign: "center", py: 4 },
|
|
127
|
-
react_2.default.createElement(react_1.Box, { textAlign: "center", fontSize: 14, color: (
|
|
128
|
+
react_2.default.createElement(react_1.Box, { textAlign: "center", fontSize: 14, color: (_f = (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.text) === null || _f === void 0 ? void 0 : _f[500] },
|
|
128
129
|
react_2.default.createElement("p", null, "No data found")))));
|
|
129
130
|
}
|
|
130
131
|
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
131
132
|
isLoading && data.length > 0 && (react_2.default.createElement(react_1.Tr, null,
|
|
132
133
|
react_2.default.createElement(react_1.Td, { colSpan: totalVisibleColumns, p: 0, border: "none", position: "relative", height: 0 },
|
|
133
134
|
react_2.default.createElement(react_1.Box, { position: "absolute", top: 4, left: "50%", transform: "translateX(-50%)", zIndex: 10 },
|
|
134
|
-
react_2.default.createElement(react_1.Spinner, { size: "sm", color: ((
|
|
135
|
+
react_2.default.createElement(react_1.Spinner, { size: "sm", color: ((_h = (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.primary) === null || _h === void 0 ? void 0 : _h[500]) || "blue.500" }))))),
|
|
135
136
|
data.map(function (row, index) {
|
|
136
137
|
var _a;
|
|
137
138
|
var rowIndex = startRow + index;
|
|
138
139
|
var isExpanded = expandedRows.has(rowIndex);
|
|
139
|
-
var isChecked =
|
|
140
|
-
return (react_2.default.createElement(TableRow, { key: (_a = row.id) !== null && _a !== void 0 ? _a : rowIndex, row: row, rowIndex: rowIndex, index: index, isChecked: isChecked, isExpanded: isExpanded, isContent: isContent, isLink: isLink, isCheckbox: isCheckbox, isLoading: isLoading, isActionFreeze: isActionFreeze, columns: columns,
|
|
140
|
+
var isChecked = selectionsSet.has(row.id);
|
|
141
|
+
return (react_2.default.createElement(TableRow, { key: (_a = row.id) !== null && _a !== void 0 ? _a : rowIndex, row: row, rowIndex: rowIndex, index: index, isChecked: isChecked, isExpanded: isExpanded, isContent: isContent, isLink: isLink, isCheckbox: isCheckbox, isLoading: isLoading, isActionFreeze: isActionFreeze, columns: columns, leftOffsets: leftOffsets, noBorders: noBorders, freezedBgColor: freezedBgColor, freezedTextColor: freezedTextColor, theme: theme, borderStyle: borderStyle, hoverStyle: hoverStyle, handleCheckbox: handleCheckbox, onRowClick: onRowClick, toggleRowExpansion: toggleRowExpansion }));
|
|
141
142
|
})));
|
|
142
143
|
};
|
|
143
144
|
exports.default = TableBody;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TableHeaderPageProps } from "../TableProps";
|
|
3
|
-
declare const _default: React.MemoExoticComponent<({ columns, isCheckbox, handleSort, headerRefs, columnWidths, columnsSort, headerBgColor, headerTextColor, freezedBgColor, freezedTextColor, noBorders, handleCheckbox, checked, isLoading, isContent, isLink, isActionFreeze, setColumnsSearch, columnsSearch, }: TableHeaderPageProps) => React.JSX.Element>;
|
|
3
|
+
declare const _default: React.MemoExoticComponent<({ columns, isCheckbox, handleSort, headerRefs, columnWidths, columnsSort, headerBgColor, headerTextColor, freezedBgColor, freezedTextColor, noBorders, handleCheckbox, checked, isLoading, isContent, isLink, isActionFreeze, setColumnsSearch, columnsSearch, isSelecting, }: TableHeaderPageProps) => React.JSX.Element>;
|
|
4
4
|
export default _default;
|
|
@@ -55,18 +55,18 @@ var TableFilters_1 = __importDefault(require("./TableFilters"));
|
|
|
55
55
|
var lucide_react_1 = require("lucide-react");
|
|
56
56
|
var Checkbox_1 = __importDefault(require("../../Checkbox/Checkbox"));
|
|
57
57
|
var TableHeader = function (_a) {
|
|
58
|
-
var columns = _a.columns, isCheckbox = _a.isCheckbox, handleSort = _a.handleSort, headerRefs = _a.headerRefs, columnWidths = _a.columnWidths, columnsSort = _a.columnsSort, headerBgColor = _a.headerBgColor, headerTextColor = _a.headerTextColor, freezedBgColor = _a.freezedBgColor, freezedTextColor = _a.freezedTextColor, noBorders = _a.noBorders, handleCheckbox = _a.handleCheckbox, checked = _a.checked, isLoading = _a.isLoading, isContent = _a.isContent, isLink = _a.isLink, isActionFreeze = _a.isActionFreeze, setColumnsSearch = _a.setColumnsSearch, columnsSearch = _a.columnsSearch;
|
|
58
|
+
var columns = _a.columns, isCheckbox = _a.isCheckbox, handleSort = _a.handleSort, headerRefs = _a.headerRefs, columnWidths = _a.columnWidths, columnsSort = _a.columnsSort, headerBgColor = _a.headerBgColor, headerTextColor = _a.headerTextColor, freezedBgColor = _a.freezedBgColor, freezedTextColor = _a.freezedTextColor, noBorders = _a.noBorders, handleCheckbox = _a.handleCheckbox, checked = _a.checked, isLoading = _a.isLoading, isContent = _a.isContent, isLink = _a.isLink, isActionFreeze = _a.isActionFreeze, setColumnsSearch = _a.setColumnsSearch, columnsSearch = _a.columnsSearch, isSelecting = _a.isSelecting;
|
|
59
59
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
60
60
|
var _b = (0, react_2.useState)(null), openFilterId = _b[0], setOpenFilterId = _b[1];
|
|
61
61
|
var RenderCheckbox = (0, react_2.useCallback)(function () {
|
|
62
|
-
var _a, _b, _c;
|
|
63
|
-
return (react_2.default.createElement(react_1.Th, { w: 6, fontSize: 14, fontWeight: 600, color: freezedTextColor, textTransform: "capitalize", backgroundColor: (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.secondary) === null || _b === void 0 ? void 0 : _b[50], borderY: noBorders ? "none" : "0.063rem solid ".concat((_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray[300]), position: "sticky", className: "columns sticky-columns", left: "0px", zIndex: 9, boxShadow: theme.shadows.md },
|
|
64
|
-
react_2.default.createElement(Checkbox_1.default, { "aria-label": "Select all rows", variant: "outline", onChange: function () { return handleCheckbox(0); }, isChecked: isLoading ? false : checked === true, isIndeterminate: checked === "indeterminate" })));
|
|
62
|
+
var _a, _b, _c, _d, _e;
|
|
63
|
+
return (react_2.default.createElement(react_1.Th, { w: 6, fontSize: 14, fontWeight: 600, color: freezedTextColor, textTransform: "capitalize", backgroundColor: (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.secondary) === null || _b === void 0 ? void 0 : _b[50], borderY: noBorders ? "none" : "0.063rem solid ".concat((_c = theme.colors) === null || _c === void 0 ? void 0 : _c.gray[300]), position: "sticky", className: "columns sticky-columns", left: "0px", zIndex: 9, boxShadow: theme.shadows.md }, isSelecting ? (react_2.default.createElement(react_1.Spinner, { size: "sm", color: (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.primary) === null || _e === void 0 ? void 0 : _e[500] })) : (react_2.default.createElement(Checkbox_1.default, { "aria-label": "Select all rows", variant: "outline", onChange: function () { return handleCheckbox(0); }, isChecked: isLoading ? false : checked === true, isIndeterminate: checked === "indeterminate" }))));
|
|
65
64
|
}, [
|
|
66
65
|
checked,
|
|
67
66
|
freezedTextColor,
|
|
68
67
|
handleCheckbox,
|
|
69
68
|
isLoading,
|
|
69
|
+
isSelecting,
|
|
70
70
|
noBorders,
|
|
71
71
|
theme.colors,
|
|
72
72
|
]);
|
|
@@ -12,8 +12,9 @@ type UseTableProps = {
|
|
|
12
12
|
isServerPagination: boolean;
|
|
13
13
|
totalRecords: number;
|
|
14
14
|
onNoOfRowsPerPageChange?: (noOfRows: number) => void;
|
|
15
|
+
defaultVisibleColumns?: number;
|
|
15
16
|
};
|
|
16
|
-
declare const useTable: ({ tableBorderColor, data, isPagination, selections, onSelection, tablePreferences, savePreferences, noOfRowsPerPage, isServerPagination, totalRecords, columns, onNoOfRowsPerPageChange, }: UseTableProps) => {
|
|
17
|
+
declare const useTable: ({ tableBorderColor, data, isPagination, selections, onSelection, tablePreferences, savePreferences, noOfRowsPerPage, isServerPagination, totalRecords, columns, onNoOfRowsPerPageChange, defaultVisibleColumns, }: UseTableProps) => {
|
|
17
18
|
tableData: DataObject[];
|
|
18
19
|
tableContainerStyles: {
|
|
19
20
|
borderRadius: string;
|
|
@@ -41,5 +42,6 @@ declare const useTable: ({ tableBorderColor, data, isPagination, selections, onS
|
|
|
41
42
|
setCurrentPage: import("react").Dispatch<import("react").SetStateAction<number>>;
|
|
42
43
|
columnsList: TableHeaderProps[];
|
|
43
44
|
handleColumnPreferences: (columns: any) => void;
|
|
45
|
+
isSelecting: boolean;
|
|
44
46
|
};
|
|
45
47
|
export default useTable;
|
|
@@ -38,7 +38,7 @@ var mergeColumnWithPreference = function (pref, originalCol) {
|
|
|
38
38
|
return next;
|
|
39
39
|
};
|
|
40
40
|
var useTable = function (_a) {
|
|
41
|
-
var tableBorderColor = _a.tableBorderColor, data = _a.data, isPagination = _a.isPagination, selections = _a.selections, onSelection = _a.onSelection, tablePreferences = _a.tablePreferences, savePreferences = _a.savePreferences, noOfRowsPerPage = _a.noOfRowsPerPage, isServerPagination = _a.isServerPagination, totalRecords = _a.totalRecords, columns = _a.columns, onNoOfRowsPerPageChange = _a.onNoOfRowsPerPageChange;
|
|
41
|
+
var tableBorderColor = _a.tableBorderColor, data = _a.data, isPagination = _a.isPagination, selections = _a.selections, onSelection = _a.onSelection, tablePreferences = _a.tablePreferences, savePreferences = _a.savePreferences, noOfRowsPerPage = _a.noOfRowsPerPage, isServerPagination = _a.isServerPagination, totalRecords = _a.totalRecords, columns = _a.columns, onNoOfRowsPerPageChange = _a.onNoOfRowsPerPageChange, defaultVisibleColumns = _a.defaultVisibleColumns;
|
|
42
42
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
43
43
|
var headerRefs = (0, react_1.useRef)([]);
|
|
44
44
|
var _b = (0, react_1.useState)([]), columnWidths = _b[0], setColumnWidths = _b[1];
|
|
@@ -55,7 +55,10 @@ var useTable = function (_a) {
|
|
|
55
55
|
}
|
|
56
56
|
var tableData = data;
|
|
57
57
|
var _g = (0, react_1.useState)(function () {
|
|
58
|
-
return columns.map(function (col
|
|
58
|
+
return columns.map(function (col, i) {
|
|
59
|
+
var _a;
|
|
60
|
+
return (__assign(__assign({}, col), { isHidden: defaultVisibleColumns ? i >= defaultVisibleColumns : ((_a = col.isHidden) !== null && _a !== void 0 ? _a : false) }));
|
|
61
|
+
});
|
|
59
62
|
}), columnsList = _g[0], setColumnsList = _g[1];
|
|
60
63
|
(0, react_1.useEffect)(function () {
|
|
61
64
|
var _a;
|
|
@@ -70,9 +73,12 @@ var useTable = function (_a) {
|
|
|
70
73
|
setColumnsList(mergedColumns);
|
|
71
74
|
}
|
|
72
75
|
else {
|
|
73
|
-
setColumnsList(columns.map(function (col
|
|
76
|
+
setColumnsList(columns.map(function (col, i) {
|
|
77
|
+
var _a;
|
|
78
|
+
return (__assign(__assign({}, col), { isHidden: defaultVisibleColumns ? i >= defaultVisibleColumns : ((_a = col.isHidden) !== null && _a !== void 0 ? _a : false) }));
|
|
79
|
+
}));
|
|
74
80
|
}
|
|
75
|
-
}, [tablePreferences, columns]);
|
|
81
|
+
}, [tablePreferences, columns, defaultVisibleColumns]);
|
|
76
82
|
var tableContainerStyles = (0, react_1.useMemo)(function () {
|
|
77
83
|
var _a;
|
|
78
84
|
return ({
|
|
@@ -139,25 +145,36 @@ var useTable = function (_a) {
|
|
|
139
145
|
(0, react_1.useEffect)(function () {
|
|
140
146
|
setSelection(selections !== null && selections !== void 0 ? selections : []);
|
|
141
147
|
}, [selections]);
|
|
148
|
+
var _h = (0, react_1.useState)(false), isSelecting = _h[0], setIsSelecting = _h[1];
|
|
149
|
+
var selectionRef = (0, react_1.useRef)(selection);
|
|
150
|
+
selectionRef.current = selection;
|
|
151
|
+
var onSelectionRef = (0, react_1.useRef)(onSelection);
|
|
152
|
+
onSelectionRef.current = onSelection;
|
|
142
153
|
var handleCheckbox = (0, react_1.useCallback)(function (id) {
|
|
143
|
-
var
|
|
154
|
+
var _a;
|
|
155
|
+
var current = selectionRef.current;
|
|
144
156
|
if (id === 0) {
|
|
145
|
-
|
|
146
|
-
|
|
157
|
+
setIsSelecting(true);
|
|
158
|
+
setTimeout(function () {
|
|
159
|
+
var _a;
|
|
160
|
+
var selectedItems = current.length === tableData.length ? [] : tableData.map(function (item) { return item.id; });
|
|
161
|
+
setSelection(selectedItems);
|
|
162
|
+
(_a = onSelectionRef.current) === null || _a === void 0 ? void 0 : _a.call(onSelectionRef, selectedItems);
|
|
163
|
+
setIsSelecting(false);
|
|
164
|
+
}, 0);
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
var selectedItems = void 0;
|
|
168
|
+
if (current.includes(id)) {
|
|
169
|
+
selectedItems = current.filter(function (item) { return item !== id; });
|
|
147
170
|
}
|
|
148
171
|
else {
|
|
149
|
-
selectedItems =
|
|
172
|
+
selectedItems = __spreadArray(__spreadArray([], current, true), [id], false);
|
|
150
173
|
}
|
|
174
|
+
setSelection(selectedItems);
|
|
175
|
+
(_a = onSelectionRef.current) === null || _a === void 0 ? void 0 : _a.call(onSelectionRef, selectedItems);
|
|
151
176
|
}
|
|
152
|
-
|
|
153
|
-
selectedItems = selection.filter(function (item) { return item !== id; });
|
|
154
|
-
}
|
|
155
|
-
else {
|
|
156
|
-
selectedItems = __spreadArray(__spreadArray([], selection, true), [id], false);
|
|
157
|
-
}
|
|
158
|
-
setSelection(selectedItems);
|
|
159
|
-
onSelection && onSelection(selectedItems);
|
|
160
|
-
}, [onSelection, selection, tableData]);
|
|
177
|
+
}, [tableData]);
|
|
161
178
|
var handleColumnPreferences = function (columns) {
|
|
162
179
|
setColumnsList(columns);
|
|
163
180
|
savePreferences &&
|
|
@@ -184,6 +201,7 @@ var useTable = function (_a) {
|
|
|
184
201
|
setCurrentPage: setCurrentPage,
|
|
185
202
|
columnsList: columnsList,
|
|
186
203
|
handleColumnPreferences: handleColumnPreferences,
|
|
204
|
+
isSelecting: isSelecting,
|
|
187
205
|
};
|
|
188
206
|
};
|
|
189
207
|
exports.default = useTable;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TableProps } from "./TableProps";
|
|
3
|
-
export default function Table({ data, columns, onSelection, isLoading, isCheckbox, headerBgColor, freezedBgColor, headerTextColor, freezedTextColor, tableBorderColor, noBorders, isPagination, onRowClick, selections, isActionFreeze, preferences, paginationMode, noOfRowsPerPage, totalRecords, onPagination, isTableSettings, headerActions, onGlobalSearch, onNoOfRowsPerPageChange, paginationSelectOptions, tableMaxHeight, minVisibleRows, maxVisibleRows, autoFitViewport, tableSettings, filterSidebar, loadingSkeletonRows }: TableProps): React.JSX.Element;
|
|
3
|
+
export default function Table({ data, columns, onSelection, isLoading, isCheckbox, headerBgColor, freezedBgColor, headerTextColor, freezedTextColor, tableBorderColor, noBorders, isPagination, onRowClick, selections, isActionFreeze, preferences, paginationMode, noOfRowsPerPage, totalRecords, onPagination, isTableSettings, headerActions, onGlobalSearch, onNoOfRowsPerPageChange, paginationSelectOptions, tableMaxHeight, minVisibleRows, maxVisibleRows, autoFitViewport, tableSettings, filterSidebar, loadingSkeletonRows, defaultVisibleColumns, }: TableProps): React.JSX.Element;
|
|
@@ -65,9 +65,7 @@ function Table(_a) {
|
|
|
65
65
|
name: "",
|
|
66
66
|
page: "",
|
|
67
67
|
orgId: "",
|
|
68
|
-
} : _4, _5 = _a.paginationMode, paginationMode = _5 === void 0 ? "client" : _5, _6 = _a.noOfRowsPerPage, noOfRowsPerPage = _6 === void 0 ? 50 : _6, _7 = _a.totalRecords, totalRecords = _7 === void 0 ? 0 : _7, onPagination = _a.onPagination, _8 = _a.isTableSettings, isTableSettings = _8 === void 0 ? false : _8, headerActions = _a.headerActions, onGlobalSearch = _a.onGlobalSearch, onNoOfRowsPerPageChange = _a.onNoOfRowsPerPageChange, paginationSelectOptions = _a.paginationSelectOptions, tableMaxHeight = _a.tableMaxHeight, minVisibleRows = _a.minVisibleRows, maxVisibleRows = _a.maxVisibleRows, autoFitViewport = _a.autoFitViewport, tableSettings = _a.tableSettings, filterSidebar = _a.filterSidebar, loadingSkeletonRows = _a.loadingSkeletonRows
|
|
69
|
-
// onColumnFilter
|
|
70
|
-
;
|
|
68
|
+
} : _4, _5 = _a.paginationMode, paginationMode = _5 === void 0 ? "client" : _5, _6 = _a.noOfRowsPerPage, noOfRowsPerPage = _6 === void 0 ? 50 : _6, _7 = _a.totalRecords, totalRecords = _7 === void 0 ? 0 : _7, onPagination = _a.onPagination, _8 = _a.isTableSettings, isTableSettings = _8 === void 0 ? false : _8, headerActions = _a.headerActions, onGlobalSearch = _a.onGlobalSearch, onNoOfRowsPerPageChange = _a.onNoOfRowsPerPageChange, paginationSelectOptions = _a.paginationSelectOptions, tableMaxHeight = _a.tableMaxHeight, minVisibleRows = _a.minVisibleRows, maxVisibleRows = _a.maxVisibleRows, autoFitViewport = _a.autoFitViewport, tableSettings = _a.tableSettings, filterSidebar = _a.filterSidebar, loadingSkeletonRows = _a.loadingSkeletonRows, defaultVisibleColumns = _a.defaultVisibleColumns;
|
|
71
69
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
72
70
|
var _9 = (0, react_1.useState)({}), columnsSearch = _9[0], setColumnsSearch = _9[1];
|
|
73
71
|
var tableContainerRef = (0, react_1.useRef)(null);
|
|
@@ -113,7 +111,8 @@ function Table(_a) {
|
|
|
113
111
|
totalRecords: totalRecords,
|
|
114
112
|
isServerPagination: isServerPagination,
|
|
115
113
|
onNoOfRowsPerPageChange: onNoOfRowsPerPageChange,
|
|
116
|
-
|
|
114
|
+
defaultVisibleColumns: defaultVisibleColumns,
|
|
115
|
+
}), tableData = _13.tableData, isContent = _13.isContent, isLink = _13.isLink, headerRefs = _13.headerRefs, columnWidths = _13.columnWidths, handleSort = _13.handleSort, handleCheckbox = _13.handleCheckbox, filteredData = _13.filteredData, startRow = _13.startRow, endRow = _13.endRow, selection = _13.selection, columnsSort = _13.columnsSort, currentPage = _13.currentPage, pages = _13.pages, rowsPerPage = _13.rowsPerPage, handlePageSizeChange = _13.handlePageSizeChange, setCurrentPage = _13.setCurrentPage, columnsList = _13.columnsList, handleColumnPreferences = _13.handleColumnPreferences, isSelecting = _13.isSelecting;
|
|
117
116
|
var _filteredData = (0, react_1.useMemo)(function () {
|
|
118
117
|
return (0, table_1.searchAndSortData)(filteredData, columnsSearch);
|
|
119
118
|
}, [columnsSearch, filteredData]);
|
|
@@ -275,7 +274,7 @@ function Table(_a) {
|
|
|
275
274
|
? true
|
|
276
275
|
: selection.length === 0
|
|
277
276
|
? false
|
|
278
|
-
: "indeterminate", isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze, setColumnsSearch: setColumnsSearch, columnsSearch: columnsSearch })),
|
|
277
|
+
: "indeterminate", isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze, setColumnsSearch: setColumnsSearch, columnsSearch: columnsSearch, isSelecting: isSelecting })),
|
|
279
278
|
react_1.default.createElement(react_3.Tbody, null,
|
|
280
279
|
react_1.default.createElement(TableBody_1.default, { data: _filteredData, columns: columnsList, startRow: startRow, endRow: endRow, isCheckbox: isCheckbox, columnWidths: columnWidths, noBorders: noBorders, freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_z = theme.colors) === null || _z === void 0 ? void 0 : _z.gray[600], handleCheckbox: handleCheckbox, selections: selection, isLoading: isTableLoading, loadingSkeletonRows: loadingSkeletonRows, onRowClick: onRowClick, isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze }))))))));
|
|
281
280
|
}
|
|
@@ -30,6 +30,7 @@ export type TableProps = {
|
|
|
30
30
|
minVisibleRows?: number;
|
|
31
31
|
maxVisibleRows?: number;
|
|
32
32
|
autoFitViewport?: boolean;
|
|
33
|
+
defaultVisibleColumns?: number;
|
|
33
34
|
loadingSkeletonRows?: number;
|
|
34
35
|
headerActions?: HeaderActionsProps;
|
|
35
36
|
onGlobalSearch?: (searchVal: string) => void;
|
|
@@ -107,6 +108,7 @@ export type TableHeaderPageProps = Pick<TableProps, "columns" | "isCheckbox" | "
|
|
|
107
108
|
isLink: boolean;
|
|
108
109
|
setColumnsSearch: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
109
110
|
columnsSearch: Record<string, string>;
|
|
111
|
+
isSelecting?: boolean;
|
|
110
112
|
};
|
|
111
113
|
export type TableBodyPageProps = Pick<TableProps, "columns" | "isCheckbox" | "data" | "freezedBgColor" | "freezedTextColor" | "noBorders" | "isLoading" | "loadingSkeletonRows" | "onRowClick" | "isActionFreeze"> & {
|
|
112
114
|
startRow: number;
|