blixify-ui-web 1.2.202 → 1.2.204

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 (73) hide show
  1. package/lib/components/data/dataGraph/filterScope.d.ts +3 -0
  2. package/lib/components/data/dataGraph/filterScope.d.ts.map +1 -0
  3. package/lib/components/data/dataGraph/filterScope.js +47 -0
  4. package/lib/components/data/dataGraph/filterScope.js.map +1 -0
  5. package/lib/components/data/dataGraph/index.d.ts.map +1 -1
  6. package/lib/components/data/dataGraph/index.js +58 -28
  7. package/lib/components/data/dataGraph/index.js.map +1 -1
  8. package/lib/components/data/dataTemplate/activityModal.js +7 -3
  9. package/lib/components/data/dataTemplate/activityModal.js.map +1 -1
  10. package/lib/components/data/dataTemplate/chartView.d.ts.map +1 -1
  11. package/lib/components/data/dataTemplate/chartView.js +4 -1
  12. package/lib/components/data/dataTemplate/chartView.js.map +1 -1
  13. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  14. package/lib/components/data/dataTemplate/index.js +59 -12
  15. package/lib/components/data/dataTemplate/index.js.map +1 -1
  16. package/lib/components/data/dataTemplate/model.d.ts +1 -0
  17. package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
  18. package/lib/components/data/formula/builder.d.ts.map +1 -1
  19. package/lib/components/data/formula/builder.js +2 -1
  20. package/lib/components/data/formula/builder.js.map +1 -1
  21. package/lib/components/data/updateModule.d.ts.map +1 -1
  22. package/lib/components/data/updateModule.js +4 -1
  23. package/lib/components/data/updateModule.js.map +1 -1
  24. package/lib/components/display/drawer/index.d.ts +2 -0
  25. package/lib/components/display/drawer/index.d.ts.map +1 -1
  26. package/lib/components/display/drawer/index.js +28 -3
  27. package/lib/components/display/drawer/index.js.map +1 -1
  28. package/lib/components/display/flexTable/index.d.ts.map +1 -1
  29. package/lib/components/display/flexTable/index.js +10 -9
  30. package/lib/components/display/flexTable/index.js.map +1 -1
  31. package/lib/components/display/flexTable/newMobileItemCard.d.ts.map +1 -1
  32. package/lib/components/display/flexTable/newMobileItemCard.js +7 -6
  33. package/lib/components/display/flexTable/newMobileItemCard.js.map +1 -1
  34. package/lib/components/display/groupSection/index.d.ts +49 -0
  35. package/lib/components/display/groupSection/index.d.ts.map +1 -0
  36. package/lib/components/display/groupSection/index.js +160 -0
  37. package/lib/components/display/groupSection/index.js.map +1 -0
  38. package/lib/components/display/newGrid/index.d.ts +2 -1
  39. package/lib/components/display/newGrid/index.d.ts.map +1 -1
  40. package/lib/components/display/newGrid/index.js +29 -9
  41. package/lib/components/display/newGrid/index.js.map +1 -1
  42. package/lib/components/display/newList/index.d.ts +2 -1
  43. package/lib/components/display/newList/index.d.ts.map +1 -1
  44. package/lib/components/display/newList/index.js +27 -5
  45. package/lib/components/display/newList/index.js.map +1 -1
  46. package/lib/components/display/newPagination/index.d.ts.map +1 -1
  47. package/lib/components/display/newPagination/index.js +2 -1
  48. package/lib/components/display/newPagination/index.js.map +1 -1
  49. package/lib/components/display/newTable/index.d.ts.map +1 -1
  50. package/lib/components/display/newTable/index.js +169 -127
  51. package/lib/components/display/newTable/index.js.map +1 -1
  52. package/lib/components/input/address/index.d.ts.map +1 -1
  53. package/lib/components/input/address/index.js +2 -1
  54. package/lib/components/input/address/index.js.map +1 -1
  55. package/lib/components/input/datePicker/index.d.ts +1 -1
  56. package/lib/components/input/datePicker/index.d.ts.map +1 -1
  57. package/lib/components/input/datePicker/index.js +3 -2
  58. package/lib/components/input/datePicker/index.js.map +1 -1
  59. package/lib/components/input/markdown/index.d.ts.map +1 -1
  60. package/lib/components/input/markdown/index.js +8 -7
  61. package/lib/components/input/markdown/index.js.map +1 -1
  62. package/lib/components/input/select/index.d.ts.map +1 -1
  63. package/lib/components/input/select/index.js +10 -10
  64. package/lib/components/input/select/index.js.map +1 -1
  65. package/lib/components/input/textInput/index.d.ts.map +1 -1
  66. package/lib/components/input/textInput/index.js +6 -11
  67. package/lib/components/input/textInput/index.js.map +1 -1
  68. package/lib/components/input/utils.d.ts +15 -0
  69. package/lib/components/input/utils.d.ts.map +1 -1
  70. package/lib/components/input/utils.js +21 -1
  71. package/lib/components/input/utils.js.map +1 -1
  72. package/lib/tail.css +4 -4
  73. package/package.json +1 -1
@@ -120,12 +120,14 @@ var textInput_1 = require("../../input/textInput");
120
120
  var link_1 = require("../../structure/link");
121
121
  var detailList_1 = require("../detailList");
122
122
  var loading_1 = require("../loading");
123
+ var groupSection_1 = require("../groupSection");
123
124
  var modal_1 = require("../modal");
124
125
  var newPagination_1 = require("../newPagination");
125
126
  var recordActions_1 = require("../recordActions");
126
127
  var scrollShadow_1 = require("../scrollShadow");
127
128
  var columnWidth_1 = require("./columnWidth");
128
129
  var tag_1 = require("../tag");
130
+ var utils_2 = require("../../input/utils");
129
131
  // INFO: rows a section draws before its "Show more" — a 2,000-row section
130
132
  // would otherwise mount every row (and every cell's controls) at once
131
133
  exports.NEW_TABLE_GROUP_ROW_BATCH = 50;
@@ -348,22 +350,8 @@ var handleGetEditableColumnTypes = function (type) {
348
350
  ], ((_a = SAFE_TYPE_CHANGES[type]) !== null && _a !== void 0 ? _a : []), true);
349
351
  };
350
352
  exports.handleGetEditableColumnTypes = handleGetEditableColumnTypes;
