pixelize-design-library 2.3.9 → 2.3.10
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/.cursor/plans/current.md +8 -11
- package/coverage/clover.xml +317 -1525
- package/coverage/coverage-final.json +15 -48
- package/coverage/lcov-report/Components/Button/Button.tsx.html +5 -5
- package/coverage/lcov-report/Components/Button/index.html +5 -5
- package/coverage/lcov-report/Components/Common/ErrorMessage.tsx.html +16 -16
- package/coverage/lcov-report/Components/Common/FormLabel.tsx.html +23 -23
- package/coverage/lcov-report/Components/Common/HelperText.tsx.html +14 -14
- package/coverage/lcov-report/Components/Common/index.html +41 -41
- package/coverage/lcov-report/Components/Divider/Divider.tsx.html +14 -14
- package/coverage/lcov-report/Components/Divider/index.html +17 -17
- package/coverage/lcov-report/Components/Header/HeaderActions.tsx.html +26 -26
- package/coverage/lcov-report/Components/Header/index.html +21 -21
- package/coverage/lcov-report/Components/Input/index.html +21 -36
- package/coverage/lcov-report/Components/Input/textInputIconSize.ts.html +20 -20
- package/coverage/lcov-report/Components/KanbanBoard/AccountCard.tsx.html +14 -14
- package/coverage/lcov-report/Components/KanbanBoard/AccountRow.tsx.html +4 -4
- package/coverage/lcov-report/Components/KanbanBoard/KanbanBoard.tsx.html +220 -103
- package/coverage/lcov-report/Components/KanbanBoard/MeasuredItem.tsx.html +48 -48
- package/coverage/lcov-report/Components/KanbanBoard/index.html +31 -31
- package/coverage/lcov-report/Components/Select/Select.tsx.html +33 -33
- package/coverage/lcov-report/Components/Select/index.html +21 -21
- package/coverage/lcov-report/Components/SideBar/components/OverflowTooltipText.tsx.html +19 -19
- package/coverage/lcov-report/Components/SideBar/components/index.html +6 -21
- package/coverage/lcov-report/Components/ToolTip/ToolTip.tsx.html +5 -5
- package/coverage/lcov-report/Components/ToolTip/index.html +5 -5
- package/coverage/lcov-report/Utils/functions.ts.html +3 -3
- package/coverage/lcov-report/Utils/index.html +8 -23
- package/coverage/lcov-report/index.html +86 -311
- package/coverage/lcov.info +739 -4097
- package/dist/Components/KanbanBoard/KanbanBoard.d.ts.map +1 -1
- package/dist/Components/KanbanBoard/KanbanBoard.js +38 -1
- package/dist/Components/Table/Table.d.ts.map +1 -1
- package/dist/Components/Table/Table.js +9 -3
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KanbanBoard.d.ts","sourceRoot":"","sources":["../../../src/Components/KanbanBoard/KanbanBoard.tsx"],"names":[],"mappings":"AAqCA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,oBAAoB,CAAC;AAqH5B,QAAA,MAAM,WAAW,GAAI,0TA4BlB,gBAAgB,
|
|
1
|
+
{"version":3,"file":"KanbanBoard.d.ts","sourceRoot":"","sources":["../../../src/Components/KanbanBoard/KanbanBoard.tsx"],"names":[],"mappings":"AAqCA,OAAO,EAEL,gBAAgB,EAEjB,MAAM,oBAAoB,CAAC;AAqH5B,QAAA,MAAM,WAAW,GAAI,0TA4BlB,gBAAgB,mDAs9BlB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -132,20 +132,37 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
|
|
|
132
132
|
const [expanded, setExpanded] = (0, react_1.useState)({});
|
|
133
133
|
/** When true, column id maps to collapsed (body hidden). */
|
|
134
134
|
const [collapsedColumns, setCollapsedColumns] = (0, react_1.useState)(() => ({ ...defaultCollapsedColumns }));
|
|
135
|
+
const hasHydratedCollapsedFromPrefs = (0, react_1.useRef)(false);
|
|
136
|
+
(0, react_1.useEffect)(() => {
|
|
137
|
+
hasHydratedCollapsedFromPrefs.current = false;
|
|
138
|
+
}, [
|
|
139
|
+
preferences.baseurl,
|
|
140
|
+
preferences.page,
|
|
141
|
+
preferences.key,
|
|
142
|
+
preferences.name,
|
|
143
|
+
]);
|
|
135
144
|
(0, react_1.useEffect)(() => {
|
|
136
145
|
if (!enableColumnCollapse || !preferences.baseurl || preferencesLoading) {
|
|
137
146
|
return;
|
|
138
147
|
}
|
|
148
|
+
if (hasHydratedCollapsedFromPrefs.current) {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
const validIds = new Set(Object.keys(mergedColumns));
|
|
152
|
+
if (validIds.size === 0) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
139
155
|
if (!("collapsedColumns" in kanbanPreferencesJson)) {
|
|
156
|
+
hasHydratedCollapsedFromPrefs.current = true;
|
|
140
157
|
return;
|
|
141
158
|
}
|
|
142
159
|
const saved = kanbanPreferencesJson.collapsedColumns;
|
|
143
160
|
if (saved === null ||
|
|
144
161
|
typeof saved !== "object" ||
|
|
145
162
|
Array.isArray(saved)) {
|
|
163
|
+
hasHydratedCollapsedFromPrefs.current = true;
|
|
146
164
|
return;
|
|
147
165
|
}
|
|
148
|
-
const validIds = new Set(Object.keys(mergedColumns));
|
|
149
166
|
const next = {};
|
|
150
167
|
for (const [k, v] of Object.entries(saved)) {
|
|
151
168
|
if (validIds.has(k) && typeof v === "boolean") {
|
|
@@ -156,6 +173,7 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
|
|
|
156
173
|
...defaultCollapsedColumns,
|
|
157
174
|
...next,
|
|
158
175
|
});
|
|
176
|
+
hasHydratedCollapsedFromPrefs.current = true;
|
|
159
177
|
}, [
|
|
160
178
|
enableColumnCollapse,
|
|
161
179
|
preferences.baseurl,
|
|
@@ -164,6 +182,25 @@ const KanbanBoard = ({ data, customColumns, customizeColumn, onDrag, onDelete, o
|
|
|
164
182
|
mergedColumns,
|
|
165
183
|
defaultCollapsedColumns,
|
|
166
184
|
]);
|
|
185
|
+
(0, react_1.useEffect)(() => {
|
|
186
|
+
if (!enableColumnCollapse) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const validIds = new Set(Object.keys(mergedColumns));
|
|
190
|
+
setCollapsedColumns((prev) => {
|
|
191
|
+
const hasStale = Object.keys(prev).some((k) => !validIds.has(k));
|
|
192
|
+
if (!hasStale) {
|
|
193
|
+
return prev;
|
|
194
|
+
}
|
|
195
|
+
const pruned = {};
|
|
196
|
+
for (const [k, v] of Object.entries(prev)) {
|
|
197
|
+
if (validIds.has(k)) {
|
|
198
|
+
pruned[k] = v;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
return pruned;
|
|
202
|
+
});
|
|
203
|
+
}, [mergedColumns, enableColumnCollapse]);
|
|
167
204
|
const toggleColumnCollapsed = (0, react_1.useCallback)((colId) => {
|
|
168
205
|
setCollapsedColumns((prev) => {
|
|
169
206
|
const collapsed = !prev[colId];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/Components/Table/Table.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAkC,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB1E,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,IAAI,EACJ,OAAO,EACP,WAAW,EACX,SAAS,EACT,UAAkB,EAClB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,SAAiB,EACjB,YAAmB,EACnB,UAAU,EACV,UAAU,EACV,cAAqB,EACrB,WAOC,EACD,cAAyB,EACzB,cAAsB,EACtB,OAAO,EACP,aAAqB,EACrB,aAAqB,EACrB,YAA0B,EAC1B,gBAAwB,EACxB,iBAAiB,EACjB,eAAoB,EACpB,YAAgB,EAChB,YAAY,EACZ,eAAuB,EACvB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,OAAkB,EAClB,MAAM,EACN,WAAW,EACX,SAAS,EACT,UAAU,EACV,SAAS,GAEV,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"Table.d.ts","sourceRoot":"","sources":["../../../src/Components/Table/Table.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAkC,UAAU,EAAE,MAAM,cAAc,CAAC;AAuB1E,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,IAAI,EACJ,OAAO,EACP,WAAW,EACX,SAAS,EACT,UAAkB,EAClB,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,gBAAgB,EAChB,SAAiB,EACjB,YAAmB,EACnB,UAAU,EACV,UAAU,EACV,cAAqB,EACrB,WAOC,EACD,cAAyB,EACzB,cAAsB,EACtB,OAAO,EACP,aAAqB,EACrB,aAAqB,EACrB,YAA0B,EAC1B,gBAAwB,EACxB,iBAAiB,EACjB,eAAoB,EACpB,YAAgB,EAChB,YAAY,EACZ,eAAuB,EACvB,aAAa,EACb,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,cAAc,EACd,cAAc,EACd,cAAc,EACd,eAAe,EACf,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,qBAAqB,EACrB,OAAkB,EAClB,MAAM,EACN,WAAW,EACX,SAAS,EACT,UAAU,EACV,SAAS,GAEV,EAAE,UAAU,2CAuwBZ"}
|
|
@@ -91,6 +91,7 @@ function Table({ data, columns, onSelection, isLoading, isCheckbox = false, head
|
|
|
91
91
|
// Grouping is chosen by the user in Table Settings > Group and persisted to
|
|
92
92
|
// preferences (`json.groupBy`); there is no `groupBy` prop.
|
|
93
93
|
const [groupByState, setGroupByState] = (0, react_1.useState)(undefined);
|
|
94
|
+
const [isPaginationPopoverOpen, setIsPaginationPopoverOpen] = (0, react_1.useState)(false);
|
|
94
95
|
// Grouped "Load more" accumulates pages here so loading more ADDS rows to the
|
|
95
96
|
// groups (server pagination replaces `data` each fetch). Reset on fresh loads
|
|
96
97
|
// (search / filter / sort / page-size). Only used in grouped + groupLoadMore mode.
|
|
@@ -311,6 +312,11 @@ function Table({ data, columns, onSelection, isLoading, isCheckbox = false, head
|
|
|
311
312
|
const fittedMaxH = autoFitViewport ? Math.min(dynamicMaxH, viewportAvailableH) : dynamicMaxH;
|
|
312
313
|
const tableMaxH = typeof tableMaxHeight === "number" ? tableMaxHeight : (isCompactRows ? rowsHeight + 8 : fittedMaxH);
|
|
313
314
|
const isCompactHeader = (0, react_2.useBreakpointValue)({ base: true, md: true, lg: false });
|
|
315
|
+
(0, react_1.useEffect)(() => {
|
|
316
|
+
if (!isCompactHeader) {
|
|
317
|
+
setIsPaginationPopoverOpen(false);
|
|
318
|
+
}
|
|
319
|
+
}, [isCompactHeader]);
|
|
314
320
|
const compactScrollbarPadding = isCompactRows ? 4 : 0;
|
|
315
321
|
// Infinite scroll: reuse onPagination("next") when scrolled near the bottom.
|
|
316
322
|
const infiniteRef = (0, react_1.useRef)({ isLoadingMore, isTableLoading, hasMore, rowsPerPage, dataLen: tableData.length, lastRecord: tableData[tableData.length - 1], totalRecords, isServerPagination });
|
|
@@ -383,9 +389,9 @@ function Table({ data, columns, onSelection, isLoading, isCheckbox = false, head
|
|
|
383
389
|
animation: isRefreshing
|
|
384
390
|
? "pixelize-table-spin 1s linear infinite"
|
|
385
391
|
: "none"
|
|
386
|
-
}, children: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { size: 16 }) }) })] })), headerActions && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Divider_1.default, {}), (0, jsx_runtime_1.jsx)(HeaderActions_1.default, { actions: headerActions, selections: selection })] })), (0, jsx_runtime_1.jsx)(ActiveFilters_1.default, { columns: columnsList, columnsSearch: columnsSearch, setColumnsSearch: setColumnsSearch }), (0, jsx_runtime_1.jsxs)(react_2.Box, { ml: "auto", display: "flex", alignItems: "center", gap: 2, children: [groupLoadMoreActive && loadMorePosition === "top" && (groupLoadMoreCaption || canGroupLoadMore) && ((0, jsx_runtime_1.jsxs)(react_2.Box, { display: "flex", alignItems: "center", gap: 2, flex: "0 0 auto", children: [groupLoadMoreCaption && ((0, jsx_runtime_1.jsx)(react_2.Box, { fontSize: "0.75rem", color: (_y = (_x = theme.colors) === null || _x === void 0 ? void 0 : _x.text) === null || _y === void 0 ? void 0 : _y[500], whiteSpace: "nowrap", children: groupLoadMoreCaption })), canGroupLoadMore && ((0, jsx_runtime_1.jsx)(Button_1.default, { size: "xs", variant: "outline", colorScheme: "gray", isLoading: isLoadingMore, loadingText: loadMoreText, onClick: handleGroupLoadMore, label: loadMoreText }))] })), (isPagination || isServerPagination) && !isGrouped && !canInfinite && !isCompactHeader && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }) })), (isPagination || isServerPagination) && !isGrouped && !canInfinite && isCompactHeader && tableData.length > 0 && ((0, jsx_runtime_1.jsxs)(react_2.Popover, { placement: "bottom-end", children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsx)(
|
|
387
|
-
|
|
388
|
-
|
|
392
|
+
}, children: (0, jsx_runtime_1.jsx)(lucide_react_1.RefreshCw, { size: 16 }) }) })] })), headerActions && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(Divider_1.default, {}), (0, jsx_runtime_1.jsx)(HeaderActions_1.default, { actions: headerActions, selections: selection })] })), (0, jsx_runtime_1.jsx)(ActiveFilters_1.default, { columns: columnsList, columnsSearch: columnsSearch, setColumnsSearch: setColumnsSearch }), (0, jsx_runtime_1.jsxs)(react_2.Box, { ml: "auto", display: "flex", alignItems: "center", gap: 2, children: [groupLoadMoreActive && loadMorePosition === "top" && (groupLoadMoreCaption || canGroupLoadMore) && ((0, jsx_runtime_1.jsxs)(react_2.Box, { display: "flex", alignItems: "center", gap: 2, flex: "0 0 auto", children: [groupLoadMoreCaption && ((0, jsx_runtime_1.jsx)(react_2.Box, { fontSize: "0.75rem", color: (_y = (_x = theme.colors) === null || _x === void 0 ? void 0 : _x.text) === null || _y === void 0 ? void 0 : _y[500], whiteSpace: "nowrap", children: groupLoadMoreCaption })), canGroupLoadMore && ((0, jsx_runtime_1.jsx)(Button_1.default, { size: "xs", variant: "outline", colorScheme: "gray", isLoading: isLoadingMore, loadingText: loadMoreText, onClick: handleGroupLoadMore, label: loadMoreText }))] })), (isPagination || isServerPagination) && !isGrouped && !canInfinite && !isCompactHeader && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }) })), (isPagination || isServerPagination) && !isGrouped && !canInfinite && isCompactHeader && tableData.length > 0 && ((0, jsx_runtime_1.jsxs)(react_2.Popover, { isOpen: isPaginationPopoverOpen, onClose: () => setIsPaginationPopoverOpen(false), placement: "bottom-end", children: [(0, jsx_runtime_1.jsx)(react_2.PopoverTrigger, { children: (0, jsx_runtime_1.jsx)(react_2.IconButton, { "aria-label": "Pagination", size: "sm", variant: "ghost", icon: (0, jsx_runtime_1.jsx)(lucide_react_1.EllipsisVertical, { size: 18 }), color: (_0 = (_z = theme.colors) === null || _z === void 0 ? void 0 : _z.text) === null || _0 === void 0 ? void 0 : _0[500], _hover: {
|
|
393
|
+
color: (_2 = (_1 = theme.colors) === null || _1 === void 0 ? void 0 : _1.primary) === null || _2 === void 0 ? void 0 : _2[500],
|
|
394
|
+
}, onClick: () => setIsPaginationPopoverOpen((open) => !open) }) }), (0, jsx_runtime_1.jsx)(react_2.Portal, { children: (0, jsx_runtime_1.jsx)(react_2.PopoverContent, { maxW: "22rem", p: 2, zIndex: 1600, bg: "white", boxShadow: "lg", children: (0, jsx_runtime_1.jsx)(react_2.PopoverBody, { p: 0, children: (0, jsx_runtime_1.jsx)(Pagination_1.default, { columns: columns, currentPage: currentPage, setCurrentPage: setCurrentPage, rowsPerPage: rowsPerPage, pages: pages, paginationText: tablePaginationText, handlePageSizeChange: handlePageSizeChange, dataLength: tableData.length, isServerPagination: isServerPagination, paginationSelectOptions: paginationSelectOptions, isVisiblity: true }) }) }) })] }))] })] }), (0, jsx_runtime_1.jsxs)(react_2.TableContainer, { ref: tableContainerRef, position: "relative", h: isTableLoading ? tableMaxH : undefined, maxH: !isTableLoading ? tableMaxH : undefined, pb: isTableLoading ? 0 : compactScrollbarPadding, overflowY: isCompactRows ? "hidden" : "auto", overflowX: "auto", sx: {
|
|
389
395
|
'&::-webkit-scrollbar': {
|
|
390
396
|
width: '6px',
|
|
391
397
|
height: isCompactRows ? '0px' : '6px',
|