pixelize-design-library 2.2.189 → 2.2.191
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/dist/Components/Editor/Editor.d.ts +1 -2
- package/dist/Components/Editor/Editor.js +5 -39
- package/dist/Components/KanbanBoard/AccountCard.d.ts +2 -2
- package/dist/Components/KanbanBoard/AccountCard.js +4 -37
- package/dist/Components/KanbanBoard/KanbanBoard.js +34 -70
- package/dist/Components/MultiSelect/MultiSelect.js +19 -10
- package/dist/Components/SearchSelect/SearchSelect.js +16 -23
- package/dist/Components/Table/Components/ActiveFilters.js +25 -66
- package/dist/Components/Table/Components/Pagination.d.ts +1 -1
- package/dist/Components/Table/Components/Pagination.js +9 -41
- package/dist/Components/Table/Components/TableFilters.js +5 -11
- package/dist/Components/Table/Components/useTable.js +24 -36
- package/package.json +1 -1
- package/coverage/clover.xml +0 -638
- package/coverage/coverage-final.json +0 -20
- package/coverage/lcov-report/Table/CompactSelect.tsx.html +0 -379
- package/coverage/lcov-report/Table/Components/ActiveFilters.tsx.html +0 -514
- package/coverage/lcov-report/Table/Components/HeaderActions.tsx.html +0 -373
- package/coverage/lcov-report/Table/Components/Pagination.tsx.html +0 -574
- package/coverage/lcov-report/Table/Components/TableActions.tsx.html +0 -574
- package/coverage/lcov-report/Table/Components/TableBody.tsx.html +0 -1027
- package/coverage/lcov-report/Table/Components/TableFilters.tsx.html +0 -397
- package/coverage/lcov-report/Table/Components/TableHeader.tsx.html +0 -1060
- package/coverage/lcov-report/Table/Components/TableLoading.tsx.html +0 -361
- package/coverage/lcov-report/Table/Components/TableSearch.tsx.html +0 -337
- package/coverage/lcov-report/Table/Components/index.html +0 -266
- package/coverage/lcov-report/Table/Components/useDebounce.ts.html +0 -178
- package/coverage/lcov-report/Table/Components/useTable.ts.html +0 -778
- package/coverage/lcov-report/Table/LeftFilterPane.tsx.html +0 -1810
- package/coverage/lcov-report/Table/SelectOperationControls.tsx.html +0 -178
- package/coverage/lcov-report/Table/Table.tsx.html +0 -1567
- package/coverage/lcov-report/Table/TableProps.tsx.html +0 -658
- package/coverage/lcov-report/Table/TableSettings/ManageColumns.tsx.html +0 -619
- package/coverage/lcov-report/Table/TableSettings/TableFilters.tsx.html +0 -229
- package/coverage/lcov-report/Table/TableSettings/TableSettings.tsx.html +0 -532
- package/coverage/lcov-report/Table/TableSettings/index.html +0 -146
- package/coverage/lcov-report/Table/TableToDo.tsx.html +0 -973
- package/coverage/lcov-report/Table/TextOperationControls.tsx.html +0 -271
- package/coverage/lcov-report/Table/filterTypes.ts.html +0 -97
- package/coverage/lcov-report/Table/index.html +0 -176
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -146
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov.info +0 -1836
- package/debug-storybook.log +0 -72
- package/dist/Assets/defaultLogo.tsx +0 -31
- package/dist/Theme/Dark/palette.d.ts +0 -370
- package/dist/Theme/Dark/palette.js +0 -372
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { EditorProps } from "./EditorProps";
|
|
3
|
-
|
|
4
|
-
export default Editor;
|
|
3
|
+
export default function Editor({ value, key, config, editorRef, className, onChange, onBlur, }: EditorProps): React.JSX.Element;
|
|
@@ -1,46 +1,12 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
|
|
6
|
+
exports.default = Editor;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
40
8
|
var jodit_react_1 = __importDefault(require("jodit-react"));
|
|
41
|
-
|
|
9
|
+
function Editor(_a) {
|
|
42
10
|
var value = _a.value, key = _a.key, config = _a.config, editorRef = _a.editorRef, className = _a.className, onChange = _a.onChange, onBlur = _a.onBlur;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
});
|
|
46
|
-
exports.default = Editor;
|
|
11
|
+
return (react_1.default.createElement(jodit_react_1.default, { key: key, config: config, value: value, ref: editorRef, className: className, onChange: onChange, onBlur: onBlur }));
|
|
12
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { Account, KanbanBoardProps } from "./KanbanBoardProps";
|
|
3
|
-
declare const AccountCard:
|
|
3
|
+
declare const AccountCard: ({ account, onDelete, onOpen, isExpanded, onToggleExpand, isDeletable, }: {
|
|
4
4
|
account: Account;
|
|
5
5
|
index?: number;
|
|
6
6
|
onDelete: KanbanBoardProps["onDelete"];
|
|
@@ -8,5 +8,5 @@ declare const AccountCard: React.MemoExoticComponent<({ account, onDelete, onOpe
|
|
|
8
8
|
isExpanded?: boolean;
|
|
9
9
|
onToggleExpand?: () => void;
|
|
10
10
|
isDeletable?: boolean;
|
|
11
|
-
}) => React.JSX.Element
|
|
11
|
+
}) => React.JSX.Element;
|
|
12
12
|
export default AccountCard;
|
|
@@ -1,52 +1,19 @@
|
|
|
1
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
2
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
36
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
4
|
};
|
|
38
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
var react_1 =
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
40
7
|
var react_2 = require("@chakra-ui/react");
|
|
41
8
|
var lucide_react_1 = require("lucide-react");
|
|
42
9
|
var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
43
10
|
var AccountRow_1 = __importDefault(require("./AccountRow"));
|
|
44
11
|
var excludeKeys = ["id", "details"];
|
|
45
|
-
var AccountCard =
|
|
12
|
+
var AccountCard = function (_a) {
|
|
46
13
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
47
14
|
var account = _a.account, onDelete = _a.onDelete, onOpen = _a.onOpen, _j = _a.isExpanded, isExpanded = _j === void 0 ? false : _j, onToggleExpand = _a.onToggleExpand, _k = _a.isDeletable, isDeletable = _k === void 0 ? true : _k;
|
|
48
15
|
var colors = (0, useCustomTheme_1.useCustomTheme)().colors;
|
|
49
|
-
var keys =
|
|
16
|
+
var keys = Object.keys(account).filter(function (key) { return typeof account[key] === "string" && !excludeKeys.includes(key); });
|
|
50
17
|
var visibleKeys = isExpanded ? keys : keys.slice(0, 4);
|
|
51
18
|
var handleToggle = function () {
|
|
52
19
|
onToggleExpand === null || onToggleExpand === void 0 ? void 0 : onToggleExpand();
|
|
@@ -70,5 +37,5 @@ var AccountCard = react_1.default.memo(function (_a) {
|
|
|
70
37
|
react_1.default.createElement(lucide_react_1.Trash2, { size: 16, color: (_g = colors === null || colors === void 0 ? void 0 : colors.red) === null || _g === void 0 ? void 0 : _g[600], onClick: function () { return onDelete === null || onDelete === void 0 ? void 0 : onDelete(account); }, cursor: "pointer", "aria-label": "Delete" }))),
|
|
71
38
|
react_1.default.createElement(react_2.Tooltip, { label: "Open" },
|
|
72
39
|
react_1.default.createElement(lucide_react_1.ExternalLink, { size: 16, color: (_h = colors === null || colors === void 0 ? void 0 : colors.blue) === null || _h === void 0 ? void 0 : _h[600], onClick: function () { return onOpen === null || onOpen === void 0 ? void 0 : onOpen(account); }, cursor: "pointer", "aria-label": "Open" })))))));
|
|
73
|
-
}
|
|
40
|
+
};
|
|
74
41
|
exports.default = AccountCard;
|
|
@@ -70,31 +70,6 @@ var OverflowTooltipText_1 = __importDefault(require("../SideBar/components/Overf
|
|
|
70
70
|
var Button_1 = __importDefault(require("../Button/Button"));
|
|
71
71
|
/** Narrow rail width when a column is horizontally collapsed. */
|
|
72
72
|
var COLLAPSED_KANBAN_COLUMN_WIDTH = "2.75rem";
|
|
73
|
-
var KanbanRow = react_1.default.memo(function (_a) {
|
|
74
|
-
var index = _a.index, style = _a.style, data = _a.data;
|
|
75
|
-
var items = data.items, colId = data.colId, canDrag = data.canDrag, expanded = data.expanded, onDelete = data.onDelete, onOpen = data.onOpen, canDelete = data.canDelete, setSize = data.setSize, toggleExpand = data.toggleExpand;
|
|
76
|
-
var account = items[index];
|
|
77
|
-
if (!account) {
|
|
78
|
-
return react_1.default.createElement("div", { style: style });
|
|
79
|
-
}
|
|
80
|
-
return (react_1.default.createElement("div", { style: style },
|
|
81
|
-
react_1.default.createElement(MeasuredItem_1.default, { index: index, setSize: function (i, h) { return setSize(i, h, colId); } },
|
|
82
|
-
react_1.default.createElement("div", { style: { marginBottom: 12 } },
|
|
83
|
-
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (provided) {
|
|
84
|
-
var _a;
|
|
85
|
-
return (react_1.default.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: provided.draggableProps.style }), (account === null || account === void 0 ? void 0 : account.customNode) ? (_a = account === null || account === void 0 ? void 0 : account.customNode) === null || _a === void 0 ? void 0 : _a.call(account) : (react_1.default.createElement(AccountCard_1.default, { key: account.id, account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[account.id], onToggleExpand: function () {
|
|
86
|
-
return toggleExpand(account.id, colId, index);
|
|
87
|
-
}, isDeletable: canDelete }))));
|
|
88
|
-
})))));
|
|
89
|
-
});
|
|
90
|
-
var NoItemsTemplate = react_1.default.memo(function (_a) {
|
|
91
|
-
var _b;
|
|
92
|
-
var column = _a.column, noItems = _a.noItems, colors = _a.colors;
|
|
93
|
-
return (react_1.default.createElement(react_2.Box, null,
|
|
94
|
-
react_1.default.createElement(react_2.Flex, { flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 2 },
|
|
95
|
-
react_1.default.createElement(react_2.Text, { fontSize: "sm", color: (_b = colors === null || colors === void 0 ? void 0 : colors.text) === null || _b === void 0 ? void 0 : _b[600], textAlign: "center", mt: 4 }, (noItems === null || noItems === void 0 ? void 0 : noItems.text) || "No items in this column"),
|
|
96
|
-
!(noItems === null || noItems === void 0 ? void 0 : noItems.isEmptyTextOnly) && (react_1.default.createElement(Button_1.default, { onClick: function () { var _a; return (_a = noItems === null || noItems === void 0 ? void 0 : noItems.onClick) === null || _a === void 0 ? void 0 : _a.call(noItems, column); }, size: "xs" }, (noItems === null || noItems === void 0 ? void 0 : noItems.buttonText) || "Add Item")))));
|
|
97
|
-
});
|
|
98
73
|
function reorderColumnEntries(entries, startIndex, endIndex) {
|
|
99
74
|
var result = Array.from(entries);
|
|
100
75
|
var removed = result.splice(startIndex, 1)[0];
|
|
@@ -216,37 +191,6 @@ var KanbanBoard = function (_a) {
|
|
|
216
191
|
var containerRef = (0, react_1.useRef)(null);
|
|
217
192
|
// store measured heights
|
|
218
193
|
var _4 = (0, react_1.useState)({}), sizes = _4[0], setSizes = _4[1];
|
|
219
|
-
var hasMountedSizes = (0, react_1.useRef)(false);
|
|
220
|
-
// Prune stale size entries when columns change (skip first render)
|
|
221
|
-
(0, react_1.useEffect)(function () {
|
|
222
|
-
if (!hasMountedSizes.current) {
|
|
223
|
-
hasMountedSizes.current = true;
|
|
224
|
-
return;
|
|
225
|
-
}
|
|
226
|
-
setSizes(function (prev) {
|
|
227
|
-
if (Object.keys(prev).length === 0)
|
|
228
|
-
return prev;
|
|
229
|
-
var validKeys = new Set();
|
|
230
|
-
for (var _i = 0, _a = Object.entries(columns); _i < _a.length; _i++) {
|
|
231
|
-
var _b = _a[_i], colId = _b[0], col = _b[1];
|
|
232
|
-
for (var i = 0; i < col.items.length; i++) {
|
|
233
|
-
validKeys.add("".concat(colId, "-").concat(i));
|
|
234
|
-
}
|
|
235
|
-
}
|
|
236
|
-
var pruned = {};
|
|
237
|
-
var changed = false;
|
|
238
|
-
for (var _c = 0, _d = Object.keys(prev); _c < _d.length; _c++) {
|
|
239
|
-
var key = _d[_c];
|
|
240
|
-
if (validKeys.has(key)) {
|
|
241
|
-
pruned[key] = prev[key];
|
|
242
|
-
}
|
|
243
|
-
else {
|
|
244
|
-
changed = true;
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
return changed ? pruned : prev;
|
|
248
|
-
});
|
|
249
|
-
}, [columns]);
|
|
250
194
|
// update height for an item
|
|
251
195
|
var setSize = (0, react_1.useCallback)(function (index, size, colId) {
|
|
252
196
|
var key = "".concat(colId, "-").concat(index);
|
|
@@ -260,10 +204,10 @@ var KanbanBoard = function (_a) {
|
|
|
260
204
|
listRefs.current[colId].resetAfterIndex(index);
|
|
261
205
|
}
|
|
262
206
|
}, []);
|
|
263
|
-
var getItemSize =
|
|
207
|
+
var getItemSize = function (index, _items, colId) {
|
|
264
208
|
var key = "".concat(colId, "-").concat(index);
|
|
265
|
-
return (sizes[key] ||
|
|
266
|
-
}
|
|
209
|
+
return (sizes[key] || 180) + 12; // Add margin to the measured height
|
|
210
|
+
};
|
|
267
211
|
// Calculate container height
|
|
268
212
|
(0, react_1.useEffect)(function () {
|
|
269
213
|
var calculateDimensions = function () {
|
|
@@ -347,15 +291,32 @@ var KanbanBoard = function (_a) {
|
|
|
347
291
|
var columnIds = ((_b = (_a = columns[colId]) === null || _a === void 0 ? void 0 : _a.items) === null || _b === void 0 ? void 0 : _b.map(function (item) { return item.id; })) || [];
|
|
348
292
|
onColumnDelete === null || onColumnDelete === void 0 ? void 0 : onColumnDelete(columnIds);
|
|
349
293
|
};
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
294
|
+
// row renderer
|
|
295
|
+
var Row = function (_a) {
|
|
296
|
+
var index = _a.index, style = _a.style, data = _a.data;
|
|
297
|
+
var items = data.items, colId = data.colId;
|
|
298
|
+
var account = items[index];
|
|
299
|
+
if (!account) {
|
|
300
|
+
return react_1.default.createElement("div", { style: style });
|
|
301
|
+
}
|
|
302
|
+
return (react_1.default.createElement("div", { style: style },
|
|
303
|
+
react_1.default.createElement(MeasuredItem_1.default, { index: index, setSize: function (i, h) { return setSize(i, h, colId); } },
|
|
304
|
+
react_1.default.createElement("div", { style: { marginBottom: 12 } },
|
|
305
|
+
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (provided) {
|
|
306
|
+
var _a;
|
|
307
|
+
return (react_1.default.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: provided.draggableProps.style }), (account === null || account === void 0 ? void 0 : account.customNode) ? (_a = account === null || account === void 0 ? void 0 : account.customNode) === null || _a === void 0 ? void 0 : _a.call(account) : (react_1.default.createElement(AccountCard_1.default, { key: account.id, account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[account.id], onToggleExpand: function () {
|
|
308
|
+
return toggleExpand(account.id, colId, index);
|
|
309
|
+
}, isDeletable: canDelete }))));
|
|
310
|
+
})))));
|
|
311
|
+
};
|
|
312
|
+
var NoItemsTemplate = function (_a) {
|
|
313
|
+
var _b;
|
|
314
|
+
var column = _a.column;
|
|
315
|
+
return (react_1.default.createElement(react_2.Box, null,
|
|
316
|
+
react_1.default.createElement(react_2.Flex, { flexDirection: "column", alignItems: "center", justifyContent: "center", gap: 2 },
|
|
317
|
+
react_1.default.createElement(react_2.Text, { fontSize: "sm", color: (_b = colors === null || colors === void 0 ? void 0 : colors.text) === null || _b === void 0 ? void 0 : _b[600], textAlign: "center", mt: 4 }, (noItems === null || noItems === void 0 ? void 0 : noItems.text) || "No items in this column"),
|
|
318
|
+
!(noItems === null || noItems === void 0 ? void 0 : noItems.isEmptyTextOnly) && (react_1.default.createElement(Button_1.default, { onClick: function () { var _a; return (_a = noItems === null || noItems === void 0 ? void 0 : noItems.onClick) === null || _a === void 0 ? void 0 : _a.call(noItems, column); }, size: "xs" }, (noItems === null || noItems === void 0 ? void 0 : noItems.buttonText) || "Add Item")))));
|
|
319
|
+
};
|
|
359
320
|
var renderColumnDroppable = function (colId, column, columnDragHandleProps, isColCollapsed) { return (react_1.default.createElement(dnd_1.Droppable, { droppableId: colId, key: colId, mode: virtualization ? "virtual" : "standard", renderClone: function (provided, _snapshot, rubric) {
|
|
360
321
|
var _a;
|
|
361
322
|
var item = column.items[rubric.source.index];
|
|
@@ -430,14 +391,17 @@ var KanbanBoard = function (_a) {
|
|
|
430
391
|
},
|
|
431
392
|
cursor: canDrag ? "grab" : "not-allowed",
|
|
432
393
|
} },
|
|
433
|
-
(noItems === null || noItems === void 0 ? void 0 : noItems.isVisible) && column.items.length === 0 && (react_1.default.createElement(NoItemsTemplate, { column: column
|
|
394
|
+
(noItems === null || noItems === void 0 ? void 0 : noItems.isVisible) && column.items.length === 0 && (react_1.default.createElement(NoItemsTemplate, { column: column })),
|
|
434
395
|
virtualization ? (react_1.default.createElement(react_window_1.VariableSizeList, { ref: function (el) {
|
|
435
396
|
if (el)
|
|
436
397
|
listRefs.current[colId] = el;
|
|
437
398
|
}, height: containerHeight - 150, itemCount: column.items.length +
|
|
438
399
|
(snapshot.isUsingPlaceholder ? 1 : 0), itemSize: function (index) {
|
|
439
400
|
return getItemSize(index, column.items, colId);
|
|
440
|
-
}, width: "100%", itemData:
|
|
401
|
+
}, width: "100%", itemData: {
|
|
402
|
+
items: column.items,
|
|
403
|
+
colId: colId,
|
|
404
|
+
} }, Row)) : (react_1.default.createElement(react_2.Box, null,
|
|
441
405
|
column.items.map(function (account, index) { return (react_1.default.createElement("div", { key: account.id, style: { marginBottom: 12 } },
|
|
442
406
|
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (dragProvided) {
|
|
443
407
|
var _a;
|
|
@@ -78,14 +78,17 @@ function MultiSelect(_a) {
|
|
|
78
78
|
var value = _a.value, onValueChange = _a.onValueChange, _d = _a.width, width = _d === void 0 ? "100%" : _d, _e = _a.label, label = _e === void 0 ? "label" : _e, _f = _a.isRequired, isRequired = _f === void 0 ? true : _f, _g = _a.isInformation, isInformation = _g === void 0 ? false : _g, _h = _a.informationMessage, informationMessage = _h === void 0 ? "" : _h, name = _a.name, id = _a.id, _j = _a.placeholderText, placeholderText = _j === void 0 ? "Type valid email and press enter" : _j, isDisabled = _a.isDisabled, isReadOnly = _a.isReadOnly, _k = _a.size, size = _k === void 0 ? "md" : _k, inputStyle = _a.inputStyle, helperText = _a.helperText, error = _a.error, errorMessage = _a.errorMessage;
|
|
79
79
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
80
80
|
var s = (0, searchSelectSize_1.getSearchSelectSizeStyles)((size || "md"));
|
|
81
|
-
var options =
|
|
82
|
-
var
|
|
83
|
-
var
|
|
81
|
+
var _l = (0, react_1.useState)(value), options = _l[0], setOptions = _l[1];
|
|
82
|
+
var _m = (0, react_1.useState)(""), inputValue = _m[0], setInputValue = _m[1];
|
|
83
|
+
var _o = (0, react_1.useState)(""), localError = _o[0], setLocalError = _o[1];
|
|
84
84
|
var inputRef = (0, react_1.useRef)(null);
|
|
85
|
-
|
|
85
|
+
(0, react_1.useEffect)(function () {
|
|
86
|
+
setOptions(value);
|
|
87
|
+
}, [value]);
|
|
88
|
+
var handleInputChange = function (e) {
|
|
86
89
|
setInputValue(e.target.value);
|
|
87
90
|
setLocalError("");
|
|
88
|
-
}
|
|
91
|
+
};
|
|
89
92
|
var validateEmail = function (email) {
|
|
90
93
|
var emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
91
94
|
return emailRegex.test(email);
|
|
@@ -99,17 +102,23 @@ function MultiSelect(_a) {
|
|
|
99
102
|
var existingOption = options.find(function (option) { return option.label === inputValue; });
|
|
100
103
|
if (!existingOption) {
|
|
101
104
|
var newOption = { id: generateUniqueId(), label: inputValue };
|
|
102
|
-
|
|
105
|
+
var updatedOptions = __spreadArray(__spreadArray([], options, true), [newOption], false);
|
|
106
|
+
setOptions(updatedOptions);
|
|
107
|
+
onValueChange(updatedOptions);
|
|
103
108
|
setInputValue("");
|
|
104
109
|
}
|
|
105
110
|
}
|
|
106
111
|
else if (e.key === "Backspace" && inputValue === "") {
|
|
107
|
-
|
|
112
|
+
var updatedOptions = options.slice(0, -1); // Remove the last item
|
|
113
|
+
setOptions(updatedOptions);
|
|
114
|
+
onValueChange(updatedOptions);
|
|
108
115
|
}
|
|
109
116
|
};
|
|
110
|
-
var handleRemove =
|
|
111
|
-
|
|
112
|
-
|
|
117
|
+
var handleRemove = function (optionToRemove) {
|
|
118
|
+
var updatedOptions = options.filter(function (option) { return option.id !== optionToRemove.id; });
|
|
119
|
+
setOptions(updatedOptions);
|
|
120
|
+
onValueChange(updatedOptions);
|
|
121
|
+
};
|
|
113
122
|
return (react_1.default.createElement(react_2.Box, { width: width },
|
|
114
123
|
label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, isRequired: isRequired, isInformation: isInformation, informationMessage: informationMessage })),
|
|
115
124
|
react_1.default.createElement(react_2.Flex, { wrap: "wrap", gap: s.gap, align: "center", px: s.px, border: "1px solid", borderColor: error || localError
|
|
@@ -67,7 +67,6 @@ var HelperText_1 = __importDefault(require("../Common/HelperText"));
|
|
|
67
67
|
var ToolTip_1 = __importDefault(require("../ToolTip/ToolTip"));
|
|
68
68
|
var SelectTruncatedLabel_1 = __importDefault(require("./SelectTruncatedLabel"));
|
|
69
69
|
var searchSelectSize_1 = require("./searchSelectSize");
|
|
70
|
-
var Checkbox_1 = __importDefault(require("../Checkbox/Checkbox"));
|
|
71
70
|
var normalizeSingleValue = function (val) {
|
|
72
71
|
if (typeof val === "object" && val !== null && "id" in val && "label" in val) {
|
|
73
72
|
return val;
|
|
@@ -111,16 +110,13 @@ var SearchSelect = function (_a) {
|
|
|
111
110
|
: normalizeSingleValue(value)
|
|
112
111
|
? [normalizeSingleValue(value)]
|
|
113
112
|
: [];
|
|
114
|
-
var filteredOptions =
|
|
115
|
-
var onSearchRef = (0, react_1.useRef)(onSearch);
|
|
116
|
-
onSearchRef.current = onSearch;
|
|
113
|
+
var filteredOptions = options.filter(function (option) { var _a, _b; return (_b = (_a = option === null || option === void 0 ? void 0 : option.label) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === null || _b === void 0 ? void 0 : _b.includes(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase()); });
|
|
117
114
|
(0, react_1.useEffect)(function () {
|
|
118
115
|
var delayDebounce = setTimeout(function () {
|
|
119
|
-
|
|
120
|
-
(_a = onSearchRef.current) === null || _a === void 0 ? void 0 : _a.call(onSearchRef, inputValue);
|
|
116
|
+
onSearch === null || onSearch === void 0 ? void 0 : onSearch(inputValue);
|
|
121
117
|
}, 1000);
|
|
122
118
|
return function () { return clearTimeout(delayDebounce); };
|
|
123
|
-
}, [inputValue]);
|
|
119
|
+
}, [inputValue, onSearch]);
|
|
124
120
|
(0, react_1.useEffect)(function () {
|
|
125
121
|
if (pagination === null || pagination === void 0 ? void 0 : pagination.limit) {
|
|
126
122
|
setHasMore(options.length % pagination.limit === 0);
|
|
@@ -146,8 +142,8 @@ var SearchSelect = function (_a) {
|
|
|
146
142
|
else {
|
|
147
143
|
onSelect === null || onSelect === void 0 ? void 0 : onSelect(option);
|
|
148
144
|
setIsOpen(false);
|
|
149
|
-
setInputValue("");
|
|
150
145
|
}
|
|
146
|
+
setInputValue("");
|
|
151
147
|
};
|
|
152
148
|
var handleRemove = function (id) {
|
|
153
149
|
var updated = selectedValues.filter(function (v) { return v.id !== id; });
|
|
@@ -171,15 +167,16 @@ var SearchSelect = function (_a) {
|
|
|
171
167
|
}
|
|
172
168
|
setInputValue("");
|
|
173
169
|
};
|
|
174
|
-
var
|
|
175
|
-
|
|
170
|
+
var isSelected = function (id) {
|
|
171
|
+
return selectedValues.some(function (v) { return v.id === id; });
|
|
172
|
+
};
|
|
176
173
|
var isValidIcon = function (icon) {
|
|
177
174
|
return react_1.default.isValidElement(icon);
|
|
178
175
|
};
|
|
179
|
-
var allFilteredSelected =
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
176
|
+
var allFilteredSelected = filteredOptions.length > 0 &&
|
|
177
|
+
filteredOptions.every(function (opt) {
|
|
178
|
+
return selectedValues.some(function (sel) { return sel.id === opt.id; });
|
|
179
|
+
});
|
|
183
180
|
var handleScroll = (0, react_1.useCallback)(function (e) {
|
|
184
181
|
if (!pagination ||
|
|
185
182
|
!pagination.onScroll ||
|
|
@@ -277,17 +274,13 @@ var SearchSelect = function (_a) {
|
|
|
277
274
|
}, "aria-label": "toggle-dropdown", display: "flex", alignItems: "center" }, isOpen ? (react_1.default.createElement(lucide_react_1.ChevronUp, { size: s.chevronSize })) : (react_1.default.createElement(lucide_react_1.ChevronDown, { size: s.chevronSize }))))))),
|
|
278
275
|
isOpen && (react_1.default.createElement(react_2.Box, { position: "absolute", zIndex: 10, width: "100%", maxH: "20rem", borderWidth: 1, borderRadius: "sm", bg: theme.colors.white, boxShadow: "md", display: "flex", flexDirection: "column" },
|
|
279
276
|
isMultiple && isSelectAll && (react_1.default.createElement(react_2.Box, { py: s.optionRowPy, px: 3, cursor: "pointer", onClick: handleSelectAll, display: "flex", alignItems: "center", gap: 2, borderBottom: "0.063rem solid ".concat(theme.colors.gray[100]) },
|
|
280
|
-
react_1.default.createElement(
|
|
277
|
+
react_1.default.createElement(react_2.Checkbox, { isChecked: allFilteredSelected, pointerEvents: "none", size: s.checkboxSize }),
|
|
281
278
|
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, allFilteredSelected ? "Unselect All" : "Select All"))),
|
|
282
|
-
react_1.default.createElement(react_2.Box, { flex: "1", overflowY: "auto", onScroll: handleScroll, maxH: "15rem", borderBottom: "0.063rem solid", borderColor: theme.colors.gray[200] }, isOptionLoading
|
|
279
|
+
react_1.default.createElement(react_2.Box, { flex: "1", overflowY: "auto", onScroll: handleScroll, maxH: "15rem", borderBottom: "0.063rem solid", borderColor: theme.colors.gray[200] }, isOptionLoading ? (react_1.default.createElement(react_2.Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH },
|
|
283
280
|
react_1.default.createElement(react_2.Spinner, { size: s.spinnerSize }),
|
|
284
|
-
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, loadingText))) :
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
option.view ? (react_1.default.createElement(react_1.default.Fragment, null, option.view)) : (react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, option.label)))); }),
|
|
288
|
-
((pagination === null || pagination === void 0 ? void 0 : pagination.scrollLoading) || (isOptionLoading && filteredOptions.length > 0)) && (react_1.default.createElement(react_2.Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", justifyContent: "center", gap: 2, minH: s.optionRowMinH },
|
|
289
|
-
react_1.default.createElement(react_2.Spinner, { size: s.spinnerSize }),
|
|
290
|
-
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, loadingText)))))),
|
|
281
|
+
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, loadingText))) : filteredOptions.length === 0 ? (react_1.default.createElement(react_2.Text, { p: 3, fontSize: s.dropdownTextFontSize, color: theme.colors.gray[500] }, "No results found")) : (filteredOptions.map(function (option) { return (react_1.default.createElement(react_2.Box, { key: option.id, py: s.optionRowPy, px: 3, minH: s.optionRowMinH, cursor: "pointer", bg: isSelected(option.id) ? theme.colors.gray[100] : "transparent", _hover: { bg: theme.colors.gray[50] }, onClick: function () { return handleSelect(option); }, display: "flex", alignItems: "center", gap: 2, borderBottom: "0.063rem solid ".concat(theme.colors.gray[100]) },
|
|
282
|
+
isMultiple && (react_1.default.createElement(react_2.Checkbox, { isChecked: isSelected(option.id), pointerEvents: "none", colorScheme: "blue", size: s.checkboxSize })),
|
|
283
|
+
option.view ? (react_1.default.createElement(react_1.default.Fragment, null, option.view)) : (react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, option.label)))); }))),
|
|
291
284
|
(addNew === null || addNew === void 0 ? void 0 : addNew.enabled) && (react_1.default.createElement(react_2.Box, { py: s.optionRowPy, px: 3, borderTop: "0.063rem solid", borderColor: theme.colors.gray[200], bg: theme.colors.white, display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH, cursor: "pointer", onClick: addNew.onClick, _hover: { bg: theme.colors.gray[50] } },
|
|
292
285
|
addNew.icon || react_1.default.createElement(lucide_react_1.Plus, { size: s.addNewIconSize }),
|
|
293
286
|
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, addNew.text || "Add New"))))),
|
|
@@ -10,88 +10,47 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
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
13
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
14
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
15
|
};
|
|
49
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
var react_1 =
|
|
17
|
+
var react_1 = __importDefault(require("react"));
|
|
51
18
|
var react_2 = require("@chakra-ui/react");
|
|
52
19
|
var lucide_react_1 = require("lucide-react");
|
|
53
20
|
var useCustomTheme_1 = require("../../../Theme/useCustomTheme");
|
|
54
21
|
var Divider_1 = __importDefault(require("../../Divider/Divider"));
|
|
55
|
-
var ActiveFilters =
|
|
22
|
+
var ActiveFilters = function (_a) {
|
|
56
23
|
var _b, _c, _d, _e, _f, _g, _h, _j;
|
|
57
24
|
var columns = _a.columns, columnsSearch = _a.columnsSearch, setColumnsSearch = _a.setColumnsSearch;
|
|
58
25
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
return ({
|
|
76
|
-
columnId: columnId,
|
|
77
|
-
label: columnLabelMap.get(columnId) || columnId,
|
|
78
|
-
value: value.trim(),
|
|
79
|
-
});
|
|
80
|
-
});
|
|
81
|
-
}, [columnsSearch, columnLabelMap]);
|
|
82
|
-
if (activeFilters.length === 0) {
|
|
83
|
-
return null;
|
|
84
|
-
}
|
|
85
|
-
var handleRemoveFilter = (0, react_1.useCallback)(function (columnId) {
|
|
26
|
+
// Get active filters (columns that have a search value)
|
|
27
|
+
var activeFilters = Object.entries(columnsSearch)
|
|
28
|
+
.filter(function (_a) {
|
|
29
|
+
var _ = _a[0], value = _a[1];
|
|
30
|
+
return value && value.trim() !== "";
|
|
31
|
+
})
|
|
32
|
+
.map(function (_a) {
|
|
33
|
+
var columnId = _a[0], value = _a[1];
|
|
34
|
+
var column = columns.find(function (col) { return col.id === columnId; });
|
|
35
|
+
return {
|
|
36
|
+
columnId: columnId,
|
|
37
|
+
label: (column === null || column === void 0 ? void 0 : column.label) || columnId,
|
|
38
|
+
value: value.trim(),
|
|
39
|
+
};
|
|
40
|
+
});
|
|
41
|
+
var handleRemoveFilter = function (columnId) {
|
|
86
42
|
setColumnsSearch(function (prev) {
|
|
87
43
|
var newSearch = __assign({}, prev);
|
|
88
44
|
delete newSearch[columnId];
|
|
89
45
|
return newSearch;
|
|
90
46
|
});
|
|
91
|
-
}
|
|
92
|
-
var handleClearAll =
|
|
47
|
+
};
|
|
48
|
+
var handleClearAll = function () {
|
|
93
49
|
setColumnsSearch({});
|
|
94
|
-
}
|
|
50
|
+
};
|
|
51
|
+
if (activeFilters.length === 0) {
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
95
54
|
return (react_1.default.createElement(react_2.Box, { px: 2, py: 1, bg: ((_c = (_b = theme.colors) === null || _b === void 0 ? void 0 : _b.background) === null || _c === void 0 ? void 0 : _c[100]) || ((_e = (_d = theme.colors) === null || _d === void 0 ? void 0 : _d.gray) === null || _e === void 0 ? void 0 : _e[50]), overflowX: "auto", sx: {
|
|
96
55
|
'&::-webkit-scrollbar': {
|
|
97
56
|
height: '6px',
|
|
@@ -128,5 +87,5 @@ var ActiveFilters = react_1.default.memo(function (_a) {
|
|
|
128
87
|
activeFilters.length > 1 && (react_1.default.createElement(react_2.Text, { as: "p", className: "clear-all-text", "aria-label": "Clear All", fontSize: "sm", color: ((_g = (_f = theme.colors) === null || _f === void 0 ? void 0 : _f.blue) === null || _g === void 0 ? void 0 : _g[600]) || ((_j = (_h = theme.colors) === null || _h === void 0 ? void 0 : _h.primary) === null || _j === void 0 ? void 0 : _j[600]), cursor: "pointer", fontWeight: 500, onClick: handleClearAll, _hover: {
|
|
129
88
|
textDecoration: "underline",
|
|
130
89
|
}, flexShrink: 0, whiteSpace: "nowrap" }, "Clear All")))));
|
|
131
|
-
}
|
|
90
|
+
};
|
|
132
91
|
exports.default = ActiveFilters;
|
|
@@ -10,5 +10,5 @@ type PaginationProps = Pick<TableProps, "isVisiblity" | "columns" | "paginationS
|
|
|
10
10
|
dataLength: number;
|
|
11
11
|
isServerPagination: boolean;
|
|
12
12
|
};
|
|
13
|
-
declare const Pagination:
|
|
13
|
+
declare const Pagination: ({ paginationText, handlePageSizeChange, rowsPerPage, currentPage, pages, setCurrentPage, dataLength, isServerPagination, paginationSelectOptions, }: PaginationProps) => React.JSX.Element;
|
|
14
14
|
export default Pagination;
|
|
@@ -1,49 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
})();
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
35
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
var react_1 =
|
|
6
|
+
var react_1 = __importDefault(require("react"));
|
|
37
7
|
var react_2 = require("@chakra-ui/react");
|
|
38
8
|
var table_1 = require("../../../Utils/table");
|
|
39
9
|
var lucide_react_1 = require("lucide-react");
|
|
40
|
-
var Pagination =
|
|
10
|
+
var Pagination = function (_a) {
|
|
41
11
|
var paginationText = _a.paginationText, handlePageSizeChange = _a.handlePageSizeChange, rowsPerPage = _a.rowsPerPage, currentPage = _a.currentPage, pages = _a.pages, setCurrentPage = _a.setCurrentPage, dataLength = _a.dataLength, isServerPagination = _a.isServerPagination, paginationSelectOptions = _a.paginationSelectOptions;
|
|
42
|
-
var computedOptions =
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
: (0, table_1.pageSizeCalculation)(dataLength);
|
|
46
|
-
}, [paginationSelectOptions, dataLength]);
|
|
12
|
+
var computedOptions = paginationSelectOptions && paginationSelectOptions.length
|
|
13
|
+
? paginationSelectOptions
|
|
14
|
+
: (0, table_1.pageSizeCalculation)(dataLength);
|
|
47
15
|
// const isLeftDisabled = currentPage === 0;
|
|
48
16
|
// const isRightDisabled = currentPage >= pages - 1;
|
|
49
17
|
var isLeftDisabled = dataLength === 0 || currentPage === 0;
|
|
@@ -64,5 +32,5 @@ var Pagination = react_1.default.memo(function (_a) {
|
|
|
64
32
|
react_1.default.createElement(lucide_react_1.ChevronRight, null)),
|
|
65
33
|
react_1.default.createElement(react_2.IconButton, { "aria-label": "last-page", color: isRightDisabled ? "gray" : "black", rounded: "full", variant: isRightDisabled ? "plain" : "ghost", onClick: function () { return setCurrentPage(pages - 1); } },
|
|
66
34
|
react_1.default.createElement(lucide_react_1.ChevronsRight, null))))));
|
|
67
|
-
}
|
|
35
|
+
};
|
|
68
36
|
exports.default = Pagination;
|