blixify-ui-web 1.2.63 → 1.2.65

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 (86) hide show
  1. package/lib/components/action/radioList/index.d.ts +1 -0
  2. package/lib/components/action/radioList/index.d.ts.map +1 -1
  3. package/lib/components/action/radioList/index.js +16 -8
  4. package/lib/components/action/radioList/index.js.map +1 -1
  5. package/lib/components/advanced/popUp/index.d.ts +2 -0
  6. package/lib/components/advanced/popUp/index.d.ts.map +1 -1
  7. package/lib/components/advanced/popUp/index.js +1 -1
  8. package/lib/components/advanced/popUp/index.js.map +1 -1
  9. package/lib/components/data/dataTemplate/dataStateModel.d.ts +1 -0
  10. package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
  11. package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
  12. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  13. package/lib/components/data/dataTemplate/index.js +360 -311
  14. package/lib/components/data/dataTemplate/index.js.map +1 -1
  15. package/lib/components/data/dataTemplate/model.d.ts +3 -2
  16. package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
  17. package/lib/components/data/dataTemplate/pagination.js +1 -1
  18. package/lib/components/data/dataTemplate/pagination.js.map +1 -1
  19. package/lib/components/data/dataWrapper/index.d.ts.map +1 -1
  20. package/lib/components/data/dataWrapper/index.js +3 -3
  21. package/lib/components/data/dataWrapper/index.js.map +1 -1
  22. package/lib/components/data/flexFilter/index.d.ts +6 -2
  23. package/lib/components/data/flexFilter/index.d.ts.map +1 -1
  24. package/lib/components/data/flexFilter/index.js +31 -27
  25. package/lib/components/data/flexFilter/index.js.map +1 -1
  26. package/lib/components/data/updateModule.d.ts +5 -0
  27. package/lib/components/data/updateModule.d.ts.map +1 -1
  28. package/lib/components/data/updateModule.js +43 -30
  29. package/lib/components/data/updateModule.js.map +1 -1
  30. package/lib/components/display/detailList/index.d.ts +1 -0
  31. package/lib/components/display/detailList/index.d.ts.map +1 -1
  32. package/lib/components/display/detailList/index.js +7 -3
  33. package/lib/components/display/detailList/index.js.map +1 -1
  34. package/lib/components/display/drawer/index.d.ts +2 -0
  35. package/lib/components/display/drawer/index.d.ts.map +1 -1
  36. package/lib/components/display/drawer/index.js +7 -2
  37. package/lib/components/display/drawer/index.js.map +1 -1
  38. package/lib/components/display/modal/index.d.ts +1 -0
  39. package/lib/components/display/modal/index.d.ts.map +1 -1
  40. package/lib/components/display/modal/index.js +6 -4
  41. package/lib/components/display/modal/index.js.map +1 -1
  42. package/lib/components/display/newCalendar/index.d.ts.map +1 -1
  43. package/lib/components/display/newCalendar/index.js +61 -27
  44. package/lib/components/display/newCalendar/index.js.map +1 -1
  45. package/lib/components/display/newFeeds/index.d.ts +2 -0
  46. package/lib/components/display/newFeeds/index.d.ts.map +1 -1
  47. package/lib/components/display/newFeeds/index.js +7 -7
  48. package/lib/components/display/newFeeds/index.js.map +1 -1
  49. package/lib/components/display/newKanban/index.d.ts.map +1 -1
  50. package/lib/components/display/newKanban/index.js +53 -17
  51. package/lib/components/display/newKanban/index.js.map +1 -1
  52. package/lib/components/display/newList/index.d.ts.map +1 -1
  53. package/lib/components/display/newList/index.js +11 -64
  54. package/lib/components/display/newList/index.js.map +1 -1
  55. package/lib/components/display/newPagination/index.d.ts +23 -0
  56. package/lib/components/display/newPagination/index.d.ts.map +1 -0
  57. package/lib/components/display/newPagination/index.js +69 -0
  58. package/lib/components/display/newPagination/index.js.map +1 -0
  59. package/lib/components/display/newTable/index.d.ts.map +1 -1
  60. package/lib/components/display/newTable/index.js +54 -199
  61. package/lib/components/display/newTable/index.js.map +1 -1
  62. package/lib/components/index.d.ts +1 -0
  63. package/lib/components/index.d.ts.map +1 -1
  64. package/lib/components/index.js +4 -2
  65. package/lib/components/index.js.map +1 -1
  66. package/lib/components/input/checkbox/index.d.ts.map +1 -1
  67. package/lib/components/input/checkbox/index.js +5 -1
  68. package/lib/components/input/checkbox/index.js.map +1 -1
  69. package/lib/components/input/datePicker/index.d.ts.map +1 -1
  70. package/lib/components/input/datePicker/index.js +12 -6
  71. package/lib/components/input/datePicker/index.js.map +1 -1
  72. package/lib/components/input/select/index.d.ts.map +1 -1
  73. package/lib/components/input/select/index.js +64 -17
  74. package/lib/components/input/select/index.js.map +1 -1
  75. package/lib/components/input/textArea/index.d.ts.map +1 -1
  76. package/lib/components/input/textArea/index.js +3 -1
  77. package/lib/components/input/textArea/index.js.map +1 -1
  78. package/lib/components/input/textInput/index.d.ts.map +1 -1
  79. package/lib/components/input/textInput/index.js +11 -4
  80. package/lib/components/input/textInput/index.js.map +1 -1
  81. package/lib/components/input/uploadInput/index.js +1 -1
  82. package/lib/components/input/uploadInput/index.js.map +1 -1
  83. package/lib/components/navigation/tabs/index.js +1 -1
  84. package/lib/components/navigation/tabs/index.js.map +1 -1
  85. package/lib/tail.css +2 -2
  86. package/package.json +1 -1
