pixelize-design-library 2.1.64 → 2.1.66

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.
@@ -1,9 +1,11 @@
1
1
  import React from "react";
2
2
  import { Account, KanbanBoardProps } from "./KanbanBoardProps";
3
- declare const AccountCard: ({ account, index, onDelete, onOpen, }: {
3
+ declare const AccountCard: ({ account, index, onDelete, onOpen, isExpanded, onToggleExpand, }: {
4
4
  account: Account;
5
5
  index: number;
6
- onDelete: KanbanBoardProps['onDelete'];
7
- onOpen: KanbanBoardProps['onOpen'];
6
+ onDelete: KanbanBoardProps["onDelete"];
7
+ onOpen: KanbanBoardProps["onOpen"];
8
+ isExpanded?: boolean | undefined;
9
+ onToggleExpand?: (() => void) | undefined;
8
10
  }) => React.JSX.Element;
9
11
  export default AccountCard;
@@ -1,15 +1,4 @@
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
- };
13
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
14
3
  if (k2 === undefined) k2 = k;
15
4
  var desc = Object.getOwnPropertyDescriptor(m, k);
@@ -39,36 +28,38 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
28
  Object.defineProperty(exports, "__esModule", { value: true });
40
29
  var react_1 = __importStar(require("react"));
41
30
  var react_2 = require("@chakra-ui/react");
42
- var dnd_1 = require("@hello-pangea/dnd");
43
31
  var lucide_react_1 = require("lucide-react");
44
32
  var useCustomTheme_1 = require("../../Theme/useCustomTheme");
45
33
  var AccountRow_1 = __importDefault(require("./AccountRow"));
46
34
  var excludeKeys = ["id", "details"];
47
35
  var AccountCard = function (_a) {
48
- var account = _a.account, index = _a.index, onDelete = _a.onDelete, onOpen = _a.onOpen;
36
+ var _b, _c, _d, _e, _f, _g;
37
+ var account = _a.account, index = _a.index, onDelete = _a.onDelete, onOpen = _a.onOpen, _h = _a.isExpanded, isExpanded = _h === void 0 ? false : _h, onToggleExpand = _a.onToggleExpand;
49
38
  var colors = (0, useCustomTheme_1.useCustomTheme)().colors;
50
- var _b = (0, react_1.useState)(false), showMore = _b[0], setShowMore = _b[1];
39
+ var _j = (0, react_1.useState)(false), showMore = _j[0], setShowMore = _j[1];
51
40
  var keys = Object.keys(account).filter(function (key) { return typeof account[key] === "string" && !excludeKeys.includes(key); });
52
- var visibleKeys = showMore ? keys : keys.slice(0, 4);
53
- return (react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index }, function (provided) {
54
- var _a, _b, _c, _d, _e, _f;
55
- return (react_1.default.createElement(react_2.Box, __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { width: "16.5rem", borderRadius: "0.25rem", borderWidth: "0.063rem", background: (_a = colors === null || colors === void 0 ? void 0 : colors.background) === null || _a === void 0 ? void 0 : _a[500], border: "0.1rem solid ".concat((_b = colors.gray) === null || _b === void 0 ? void 0 : _b[200]), p: 2, mt: 3 }),
56
- react_1.default.createElement(react_2.VStack, { align: "start", spacing: 2, fontSize: "0.875rem", color: (_c = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _c === void 0 ? void 0 : _c[700], overflow: "none" },
57
- 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] })); }),
58
- react_1.default.createElement(react_2.Collapse, { in: showMore && account.details !== undefined, animateOpacity: true },
59
- react_1.default.createElement(react_2.Text, { pt: 2 }, account.details)),
60
- keys.length > 4 && (react_1.default.createElement(react_2.Flex, { justify: "space-between", w: "full", pt: 2, alignItems: "center" },
61
- react_1.default.createElement(react_2.Text, { color: (_d = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _d === void 0 ? void 0 : _d[500], fontSize: "sm", fontWeight: "medium", cursor: "pointer", onClick: function () { return setShowMore(!showMore); }, display: "flex", alignItems: "center", gap: 2 },
62
- "Show ",
63
- showMore ? "less" : "more",
64
- " ",
65
- showMore ? (react_1.default.createElement(lucide_react_1.ChevronUp, { size: 14 })) : (react_1.default.createElement(lucide_react_1.ChevronDown, { size: 14 }))),
66
- react_1.default.createElement(react_2.Spacer, null),
67
- react_1.default.createElement(react_2.HStack, { spacing: 2 },
68
- react_1.default.createElement(react_2.Tooltip, { label: "Delete" },
69
- react_1.default.createElement(lucide_react_1.Trash2, { size: 16, color: (_e = colors === null || colors === void 0 ? void 0 : colors.red) === null || _e === void 0 ? void 0 : _e[600], onClick: function () { return onDelete === null || onDelete === void 0 ? void 0 : onDelete(account); } })),
70
- react_1.default.createElement(react_2.Tooltip, { label: "Open" },
71
- react_1.default.createElement(lucide_react_1.ExternalLink, { size: 16, color: (_f = colors === null || colors === void 0 ? void 0 : colors.blue) === null || _f === void 0 ? void 0 : _f[600], onClick: function () { return onOpen === null || onOpen === void 0 ? void 0 : onOpen(account); } }))))))));
72
- }));
41
+ var visibleKeys = isExpanded ? keys : keys.slice(0, 4);
42
+ // Handle the show more/less toggle
43
+ var handleToggle = function () {
44
+ setShowMore(!showMore);
45
+ onToggleExpand === null || onToggleExpand === void 0 ? void 0 : onToggleExpand();
46
+ };
47
+ return (react_1.default.createElement(react_2.Box, { width: "100%", borderRadius: "0.25rem", borderWidth: "0.063rem", background: (_b = colors === null || colors === void 0 ? void 0 : colors.background) === null || _b === void 0 ? void 0 : _b[500], border: "0.1rem solid ".concat((_c = colors.gray) === null || _c === void 0 ? void 0 : _c[200]), p: 2, mt: 3, boxSizing: "border-box", minHeight: isExpanded ? "180px" : "100px" },
48
+ react_1.default.createElement(react_2.VStack, { align: "start", spacing: 2, fontSize: "0.875rem", color: (_d = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _d === void 0 ? void 0 : _d[700] },
49
+ 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] })); }),
50
+ react_1.default.createElement(react_2.Collapse, { in: isExpanded && account.details !== undefined, animateOpacity: true },
51
+ react_1.default.createElement(react_2.Text, { pt: 2 }, account.details)),
52
+ react_1.default.createElement(react_2.Flex, { justify: "space-between", w: "full", pt: 2, alignItems: "center" },
53
+ keys.length > 4 && (react_1.default.createElement(react_2.Text, { color: (_e = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _e === void 0 ? void 0 : _e[500], fontSize: "sm", fontWeight: "medium", cursor: "pointer", onClick: handleToggle, display: "flex", alignItems: "center", gap: 2 },
54
+ "Show ",
55
+ isExpanded ? "less" : "more",
56
+ " ",
57
+ isExpanded ? react_1.default.createElement(lucide_react_1.ChevronUp, { size: 14 }) : react_1.default.createElement(lucide_react_1.ChevronDown, { size: 14 }))),
58
+ react_1.default.createElement(react_2.Spacer, null),
59
+ react_1.default.createElement(react_2.HStack, { spacing: 2 },
60
+ react_1.default.createElement(react_2.Tooltip, { label: "Delete" },
61
+ react_1.default.createElement(lucide_react_1.Trash2, { size: 16, color: (_f = colors === null || colors === void 0 ? void 0 : colors.red) === null || _f === void 0 ? void 0 : _f[600], onClick: function () { return onDelete === null || onDelete === void 0 ? void 0 : onDelete(account); }, cursor: "pointer" })),
62
+ react_1.default.createElement(react_2.Tooltip, { label: "Open" },
63
+ react_1.default.createElement(lucide_react_1.ExternalLink, { size: 16, color: (_g = colors === null || colors === void 0 ? void 0 : colors.blue) === null || _g === void 0 ? void 0 : _g[600], onClick: function () { return onOpen === null || onOpen === void 0 ? void 0 : onOpen(account); }, cursor: "pointer" })))))));
73
64
  };
