pixelize-design-library 2.2.198 → 2.3.1-beta.2
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/.claude/settings.local.json +24 -0
- 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/dist/Assets/defaultLogo.tsx +31 -0
- package/dist/Components/Button/Button.styles.js +44 -3
- package/dist/Components/Button/ButtonProps.d.ts +1 -1
- package/dist/Components/ButtonGroupIcon/ButtonGoupIconProps.d.ts +2 -2
- package/dist/Components/ButtonGroupIcon/ButtonGroupIcon.js +50 -38
- package/dist/Components/Checkbox/Checkbox.js +2 -2
- package/dist/Components/Checkbox/Checkbox.styles.js +2 -0
- package/dist/Components/Common/FormLabel.d.ts +2 -1
- package/dist/Components/Common/FormLabel.js +8 -9
- package/dist/Components/Common/fieldStyles.d.ts +22 -0
- package/dist/Components/Common/fieldStyles.js +42 -0
- package/dist/Components/DatePicker/CalendarPanel.d.ts +2 -0
- package/dist/Components/DatePicker/CalendarPanel.js +104 -65
- package/dist/Components/DatePicker/RangeDatePicker.js +37 -16
- package/dist/Components/DatePicker/SingleDatePicker.js +16 -16
- package/dist/Components/DatePicker/TimePicker.js +4 -4
- package/dist/Components/Input/Input/Input.d.ts +1 -1
- package/dist/Components/Input/Input/Input.js +5 -4
- package/dist/Components/Input/Input/InputProps.d.ts +2 -0
- package/dist/Components/Input/TextInput.styles.js +2 -1
- package/dist/Components/InputTextArea/InputTextArea.style.js +2 -1
- package/dist/Components/MultiSelect/MultiSelect.js +11 -12
- package/dist/Components/NavigationBar/NavigationBar.d.ts +1 -1
- package/dist/Components/NavigationBar/NavigationBar.js +54 -27
- package/dist/Components/NavigationBar/NavigationBarProps.d.ts +1 -0
- package/dist/Components/NoteTextArea/NoteTextArea.js +44 -40
- package/dist/Components/NumberInput/NumberInput.styles.js +2 -1
- package/dist/Components/PinInput/PinInput.d.ts +1 -1
- package/dist/Components/PinInput/PinInput.js +3 -2
- package/dist/Components/PinInput/PinInputProps.d.ts +4 -0
- package/dist/Components/RadioButton/RadioButton.js +1 -1
- package/dist/Components/SearchSelect/SearchSelect.d.ts +1 -1
- package/dist/Components/SearchSelect/SearchSelect.js +3 -3
- package/dist/Components/SearchSelect/SearchSelectProps.d.ts +2 -0
- package/dist/Components/Select/Select.styles.js +2 -1
- package/dist/Components/SelectSearch/SelectSearch.js +7 -4
- package/dist/Components/SideBar/SecondaryBar.js +20 -18
- package/dist/Components/SideBar/SideBar.d.ts +1 -1
- package/dist/Components/SideBar/SideBar.js +58 -43
- package/dist/Components/SideBar/SideBarProps.d.ts +14 -3
- package/dist/Components/SideBar/components/MenuItemBox.js +28 -24
- package/dist/Components/SideBar/components/MenuItems.js +16 -2
- package/dist/Components/SideBar/components/MenuPopoverContent.js +16 -16
- package/dist/Components/SideBar/components/OtherApps.js +16 -14
- package/dist/Components/Table/Table.d.ts +1 -1
- package/dist/Components/Table/Table.js +119 -38
- package/dist/Components/Table/TableProps.d.ts +34 -2
- package/dist/Components/Table/{Components → components}/TableBody.d.ts +5 -1
- package/dist/Components/Table/components/TableBody.js +303 -0
- package/dist/Components/Table/components/TableGroupRow.d.ts +15 -0
- package/dist/Components/Table/components/TableGroupRow.js +27 -0
- package/dist/Components/Table/{Components → components}/TableHeader.js +23 -9
- package/dist/Components/Table/{LeftFilterPane.js → filters/LeftFilterPane.js} +3 -3
- package/dist/Components/Table/{TableSettings → settings}/TableSettings.d.ts +4 -2
- package/dist/Components/Table/settings/TableSettings.js +141 -0
- package/dist/Theme/Default/palette.d.ts +4 -0
- package/dist/Theme/Default/palette.js +3 -0
- package/dist/Theme/Emerald/palette.d.ts +4 -0
- package/dist/Theme/Emerald/palette.js +2 -1
- package/dist/Theme/Meadow/palette.d.ts +4 -0
- package/dist/Theme/Meadow/palette.js +2 -1
- package/dist/Theme/Radiant/palette.d.ts +4 -0
- package/dist/Theme/Radiant/palette.js +2 -1
- package/dist/Theme/Rosewood/palette.d.ts +4 -0
- package/dist/Theme/Rosewood/palette.js +2 -1
- package/dist/Theme/Skyline/palette.d.ts +4 -0
- package/dist/Theme/Skyline/palette.js +2 -1
- package/dist/Theme/Slate/palette.d.ts +4 -0
- package/dist/Theme/Slate/palette.js +2 -1
- package/dist/Theme/themeProps.d.ts +4 -0
- package/dist/Utils/table.d.ts +21 -0
- package/dist/Utils/table.js +98 -14
- package/package.json +2 -2
- package/dist/Components/Table/Components/TableBody.js +0 -201
- package/dist/Components/Table/TableSettings/TableFilters.d.ts +0 -10
- package/dist/Components/Table/TableSettings/TableFilters.js +0 -69
- package/dist/Components/Table/TableSettings/TableFilters.test.d.ts +0 -1
- package/dist/Components/Table/TableSettings/TableFilters.test.js +0 -109
- package/dist/Components/Table/TableSettings/TableSettings.js +0 -141
- package/dist/Components/Table/TableToDo.d.ts +0 -2
- package/dist/Components/Table/TableToDo.js +0 -291
- /package/dist/Components/Table/{Components → components}/HeaderActions.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/HeaderActions.js +0 -0
- /package/dist/Components/Table/{Components → components}/Pagination.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/Pagination.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableActions.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableActions.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableBody.virtualize.test.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableBody.virtualize.test.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableHeader.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableLoading.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableLoading.js +0 -0
- /package/dist/Components/Table/{Components → components}/TableSearch.d.ts +0 -0
- /package/dist/Components/Table/{Components → components}/TableSearch.js +0 -0
- /package/dist/Components/Table/{Components → filters}/ActiveFilters.d.ts +0 -0
- /package/dist/Components/Table/{Components → filters}/ActiveFilters.js +0 -0
- /package/dist/Components/Table/{CompactSelect.d.ts → filters/CompactSelect.d.ts} +0 -0
- /package/dist/Components/Table/{CompactSelect.js → filters/CompactSelect.js} +0 -0
- /package/dist/Components/Table/{LeftFilterPane.d.ts → filters/LeftFilterPane.d.ts} +0 -0
- /package/dist/Components/Table/{SelectOperationControls.d.ts → filters/SelectOperationControls.d.ts} +0 -0
- /package/dist/Components/Table/{SelectOperationControls.js → filters/SelectOperationControls.js} +0 -0
- /package/dist/Components/Table/{Components → filters}/TableFilters.d.ts +0 -0
- /package/dist/Components/Table/{Components → filters}/TableFilters.js +0 -0
- /package/dist/Components/Table/{TextOperationControls.d.ts → filters/TextOperationControls.d.ts} +0 -0
- /package/dist/Components/Table/{TextOperationControls.js → filters/TextOperationControls.js} +0 -0
- /package/dist/Components/Table/{Components → hooks}/useDebounce.d.ts +0 -0
- /package/dist/Components/Table/{Components → hooks}/useDebounce.js +0 -0
- /package/dist/Components/Table/{Components → hooks}/useTable.d.ts +0 -0
- /package/dist/Components/Table/{Components → hooks}/useTable.js +0 -0
- /package/dist/Components/Table/{TableSettings → settings}/ManageColumns.d.ts +0 -0
- /package/dist/Components/Table/{TableSettings → settings}/ManageColumns.js +0 -0
- /package/dist/Components/Table/{TableSettings → settings}/ManageColumns.test.d.ts +0 -0
- /package/dist/Components/Table/{TableSettings → settings}/ManageColumns.test.js +0 -0
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.DENSITY_CONFIG = void 0;
|
|
40
|
+
var react_1 = require("@chakra-ui/react");
|
|
41
|
+
var react_2 = __importStar(require("react"));
|
|
42
|
+
var table_1 = require("../../../Utils/table");
|
|
43
|
+
var useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
44
|
+
var TableLoading_1 = require("./TableLoading");
|
|
45
|
+
var TableActions_1 = __importDefault(require("./TableActions"));
|
|
46
|
+
var lucide_react_1 = require("lucide-react");
|
|
47
|
+
var Checkbox_1 = __importDefault(require("../../Checkbox/Checkbox"));
|
|
48
|
+
var TableGroupRow_1 = __importDefault(require("./TableGroupRow"));
|
|
49
|
+
// Density → row height (px) + cell vertical padding. The padding (not just the
|
|
50
|
+
// min-height) is what drives perceived row size, so compact tightens both.
|
|
51
|
+
exports.DENSITY_CONFIG = {
|
|
52
|
+
compact: { height: 32, py: "0.125rem" },
|
|
53
|
+
normal: { height: 40, py: "0.5rem" },
|
|
54
|
+
comfortable: { height: 52, py: "0.875rem" },
|
|
55
|
+
};
|
|
56
|
+
// Monday-style status cell: the whole cell is filled with the status color and
|
|
57
|
+
// the label is centered in white.
|
|
58
|
+
var StatusCell = function (_a) {
|
|
59
|
+
var value = _a.value;
|
|
60
|
+
return (react_2.default.createElement(react_1.Box, { display: "flex", alignItems: "center", justifyContent: "center", w: "100%", h: "100%", px: "0.5rem", fontSize: "0.75rem", fontWeight: 600, color: "white", textAlign: "center", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }, value));
|
|
61
|
+
};
|
|
62
|
+
var EMPTY_SX = {};
|
|
63
|
+
var EMPTY_HOVER = {};
|
|
64
|
+
var TableRow = react_2.default.memo(function (_a) {
|
|
65
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
66
|
+
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, rowHeight = _a.rowHeight, cellPy = _a.cellPy, palette = _a.palette, accentColor = _a.accentColor, handleCheckbox = _a.handleCheckbox, onRowClick = _a.onRowClick, toggleRowExpansion = _a.toggleRowExpansion;
|
|
67
|
+
var checkedSx = (0, react_2.useMemo)(function () {
|
|
68
|
+
var _a, _b, _c;
|
|
69
|
+
return isChecked ? {
|
|
70
|
+
"& td": { backgroundColor: (_c = (_b = (_a = theme.colors.primary) === null || _a === void 0 ? void 0 : _a.opacity) === null || _b === void 0 ? void 0 : _b[16]) !== null && _c !== void 0 ? _c : theme.colors.disabled[100] },
|
|
71
|
+
} : EMPTY_SX;
|
|
72
|
+
}, [isChecked, (_b = theme.colors.primary) === null || _b === void 0 ? void 0 : _b.opacity, theme.colors.disabled]);
|
|
73
|
+
var handleCellClick = (0, react_2.useCallback)(function (header) {
|
|
74
|
+
if (!header.node && onRowClick) {
|
|
75
|
+
onRowClick(row, { label: header.label, id: header.id });
|
|
76
|
+
}
|
|
77
|
+
}, [row, onRowClick]);
|
|
78
|
+
var firstDataColIndex = columns.findIndex(function (c) { return !c.isHidden; });
|
|
79
|
+
var accentSx = accentColor ? "inset 3px 0 0 ".concat(accentColor) : undefined;
|
|
80
|
+
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
81
|
+
react_2.default.createElement(react_1.Tr, { opacity: isLoading ? 0.4 : 1, pointerEvents: isLoading ? "none" : "auto", transition: "opacity 0.2s", sx: checkedSx },
|
|
82
|
+
isContent && (react_2.default.createElement(react_1.Td, { w: "6", p: 0, fontSize: 14, backgroundColor: (_d = (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.background) === null || _d === void 0 ? void 0 : _d[50], color: freezedTextColor, position: "sticky", borderBottom: borderStyle, boxShadow: accentSx, 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" })))),
|
|
83
|
+
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: borderStyle, boxShadow: !isContent ? accentSx : undefined, boxSizing: "border-box", left: 0, zIndex: 1, className: "columns sticky-columns" },
|
|
84
|
+
react_2.default.createElement(Checkbox_1.default, { "aria-label": "Select all rows", onChange: function () { return handleCheckbox(row.id); }, isChecked: isChecked }))),
|
|
85
|
+
columns.map(function (header, headerIndex) {
|
|
86
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
87
|
+
if (header.isHidden)
|
|
88
|
+
return null;
|
|
89
|
+
var isFrozen = header.isFreeze;
|
|
90
|
+
var isFirstDataCell = !isContent && !isCheckbox && headerIndex === firstDataColIndex;
|
|
91
|
+
var isStatus = header.type === "status" && !header.node;
|
|
92
|
+
var rawStatus = String((_a = row[header.id]) !== null && _a !== void 0 ? _a : "");
|
|
93
|
+
var statusColor = isStatus
|
|
94
|
+
? (0, table_1.pickTableColor)(rawStatus, palette, (_b = header.statusColors) === null || _b === void 0 ? void 0 : _b[rawStatus])
|
|
95
|
+
: null;
|
|
96
|
+
return (react_2.default.createElement(react_1.Td, { maxWidth: 500, minWidth: 120, height: "".concat(rowHeight, "px"), py: isStatus && statusColor ? 0 : cellPy, px: isStatus && statusColor ? 0 : undefined, 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: isStatus && statusColor ? statusColor.solid : (_c = theme.colors.background) === null || _c === void 0 ? void 0 : _c[50], textOverflow: "ellipsis", boxShadow: isFirstDataCell ? accentSx : undefined, borderBottom: noBorders
|
|
97
|
+
? "none"
|
|
98
|
+
: "0.063rem solid ".concat((_d = theme.colors) === null || _d === void 0 ? void 0 : _d.gray[isFrozen || isChecked ? 300 : 200]), className: "columns ".concat(isFrozen ? "sticky-columns" : "scrollable-columns"), boxSizing: "border-box", color: isStatus && statusColor ? "white" : (_f = (_e = theme.colors) === null || _e === void 0 ? void 0 : _e.text) === null || _f === void 0 ? void 0 : _f[500], _hover: isStatus && statusColor
|
|
99
|
+
? EMPTY_HOVER
|
|
100
|
+
: ((_g = row.cellStyle) === null || _g === void 0 ? void 0 : _g[header.id]) || row.rowStyle
|
|
101
|
+
? EMPTY_HOVER
|
|
102
|
+
: hoverStyle }, isStatus && statusColor ? (react_2.default.createElement(StatusCell, { value: (0, table_1.normalizeTableCellValue)(row[header.id]) })) : (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])))));
|
|
103
|
+
}),
|
|
104
|
+
isLink && (react_2.default.createElement(react_1.Td, { w: 2, p: 0, fontSize: 14, backgroundColor: (_l = (_k = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _k === void 0 ? void 0 : _k.background) === null || _l === void 0 ? void 0 : _l[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 }))))),
|
|
105
|
+
row.content && isExpanded && (react_2.default.createElement(react_1.Tr, null,
|
|
106
|
+
react_2.default.createElement(react_1.Td, { colSpan: columns.length +
|
|
107
|
+
(isCheckbox ? 1 : 0) +
|
|
108
|
+
(isContent ? 1 : 0) +
|
|
109
|
+
(isLink ? 1 : 0), p: 2 },
|
|
110
|
+
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)))))));
|
|
111
|
+
});
|
|
112
|
+
var TableBody = function (_a) {
|
|
113
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
114
|
+
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, scrollContainerRef = _a.scrollContainerRef, density = _a.density, accentColors = _a.accentColors, groups = _a.groups, onAddItem = _a.onAddItem, emptyState = _a.emptyState;
|
|
115
|
+
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
116
|
+
var _u = (0, react_2.useState)(new Set()), expandedRows = _u[0], setExpandedRows = _u[1];
|
|
117
|
+
var _v = (0, react_2.useState)(new Set()), collapsedGroups = _v[0], setCollapsedGroups = _v[1];
|
|
118
|
+
var toggleGroup = (0, react_2.useCallback)(function (value) {
|
|
119
|
+
setCollapsedGroups(function (prev) {
|
|
120
|
+
var next = new Set(prev);
|
|
121
|
+
next.has(value) ? next.delete(value) : next.add(value);
|
|
122
|
+
return next;
|
|
123
|
+
});
|
|
124
|
+
}, []);
|
|
125
|
+
var selectionsSet = (0, react_2.useMemo)(function () { return new Set(selections); }, [selections]);
|
|
126
|
+
var palette = (0, react_2.useMemo)(function () { return (0, table_1.buildTablePalette)(theme); }, [theme]);
|
|
127
|
+
var densityConfig = (_b = exports.DENSITY_CONFIG[density !== null && density !== void 0 ? density : "normal"]) !== null && _b !== void 0 ? _b : exports.DENSITY_CONFIG.normal;
|
|
128
|
+
var rowHeight = densityConfig.height;
|
|
129
|
+
var cellPy = densityConfig.py;
|
|
130
|
+
// --- Row virtualization ---------------------------------------------------
|
|
131
|
+
// Rows are a fixed 45px tall (see the `height={45}` on every <Td/> below),
|
|
132
|
+
// and the scroll viewport is capped at ~500px, so only ~11 rows are ever
|
|
133
|
+
// visible. Mounting all 50/100 page rows is what makes paging freeze. We
|
|
134
|
+
// render only the rows inside the viewport (+ overscan) and reserve the
|
|
135
|
+
// remaining height with empty spacer rows. Spacer rows (rather than CSS
|
|
136
|
+
// transforms) keep the table in normal flow so the sticky header and
|
|
137
|
+
// `position: sticky` frozen columns keep working.
|
|
138
|
+
// Disabled when expandable content rows are present, since those break the
|
|
139
|
+
// fixed-height assumption.
|
|
140
|
+
var ROW_HEIGHT = rowHeight;
|
|
141
|
+
var GROUP_HEADER_H = 42;
|
|
142
|
+
var OVERSCAN = 6;
|
|
143
|
+
var VIRTUALIZE_THRESHOLD = 30;
|
|
144
|
+
var shouldVirtualize = !isContent && data.length > VIRTUALIZE_THRESHOLD;
|
|
145
|
+
// Grouped mode has no pager, so it virtualizes too (when no expandable rows):
|
|
146
|
+
// group headers + rows form one flat sequence that we window over.
|
|
147
|
+
var groupRowCount = groups ? groups.reduce(function (n, g) { return n + g.rows.length; }, 0) : 0;
|
|
148
|
+
var groupVirtualize = !!groups && !isContent && groupRowCount > VIRTUALIZE_THRESHOLD;
|
|
149
|
+
var _w = (0, react_2.useState)(0), scrollTop = _w[0], setScrollTop = _w[1];
|
|
150
|
+
var _x = (0, react_2.useState)(0), viewportH = _x[0], setViewportH = _x[1];
|
|
151
|
+
(0, react_2.useEffect)(function () {
|
|
152
|
+
var el = scrollContainerRef === null || scrollContainerRef === void 0 ? void 0 : scrollContainerRef.current;
|
|
153
|
+
if (!el || !(shouldVirtualize || groupVirtualize))
|
|
154
|
+
return;
|
|
155
|
+
var onScroll = function () { return setScrollTop(el.scrollTop); };
|
|
156
|
+
var measure = function () { return setViewportH(el.clientHeight); };
|
|
157
|
+
measure();
|
|
158
|
+
setScrollTop(el.scrollTop);
|
|
159
|
+
el.addEventListener("scroll", onScroll, { passive: true });
|
|
160
|
+
window.addEventListener("resize", measure);
|
|
161
|
+
return function () {
|
|
162
|
+
el.removeEventListener("scroll", onScroll);
|
|
163
|
+
window.removeEventListener("resize", measure);
|
|
164
|
+
};
|
|
165
|
+
}, [scrollContainerRef, shouldVirtualize, groupVirtualize, data.length, groupRowCount]);
|
|
166
|
+
// New page: jump back to the top so the window recomputes from row 0.
|
|
167
|
+
(0, react_2.useEffect)(function () {
|
|
168
|
+
if (!shouldVirtualize)
|
|
169
|
+
return;
|
|
170
|
+
var el = scrollContainerRef === null || scrollContainerRef === void 0 ? void 0 : scrollContainerRef.current;
|
|
171
|
+
if (el)
|
|
172
|
+
el.scrollTop = 0;
|
|
173
|
+
setScrollTop(0);
|
|
174
|
+
}, [startRow, shouldVirtualize, scrollContainerRef]);
|
|
175
|
+
var total = data.length;
|
|
176
|
+
var firstIndex = 0;
|
|
177
|
+
var lastIndex = total;
|
|
178
|
+
if (shouldVirtualize) {
|
|
179
|
+
var vh = viewportH || 500;
|
|
180
|
+
firstIndex = Math.max(0, Math.floor(scrollTop / ROW_HEIGHT) - OVERSCAN);
|
|
181
|
+
var count = Math.ceil(vh / ROW_HEIGHT) + OVERSCAN * 2;
|
|
182
|
+
lastIndex = Math.min(total, firstIndex + count);
|
|
183
|
+
}
|
|
184
|
+
var visibleRows = shouldVirtualize ? data.slice(firstIndex, lastIndex) : data;
|
|
185
|
+
var topPad = firstIndex * ROW_HEIGHT;
|
|
186
|
+
var bottomPad = (total - lastIndex) * ROW_HEIGHT;
|
|
187
|
+
var toggleRowExpansion = (0, react_2.useCallback)(function (rowIndex) {
|
|
188
|
+
setExpandedRows(function (prev) {
|
|
189
|
+
var newSet = new Set(prev);
|
|
190
|
+
if (newSet.has(rowIndex)) {
|
|
191
|
+
newSet.delete(rowIndex);
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
newSet.add(rowIndex);
|
|
195
|
+
}
|
|
196
|
+
return newSet;
|
|
197
|
+
});
|
|
198
|
+
}, []);
|
|
199
|
+
var totalVisibleColumns = (0, react_2.useMemo)(function () {
|
|
200
|
+
return columns.filter(function (o) { return !o.isHidden; }).length +
|
|
201
|
+
(isCheckbox ? 1 : 0) +
|
|
202
|
+
(isContent ? 1 : 0) +
|
|
203
|
+
(isLink ? 1 : 0);
|
|
204
|
+
}, [columns, isCheckbox, isContent, isLink]);
|
|
205
|
+
var leftOffsets = (0, react_2.useMemo)(function () {
|
|
206
|
+
var checkboxOffset = isCheckbox ? 50 : 0;
|
|
207
|
+
return columnWidths.map(function (_, idx) {
|
|
208
|
+
return columnWidths.slice(0, idx).reduce(function (sum, w) { return sum + w; }, 0) + checkboxOffset;
|
|
209
|
+
});
|
|
210
|
+
}, [columnWidths, isCheckbox]);
|
|
211
|
+
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, (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.border]);
|
|
212
|
+
var hoverStyle = (0, react_2.useMemo)(function () {
|
|
213
|
+
var _a, _b, _c, _d, _e;
|
|
214
|
+
return ({
|
|
215
|
+
backgroundColor: (_c = (_b = (_a = theme.colors.table) === null || _a === void 0 ? void 0 : _a.hover) === null || _b === void 0 ? void 0 : _b[300]) !== null && _c !== void 0 ? _c : (_e = (_d = theme.colors.secondary) === null || _d === void 0 ? void 0 : _d.opacity) === null || _e === void 0 ? void 0 : _e[4],
|
|
216
|
+
});
|
|
217
|
+
}, [(_d = theme.colors.table) === null || _d === void 0 ? void 0 : _d.hover, (_e = theme.colors.secondary) === null || _e === void 0 ? void 0 : _e.opacity]);
|
|
218
|
+
if (isLoading && data.length === 0) {
|
|
219
|
+
return (react_2.default.createElement(TableLoading_1.TableBodyLoading, { noOfColumns: totalVisibleColumns, borderColor: theme.colors.gray[300], rowsCount: typeof loadingSkeletonRows === "number" ? loadingSkeletonRows : 4 }));
|
|
220
|
+
}
|
|
221
|
+
if (!isLoading && data.length === 0) {
|
|
222
|
+
var isStructured = emptyState && typeof emptyState === "object" && !react_2.default.isValidElement(emptyState);
|
|
223
|
+
var es = isStructured ? emptyState : null;
|
|
224
|
+
return (react_2.default.createElement(react_1.Tr, { backgroundColor: (_f = theme.colors.background) === null || _f === void 0 ? void 0 : _f[50] },
|
|
225
|
+
react_2.default.createElement(react_1.Td, { colSpan: totalVisibleColumns, textAlign: "center", py: 10, border: "none" }, emptyState && !isStructured ? emptyState : (react_2.default.createElement(react_1.Box, { display: "flex", flexDirection: "column", alignItems: "center", gap: 2, color: (_h = (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.gray) === null || _h === void 0 ? void 0 : _h[500] },
|
|
226
|
+
(es === null || es === void 0 ? void 0 : es.icon) && react_2.default.createElement(react_1.Box, { fontSize: "1.75rem", color: (_k = (_j = theme.colors) === null || _j === void 0 ? void 0 : _j.gray) === null || _k === void 0 ? void 0 : _k[400] }, es.icon),
|
|
227
|
+
react_2.default.createElement(react_1.Box, { fontSize: "0.95rem", fontWeight: 600, color: (_m = (_l = theme.colors) === null || _l === void 0 ? void 0 : _l.text) === null || _m === void 0 ? void 0 : _m[700] }, (_o = es === null || es === void 0 ? void 0 : es.title) !== null && _o !== void 0 ? _o : "No data found"),
|
|
228
|
+
(es === null || es === void 0 ? void 0 : es.description) && (react_2.default.createElement(react_1.Box, { fontSize: "0.8125rem", color: (_q = (_p = theme.colors) === null || _p === void 0 ? void 0 : _p.gray) === null || _q === void 0 ? void 0 : _q[500] }, es.description)))))));
|
|
229
|
+
}
|
|
230
|
+
// --- Monday-style grouped board render (virtualized when large) -----------
|
|
231
|
+
if (groups) {
|
|
232
|
+
// Flatten groups → one sequence of header/row items so it can be windowed.
|
|
233
|
+
var items = [];
|
|
234
|
+
for (var _i = 0, groups_1 = groups; _i < groups_1.length; _i++) {
|
|
235
|
+
var g = groups_1[_i];
|
|
236
|
+
items.push({ kind: "header", g: g });
|
|
237
|
+
if (!collapsedGroups.has(g.value)) {
|
|
238
|
+
for (var _y = 0, _z = g.rows; _y < _z.length; _y++) {
|
|
239
|
+
var row = _z[_y];
|
|
240
|
+
items.push({ kind: "row", g: g, row: row });
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
var firstI_1 = 0;
|
|
245
|
+
var lastI = items.length;
|
|
246
|
+
var gTopPad = 0;
|
|
247
|
+
var gBottomPad = 0;
|
|
248
|
+
if (groupVirtualize) {
|
|
249
|
+
var heights_2 = items.map(function (it) { return (it.kind === "header" ? GROUP_HEADER_H : rowHeight); });
|
|
250
|
+
var offsets_1 = [];
|
|
251
|
+
var acc = 0;
|
|
252
|
+
for (var _0 = 0, heights_1 = heights_2; _0 < heights_1.length; _0++) {
|
|
253
|
+
var h = heights_1[_0];
|
|
254
|
+
offsets_1.push(acc);
|
|
255
|
+
acc += h;
|
|
256
|
+
}
|
|
257
|
+
var totalH = acc;
|
|
258
|
+
var vh = viewportH || 500;
|
|
259
|
+
var top_1 = scrollTop - OVERSCAN * rowHeight;
|
|
260
|
+
var bottom = scrollTop + vh + OVERSCAN * rowHeight;
|
|
261
|
+
firstI_1 = items.findIndex(function (_, i) { return offsets_1[i] + heights_2[i] > top_1; });
|
|
262
|
+
if (firstI_1 < 0)
|
|
263
|
+
firstI_1 = items.length;
|
|
264
|
+
lastI = items.length;
|
|
265
|
+
for (var i = firstI_1; i < items.length; i++) {
|
|
266
|
+
if (offsets_1[i] > bottom) {
|
|
267
|
+
lastI = i;
|
|
268
|
+
break;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
gTopPad = (_r = offsets_1[firstI_1]) !== null && _r !== void 0 ? _r : 0;
|
|
272
|
+
gBottomPad = totalH - (lastI > firstI_1 ? offsets_1[lastI - 1] + heights_2[lastI - 1] : gTopPad);
|
|
273
|
+
}
|
|
274
|
+
var windowItems = groupVirtualize ? items.slice(firstI_1, lastI) : items;
|
|
275
|
+
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
276
|
+
gTopPad > 0 && (react_2.default.createElement("tr", { "aria-hidden": "true", style: { height: gTopPad } },
|
|
277
|
+
react_2.default.createElement("td", { colSpan: totalVisibleColumns, style: { padding: 0, border: "none", height: gTopPad } }))),
|
|
278
|
+
windowItems.map(function (it, k) {
|
|
279
|
+
var _a;
|
|
280
|
+
return it.kind === "header" ? (react_2.default.createElement(TableGroupRow_1.default, { key: "h-".concat(it.g.value), label: it.g.label, value: it.g.value, count: it.g.rows.length, color: it.g.color, collapsed: collapsedGroups.has(it.g.value), colSpan: totalVisibleColumns, onToggle: function () { return toggleGroup(it.g.value); }, onAddItem: onAddItem })) : (react_2.default.createElement(TableRow, { key: (_a = it.row.id) !== null && _a !== void 0 ? _a : "r-".concat(firstI_1 + k), row: it.row, rowIndex: firstI_1 + k, index: firstI_1 + k, isChecked: selectionsSet.has(it.row.id), isExpanded: expandedRows.has(firstI_1 + k), 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, rowHeight: rowHeight, cellPy: cellPy, palette: palette, accentColor: it.g.color.solid, handleCheckbox: handleCheckbox, onRowClick: onRowClick, toggleRowExpansion: toggleRowExpansion }));
|
|
281
|
+
}),
|
|
282
|
+
gBottomPad > 0 && (react_2.default.createElement("tr", { "aria-hidden": "true", style: { height: gBottomPad } },
|
|
283
|
+
react_2.default.createElement("td", { colSpan: totalVisibleColumns, style: { padding: 0, border: "none", height: gBottomPad } })))));
|
|
284
|
+
}
|
|
285
|
+
return (react_2.default.createElement(react_2.default.Fragment, null,
|
|
286
|
+
isLoading && data.length > 0 && (react_2.default.createElement(react_1.Tr, null,
|
|
287
|
+
react_2.default.createElement(react_1.Td, { colSpan: totalVisibleColumns, p: 0, border: "none", position: "relative", height: 0 },
|
|
288
|
+
react_2.default.createElement(react_1.Box, { position: "absolute", top: 4, left: "50%", transform: "translateX(-50%)", zIndex: 10 },
|
|
289
|
+
react_2.default.createElement(react_1.Spinner, { size: "sm", color: ((_t = (_s = theme.colors) === null || _s === void 0 ? void 0 : _s.primary) === null || _t === void 0 ? void 0 : _t[500]) || "blue.500" }))))),
|
|
290
|
+
shouldVirtualize && topPad > 0 && (react_2.default.createElement("tr", { "aria-hidden": "true", style: { height: topPad } },
|
|
291
|
+
react_2.default.createElement("td", { colSpan: totalVisibleColumns, style: { padding: 0, border: "none", height: topPad } }))),
|
|
292
|
+
visibleRows.map(function (row, i) {
|
|
293
|
+
var _a;
|
|
294
|
+
var index = firstIndex + i;
|
|
295
|
+
var rowIndex = startRow + index;
|
|
296
|
+
var isExpanded = expandedRows.has(rowIndex);
|
|
297
|
+
var isChecked = selectionsSet.has(row.id);
|
|
298
|
+
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, rowHeight: rowHeight, cellPy: cellPy, palette: palette, accentColor: accentColors === null || accentColors === void 0 ? void 0 : accentColors[row.id], handleCheckbox: handleCheckbox, onRowClick: onRowClick, toggleRowExpansion: toggleRowExpansion }));
|
|
299
|
+
}),
|
|
300
|
+
shouldVirtualize && bottomPad > 0 && (react_2.default.createElement("tr", { "aria-hidden": "true", style: { height: bottomPad } },
|
|
301
|
+
react_2.default.createElement("td", { colSpan: totalVisibleColumns, style: { padding: 0, border: "none", height: bottomPad } })))));
|
|
302
|
+
};
|
|
303
|
+
exports.default = TableBody;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { TablePaletteColor } from "../../../Utils/table";
|
|
3
|
+
type Props = {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string | number;
|
|
6
|
+
count: number;
|
|
7
|
+
color: TablePaletteColor;
|
|
8
|
+
collapsed: boolean;
|
|
9
|
+
colSpan: number;
|
|
10
|
+
onToggle: () => void;
|
|
11
|
+
onAddItem?: (groupValue: string | number) => void;
|
|
12
|
+
};
|
|
13
|
+
/** Monday-style colored, collapsible group header row. */
|
|
14
|
+
export declare const TableGroupRow: React.FC<Props>;
|
|
15
|
+
export default TableGroupRow;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TableGroupRow = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var react_2 = require("@chakra-ui/react");
|
|
9
|
+
var lucide_react_1 = require("lucide-react");
|
|
10
|
+
var useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
11
|
+
/** Monday-style colored, collapsible group header row. */
|
|
12
|
+
var TableGroupRow = function (_a) {
|
|
13
|
+
var _b, _c, _d, _e, _f, _g;
|
|
14
|
+
var label = _a.label, value = _a.value, count = _a.count, color = _a.color, collapsed = _a.collapsed, colSpan = _a.colSpan, onToggle = _a.onToggle, onAddItem = _a.onAddItem;
|
|
15
|
+
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
16
|
+
return (react_1.default.createElement(react_2.Tr, null,
|
|
17
|
+
react_1.default.createElement(react_2.Td, { colSpan: colSpan, p: 0, border: "none" },
|
|
18
|
+
react_1.default.createElement(react_2.Flex, { align: "center", gap: 2, px: 3, py: 2, bg: color.soft, boxShadow: "inset 4px 0 0 ".concat(color.solid), borderBottom: "0.063rem solid ".concat((_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.border) === null || _c === void 0 ? void 0 : _c[500]) },
|
|
19
|
+
react_1.default.createElement(react_2.IconButton, { "aria-label": collapsed ? "Expand group" : "Collapse group", size: "xs", variant: "ghost", color: color.text, onClick: onToggle, icon: collapsed ? react_1.default.createElement(lucide_react_1.ChevronRight, { size: 16 }) : react_1.default.createElement(lucide_react_1.ChevronDown, { size: 16 }) }),
|
|
20
|
+
react_1.default.createElement(react_2.Text, { fontSize: "0.8125rem", fontWeight: 700, color: color.text, isTruncated: true, maxW: "20rem" }, label),
|
|
21
|
+
react_1.default.createElement(react_2.Box, { as: "span", fontSize: "0.6875rem", fontWeight: 600, color: color.text, bg: (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.background) === null || _e === void 0 ? void 0 : _e[50], borderRadius: "full", px: "0.5rem", py: "0.0625rem" }, count),
|
|
22
|
+
onAddItem && (react_1.default.createElement(react_2.Flex, { as: "button", type: "button", align: "center", gap: 1, ml: "auto", px: 2, py: 1, borderRadius: "md", fontSize: "0.75rem", fontWeight: 500, color: (_g = (_f = theme.colors) === null || _f === void 0 ? void 0 : _f.text) === null || _g === void 0 ? void 0 : _g[500], _hover: { bg: "whiteAlpha.500", color: color.text }, onClick: function () { return onAddItem(value); } },
|
|
23
|
+
react_1.default.createElement(lucide_react_1.Plus, { size: 14 }),
|
|
24
|
+
" Add item"))))));
|
|
25
|
+
};
|
|
26
|
+
exports.TableGroupRow = TableGroupRow;
|
|
27
|
+
exports.default = exports.TableGroupRow;
|
|
@@ -51,7 +51,7 @@ var react_1 = require("@chakra-ui/react");
|
|
|
51
51
|
var react_2 = __importStar(require("react"));
|
|
52
52
|
var table_1 = require("../../../Utils/table");
|
|
53
53
|
var useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
54
|
-
var TableFilters_1 = __importDefault(require("
|
|
54
|
+
var TableFilters_1 = __importDefault(require("../filters/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) {
|
|
@@ -59,8 +59,8 @@ var TableHeader = function (_a) {
|
|
|
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, _d
|
|
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],
|
|
62
|
+
var _a, _b, _c, _d;
|
|
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], position: "sticky", className: "columns sticky-columns", left: "0px", zIndex: 9 }, isSelecting ? (react_2.default.createElement(react_1.Spinner, { size: "sm", color: (_d = (_c = theme.colors) === null || _c === void 0 ? void 0 : _c.primary) === null || _d === void 0 ? void 0 : _d[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" }))));
|
|
64
64
|
}, [
|
|
65
65
|
checked,
|
|
66
66
|
freezedTextColor,
|
|
@@ -75,8 +75,12 @@ var TableHeader = function (_a) {
|
|
|
75
75
|
return (react_2.default.createElement(react_1.Th, { w: 6, minW: "35px", p: 0, 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: 1, boxShadow: theme.shadows.md }));
|
|
76
76
|
}, [noBorders, theme.colors]);
|
|
77
77
|
var RenderView = (0, react_2.useCallback)(function () {
|
|
78
|
-
var _a, _b
|
|
79
|
-
return (react_2.default.createElement(react_1.Th, { w: 2, p: 0, minW: "2.065rem", backgroundColor: (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.secondary) === null || _b === void 0 ? void 0 : _b[50],
|
|
78
|
+
var _a, _b;
|
|
79
|
+
return (react_2.default.createElement(react_1.Th, { w: 2, p: 0, minW: "2.065rem", backgroundColor: (_b = (_a = theme.colors) === null || _a === void 0 ? void 0 : _a.secondary) === null || _b === void 0 ? void 0 : _b[50],
|
|
80
|
+
// borderY={
|
|
81
|
+
// noBorders ? "none" : `0.063rem solid ${theme.colors?.gray[300]}`
|
|
82
|
+
// }
|
|
83
|
+
position: isActionFreeze ? "sticky" : "relative", className: "columns sticky-columns", right: "0px", zIndex: 1 }));
|
|
80
84
|
}, [noBorders, theme.colors, isActionFreeze]);
|
|
81
85
|
return (react_2.default.createElement(react_1.Tr, { pr: 0 },
|
|
82
86
|
isContent && react_2.default.createElement(RenderConent, null),
|
|
@@ -99,9 +103,9 @@ var SortingIcon = (0, react_2.memo)(function (_a) {
|
|
|
99
103
|
sortState === "desc" && react_2.default.createElement(lucide_react_1.ChevronDown, { size: 14 })));
|
|
100
104
|
});
|
|
101
105
|
var ColumnHeader = (0, react_2.memo)(function (_a) {
|
|
102
|
-
var _b, _c, _d, _e, _f;
|
|
106
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
103
107
|
var header = _a.header, index = _a.index, columnWidths = _a.columnWidths, isCheckbox = _a.isCheckbox, headerTextColor = _a.headerTextColor, freezedTextColor = _a.freezedTextColor, noBorders = _a.noBorders, columnsSort = _a.columnsSort, headerRefs = _a.headerRefs, columnsSearch = _a.columnsSearch, setColumnsSearch = _a.setColumnsSearch, handleSort = _a.handleSort, openFilterId = _a.openFilterId, setOpenFilterId = _a.setOpenFilterId;
|
|
104
|
-
var
|
|
108
|
+
var _v = (0, react_2.useState)(false), isHovered = _v[0], setIsHovered = _v[1];
|
|
105
109
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
106
110
|
var isFrozen = header.isFreeze;
|
|
107
111
|
var leftOffset = isFrozen
|
|
@@ -110,6 +114,15 @@ var ColumnHeader = (0, react_2.memo)(function (_a) {
|
|
|
110
114
|
var isSorting = header.isSort
|
|
111
115
|
? columnsSort.find(function (o) { return o.column === header.id; })
|
|
112
116
|
: undefined;
|
|
117
|
+
var activeSorts = columnsSort.filter(function (o) { return o.direction !== "none"; });
|
|
118
|
+
var sortPriority = activeSorts.length > 1 && isSorting && isSorting.direction !== "none"
|
|
119
|
+
? activeSorts.findIndex(function (o) { return o.column === header.id; }) + 1
|
|
120
|
+
: 0;
|
|
121
|
+
var ariaSort = (isSorting === null || isSorting === void 0 ? void 0 : isSorting.direction) === "asc"
|
|
122
|
+
? "ascending"
|
|
123
|
+
: (isSorting === null || isSorting === void 0 ? void 0 : isSorting.direction) === "desc"
|
|
124
|
+
? "descending"
|
|
125
|
+
: undefined;
|
|
113
126
|
// const TextColor = isFrozen ? freezedTextColor : headerTextColor;
|
|
114
127
|
var handleMouseDown = function (e) {
|
|
115
128
|
var parentBox = e.target
|
|
@@ -144,11 +157,12 @@ var ColumnHeader = (0, react_2.memo)(function (_a) {
|
|
|
144
157
|
}, [handleSort]);
|
|
145
158
|
var isFiltersEnabled = (isHovered && header.isSort) ||
|
|
146
159
|
((isSorting === null || isSorting === void 0 ? void 0 : isSorting.direction) && isSorting.direction !== "none");
|
|
147
|
-
return (react_2.default.createElement(react_1.Th, { key: index + 1, ref: function (el) { return (headerRefs.current[index] = el); }, textTransform: "capitalize", fontSize:
|
|
148
|
-
react_2.default.createElement(react_1.Box, { display: "flex", color: (
|
|
160
|
+
return (react_2.default.createElement(react_1.Th, { key: index + 1, ref: function (el) { return (headerRefs.current[index] = el); }, "aria-sort": ariaSort, textTransform: "capitalize", fontSize: 13, fontWeight: 600, position: isFrozen ? "sticky" : undefined, left: isFrozen ? leftOffset : undefined, minWidth: 120, backgroundColor: (_e = (_d = (_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.table) === null || _c === void 0 ? void 0 : _c.hover) === null || _d === void 0 ? void 0 : _d[200]) !== null && _e !== void 0 ? _e : (_g = (_f = theme.colors) === null || _f === void 0 ? void 0 : _f.secondary) === null || _g === void 0 ? void 0 : _g[50], maxWidth: 500, zIndex: isFrozen ? 2 : 1, py: 2, pr: 0, overflow: "hidden", borderTop: "none", borderBottom: noBorders ? "none" : "0.063rem solid ".concat((_h = theme.colors) === null || _h === void 0 ? void 0 : _h.border[500]), borderRight: noBorders ? "none" : "0.063rem solid ".concat((_l = (_k = (_j = theme.colors) === null || _j === void 0 ? void 0 : _j.boxborder) === null || _k === void 0 ? void 0 : _k[300]) !== null && _l !== void 0 ? _l : (_m = theme.colors) === null || _m === void 0 ? void 0 : _m.gray[200]), className: "columns ".concat(isFrozen ? "sticky-columns" : "scrollable-columns"), height: 45, onMouseEnter: function () { return setIsHovered(true); }, onMouseLeave: function () { return setIsHovered(false); } },
|
|
161
|
+
react_2.default.createElement(react_1.Box, { display: "flex", color: (_p = (_o = theme.colors) === null || _o === void 0 ? void 0 : _o.secondary) === null || _p === void 0 ? void 0 : _p[500], lineHeight: "1.25rem", justifyContent: "space-between", alignItems: "center", position: "relative" },
|
|
149
162
|
react_2.default.createElement(react_1.Box, { textOverflow: "ellipsis", whiteSpace: "nowrap", display: "inline-block", overflow: "hidden" }, header.label),
|
|
150
163
|
react_2.default.createElement(react_1.Box, { display: "inline-flex", alignItems: "center" },
|
|
151
164
|
isFiltersEnabled && (react_2.default.createElement(Sorting, { isSorting: isSorting, header: header })),
|
|
165
|
+
sortPriority > 0 && (react_2.default.createElement(react_1.Box, { as: "span", ml: 1, fontSize: "0.625rem", fontWeight: 700, lineHeight: "1", borderRadius: "full", px: "0.3rem", py: "0.1rem", bg: (_s = (_r = (_q = theme.colors) === null || _q === void 0 ? void 0 : _q.primary) === null || _r === void 0 ? void 0 : _r.opacity) === null || _s === void 0 ? void 0 : _s[16], color: (_u = (_t = theme.colors) === null || _t === void 0 ? void 0 : _t.primary) === null || _u === void 0 ? void 0 : _u[600] }, sortPriority)),
|
|
152
166
|
react_2.default.createElement(TableFilters_1.default, { header: header, setColumnsSearch: function (searchVal) {
|
|
153
167
|
return setColumnsSearch(function (prev) {
|
|
154
168
|
var _a;
|
|
@@ -61,12 +61,12 @@ var react_2 = require("@chakra-ui/react");
|
|
|
61
61
|
var lucide_react_1 = require("lucide-react");
|
|
62
62
|
var framer_motion_1 = require("framer-motion");
|
|
63
63
|
var react_3 = require("@chakra-ui/react");
|
|
64
|
-
var Checkbox_1 = __importDefault(require("
|
|
65
|
-
var RadioButton_1 = require("
|
|
64
|
+
var Checkbox_1 = __importDefault(require("../../Checkbox/Checkbox"));
|
|
65
|
+
var RadioButton_1 = require("../../RadioButton/RadioButton");
|
|
66
66
|
var TextOperationControls_1 = require("./TextOperationControls");
|
|
67
67
|
var SelectOperationControls_1 = require("./SelectOperationControls");
|
|
68
68
|
var CompactSelect_1 = __importDefault(require("./CompactSelect"));
|
|
69
|
-
var DatePicker_1 = __importDefault(require("
|
|
69
|
+
var DatePicker_1 = __importDefault(require("../../DatePicker/DatePicker"));
|
|
70
70
|
// ─── Helpers ──────────────────────────────────────────────────────────────────
|
|
71
71
|
var LABEL_MAX_LENGTH = 18;
|
|
72
72
|
function formatHeaderLabel(label) {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { TableProps } from "../TableProps";
|
|
3
|
-
declare const TableSettings: ({ columns, onSave,
|
|
2
|
+
import { TableDensity, TableProps } from "../TableProps";
|
|
3
|
+
declare const TableSettings: ({ columns, onSave, density, onDensityChange, }: {
|
|
4
4
|
columns: TableProps["columns"];
|
|
5
5
|
onSave: (updatedColumns: TableProps["columns"]) => void;
|
|
6
6
|
tableSettings?: TableProps["tableSettings"];
|
|
7
|
+
density?: TableDensity;
|
|
8
|
+
onDensityChange?: (d: TableDensity) => void;
|
|
7
9
|
}) => React.JSX.Element;
|
|
8
10
|
export default TableSettings;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
16
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
17
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
18
|
+
}
|
|
19
|
+
Object.defineProperty(o, k2, desc);
|
|
20
|
+
}) : (function(o, m, k, k2) {
|
|
21
|
+
if (k2 === undefined) k2 = k;
|
|
22
|
+
o[k2] = m[k];
|
|
23
|
+
}));
|
|
24
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
25
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
26
|
+
}) : function(o, v) {
|
|
27
|
+
o["default"] = v;
|
|
28
|
+
});
|
|
29
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
30
|
+
var ownKeys = function(o) {
|
|
31
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
32
|
+
var ar = [];
|
|
33
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
34
|
+
return ar;
|
|
35
|
+
};
|
|
36
|
+
return ownKeys(o);
|
|
37
|
+
};
|
|
38
|
+
return function (mod) {
|
|
39
|
+
if (mod && mod.__esModule) return mod;
|
|
40
|
+
var result = {};
|
|
41
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
42
|
+
__setModuleDefault(result, mod);
|
|
43
|
+
return result;
|
|
44
|
+
};
|
|
45
|
+
})();
|
|
46
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
var react_1 = require("@chakra-ui/react");
|
|
51
|
+
var react_2 = __importStar(require("react"));
|
|
52
|
+
var framer_motion_1 = require("framer-motion");
|
|
53
|
+
var ManageColumns_1 = __importDefault(require("./ManageColumns"));
|
|
54
|
+
var Button_1 = __importDefault(require("../../Button/Button"));
|
|
55
|
+
var useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
56
|
+
var lucide_react_1 = require("lucide-react");
|
|
57
|
+
var MotionModalContent = (0, framer_motion_1.motion)(react_1.ModalContent);
|
|
58
|
+
var DENSITY_OPTIONS = [
|
|
59
|
+
{ value: "compact", label: "Compact", desc: "Tight rows — fit more data on screen" },
|
|
60
|
+
{ value: "normal", label: "Normal", desc: "Balanced default spacing" },
|
|
61
|
+
{ value: "comfortable", label: "Comfortable", desc: "Roomy rows, easier scanning" },
|
|
62
|
+
];
|
|
63
|
+
var TableSettings = function (_a) {
|
|
64
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
65
|
+
var columns = _a.columns, onSave = _a.onSave, _p = _a.density, density = _p === void 0 ? "normal" : _p, onDensityChange = _a.onDensityChange;
|
|
66
|
+
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
67
|
+
var childInputMethodsRef = (0, react_2.useRef)({});
|
|
68
|
+
var _q = (0, react_2.useState)(false), settingsOpen = _q[0], setSettingsOpen = _q[1];
|
|
69
|
+
var _r = (0, react_2.useState)(0), selectedIndex = _r[0], setSelectedIndex = _r[1];
|
|
70
|
+
var _s = (0, react_2.useState)(columns), items = _s[0], setItems = _s[1];
|
|
71
|
+
var handleSave = (0, react_2.useCallback)(function () {
|
|
72
|
+
onSave(items);
|
|
73
|
+
setSettingsOpen(false);
|
|
74
|
+
}, [onSave, items]);
|
|
75
|
+
var handleOpen = (0, react_2.useCallback)(function () {
|
|
76
|
+
setItems(columns);
|
|
77
|
+
setSettingsOpen(true);
|
|
78
|
+
}, [columns]);
|
|
79
|
+
var tabStyle = {
|
|
80
|
+
fontSize: "13px",
|
|
81
|
+
fontWeight: 500,
|
|
82
|
+
px: 4,
|
|
83
|
+
py: 2,
|
|
84
|
+
borderBottom: "2px solid transparent",
|
|
85
|
+
color: (_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.text) === null || _c === void 0 ? void 0 : _c[400],
|
|
86
|
+
_selected: {
|
|
87
|
+
borderBottom: "2px solid ".concat(theme.colors.primary[600]),
|
|
88
|
+
color: theme.colors.primary[600],
|
|
89
|
+
fontWeight: 600,
|
|
90
|
+
},
|
|
91
|
+
_hover: { color: (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.text) === null || _e === void 0 ? void 0 : _e[600] },
|
|
92
|
+
};
|
|
93
|
+
return (react_2.default.createElement(react_1.Box, null,
|
|
94
|
+
react_2.default.createElement(react_1.Box, { display: "flex", justifyContent: "flex-end", cursor: "pointer", transition: "all 0.2s ease", _hover: { transform: "scale(1.1)" } },
|
|
95
|
+
react_2.default.createElement(lucide_react_1.Settings, { onClick: handleOpen, size: "1.25rem", color: (_g = (_f = theme === null || theme === void 0 ? void 0 : theme.colors) === null || _f === void 0 ? void 0 : _f.text) === null || _g === void 0 ? void 0 : _g[500] })),
|
|
96
|
+
react_2.default.createElement(react_1.Modal, { isOpen: settingsOpen, onClose: function () { return setSettingsOpen(false); }, size: "md" },
|
|
97
|
+
react_2.default.createElement(react_1.ModalOverlay, null),
|
|
98
|
+
react_2.default.createElement(MotionModalContent, { mt: "0", top: "0", position: "absolute", borderTopRadius: "0", initial: { y: "-100%", opacity: 0 }, animate: { y: 0, opacity: 1 }, exit: { y: "-100%", opacity: 0 }, transition: { duration: 0.4, ease: "easeOut" }, padding: "0", minW: "620px", minH: "520px", maxH: "90vh", display: "flex", flexDirection: "column", bg: (_j = (_h = theme.colors) === null || _h === void 0 ? void 0 : _h.background) === null || _j === void 0 ? void 0 : _j[50], overflow: "hidden" },
|
|
99
|
+
react_2.default.createElement(react_1.ModalCloseButton, { top: 3, right: 3, zIndex: 2 }),
|
|
100
|
+
react_2.default.createElement(react_1.Tabs, { index: selectedIndex, onChange: setSelectedIndex, variant: "unstyled", display: "flex", flexDirection: "column", flex: "1", minH: 0 },
|
|
101
|
+
react_2.default.createElement(react_1.Box, { pt: 4, px: 4 },
|
|
102
|
+
react_2.default.createElement(react_1.Text, { fontWeight: 600, fontSize: "md", mb: 3 }, "Table Settings"),
|
|
103
|
+
react_2.default.createElement(react_1.TabList, { gap: 0, borderBottom: "1px solid", borderColor: (_l = (_k = theme.colors) === null || _k === void 0 ? void 0 : _k.border) === null || _l === void 0 ? void 0 : _l[200] },
|
|
104
|
+
react_2.default.createElement(react_1.Tab, __assign({}, tabStyle), "Density"),
|
|
105
|
+
react_2.default.createElement(react_1.Tab, __assign({}, tabStyle), "Manage Columns"))),
|
|
106
|
+
react_2.default.createElement(react_1.ModalBody, { px: 4, py: 3, flex: "1", overflowY: "auto", sx: {
|
|
107
|
+
"&::-webkit-scrollbar": { width: "3px", height: "3px" },
|
|
108
|
+
"&::-webkit-scrollbar-track": { background: theme.colors.gray[100], borderRadius: "2px" },
|
|
109
|
+
"&::-webkit-scrollbar-thumb": { background: theme.colors.gray[400], borderRadius: "2px" },
|
|
110
|
+
"&::-webkit-scrollbar-thumb:hover": { background: theme.colors.gray[500] },
|
|
111
|
+
scrollbarWidth: "thin",
|
|
112
|
+
scrollbarColor: "".concat(theme.colors.gray[400], " ").concat(theme.colors.gray[100]),
|
|
113
|
+
} },
|
|
114
|
+
react_2.default.createElement(react_1.TabPanels, null,
|
|
115
|
+
react_2.default.createElement(react_1.TabPanel, { px: 0, py: 1 },
|
|
116
|
+
react_2.default.createElement(react_1.Flex, { direction: "column", gap: 2 }, DENSITY_OPTIONS.map(function (opt) {
|
|
117
|
+
var _a;
|
|
118
|
+
var selected = density === opt.value;
|
|
119
|
+
return (react_2.default.createElement(react_1.Flex, { as: "button", type: "button", key: opt.value, align: "center", gap: 3, px: 3, py: 2.5, borderRadius: "0.5rem", border: "1px solid", borderColor: selected ? theme.colors.primary[500] : (_a = theme.colors.boxborder) === null || _a === void 0 ? void 0 : _a[300], bg: selected ? theme.colors.primary.opacity[8] : "transparent", transition: "all 0.15s", _hover: { borderColor: theme.colors.primary[400] }, onClick: function () { return onDensityChange === null || onDensityChange === void 0 ? void 0 : onDensityChange(opt.value); } },
|
|
120
|
+
react_2.default.createElement(react_1.Box, { boxSize: "1.1rem", borderRadius: "full", border: "2px solid", borderColor: selected ? theme.colors.primary[500] : theme.colors.gray[400], display: "flex", alignItems: "center", justifyContent: "center", flexShrink: 0 }, selected && react_2.default.createElement(lucide_react_1.Check, { size: 11, color: theme.colors.primary[500], strokeWidth: 3 })),
|
|
121
|
+
react_2.default.createElement(react_1.Box, { textAlign: "left" },
|
|
122
|
+
react_2.default.createElement(react_1.Text, { fontSize: "13px", fontWeight: 600, color: theme.colors.text[700] }, opt.label),
|
|
123
|
+
react_2.default.createElement(react_1.Text, { fontSize: "11px", color: theme.colors.gray[500] }, opt.desc))));
|
|
124
|
+
}))),
|
|
125
|
+
react_2.default.createElement(react_1.TabPanel, { px: 0, py: 0 },
|
|
126
|
+
react_2.default.createElement(react_1.Box, { sx: {
|
|
127
|
+
"& [role='listitem'], & > div > div": {
|
|
128
|
+
py: "4px !important",
|
|
129
|
+
minHeight: "unset !important",
|
|
130
|
+
},
|
|
131
|
+
"& label": { fontSize: "13px !important" },
|
|
132
|
+
"& .chakra-checkbox": { gap: "8px !important" },
|
|
133
|
+
"& .chakra-checkbox__label": { fontSize: "13px !important" },
|
|
134
|
+
"& [draggable]": { py: "5px !important" },
|
|
135
|
+
} },
|
|
136
|
+
react_2.default.createElement(ManageColumns_1.default, { columns: columns, items: items, setItems: setItems, childInputMethodsRef: childInputMethodsRef })))))),
|
|
137
|
+
react_2.default.createElement(react_1.ModalFooter, { gap: "0.5rem", borderTop: "1px solid", borderColor: (_o = (_m = theme.colors) === null || _m === void 0 ? void 0 : _m.border) === null || _o === void 0 ? void 0 : _o[200], pt: 3, pb: 3, px: 4 },
|
|
138
|
+
react_2.default.createElement(Button_1.default, { label: "Close", size: "sm", onClick: function () { return setSettingsOpen(false); }, variant: "outline", colorScheme: "red" }),
|
|
139
|
+
react_2.default.createElement(Button_1.default, { label: "Save", size: "sm", onClick: handleSave }))))));
|
|
140
|
+
};
|
|
141
|
+
exports.default = TableSettings;
|