pixelize-design-library 2.2.190 → 2.2.191
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Editor/Editor.d.ts +1 -2
- package/dist/Components/Editor/Editor.js +5 -39
- package/dist/Components/KanbanBoard/AccountCard.d.ts +2 -2
- package/dist/Components/KanbanBoard/AccountCard.js +4 -37
- package/dist/Components/KanbanBoard/KanbanBoard.js +35 -72
- package/dist/Components/MultiSelect/MultiSelect.js +19 -10
- package/dist/Components/SearchSelect/SearchSelect.js +16 -23
- package/dist/Components/Table/Components/ActiveFilters.js +25 -66
- package/dist/Components/Table/Components/Pagination.d.ts +1 -1
- package/dist/Components/Table/Components/Pagination.js +9 -41
- package/dist/Components/Table/Components/TableFilters.js +5 -11
- package/dist/Components/Table/Components/useTable.js +24 -36
- package/package.json +1 -1
- package/coverage/clover.xml +0 -638
- package/coverage/coverage-final.json +0 -20
- package/coverage/lcov-report/Table/CompactSelect.tsx.html +0 -379
- package/coverage/lcov-report/Table/Components/ActiveFilters.tsx.html +0 -514
- package/coverage/lcov-report/Table/Components/HeaderActions.tsx.html +0 -373
- package/coverage/lcov-report/Table/Components/Pagination.tsx.html +0 -574
- package/coverage/lcov-report/Table/Components/TableActions.tsx.html +0 -574
- package/coverage/lcov-report/Table/Components/TableBody.tsx.html +0 -1027
- package/coverage/lcov-report/Table/Components/TableFilters.tsx.html +0 -397
- package/coverage/lcov-report/Table/Components/TableHeader.tsx.html +0 -1060
- package/coverage/lcov-report/Table/Components/TableLoading.tsx.html +0 -361
- package/coverage/lcov-report/Table/Components/TableSearch.tsx.html +0 -337
- package/coverage/lcov-report/Table/Components/index.html +0 -266
- package/coverage/lcov-report/Table/Components/useDebounce.ts.html +0 -178
- package/coverage/lcov-report/Table/Components/useTable.ts.html +0 -778
- package/coverage/lcov-report/Table/LeftFilterPane.tsx.html +0 -1810
- package/coverage/lcov-report/Table/SelectOperationControls.tsx.html +0 -178
- package/coverage/lcov-report/Table/Table.tsx.html +0 -1567
- package/coverage/lcov-report/Table/TableProps.tsx.html +0 -658
- package/coverage/lcov-report/Table/TableSettings/ManageColumns.tsx.html +0 -619
- package/coverage/lcov-report/Table/TableSettings/TableFilters.tsx.html +0 -229
- package/coverage/lcov-report/Table/TableSettings/TableSettings.tsx.html +0 -532
- package/coverage/lcov-report/Table/TableSettings/index.html +0 -146
- package/coverage/lcov-report/Table/TableToDo.tsx.html +0 -973
- package/coverage/lcov-report/Table/TextOperationControls.tsx.html +0 -271
- package/coverage/lcov-report/Table/filterTypes.ts.html +0 -97
- package/coverage/lcov-report/Table/index.html +0 -176
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -146
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -210
- package/coverage/lcov.info +0 -1836
- package/debug-storybook.log +0 -72
- package/dist/Assets/defaultLogo.tsx +0 -31
- package/dist/Theme/Dark/palette.d.ts +0 -370
- package/dist/Theme/Dark/palette.js +0 -372
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
var react_1 = __importStar(require("react"));
|
|
37
37
|
var react_2 = require("@chakra-ui/react");
|
|
38
|
+
var table_1 = require("../../../Utils/table");
|
|
38
39
|
var lucide_react_1 = require("lucide-react");
|
|
39
40
|
var TableFilters = (0, react_1.memo)(function (_a) {
|
|
40
41
|
var _b, _c;
|
|
@@ -42,16 +43,9 @@ var TableFilters = (0, react_1.memo)(function (_a) {
|
|
|
42
43
|
var theme = (0, react_2.useTheme)();
|
|
43
44
|
var searchRef = (0, react_1.useRef)(null);
|
|
44
45
|
var _d = (0, react_1.useState)(false), refreshDataOnOpen = _d[0], setRefreshDataOnOpen = _d[1];
|
|
45
|
-
var
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
var debouncedSearch = (0, react_1.useCallback)(function (value) {
|
|
49
|
-
if (debounceTimerRef.current)
|
|
50
|
-
clearTimeout(debounceTimerRef.current);
|
|
51
|
-
debounceTimerRef.current = setTimeout(function () {
|
|
52
|
-
setColumnsSearchRef.current(value);
|
|
53
|
-
}, 700);
|
|
54
|
-
}, []);
|
|
46
|
+
var debounceRef = (0, table_1.debounce)(function (value) {
|
|
47
|
+
setColumnsSearch(value);
|
|
48
|
+
}, 700);
|
|
55
49
|
(0, react_1.useEffect)(function () {
|
|
56
50
|
if (columnsSearch.length && searchRef.current) {
|
|
57
51
|
searchRef.current.value = columnsSearch;
|
|
@@ -83,7 +77,7 @@ var TableFilters = (0, react_1.memo)(function (_a) {
|
|
|
83
77
|
react_1.default.createElement(react_2.Icon, { as: lucide_react_1.Search, color: "gray.400", boxSize: 4 })),
|
|
84
78
|
react_1.default.createElement(react_2.Input, { autoFocus: true, placeholder: "Search ".concat(header.label, "..."), size: "xs", ref: searchRef, onChange: function (e) {
|
|
85
79
|
e.stopPropagation();
|
|
86
|
-
|
|
80
|
+
debounceRef(e.target.value);
|
|
87
81
|
}, onFocus: function (e) { return e.stopPropagation(); } })))))));
|
|
88
82
|
});
|
|
89
83
|
exports.default = TableFilters;
|
|
@@ -38,15 +38,14 @@ var mergeColumnWithPreference = function (pref, originalCol) {
|
|
|
38
38
|
return next;
|
|
39
39
|
};
|
|
40
40
|
var useTable = function (_a) {
|
|
41
|
-
var _b, _c;
|
|
42
41
|
var tableBorderColor = _a.tableBorderColor, data = _a.data, isPagination = _a.isPagination, selections = _a.selections, onSelection = _a.onSelection, tablePreferences = _a.tablePreferences, savePreferences = _a.savePreferences, noOfRowsPerPage = _a.noOfRowsPerPage, isServerPagination = _a.isServerPagination, totalRecords = _a.totalRecords, columns = _a.columns, onNoOfRowsPerPageChange = _a.onNoOfRowsPerPageChange, defaultVisibleColumns = _a.defaultVisibleColumns;
|
|
43
42
|
var theme = (0, useCustomTheme_1.useCustomTheme)();
|
|
44
43
|
var headerRefs = (0, react_1.useRef)([]);
|
|
45
|
-
var
|
|
46
|
-
var
|
|
47
|
-
var
|
|
48
|
-
var
|
|
49
|
-
var
|
|
44
|
+
var _b = (0, react_1.useState)([]), columnWidths = _b[0], setColumnWidths = _b[1];
|
|
45
|
+
var _c = (0, react_1.useState)(selections !== null && selections !== void 0 ? selections : []), selection = _c[0], setSelection = _c[1];
|
|
46
|
+
var _d = (0, react_1.useState)([]), columnsSort = _d[0], setColumnsSort = _d[1];
|
|
47
|
+
var _e = (0, react_1.useState)(0), currentPage = _e[0], setCurrentPage = _e[1];
|
|
48
|
+
var _f = (0, react_1.useState)(noOfRowsPerPage !== null && noOfRowsPerPage !== void 0 ? noOfRowsPerPage : defaultPageSize), rowsPerPage = _f[0], setRowsPerPage = _f[1];
|
|
50
49
|
var prevRowsPerPageProp = (0, react_1.useRef)(noOfRowsPerPage);
|
|
51
50
|
if (noOfRowsPerPage !== prevRowsPerPageProp.current) {
|
|
52
51
|
prevRowsPerPageProp.current = noOfRowsPerPage;
|
|
@@ -55,12 +54,12 @@ var useTable = function (_a) {
|
|
|
55
54
|
}
|
|
56
55
|
}
|
|
57
56
|
var tableData = data;
|
|
58
|
-
var
|
|
57
|
+
var _g = (0, react_1.useState)(function () {
|
|
59
58
|
return columns.map(function (col, i) {
|
|
60
59
|
var _a;
|
|
61
60
|
return (__assign(__assign({}, col), { isHidden: defaultVisibleColumns ? i >= defaultVisibleColumns : ((_a = col.isHidden) !== null && _a !== void 0 ? _a : false) }));
|
|
62
61
|
});
|
|
63
|
-
}), columnsList =
|
|
62
|
+
}), columnsList = _g[0], setColumnsList = _g[1];
|
|
64
63
|
(0, react_1.useEffect)(function () {
|
|
65
64
|
var _a;
|
|
66
65
|
var columnPreference = (_a = tablePreferences === null || tablePreferences === void 0 ? void 0 : tablePreferences.columns) !== null && _a !== void 0 ? _a : [];
|
|
@@ -91,18 +90,8 @@ var useTable = function (_a) {
|
|
|
91
90
|
overflowY: "auto",
|
|
92
91
|
});
|
|
93
92
|
}, [tableBorderColor, theme]);
|
|
94
|
-
var
|
|
95
|
-
var
|
|
96
|
-
var isContent = (0, react_1.useMemo)(function () {
|
|
97
|
-
var result = tableData.some(function (o) { return o.content; });
|
|
98
|
-
prevIsContent.current = result;
|
|
99
|
-
return result;
|
|
100
|
-
}, [tableData.length === 0 ? 0 : (_b = tableData[0]) === null || _b === void 0 ? void 0 : _b.id, tableData.length]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
101
|
-
var isLink = (0, react_1.useMemo)(function () {
|
|
102
|
-
var result = tableData.some(function (o) { return o.onLink || o.onDelete || o.onEdit; });
|
|
103
|
-
prevIsLink.current = result;
|
|
104
|
-
return result;
|
|
105
|
-
}, [tableData.length === 0 ? 0 : (_c = tableData[0]) === null || _c === void 0 ? void 0 : _c.id, tableData.length]); // eslint-disable-line react-hooks/exhaustive-deps
|
|
93
|
+
var isContent = (0, react_1.useMemo)(function () { return tableData.some(function (o) { return o.content; }); }, [tableData]);
|
|
94
|
+
var isLink = (0, react_1.useMemo)(function () { return tableData.some(function (o) { return o.onLink || o.onDelete || o.onEdit; }); }, [tableData]);
|
|
106
95
|
(0, react_1.useEffect)(function () {
|
|
107
96
|
var widths = headerRefs.current.map(function (ref) { return (ref === null || ref === void 0 ? void 0 : ref.offsetWidth) || 0; });
|
|
108
97
|
setColumnWidths(widths);
|
|
@@ -139,25 +128,24 @@ var useTable = function (_a) {
|
|
|
139
128
|
var handleSort = (0, react_1.useCallback)(function (field, sort) {
|
|
140
129
|
if (!sort)
|
|
141
130
|
return;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}, []);
|
|
131
|
+
var newSortState = __spreadArray([], columnsSort, true);
|
|
132
|
+
var existingIndex = newSortState.findIndex(function (sort) { return sort.column === field; });
|
|
133
|
+
if (existingIndex === -1) {
|
|
134
|
+
newSortState.push({
|
|
135
|
+
column: field,
|
|
136
|
+
direction: "asc", // Default to ascending when adding a column
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
var existingSort = newSortState[existingIndex];
|
|
141
|
+
existingSort.direction = sort;
|
|
142
|
+
}
|
|
143
|
+
setColumnsSort(newSortState);
|
|
144
|
+
}, [columnsSort]);
|
|
157
145
|
(0, react_1.useEffect)(function () {
|
|
158
146
|
setSelection(selections !== null && selections !== void 0 ? selections : []);
|
|
159
147
|
}, [selections]);
|
|
160
|
-
var
|
|
148
|
+
var _h = (0, react_1.useState)(false), isSelecting = _h[0], setIsSelecting = _h[1];
|
|
161
149
|
var selectionRef = (0, react_1.useRef)(selection);
|
|
162
150
|
selectionRef.current = selection;
|
|
163
151
|
var onSelectionRef = (0, react_1.useRef)(onSelection);
|