74
65
  exports.default = AccountCard;
@@ -1,4 +1,4 @@
1
1
  import React from "react";
2
2
  import { KanbanBoardProps } from "./KanbanBoardProps";
3
- declare const KanbanBoard: ({ data, onDrag, onDelete, onOpen, onColumnDelete, isLoading, kanbanSelect, kanbanEdit, kanbanCreate }: KanbanBoardProps) => React.JSX.Element;
3
+ declare const KanbanBoard: ({ data, onDrag, onDelete, onOpen, onColumnDelete, isLoading, kanbanSelect, kanbanEdit, kanbanCreate, virtualization, }: KanbanBoardProps) => React.JSX.Element;
4
4
  export default KanbanBoard;
@@ -50,14 +50,73 @@ var react_1 = __importStar(require("react"));
50
50
  var react_2 = require("@chakra-ui/react");
51
51
  var dnd_1 = require("@hello-pangea/dnd");
52
52
  var lucide_react_1 = require("lucide-react");
53
+ var react_window_1 = require("react-window");
53
54
  var useCustomTheme_1 = require("../../Theme/useCustomTheme");
54
55
  var AccountCard_1 = __importDefault(require("./AccountCard"));
55
56
  var HeaderActions_1 = __importDefault(require("../Header/HeaderActions"));
