pixelize-design-library 2.3.1-beta.3 → 2.3.1-beta.5
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 +19 -1
- package/dist/Components/KanbanBoard/AccountCard.js +17 -14
- package/dist/Components/KanbanBoard/KanbanBoard.js +93 -78
- package/dist/Components/SearchSelect/SearchSelect.js +53 -21
- package/dist/Components/Table/Table.d.ts +1 -1
- package/dist/Components/Table/Table.js +67 -26
- package/dist/Components/Table/TableProps.d.ts +7 -1
- package/dist/Components/Table/components/TableActions.d.ts +2 -2
- package/dist/Components/Table/components/TableActions.js +5 -4
- package/dist/Components/Table/components/TableBody.js +84 -18
- package/dist/Components/Table/settings/TableSettings.d.ts +3 -1
- package/dist/Components/Table/settings/TableSettings.js +30 -5
- package/dist/Utils/table.d.ts +6 -1
- package/dist/Utils/table.js +47 -27
- package/package.json +1 -1
|
@@ -20,7 +20,25 @@
|
|
|
20
20
|
"Bash(git mv *)",
|
|
21
21
|
"Bash(git rm *)",
|
|
22
22
|
"Bash(node -e \"console.log\\(require\\('@emotion/react/package.json'\\).version\\)\")",
|
|
23
|
-
"Bash(node -e \"console.log\\('jodit-react', require\\('jodit-react/package.json'\\).version\\); try{console.log\\('jodit', require\\('jodit/package.json'\\).version\\)}catch\\(e\\){}\")"
|
|
23
|
+
"Bash(node -e \"console.log\\('jodit-react', require\\('jodit-react/package.json'\\).version\\); try{console.log\\('jodit', require\\('jodit/package.json'\\).version\\)}catch\\(e\\){}\")",
|
|
24
|
+
"Bash(node -e \"console.log\\('playwright', require\\('playwright/package.json'\\).version\\)\")",
|
|
25
|
+
"Bash(node -e \"console.log\\('puppeteer', require\\('puppeteer/package.json'\\).version\\)\")",
|
|
26
|
+
"Bash(node -e \"console.log\\('ws', require\\('ws/package.json'\\).version\\)\")",
|
|
27
|
+
"Bash(node -e \"console.log\\('node', process.version\\)\")",
|
|
28
|
+
"Bash(grep -E \"\\\\.tsx?$\")",
|
|
29
|
+
"Bash(node -e \"console.log\\(require.resolve\\('@chakra-ui/styled-system'\\)\\)\")",
|
|
30
|
+
"Bash(node -e \"const p=require.resolve\\('@chakra-ui/react'\\);console.log\\(p\\)\")",
|
|
31
|
+
"Bash(sed -n '31,45p' src/Pages/table.tsx)",
|
|
32
|
+
"Bash(perl -0pi -e 's/\\\\n\\\\s*content: \\\\\\(\\\\\\) => <>Hello<\\\\/>,?//' src/Pages/table.tsx)",
|
|
33
|
+
"Bash(cd /Users/mahesh/Applications/Pixelize/CRM/Micro-Components *)",
|
|
34
|
+
"Bash(node -e \"console.log\\(require\\('./node_modules/pixelize-design-library/package.json'\\).version\\)\")",
|
|
35
|
+
"Bash(node -e \"console.log\\(JSON.stringify\\(require\\('./node_modules/pixelize-authenticator/package.json'\\).dependencies\\)\\)\")",
|
|
36
|
+
"Bash(node -e \"console.log\\(require\\('./node_modules/pixelize-authenticator/package.json'\\).version\\)\")",
|
|
37
|
+
"Bash(node -e \"console.log\\(require\\('./node_modules/pixelize-authenticator/node_modules/pixelize-design-library/package.json'\\).version\\)\")"
|
|
38
|
+
],
|
|
39
|
+
"additionalDirectories": [
|
|
40
|
+
"/private/tmp",
|
|
41
|
+
"/tmp"
|
|
24
42
|
]
|
|
25
43
|
}
|
|
26
44
|
}
|
|
@@ -43,32 +43,35 @@ var useCustomTheme_1 = require("../../Theme/useCustomTheme");
|
|
|
43
43
|
var AccountRow_1 = __importDefault(require("./AccountRow"));
|
|
44
44
|
var excludeKeys = ["id", "details"];
|
|
45
45
|
var AccountCard = react_1.default.memo(function (_a) {
|
|
46
|
-
var _b, _c, _d, _e, _f, _g, _h;
|
|
47
|
-
var account = _a.account, onDelete = _a.onDelete, onOpen = _a.onOpen,
|
|
46
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
47
|
+
var account = _a.account, onDelete = _a.onDelete, onOpen = _a.onOpen, _s = _a.isExpanded, isExpanded = _s === void 0 ? false : _s, onToggleExpand = _a.onToggleExpand, _t = _a.isDeletable, isDeletable = _t === void 0 ? true : _t;
|
|
48
48
|
var colors = (0, useCustomTheme_1.useCustomTheme)().colors;
|
|
49
49
|
var keys = (0, react_1.useMemo)(function () { return Object.keys(account).filter(function (key) { return typeof account[key] === "string" && !excludeKeys.includes(key); }); }, [account]);
|
|
50
50
|
var visibleKeys = isExpanded ? keys : keys.slice(0, 4);
|
|
51
51
|
var handleToggle = function () {
|
|
52
52
|
onToggleExpand === null || onToggleExpand === void 0 ? void 0 : onToggleExpand();
|
|
53
53
|
};
|
|
54
|
-
return (react_1.default.createElement(react_2.Box, {
|
|
55
|
-
borderColor: (
|
|
54
|
+
return (react_1.default.createElement(react_2.Box, { role: "group", width: "100%", borderRadius: "0.625rem", background: (_b = colors === null || colors === void 0 ? void 0 : colors.white) !== null && _b !== void 0 ? _b : "#fff", border: "0.063rem solid ".concat((_d = (_c = colors === null || colors === void 0 ? void 0 : colors.boxborder) === null || _c === void 0 ? void 0 : _c[200]) !== null && _d !== void 0 ? _d : (_e = colors.gray) === null || _e === void 0 ? void 0 : _e[200]), boxShadow: "0 0.063rem 0.125rem rgba(0,0,0,0.04)", p: 3, boxSizing: "border-box", minHeight: isExpanded ? "180px" : "80px", transition: "border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease", _hover: {
|
|
55
|
+
borderColor: (_f = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _f === void 0 ? void 0 : _f[300],
|
|
56
|
+
boxShadow: "0 0.25rem 0.75rem rgba(0,0,0,0.08)",
|
|
57
|
+
transform: "translateY(-0.063rem)",
|
|
56
58
|
} },
|
|
57
|
-
react_1.default.createElement(react_2.VStack, { align: "
|
|
59
|
+
react_1.default.createElement(react_2.VStack, { align: "stretch", spacing: 1, fontSize: "0.875rem", color: (_g = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _g === void 0 ? void 0 : _g[700] },
|
|
58
60
|
visibleKeys.map(function (key) { return (react_1.default.createElement(AccountRow_1.default, { key: key, label: key.replace(/\b\w/g, function (c) { return c.toUpperCase(); }), value: account[key] })); }),
|
|
59
61
|
react_1.default.createElement(react_2.Collapse, { in: isExpanded && account.details !== undefined, animateOpacity: true },
|
|
60
|
-
react_1.default.createElement(react_2.Text, { pt: 2 }, account.details)),
|
|
62
|
+
react_1.default.createElement(react_2.Text, { pt: 2, fontSize: "0.8125rem", color: (_h = colors === null || colors === void 0 ? void 0 : colors.text) === null || _h === void 0 ? void 0 : _h[600] }, account.details)),
|
|
61
63
|
react_1.default.createElement(react_2.Flex, { justify: "space-between", w: "full", pt: 2, alignItems: "center" },
|
|
62
|
-
keys.length > 4
|
|
64
|
+
keys.length > 4 ? (react_1.default.createElement(react_2.Text, { color: (_j = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _j === void 0 ? void 0 : _j[600], fontSize: "0.75rem", fontWeight: 600, cursor: "pointer", onClick: handleToggle, display: "flex", alignItems: "center", gap: 1, _hover: { color: (_k = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _k === void 0 ? void 0 : _k[700] } },
|
|
63
65
|
"Show ",
|
|
64
66
|
isExpanded ? "less" : "more",
|
|
65
67
|
" ",
|
|
66
|
-
isExpanded ? react_1.default.createElement(lucide_react_1.ChevronUp, { size:
|
|
67
|
-
react_1.default.createElement(react_2.
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
react_1.default.createElement(react_2.Tooltip, { label: "Open" },
|
|
72
|
-
react_1.default.createElement(
|
|
68
|
+
isExpanded ? react_1.default.createElement(lucide_react_1.ChevronUp, { size: 13 }) : react_1.default.createElement(lucide_react_1.ChevronDown, { size: 13 }))) : (react_1.default.createElement(react_2.Spacer, null)),
|
|
69
|
+
react_1.default.createElement(react_2.HStack, { spacing: 1, opacity: 0, transition: "opacity 0.15s ease", _groupHover: { opacity: 1 } },
|
|
70
|
+
isDeletable && (react_1.default.createElement(react_2.Tooltip, { label: "Delete", hasArrow: true },
|
|
71
|
+
react_1.default.createElement(react_2.Flex, { align: "center", justify: "center", boxSize: "1.625rem", borderRadius: "0.375rem", cursor: "pointer", color: (_l = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _l === void 0 ? void 0 : _l[500], transition: "background 0.15s ease, color 0.15s ease", _hover: { bg: (_m = colors === null || colors === void 0 ? void 0 : colors.red) === null || _m === void 0 ? void 0 : _m[50], color: (_o = colors === null || colors === void 0 ? void 0 : colors.red) === null || _o === void 0 ? void 0 : _o[600] }, onClick: function () { return onDelete === null || onDelete === void 0 ? void 0 : onDelete(account); }, "aria-label": "Delete" },
|
|
72
|
+
react_1.default.createElement(lucide_react_1.Trash2, { size: 15 })))),
|
|
73
|
+
react_1.default.createElement(react_2.Tooltip, { label: "Open", hasArrow: true },
|
|
74
|
+
react_1.default.createElement(react_2.Flex, { align: "center", justify: "center", boxSize: "1.625rem", borderRadius: "0.375rem", cursor: "pointer", color: (_p = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _p === void 0 ? void 0 : _p[500], transition: "background 0.15s ease, color 0.15s ease", _hover: { bg: (_q = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _q === void 0 ? void 0 : _q[50], color: (_r = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _r === void 0 ? void 0 : _r[600] }, onClick: function () { return onOpen === null || onOpen === void 0 ? void 0 : onOpen(account); }, "aria-label": "Open" },
|
|
75
|
+
react_1.default.createElement(lucide_react_1.ExternalLink, { size: 15 }))))))));
|
|
73
76
|
});
|
|
74
77
|
exports.default = AccountCard;
|
|
@@ -71,6 +71,9 @@ 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
73
|
var KANBAN_CARD_GAP = 12;
|
|
74
|
+
// Top buffer above the first card so its border + hover lift aren't clipped by the
|
|
75
|
+
// scroll/virtualized list's top edge.
|
|
76
|
+
var KANBAN_LIST_TOP_PAD = 6;
|
|
74
77
|
var KanbanRow = react_1.default.memo(function (_a) {
|
|
75
78
|
var index = _a.index, style = _a.style, data = _a.data;
|
|
76
79
|
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;
|
|
@@ -79,7 +82,7 @@ var KanbanRow = react_1.default.memo(function (_a) {
|
|
|
79
82
|
return react_1.default.createElement("div", { style: style });
|
|
80
83
|
}
|
|
81
84
|
return (react_1.default.createElement("div", { style: style },
|
|
82
|
-
react_1.default.createElement("div", { style: { paddingBottom: KANBAN_CARD_GAP } },
|
|
85
|
+
react_1.default.createElement("div", { style: { paddingBottom: KANBAN_CARD_GAP, paddingTop: index === 0 ? KANBAN_LIST_TOP_PAD : 0 } },
|
|
83
86
|
react_1.default.createElement(MeasuredItem_1.default, { index: index, setSize: function (i, h) { return setSize(i, h, colId); } },
|
|
84
87
|
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (provided) {
|
|
85
88
|
var _a;
|
|
@@ -259,13 +262,14 @@ var KanbanBoard = function (_a) {
|
|
|
259
262
|
return prev;
|
|
260
263
|
return __assign(__assign({}, prev), (_a = {}, _a[key] = size, _a));
|
|
261
264
|
});
|
|
265
|
+
// Only recompute from the row that changed downward (cheaper than resetting all).
|
|
262
266
|
if (listRefs.current[colId]) {
|
|
263
|
-
listRefs.current[colId].resetAfterIndex(
|
|
267
|
+
listRefs.current[colId].resetAfterIndex(index);
|
|
264
268
|
}
|
|
265
269
|
}, []);
|
|
266
270
|
var getItemSize = (0, react_1.useCallback)(function (index, _items, colId) {
|
|
267
271
|
var key = "".concat(colId, "-").concat(index);
|
|
268
|
-
return (sizes[key] || DEFAULT_ITEM_HEIGHT) + KANBAN_CARD_GAP;
|
|
272
|
+
return (sizes[key] || DEFAULT_ITEM_HEIGHT) + KANBAN_CARD_GAP + (index === 0 ? KANBAN_LIST_TOP_PAD : 0);
|
|
269
273
|
}, [sizes]);
|
|
270
274
|
// Calculate container height
|
|
271
275
|
(0, react_1.useEffect)(function () {
|
|
@@ -281,8 +285,9 @@ var KanbanBoard = function (_a) {
|
|
|
281
285
|
window.removeEventListener("resize", calculateDimensions);
|
|
282
286
|
};
|
|
283
287
|
}, [isBoardLoading]);
|
|
284
|
-
// toggle expand/collapse
|
|
285
|
-
|
|
288
|
+
// toggle expand/collapse — memoized so it doesn't bust `rowBaseProps`/itemData
|
|
289
|
+
// every render (which would re-render every virtualized row).
|
|
290
|
+
var toggleExpand = (0, react_1.useCallback)(function (id, colId, index) {
|
|
286
291
|
setExpanded(function (prev) {
|
|
287
292
|
var _a;
|
|
288
293
|
var newExpanded = __assign(__assign({}, prev), (_a = {}, _a[id] = !prev[id], _a));
|
|
@@ -291,9 +296,9 @@ var KanbanBoard = function (_a) {
|
|
|
291
296
|
}
|
|
292
297
|
return newExpanded;
|
|
293
298
|
});
|
|
294
|
-
};
|
|
299
|
+
}, []);
|
|
295
300
|
// drag handler
|
|
296
|
-
var onDragEnd = function (result) {
|
|
301
|
+
var onDragEnd = (0, react_1.useCallback)(function (result) {
|
|
297
302
|
var _a, _b;
|
|
298
303
|
var source = result.source, destination = result.destination, type = result.type;
|
|
299
304
|
if (!destination)
|
|
@@ -344,12 +349,12 @@ var KanbanBoard = function (_a) {
|
|
|
344
349
|
toIndex: destination.index,
|
|
345
350
|
});
|
|
346
351
|
}
|
|
347
|
-
};
|
|
348
|
-
var handleColumnDelete = function (colId) {
|
|
352
|
+
}, [columns, onDrag, onColumnReorder]);
|
|
353
|
+
var handleColumnDelete = (0, react_1.useCallback)(function (colId) {
|
|
349
354
|
var _a, _b;
|
|
350
355
|
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; })) || [];
|
|
351
356
|
onColumnDelete === null || onColumnDelete === void 0 ? void 0 : onColumnDelete(columnIds);
|
|
352
|
-
};
|
|
357
|
+
}, [columns, onColumnDelete]);
|
|
353
358
|
var rowBaseProps = (0, react_1.useMemo)(function () { return ({
|
|
354
359
|
canDrag: canDrag,
|
|
355
360
|
expanded: expanded,
|
|
@@ -359,6 +364,16 @@ var KanbanBoard = function (_a) {
|
|
|
359
364
|
setSize: setSize,
|
|
360
365
|
toggleExpand: toggleExpand,
|
|
361
366
|
}); }, [canDrag, expanded, onDelete, onOpen, canDelete, setSize, toggleExpand]);
|
|
367
|
+
// Stable per-column itemData so unrelated board re-renders (e.g. column hover)
|
|
368
|
+
// don't change the reference react-window hands to every row → no row re-renders.
|
|
369
|
+
var itemDataByCol = (0, react_1.useMemo)(function () {
|
|
370
|
+
var map = {};
|
|
371
|
+
for (var _i = 0, _a = Object.entries(columns); _i < _a.length; _i++) {
|
|
372
|
+
var _b = _a[_i], colId = _b[0], column = _b[1];
|
|
373
|
+
map[colId] = __assign(__assign({}, rowBaseProps), { items: column.items, colId: colId });
|
|
374
|
+
}
|
|
375
|
+
return map;
|
|
376
|
+
}, [columns, rowBaseProps]);
|
|
362
377
|
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) {
|
|
363
378
|
var _a;
|
|
364
379
|
var item = column.items[rubric.source.index];
|
|
@@ -366,89 +381,89 @@ var KanbanBoard = function (_a) {
|
|
|
366
381
|
return toggleExpand(item.id, colId, rubric.source.index);
|
|
367
382
|
}, isDeletable: canDelete }))));
|
|
368
383
|
} }, function (provided, snapshot) {
|
|
369
|
-
var _a, _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;
|
|
370
|
-
return (react_1.default.createElement(react_2.Box, __assign({ ref: provided.innerRef }, provided.droppableProps, { width: isColCollapsed ? COLLAPSED_KANBAN_COLUMN_WIDTH : columnWidth, borderRadius: "0.
|
|
384
|
+
var _a, _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, _9, _10;
|
|
385
|
+
return (react_1.default.createElement(react_2.Box, __assign({ ref: provided.innerRef }, provided.droppableProps, { width: isColCollapsed ? COLLAPSED_KANBAN_COLUMN_WIDTH : columnWidth, borderRadius: "0.75rem", background: snapshot.isDraggingOver
|
|
371
386
|
? (_a = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _a === void 0 ? void 0 : _a[50]
|
|
372
|
-
: (_b = colors === null || colors === void 0 ? void 0 : colors.background) === null || _b === void 0 ? void 0 : _b[100], border: "".concat(snapshot.isDraggingOver
|
|
373
|
-
?
|
|
374
|
-
:
|
|
387
|
+
: (_b = colors === null || colors === void 0 ? void 0 : colors.background) === null || _b === void 0 ? void 0 : _b[100], border: "0.063rem ".concat(snapshot.isDraggingOver ? "dashed" : "solid", " ").concat(snapshot.isDraggingOver
|
|
388
|
+
? (_c = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _c === void 0 ? void 0 : _c[300]
|
|
389
|
+
: (_e = (_d = colors === null || colors === void 0 ? void 0 : colors.boxborder) === null || _d === void 0 ? void 0 : _d[200]) !== null && _e !== void 0 ? _e : (_f = colors.gray) === null || _f === void 0 ? void 0 : _f[200]), transition: "background 0.15s ease, border-color 0.15s ease, width 0.2s ease", display: "flex", flexDirection: "column", flexShrink: 0, overflow: isColCollapsed ? "visible" : "hidden", height: "".concat(containerHeight - 60, "px"), onMouseEnter: function () { return setHoveredColumn(colId); }, onMouseLeave: function () { return setHoveredColumn(null); } }),
|
|
375
390
|
isColCollapsed ? (react_1.default.createElement(react_2.Flex, { direction: "column", align: "stretch", flex: "1", width: "100%", minH: 0, overflow: "visible", position: "relative" },
|
|
376
|
-
react_1.default.createElement(react_2.Flex, { as: "header", direction: "column", align: "center", flexShrink: 0, width: "100%", py: 3, px: 1, gap: 3, borderTop: "0.25rem solid", borderTopColor: (
|
|
391
|
+
react_1.default.createElement(react_2.Flex, { as: "header", direction: "column", align: "center", flexShrink: 0, width: "100%", py: 3, px: 1, gap: 3, borderTop: "0.25rem solid", borderTopColor: (_g = column.color) !== null && _g !== void 0 ? _g : (_h = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _h === void 0 ? void 0 : _h[500], bg: (_j = colors === null || colors === void 0 ? void 0 : colors.background) === null || _j === void 0 ? void 0 : _j[100], position: "relative", zIndex: 1 },
|
|
377
392
|
enableColumnReorder && columnDragHandleProps ? (react_1.default.createElement(react_2.Flex, __assign({ align: "center", justify: "center", flexShrink: 0, cursor: "grab" }, columnDragHandleProps),
|
|
378
|
-
react_1.default.createElement(react_2.Box, { as: lucide_react_1.GripVertical, size: 14, color: (
|
|
379
|
-
enableColumnCollapse && (react_1.default.createElement(react_2.Flex, { flexShrink: 0, w: "100%", justify: "center", bg: (
|
|
393
|
+
react_1.default.createElement(react_2.Box, { as: lucide_react_1.GripVertical, size: 14, color: (_k = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _k === void 0 ? void 0 : _k[400] }))) : null,
|
|
394
|
+
enableColumnCollapse && (react_1.default.createElement(react_2.Flex, { flexShrink: 0, w: "100%", justify: "center", bg: (_l = colors === null || colors === void 0 ? void 0 : colors.background) === null || _l === void 0 ? void 0 : _l[100], position: "relative", zIndex: 3 },
|
|
380
395
|
react_1.default.createElement(react_2.IconButton, { "aria-label": "Expand column", icon: react_1.default.createElement(lucide_react_1.ChevronRight, { size: 14 }), variant: "ghost", size: "xs", minW: "1.5rem", h: "1.75rem", onClick: function () { return toggleColumnCollapsed(colId); } }))),
|
|
381
|
-
react_1.default.createElement(react_2.Text, { as: "span", fontWeight: "700", fontSize: "0.75rem", color: (
|
|
396
|
+
react_1.default.createElement(react_2.Text, { as: "span", fontWeight: "700", fontSize: "0.75rem", color: (_m = colors === null || colors === void 0 ? void 0 : colors.text) === null || _m === void 0 ? void 0 : _m[700], sx: {
|
|
382
397
|
writingMode: "vertical-rl",
|
|
383
398
|
textOrientation: "mixed",
|
|
384
399
|
}, maxH: "".concat(Math.max(120, containerHeight - 200), "px"), overflow: "hidden", lineHeight: "1.2", title: column.title }, column.title),
|
|
385
|
-
react_1.default.createElement(react_2.Badge, { minW: "1.25rem", h: "1.25rem", borderRadius: "999px", border: "1px solid", borderColor: (
|
|
386
|
-
column.customNode ? (react_1.default.createElement(react_2.Box, { flexShrink: 0, minH: COLLAPSED_CUSTOM_NODE_TOP_RESERVE, w: "100%", bg: (
|
|
387
|
-
column.customNode ? (react_1.default.createElement(react_2.Box, { as: "section", "aria-label": "Column summary", flex: "1", minH: 0, w: "100%", overflow: "visible", py: 2, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "flex-start", bg: (
|
|
400
|
+
react_1.default.createElement(react_2.Badge, { minW: "1.25rem", h: "1.25rem", borderRadius: "999px", border: "1px solid", borderColor: (_o = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _o === void 0 ? void 0 : _o[300], display: "flex", backgroundColor: (_p = colors === null || colors === void 0 ? void 0 : colors.background) === null || _p === void 0 ? void 0 : _p[100], alignItems: "center", justifyContent: "center", color: (_q = colors === null || colors === void 0 ? void 0 : colors.text) === null || _q === void 0 ? void 0 : _q[900], fontWeight: 600, fontSize: "10px" }, (_r = column === null || column === void 0 ? void 0 : column.items) === null || _r === void 0 ? void 0 : _r.length)),
|
|
401
|
+
column.customNode ? (react_1.default.createElement(react_2.Box, { flexShrink: 0, minH: COLLAPSED_CUSTOM_NODE_TOP_RESERVE, w: "100%", bg: (_s = colors === null || colors === void 0 ? void 0 : colors.background) === null || _s === void 0 ? void 0 : _s[100], "aria-hidden": true })) : null,
|
|
402
|
+
column.customNode ? (react_1.default.createElement(react_2.Box, { as: "section", "aria-label": "Column summary", flex: "1", minH: 0, w: "100%", overflow: "visible", py: 2, display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "flex-start", bg: (_t = colors === null || colors === void 0 ? void 0 : colors.background) === null || _t === void 0 ? void 0 : _t[100], position: "relative", zIndex: 2 },
|
|
388
403
|
react_1.default.createElement(react_2.Box, { position: "relative", transform: "rotate(90deg)", transformOrigin: "center center", marginTop: '1rem' },
|
|
389
|
-
react_1.default.createElement(react_2.VStack, { align: "stretch", spacing: 1, minW: "max-content", fontSize: "xs", color: (
|
|
390
|
-
react_1.default.createElement(react_2.
|
|
391
|
-
|
|
392
|
-
react_1.default.createElement(react_2.Box, {
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
404
|
+
react_1.default.createElement(react_2.VStack, { align: "stretch", spacing: 1, minW: "max-content", fontSize: "xs", color: (_u = colors === null || colors === void 0 ? void 0 : colors.text) === null || _u === void 0 ? void 0 : _u[600] }, column.customNode())))) : (react_1.default.createElement(react_2.Box, { flex: "1", minH: 0 })))) : (react_1.default.createElement(react_2.Flex, { width: "100%", h: !isColCollapsed && !!((_v = column.customNode) === null || _v === void 0 ? void 0 : _v.call(column)) ? "auto" : "2.75rem", align: !isColCollapsed && !!((_w = column.customNode) === null || _w === void 0 ? void 0 : _w.call(column)) ? "flex-start" : "center", px: 3, py: 2, flexShrink: 0, justifyContent: "space-between", position: "relative", gap: 2, borderBottom: "0.063rem solid ".concat((_y = (_x = colors === null || colors === void 0 ? void 0 : colors.boxborder) === null || _x === void 0 ? void 0 : _x[100]) !== null && _y !== void 0 ? _y : (_z = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _z === void 0 ? void 0 : _z[100]) },
|
|
405
|
+
react_1.default.createElement(react_2.Flex, { direction: "column", gap: 1, minW: 0, flex: "1" },
|
|
406
|
+
react_1.default.createElement(react_2.Flex, { align: "center", gap: 2, minW: 0 },
|
|
407
|
+
react_1.default.createElement(react_2.Box, { boxSize: "0.625rem", borderRadius: "full", bg: (_0 = column.color) !== null && _0 !== void 0 ? _0 : (_1 = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _1 === void 0 ? void 0 : _1[500], flexShrink: 0 }),
|
|
408
|
+
enableColumnReorder && columnDragHandleProps ? (react_1.default.createElement(react_2.Flex, __assign({ align: "center", justify: "center", flexShrink: 0, cursor: "grab" }, columnDragHandleProps),
|
|
409
|
+
react_1.default.createElement(react_2.Box, { as: lucide_react_1.GripVertical, size: 14, color: (_2 = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _2 === void 0 ? void 0 : _2[400] }))) : null,
|
|
410
|
+
react_1.default.createElement(react_2.Text, { as: "span", fontWeight: "600", fontSize: "0.875rem", color: (_3 = colors === null || colors === void 0 ? void 0 : colors.text) === null || _3 === void 0 ? void 0 : _3[700], noOfLines: 1, minW: 0 },
|
|
411
|
+
react_1.default.createElement(OverflowTooltipText_1.default, { placement: "top" }, column.title))),
|
|
412
|
+
!!((_4 = column.customNode) === null || _4 === void 0 ? void 0 : _4.call(column)) ? (react_1.default.createElement(react_2.Box, { as: "section", "aria-label": "Column summary", width: "100%", flexShrink: 0, fontSize: "xs", color: (_5 = colors === null || colors === void 0 ? void 0 : colors.text) === null || _5 === void 0 ? void 0 : _5[600] }, column.customNode())) : null),
|
|
397
413
|
react_1.default.createElement(react_2.Box, { display: "flex", alignItems: "center", gap: 2 },
|
|
398
|
-
react_1.default.createElement(react_2.Badge, { minW:
|
|
414
|
+
react_1.default.createElement(react_2.Badge, { minW: "1.5rem", h: "1.5rem", px: 2, borderRadius: "999px", backgroundColor: (_6 = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _6 === void 0 ? void 0 : _6[100], display: "flex", alignItems: "center", justifyContent: "center", color: (_7 = colors === null || colors === void 0 ? void 0 : colors.text) === null || _7 === void 0 ? void 0 : _7[700], fontWeight: 600, fontSize: "0.625rem" }, (_8 = column === null || column === void 0 ? void 0 : column.items) === null || _8 === void 0 ? void 0 : _8.length),
|
|
399
415
|
enableColumnCollapse && (react_1.default.createElement(react_2.IconButton, { "aria-label": "Collapse column", icon: react_1.default.createElement(lucide_react_1.ChevronLeft, { size: 14 }), variant: "ghost", size: "xs", minW: "1.5rem", h: "1.75rem", flexShrink: 0, onClick: function () { return toggleColumnCollapsed(colId); } })),
|
|
400
416
|
canDelete &&
|
|
401
417
|
hoveredColumn === colId &&
|
|
402
|
-
column.items.length > 0 && (react_1.default.createElement(react_2.Box, { as: lucide_react_1.Trash2, size: 16, cursor: "pointer", color: (
|
|
418
|
+
column.items.length > 0 && (react_1.default.createElement(react_2.Box, { as: lucide_react_1.Trash2, size: 16, cursor: "pointer", color: (_9 = colors === null || colors === void 0 ? void 0 : colors.text) === null || _9 === void 0 ? void 0 : _9[600], _hover: { color: (_10 = colors === null || colors === void 0 ? void 0 : colors.red) === null || _10 === void 0 ? void 0 : _10[600] }, onClick: function () { return handleColumnDelete(colId); }, transition: "color 0.2s ease", flexShrink: 0 })),
|
|
403
419
|
!(canDelete &&
|
|
404
420
|
hoveredColumn === colId &&
|
|
405
421
|
column.items.length > 0) && react_1.default.createElement(react_2.Box, { width: "16px", height: "16px", flexShrink: 0 })))),
|
|
406
|
-
!isColCollapsed && (react_1.default.createElement(
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
"
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
"
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
"
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
"
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
provided.placeholder)))))));
|
|
422
|
+
!isColCollapsed && (react_1.default.createElement(react_2.Box, { px: 2, flex: "1", overflowY: "auto", width: "100%", sx: {
|
|
423
|
+
overflowY: "auto",
|
|
424
|
+
overflowX: "hidden",
|
|
425
|
+
scrollbarWidth: "thin",
|
|
426
|
+
scrollbarColor: "var(--chakra-colors-gray-300) transparent",
|
|
427
|
+
"&::-webkit-scrollbar": {
|
|
428
|
+
width: "6px !important",
|
|
429
|
+
height: "6px !important",
|
|
430
|
+
},
|
|
431
|
+
"&::-webkit-scrollbar-track": {
|
|
432
|
+
background: "gray.100",
|
|
433
|
+
borderRadius: "3px",
|
|
434
|
+
marginTop: "4px",
|
|
435
|
+
marginBottom: "4px",
|
|
436
|
+
},
|
|
437
|
+
"&::-webkit-scrollbar-thumb": {
|
|
438
|
+
background: "gray.300",
|
|
439
|
+
borderRadius: "3px",
|
|
440
|
+
border: "1px solid",
|
|
441
|
+
borderColor: "gray.100",
|
|
442
|
+
},
|
|
443
|
+
"&::-webkit-scrollbar-thumb:hover": {
|
|
444
|
+
background: "gray.400",
|
|
445
|
+
},
|
|
446
|
+
"&": {
|
|
447
|
+
scrollbarGutter: "stable both-edges",
|
|
448
|
+
},
|
|
449
|
+
cursor: canDrag ? "grab" : "not-allowed",
|
|
450
|
+
} },
|
|
451
|
+
(noItems === null || noItems === void 0 ? void 0 : noItems.isVisible) && column.items.length === 0 && (react_1.default.createElement(NoItemsTemplate, { column: column, noItems: noItems, colors: colors })),
|
|
452
|
+
virtualization ? (react_1.default.createElement(react_window_1.VariableSizeList, { ref: function (el) {
|
|
453
|
+
if (el)
|
|
454
|
+
listRefs.current[colId] = el;
|
|
455
|
+
}, height: containerHeight - 150, itemCount: column.items.length +
|
|
456
|
+
(snapshot.isUsingPlaceholder ? 1 : 0), itemSize: function (index) {
|
|
457
|
+
return getItemSize(index, column.items, colId);
|
|
458
|
+
}, width: "100%", itemData: itemDataByCol[colId] }, KanbanRow)) : (react_1.default.createElement(react_2.Box, null,
|
|
459
|
+
column.items.map(function (account, index) { return (react_1.default.createElement("div", { key: account.id, style: { paddingBottom: KANBAN_CARD_GAP, paddingTop: index === 0 ? KANBAN_LIST_TOP_PAD : 0 } },
|
|
460
|
+
react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id, isDragDisabled: !canDrag }, function (dragProvided) {
|
|
461
|
+
var _a;
|
|
462
|
+
return (react_1.default.createElement("div", __assign({ ref: dragProvided.innerRef }, dragProvided.draggableProps, dragProvided.dragHandleProps, { style: dragProvided.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, { account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[account.id], onToggleExpand: function () {
|
|
463
|
+
return toggleExpand(account.id, colId, index);
|
|
464
|
+
}, isDeletable: canDelete }))));
|
|
465
|
+
}))); }),
|
|
466
|
+
provided.placeholder))))));
|
|
452
467
|
})); };
|
|
453
468
|
if (!canView)
|
|
454
469
|
return null;
|
|
@@ -90,19 +90,26 @@ var SearchSelect = function (_a) {
|
|
|
90
90
|
var _y = (0, react_1.useState)(true), hasMore = _y[0], setHasMore = _y[1];
|
|
91
91
|
var inputRef = (0, react_1.useRef)(null);
|
|
92
92
|
var containerRef = (0, react_1.useRef)(null);
|
|
93
|
+
var controlRef = (0, react_1.useRef)(null);
|
|
94
|
+
var _z = (0, react_1.useState)({ top: 0, left: 0, width: 0 }), dropdownPos = _z[0], setDropdownPos = _z[1];
|
|
93
95
|
var scrollTimeoutRef = (0, react_1.useRef)(null);
|
|
94
|
-
var
|
|
95
|
-
var
|
|
96
|
+
var _0 = (0, react_1.useState)(false), focused = _0[0], setFocused = _0[1];
|
|
97
|
+
var _1 = (0, react_1.useState)(false), customSelectOpen = _1[0], setCustomSelectOpen = _1[1];
|
|
96
98
|
var customSelectRef = (0, react_1.useRef)(null);
|
|
97
|
-
var
|
|
99
|
+
var _2 = (0, react_1.useState)({
|
|
98
100
|
top: 0,
|
|
99
101
|
left: 0,
|
|
100
102
|
width: 0,
|
|
101
|
-
}), customSelectPos =
|
|
103
|
+
}), customSelectPos = _2[0], setCustomSelectPos = _2[1];
|
|
102
104
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
103
105
|
(0, react_2.useOutsideClick)({
|
|
104
106
|
ref: containerRef,
|
|
105
|
-
handler: function () {
|
|
107
|
+
handler: function (e) {
|
|
108
|
+
// The options dropdown is portaled to <body>, so a click on it is "outside"
|
|
109
|
+
// the container — ignore those so selecting an option doesn't close first.
|
|
110
|
+
var dropdown = document.getElementById("searchselect-dropdown-portal");
|
|
111
|
+
if (dropdown && dropdown.contains(e.target))
|
|
112
|
+
return;
|
|
106
113
|
setIsOpen(false);
|
|
107
114
|
},
|
|
108
115
|
});
|
|
@@ -223,10 +230,34 @@ var SearchSelect = function (_a) {
|
|
|
223
230
|
});
|
|
224
231
|
}
|
|
225
232
|
}, [customSelectOpen]);
|
|
233
|
+
// Keep the portaled options dropdown anchored to the control (on open + while
|
|
234
|
+
// open if the page/modal scrolls or resizes).
|
|
235
|
+
var updateDropdownPos = (0, react_1.useCallback)(function () {
|
|
236
|
+
if (!controlRef.current)
|
|
237
|
+
return;
|
|
238
|
+
var rect = controlRef.current.getBoundingClientRect();
|
|
239
|
+
setDropdownPos({
|
|
240
|
+
top: rect.bottom + window.scrollY,
|
|
241
|
+
left: rect.left + window.scrollX,
|
|
242
|
+
width: rect.width,
|
|
243
|
+
});
|
|
244
|
+
}, []);
|
|
245
|
+
(0, react_1.useEffect)(function () {
|
|
246
|
+
if (!isOpen)
|
|
247
|
+
return;
|
|
248
|
+
updateDropdownPos();
|
|
249
|
+
// `true` (capture) catches scrolling inside any ancestor (e.g. modal body).
|
|
250
|
+
window.addEventListener("scroll", updateDropdownPos, true);
|
|
251
|
+
window.addEventListener("resize", updateDropdownPos);
|
|
252
|
+
return function () {
|
|
253
|
+
window.removeEventListener("scroll", updateDropdownPos, true);
|
|
254
|
+
window.removeEventListener("resize", updateDropdownPos);
|
|
255
|
+
};
|
|
256
|
+
}, [isOpen, updateDropdownPos]);
|
|
226
257
|
return (react_1.default.createElement(react_2.Box, { ref: containerRef, width: width, position: "relative" },
|
|
227
258
|
label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, id: id, isRequired: isRequired, isInformation: isInformation !== null && isInformation !== void 0 ? isInformation : information === null || information === void 0 ? void 0 : information.isInformation, informationMessage: informationMessage !== null && informationMessage !== void 0 ? informationMessage : information === null || information === void 0 ? void 0 : information.informationMessage })),
|
|
228
259
|
react_1.default.createElement(react_2.InputGroup, { size: size },
|
|
229
|
-
react_1.default.createElement(react_2.Box, { as: "div", w: "100%", minH: s.minH, px: s.px, pr: s.pr, position: "relative", display: "flex", alignItems: "center", flexWrap: "wrap", gap: s.gap, border: "0.063rem solid", borderColor: error
|
|
260
|
+
react_1.default.createElement(react_2.Box, { as: "div", ref: controlRef, w: "100%", minH: s.minH, px: s.px, pr: s.pr, position: "relative", display: "flex", alignItems: "center", flexWrap: "wrap", gap: s.gap, border: "0.063rem solid", borderColor: error
|
|
230
261
|
? theme.colors.semantic.error[500]
|
|
231
262
|
: focused
|
|
232
263
|
? theme.colors.primary[500]
|
|
@@ -275,22 +306,23 @@ var SearchSelect = function (_a) {
|
|
|
275
306
|
e.stopPropagation();
|
|
276
307
|
setIsOpen(function (prev) { return !prev; });
|
|
277
308
|
}, "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
|
-
isOpen && (react_1.default.createElement(react_2.
|
|
279
|
-
|
|
280
|
-
react_1.default.createElement(
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
react_1.default.createElement(react_2.
|
|
284
|
-
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, loadingText))) : !isOptionLoading && filteredOptions.length === 0 ? (react_1.default.createElement(react_2.Text, { p: 3, fontSize: s.dropdownTextFontSize, color: theme.colors.gray[500] }, "No results found")) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
285
|
-
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]) },
|
|
286
|
-
isMultiple && (react_1.default.createElement(Checkbox_1.default, { isChecked: isSelected(option.id), sx: { pointerEvents: "none" }, size: s.checkboxSize })),
|
|
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 },
|
|
309
|
+
isOpen && (react_1.default.createElement(react_2.Portal, null,
|
|
310
|
+
react_1.default.createElement(react_2.Box, { id: "searchselect-dropdown-portal", position: "absolute", top: "".concat(dropdownPos.top, "px"), left: "".concat(dropdownPos.left, "px"), width: "".concat(dropdownPos.width, "px"), zIndex: 1500, maxH: "20rem", borderWidth: 1, borderColor: theme.colors.gray[200], borderRadius: "sm", bg: theme.colors.white, boxShadow: "md", display: "flex", flexDirection: "column" },
|
|
311
|
+
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]) },
|
|
312
|
+
react_1.default.createElement(Checkbox_1.default, { isChecked: allFilteredSelected, sx: { pointerEvents: "none" }, size: s.checkboxSize }),
|
|
313
|
+
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, allFilteredSelected ? "Unselect All" : "Select All"))),
|
|
314
|
+
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 && filteredOptions.length === 0 ? (react_1.default.createElement(react_2.Box, { py: s.optionRowPy, px: 3, display: "flex", alignItems: "center", gap: 2, minH: s.optionRowMinH },
|
|
289
315
|
react_1.default.createElement(react_2.Spinner, { size: s.spinnerSize }),
|
|
290
|
-
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, loadingText)))))
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
316
|
+
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, loadingText))) : !isOptionLoading && filteredOptions.length === 0 ? (react_1.default.createElement(react_2.Text, { p: 3, fontSize: s.dropdownTextFontSize, color: theme.colors.gray[500] }, "No results found")) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
317
|
+
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]) },
|
|
318
|
+
isMultiple && (react_1.default.createElement(Checkbox_1.default, { isChecked: isSelected(option.id), sx: { pointerEvents: "none" }, size: s.checkboxSize })),
|
|
319
|
+
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)))); }),
|
|
320
|
+
((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 },
|
|
321
|
+
react_1.default.createElement(react_2.Spinner, { size: s.spinnerSize }),
|
|
322
|
+
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, loadingText)))))),
|
|
323
|
+
(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] } },
|
|
324
|
+
addNew.icon || react_1.default.createElement(lucide_react_1.Plus, { size: s.addNewIconSize }),
|
|
325
|
+
react_1.default.createElement(react_2.Text, { fontSize: s.dropdownTextFontSize }, addNew.text || "Add New")))))),
|
|
294
326
|
helperText && !error && react_1.default.createElement(HelperText_1.default, { helperText: helperText }),
|
|
295
327
|
error && react_1.default.createElement(ErrorMessage_1.default, { errorMessage: errorMessage })));
|
|
296
328
|
};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { TableProps } from "./TableProps";
|
|
3
|
-
export default function Table({ data, columns, onSelection, isLoading, isCheckbox, headerBgColor, freezedBgColor, headerTextColor, freezedTextColor, tableBorderColor, noBorders, isPagination, onRowClick, selections, isActionFreeze, preferences, paginationMode, infiniteScroll, hasMore, isLoadingMore, noOfRowsPerPage, totalRecords, onPagination, isTableSettings, headerActions, onGlobalSearch, onNoOfRowsPerPageChange, paginationSelectOptions, tableMaxHeight, minVisibleRows, maxVisibleRows, autoFitViewport, tableSettings, filterSidebar, loadingSkeletonRows, defaultVisibleColumns, density, stripe,
|
|
3
|
+
export default function Table({ data, columns, onSelection, isLoading, isCheckbox, headerBgColor, freezedBgColor, headerTextColor, freezedTextColor, tableBorderColor, noBorders, isPagination, onRowClick, selections, isActionFreeze, preferences, paginationMode, infiniteScroll, hasMore, isLoadingMore, groupLoadMore, loadMoreText, loadMorePosition, loadMoreChunkSize, noOfRowsPerPage, totalRecords, onPagination, isTableSettings, headerActions, onGlobalSearch, onNoOfRowsPerPageChange, paginationSelectOptions, tableMaxHeight, minVisibleRows, maxVisibleRows, autoFitViewport, tableSettings, filterSidebar, loadingSkeletonRows, defaultVisibleColumns, density, stripe, groupColors, onAddItem, emptyState, }: TableProps): React.JSX.Element;
|