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
|
@@ -1,4 +1,15 @@
|
|
|
1
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
|
+
};
|
|
2
13
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
14
|
if (k2 === undefined) k2 = k;
|
|
4
15
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -41,46 +52,46 @@ var react_1 = __importStar(require("react"));
|
|
|
41
52
|
var react_2 = require("@chakra-ui/react");
|
|
42
53
|
var react_3 = require("@chakra-ui/react");
|
|
43
54
|
var framer_motion_1 = require("framer-motion");
|
|
44
|
-
var LeftFilterPane_1 = __importDefault(require("./LeftFilterPane"));
|
|
45
|
-
var Pagination_1 = __importDefault(require("./
|
|
46
|
-
var TableHeader_1 = __importDefault(require("./
|
|
47
|
-
var TableBody_1 = __importDefault(require("./
|
|
55
|
+
var LeftFilterPane_1 = __importDefault(require("./filters/LeftFilterPane"));
|
|
56
|
+
var Pagination_1 = __importDefault(require("./components/Pagination"));
|
|
57
|
+
var TableHeader_1 = __importDefault(require("./components/TableHeader"));
|
|
58
|
+
var TableBody_1 = __importDefault(require("./components/TableBody"));
|
|
48
59
|
var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
49
|
-
var useTable_1 = __importDefault(require("./
|
|
60
|
+
var useTable_1 = __importDefault(require("./hooks/useTable"));
|
|
50
61
|
var table_1 = require("../../Utils/table");
|
|
51
62
|
var usePreferences_1 = require("../../Hooks/usePreferences");
|
|
52
|
-
var TableSettings_1 = __importDefault(require("./
|
|
53
|
-
var HeaderActions_1 = __importDefault(require("./
|
|
63
|
+
var TableSettings_1 = __importDefault(require("./settings/TableSettings"));
|
|
64
|
+
var HeaderActions_1 = __importDefault(require("./components/HeaderActions"));
|
|
54
65
|
var Divider_1 = __importDefault(require("../Divider/Divider"));
|
|
55
|
-
var TableSearch_1 = __importDefault(require("./
|
|
56
|
-
var ActiveFilters_1 = __importDefault(require("./
|
|
66
|
+
var TableSearch_1 = __importDefault(require("./components/TableSearch"));
|
|
67
|
+
var ActiveFilters_1 = __importDefault(require("./filters/ActiveFilters"));
|
|
57
68
|
var lucide_react_1 = require("lucide-react");
|
|
58
69
|
var MotionBox = (0, framer_motion_1.motion)(react_2.Box);
|
|
59
70
|
function Table(_a) {
|
|
60
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z;
|
|
61
|
-
var data = _a.data, columns = _a.columns, onSelection = _a.onSelection, isLoading = _a.isLoading,
|
|
71
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8;
|
|
72
|
+
var data = _a.data, columns = _a.columns, onSelection = _a.onSelection, isLoading = _a.isLoading, _9 = _a.isCheckbox, isCheckbox = _9 === void 0 ? false : _9, headerBgColor = _a.headerBgColor, freezedBgColor = _a.freezedBgColor, headerTextColor = _a.headerTextColor, freezedTextColor = _a.freezedTextColor, tableBorderColor = _a.tableBorderColor, _10 = _a.noBorders, noBorders = _10 === void 0 ? false : _10, _11 = _a.isPagination, isPagination = _11 === void 0 ? true : _11, onRowClick = _a.onRowClick, selections = _a.selections, _12 = _a.isActionFreeze, isActionFreeze = _12 === void 0 ? true : _12, _13 = _a.preferences, preferences = _13 === void 0 ? {
|
|
62
73
|
url: "",
|
|
63
74
|
token: "",
|
|
64
75
|
key: "",
|
|
65
76
|
name: "",
|
|
66
77
|
page: "",
|
|
67
78
|
orgId: "",
|
|
68
|
-
} :
|
|
79
|
+
} : _13, _14 = _a.paginationMode, paginationMode = _14 === void 0 ? "client" : _14, _15 = _a.infiniteScroll, infiniteScroll = _15 === void 0 ? false : _15, hasMore = _a.hasMore, _16 = _a.isLoadingMore, isLoadingMore = _16 === void 0 ? false : _16, _17 = _a.noOfRowsPerPage, noOfRowsPerPage = _17 === void 0 ? 50 : _17, _18 = _a.totalRecords, totalRecords = _18 === void 0 ? 0 : _18, onPagination = _a.onPagination, _19 = _a.isTableSettings, isTableSettings = _19 === void 0 ? false : _19, 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, _20 = _a.density, density = _20 === void 0 ? "normal" : _20, stripe = _a.stripe, groupBy = _a.groupBy, groupColors = _a.groupColors, onAddItem = _a.onAddItem, emptyState = _a.emptyState;
|
|
69
80
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
70
|
-
var
|
|
81
|
+
var _21 = (0, react_1.useState)({}), columnsSearch = _21[0], setColumnsSearch = _21[1];
|
|
71
82
|
var tableContainerRef = (0, react_1.useRef)(null);
|
|
72
|
-
var
|
|
83
|
+
var _22 = (0, react_2.useDisclosure)(), isFilterModalOpen = _22.isOpen, onFilterModalOpen = _22.onOpen, onFilterModalClose = _22.onClose;
|
|
73
84
|
var filterMode = (_b = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.filterMode) !== null && _b !== void 0 ? _b : "sidebar";
|
|
74
|
-
var
|
|
85
|
+
var _23 = (0, react_1.useState)(500), viewportAvailableH = _23[0], setViewportAvailableH = _23[1];
|
|
75
86
|
var isServerPagination = paginationMode === "server";
|
|
76
|
-
var
|
|
87
|
+
var _24 = (0, usePreferences_1.useGetPreferences)({
|
|
77
88
|
baseUrl: preferences.url,
|
|
78
89
|
page: preferences.page,
|
|
79
90
|
key: preferences.key,
|
|
80
91
|
name: preferences.name,
|
|
81
92
|
authToken: preferences.token,
|
|
82
93
|
orgId: preferences.orgId,
|
|
83
|
-
}), tablePreferencesData =
|
|
94
|
+
}), tablePreferencesData = _24.preferences, loading = _24.loading;
|
|
84
95
|
var savePreferences = (0, usePreferences_1.useSavePreferences)({
|
|
85
96
|
baseUrl: preferences.url,
|
|
86
97
|
page: preferences.page,
|
|
@@ -98,7 +109,7 @@ function Table(_a) {
|
|
|
98
109
|
}
|
|
99
110
|
return {};
|
|
100
111
|
}, [tablePreferencesData]);
|
|
101
|
-
var
|
|
112
|
+
var _25 = (0, useTable_1.default)({
|
|
102
113
|
tableBorderColor: tableBorderColor,
|
|
103
114
|
data: data,
|
|
104
115
|
isPagination: isPagination,
|
|
@@ -112,10 +123,37 @@ function Table(_a) {
|
|
|
112
123
|
isServerPagination: isServerPagination,
|
|
113
124
|
onNoOfRowsPerPageChange: onNoOfRowsPerPageChange,
|
|
114
125
|
defaultVisibleColumns: defaultVisibleColumns,
|
|
115
|
-
}), tableData =
|
|
126
|
+
}), tableData = _25.tableData, isContent = _25.isContent, isLink = _25.isLink, headerRefs = _25.headerRefs, columnWidths = _25.columnWidths, handleSort = _25.handleSort, handleCheckbox = _25.handleCheckbox, filteredData = _25.filteredData, startRow = _25.startRow, endRow = _25.endRow, selection = _25.selection, columnsSort = _25.columnsSort, currentPage = _25.currentPage, pages = _25.pages, rowsPerPage = _25.rowsPerPage, handlePageSizeChange = _25.handlePageSizeChange, setCurrentPage = _25.setCurrentPage, columnsList = _25.columnsList, handleColumnPreferences = _25.handleColumnPreferences, isSelecting = _25.isSelecting;
|
|
127
|
+
// Density is managed here so the Table Settings tab can change + persist it
|
|
128
|
+
// (seeded from the prop, then from saved preferences when they load).
|
|
129
|
+
var _26 = (0, react_1.useState)(density), densityState = _26[0], setDensityState = _26[1];
|
|
130
|
+
(0, react_1.useEffect)(function () {
|
|
131
|
+
if (tablePreferences === null || tablePreferences === void 0 ? void 0 : tablePreferences.density)
|
|
132
|
+
setDensityState(tablePreferences.density);
|
|
133
|
+
}, [tablePreferences === null || tablePreferences === void 0 ? void 0 : tablePreferences.density]);
|
|
134
|
+
var handleDensityChange = function (d) {
|
|
135
|
+
setDensityState(d);
|
|
136
|
+
savePreferences === null || savePreferences === void 0 ? void 0 : savePreferences(__assign(__assign({}, tablePreferences), { columns: columnsList, density: d }));
|
|
137
|
+
};
|
|
116
138
|
var _filteredData = (0, react_1.useMemo)(function () {
|
|
117
139
|
return (0, table_1.searchAndSortData)(filteredData, columnsSearch);
|
|
118
140
|
}, [columnsSearch, filteredData]);
|
|
141
|
+
// --- Monday-style grouping (client-side). When active, pagination is hidden
|
|
142
|
+
// and the body renders colored, collapsible groups over the full dataset. ---
|
|
143
|
+
var isGrouped = !!groupBy && !isServerPagination;
|
|
144
|
+
// Infinite scroll (server mode, not grouped): load more on scroll-near-bottom.
|
|
145
|
+
var canInfinite = infiniteScroll && !isGrouped;
|
|
146
|
+
var groupPalette = (0, react_1.useMemo)(function () { return (0, table_1.buildTablePalette)(theme); }, [theme]);
|
|
147
|
+
var groupedSource = (0, react_1.useMemo)(function () {
|
|
148
|
+
if (!isGrouped)
|
|
149
|
+
return [];
|
|
150
|
+
return (0, table_1.searchAndSortData)((0, table_1.SortMultiColumnData)(tableData, columnsSort), columnsSearch);
|
|
151
|
+
}, [isGrouped, tableData, columnsSort, columnsSearch]);
|
|
152
|
+
var renderGroups = (0, react_1.useMemo)(function () {
|
|
153
|
+
if (!isGrouped)
|
|
154
|
+
return undefined;
|
|
155
|
+
return (0, table_1.groupRows)(groupedSource, groupBy).map(function (g) { return (__assign(__assign({}, g), { color: (0, table_1.pickTableColor)(g.value, groupPalette, groupColors === null || groupColors === void 0 ? void 0 : groupColors[g.value]) })); });
|
|
156
|
+
}, [isGrouped, groupedSource, groupBy, groupPalette, groupColors]);
|
|
119
157
|
var onPaginationRef = (0, react_1.useRef)(onPagination);
|
|
120
158
|
onPaginationRef.current = onPagination;
|
|
121
159
|
var prevPageRef = (0, react_1.useRef)(currentPage);
|
|
@@ -147,7 +185,10 @@ function Table(_a) {
|
|
|
147
185
|
: "".concat(startRow + 1, " - ").concat(endRow > tableData.length ? tableData.length : endRow, " of ").concat(tableData.length); }, [startRow, rowsPerPage, totalRecords, endRow, tableData.length]);
|
|
148
186
|
var controlsHeight = 45;
|
|
149
187
|
var estimatedRowHeight = 45;
|
|
150
|
-
|
|
188
|
+
// In grouped mode the rendered rows come from the full grouped source, not the
|
|
189
|
+
// paged slice — base the height on that so a 1-result search isn't clipped.
|
|
190
|
+
var actualRows = isGrouped ? groupedSource.length : _filteredData.length;
|
|
191
|
+
var isEmptyState = !isTableLoading && actualRows === 0;
|
|
151
192
|
var loadingRowsCount = typeof loadingSkeletonRows === "number" ? Math.max(1, loadingSkeletonRows) : 4;
|
|
152
193
|
var minRows = typeof minVisibleRows === "number"
|
|
153
194
|
? Math.max(0, minVisibleRows)
|
|
@@ -171,13 +212,46 @@ function Table(_a) {
|
|
|
171
212
|
return function () { return window.removeEventListener("resize", compute); };
|
|
172
213
|
}, [autoFitViewport]);
|
|
173
214
|
var heightRowsCount = isTableLoading ? loadingRowsCount : visibleRowsCount;
|
|
174
|
-
var isCompactRows = heightRowsCount <= 1 && !(filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar);
|
|
175
|
-
var rowsHeight =
|
|
215
|
+
var isCompactRows = heightRowsCount <= 1 && !(filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) && !isGrouped && !isEmptyState;
|
|
216
|
+
var rowsHeight = heightRowsCount * estimatedRowHeight + estimatedRowHeight;
|
|
217
|
+
if (isGrouped)
|
|
218
|
+
rowsHeight += ((_c = renderGroups === null || renderGroups === void 0 ? void 0 : renderGroups.length) !== null && _c !== void 0 ? _c : 1) * 42; // group header rows
|
|
219
|
+
if (isEmptyState)
|
|
220
|
+
rowsHeight = Math.max(rowsHeight, 200); // room for the empty state
|
|
176
221
|
var dynamicMaxH = Math.min(500, rowsHeight);
|
|
177
222
|
var fittedMaxH = autoFitViewport ? Math.min(dynamicMaxH, viewportAvailableH) : dynamicMaxH;
|
|
178
223
|
var tableMaxH = typeof tableMaxHeight === "number" ? tableMaxHeight : (isCompactRows ? rowsHeight + 8 : fittedMaxH);
|
|
179
224
|
var isCompactHeader = (0, react_2.useBreakpointValue)({ base: true, md: true, lg: false });
|
|
180
225
|
var compactScrollbarPadding = isCompactRows ? 4 : 0;
|
|
226
|
+
// Infinite scroll: reuse onPagination("next") when scrolled near the bottom.
|
|
227
|
+
var infiniteRef = (0, react_1.useRef)({ isLoadingMore: isLoadingMore, isTableLoading: isTableLoading, hasMore: hasMore, rowsPerPage: rowsPerPage, dataLen: tableData.length, lastRecord: tableData[tableData.length - 1], totalRecords: totalRecords, isServerPagination: isServerPagination });
|
|
228
|
+
infiniteRef.current = { isLoadingMore: isLoadingMore, isTableLoading: isTableLoading, hasMore: hasMore, rowsPerPage: rowsPerPage, dataLen: tableData.length, lastRecord: tableData[tableData.length - 1], totalRecords: totalRecords, isServerPagination: isServerPagination };
|
|
229
|
+
(0, react_1.useEffect)(function () {
|
|
230
|
+
if (!canInfinite)
|
|
231
|
+
return;
|
|
232
|
+
var el = tableContainerRef.current;
|
|
233
|
+
if (!el)
|
|
234
|
+
return;
|
|
235
|
+
var onScroll = function () {
|
|
236
|
+
var _a;
|
|
237
|
+
var s = infiniteRef.current;
|
|
238
|
+
if (s.isLoadingMore || s.isTableLoading)
|
|
239
|
+
return;
|
|
240
|
+
var more = typeof s.hasMore === "boolean"
|
|
241
|
+
? s.hasMore
|
|
242
|
+
: s.isServerPagination
|
|
243
|
+
? s.dataLen < s.totalRecords
|
|
244
|
+
: false;
|
|
245
|
+
if (!more)
|
|
246
|
+
return;
|
|
247
|
+
if (el.scrollHeight - el.scrollTop - el.clientHeight < 160) {
|
|
248
|
+
var nextPage = Math.floor(s.dataLen / (s.rowsPerPage || 1)) + 1;
|
|
249
|
+
(_a = onPaginationRef.current) === null || _a === void 0 ? void 0 : _a.call(onPaginationRef, nextPage, s.rowsPerPage, s.lastRecord, "next");
|
|
250
|
+
}
|
|
251
|
+
};
|
|
252
|
+
el.addEventListener("scroll", onScroll, { passive: true });
|
|
253
|
+
return function () { return el.removeEventListener("scroll", onScroll); };
|
|
254
|
+
}, [canInfinite]);
|
|
181
255
|
var sidebarActiveCount = (0, react_1.useMemo)(function () {
|
|
182
256
|
if (!(filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected))
|
|
183
257
|
return 0;
|
|
@@ -188,22 +262,22 @@ function Table(_a) {
|
|
|
188
262
|
return acc + (Array.isArray(items) ? items.length : 0);
|
|
189
263
|
}, 0);
|
|
190
264
|
}, [filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected]);
|
|
191
|
-
return (react_1.default.createElement(react_2.Box, { bg: (
|
|
265
|
+
return (react_1.default.createElement(react_2.Box, { bg: (_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.background) === null || _e === void 0 ? void 0 : _e[50], border: "0.063rem solid ".concat((_f = theme.colors.border) === null || _f === void 0 ? void 0 : _f[500]), borderRadius: 3 },
|
|
192
266
|
filterSidebar && filterMode === "modal" && (react_1.default.createElement(react_2.Modal, { isOpen: isFilterModalOpen, onClose: onFilterModalClose, size: "4xl", scrollBehavior: "inside" },
|
|
193
267
|
react_1.default.createElement(react_2.ModalOverlay, null),
|
|
194
268
|
react_1.default.createElement(react_2.ModalContent, { my: 0, top: "10%", position: "fixed", left: "auto", right: "auto" },
|
|
195
269
|
react_1.default.createElement(react_2.ModalCloseButton, { size: "sm" }),
|
|
196
270
|
react_1.default.createElement(react_2.ModalBody, { p: 0 },
|
|
197
|
-
react_1.default.createElement(LeftFilterPane_1.default, { theme: theme, sections: (
|
|
271
|
+
react_1.default.createElement(LeftFilterPane_1.default, { theme: theme, sections: (_g = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.sidebarOptions) !== null && _g !== void 0 ? _g : [], selected: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected, onApply: function (sel) { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply) === null || _a === void 0 ? void 0 : _a.call(filterSidebar, sel); onFilterModalClose(); }, onClear: function () { var _a; (_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler) === null || _a === void 0 ? void 0 : _a.call(filterSidebar); }, isApplyLoading: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isApplyLoading, filterMode: filterMode }))))),
|
|
198
272
|
react_1.default.createElement(react_2.Flex, { align: "start" },
|
|
199
|
-
filterMode === "sidebar" && (react_1.default.createElement(MotionBox, { initial: { width: 0 }, animate: { width: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? 180 : 0 }, transition: { type: "tween", duration: 0.5 }, overflow: "hidden", flexShrink: 0, borderRight: "1px solid", borderColor: (
|
|
200
|
-
react_1.default.createElement(LeftFilterPane_1.default, { height: controlsHeight + tableMaxH, theme: theme, sections: (
|
|
273
|
+
filterMode === "sidebar" && (react_1.default.createElement(MotionBox, { initial: { width: 0 }, animate: { width: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? 180 : 0 }, transition: { type: "tween", duration: 0.5 }, overflow: "hidden", flexShrink: 0, borderRight: "1px solid", borderColor: (_h = theme.colors.border) === null || _h === void 0 ? void 0 : _h[500], style: { height: controlsHeight + tableMaxH }, minHeight: (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isFilterSidebar) ? "32rem" : "auto" },
|
|
274
|
+
react_1.default.createElement(LeftFilterPane_1.default, { height: controlsHeight + tableMaxH, theme: theme, sections: (_j = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.sidebarOptions) !== null && _j !== void 0 ? _j : [], selected: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.selected, onApply: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply, onClear: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler, isApplyLoading: filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.isApplyLoading, filterMode: filterMode }))),
|
|
201
275
|
react_1.default.createElement(react_2.Box, { flex: "1", minW: 0 },
|
|
202
|
-
react_1.default.createElement(react_2.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 0, height: controlsHeight, gap:
|
|
276
|
+
react_1.default.createElement(react_2.Box, { display: "flex", alignItems: "center", justifyContent: "space-between", px: 3, py: 0, height: controlsHeight, gap: 3, flexWrap: "nowrap", bg: (_l = (_k = theme.colors) === null || _k === void 0 ? void 0 : _k.background) === null || _l === void 0 ? void 0 : _l[50], borderBottom: "0.063rem solid ".concat((_m = theme.colors.border) === null || _m === void 0 ? void 0 : _m[500]) },
|
|
203
277
|
filterSidebar && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
204
278
|
react_1.default.createElement(react_2.Box, { position: "relative", display: "inline-block" },
|
|
205
|
-
react_1.default.createElement(react_3.Icon, { as: lucide_react_1.Filter, transform: "scaleX(-1)", cursor: "pointer", boxSize: 4, color: sidebarActiveCount > 0 ? (
|
|
206
|
-
sidebarActiveCount > 0 && (react_1.default.createElement(react_2.Box, { position: "absolute", top: "-6px", right: "-10px", bg: (
|
|
279
|
+
react_1.default.createElement(react_3.Icon, { as: lucide_react_1.Filter, transform: "scaleX(-1)", cursor: "pointer", boxSize: 4, color: sidebarActiveCount > 0 ? (_p = (_o = theme.colors) === null || _o === void 0 ? void 0 : _o.primary) === null || _p === void 0 ? void 0 : _p[500] : (_r = (_q = theme.colors) === null || _q === void 0 ? void 0 : _q.text) === null || _r === void 0 ? void 0 : _r[500], onClick: filterMode === "modal" ? onFilterModalOpen : filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.filterSidebarToggle }),
|
|
280
|
+
sidebarActiveCount > 0 && (react_1.default.createElement(react_2.Box, { position: "absolute", top: "-6px", right: "-10px", bg: (_t = (_s = theme.colors) === null || _s === void 0 ? void 0 : _s.primary) === null || _t === void 0 ? void 0 : _t[500], color: "white", borderRadius: "full", p: "1px", cursor: "pointer", onClick: function (e) {
|
|
207
281
|
var _a;
|
|
208
282
|
e.stopPropagation();
|
|
209
283
|
if (filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onClearAllHandler) {
|
|
@@ -212,23 +286,23 @@ function Table(_a) {
|
|
|
212
286
|
else {
|
|
213
287
|
(_a = filterSidebar === null || filterSidebar === void 0 ? void 0 : filterSidebar.onApply) === null || _a === void 0 ? void 0 : _a.call(filterSidebar, {});
|
|
214
288
|
}
|
|
215
|
-
}, _hover: { bg: (
|
|
289
|
+
}, _hover: { bg: (_v = (_u = theme.colors) === null || _u === void 0 ? void 0 : _u.red) === null || _v === void 0 ? void 0 : _v[600] }, display: "flex", alignItems: "center", justifyContent: "center", zIndex: 2 },
|
|
216
290
|
react_1.default.createElement(lucide_react_1.X, { size: 10, strokeWidth: 3 })))),
|
|
217
291
|
react_1.default.createElement(Divider_1.default, null))),
|
|
218
292
|
react_1.default.createElement(TableSearch_1.default, { onSearch: onGlobalSearch }),
|
|
219
293
|
isTableSettings && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
220
294
|
react_1.default.createElement(Divider_1.default, null),
|
|
221
|
-
react_1.default.createElement(TableSettings_1.default, { columns: columnsList, onSave: function (cols) { return handleColumnPreferences(cols); }, tableSettings: tableSettings }))),
|
|
295
|
+
react_1.default.createElement(TableSettings_1.default, { columns: columnsList, onSave: function (cols) { return handleColumnPreferences(cols); }, tableSettings: tableSettings, density: densityState, onDensityChange: handleDensityChange }))),
|
|
222
296
|
headerActions && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
223
297
|
react_1.default.createElement(Divider_1.default, null),
|
|
224
298
|
react_1.default.createElement(HeaderActions_1.default, { actions: headerActions, selections: selection }))),
|
|
225
299
|
react_1.default.createElement(ActiveFilters_1.default, { columns: columnsList, columnsSearch: columnsSearch, setColumnsSearch: setColumnsSearch }),
|
|
226
300
|
react_1.default.createElement(react_2.Box, { ml: "auto", display: "flex", alignItems: "center", gap: 2 },
|
|
227
|
-
(isPagination || isServerPagination) && !isCompactHeader && (react_1.default.createElement(react_2.Box, { flex: "0 0 auto" },
|
|
301
|
+
(isPagination || isServerPagination) && !isGrouped && !canInfinite && !isCompactHeader && (react_1.default.createElement(react_2.Box, { flex: "0 0 auto" },
|
|
228
302
|
react_1.default.createElement(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }))),
|
|
229
|
-
(isPagination || isServerPagination) && isCompactHeader && tableData.length > 0 && (react_1.default.createElement(react_2.Popover, { placement: "bottom-end" },
|
|
303
|
+
(isPagination || isServerPagination) && !isGrouped && !canInfinite && isCompactHeader && tableData.length > 0 && (react_1.default.createElement(react_2.Popover, { placement: "bottom-end" },
|
|
230
304
|
react_1.default.createElement(react_2.PopoverTrigger, null,
|
|
231
|
-
react_1.default.createElement(react_2.IconButton, { "aria-label": "More", size: "sm", variant: "ghost", icon: react_1.default.createElement(lucide_react_1.EllipsisVertical, { size: 18, color: (
|
|
305
|
+
react_1.default.createElement(react_2.IconButton, { "aria-label": "More", size: "sm", variant: "ghost", icon: react_1.default.createElement(lucide_react_1.EllipsisVertical, { size: 18, color: (_x = (_w = theme.colors) === null || _w === void 0 ? void 0 : _w.text) === null || _x === void 0 ? void 0 : _x[500] }) })),
|
|
232
306
|
react_1.default.createElement(react_2.PopoverContent, { maxW: "22rem", p: 2, overflow: "hidden" },
|
|
233
307
|
react_1.default.createElement(react_2.PopoverBody, { p: 0 },
|
|
234
308
|
react_1.default.createElement(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }))))))),
|
|
@@ -259,7 +333,11 @@ function Table(_a) {
|
|
|
259
333
|
} },
|
|
260
334
|
react_1.default.createElement(react_3.Table, { variant: "simple", size: "sm", minW: "100%", className: "table_wrapper", sx: {
|
|
261
335
|
width: "100%",
|
|
262
|
-
|
|
336
|
+
// `separate` (not `collapse`) so sticky header cells paint an opaque
|
|
337
|
+
// background over their borders — collapsed borders bleed scrolling
|
|
338
|
+
// content through the seams.
|
|
339
|
+
borderCollapse: "separate",
|
|
340
|
+
borderSpacing: 0,
|
|
263
341
|
"th .resize-handle": {
|
|
264
342
|
position: "absolute",
|
|
265
343
|
top: 0,
|
|
@@ -271,12 +349,15 @@ function Table(_a) {
|
|
|
271
349
|
zIndex: 999,
|
|
272
350
|
},
|
|
273
351
|
} },
|
|
274
|
-
react_1.default.createElement(react_3.Thead, { position: "sticky", top: 0, zIndex: 4 },
|
|
275
|
-
react_1.default.createElement(TableHeader_1.default, { columns: columnsList, isCheckbox: isCheckbox, headerBgColor: headerBgColor !== null && headerBgColor !== void 0 ? headerBgColor : theme.colors.backgroundColor.muted, headerTextColor: headerTextColor !== null && headerTextColor !== void 0 ? headerTextColor : (
|
|
352
|
+
react_1.default.createElement(react_3.Thead, { position: "sticky", top: 0, zIndex: 4, bg: (_0 = (_z = (_y = theme.colors.table) === null || _y === void 0 ? void 0 : _y.hover) === null || _z === void 0 ? void 0 : _z[200]) !== null && _0 !== void 0 ? _0 : (_1 = theme.colors.secondary) === null || _1 === void 0 ? void 0 : _1[50] },
|
|
353
|
+
react_1.default.createElement(TableHeader_1.default, { columns: columnsList, isCheckbox: isCheckbox, headerBgColor: headerBgColor !== null && headerBgColor !== void 0 ? headerBgColor : theme.colors.backgroundColor.muted, headerTextColor: headerTextColor !== null && headerTextColor !== void 0 ? headerTextColor : (_2 = theme.colors) === null || _2 === void 0 ? void 0 : _2.gray[600], freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_3 = theme.colors) === null || _3 === void 0 ? void 0 : _3.gray[600], handleSort: handleSort, headerRefs: headerRefs, columnWidths: columnWidths, columnsSort: columnsSort, noBorders: noBorders, handleCheckbox: handleCheckbox, isLoading: isTableLoading, checked: tableData.length !== 0 && selection.length === tableData.length
|
|
276
354
|
? true
|
|
277
355
|
: selection.length === 0
|
|
278
356
|
? false
|
|
279
357
|
: "indeterminate", isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze, setColumnsSearch: setColumnsSearch, columnsSearch: columnsSearch, isSelecting: isSelecting })),
|
|
280
358
|
react_1.default.createElement(react_3.Tbody, null,
|
|
281
|
-
react_1.default.createElement(TableBody_1.default, { data: _filteredData, columns: columnsList, startRow: startRow, endRow: endRow, scrollContainerRef: tableContainerRef, isCheckbox: isCheckbox, columnWidths: columnWidths, noBorders: noBorders, freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (
|
|
359
|
+
react_1.default.createElement(TableBody_1.default, { data: isGrouped ? groupedSource : _filteredData, groups: renderGroups, onAddItem: onAddItem, columns: columnsList, startRow: isGrouped ? 0 : startRow, endRow: endRow, scrollContainerRef: tableContainerRef, isCheckbox: isCheckbox, columnWidths: columnWidths, noBorders: noBorders, freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_4 = theme.colors) === null || _4 === void 0 ? void 0 : _4.gray[600], handleCheckbox: handleCheckbox, selections: selection, isLoading: isTableLoading, loadingSkeletonRows: loadingSkeletonRows, onRowClick: onRowClick, isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze, density: densityState, stripe: stripe, emptyState: emptyState }))),
|
|
360
|
+
canInfinite && isLoadingMore && (react_1.default.createElement(react_2.Flex, { justify: "center", align: "center", py: 3, gap: 2 },
|
|
361
|
+
react_1.default.createElement(react_2.Spinner, { size: "sm", color: (_6 = (_5 = theme.colors) === null || _5 === void 0 ? void 0 : _5.primary) === null || _6 === void 0 ? void 0 : _6[500] }),
|
|
362
|
+
react_1.default.createElement(react_2.Box, { fontSize: "0.75rem", color: (_8 = (_7 = theme.colors) === null || _7 === void 0 ? void 0 : _7.text) === null || _8 === void 0 ? void 0 : _8[500] }, "Loading more\u2026"))))))));
|
|
282
363
|
}
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import { Dispatch, MutableRefObject, SetStateAction } from "react";
|
|
1
|
+
import { Dispatch, MutableRefObject, ReactNode, SetStateAction } from "react";
|
|
2
2
|
import { FilterSidebarProps } from "../FilterSidebar/FilterSidebar";
|
|
3
|
+
export type TableDensity = "compact" | "normal" | "comfortable";
|
|
4
|
+
export type TableEmptyState = {
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
title?: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
};
|
|
3
9
|
export type TableProps = {
|
|
4
10
|
data: DataObject[];
|
|
5
11
|
columns: TableHeaderProps[];
|
|
12
|
+
groupBy?: string | number;
|
|
13
|
+
groupColors?: Record<string | number, string>;
|
|
14
|
+
onAddItem?: (groupValue: string | number) => void;
|
|
15
|
+
density?: TableDensity;
|
|
16
|
+
stripe?: boolean;
|
|
17
|
+
emptyState?: TableEmptyState | ReactNode;
|
|
6
18
|
handleExportChange?: (value: string) => void | undefined;
|
|
7
19
|
exportOptions?: ExportOption[];
|
|
8
20
|
exportLabel?: string;
|
|
@@ -21,6 +33,9 @@ export type TableProps = {
|
|
|
21
33
|
onRowClick?: (row: DataObject, header: Record<string | number, string | number>) => void;
|
|
22
34
|
isActionFreeze?: boolean;
|
|
23
35
|
paginationMode?: "client" | "server";
|
|
36
|
+
infiniteScroll?: boolean;
|
|
37
|
+
hasMore?: boolean;
|
|
38
|
+
isLoadingMore?: boolean;
|
|
24
39
|
noOfRowsPerPage?: number;
|
|
25
40
|
totalRecords?: number;
|
|
26
41
|
onPagination?: (page: number, noOfRecords: number, record: DataObject | undefined, direction: "next" | "prev" | "first" | "last") => void;
|
|
@@ -88,6 +103,8 @@ export type TableHeaderProps = {
|
|
|
88
103
|
isSearch?: boolean;
|
|
89
104
|
isFreeze?: boolean;
|
|
90
105
|
isHidden?: boolean;
|
|
106
|
+
type?: "status";
|
|
107
|
+
statusColors?: Record<string, string>;
|
|
91
108
|
node?: (data: DataObject) => JSX.Element | string | number | undefined;
|
|
92
109
|
};
|
|
93
110
|
export type ExportOption = {
|
|
@@ -116,7 +133,7 @@ export type TableHeaderPageProps = Pick<TableProps, "columns" | "isCheckbox" | "
|
|
|
116
133
|
columnsSearch: Record<string, string>;
|
|
117
134
|
isSelecting?: boolean;
|
|
118
135
|
};
|
|
119
|
-
export type TableBodyPageProps = Pick<TableProps, "columns" | "isCheckbox" | "data" | "freezedBgColor" | "freezedTextColor" | "noBorders" | "isLoading" | "loadingSkeletonRows" | "onRowClick" | "isActionFreeze"> & {
|
|
136
|
+
export type TableBodyPageProps = Pick<TableProps, "columns" | "isCheckbox" | "data" | "freezedBgColor" | "freezedTextColor" | "noBorders" | "isLoading" | "loadingSkeletonRows" | "onRowClick" | "isActionFreeze" | "density" | "stripe" | "emptyState"> & {
|
|
120
137
|
startRow: number;
|
|
121
138
|
endRow: number;
|
|
122
139
|
columnWidths: number[];
|
|
@@ -125,6 +142,21 @@ export type TableBodyPageProps = Pick<TableProps, "columns" | "isCheckbox" | "da
|
|
|
125
142
|
isContent: boolean;
|
|
126
143
|
isLink: boolean;
|
|
127
144
|
scrollContainerRef?: MutableRefObject<HTMLDivElement | null>;
|
|
145
|
+
/** Optional per-row id → accent color (Monday group stripe). */
|
|
146
|
+
accentColors?: Record<string | number, string>;
|
|
147
|
+
/** When provided, the body renders as a grouped (Monday) board instead of a flat list. */
|
|
148
|
+
groups?: TableRenderGroup[];
|
|
149
|
+
onAddItem?: (groupValue: string | number) => void;
|
|
150
|
+
};
|
|
151
|
+
export type TableRenderGroup = {
|
|
152
|
+
value: string | number;
|
|
153
|
+
label: string;
|
|
154
|
+
color: {
|
|
155
|
+
solid: string;
|
|
156
|
+
soft: string;
|
|
157
|
+
text: string;
|
|
158
|
+
};
|
|
159
|
+
rows: DataObject[];
|
|
128
160
|
};
|
|
129
161
|
export type TableFiltersProps = {
|
|
130
162
|
header: DataObject;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TableBodyPageProps } from "../TableProps";
|
|
3
|
-
declare const
|
|
3
|
+
export declare const DENSITY_CONFIG: Record<string, {
|
|
4
|
+
height: number;
|
|
5
|
+
py: string;
|
|
6
|
+
}>;
|
|
7
|
+
declare const TableBody: ({ data, isCheckbox, columns, startRow, columnWidths, freezedBgColor, freezedTextColor, noBorders, handleCheckbox, selections, isLoading, onRowClick, isContent, isLink, isActionFreeze, loadingSkeletonRows, scrollContainerRef, density, accentColors, groups, onAddItem, emptyState, }: TableBodyPageProps) => React.JSX.Element;
|
|
4
8
|
export default TableBody;
|