57
+ var MeasuredItem_1 = __importDefault(require("./MeasuredItem"));
56
58
  var KanbanBoard = function (_a) {
57
- var _b, _c, _d;
58
- var data = _a.data, onDrag = _a.onDrag, onDelete = _a.onDelete, onOpen = _a.onOpen, onColumnDelete = _a.onColumnDelete, _e = _a.isLoading, isLoading = _e === void 0 ? false : _e, kanbanSelect = _a.kanbanSelect, kanbanEdit = _a.kanbanEdit, kanbanCreate = _a.kanbanCreate;
59
+ var _b;
60
+ var data = _a.data, onDrag = _a.onDrag, onDelete = _a.onDelete, onOpen = _a.onOpen, onColumnDelete = _a.onColumnDelete, _c = _a.isLoading, isLoading = _c === void 0 ? false : _c, kanbanSelect = _a.kanbanSelect, kanbanEdit = _a.kanbanEdit, kanbanCreate = _a.kanbanCreate, virtualization = _a.virtualization;
59
61
  var colors = (0, useCustomTheme_1.useCustomTheme)().colors;
60
- var _f = (0, react_1.useState)(data), columns = _f[0], setColumns = _f[1];
62
+ var _d = (0, react_1.useState)(data), columns = _d[0], setColumns = _d[1];
63
+ var _e = (0, react_1.useState)(600), containerHeight = _e[0], setContainerHeight = _e[1];
64
+ // Responsive column width
65
+ var columnWidth = (0, react_2.useBreakpointValue)({
66
+ base: "16rem",
67
+ md: "17.5rem",
68
+ lg: "19rem",
69
+ });
70
+ // track expanded cards
71
+ var _f = (0, react_1.useState)({}), expanded = _f[0], setExpanded = _f[1];
72
+ // ref for lists
73
+ var listRefs = (0, react_1.useRef)({});
74
+ var containerRef = (0, react_1.useRef)(null);
75
+ // store measured heights
76
+ var _g = (0, react_1.useState)({}), sizes = _g[0], setSizes = _g[1];
77
+ // update height for an item
78
+ var setSize = (0, react_1.useCallback)(function (index, size, colId) {
79
+ var key = "".concat(colId, "-").concat(index);
80
+ setSizes(function (prev) {
81
+ var _a;
82
+ if (prev[key] === size)
83
+ return prev;
84
+ return __assign(__assign({}, prev), (_a = {}, _a[key] = size, _a));
85
+ });
86
+ if (listRefs.current[colId]) {
87
+ listRefs.current[colId].resetAfterIndex(index);
88
+ }
89
+ }, []);
90
+ var getItemSize = function (index, _items, colId) {
91
+ var key = "".concat(colId, "-").concat(index);
92
+ return sizes[key] || 180; // default until measured
93
+ };
94
+ // Calculate container height
95
+ (0, react_1.useEffect)(function () {
96
+ var calculateHeight = function () {
97
+ var _a;
98
+ if (containerRef.current) {
99
+ var headerHeight = ((_a = document.querySelector("header")) === null || _a === void 0 ? void 0 : _a.clientHeight) || 0;
100
+ var availableHeight = window.innerHeight - headerHeight - 100;
101
+ setContainerHeight(Math.max(500, availableHeight));
102
+ }
103
+ };
104
+ calculateHeight();
105
+ window.addEventListener("resize", calculateHeight);
106
+ return function () { return window.removeEventListener("resize", calculateHeight); };
107
+ }, []);
108
+ // toggle expand/collapse
109
+ var toggleExpand = function (id, colId, index) {
110
+ setExpanded(function (prev) {
111
+ var _a;
112
+ var newExpanded = __assign(__assign({}, prev), (_a = {}, _a[id] = !prev[id], _a));
113
+ if (listRefs.current[colId]) {
114
+ listRefs.current[colId].resetAfterIndex(index);
115
+ }
116
+ return newExpanded;
117
+ });
118
+ };
119
+ // drag handler
61
120
  var onDragEnd = function (result) {
62
121
  var _a, _b;
63
122
  var source = result.source, destination = result.destination;
@@ -72,16 +131,14 @@ var KanbanBoard = function (_a) {
72
131
  var copiedItems = __spreadArray([], sourceCol.items, true);
73
132
  copiedItems.splice(source.index, 1);
74
133
  copiedItems.splice(destination.index, 0, draggedItem);
75
- var newCol = __assign(__assign({}, columns), (_a = {}, _a[source.droppableId] = __assign(__assign({}, sourceCol), { items: copiedItems }), _a));
76
- setColumns(newCol);
134
+ setColumns(__assign(__assign({}, columns), (_a = {}, _a[source.droppableId] = __assign(__assign({}, sourceCol), { items: copiedItems }), _a)));
77
135
  }
78
136
  else {
79
137
  var sourceItems = __spreadArray([], sourceCol.items, true);
80
138
  var destItems = __spreadArray([], destCol.items, true);
81
139
  sourceItems.splice(source.index, 1);
82
140
  destItems.splice(destination.index, 0, draggedItem);
83
- var updatedCols = __assign(__assign({}, columns), (_b = {}, _b[source.droppableId] = __assign(__assign({}, sourceCol), { items: sourceItems }), _b[destination.droppableId] = __assign(__assign({}, destCol), { items: destItems }), _b));
84
- setColumns(updatedCols);
141
+ setColumns(__assign(__assign({}, columns), (_b = {}, _b[source.droppableId] = __assign(__assign({}, sourceCol), { items: sourceItems }), _b[destination.droppableId] = __assign(__assign({}, destCol), { items: destItems }), _b)));
85
142
  onDrag === null || onDrag === void 0 ? void 0 : onDrag({
86
143
  from: source.droppableId,
87
144
  to: destination.droppableId,
@@ -94,30 +151,61 @@ var KanbanBoard = function (_a) {
94
151
  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; })) || [];
95
152
  onColumnDelete === null || onColumnDelete === void 0 ? void 0 : onColumnDelete(columnIds);
96
153
  };
154
+ // row renderer
155
+ var Row = function (_a) {
156
+ var index = _a.index, style = _a.style, data = _a.data;
157
+ var items = data.items, colId = data.colId, placeholder = data.placeholder;
158
+ var account = items[index];
159
+ return (react_1.default.createElement("div", { style: __assign(__assign({}, style), { marginBottom: 12 }) },
160
+ react_1.default.createElement(MeasuredItem_1.default, { index: index, setSize: function (i, h) { return setSize(i, h, colId); } },
161
+ react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id }, function (provided) { return (react_1.default.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: provided.draggableProps.style }),
162
+ react_1.default.createElement(AccountCard_1.default, { key: account.id, account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[account.id], onToggleExpand: function () { return toggleExpand(account.id, colId, index); } }))); })),
163
+ index === items.length - 1 && placeholder));
164
+ };
97
165
  return (react_1.default.createElement(react_1.default.Fragment, null,
98
166
  react_1.default.createElement(HeaderActions_1.default, { select: kanbanSelect, edit: kanbanEdit, create: kanbanCreate }),
99
167
  react_1.default.createElement(dnd_1.DragDropContext, { onDragEnd: onDragEnd },
100
- react_1.default.createElement(react_2.Flex, { gap: 4, p: 4, mt: 2, bg: (_b = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _b === void 0 ? void 0 : _b[200], minH: "100vh", overflowX: "auto", maxWidth: "100vw" }, isLoading ? ((_c = Array.from({ length: 5 })) === null || _c === void 0 ? void 0 : _c.map(function (_, idx) {
101
- var _a, _b;
102
- return (react_1.default.createElement(react_2.Box, { key: idx, width: "17.5rem", p: 4, borderRadius: "0.5rem", bg: (_a = colors === null || colors === void 0 ? void 0 : colors.background) === null || _a === void 0 ? void 0 : _a[100], border: "0.125rem solid ".concat((_b = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _b === void 0 ? void 0 : _b[200]), flexShrink: 0 },
103
- react_1.default.createElement(react_2.Skeleton, { height: "2.75rem", mb: 4, borderRadius: "0.25rem" }),
104
- react_1.default.createElement(react_2.SkeletonText, { mt: "4", noOfLines: 5, spacing: "4" })));
105
- })) : ((_d = Object.entries(columns)) === null || _d === void 0 ? void 0 : _d.map(function (_a) {
106
- var colId = _a[0], column = _a[1];
107
- return (react_1.default.createElement(dnd_1.Droppable, { droppableId: colId.toString(), key: colId }, function (provided, snapshot) {
108
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
109
- return (react_1.default.createElement(react_2.Box, __assign({ ref: provided.innerRef }, provided.droppableProps, { width: "17.5rem", opacity: 1, borderRadius: "0.5rem", borderWidth: "0.063rem", background: snapshot.isDraggingOver
110
- ? (_a = colors === null || colors === void 0 ? void 0 : colors.blue) === null || _a === void 0 ? void 0 : _a[50]
111
- : (_b = colors === null || colors === void 0 ? void 0 : colors.background) === null || _b === void 0 ? void 0 : _b[100], border: "".concat(snapshot.isDraggingOver
112
- ? "0.5px dashed" + ((_c = colors === null || colors === void 0 ? void 0 : colors.blue) === null || _c === void 0 ? void 0 : _c[500])
113
- : "0.125rem solid" + ((_d = colors.gray) === null || _d === void 0 ? void 0 : _d[200])), display: "flex", flexDirection: "column", flexShrink: 0 }),
114
- react_1.default.createElement(react_2.Flex, { width: "16.5rem", height: "2.75rem", borderRadius: "0.25rem", borderLeft: "0.188rem solid", borderLeftColor: (_e = column.color) !== null && _e !== void 0 ? _e : (_f = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _f === void 0 ? void 0 : _f[500], background: (_g = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _g === void 0 ? void 0 : _g[100], align: "center", px: 2, mb: 3, flexShrink: 0, m: 2, justifyContent: "space-between" },
115
- react_1.default.createElement(react_2.Text, { fontWeight: "600", fontSize: "1rem", color: (_h = colors === null || colors === void 0 ? void 0 : colors.text) === null || _h === void 0 ? void 0 : _h[700] }, column.title),
116
- react_1.default.createElement(react_2.Box, { as: lucide_react_1.Trash2, size: 16, cursor: "pointer", color: (_j = colors === null || colors === void 0 ? void 0 : colors.text) === null || _j === void 0 ? void 0 : _j[600], _hover: { color: (_k = colors === null || colors === void 0 ? void 0 : colors.red) === null || _k === void 0 ? void 0 : _k[600] }, onClick: function () { return handleColumnDelete(colId); } })),
117
- react_1.default.createElement(react_2.Box, { px: 2, pb: 2, overflowY: "auto", maxHeight: "calc(100vh - 7rem)", overflowX: "hidden" }, (_l = column.items) === null || _l === void 0 ? void 0 :
118
- _l.map(function (account, index) { return (react_1.default.createElement(AccountCard_1.default, { key: account.id, account: account, index: index, onDelete: onDelete, onOpen: onOpen })); }),
119
- provided.placeholder)));
120
- }));
121
- }))))));
168
+ react_1.default.createElement(react_2.Flex, { ref: containerRef, gap: 4, p: 4, mt: 2, bg: (_b = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _b === void 0 ? void 0 : _b[200], minH: "".concat(containerHeight, "px"), overflowX: "auto", maxWidth: "100vw" }, isLoading
169
+ ? Array.from({ length: 5 }).map(function (_, idx) {
170
+ var _a, _b;
171
+ return (react_1.default.createElement(react_2.Box, { key: idx, width: columnWidth, p: 4, borderRadius: "0.5rem", bg: (_a = colors === null || colors === void 0 ? void 0 : colors.background) === null || _a === void 0 ? void 0 : _a[100], border: "0.125rem solid ".concat((_b = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _b === void 0 ? void 0 : _b[200]), flexShrink: 0 },
172
+ react_1.default.createElement(react_2.Skeleton, { height: "2.75rem", mb: 4, borderRadius: "0.25rem" }),
173
+ react_1.default.createElement(react_2.SkeletonText, { mt: "4", noOfLines: 5, spacing: "4" })));
174
+ })
175
+ : Object.entries(columns).map(function (_a) {
176
+ var colId = _a[0], column = _a[1];
177
+ return (react_1.default.createElement(dnd_1.Droppable, { droppableId: colId, key: colId, mode: virtualization ? "virtual" : "standard", renderClone: function (provided, _snapshot, rubric) {
178
+ var item = column.items[rubric.source.index];
179
+ return (react_1.default.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: __assign(__assign({}, provided.draggableProps.style), { width: columnWidth, marginBottom: 12 }) }),
180
+ react_1.default.createElement(AccountCard_1.default, { key: item.id, account: item, index: rubric.source.index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[item.id], onToggleExpand: function () {
181
+ return toggleExpand(item.id, colId, rubric.source.index);
182
+ } })));
183
+ } }, function (provided, snapshot) {
184
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
185
+ return (react_1.default.createElement(react_2.Box, __assign({ ref: provided.innerRef }, provided.droppableProps, { width: columnWidth, borderRadius: "0.5rem", borderWidth: "0.063rem", background: snapshot.isDraggingOver
186
+ ? (_a = colors === null || colors === void 0 ? void 0 : colors.blue) === null || _a === void 0 ? void 0 : _a[50]
187
+ : (_b = colors === null || colors === void 0 ? void 0 : colors.background) === null || _b === void 0 ? void 0 : _b[100], border: "".concat(snapshot.isDraggingOver
188
+ ? "0.5px dashed " + ((_c = colors === null || colors === void 0 ? void 0 : colors.blue) === null || _c === void 0 ? void 0 : _c[500])
189
+ : "0.125rem solid " + ((_d = colors.gray) === null || _d === void 0 ? void 0 : _d[200])), display: "flex", flexDirection: "column", flexShrink: 0, overflow: "hidden", height: "".concat(containerHeight, "px") }),
190
+ react_1.default.createElement(react_2.Flex, { width: "95%", height: "2.75rem", borderRadius: "0.25rem", borderLeft: "0.188rem solid", borderLeftColor: (_e = column.color) !== null && _e !== void 0 ? _e : (_f = colors === null || colors === void 0 ? void 0 : colors.primary) === null || _f === void 0 ? void 0 : _f[500], background: (_g = colors === null || colors === void 0 ? void 0 : colors.gray) === null || _g === void 0 ? void 0 : _g[100], align: "center", px: 2, m: 2, flexShrink: 0, justifyContent: "space-between" },
191
+ react_1.default.createElement(react_2.Text, { fontWeight: "600", fontSize: "1rem", color: (_h = colors === null || colors === void 0 ? void 0 : colors.text) === null || _h === void 0 ? void 0 : _h[700] }, column.title),
192
+ react_1.default.createElement(react_2.Box, { as: lucide_react_1.Trash2, size: 16, cursor: "pointer", color: (_j = colors === null || colors === void 0 ? void 0 : colors.text) === null || _j === void 0 ? void 0 : _j[600], _hover: { color: (_k = colors === null || colors === void 0 ? void 0 : colors.red) === null || _k === void 0 ? void 0 : _k[600] }, onClick: function () { return handleColumnDelete(colId); } })),
193
+ react_1.default.createElement(react_2.Box, { px: 2, pb: 2, flex: "1", overflow: "auto", width: "100%" }, virtualization ? (react_1.default.createElement(react_window_1.VariableSizeList, { ref: function (el) {
194
+ if (el)
195
+ listRefs.current[colId] = el;
196
+ }, height: containerHeight - 100, itemCount: column.items.length, itemSize: function (index) {
197
+ return getItemSize(index, column.items, colId);
198
+ }, width: "100%", itemData: {
199
+ items: column.items,
200
+ colId: colId,
201
+ placeholder: provided.placeholder,
202
+ } }, Row)) : (react_1.default.createElement(react_2.Box, { height: "100%", overflow: "auto" },
203
+ column.items.map(function (account, index) { return (react_1.default.createElement(dnd_1.Draggable, { draggableId: account.id.toString(), index: index, key: account.id }, function (provided) { return (react_1.default.createElement("div", __assign({ ref: provided.innerRef }, provided.draggableProps, provided.dragHandleProps, { style: __assign(__assign({}, provided.draggableProps.style), { marginBottom: 12 }) }),
204
+ react_1.default.createElement(AccountCard_1.default, { key: account.id, account: account, index: index, onDelete: onDelete, onOpen: onOpen, isExpanded: expanded[account.id], onToggleExpand: function () {
205
+ return toggleExpand(account.id, colId, index);
206
+ } }))); })); }),
207
+ provided.placeholder)))));
208
+ }));
209
+ })))));
122
210
  };