351
- // INFO: group band (tinted) and the accent bar its member rows carry
352
- var BAND_CLASS = {
353
- default: "bg-primary-50 text-primary-800 border-primary-500",
354
- red: "bg-red-50 text-red-800 border-red-500",
355
- blue: "bg-blue-50 text-blue-800 border-blue-500",
356
- green: "bg-green-50 text-green-800 border-green-500",
357
- yellow: "bg-yellow-50 text-yellow-800 border-yellow-500",
358
- indigo: "bg-indigo-50 text-indigo-800 border-indigo-500",
359
- purple: "bg-purple-50 text-purple-800 border-purple-500",
360
- lime: "bg-lime-50 text-lime-800 border-lime-500",
361
- sky: "bg-sky-50 text-sky-800 border-sky-500",
362
- pink: "bg-pink-50 text-pink-800 border-pink-500",
363
- orange: "bg-orange-50 text-orange-800 border-orange-500",
364
- dark: "bg-gray-100 text-gray-800 border-gray-700",
365
- none: "bg-gray-50 text-gray-700 border-gray-300",
366
- };
353
+ // INFO: group band (tinted) — shared with the list and grid sections
354
+ var BAND_CLASS = groupSection_1.GROUP_BAND_CLASS;
367
355
  var ACCENT_CLASS = {
368
356
  default: "border-primary-500",
369
357
  red: "border-red-500",
@@ -392,7 +380,7 @@ var handleGetListColour = function (col, value) {
392
380
  return column.listSelectionColour[index] || undefined;
393
381
  };
394
382
  var NewTable = function (props) {
395
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2;
383
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4;
396
384
  var columns = (_b = (_a = props.columns) !== null && _a !== void 0 ? _a : props.header) !== null && _b !== void 0 ? _b : [];
397
385
  var defaultLimit = 10;
398
386
  // INFO: flatten groupData columns so both mobile and desktop share the same
@@ -424,6 +412,10 @@ var NewTable = function (props) {
424
412
  // INFO: compute sticky left/right offsets for pinned columns.
425
413
  var DEFAULT_PIN_WIDTH = 150;
426
414
  var CHECKBOX_WIDTH = 66;
415
+ // INFO: the share of the scrolling view the left pins may cover, and the
416
+ // narrowest the first pinned column is made to fit it
417
+ var PIN_VIEW_SHARE = 0.6;
418
+ var MIN_PIN_WIDTH = 96;
427
419
  // INFO: room for the add row's confirm and cancel buttons plus cell padding.
428
420
  // Only enforced when right-pinned columns need to know where to start.
429
421
  var ACTION_COLUMN_WIDTH = 136;
@@ -458,7 +450,7 @@ var NewTable = function (props) {
458
450
  flatColumns.length = 0;
459
451
  flatColumns.push.apply(flatColumns, __spreadArray(__spreadArray(__spreadArray([], leftCols, false), middleCols, false), rightCols, false));
460
452
  }
461
- var _3 = (0, react_2.useState)(props.fixedPagination ? true : false), isFixed = _3[0], setIsFixed = _3[1];
453
+ var _5 = (0, react_2.useState)(props.fixedPagination ? true : false), isFixed = _5[0], setIsFixed = _5[1];
462
454
  // INFO: the pencil and the bubble sit over the title cell's right padding,
463
455
  // 36px each plus 4px from the edge and 8px from the text — kept clear so
464
456
  // they never cover the title, and added to the cell's measured width so the
@@ -470,43 +462,43 @@ var NewTable = function (props) {
470
462
  //=====================================================================================
471
463
  // SECTION: Advanced Settings
472
464
  //=====================================================================================
473
- var _4 = (0, react_2.useState)(""), filterModal = _4[0], setFilterModal = _4[1];
474
- var _5 = (0, react_2.useState)(""), addColumnModal = _5[0], setAddColumnModal = _5[1];
465
+ var _6 = (0, react_2.useState)(""), filterModal = _6[0], setFilterModal = _6[1];
466
+ var _7 = (0, react_2.useState)(""), addColumnModal = _7[0], setAddColumnModal = _7[1];
475
467
  // INFO: what a DataTemplate around the table lets a cell save
476
468
  var columnTypeActions = (0, react_2.useContext)(context_1.ColumnTypeContext);
477
- var _6 = (0, react_2.useState)(""), newColumnName = _6[0], setNewColumnName = _6[1];
478
- var _7 = (0, react_2.useState)("string"), newColumnType = _7[0], setNewColumnType = _7[1];
479
- var _8 = (0, react_2.useState)(""), newColumnRefSpace = _8[0], setNewColumnRefSpace = _8[1];
480
- var _9 = (0, react_2.useState)(""), newColumnRefLabel = _9[0], setNewColumnRefLabel = _9[1];
481
- var _10 = (0, react_2.useState)([]), newColumnOptions = _10[0], setNewColumnOptions = _10[1];
469
+ var _8 = (0, react_2.useState)(""), newColumnName = _8[0], setNewColumnName = _8[1];
470
+ var _9 = (0, react_2.useState)("string"), newColumnType = _9[0], setNewColumnType = _9[1];
471
+ var _10 = (0, react_2.useState)(""), newColumnRefSpace = _10[0], setNewColumnRefSpace = _10[1];
472
+ var _11 = (0, react_2.useState)(""), newColumnRefLabel = _11[0], setNewColumnRefLabel = _11[1];
473
+ var _12 = (0, react_2.useState)([]), newColumnOptions = _12[0], setNewColumnOptions = _12[1];
482
474
  // INFO: the option row whose colour palette is open
483
- var _11 = (0, react_2.useState)(null), optionColourKey = _11[0], setOptionColourKey = _11[1];
484
- var _12 = (0, react_2.useState)(false), newColumnRequired = _12[0], setNewColumnRequired = _12[1];
485
- var _13 = (0, react_2.useState)(""), newColumnRatingMax = _13[0], setNewColumnRatingMax = _13[1];
486
- var _14 = (0, react_2.useState)(""), newColumnButtonLabel = _14[0], setNewColumnButtonLabel = _14[1];
487
- var _15 = (0, react_2.useState)(""), newColumnButtonColour = _15[0], setNewColumnButtonColour = _15[1];
488
- var _16 = (0, react_2.useState)(""), newColumnButtonConfirm = _16[0], setNewColumnButtonConfirm = _16[1];
489
- var _17 = (0, react_2.useState)(false), addingColumn = _17[0], setAddingColumn = _17[1];
475
+ var _13 = (0, react_2.useState)(null), optionColourKey = _13[0], setOptionColourKey = _13[1];
476
+ var _14 = (0, react_2.useState)(false), newColumnRequired = _14[0], setNewColumnRequired = _14[1];
477
+ var _15 = (0, react_2.useState)(""), newColumnRatingMax = _15[0], setNewColumnRatingMax = _15[1];
478
+ var _16 = (0, react_2.useState)(""), newColumnButtonLabel = _16[0], setNewColumnButtonLabel = _16[1];
479
+ var _17 = (0, react_2.useState)(""), newColumnButtonColour = _17[0], setNewColumnButtonColour = _17[1];
480
+ var _18 = (0, react_2.useState)(""), newColumnButtonConfirm = _18[0], setNewColumnButtonConfirm = _18[1];
481
+ var _19 = (0, react_2.useState)(false), addingColumn = _19[0], setAddingColumn = _19[1];
490
482
  // INFO: the formula as shown in the builder — column names, not ids
491
- var _18 = (0, react_2.useState)(""), newColumnFormula = _18[0], setNewColumnFormula = _18[1];
483
+ var _20 = (0, react_2.useState)(""), newColumnFormula = _20[0], setNewColumnFormula = _20[1];
492
484
  var addColumnPopUpRef = (0, react_2.useRef)(null);
493
485
  // INFO: the column being changed — empty while the panel adds a new one
494
- var _19 = (0, react_2.useState)(null), editingColumn = _19[0], setEditingColumn = _19[1];
486
+ var _21 = (0, react_2.useState)(null), editingColumn = _21[0], setEditingColumn = _21[1];
495
487
  //=====================================================================================
496
488
  // SECTION: Editable & Addable cells
497
489
  //=====================================================================================
498
- var _20 = (0, react_2.useState)(""), editDataRowId = _20[0], setEditDataRowId = _20[1];
499
- var _21 = (0, react_2.useState)(""), editDataHeaderKey = _21[0], setEditDataHeaderKey = _21[1];
490
+ var _22 = (0, react_2.useState)(""), editDataRowId = _22[0], setEditDataRowId = _22[1];
491
+ var _23 = (0, react_2.useState)(""), editDataHeaderKey = _23[0], setEditDataHeaderKey = _23[1];
500
492
  // INFO: an editable table used to mount an input in every cell — it read as a
501
493
  // form, and a row click always landed on a child input. Only the hovered cell
502
494
  // becomes its input now.
503
- var _22 = (0, react_2.useState)(null), hoveredCell = _22[0], setHoveredCell = _22[1];
504
- var _23 = (0, react_2.useState)(false), modalEditVisible = _23[0], setModalEditVisible = _23[1];
495
+ var _24 = (0, react_2.useState)(null), hoveredCell = _24[0], setHoveredCell = _24[1];
496
+ var _25 = (0, react_2.useState)(false), modalEditVisible = _25[0], setModalEditVisible = _25[1];
505
497
  // INFO: whether the modal's signature pad has been drawn on
506
- var _24 = (0, react_2.useState)(false), signatureSigning = _24[0], setSignatureSigning = _24[1];
507
- var _25 = (0, react_2.useState)([]), collapsedGroupIds = _25[0], setCollapsedGroupIds = _25[1];
498
+ var _26 = (0, react_2.useState)(false), signatureSigning = _26[0], setSignatureSigning = _26[1];
499
+ var _27 = (0, react_2.useState)([]), collapsedGroupIds = _27[0], setCollapsedGroupIds = _27[1];
508
500
  // INFO: rows shown per section when the sections do not page themselves
509
- var _26 = (0, react_2.useState)({}), groupVisibleCounts = _26[0], setGroupVisibleCounts = _26[1];
501
+ var _28 = (0, react_2.useState)({}), groupVisibleCounts = _28[0], setGroupVisibleCounts = _28[1];
510
502
  // INFO: per-group scroll pagination. One sentinel element per band, observed
511
503
  // by a single IntersectionObserver that fires props.onGroupLoadMore when a
512
504
  // band's sentinel scrolls into view. The debounce guard stops repeat fires
@@ -522,25 +514,27 @@ var NewTable = function (props) {
522
514
  var lastSelectedRowRef = (0, react_2.useRef)(null);
523
515
  var dragSelectRef = (0, react_2.useRef)(null);
524
516
  var suppressNextClickRef = (0, react_2.useRef)(false);
525
- var _27 = (0, react_2.useState)(false), isDragSelecting = _27[0], setIsDragSelecting = _27[1];
526
- var _28 = (0, react_2.useState)(0), copiedCount = _28[0], setCopiedCount = _28[1];
527
- var _29 = (0, react_2.useState)({}), editDataValue = _29[0], setEditDataValue = _29[1];
528
- var _30 = (0, react_2.useState)(false), editDataIsLoading = _30[0], setEditDataIsLoading = _30[1];
517
+ var _29 = (0, react_2.useState)(false), isDragSelecting = _29[0], setIsDragSelecting = _29[1];
518
+ var _30 = (0, react_2.useState)(0), copiedCount = _30[0], setCopiedCount = _30[1];
519
+ var _31 = (0, react_2.useState)({}), editDataValue = _31[0], setEditDataValue = _31[1];
520
+ var _32 = (0, react_2.useState)(false), editDataIsLoading = _32[0], setEditDataIsLoading = _32[1];
529
521
  // INFO: true while the empty bottom row is being filled in; the row itself is
530
522
  // always there in an addable table
531
- var _31 = (0, react_2.useState)(false), addData = _31[0], setAddData = _31[1];
532
- var _32 = (0, react_2.useState)({}), addDataValue = _32[0], setAddDataValue = _32[1];
523
+ var _33 = (0, react_2.useState)(false), addData = _33[0], setAddData = _33[1];
524
+ var _34 = (0, react_2.useState)({}), addDataValue = _34[0], setAddDataValue = _34[1];
533
525
  // INFO: bumped after each saved row, so the next one starts with fresh
534
526
  // inputs and its first cell takes the focus
535
- var _33 = (0, react_2.useState)(0), addRowKey = _33[0], setAddRowKey = _33[1];
536
- var _34 = (0, react_2.useState)({}), referencesOptions = _34[0], setReferencesOptions = _34[1];
527
+ var _35 = (0, react_2.useState)(0), addRowKey = _35[0], setAddRowKey = _35[1];
528
+ var _36 = (0, react_2.useState)({}), referencesOptions = _36[0], setReferencesOptions = _36[1];
537
529
  // INFO: seeded options sit under the local map so a cell's own search
538
530
  // results still win per key
539
531
  var mergedReferencesOptions = __assign(__assign({}, ((_l = props.referencesOptions) !== null && _l !== void 0 ? _l : {})), referencesOptions);
540
- var _35 = (0, react_2.useState)({}), referencesDetails = _35[0], setReferencesDetails = _35[1];
541
- var _36 = (0, react_2.useState)(false), referenceLoading = _36[0], setReferenceLoading = _36[1];
532
+ var _37 = (0, react_2.useState)({}), referencesDetails = _37[0], setReferencesDetails = _37[1];
533
+ var _38 = (0, react_2.useState)(false), referenceLoading = _38[0], setReferenceLoading = _38[1];
542
534
  // INFO: measured pixel widths for pinned columns without an explicit width.
543
- var _37 = (0, react_2.useState)({}), measuredPinWidths = _37[0], setMeasuredPinWidths = _37[1];
535
+ var _39 = (0, react_2.useState)({}), measuredPinWidths = _39[0], setMeasuredPinWidths = _39[1];
536
+ // INFO: the scrolling view's width, which caps how much the left pins take
537
+ var _40 = (0, react_2.useState)(0), pinViewWidth = _40[0], setPinViewWidth = _40[1];
544
538
  var editDataValueRef = (0, react_2.useRef)({});
545
539
  var editDataRowIdRef = (0, react_2.useRef)("");
546
540
  var editDataHeaderKeyRef = (0, react_2.useRef)("");
@@ -794,6 +788,19 @@ var NewTable = function (props) {
794
788
  });
795
789
  return function () { return cancelAnimationFrame(frameId); };
796
790
  }, [hasPinColumns, props.data.length]);
791
+ (0, react_2.useEffect)(function () {
792
+ var _a;
793
+ if (!hasPinColumns || typeof ResizeObserver === "undefined")
794
+ return;
795
+ var view = (_a = tableRef.current) === null || _a === void 0 ? void 0 : _a.closest('[data-testid="scroll-shadow-container"]');
796
+ if (!view)
797
+ return;
798
+ var handleMeasureView = function () { return setPinViewWidth(view.clientWidth); };
799
+ handleMeasureView();
800
+ var observer = new ResizeObserver(handleMeasureView);
801
+ observer.observe(view);
802
+ return function () { return observer.disconnect(); };
803
+ }, [hasPinColumns, props.data.length > 0]);
797
804
  var handleCancelAdd = function () {
798
805
  addDataValueRef.current = {};
799
806
  setAddData(false);
@@ -1194,7 +1201,7 @@ var NewTable = function (props) {
1194
1201
  // it stays here until the table unmounts. Tailwind cannot emit a runtime
1195
1202
  // w-[Npx], so a width drives an inline style and wins over the col.width
1196
1203
  // class.
1197
- var _38 = (0, react_2.useState)({}), columnWidths = _38[0], setColumnWidths = _38[1];
1204
+ var _41 = (0, react_2.useState)({}), columnWidths = _41[0], setColumnWidths = _41[1];
1198
1205
  var resizeRef = (0, react_2.useRef)(null);
1199
1206
  // INFO: a dragged width first, else the column's own fixed width in pixels
1200
1207
  // whatever form it is stored in ("180px", "w-[180px]", "w-48")
@@ -1351,6 +1358,7 @@ var NewTable = function (props) {
1351
1358
  addingColumn ||
1352
1359
  !handleIsNewColumnReady(), onClick: handleSubmitNewColumn }))));
