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.
Files changed (53) hide show
  1. package/dist/Components/Editor/Editor.d.ts +1 -2
  2. package/dist/Components/Editor/Editor.js +5 -39
  3. package/dist/Components/KanbanBoard/AccountCard.d.ts +2 -2
  4. package/dist/Components/KanbanBoard/AccountCard.js +4 -37
  5. package/dist/Components/KanbanBoard/KanbanBoard.js +35 -72
  6. package/dist/Components/MultiSelect/MultiSelect.js +19 -10
  7. package/dist/Components/SearchSelect/SearchSelect.js +16 -23
  8. package/dist/Components/Table/Components/ActiveFilters.js +25 -66
  9. package/dist/Components/Table/Components/Pagination.d.ts +1 -1
  10. package/dist/Components/Table/Components/Pagination.js +9 -41
  11. package/dist/Components/Table/Components/TableFilters.js +5 -11
  12. package/dist/Components/Table/Components/useTable.js +24 -36
  13. package/package.json +1 -1
  14. package/coverage/clover.xml +0 -638
  15. package/coverage/coverage-final.json +0 -20
  16. package/coverage/lcov-report/Table/CompactSelect.tsx.html +0 -379
  17. package/coverage/lcov-report/Table/Components/ActiveFilters.tsx.html +0 -514
  18. package/coverage/lcov-report/Table/Components/HeaderActions.tsx.html +0 -373
  19. package/coverage/lcov-report/Table/Components/Pagination.tsx.html +0 -574
  20. package/coverage/lcov-report/Table/Components/TableActions.tsx.html +0 -574
  21. package/coverage/lcov-report/Table/Components/TableBody.tsx.html +0 -1027
  22. package/coverage/lcov-report/Table/Components/TableFilters.tsx.html +0 -397
  23. package/coverage/lcov-report/Table/Components/TableHeader.tsx.html +0 -1060
  24. package/coverage/lcov-report/Table/Components/TableLoading.tsx.html +0 -361
  25. package/coverage/lcov-report/Table/Components/TableSearch.tsx.html +0 -337
  26. package/coverage/lcov-report/Table/Components/index.html +0 -266
  27. package/coverage/lcov-report/Table/Components/useDebounce.ts.html +0 -178
  28. package/coverage/lcov-report/Table/Components/useTable.ts.html +0 -778
  29. package/coverage/lcov-report/Table/LeftFilterPane.tsx.html +0 -1810
  30. package/coverage/lcov-report/Table/SelectOperationControls.tsx.html +0 -178
  31. package/coverage/lcov-report/Table/Table.tsx.html +0 -1567
  32. package/coverage/lcov-report/Table/TableProps.tsx.html +0 -658
  33. package/coverage/lcov-report/Table/TableSettings/ManageColumns.tsx.html +0 -619
  34. package/coverage/lcov-report/Table/TableSettings/TableFilters.tsx.html +0 -229
  35. package/coverage/lcov-report/Table/TableSettings/TableSettings.tsx.html +0 -532
  36. package/coverage/lcov-report/Table/TableSettings/index.html +0 -146
  37. package/coverage/lcov-report/Table/TableToDo.tsx.html +0 -973
  38. package/coverage/lcov-report/Table/TextOperationControls.tsx.html +0 -271
  39. package/coverage/lcov-report/Table/filterTypes.ts.html +0 -97
  40. package/coverage/lcov-report/Table/index.html +0 -176
  41. package/coverage/lcov-report/base.css +0 -224
  42. package/coverage/lcov-report/block-navigation.js +0 -87
  43. package/coverage/lcov-report/favicon.png +0 -0
  44. package/coverage/lcov-report/index.html +0 -146
  45. package/coverage/lcov-report/prettify.css +0 -1
  46. package/coverage/lcov-report/prettify.js +0 -2
  47. package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  48. package/coverage/lcov-report/sorter.js +0 -210
  49. package/coverage/lcov.info +0 -1836
  50. package/debug-storybook.log +0 -72
  51. package/dist/Assets/defaultLogo.tsx +0 -31
  52. package/dist/Theme/Dark/palette.d.ts +0 -370
  53. 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 setColumnsSearchRef = (0, react_1.useRef)(setColumnsSearch);
46
- setColumnsSearchRef.current = setColumnsSearch;
47
- var debounceTimerRef = (0, react_1.useRef)(null);
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
- debouncedSearch(e.target.value);
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 _d = (0, react_1.useState)([]), columnWidths = _d[0], setColumnWidths = _d[1];
46
- var _e = (0, react_1.useState)(selections !== null && selections !== void 0 ? selections : []), selection = _e[0], setSelection = _e[1];
47
- var _f = (0, react_1.useState)([]), columnsSort = _f[0], setColumnsSort = _f[1];
48
- var _g = (0, react_1.useState)(0), currentPage = _g[0], setCurrentPage = _g[1];
49
- var _h = (0, react_1.useState)(noOfRowsPerPage !== null && noOfRowsPerPage !== void 0 ? noOfRowsPerPage : defaultPageSize), rowsPerPage = _h[0], setRowsPerPage = _h[1];
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 _j = (0, react_1.useState)(function () {
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 = _j[0], setColumnsList = _j[1];
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 prevIsContent = (0, react_1.useRef)(false);
95
- var prevIsLink = (0, react_1.useRef)(false);
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
- setColumnsSort(function (prev) {
143
- var newSortState = __spreadArray([], prev, true);
144
- var existingIndex = newSortState.findIndex(function (s) { return s.column === field; });
145
- if (existingIndex === -1) {
146
- newSortState.push({
147
- column: field,
148
- direction: "asc",
149
- });
150
- }
151
- else {
152
- newSortState[existingIndex] = __assign(__assign({}, newSortState[existingIndex]), { direction: sort });
153
- }
154
- return newSortState;
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 _k = (0, react_1.useState)(false), isSelecting = _k[0], setIsSelecting = _k[1];
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pixelize-design-library",
3
- "version": "2.2.190",
3
+ "version": "2.2.191",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",