123
211
  exports.default = KanbanBoard;
@@ -38,4 +38,5 @@ export type KanbanBoardProps = {
38
38
  onCreate?: () => void;
39
39
  label?: string;
40
40
  };
41
+ virtualization?: boolean;
41
42
  };
@@ -0,0 +1,8 @@
1
+ import React from "react";
2
+ type MeasuredItemProps = {
3
+ index: number;
4
+ setSize: (index: number, size: number) => void;
5
+ children: React.ReactNode;
6
+ };
7
+ declare const MeasuredItem: React.FC<MeasuredItemProps>;
8
+ export default MeasuredItem;
@@ -0,0 +1,68 @@
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ Object.defineProperty(exports, "__esModule", { value: true });
26
+ var react_1 = __importStar(require("react"));
27
+ var MeasuredItem = function (_a) {
28
+ var index = _a.index, setSize = _a.setSize, children = _a.children;
29
+ var ref = (0, react_1.useRef)(null);
30
+ var prevHeight = (0, react_1.useRef)(null);
31
+ // measure function
32
+ var measure = function () {
33
+ if (ref.current) {
34
+ var height = Math.round(ref.current.getBoundingClientRect().height);
35
+ if (prevHeight.current !== height) {
36
+ prevHeight.current = height;
37
+ setSize(index, height);
38
+ }
39
+ }
40
+ };
41
+ (0, react_1.useLayoutEffect)(function () {
42
+ // initial measure
43
+ measure();
44
+ // ResizeObserver to capture any content changes (collapse/expand)
45
+ var ro;
46
+ if (typeof ResizeObserver !== "undefined") {
47
+ ro = new ResizeObserver(function () {
48
+ measure();
49
+ });
50
+ if (ref.current)
51
+ ro.observe(ref.current);
52
+ }
53
+ else {
54
+ // fallback: window resize
55
+ window.addEventListener("resize", measure);
56
+ }
57
+ return function () {
58
+ if (ro && ref.current)
59
+ ro.unobserve(ref.current);
60
+ if (!ro)
61
+ window.removeEventListener("resize", measure);
62
+ };
63
+ // We intentionally do not add children to deps to avoid extra runs; ResizeObserver catches updates.
64
+ // eslint-disable-next-line react-hooks/exhaustive-deps
65
+ }, [index, setSize]);
66
+ return react_1.default.createElement("div", { ref: ref }, children);
67
+ };
68
+ exports.default = MeasuredItem;
@@ -69,18 +69,18 @@ var normalizeMultiValue = function (val) {
69
69
  return [];
70
70
  };