1353
1360
  };
1361
+ var renderAddColumnModal = function () { return (react_2.default.createElement(modal_1.Modal, { open: addColumnModal ? true : false, maxWidth: newColumnType === "formula" ? "2xl" : undefined, title: editingColumn ? "Edit Column" : "Add Column", renderContent: renderAddColumnPanel, onClose: function () { return handleAddColumnModal(""); } })); };
1354
1362
  var handleChangeOption = function (key, change) {
1355
1363
  return setNewColumnOptions(newColumnOptions.map(function (eachOption) {
1356
1364
  return eachOption.key === key ? __assign(__assign({}, eachOption), change) : eachOption;
@@ -1383,7 +1391,7 @@ var NewTable = function (props) {
1383
1391
  newColumnOptions.map(function (eachOption, index) {
1384
1392
  var _a;
1385
1393
  return (react_2.default.createElement("div", { key: eachOption.key, className: "relative flex flex-row items-center gap-x-2", "data-testid": "column-option-".concat(index) },
1386
- react_2.default.createElement("input", { id: "newColumnOption-".concat(index), type: "text", value: eachOption.text, placeholder: "Option", className: "block w-full min-w-0 flex-1 rounded-md border px-3 py-1.5 text-sm focus:border-primary-500 focus:outline-none focus:ring-0 ".concat(props.darkMode
1394
+ react_2.default.createElement("input", { id: "newColumnOption-".concat(index), type: "text", value: eachOption.text, placeholder: "Option", className: "block w-full min-w-0 flex-1 rounded-md border px-3 py-1.5 ".concat(utils_2.touchSafeFontSize.sm, " focus:border-primary-500 focus:outline-none focus:ring-0 ").concat(props.darkMode
1387
1395
  ? "border-gray-600 bg-gray-800 text-white"
1388
1396
  : "border-gray-300"), onChange: function (event) {
1389
1397
  return handleChangeOption(eachOption.key, { text: event.target.value });
@@ -1867,47 +1875,81 @@ var NewTable = function (props) {
1867
1875
  };
1868
1876
  // INFO: returns sticky style, border, and background class for a pinned column cell.
1869
1877
  // Returns undefined when the column is not pinned.
1878
+ // INFO: extract numeric px value from a Tailwind width class (e.g. "w-[200px]" → 200, "w-48" → 192).
1879
+ // Falls back to measured DOM width for columns without explicit width.
1880
+ var handleGetPinWidth = function (key) {
1881
+ var _a;
1882
+ // INFO: a dragged or fixed width wins over the measured fallback
1883
+ var fixedWidth = getColumnWidth(key);
1884
+ if (fixedWidth)
1885
+ return fixedWidth;
1886
+ var col = flatColumns.find(function (c) { return c.key === key; });
1887
+ if (!(col === null || col === void 0 ? void 0 : col.width))
1888
+ return (_a = measuredPinWidths[key]) !== null && _a !== void 0 ? _a : DEFAULT_PIN_WIDTH;
1889
+ return DEFAULT_PIN_WIDTH;
1890
+ };
1891
+ var pinCheckboxOffset = props.checkbox &&
1892
+ (props.data.length > 0 || (props.spaceData && ((_q = props.spaceData) === null || _q === void 0 ? void 0 : _q.length) > 0))
1893
+ ? CHECKBOX_WIDTH
1894
+ : 0;
1895
+ /**
1896
+ * INFO: sticky columns wider than the view cover every column that scrolls,
1897
+ * so on a phone in portrait the table did scroll, but always underneath the
1898
+ * pinned title and looked stuck. While every pin (the checkbox, left and
1899
+ * right pins, the "+" and Actions) fits in PIN_VIEW_SHARE of the view,
1900
+ * nothing changes. Past that only the first column stays pinned, narrowed to
1901
+ * fit with its text wrapping, and everything else scrolls with the table.
1902
+ */
1903
+ var handleFitPins = function () {
1904
+ var _a;
1905
+ // INFO: the checkbox column is drawn whenever it is on, rows or not
1906
+ var leftNatural = leftPinned.reduce(function (sum, key) { return sum + handleGetPinWidth(key); }, props.checkbox ? CHECKBOX_WIDTH : 0);
1907
+ var rightNatural = rightPinned.reduce(function (sum, key) { return sum + handleGetPinWidth(key); }, 0) +
1908
+ (handleShowsActionColumn() ? ACTION_COLUMN_WIDTH : 0) +
1909
+ (((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.addColumnEnabled) ? ADD_COLUMN_WIDTH : 0);
1910
+ var budget = pinViewWidth ? pinViewWidth * PIN_VIEW_SHARE : Infinity;
1911
+ var widths = {};
1912
+ if (leftNatural + rightNatural <= budget) {
1913
+ leftPinned.forEach(function (key) { return (widths[key] = handleGetPinWidth(key)); });
1914
+ return { widths: widths, narrow: false };
1915
+ }
1916
+ var first = leftPinned[0];
1917
+ if (first)
1918
+ widths[first] = Math.min(handleGetPinWidth(first), Math.max(MIN_PIN_WIDTH, Math.floor(budget)));
1919
+ return { widths: widths, narrow: true };
1920
+ };
1921
+ var handleGetCheckboxPinStyle = function (zIndex) {
1922
+ if (!hasPinColumns)
1923
+ return undefined;
1924
+ var size = { width: CHECKBOX_WIDTH, minWidth: CHECKBOX_WIDTH };
1925
+ return narrowPins ? size : __assign({ position: "sticky", left: 0, zIndex: zIndex }, size);
1926
+ };
1870
1927
  var getPinProps = function (colKey, isHeader, rowBg, isHoverable) {
1871
- var _a, _b;
1928
+ var _a;
1872
1929
  if (!hasPinColumns)
1873
1930
  return undefined;
1874
- // INFO: extract numeric px value from a Tailwind width class (e.g. "w-[200px]" → 200, "w-48" → 192).
1875
- // Falls back to measured DOM width for columns without explicit width.
1876
- var parsePinWidth = function (key) {
1877
- var _a;
1878
- // INFO: a dragged or fixed width wins over the measured fallback
1879
- var fixedWidth = getColumnWidth(key);
1880
- if (fixedWidth)
1881
- return fixedWidth;
1882
- var col = flatColumns.find(function (c) { return c.key === key; });
1883
- if (!(col === null || col === void 0 ? void 0 : col.width))
1884
- return (_a = measuredPinWidths[key]) !== null && _a !== void 0 ? _a : DEFAULT_PIN_WIDTH;
1885
- return DEFAULT_PIN_WIDTH;
1886
- };
1931
+ var parsePinWidth = handleGetPinWidth;
1887
1932
  var style;
1888
1933
  var borderClass = "";
1889
- var leftIdx = leftPinned.indexOf(colKey);
1890
- var rightIdx = rightPinned.indexOf(colKey);
1934
+ var fittedLeftKeys = leftPinned.filter(function (key) { return key in fittedLeftPins; });
1935
+ var leftIdx = fittedLeftKeys.indexOf(colKey);
1936
+ var rightIdx = narrowPins ? -1 : rightPinned.indexOf(colKey);
1891
1937
  var pinBase = "sticky z-[2] relative whitespace-normal break-words";
1892
1938
  var afterBase = "after:absolute after:top-0 after:bottom-0 after:w-px after:pointer-events-none";
1893
1939
  var afterColor = props.darkMode
1894
1940
  ? "after:bg-gray-700"
1895
1941
  : "after:bg-gray-200";
1896
1942
  if (leftIdx >= 0) {
1897
- var baseOffset = props.checkbox &&
1898
- (props.data.length > 0 ||
1899
- (props.spaceData && ((_a = props.spaceData) === null || _a === void 0 ? void 0 : _a.length) > 0))
1900
- ? CHECKBOX_WIDTH
1901
- : 0;
1902
1943
  // INFO: offset = sum of widths of all preceding left-pinned columns
1903
- var left = leftPinned
1944
+ var left = fittedLeftKeys
1904
1945
  .slice(0, leftIdx)
1905
- .reduce(function (sum, key) { return sum + parsePinWidth(key); }, baseOffset);
1906
- var colWidth = parsePinWidth(colKey);
1946
+ .reduce(function (sum, key) { return sum + fittedLeftPins[key]; }, narrowPins ? 0 : pinCheckboxOffset);
1947
+ var colWidth = fittedLeftPins[colKey];
1907
1948
  var col = flatColumns.find(function (c) { return c.key === colKey; });
1908
- // INFO: only lock width when the column has an explicit width or has been measured.
1909
- // Unmeasured columns render unconstrained so the observer can capture natural size.
1910
- var hasFixedWidth = !!(col === null || col === void 0 ? void 0 : col.width) || !!measuredPinWidths[colKey];
1949
+ // INFO: only lock width when the column has an explicit width, has been
1950
+ // measured or is fitted to a narrow view. Unmeasured columns render
1951
+ // unconstrained so the observer can capture natural size.
1952
+ var hasFixedWidth = !!(col === null || col === void 0 ? void 0 : col.width) || !!measuredPinWidths[colKey] || narrowPins;
1911
1953
  style = __assign({ left: left, overflowWrap: "break-word" }, (hasFixedWidth && {
1912
1954
  width: colWidth,
1913
1955
  minWidth: colWidth,
@@ -1921,7 +1963,7 @@ var NewTable = function (props) {
1921
1963
  var right = rightPinned
1922
1964
  .slice(rightIdx + 1)
1923
1965
  .reduce(function (sum, key) { return sum + parsePinWidth(key); }, (handleShowsActionColumn() ? ACTION_COLUMN_WIDTH : 0) +
1924
- (((_b = props.advSettings) === null || _b === void 0 ? void 0 : _b.addColumnEnabled) ? ADD_COLUMN_WIDTH : 0));
1966
+ (((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.addColumnEnabled) ? ADD_COLUMN_WIDTH : 0));
1925
1967
  var colWidth = parsePinWidth(colKey);
1926
1968
  var col = flatColumns.find(function (c) { return c.key === colKey; });
1927
1969
  var hasFixedWidth = !!(col === null || col === void 0 ? void 0 : col.width) || !!measuredPinWidths[colKey];
@@ -2060,7 +2102,7 @@ var NewTable = function (props) {
2060
2102
  * column carries a background so the scrolling cells pass beneath it.
2061
2103
  */
2062
2104
  var handleGetActionCellPin = function (isHeader, rowBg, isHoverable) {
2063
- var _a;
2105
+ var _a, _b;
2064
2106
  var bg = isHeader ? tableHeaderBgColor : (rowBg !== null && rowBg !== void 0 ? rowBg : bgColor);
2065
2107
  var hoverClass = !isHeader && isHoverable
2066
2108
  ? props.darkMode
@@ -2070,11 +2112,18 @@ var NewTable = function (props) {
2070
2112
  var divider = props.darkMode
2071
2113
  ? "before:bg-gray-700"
2072
2114
  : "before:bg-gray-200";
2115
+ if (narrowPins)
2116
+ return {
2117
+ className: bg,
2118
+ style: rightPinned.length > 0 || ((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.addColumnEnabled)
2119
+ ? { width: ACTION_COLUMN_WIDTH, minWidth: ACTION_COLUMN_WIDTH }
2120
+ : undefined,
2121
+ };
2073
2122
  return {
2074
2123
  className: "sticky right-0 z-[3] ".concat(bg, " ").concat(hoverClass, " before:absolute before:inset-y-0 before:left-0 before:w-px before:pointer-events-none ").concat(divider),
2075
2124
  // INFO: right-pinned data columns and the add-column "+" offset by this
2076
2125
  // width, so it has to be exact while either exists
2077
- style: rightPinned.length > 0 || ((_a = props.advSettings) === null || _a === void 0 ? void 0 : _a.addColumnEnabled)
2126
+ style: rightPinned.length > 0 || ((_b = props.advSettings) === null || _b === void 0 ? void 0 : _b.addColumnEnabled)
2078
2127
  ? { width: ACTION_COLUMN_WIDTH, minWidth: ACTION_COLUMN_WIDTH }
2079
2128
  : undefined,
2080
2129
  };
@@ -2095,6 +2144,11 @@ var NewTable = function (props) {
2095
2144
  var divider = props.darkMode
2096
2145
  ? "before:bg-gray-700"
2097
2146
  : "before:bg-gray-200";
2147
+ if (narrowPins)
2148
+ return {
2149
+ className: bg,
2150
+ style: { width: ADD_COLUMN_WIDTH, minWidth: ADD_COLUMN_WIDTH },
2151
+ };
2098
2152
  return {
2099
2153
  className: "sticky z-[3] ".concat(bg, " ").concat(hoverClass, " before:absolute before:inset-y-0 before:left-0 before:w-px before:pointer-events-none ").concat(divider),
2100
2154
  style: {
@@ -2104,6 +2158,9 @@ var NewTable = function (props) {
2104
2158
  },
2105
2159
  };
2106
2160
  };
2161
+ // INFO: worked out here, after the Actions and "+" helpers it reads, and
2162
+ // only read by the render helpers called from the return below
2163
+ var _42 = handleFitPins(), fittedLeftPins = _42.widths, narrowPins = _42.narrow;
2107
2164
  var renderActionColumnHeader = function () {
2108
2165
  if (handleShowsActionColumn()) {
2109
2166
  var pin = handleGetActionCellPin(true);
@@ -2215,7 +2272,7 @@ var NewTable = function (props) {
2215
2272
  };
2216
2273
  // INFO: true when maxSelectedCount is set and the current selection has reached the limit
2217
2274
  var isMaxReached = !!props.maxSelectedCount &&
2218
- ((_r = (_q = props.selectedIds) === null || _q === void 0 ? void 0 : _q.length) !== null && _r !== void 0 ? _r : 0) >= props.maxSelectedCount;
2275
+ ((_s = (_r = props.selectedIds) === null || _r === void 0 ? void 0 : _r.length) !== null && _s !== void 0 ? _s : 0) >= props.maxSelectedCount;
2219
2276
  // INFO: one desktop row. groupAccent carries the group's colour so member
2220
2277
  // rows show the band's colour as a bar down their left edge.
2221
2278
  var renderDesktopRow = function (row, index, groupAccent) {
@@ -2253,15 +2310,7 @@ var NewTable = function (props) {
2253
2310
  : "", " ").concat(groupAccent
2254
2311
  ? "border-l-4 ".concat((_e = ACCENT_CLASS[groupAccent]) !== null && _e !== void 0 ? _e : ACCENT_CLASS.default)
2255
2312
  : "") },
2256
- props.checkbox && (react_2.default.createElement("td", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? "".concat(rowBgClass, " ").concat(isRowHoverable ? (props.darkMode ? "group-hover:bg-gray-700" : "group-hover:bg-gray-100") : "") : ""), style: hasPinColumns
2257
- ? {
2258
- position: "sticky",
2259
- left: 0,
2260
- zIndex: 1,
2261
- width: CHECKBOX_WIDTH,
2262
- minWidth: CHECKBOX_WIDTH,
2263
- }
2264
- : undefined, onClick: function (e) { return handleSelectRow(row.id, e); }, onMouseDown: function (e) { return handleDragSelectStart(row.id, e); }, onMouseEnter: function () { return handleDragSelectOver(row.id); } }, renderCheckbox(isSelected, function () { }, undefined, isMaxReached && !isSelected
2313
+ props.checkbox && (react_2.default.createElement("td", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? "".concat(rowBgClass, " ").concat(isRowHoverable ? (props.darkMode ? "group-hover:bg-gray-700" : "group-hover:bg-gray-100") : "") : ""), style: handleGetCheckboxPinStyle(1), onClick: function (e) { return handleSelectRow(row.id, e); }, onMouseDown: function (e) { return handleDragSelectStart(row.id, e); }, onMouseEnter: function () { return handleDragSelectOver(row.id); } }, renderCheckbox(isSelected, function () { }, undefined, isMaxReached && !isSelected
2265
2314
  ? "opacity-50 cursor-not-allowed"
2266
2315
  : ""))),
2267
2316
  flatColumns.map(function (col, colIndex) {
@@ -2683,15 +2732,7 @@ var NewTable = function (props) {
2683
2732
  if (!hasGroupHeaders) {
2684
2733
  return (react_2.default.createElement("thead", null,
2685
2734
  react_2.default.createElement("tr", { className: "border-b ".concat(dividerColor, " ").concat(tableHeaderBgColor, " ").concat(tableHeaderFontColor) },
2686
- props.checkbox && (react_2.default.createElement("th", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? tableHeaderBgColor : ""), style: hasPinColumns
2687
- ? {
2688
- position: "sticky",
2689
- left: 0,
2690
- zIndex: 3,
2691
- width: CHECKBOX_WIDTH,
2692
- minWidth: CHECKBOX_WIDTH,
2693
- }
2694
- : undefined }, renderSelectAll())),
2735
+ props.checkbox && (react_2.default.createElement("th", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? tableHeaderBgColor : ""), style: handleGetCheckboxPinStyle(3) }, renderSelectAll())),
2695
2736
  flatColumns.map(function (col) {
2696
2737
  var _a, _b, _c, _d;
2697
2738
  return (react_2.default.createElement("th", { key: col.key, className: "group/th relative ".concat(cellPadding, " text-left text-xs font-semibold uppercase tracking-wide ").concat(cursorClassname, " ").concat((_b = (_a = getPinProps(col.key, true)) === null || _a === void 0 ? void 0 : _a.className) !== null && _b !== void 0 ? _b : ""), style: __assign(__assign({}, (_c = getPinProps(col.key, true)) === null || _c === void 0 ? void 0 : _c.style), (getColumnWidth(col.key)
@@ -2720,15 +2761,7 @@ var NewTable = function (props) {
2720
2761
  });
2721
2762
  return (react_2.default.createElement("thead", null,
2722
2763
  react_2.default.createElement("tr", { className: "border-b ".concat(dividerColor, " ").concat(tableHeaderBgColor, " ").concat(tableHeaderFontColor) },
2723
- props.checkbox && (react_2.default.createElement("th", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? tableHeaderBgColor : ""), style: hasPinColumns
2724
- ? {
2725
- position: "sticky",
2726
- left: 0,
2727
- zIndex: 3,
2728
- width: CHECKBOX_WIDTH,
2729
- minWidth: CHECKBOX_WIDTH,
2730
- }
2731
- : undefined, rowSpan: 2 }, renderSelectAll())),
2764
+ props.checkbox && (react_2.default.createElement("th", { className: "w-10 ".concat(cellPadding, " ").concat(hasPinColumns ? tableHeaderBgColor : ""), style: handleGetCheckboxPinStyle(3), rowSpan: 2 }, renderSelectAll())),
2732
2765
  visibleColumns.map(function (col) {
2733
2766
  var _a, _b, _c, _d;
2734
2767
  var groupData = col.groupData;
@@ -2759,11 +2792,11 @@ var NewTable = function (props) {
2759
2792
  var isIdLike_1 = function (c) {
2760
2793
  return /^id$/i.test(c.key) || /^_id$/i.test(c.key);
2761
2794
  };
2762
- var titleCol_1 = (_s = flatColumns.find(function (c) { return !isIdLike_1(c); })) !== null && _s !== void 0 ? _s : flatColumns[0];
2795
+ var titleCol_1 = (_t = flatColumns.find(function (c) { return !isIdLike_1(c); })) !== null && _t !== void 0 ? _t : flatColumns[0];
2763
2796
  var expandHeaderBg_1 = props.darkMode ? "bg-gray-700" : "bg-gray-100";
2764
2797
  var expandHeaderFontColor_1 = props.darkMode ? "text-white" : "";
2765
2798
  var headerBgColor_1 = props.darkMode
2766
- ? ((_t = props.darkModeBg) !== null && _t !== void 0 ? _t : "bg-gray-900")
2799
+ ? ((_u = props.darkModeBg) !== null && _u !== void 0 ? _u : "bg-gray-900")
2767
2800
  : "";
2768
2801
  var headerFontColor_1 = props.darkMode ? "text-white" : "";
2769
2802
  // INFO: renders tag + trailing text adjacent to the Collapse title
@@ -2789,9 +2822,15 @@ var NewTable = function (props) {
2789
2822
  // INFO: second-line label + value summary under the title (while collapsed),
2790
2823
  // driven by titleAdjacent.summaryKeys. Reuses the tooltip's summary layout.
2791
2824
  var renderMobileTitleSummary_1 = function (row, spaceRow) {
2792
- var _a;
2825
+ var _a, _b;
2793
2826
  var ta = (_a = props.mobileTooltip) === null || _a === void 0 ? void 0 : _a.titleAdjacent;
2794
- var keys = ta === null || ta === void 0 ? void 0 : ta.summaryKeys;
2827
+ // INFO: a column the view hides, or the one already drawn as the title,
2828
+ // stays out of the line under the title
2829
+ var keys = (_b = ta === null || ta === void 0 ? void 0 : ta.summaryKeys) === null || _b === void 0 ? void 0 : _b.filter(function (key) {
2830
+ var parentKey = key.split(".")[0];
2831
+ return (key !== (titleCol_1 === null || titleCol_1 === void 0 ? void 0 : titleCol_1.key) &&
2832
+ flatColumns.some(function (col) { return col.key === key || col.key === parentKey; }));
2833
+ });
2795
2834
  if (!ta || !keys || keys.length === 0)
2796
2835
  return undefined;
2797
2836
  var source = spaceRow !== null && spaceRow !== void 0 ? spaceRow : row;
@@ -2858,16 +2897,18 @@ var NewTable = function (props) {
2858
2897
  })))));
2859
2898
  };
2860
2899
  return (react_2.default.createElement("div", null,
2861
- react_2.default.createElement("div", { className: "w-full ".concat(((_u = props.mobileTooltip) === null || _u === void 0 ? void 0 : _u.tooltip) ? "overflow-visible" : "overflow-hidden", " ").concat(isFlat
2900
+ react_2.default.createElement("div", { className: "w-full ".concat(((_v = props.mobileTooltip) === null || _v === void 0 ? void 0 : _v.tooltip) ? "overflow-visible" : "overflow-hidden", " ").concat(isFlat
2862
2901
  ? ""
2863
- : "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((_v = props.className) !== null && _v !== void 0 ? _v : "") },
2864
- react_2.default.createElement("div", { className: "p-3 flex justify-between" },
2902
+ : "border ".concat(borderRadius, " ").concat(borderColor, " ").concat(bgColor, " shadow-sm"), " divide-y ").concat(dividerColor, " ").concat((_w = props.className) !== null && _w !== void 0 ? _w : "") },
2903
+ react_2.default.createElement("div", { className: "p-3 flex items-center justify-between" },
2865
2904
  renderSelectAll(),
2866
- renderSelectedCount()),
2905
+ react_2.default.createElement("div", { className: "flex items-center gap-2" },
2906
+ renderSelectedCount(),
2907
+ ((_x = props.advSettings) === null || _x === void 0 ? void 0 : _x.addColumnEnabled) && (react_2.default.createElement(iconButton_1.IconButton, { testId: "table-add-column-btn-mobile", icon: react_2.default.createElement(solid_1.PlusIcon, { className: "h-5 w-5 text-gray" }), onClick: function () { return handleAddColumnModal("new"); } })))),
2867
2908
  props.loading &&
2868
2909
  Array.from({ length: 3 }).map(function (_, i) { return (react_2.default.createElement("div", { key: "skeleton-".concat(i), className: "p-4" },
2869
2910
  react_2.default.createElement("div", { className: "h-5 w-3/4 rounded-md animate-pulse ".concat(props.darkMode ? "bg-gray-700" : "bg-gray-200") }))); }),
2870
- !props.loading && props.data.length === 0 && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (_w = props.emptyTitle) !== null && _w !== void 0 ? _w : "No items")),
2911
+ !props.loading && props.data.length === 0 && (react_2.default.createElement("p", { className: "p-4 text-center text-sm ".concat(cellFontColor) }, (_y = props.emptyTitle) !== null && _y !== void 0 ? _y : "No items")),
2871
2912
  !props.loading &&
2872
2913
  props.data.map(function (row, index) {
2873
2914
  var _a, _b, _c, _d, _e, _f, _g;
@@ -2921,15 +2962,16 @@ var NewTable = function (props) {
2921
2962
  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
2922
2963
  ? "pagination-container w-full sm:px-6 ".concat(borderColor, " ").concat(isFixed ? "fixed bottom-0 left-0 z-10" : "sticky top-0 left-0")
2923
2964
  : "") }),
2924
- renderFloatingActionBar()));
2965
+ renderFloatingActionBar(),
2966
+ renderAddColumnModal()));
2925
2967
  }
2926
- return (react_2.default.createElement("div", { className: "w-full ".concat((_x = props.className) !== null && _x !== void 0 ? _x : "") },
2968
+ return (react_2.default.createElement("div", { className: "w-full ".concat((_z = props.className) !== null && _z !== void 0 ? _z : "") },
2927
2969
  react_2.default.createElement(modal_1.Modal, { open: filterModal ? true : false, title: "Filter Options", renderContent: function () {
2928
2970
  var _a, _b;
2929
2971
  return (react_2.default.createElement("div", { className: "pb-44" },
2930
2972
  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))));
2931
2973
  }, onClose: function () { return setFilterModal(""); } }),
2932
- react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (_z = (_y = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; })) === null || _y === void 0 ? void 0 : _y.title) !== null && _z !== void 0 ? _z : "Edit", onClose: handleModalEditClose, renderContent: function () {
2974
+ react_2.default.createElement(modal_1.Modal, { open: modalEditVisible, title: (_1 = (_0 = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; })) === null || _0 === void 0 ? void 0 : _0.title) !== null && _1 !== void 0 ? _1 : "Edit", onClose: handleModalEditClose, renderContent: function () {
2933
2975
  var _a, _b, _c, _d;
2934
2976
  var selectedCol = flatColumns.find(function (eachCol) { return eachCol.key === editDataHeaderKey; });
2935
2977
  if (!selectedCol)
@@ -2967,11 +3009,11 @@ var NewTable = function (props) {
2967
3009
  react_2.default.createElement(button_1.Button, { text: "Cancel", type: "light", onClick: handleModalEditClose }),
2968
3010
  react_2.default.createElement(button_1.Button, { text: editDataIsLoading ? "Saving" : "Save", type: "normal", disable: editDataIsLoading, onClick: handleModalEditSave }))));
2969
3011
  } }),
2970
- react_2.default.createElement(modal_1.Modal, { open: addColumnModal ? true : false, maxWidth: newColumnType === "formula" ? "2xl" : undefined, title: editingColumn ? "Edit Column" : "Add Column", renderContent: renderAddColumnPanel, onClose: function () { return handleAddColumnModal(""); } }),
3012
+ renderAddColumnModal(),
2971
3013
  react_2.default.createElement(scrollShadow_1.ScrollShadow, { className: "w-full overflow-x-auto ".concat(isFlat
2972
3014
  ? ""
2973
3015
  : "".concat(borderRadius, " border ").concat(borderColor, " ").concat(bgColor, " shadow-sm")), darkMode: props.darkMode },
2974
- (props.selectAll || ((_1 = (_0 = props.selectedIds) === null || _0 === void 0 ? void 0 : _0.length) !== null && _1 !== void 0 ? _1 : 0) > 0) &&
3016
+ (props.selectAll || ((_3 = (_2 = props.selectedIds) === null || _2 === void 0 ? void 0 : _2.length) !== null && _3 !== void 0 ? _3 : 0) > 0) &&
2975
3017
  (!props.multiActionFloatingBtns ||
2976
3018
  (props.multiActionFloatingBtns &&
2977
3019
  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" },
@@ -2992,7 +3034,7 @@ var NewTable = function (props) {
2992
3034
  !props.loading && renderDesktopRows(),
2993
3035
  !props.loading &&
2994
3036
  (addData ? renderAddDataRow() : renderEmptyAddRow()))),
2995
- !props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (_2 = props.emptyTitle) !== null && _2 !== void 0 ? _2 : "No items"))),
3037
+ !props.loading && props.data.length === 0 && (react_2.default.createElement("div", { className: "p-4 text-sm ".concat(cellFontColor, " text-center sticky left-0") }, (_4 = props.emptyTitle) !== null && _4 !== void 0 ? _4 : "No items"))),
2996
3038
  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
2997
3039
  ? "pagination-container w-full ".concat(borderColor, " ").concat(isFixed ? "fixed bottom-0 left-0 z-10" : "sticky top-0 left-0")
2998
3040
  : "") }),