@@ -89,6 +89,7 @@ var solid_3 = require("@heroicons/react/20/solid");
89
89
  var outline_1 = require("@heroicons/react/24/outline");
90
90
  var react_1 = require("@headlessui/react");
91
91
  var axios_1 = __importDefault(require("axios"));
92
+ var newPagination_1 = require("../newPagination");
92
93
  var react_2 = __importStar(require("react"));
93
94
  var collapse_1 = require("../../advanced/collapse");
94
95
  var popUp_1 = require("../../advanced/popUp");
@@ -162,15 +163,6 @@ var handleCheckModalEditEmpty = function (value) {
162
163
  // (tag/utils.ts) so a column's listSelectionColour drives both the chip in the
163
164
  // read view and the solid fill in the table. Yellow gets dark text — white on
164
165
  // yellow-500 fails contrast.
165
- var FILL_CLASS = {
166
- default: "bg-primary-500 text-white",
167
- red: "bg-red-500 text-white",
168
- blue: "bg-blue-500 text-white",
169
- green: "bg-green-500 text-white",
170
- yellow: "bg-yellow-400 text-yellow-950",
171
- indigo: "bg-indigo-500 text-white",
172
- dark: "bg-gray-800 text-white",
173
- };
174
166
  // INFO: group band (tinted) and the accent bar its member rows carry
175
167
  var BAND_CLASS = {
176
168
  default: "bg-primary-50 text-primary-800 border-primary-500",
@@ -205,10 +197,9 @@ var handleGetListColour = function (col, value) {
205
197
  return column.listSelectionColour[index] || undefined;
206
198
  };
207
199
  var NewTable = function (props) {
208
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
200
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
209
201
  var columns = (_b = (_a = props.columns) !== null && _a !== void 0 ? _a : props.header) !== null && _b !== void 0 ? _b : [];
210
202
  var defaultLimit = 10;
211
- var defaultPageSize = 5;
212
203
  // INFO: flatten groupData columns so both mobile and desktop share the same
213
204
  // resolved column list — groupData parent becomes individual sub-columns.
214
205
  // Also filters out id/_id columns unless showId is explicitly enabled.
@@ -254,19 +245,19 @@ var NewTable = function (props) {
254
245
  flatColumns.length = 0;
255
246
  flatColumns.push.apply(flatColumns, __spreadArray(__spreadArray(__spreadArray([], leftCols, false), middleCols, false), rightCols, false));
256
247
  }
257
- var _v = (0, react_2.useState)(props.fixedPagination ? true : false), isFixed = _v[0], setIsFixed = _v[1];
248
+ var _w = (0, react_2.useState)(props.fixedPagination ? true : false), isFixed = _w[0], setIsFixed = _w[1];
258
249
  //=====================================================================================
259
250
  // SECTION: Advanced Settings
260
251
  //=====================================================================================
261
- var _w = (0, react_2.useState)(""), filterModal = _w[0], setFilterModal = _w[1];
262
- var _x = (0, react_2.useState)(""), addColumnModal = _x[0], setAddColumnModal = _x[1];
252
+ var _x = (0, react_2.useState)(""), filterModal = _x[0], setFilterModal = _x[1];
253
+ var _y = (0, react_2.useState)(""), addColumnModal = _y[0], setAddColumnModal = _y[1];
263
254
  //=====================================================================================
264
255
  // SECTION: Editable & Addable cells
265
256
  //=====================================================================================
266
- var _y = (0, react_2.useState)(""), editDataRowId = _y[0], setEditDataRowId = _y[1];
267
- var _z = (0, react_2.useState)(""), editDataHeaderKey = _z[0], setEditDataHeaderKey = _z[1];
268
- var _0 = (0, react_2.useState)(false), modalEditVisible = _0[0], setModalEditVisible = _0[1];
269
- var _1 = (0, react_2.useState)([]), collapsedGroupIds = _1[0], setCollapsedGroupIds = _1[1];
257
+ var _z = (0, react_2.useState)(""), editDataRowId = _z[0], setEditDataRowId = _z[1];
258
+ var _0 = (0, react_2.useState)(""), editDataHeaderKey = _0[0], setEditDataHeaderKey = _0[1];
259
+ var _1 = (0, react_2.useState)(false), modalEditVisible = _1[0], setModalEditVisible = _1[1];
260
+ var _2 = (0, react_2.useState)([]), collapsedGroupIds = _2[0], setCollapsedGroupIds = _2[1];
270
261
  // INFO: sheet-style row selection — Shift-click extends from the last
271
262
  // clicked row, a mouse-down-and-drag down the checkbox column paints a
272
263
  // range. The drag applies the start row itself, so the click that lands on
@@ -274,32 +265,8 @@ var NewTable = function (props) {
274
265
  var lastSelectedRowRef = (0, react_2.useRef)(null);
275
266
  var dragSelectRef = (0, react_2.useRef)(null);
276
267
  var suppressNextClickRef = (0, react_2.useRef)(false);
277
- var _2 = (0, react_2.useState)(false), isDragSelecting = _2[0], setIsDragSelecting = _2[1];
278
- var _3 = (0, react_2.useState)(0), copiedCount = _3[0], setCopiedCount = _3[1];
279
- // INFO: the open colour palette for a filled list cell — which cell, and
280
- // where to anchor the popover (viewport coordinates, so it escapes the
281
- // table's overflow container)
282
- var _4 = (0, react_2.useState)(null), paletteCell = _4[0], setPaletteCell = _4[1];
283
- (0, react_2.useEffect)(function () {
284
- if (!paletteCell)
285
- return;
286
- var handleClose = function () { return setPaletteCell(null); };
287
- var handleKey = function (e) {
288
- if (e.key === "Escape")
289
- setPaletteCell(null);
290
- };
291
- // INFO: no scroll listener — opening the palette can itself scroll the
292
- // table (the row switches to edit mode and its first input takes focus),
293
- // and closing on that scroll would shut the palette as it appears
294
- document.addEventListener("mousedown", handleClose);
295
- document.addEventListener("keydown", handleKey);
296
- window.addEventListener("resize", handleClose);
297
- return function () {
298
- document.removeEventListener("mousedown", handleClose);
299
- document.removeEventListener("keydown", handleKey);
300
- window.removeEventListener("resize", handleClose);
301
- };
302
- }, [paletteCell]);
268
+ var _3 = (0, react_2.useState)(false), isDragSelecting = _3[0], setIsDragSelecting = _3[1];
269
+ var _4 = (0, react_2.useState)(0), copiedCount = _4[0], setCopiedCount = _4[1];
303
270
  var _5 = (0, react_2.useState)({}), editDataValue = _5[0], setEditDataValue = _5[1];
304
271
  var _6 = (0, react_2.useState)(false), editDataIsLoading = _6[0], setEditDataIsLoading = _6[1];
305
272
  var _7 = (0, react_2.useState)(false), addData = _7[0], setAddData = _7[1];
@@ -331,7 +298,7 @@ var NewTable = function (props) {
331
298
  : "bg-white";
332
299
  var borderRadius = "rounded-2xl";
333
300
  var borderColor = props.darkMode ? "border-gray-700" : "border-gray-100";
334
- var selectedRowBg = props.darkMode ? "bg-primary-900" : "bg-primary-50";
301
+ var selectedRowBg = props.darkMode ? "bg-gray-700" : "bg-primary-50";
335
302
  var rowHoverBg = props.darkMode ? "hover:bg-gray-700" : "hover:bg-gray-100";
336
303
  var dividerColor = props.darkMode ? "divide-gray-700" : "divide-gray-100";
337
304
  var cellFontColor = props.darkMode ? "text-gray-200" : "text-gray-700";
@@ -445,10 +412,13 @@ var NewTable = function (props) {
445
412
  return false;
446
413
  return filtered.every(function (col) { return !col.type || utils_1.supportedTableAddList.includes(col.type); });
447
414
  };
415
+ // INFO: a list column with a palette edits through the ordinary Select, whose
416
+ // options render as the same coloured tags — one dropdown for every cell
417
+ var handleColumnShowsTags = function (col) { var _a; return ((_a = col.type) !== null && _a !== void 0 ? _a : "string") === "list" && !!col.listSelectionColour; };
448
418
  var handleConvertColumnToDataStructure = function (cols) {
449
419
  return cols.map(function (col) {
450
420
  var _a;
451
- return (__assign(__assign({}, col), { id: col.key, name: col.title, type: (_a = col.type) !== null && _a !== void 0 ? _a : "string" }));
421
+ return (__assign(__assign({}, col), { id: col.key, name: col.title, type: (_a = col.type) !== null && _a !== void 0 ? _a : "string", showTagSelections: handleColumnShowsTags(col) }));
452
422
  });
453
423
  };
454
424
  var handleCreateFormInputRefs = function (type) {
@@ -762,7 +732,7 @@ var NewTable = function (props) {
762
732
  (0, react_2.useEffect)(function () {
763
733
  var _a, _b;
764
734
  var hasSelection = props.selectAll || ((_b = (_a = props.selectedIds) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0;
765
- if (!hasSelection || paletteCell)
735
+ if (!hasSelection)
766
736
  return;
767
737
  var handleKey = function (e) {
768
738
  var _a, _b;
@@ -774,7 +744,7 @@ var NewTable = function (props) {
774
744
  };
775
745
  document.addEventListener("keydown", handleKey);
776
746
  return function () { return document.removeEventListener("keydown", handleKey); };
777
- }, [props.selectAll, props.selectedIds, paletteCell]);
747
+ }, [props.selectAll, props.selectedIds]);
778
748
  // INFO: visible columns of the selected rows as TSV — header row first —
779
749
  // so a paste into Excel or Sheets lands one value per cell
780
750
  var handleCopySelection = function () { return __awaiter(void 0, void 0, void 0, function () {
@@ -1048,7 +1018,7 @@ var NewTable = function (props) {
1048
1018
  };
1049
1019
  var renderEditDataInputs = function (colIndex, col, rowData, rowId, rowBgClass, isHoverable) {
1050
1020
  var _a, _b, _c, _d;
1051
- var tempDS = __assign(__assign({}, col), { id: col.key, name: col.title, type: (_a = col.type) !== null && _a !== void 0 ? _a : "string" });
1021
+ var tempDS = __assign(__assign({}, col), { id: col.key, name: col.title, type: (_a = col.type) !== null && _a !== void 0 ? _a : "string", showTagSelections: handleColumnShowsTags(col) });
1052
1022
  var editingRow = editDataRowId === rowId;
1053
1023
  return (react_2.default.createElement("td", { key: col.key + String(colIndex),
1054
1024
  // INFO: pinned columns use whitespace-normal so text wraps within the fixed width
@@ -1144,7 +1114,7 @@ var NewTable = function (props) {
1144
1114
  return react_2.default.createElement(react_2.default.Fragment, null);
1145
1115
  return (react_2.default.createElement("div", { className: "flex items-center" },
1146
1116
  renderCheckbox(renderCheckAllSelected() || ((_b = props.selectAll) !== null && _b !== void 0 ? _b : false), function () { return handleSelectCurrentPage(renderCheckAllSelected()); }, undefined, "mr-1"),
1147
- !props.disableSelectFullData && (react_2.default.createElement(popUp_1.PopUp, { anchor: "left", lib: { Transition: react_1.Transition }, ctaComp: react_2.default.createElement(solid_1.ChevronDownIcon, { className: "h-4 w-4 ".concat(cellFontColor, " cursor-pointer"), "aria-hidden": "true" }), renderComp: react_2.default.createElement("div", { className: "border rounded ".concat(borderColor, " ").concat(props.darkMode ? "bg-gray-800" : "bg-white") },
1117
+ !props.disableSelectFullData && (react_2.default.createElement(popUp_1.PopUp, { anchor: "left", darkMode: props.darkMode, darkModeBg: props.darkModeBg, lib: { Transition: react_1.Transition }, ctaComp: react_2.default.createElement(solid_1.ChevronDownIcon, { className: "h-4 w-4 ".concat(cellFontColor, " cursor-pointer"), "aria-hidden": "true" }), renderComp: react_2.default.createElement("div", { className: "border rounded ".concat(borderColor, " ").concat(props.darkMode ? "bg-gray-800" : "bg-white") },
1148
1118
  react_2.default.createElement("p", { className: "px-4 py-3 text-xs ".concat(cellFontColor, " text-left whitespace-nowrap font-medium hover:cursor-pointer ").concat(props.darkMode ? "hover:bg-gray-700" : "hover:bg-gray-100"), onClick: function () { return handleSelectAllPages(true); } }, "Select all pages"),
1149
1119
  react_2.default.createElement("p", { className: "px-4 py-3 text-xs ".concat(cellFontColor, " text-left whitespace-nowrap font-medium hover:cursor-pointer ").concat(props.darkMode ? "hover:bg-gray-700" : "hover:bg-gray-100"), onClick: function () { return handleSelectAllPages(false); } }, "Unselect all pages")) }))));
1150
1120
  };
@@ -1184,7 +1154,7 @@ var NewTable = function (props) {
1184
1154
  }, className: "group ".concat(isSelected
1185
1155
  ? selectedRowBg
1186
1156
  : props.onClickRow
1187
- ? "cursor-pointer ".concat(rowHoverBg)
1157
+ ? "cursor-pointer ".concat(isSelected ? "" : rowHoverBg)
1188
1158
  : editDataIsLoading && editDataRowId === row.id
1189
1159
  ? "animate-pulse"
1190
1160
  : "", " ").concat(groupAccent
@@ -1202,7 +1172,7 @@ var NewTable = function (props) {
1202
1172
  ? "opacity-50 cursor-not-allowed"
1203
1173
  : ""))),
1204
1174
  flatColumns.map(function (col, colIndex) {
1205
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
1175
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1206
1176
  var cellValue = spaceRow
1207
1177
  ? spaceRow[col.key]
1208
1178
  : resolveValue(row, col.key);
@@ -1218,8 +1188,7 @@ var NewTable = function (props) {
1218
1188
  !!props.onObjectEdit;
1219
1189
  var isEditable = ((_d = props.editable) === null || _d === void 0 ? void 0 : _d.active) &&
1220
1190
  !isActionColumn &&
1221
- !(((_f = (_e = props.selectedIds) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0) > 0 ||
1222
- props.selectAll) &&
1191
+ !(((_f = (_e = props.selectedIds) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0) > 0 || props.selectAll) &&
1223
1192
  utils_1.supportedInlineEditList.includes(resolvedColType);
1224
1193
  var rowData = editDataRowId === row.id ? editDataValue : row;
1225
1194
  // INFO: a list column with a palette paints the whole cell —
@@ -1229,25 +1198,20 @@ var NewTable = function (props) {
1229
1198
  var fillColour = resolvedColType === "list" && !isActionColumn
1230
1199
  ? handleGetListColour(col, rawListValue)
1231
1200
  : undefined;
1232
- if (fillColour) {
1233
- var canPickColour = !!((_g = props.editable) === null || _g === void 0 ? void 0 : _g.active) &&
1234
- !(((_j = (_h = props.selectedIds) === null || _h === void 0 ? void 0 : _h.length) !== null && _j !== void 0 ? _j : 0) > 0 ||
1235
- props.selectAll);
1236
- return (react_2.default.createElement("td", { key: col.key, className: "p-0 align-middle ".concat((_l = (_k = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _k === void 0 ? void 0 : _k.className) !== null && _l !== void 0 ? _l : ""), style: (_m = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _m === void 0 ? void 0 : _m.style },
1237
- react_2.default.createElement("div", { "data-testid": "table-fill-".concat(col.key), "data-colour": fillColour, role: canPickColour ? "button" : undefined, tabIndex: canPickColour ? 0 : undefined, onClick: canPickColour
1238
- ? function (e) {
1239
- e.stopPropagation();
1240
- var rect = e.currentTarget.getBoundingClientRect();
1241
- handleEditDataOnClick(row.id, col.key, row);
1242
- setPaletteCell({
1243
- rowId: row.id,
1244
- key: col.key,
1245
- top: rect.bottom + 4,
1246
- left: rect.left,
1247
- width: rect.width,
1248
- });
1249
- }
1250
- : undefined, className: "flex h-full min-h-[40px] items-center justify-center px-3 text-sm font-medium ".concat((_o = FILL_CLASS[fillColour]) !== null && _o !== void 0 ? _o : FILL_CLASS.default, " ").concat(canPickColour ? "cursor-pointer hover:brightness-95" : "") }, String(rawListValue))));
1201
+ // INFO: an editable table renders the coloured cell as its Select in
1202
+ // every row (filled while closed) so the control never swaps in and
1203
+ // out; the plain block is for read-only tables
1204
+ if (fillColour && !((_g = props.editable) === null || _g === void 0 ? void 0 : _g.active)) {
1205
+ // INFO: a read-only table shows the same filled Select as an
1206
+ // editable one, just disabled the cell looks identical in both
1207
+ // modes and the row click still navigates
1208
+ var readOnlyDS = __assign(__assign({}, col), { id: col.key, name: col.title, type: (_h = col.type) !== null && _h !== void 0 ? _h : "string", showTagSelections: handleColumnShowsTags(col), disabled: true });
1209
+ return (react_2.default.createElement("td", { key: col.key, className: "p-0 align-middle ".concat((_k = (_j = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _j === void 0 ? void 0 : _j.className) !== null && _k !== void 0 ? _k : ""), style: (_l = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _l === void 0 ? void 0 : _l.style },
1210
+ react_2.default.createElement("div", { className: "w-max whitespace-nowrap p-[1px]" }, renderFormCell(row, readOnlyDS, null, {
1211
+ active: true,
1212
+ readOnly: true,
1213
+ onBlur: function () { },
1214
+ }))));
1251
1215
  }
1252
1216
  if (isObjectEdit) {
1253
1217
  return (react_2.default.createElement("td", { key: col.key, className: "".concat(cellPadding, " text-sm ").concat(cellFontColor, " whitespace-nowrap") },
@@ -1269,18 +1233,15 @@ var NewTable = function (props) {
1269
1233
  react_2.default.createElement(outline_1.PencilIcon, { className: "w-3.5 h-3.5 text-gray-400 opacity-0 group-hover/modaledit:opacity-100 flex-shrink-0" }))));
1270
1234
  }
1271
1235
  if (isEditable) {
1272
- var bareOverride = (_q = (_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareListDescription) === null || _q === void 0 ? void 0 : _q.call(_p, col.key, cellValue);
1236
+ var bareOverride = (_o = (_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareListDescription) === null || _o === void 0 ? void 0 : _o.call(_m, col.key, cellValue);
1273
1237
  if (!bareOverride)
1274
1238
  return renderEditDataInputs(colIndex, col, rowData, row.id, rowBgClass, isRowHoverable);
1275
1239
  }
1276
1240
  return (
1277
1241
  // INFO: pinned columns use whitespace-normal so text wraps within the fixed width
1278
- react_2.default.createElement("td", { key: col.key, "data-pin-key": leftPinned.includes(col.key) ||
1279
- rightPinned.includes(col.key)
1242
+ react_2.default.createElement("td", { key: col.key, "data-pin-key": leftPinned.includes(col.key) || rightPinned.includes(col.key)
1280
1243
  ? col.key
1281
- : undefined, className: "".concat(cellPadding, " text-sm ").concat(colIndex === 0 && props.onClickRow ? titleFontColor : cellFontColor, " ").concat(col.width ? "".concat(col.width, " flex-shrink-0") : getPinProps(col.key, false) ? "" : "whitespace-nowrap", " ").concat((_s = (_r = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _r === void 0 ? void 0 : _r.className) !== null && _s !== void 0 ? _s : ""), style: (_t = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _t === void 0 ? void 0 : _t.style }, props.newTabUrl && props.onClickRow ? (react_2.default.createElement(link_1.Link, { href: props.newTabUrl +
1282
- row.id +
1283
- ((_u = props.addNewTabUrl) !== null && _u !== void 0 ? _u : ""), className: "w-full block", linkType: props.linkType, custom: props.custom }, (0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord))) : ((0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord))));
1244
+ : undefined, className: "".concat(cellPadding, " text-sm ").concat(colIndex === 0 && props.onClickRow ? titleFontColor : cellFontColor, " ").concat(col.width ? "".concat(col.width, " flex-shrink-0") : getPinProps(col.key, false) ? "" : "whitespace-nowrap", " ").concat((_q = (_p = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _p === void 0 ? void 0 : _p.className) !== null && _q !== void 0 ? _q : ""), style: (_r = getPinProps(col.key, false, rowBgClass, isRowHoverable)) === null || _r === void 0 ? void 0 : _r.style }, props.newTabUrl && props.onClickRow ? (react_2.default.createElement(link_1.Link, { href: props.newTabUrl + row.id + ((_s = props.addNewTabUrl) !== null && _s !== void 0 ? _s : ""), className: "w-full block", linkType: props.linkType, custom: props.custom }, (0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord))) : ((0, readModule_1.renderEachRowDataBasedOnDataType)(col.key, cellValue, props.bareSettings, true, props.disableEllipsisOnLongWord))));
1284
1245
  }),
1285
1246
  renderActionColumnCell(row.id)));
1286
1247
  };
@@ -1472,73 +1433,6 @@ var NewTable = function (props) {
1472
1433
  });
1473
1434
  }))));
1474
1435
  };
1475
- var renderPageNumber = function (type) {
1476
- var _a, _b, _c, _d;
1477
- var pageNumberList = [];
1478
- var selectedBorderColor = props.darkMode
1479
- ? "border-primary-200"
1480
- : "border-primary-500";
1481
- var selectedFontColor = props.darkMode
1482
- ? "text-primary-200"
1483
- : "text-primary-500";
1484
- var basePageNumberClassname = "px-3 flex items-center h-full w-full text-sm font-medium cursor-pointer ";
1485
- if (type === "page") {
1486
- var pageOffset = Math.floor(((_a = props.pageIndex) !== null && _a !== void 0 ? _a : 0) / defaultPageSize);
1487
- var _loop_1 = function (i) {
1488
- var pageNumberClassName = basePageNumberClassname +
1489
- (props.pageIndex === i
1490
- ? "border rounded-xl ".concat(selectedBorderColor, " ").concat(selectedFontColor, " ").concat(bgColor)
1491
- : "".concat(cellFontColor));
1492
- pageNumberList.push(react_2.default.createElement("div", { key: i, "aria-current": "page", className: pageNumberClassName, onClick: props.pageIndex !== i
1493
- ? function () { var _a; return (_a = props.handleUpdatePageIndex) === null || _a === void 0 ? void 0 : _a.call(props, i); }
1494
- : function () { } }, i + 1));
1495
- };
1496
- for (var i = pageOffset * defaultPageSize; i * ((_b = props.limit) !== null && _b !== void 0 ? _b : defaultLimit) < ((_c = props.size) !== null && _c !== void 0 ? _c : props.data.length) &&
1497
- i < pageOffset * defaultPageSize + defaultPageSize; i++) {
1498
- _loop_1(i);
1499
- }
1500
- }
1501
- else if (type === "cursor") {
1502
- pageNumberList.push(react_2.default.createElement("div", { "aria-current": "page", className: "".concat(basePageNumberClassname, " ").concat(selectedBorderColor, " ").concat(selectedFontColor) }, ((_d = props.pageIndex) !== null && _d !== void 0 ? _d : 0) + 1));
1503
- }
1504
- return pageNumberList;
1505
- };
1506
- var renderPagination = function () {
1507
- var _a, _b, _c;
1508
- var nextDataAvailable = ((_a = props.size) !== null && _a !== void 0 ? _a : 0) >
1509
- (((_b = props.pageIndex) !== null && _b !== void 0 ? _b : 0) + 1) * ((_c = props.limit) !== null && _c !== void 0 ? _c : defaultLimit) ||
1510
- props.cursor;
1511
- switch (props.paginationType) {
1512
- case "cursor":
1513
- return (react_2.default.createElement("div", { className: "h-8 flex items-center justify-center gap-x-0.5", "aria-label": "Pagination" },
1514
- react_2.default.createElement("button", { type: "button", disabled: props.pageIndex === 0 ? true : false, className: "p-2 ".concat(cellFontColor, " ").concat(props.pageIndex === 0 ? "cursor-not-allowed" : ""), onClick: function () { var _a; return (_a = props.handleUpdatePageIndex) === null || _a === void 0 ? void 0 : _a.call(props, "prev"); } },
1515
- react_2.default.createElement(solid_1.ChevronLeftIcon, { className: "h-4 w-4", "aria-hidden": "true" })),
1516
- renderPageNumber("cursor"),
1517
- react_2.default.createElement("button", { type: "button", disabled: nextDataAvailable ? false : true, className: "p-2 ".concat(cellFontColor, " ").concat(nextDataAvailable ? "" : "cursor-not-allowed"), onClick: function () { var _a; return (_a = props.handleUpdatePageIndex) === null || _a === void 0 ? void 0 : _a.call(props, "next"); } },
1518
- react_2.default.createElement(solid_1.ChevronRightIcon, { className: "h-4 w-4", "aria-hidden": "true" }))));
1519
- case "page":
1520
- var disablePrev = props.pageIndex === 0 ? true : false;
1521
- return (react_2.default.createElement("div", { className: "h-8 flex items-center justify-center gap-x-0.5", "aria-label": "Pagination" },
1522
- react_2.default.createElement("button", { type: "button", disabled: disablePrev, className: "p-2 ".concat(cellFontColor, " ").concat(disablePrev ? "cursor-not-allowed" : ""), onClick: function () { var _a, _b; return (_a = props.handleUpdatePageIndex) === null || _a === void 0 ? void 0 : _a.call(props, ((_b = props.pageIndex) !== null && _b !== void 0 ? _b : 0) - 1); } },
1523
- react_2.default.createElement(solid_1.ChevronLeftIcon, { className: "h-4 w-4", "aria-hidden": "true" })),
1524
- renderPageNumber("page"),
1525
- react_2.default.createElement("button", { type: "button", disabled: nextDataAvailable ? false : true, className: "p-2 ".concat(cellFontColor, " ").concat(nextDataAvailable ? "" : "cursor-not-allowed"), onClick: function () { var _a, _b; return (_a = props.handleUpdatePageIndex) === null || _a === void 0 ? void 0 : _a.call(props, ((_b = props.pageIndex) !== null && _b !== void 0 ? _b : 0) + 1); } },
1526
- react_2.default.createElement(solid_1.ChevronRightIcon, { className: "h-4 w-4", "aria-hidden": "true" }))));
1527
- default:
1528
- return react_2.default.createElement(react_2.default.Fragment, null);
1529
- }
1530
- };
1531
- var renderPageResult = function () {
1532
- var _a, _b;
1533
- var text = "";
1534
- if (props.paginationType === "page") {
1535
- text = "Showing ".concat((_a = props.customPaginationSize) !== null && _a !== void 0 ? _a : props.size, " result(s)");
1536
- }
1537
- else {
1538
- text = "Showing ".concat((_b = props.customPaginationSize) !== null && _b !== void 0 ? _b : props.data.length, " result(s)");
1539
- }
1540
- return react_2.default.createElement("p", { className: "text-xs ".concat(cellFontColor) }, text);
1541
- };
1542
1436
  var renderCheckbox = function (checked, onChange, onClick, extraClassName) { return (react_2.default.createElement("input", { type: "checkbox", checked: checked, onChange: onChange, onClick: onClick, className: "rounded ".concat(props.darkMode ? "border-gray-400" : "border-gray-500", " ").concat(bgColor, " focus:ring-0 focus:ring-offset-0 focus:outline-offset-0 checked:text-primary-400 ").concat(extraClassName !== null && extraClassName !== void 0 ? extraClassName : "") })); };
1543
1437
  if (props.mobileView) {
1544
1438
  var isIdLike_1 = function (c) {
@@ -1547,7 +1441,9 @@ var NewTable = function (props) {
1547
1441
  var titleCol_1 = (_k = flatColumns.find(function (c) { return !isIdLike_1(c); })) !== null && _k !== void 0 ? _k : flatColumns[0];
1548
1442
  var expandHeaderBg_1 = props.darkMode ? "bg-gray-700" : "bg-gray-100";
1549
1443
  var expandHeaderFontColor_1 = props.darkMode ? "text-white" : "";
1550
- var headerBgColor_1 = props.darkMode ? "bg-gray-900" : "";
1444
+ var headerBgColor_1 = props.darkMode
1445
+ ? ((_l = props.darkModeBg) !== null && _l !== void 0 ? _l : "bg-gray-900")
1446
+ : "";
1551
1447
  var headerFontColor_1 = props.darkMode ? "text-white" : "";
1552
1448
  // INFO: renders tag + trailing text adjacent to the Collapse title
1553
1449
  var renderMobileTitleAdjacent_1 = function (row, spaceRow) {
@@ -1616,14 +1512,14 @@ var NewTable = function (props) {
1616
1512
  })))));
1617
1513
  };
1618
1514
  return (react_2.default.createElement("div", null,
1619
- react_2.default.createElement("div", { className: "w-full ".concat(((_l = props.mobileTooltip) === null || _l === void 0 ? void 0 : _l.tooltip) ? "overflow-visible" : "overflow-hidden", " border ").concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm divide-y ").concat(dividerColor, " ").concat((_m = props.className) !== null && _m !== void 0 ? _m : "") },
1515
+ react_2.default.createElement("div", { className: "w-full ".concat(((_m = props.mobileTooltip) === null || _m === void 0 ? void 0 : _m.tooltip) ? "overflow-visible" : "overflow-hidden", " border ").concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm divide-y ").concat(dividerColor, " ").concat((_o = props.className) !== null && _o !== void 0 ? _o : "") },
1620
1516
  react_2.default.createElement("div", { className: "p-3 flex justify-between" },
1621
1517
  renderSelectAll(),
1622
1518
  renderSelectedCount()),
1623
1519
  props.loading &&
1624
1520
  Array.from({ length: 3 }).map(function (_, i) { return (react_2.default.createElement("div", { key: "skeleton-".concat(i), className: "p-4" },
1625
1521
  react_2.default.createElement("div", { className: "h-5 w-3/4 rounded-md animate-pulse ".concat(props.darkMode ? "bg-gray-700" : "bg-gray-200") }))); }),
1626
- !props.loading && props.data.length === 0 && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (_o = props.emptyTitle) !== null && _o !== void 0 ? _o : "No items")),
1522
+ !props.loading && props.data.length === 0 && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (_p = props.emptyTitle) !== null && _p !== void 0 ? _p : "No items")),
1627
1523
  !props.loading &&
1628
1524
  props.data.map(function (row, index) {
1629
1525
  var _a, _b, _c, _d, _e, _f, _g;
@@ -1669,57 +1565,18 @@ var NewTable = function (props) {
1669
1565
  ((_g = props.mobileTooltip) === null || _g === void 0 ? void 0 : _g.tooltip) &&
1670
1566
  renderMobileTooltipContent_1(row, spaceRow) && (react_2.default.createElement("div", { className: "absolute left-1/2 -translate-x-1/2 top-full mt-1 z-50 hidden group-hover/tooltip:block" }, renderMobileTooltipContent_1(row, spaceRow)))));
1671
1567
  })),
1672
- !props.hidePagination && props.paginationType && (react_2.default.createElement("div", { className: "mt-2 flex items-center justify-between ".concat(props.fixedPagination
1673
- ? "pagination-container w-full sm:px-6 ".concat(borderColor, " ").concat(isFixed
1674
- ? "fixed bottom-0 left-0 z-10"
1675
- : "sticky top-0 left-0")
1676
- : "") },
1677
- renderPageResult(),
1678
- renderPagination())),
1568
+ react_2.default.createElement(newPagination_1.NewPagination, { paginationType: props.paginationType, pageIndex: props.pageIndex, limit: props.limit, size: props.size, cursor: props.cursor, resultCount: props.data.length, customPaginationSize: props.customPaginationSize, hidePagination: props.hidePagination, darkMode: props.darkMode, darkModeBg: props.darkModeBg, handleUpdatePageIndex: props.handleUpdatePageIndex, className: "".concat(props.fixedPagination
1569
+ ? "pagination-container w-full sm:px-6 ".concat(borderColor, " ").concat(isFixed ? "fixed bottom-0 left-0 z-10" : "sticky top-0 left-0")
1570
+ : "") }),
1679
1571
  renderFloatingActionBar()));
1680
1572
  }
1681
- return (react_2.default.createElement("div", { className: "w-full ".concat((_p = props.className) !== null && _p !== void 0 ? _p : "") },
1573
+ return (react_2.default.createElement("div", { className: "w-full ".concat((_q = props.className) !== null && _q !== void 0 ? _q : "") },
1682
1574
  react_2.default.createElement(modal_1.Modal, { open: filterModal ? true : false, title: "Filter Options", renderContent: function () {
1683
1575
  var _a, _b;
1684
1576
  return (react_2.default.createElement("div", { className: "pb-44" },
1685
1577
  react_2.default.createElement("div", { className: "pb-48" }, (_b = (_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.renderFilterElements) === null || _b === void 0 ? void 0 : _b.call(_a, filterModal))));
1686
1578
  }, onClose: function () { return setFilterModal(""); } }),
1687
- paletteCell &&
1688
- (function () {
1689
- var _a;
1690
- var column = flatColumns.find(function (eachCol) { return eachCol.key === paletteCell.key; });
1691
- var row = props.data.find(function (eachRow) { return eachRow.id === paletteCell.rowId; });
1692
- if (!column || !row)
1693
- return null;
1694
- var current = resolveValue(row, column.key);
1695
- return (react_2.default.createElement("div", { "data-testid": "table-fill-palette", role: "listbox", className: "fixed z-50 grid grid-cols-2 gap-1.5 rounded-lg border border-gray-200 bg-white p-2 shadow-xl", style: {
1696
- top: paletteCell.top,
1697
- left: paletteCell.left,
1698
- minWidth: Math.max(paletteCell.width, 200),
1699
- }, onMouseDown: function (e) { return e.stopPropagation(); } }, ((_a = column.listSelection) !== null && _a !== void 0 ? _a : []).map(function (option, index) {
1700
- var _a, _b;
1701
- var colour = (_a = column.listSelectionColour) === null || _a === void 0 ? void 0 : _a[index];
1702
- var fillClass = colour
1703
- ? ((_b = FILL_CLASS[colour]) !== null && _b !== void 0 ? _b : FILL_CLASS.default)
1704
- : "bg-gray-100 text-gray-700";
1705
- return (react_2.default.createElement("button", { key: option, type: "button", role: "option", "aria-selected": option === current, "data-testid": "table-fill-option-".concat(option), className: "rounded-md px-3 py-2 text-center text-sm font-medium ".concat(fillClass, " hover:brightness-95 ").concat(option === current
1706
- ? "ring-2 ring-primary-500 ring-offset-1"
1707
- : ""), onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
1708
- var _a;
1709
- return __generator(this, function (_b) {
1710
- switch (_b.label) {
1711
- case 0:
1712
- setPaletteCell(null);
1713
- return [4 /*yield*/, handleEditDataOnBlur(column.key, __assign(__assign({}, row), (_a = {}, _a[column.key] = option, _a)))];
1714
- case 1:
1715
- _b.sent();
1716
- return [2 /*return*/];
1717
- }
1718
- });
1719
- }); } }, option));
1720
- })));
1721
- })(),
1722
- react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (_r = (_q = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; })) === null || _q === void 0 ? void 0 : _q.title) !== null && _r !== void 0 ? _r : "Edit", onClose: handleModalEditClose, renderContent: function () {
1579
+ react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (_s = (_r = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; })) === null || _r === void 0 ? void 0 : _r.title) !== null && _s !== void 0 ? _s : "Edit", onClose: handleModalEditClose, renderContent: function () {
1723
1580
  var _a, _b, _c, _d;
1724
1581
  var selectedCol = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; });
1725
1582
  if (!selectedCol)
@@ -1760,7 +1617,7 @@ var NewTable = function (props) {
1760
1617
  return (react_2.default.createElement("div", null, (_b = (_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.renderAddColumnElements) === null || _b === void 0 ? void 0 : _b.call(_a, addColumnModal, function (id) { return handleAddColumnModal(id); })));
1761
1618
  }, onClose: function () { return handleAddColumnModal(""); } }),
1762
1619
  react_2.default.createElement(scrollShadow_1.ScrollShadow, { className: "w-full overflow-x-auto ".concat(borderRadius, " border ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), shadowFrom: props.darkMode ? "from-gray-900" : "from-white" },
1763
- (props.selectAll || ((_t = (_s = props.selectedIds) === null || _s === void 0 ? void 0 : _s.length) !== null && _t !== void 0 ? _t : 0) > 0) &&
1620
+ (props.selectAll || ((_u = (_t = props.selectedIds) === null || _t === void 0 ? void 0 : _t.length) !== null && _u !== void 0 ? _u : 0) > 0) &&
1764
1621
  (!props.multiActionFloatingBtns ||
1765
1622
  (props.multiActionFloatingBtns &&
1766
1623
  props.multiActionFloatingBtns.length <= 0)) && (react_2.default.createElement("div", { className: "sticky left-0 flex flex-row items-center px-4 py-3 gap-x-2" },
@@ -1776,13 +1633,11 @@ var NewTable = function (props) {
1776
1633
  react_2.default.createElement("div", { className: "h-5 rounded-md animate-pulse ".concat(props.darkMode ? "bg-gray-700" : "bg-gray-200") }))); }))); }),
1777
1634
  !props.loading && renderDesktopRows(),
1778
1635
  !props.loading && addData && renderAddDataRow())),
1779
- !props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (_u = props.emptyTitle) !== null && _u !== void 0 ? _u : "No items")),
1636
+ !props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (_v = props.emptyTitle) !== null && _v !== void 0 ? _v : "No items")),
1780
1637
  renderAddableSection()),
1781
- !props.hidePagination && props.paginationType && (react_2.default.createElement("div", { className: "mt-2 flex items-center justify-between ".concat(props.fixedPagination
1638
+ react_2.default.createElement(newPagination_1.NewPagination, { paginationType: props.paginationType, pageIndex: props.pageIndex, limit: props.limit, size: props.size, cursor: props.cursor, resultCount: props.data.length, customPaginationSize: props.customPaginationSize, hidePagination: props.hidePagination, darkMode: props.darkMode, darkModeBg: props.darkModeBg, handleUpdatePageIndex: props.handleUpdatePageIndex, className: "".concat(props.fixedPagination
1782
1639
  ? "pagination-container w-full ".concat(borderColor, " ").concat(isFixed ? "fixed bottom-0 left-0 z-10" : "sticky top-0 left-0")
1783
- : "") },
1784
- renderPageResult(),
1785
- renderPagination())),
1640
+ : "") }),
1786
1641
  renderFloatingActionBar()));
1787
1642
  };
1788
1643
  exports.NewTable = NewTable;