71
71
  var SearchSelect = function (_a) {
72
- var _b, _c, _d, _e, _f, _g, _h;
73
- var id = _a.id, label = _a.label, options = _a.options, onSelect = _a.onSelect, onSearch = _a.onSearch, _j = _a.isOptionLoading, isOptionLoading = _j === void 0 ? false : _j, _k = _a.isLoading, isLoading = _k === void 0 ? false : _k, _l = _a.loadingText, loadingText = _l === void 0 ? 'Loading...' : _l, _m = _a.placeholder, placeholder = _m === void 0 ? 'Select' : _m, value = _a.value, _o = _a.searchQuery, searchQuery = _o === void 0 ? '' : _o, _p = _a.isMultiple, isMultiple = _p === void 0 ? false : _p, _q = _a.isRequired, isRequired = _q === void 0 ? false : _q, _r = _a.error, error = _r === void 0 ? false : _r, errorMessage = _a.errorMessage, helperText = _a.helperText, _s = _a.width, width = _s === void 0 ? '100%' : _s, _t = _a.height, height = _t === void 0 ? "2.75rem" : _t, _u = _a.size, size = _u === void 0 ? 'md' : _u, chip = _a.chip, information = _a.information, rightIcon = _a.rightIcon, addNew = _a.addNew, _v = _a.isSelectAll, isSelectAll = _v === void 0 ? false : _v, pagination = _a.pagination, insideSelect = _a.insideSelect, isRemoveAllIcon = _a.isRemoveAllIcon;
74
- var _w = (0, react_1.useState)(searchQuery), inputValue = _w[0], setInputValue = _w[1];
75
- var _x = (0, react_1.useState)(false), isOpen = _x[0], setIsOpen = _x[1];
76
- var _y = (0, react_1.useState)(true), hasMore = _y[0], setHasMore = _y[1];
72
+ var _b, _c, _d, _e, _f, _g, _h, _j;
73
+ var id = _a.id, label = _a.label, options = _a.options, onSelect = _a.onSelect, onSearch = _a.onSearch, _k = _a.isOptionLoading, isOptionLoading = _k === void 0 ? false : _k, _l = _a.isLoading, isLoading = _l === void 0 ? false : _l, _m = _a.loadingText, loadingText = _m === void 0 ? 'Loading...' : _m, _o = _a.placeholder, placeholder = _o === void 0 ? 'Select' : _o, value = _a.value, _p = _a.searchQuery, searchQuery = _p === void 0 ? '' : _p, _q = _a.isMultiple, isMultiple = _q === void 0 ? false : _q, _r = _a.isRequired, isRequired = _r === void 0 ? false : _r, _s = _a.error, error = _s === void 0 ? false : _s, errorMessage = _a.errorMessage, helperText = _a.helperText, _t = _a.width, width = _t === void 0 ? '100%' : _t, _u = _a.height, height = _u === void 0 ? "2.75rem" : _u, _v = _a.size, size = _v === void 0 ? 'md' : _v, chip = _a.chip, information = _a.information, rightIcon = _a.rightIcon, addNew = _a.addNew, _w = _a.isSelectAll, isSelectAll = _w === void 0 ? false : _w, pagination = _a.pagination, insideSelect = _a.insideSelect, isRemoveAllIcon = _a.isRemoveAllIcon;
74
+ var _x = (0, react_1.useState)(searchQuery), inputValue = _x[0], setInputValue = _x[1];
75
+ var _y = (0, react_1.useState)(false), isOpen = _y[0], setIsOpen = _y[1];
76
+ var _z = (0, react_1.useState)(true), hasMore = _z[0], setHasMore = _z[1];
77
77
  var inputRef = (0, react_1.useRef)(null);
78
78
  var containerRef = (0, react_1.useRef)(null);
79
79
  var scrollTimeoutRef = (0, react_1.useRef)(null);
80
- var _z = (0, react_1.useState)(false), focused = _z[0], setFocused = _z[1];
81
- var _0 = (0, react_1.useState)(false), customSelectOpen = _0[0], setCustomSelectOpen = _0[1];
80
+ var _0 = (0, react_1.useState)(false), focused = _0[0], setFocused = _0[1];
81
+ var _1 = (0, react_1.useState)(false), customSelectOpen = _1[0], setCustomSelectOpen = _1[1];
82
82
  var customSelectRef = (0, react_1.useRef)(null);
83
- var _1 = (0, react_1.useState)({ top: 0, left: 0, width: 0 }), customSelectPos = _1[0], setCustomSelectPos = _1[1];
83
+ var _2 = (0, react_1.useState)({ top: 0, left: 0, width: 0 }), customSelectPos = _2[0], setCustomSelectPos = _2[1];
84
84
  var theme = (0, useCustomTheme_1.useCustomTheme)();
85
85
  (0, react_2.useOutsideClick)({
86
86
  ref: containerRef,
@@ -203,13 +203,13 @@ var SearchSelect = function (_a) {
203
203
  return (react_1.default.createElement(react_2.Box, { ref: containerRef, width: width, position: "relative" },
204
204
  label && (react_1.default.createElement(FormLabel_1.TextLabel, { label: label, id: id, isRequired: isRequired, isInformation: information === null || information === void 0 ? void 0 : information.isInformation, informationMessage: information === null || information === void 0 ? void 0 : information.informationMessage })),
205
205
  react_1.default.createElement(react_2.InputGroup, { size: size },
206
- react_1.default.createElement(react_2.Box, { as: "div", w: "100%", minH: "2.85rem", px: 3, display: "flex", alignItems: "center", flexWrap: "wrap", gap: "0.375rem", border: "0.063rem solid", borderColor: error ? theme.colors.semantic.error[500] : focused ? theme.colors.primary[500] : (_b = theme.colors.boxborder) === null || _b === void 0 ? void 0 : _b[500], borderRadius: "0.25rem", bg: (_c = theme.colors.gray) === null || _c === void 0 ? void 0 : _c[50], boxShadow: focused ? error ? "0 0 0 0.125rem ".concat((_d = theme.colors.boxShadow) === null || _d === void 0 ? void 0 : _d.error) : "0 0 0 0.125rem ".concat((_e = theme.colors.boxShadow) === null || _e === void 0 ? void 0 : _e.primary) : 'none', transition: "box-shadow 0.2s, border-color 0.2s" },
206
+ react_1.default.createElement(react_2.Box, { as: "div", w: "100%", minH: "2.85rem", px: 3, display: "flex", alignItems: "center", flexWrap: "wrap", gap: "0.375rem", border: "0.063rem solid", borderColor: error ? theme.colors.semantic.error[500] : focused ? theme.colors.primary[500] : (_b = theme.colors.boxborder) === null || _b === void 0 ? void 0 : _b[500], borderRadius: "0.25rem", bg: (_c = theme.colors.gray) === null || _c === void 0 ? void 0 : _c[50], boxShadow: focused ? error ? "0 0 0 0.125rem ".concat((_d = theme.colors.boxShadow) === null || _d === void 0 ? void 0 : _d.error) : "0 0 0 0.125rem ".concat((_e = theme.colors.boxShadow) === null || _e === void 0 ? void 0 : _e.primary) : error ? "0 0 0 0.125rem ".concat((_f = theme.colors.boxShadow) === null || _f === void 0 ? void 0 : _f.error) : 'none', transition: "box-shadow 0.2s, border-color 0.2s" },
207
207
  insideSelect && (react_1.default.createElement(react_2.Box, { position: "relative", ref: customSelectRef, backgroundColor: theme.colors.gray[200], ml: "-0.75rem", h: "-webkit-fill-available", borderRadius: "0.25rem 0 0 0.25rem", onClick: function () { return setCustomSelectOpen(function (prev) { return !prev; }); } },
208
208
  react_1.default.createElement(react_2.Box, { minW: "5rem", cursor: "pointer", display: "flex", justifyContent: "space-between", alignItems: "center", width: insideSelect.width, height: height, pl: "0.5rem", pr: "0.5rem" },
209
- react_1.default.createElement(SelectTruncatedLabel_1.default, { label: (_g = (_f = insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.value) === null || _f === void 0 ? void 0 : _f.label) !== null && _g !== void 0 ? _g : "", maxWidth: (insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.width) || "6rem" }),
209
+ react_1.default.createElement(SelectTruncatedLabel_1.default, { label: (_h = (_g = insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.value) === null || _g === void 0 ? void 0 : _g.label) !== null && _h !== void 0 ? _h : "", maxWidth: (insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.width) || "6rem" }),
210
210
  customSelectOpen ? react_1.default.createElement(lucide_react_1.ChevronUp, { size: 16 }) : react_1.default.createElement(lucide_react_1.ChevronDown, { size: 16 })),
211
211
  customSelectOpen && (react_1.default.createElement(react_2.Portal, null,
212
- react_1.default.createElement(react_2.Box, { id: "custom-select-portal", position: "absolute", top: "".concat(customSelectPos.top, "px"), left: "".concat(customSelectPos.left, "px"), zIndex: 1400, bg: theme.colors.white, border: "0.063rem solid", borderColor: theme.colors.gray[300], borderRadius: "md", boxShadow: "md", minW: "10rem", maxW: "38rem" }, (_h = insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.option) === null || _h === void 0 ? void 0 : _h.map(function (item) { return (react_1.default.createElement(react_2.Box, { key: item.id, display: "flex", alignItems: "center", height: "2.5rem", px: "0.75rem", fontSize: "sm", _hover: { bg: theme.colors.gray[100] }, cursor: "pointer", onClick: function (e) {
212
+ react_1.default.createElement(react_2.Box, { id: "custom-select-portal", position: "absolute", top: "".concat(customSelectPos.top, "px"), left: "".concat(customSelectPos.left, "px"), zIndex: 1400, bg: theme.colors.white, border: "0.063rem solid", borderColor: theme.colors.gray[300], borderRadius: "md", boxShadow: "md", minW: "10rem", maxW: "38rem" }, (_j = insideSelect === null || insideSelect === void 0 ? void 0 : insideSelect.option) === null || _j === void 0 ? void 0 : _j.map(function (item) { return (react_1.default.createElement(react_2.Box, { key: item.id, display: "flex", alignItems: "center", height: "2.5rem", px: "0.75rem", fontSize: "sm", _hover: { bg: theme.colors.gray[100] }, cursor: "pointer", onClick: function (e) {
213
213
  e.stopPropagation();
214
214
  handleCustomSelect(item);
215
215
  } }, item.label)); })))))),
@@ -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, preferencesUrl, preferencesKey, preferencesName, preferencesPage, authToken, paginationMode, noOfRowsPerPage, totalRecords, onPagination, isTableSettings, headerActions, onGlobalSearch, }: TableProps): React.JSX.Element;
3
+ export default function Table({ data, columns, onSelection, isLoading, isCheckbox, headerBgColor, freezedBgColor, headerTextColor, freezedTextColor, tableBorderColor, noBorders, isPagination, onRowClick, selections, isActionFreeze, preferencesUrl, preferencesKey, preferencesName, preferencesPage, authToken, paginationMode, noOfRowsPerPage, totalRecords, onPagination, isTableSettings, headerActions, onGlobalSearch, onColumnFilter }: TableProps): React.JSX.Element;
@@ -34,7 +34,6 @@ var TableHeader_1 = __importDefault(require("./Components/TableHeader"));
34
34
  var TableBody_1 = __importDefault(require("./Components/TableBody"));
35
35
  var useCustomTheme_1 = require("../../Theme/useCustomTheme");
36
36
  var useTable_1 = __importDefault(require("./Components/useTable"));
37
- var table_1 = require("../../Utils/table");
38
37
  var usePreferences_1 = require("../../Hooks/usePreferences");
39
38
  var TableSettings_1 = __importDefault(require("./TableSettings/TableSettings"));
40
39
  var HeaderActions_1 = __importDefault(require("./Components/HeaderActions"));
@@ -42,9 +41,14 @@ var Divider_1 = __importDefault(require("../Divider/Divider"));
42
41
  var TableSearch_1 = __importDefault(require("./Components/TableSearch"));
43
42
  function Table(_a) {
44
43
  var _b, _c, _d, _e, _f, _g;
45
- var data = _a.data, columns = _a.columns, onSelection = _a.onSelection, isLoading = _a.isLoading, _h = _a.isCheckbox, isCheckbox = _h === void 0 ? false : _h, headerBgColor = _a.headerBgColor, freezedBgColor = _a.freezedBgColor, headerTextColor = _a.headerTextColor, freezedTextColor = _a.freezedTextColor, tableBorderColor = _a.tableBorderColor, _j = _a.noBorders, noBorders = _j === void 0 ? false : _j, _k = _a.isPagination, isPagination = _k === void 0 ? true : _k, onRowClick = _a.onRowClick, selections = _a.selections, _l = _a.isActionFreeze, isActionFreeze = _l === void 0 ? true : _l, _m = _a.preferencesUrl, preferencesUrl = _m === void 0 ? "" : _m, _o = _a.preferencesKey, preferencesKey = _o === void 0 ? "" : _o, _p = _a.preferencesName, preferencesName = _p === void 0 ? "" : _p, _q = _a.preferencesPage, preferencesPage = _q === void 0 ? "" : _q, _r = _a.authToken, authToken = _r === void 0 ? "" : _r, _s = _a.paginationMode, paginationMode = _s === void 0 ? "client" : _s, _t = _a.noOfRowsPerPage, noOfRowsPerPage = _t === void 0 ? 50 : _t, _u = _a.totalRecords, totalRecords = _u === void 0 ? 0 : _u, onPagination = _a.onPagination, _v = _a.isTableSettings, isTableSettings = _v === void 0 ? false : _v, headerActions = _a.headerActions, onGlobalSearch = _a.onGlobalSearch;
44
+ var data = _a.data, columns = _a.columns, onSelection = _a.onSelection, isLoading = _a.isLoading, _h = _a.isCheckbox, isCheckbox = _h === void 0 ? false : _h, headerBgColor = _a.headerBgColor, freezedBgColor = _a.freezedBgColor, headerTextColor = _a.headerTextColor, freezedTextColor = _a.freezedTextColor, tableBorderColor = _a.tableBorderColor, _j = _a.noBorders, noBorders = _j === void 0 ? false : _j, _k = _a.isPagination, isPagination = _k === void 0 ? true : _k, onRowClick = _a.onRowClick, selections = _a.selections, _l = _a.isActionFreeze, isActionFreeze = _l === void 0 ? true : _l, _m = _a.preferencesUrl, preferencesUrl = _m === void 0 ? "" : _m, _o = _a.preferencesKey, preferencesKey = _o === void 0 ? "" : _o, _p = _a.preferencesName, preferencesName = _p === void 0 ? "" : _p, _q = _a.preferencesPage, preferencesPage = _q === void 0 ? "" : _q, _r = _a.authToken, authToken = _r === void 0 ? "" : _r, _s = _a.paginationMode, paginationMode = _s === void 0 ? "client" : _s, _t = _a.noOfRowsPerPage, noOfRowsPerPage = _t === void 0 ? 50 : _t, _u = _a.totalRecords, totalRecords = _u === void 0 ? 0 : _u, onPagination = _a.onPagination, _v = _a.isTableSettings, isTableSettings = _v === void 0 ? false : _v, headerActions = _a.headerActions, onGlobalSearch = _a.onGlobalSearch, onColumnFilter = _a.onColumnFilter;
46
45
  var theme = (0, useCustomTheme_1.useCustomTheme)();
47
46
  var _w = (0, react_1.useState)({}), columnsSearch = _w[0], setColumnsSearch = _w[1];
47
+ (0, react_1.useEffect)(function () {
48
+ if (onColumnFilter) {
49
+ onColumnFilter(columnsSearch);
50
+ }
51
+ }, [columnsSearch, onColumnFilter]);
48
52
  var isServerPagination = paginationMode === "server";
49
53
  var _x = (0, usePreferences_1.useGetPreferences)({
50
54
  baseUrl: preferencesUrl,
@@ -82,9 +86,9 @@ function Table(_a) {
82
86
  totalRecords: totalRecords,
83
87
  isServerPagination: isServerPagination,
84
88
  }), tableData = _y.tableData, isContent = _y.isContent, isLink = _y.isLink, headerRefs = _y.headerRefs, columnWidths = _y.columnWidths, handleSort = _y.handleSort, handleCheckbox = _y.handleCheckbox, filteredData = _y.filteredData, startRow = _y.startRow, endRow = _y.endRow, selection = _y.selection, columnsSort = _y.columnsSort, currentPage = _y.currentPage, pages = _y.pages, rowsPerPage = _y.rowsPerPage, handlePageSizeChange = _y.handlePageSizeChange, setCurrentPage = _y.setCurrentPage, columnsList = _y.columnsList, handleColumnPreferences = _y.handleColumnPreferences;
85
- var _filteredData = (0, react_1.useMemo)(function () {
86
- return (0, table_1.searchAndSortData)(filteredData, columnsSearch);
87
- }, [columnsSearch, filteredData]);
89
+ // const _filteredData = useMemo(() => {
90
+ // return searchAndSortData(filteredData, columnsSearch);
91
+ // }, [columnsSearch, filteredData]);
88
92
  (0, react_1.useEffect)(function () {
89
93
  if (onPagination) {
90
94
  onPagination(currentPage + 1, noOfRowsPerPage);
@@ -124,6 +128,6 @@ function Table(_a) {
124
128
  ? false
125
129
  : "indeterminate", isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze, setColumnsSearch: setColumnsSearch, columnsSearch: columnsSearch })),
126
130
  react_1.default.createElement(react_3.Tbody, null,
127
- react_1.default.createElement(TableBody_1.default, { data: _filteredData, columns: columnsList, startRow: startRow, endRow: endRow, isCheckbox: isCheckbox, columnWidths: columnWidths, noBorders: noBorders, freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.gray[600], handleCheckbox: handleCheckbox, selections: selection, isLoading: isTableLoading, onRowClick: onRowClick, isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze }))))));
131
+ react_1.default.createElement(TableBody_1.default, { data: filteredData, columns: columnsList, startRow: startRow, endRow: endRow, isCheckbox: isCheckbox, columnWidths: columnWidths, noBorders: noBorders, freezedBgColor: freezedBgColor !== null && freezedBgColor !== void 0 ? freezedBgColor : theme.colors.backgroundColor.secondary, freezedTextColor: freezedTextColor !== null && freezedTextColor !== void 0 ? freezedTextColor : (_g = theme.colors) === null || _g === void 0 ? void 0 : _g.gray[600], handleCheckbox: handleCheckbox, selections: selection, isLoading: isTableLoading, onRowClick: onRowClick, isContent: isContent, isLink: isLink, isActionFreeze: isActionFreeze }))))));
128
132
  }
129
133
  exports.default = Table;
@@ -31,6 +31,7 @@ export type TableProps = {
31
31
  isTableSettings?: boolean;
32
32
  headerActions?: HeaderActionsProps;
33
33
  onGlobalSearch?: (searchVal: string) => void;
34
+ onColumnFilter?: (filters: Record<string, any>) => void;
34
35
  };
35
36
  export type HeaderActionsProps = {
36
37
  isDelete?: {
@@ -5,117 +5,57 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  var react_1 = __importDefault(require("react"));
7
7
  var KanbanBoard_1 = __importDefault(require("../Components/KanbanBoard/KanbanBoard"));
8
+ var createItems = function (count, prefix) {
9
+ return Array.from({ length: count }, function (_, i) { return ({
10
+ id: "".concat(prefix, "-").concat(i),
11
+ rating: "Acquired",
12
+ name: "".concat(prefix, " Item ").concat(i),
13
+ // owner: `Owner ${i}`,
14
+ // site: "Demo",
15
+ // details: "Additional details here...",
16
+ // location: i % 2 === 0 ? "Chennai" : "Bangalore",
17
+ // status: i % 3 === 0 ? "Pending" : "Completed",
18
+ }); });
19
+ };
8
20
  var initialData = {
9
21
  acquired: {
10
22
  id: "acquired",
11
23
  title: "Acquired",
12
24
  color: "#9A4FE5",
13
- items: [
14
- {
15
- id: "1",
16
- rating: "Acquired",
17
- name: "1",
18
- owner: "Mathew John and so",
19
- site: "Demo",
20
- details: "Additional details here...",
21
- location: "Chennai",
22
- status: "Pending",
23
- },
24
- ],
25
+ items: createItems(1000, "acq"), // 👈 1000 records
25
26
  },
26
27
  active: {
27
- id: "requetsed",
28
+ id: "requested",
28
29
  title: "Requested",
29
30
  color: "#4CAF50",
30
- items: [
31
- {
32
- id: "2",
33
- rating: "Acquired",
34
- name: "1",
35
- owner: "Mathew John",
36
- site: "Demo",
37
- details: "Additional details here...",
38
- location: "Bangalore",
39
- status: "Completed",
40
- },
41
- ],
42
- },
43
- active2: {
44
- id: "done",
45
- title: "Done",
46
- color: "#4CfF50",
47
- items: [
48
- {
49
- id: "33",
50
- rating: "Done",
51
- name: "1",
52
- owner: "Mathew John",
53
- site: "Demo",
54
- details: "Additional details here...",
55
- location: "Mumbai",
56
- status: "In Progress",
57
- },
58
- ],
31
+ items: createItems(4, "req"), // 👈 800 records
59
32
  },
60
- active3: {
61
- id: "done",
62
- title: "Done",
33
+ closed: {
34
+ id: "closed",
35
+ title: "close",
63
36
  color: "#4CfF50",
64
- items: [
65
- {
66
- id: "332",
67
- rating: "Done",
68
- name: "1",
69
- owner: "Mathew John",
70
- site: "Demo",
71
- details: "Additional details here...",
72
- location: "Mumbai",
73
- status: "In Progress",
74
- },
75
- ],
37
+ items: createItems(3, "cls"),
76
38
  },
77
- active4: {
78
- id: "done",
79
- title: "Done",
39
+ open: {
40
+ id: "open",
41
+ title: "Open",
80
42
  color: "#4CfF50",
81
- items: [
82
- {
83
- id: "3322",
84
- rating: "Done",
85
- name: "1",
86
- owner: "Mathew John",
87
- site: "Demo",
88
- details: "Additional details here...",
89
- location: "Mumbai",
90
- status: "In Progress",
91
- },
92
- ],
43
+ items: createItems(5, "OP"),
93
44
  },
94
- active5: {
45
+ done: {
95
46
  id: "done",
96
47
  title: "Done",
97
48
  color: "#4CfF50",
98
- items: [
99
- {
100
- id: "332e2",
101
- rating: "Done",
102
- name: "1",
103
- owner: "Mathew John",
104
- site: "Demo",
105
- details: "Additional details here...",
106
- location: "Mumbai",
107
- status: "In Progress",
108
- },
109
- ],
49
+ items: createItems(6, "done"), // 👈 600 records
110
50
  },
111
51
  };
112
52
  var viewListData = [
113
53
  {
114
- "view_id": 5,
115
- "type": "contact",
116
- "viewName": "status",
117
- "groupBy": "Lead Source",
118
- "selectedField": [
54
+ view_id: 5,
55
+ type: "contact",
56
+ viewName: "status",
57
+ groupBy: "Lead Source",
58
+ selectedField: [
119
59
  "contact_owner",
120
60
  "first_name",
121
61
  "last_name",
@@ -139,18 +79,18 @@ var viewListData = [
139
79
  "other_zip",
140
80
  "other_country",
141
81
  "fax",
142
- "description"
82
+ "description",
143
83
  ],
144
- "moduleId": null,
145
- "created_at": 1756720852175,
146
- "updated_at": 1756720852175
84
+ moduleId: null,
85
+ created_at: 1756720852175,
86
+ updated_at: 1756720852175,
147
87
  },
148
88
  {
149
- "view_id": 4,
150
- "type": "contact",
151
- "viewName": "demo",
152
- "groupBy": "Lead Source",
153
- "selectedField": [
89
+ view_id: 4,
90
+ type: "contact",
91
+ viewName: "demo",
92
+ groupBy: "Lead Source",
93
+ selectedField: [
154
94
  "contact_owner",
155
95
  "first_name",
156
96
  "last_name",
@@ -174,18 +114,18 @@ var viewListData = [
174
114
  "other_zip",
175
115
  "other_country",
176
116
  "fax",
177
- "description"
117
+ "description",
178
118
  ],
179
- "moduleId": null,
180
- "created_at": 1756720474429,
181
- "updated_at": 1756720474429
119
+ moduleId: null,
120
+ created_at: 1756720474429,
121
+ updated_at: 1756720474429,
182
122
  },
183
123
  {
184
- "view_id": 2,
185
- "type": "contact",
186
- "viewName": "kanabana",
187
- "groupBy": "Lead Source",
188
- "selectedField": [
124
+ view_id: 2,
125
+ type: "contact",
126
+ viewName: "kanabana",
127
+ groupBy: "Lead Source",
128
+ selectedField: [
189
129
  "contact_owner",
190
130
  "first_name",
191
131
  "last_name",
@@ -209,15 +149,15 @@ var viewListData = [
209
149
  "other_zip",
210
150
  "other_country",
211
151
  "fax",
212
- "description"
152
+ "description",
213
153
  ],
214
- "moduleId": null,
215
- "created_at": 1756457931264,
216
- "updated_at": 1756457931264
217
- }
154
+ moduleId: null,
155
+ created_at: 1756457931264,
156
+ updated_at: 1756457931264,
157
+ },
218
158
  ];
219
159
  var KanbanBoardExample = function () {
220
- return (react_1.default.createElement(KanbanBoard_1.default, { data: initialData, onDelete: function (item) { return console.log("Delete", item); }, onOpen: function (item) { return console.log("Open", item); }, onDrag: function (updatedColumns) { return console.log("New State", updatedColumns); }, onColumnDelete: function (updatedColumns) { return console.log("New Del", updatedColumns); }, isLoading: false, kanbanCreate: {
160
+ return (react_1.default.createElement(KanbanBoard_1.default, { data: initialData, onDelete: function (item) { return console.log("Delete", item); }, onOpen: function (item) { return console.log("Open", item); }, onDrag: function (updatedColumns) { return console.log("New State", updatedColumns); }, onColumnDelete: function (updatedColumns) { return console.log("New Del", updatedColumns); }, isLoading: false, virtualization: true, kanbanCreate: {
221
161
  isCreatable: true,
222
162
  onCreate: function () { },
223
163
  }, kanbanEdit: {
@@ -75,6 +75,7 @@ var react_1 = __importStar(require("react"));
75
75
  var SearchSelect_1 = __importDefault(require("../Components/SearchSelect/SearchSelect"));
76
76
  // import { Plus } from "lucide-react";
77
77
  var react_2 = require("@chakra-ui/react");
78
+ var TextInput_1 = __importDefault(require("../Components/Input/TextInput"));
78
79
  var max = 149;
79
80
  var rrr = function (start, limit) {
80
81
  var end = Math.min(start + limit, max + 1); // +1 to include `max` as valid
@@ -102,7 +103,7 @@ var SearchSelect = function () {
102
103
  }, onSearch: function (query) { return setSearch(query); }, searchQuery: search, isOptionLoading: false, placeholder: "Search users...", chip: {
103
104
  maxChips: 3,
104
105
  onClick: function () { return console.log("chip removed"); },
105
- }, isSelectAll: true, pagination: {
106
+ }, isSelectAll: true, isRequired: true, pagination: {
106
107
  limit: 50,
107
108
  scrollLoading: paginationLoading,
108
109
  onScroll: function (startIndex, limit, query) { return __awaiter(void 0, void 0, void 0, function () {
@@ -179,6 +180,40 @@ var SearchSelect = function () {
179
180
  "label": "Hariharan Jeganathan",
180
181
  }
181
182
  ]
182
- } })));
183
+ } }),
184
+ react_1.default.createElement("br", null),
185
+ react_1.default.createElement("br", null),
186
+ react_1.default.createElement("br", null),
187
+ react_1.default.createElement(TextInput_1.default, { label: "My Label", id: "input1", name: "hello",
188
+ //helperText="Hello"
189
+ // errorMessage="Required"
190
+ // error={true}
191
+ type: "email",
192
+ // inputRightIcon={<User color="#FF0000" />}
193
+ // onRightIconclick={() => {
194
+ // console.log("icon click");
195
+ // }}
196
+ // inputLeftIcon={<User color="#FF0000" />}
197
+ // onLeftIconClick={() => {
198
+ // console.log("icon click");
199
+ // }}
200
+ key: "input1",
201
+ // border={"0px solid"}
202
+ // padding={"0px"}
203
+ // inputStyle={{ border: "0px solid", padding: "0px" }}
204
+ // inputGroupStyle={{ border: "0px solid", padding: "0px" }}
205
+ // error={true}
206
+ // errorMessage="Required"
207
+ onChange: function (e) {
208
+ console.log(e.target.files);
209
+ }, onKeyDown: function () {
210
+ console.log("keydown");
211
+ }, onBlur: function () {
212
+ console.log("blur");
213
+ },
214
+ // helperText="sometibg"
215
+ isRequired: true, informationMessage: "This is information", isInformation: true,
216
+ // isDisabled
217
+ minW: "200px", maxW: "300px" })));
183
218
  };
184
219
  exports.default = SearchSelect;
@@ -172,6 +172,6 @@ var column = [
172
172
  ];
173
173
  var TableExample = function () {
174
174
  return (react_1.default.createElement("div", null,
175
- react_1.default.createElement(Table_1.default, { columns: column, data: tableData, isCheckbox: true, isVisiblity: false, isLoading: false, noBorders: false, onSelection: function (checked) { return console.log(checked); }, onRowClick: function (row, header) { return console.log(row, header); }, isPagination: false, isTableSettings: true, onGlobalSearch: function (value) { return console.log(value, "searched"); } })));
175
+ react_1.default.createElement(Table_1.default, { columns: column, data: tableData, isCheckbox: true, isVisiblity: false, isLoading: false, noBorders: false, onSelection: function (checked) { return console.log(checked); }, onRowClick: function (row, header) { return console.log(row, header); }, isPagination: false, isTableSettings: true, onGlobalSearch: function (value) { return console.log(value, "searched"); }, onColumnFilter: function (filters) { return console.log(filters, "all column filters"); } })));
176
176
  };
177
177
  exports.TableExample = TableExample;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "2.1.64",
3
+ "version": "2.1.66",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",