blixify-ui-web 1.2.197 → 1.2.199

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 (92) hide show
  1. package/lib/components/data/columnTypes/buttonCell.d.ts +17 -0
  2. package/lib/components/data/columnTypes/buttonCell.d.ts.map +1 -0
  3. package/lib/components/data/columnTypes/buttonCell.js +160 -0
  4. package/lib/components/data/columnTypes/buttonCell.js.map +1 -0
  5. package/lib/components/data/columnTypes/context.d.ts +13 -0
  6. package/lib/components/data/columnTypes/context.d.ts.map +1 -0
  7. package/lib/components/data/columnTypes/context.js +8 -0
  8. package/lib/components/data/columnTypes/context.js.map +1 -0
  9. package/lib/components/data/columnTypes/dateRange.d.ts +24 -0
  10. package/lib/components/data/columnTypes/dateRange.d.ts.map +1 -0
  11. package/lib/components/data/columnTypes/dateRange.js +75 -0
  12. package/lib/components/data/columnTypes/dateRange.js.map +1 -0
  13. package/lib/components/data/columnTypes/dateRangeCell.d.ts +20 -0
  14. package/lib/components/data/columnTypes/dateRangeCell.d.ts.map +1 -0
  15. package/lib/components/data/columnTypes/dateRangeCell.js +210 -0
  16. package/lib/components/data/columnTypes/dateRangeCell.js.map +1 -0
  17. package/lib/components/data/columnTypes/groupSections.d.ts +56 -0
  18. package/lib/components/data/columnTypes/groupSections.d.ts.map +1 -0
  19. package/lib/components/data/columnTypes/groupSections.js +170 -0
  20. package/lib/components/data/columnTypes/groupSections.js.map +1 -0
  21. package/lib/components/data/columnTypes/index.d.ts +15 -0
  22. package/lib/components/data/columnTypes/index.d.ts.map +1 -0
  23. package/lib/components/data/columnTypes/index.js +31 -0
  24. package/lib/components/data/columnTypes/index.js.map +1 -0
  25. package/lib/components/data/columnTypes/ratingCell.d.ts +29 -0
  26. package/lib/components/data/columnTypes/ratingCell.d.ts.map +1 -0
  27. package/lib/components/data/columnTypes/ratingCell.js +176 -0
  28. package/lib/components/data/columnTypes/ratingCell.js.map +1 -0
  29. package/lib/components/data/columnTypes/systemColumns.d.ts +27 -0
  30. package/lib/components/data/columnTypes/systemColumns.d.ts.map +1 -0
  31. package/lib/components/data/columnTypes/systemColumns.js +118 -0
  32. package/lib/components/data/columnTypes/systemColumns.js.map +1 -0
  33. package/lib/components/data/columnTypes/timeTracking.d.ts +27 -0
  34. package/lib/components/data/columnTypes/timeTracking.d.ts.map +1 -0
  35. package/lib/components/data/columnTypes/timeTracking.js +127 -0
  36. package/lib/components/data/columnTypes/timeTracking.js.map +1 -0
  37. package/lib/components/data/columnTypes/timeTrackingCell.d.ts +17 -0
  38. package/lib/components/data/columnTypes/timeTrackingCell.d.ts.map +1 -0
  39. package/lib/components/data/columnTypes/timeTrackingCell.js +146 -0
  40. package/lib/components/data/columnTypes/timeTrackingCell.js.map +1 -0
  41. package/lib/components/data/dataTemplate/activityChanges.d.ts.map +1 -1
  42. package/lib/components/data/dataTemplate/activityChanges.js +7 -0
  43. package/lib/components/data/dataTemplate/activityChanges.js.map +1 -1
  44. package/lib/components/data/dataTemplate/dataStateModel.d.ts +6 -0
  45. package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
  46. package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
  47. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  48. package/lib/components/data/dataTemplate/index.js +519 -332
  49. package/lib/components/data/dataTemplate/index.js.map +1 -1
  50. package/lib/components/data/dataTemplate/model.d.ts +26 -2
  51. package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
  52. package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
  53. package/lib/components/data/dataTemplate/settingsModal.js +13 -6
  54. package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
  55. package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +1 -0
  56. package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
  57. package/lib/components/data/dataTemplate/viewStatePersistence.js +18 -3
  58. package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
  59. package/lib/components/data/flexFilter/index.d.ts.map +1 -1
  60. package/lib/components/data/flexFilter/index.js +17 -1
  61. package/lib/components/data/flexFilter/index.js.map +1 -1
  62. package/lib/components/data/formula/builder.d.ts.map +1 -1
  63. package/lib/components/data/formula/builder.js +30 -10
  64. package/lib/components/data/formula/builder.js.map +1 -1
  65. package/lib/components/data/formula/functions.d.ts +3 -0
  66. package/lib/components/data/formula/functions.d.ts.map +1 -1
  67. package/lib/components/data/formula/functions.js +269 -1
  68. package/lib/components/data/formula/functions.js.map +1 -1
  69. package/lib/components/data/formula/index.d.ts +8 -0
  70. package/lib/components/data/formula/index.d.ts.map +1 -1
  71. package/lib/components/data/formula/index.js +80 -13
  72. package/lib/components/data/formula/index.js.map +1 -1
  73. package/lib/components/data/listModule.d.ts +2 -0
  74. package/lib/components/data/listModule.d.ts.map +1 -1
  75. package/lib/components/data/listModule.js +109 -53
  76. package/lib/components/data/listModule.js.map +1 -1
  77. package/lib/components/data/readModule.d.ts.map +1 -1
  78. package/lib/components/data/readModule.js +105 -74
  79. package/lib/components/data/readModule.js.map +1 -1
  80. package/lib/components/data/updateModule.d.ts.map +1 -1
  81. package/lib/components/data/updateModule.js +78 -28
  82. package/lib/components/data/updateModule.js.map +1 -1
  83. package/lib/components/data/utils.d.ts +1 -0
  84. package/lib/components/data/utils.d.ts.map +1 -1
  85. package/lib/components/data/utils.js +32 -12
  86. package/lib/components/data/utils.js.map +1 -1
  87. package/lib/components/display/newTable/index.d.ts +9 -0
  88. package/lib/components/display/newTable/index.d.ts.map +1 -1
  89. package/lib/components/display/newTable/index.js +362 -109
  90. package/lib/components/display/newTable/index.js.map +1 -1
  91. package/lib/tail.css +2 -2
  92. package/package.json +1 -1
@@ -69,6 +69,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
69
69
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
70
70
  }
71
71
  };
72
+ var __rest = (this && this.__rest) || function (s, e) {
73
+ var t = {};
74
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
75
+ t[p] = s[p];
76
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
77
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
78
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
79
+ t[p[i]] = s[p[i]];
80
+ }
81
+ return t;
82
+ };
72
83
  var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
73
84
  if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
74
85
  if (ar || !(i in from)) {
@@ -148,6 +159,10 @@ var writeQuery_1 = require("../writeQuery");
148
159
  var activityModal_1 = require("./activityModal");
149
160
  var authModal_1 = require("./authModal");
150
161
  var indexedDb_1 = require("./indexedDb");
162
+ var context_1 = require("../columnTypes/context");
163
+ var groupSections_1 = require("../columnTypes/groupSections");
164
+ var systemColumns_1 = require("../columnTypes/systemColumns");
165
+ var dateRange_1 = require("../columnTypes/dateRange");
151
166
  var socket_1 = require("./socket");
152
167
  var newPagination_1 = require("../../display/newPagination");
153
168
  var pagination_1 = require("./pagination");
@@ -215,10 +230,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
215
230
  // Every read of the view type below uses resolvedType. The distinction matters
216
231
  // most in effect dependency arrays — following props.type there would leave
217
232
  // the list never refetching while the panel is open, which fails silently.
218
- 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, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102;
233
+ 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, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105;
219
234
  // INFO: the panel cannot navigate its way out — handleNavigate("read") is
220
235
  // routed straight back into it — so expand-to-full-page is local state.
221
- var _103 = (0, react_1.useState)(false), drawerPageView = _103[0], setDrawerPageView = _103[1];
236
+ var _106 = (0, react_1.useState)(false), drawerPageView = _106[0], setDrawerPageView = _106[1];
222
237
  // INFO: the panel keeps rendering the record it was opened with rather than
223
238
  // live props. Without this, navigating back to the list would re-render the
224
239
  // still-mounted panel as a second list behind the overlay.
@@ -310,14 +325,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
310
325
  initialFilterReferenceDate: initialFilterReferenceDate,
311
326
  };
312
327
  };
313
- var _104 = intialiseDefaultFilterValues(), initialFilterSearch = _104.initialFilterSearch, initialFilterSearchParams = _104.initialFilterSearchParams, initialFilterSelection = _104.initialFilterSelection, initialFilterReference = _104.initialFilterReference, initialFilterReferenceDate = _104.initialFilterReferenceDate;
328
+ var _107 = intialiseDefaultFilterValues(), initialFilterSearch = _107.initialFilterSearch, initialFilterSearchParams = _107.initialFilterSearchParams, initialFilterSelection = _107.initialFilterSelection, initialFilterReference = _107.initialFilterReference, initialFilterReferenceDate = _107.initialFilterReferenceDate;
314
329
  // INFO: Persist view state hook — handles storage read/write for filter/sort/column state
315
- var _105 = (0, viewStatePersistence_1.usePersistedViewState)({
330
+ var _108 = (0, viewStatePersistence_1.usePersistedViewState)({
316
331
  mode: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.persistViewState,
317
332
  collectionId: props.collectionId,
318
333
  persistKey: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey,
319
334
  type: resolvedType,
320
- }), rawPersistedState = _105.persistedState, isPersistEnabled = _105.isEnabled, handleSaveView = _105.handleSaveView, handleRegisterViewSnapshot = _105.handleRegisterViewSnapshot;
335
+ }), rawPersistedState = _108.persistedState, isPersistEnabled = _108.isEnabled, handleSaveView = _108.handleSaveView, handleRegisterViewSnapshot = _108.handleRegisterViewSnapshot;
321
336
  // INFO: drop stored filters/sort on removed columns — they would empty the table
322
337
  var persistedState = (0, react_1.useMemo)(function () {
323
338
  var _a, _b, _c;
@@ -331,8 +346,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
331
346
  (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareFlexFilterReferences,
332
347
  (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareFlexFilterListObjects,
333
348
  ]);
334
- var _106 = (0, react_1.useState)(false), loading = _106[0], setLoading = _106[1];
335
- var _107 = (0, react_1.useState)(), notification = _107[0], setNotification = _107[1];
349
+ var _109 = (0, react_1.useState)(false), loading = _109[0], setLoading = _109[1];
350
+ var _110 = (0, react_1.useState)(), notification = _110[0], setNotification = _110[1];
336
351
  // INFO: a success toast is confirmation, not a decision — it clears itself so
337
352
  // it never sits on the floating step bar; errors stay until dismissed
338
353
  (0, react_1.useEffect)(function () {
@@ -342,63 +357,75 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
342
357
  return function () { return clearTimeout(timer); };
343
358
  }, [notification]);
344
359
  //INFO : Used by List
345
- var _108 = (0, react_1.useState)((_f = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _f !== void 0 ? _f : initialFilterSearch), filterSearch = _108[0], setFilterSearch = _108[1];
346
- var _109 = (0, react_1.useState)((_g = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _g !== void 0 ? _g : initialFilterSearchParams), filterSearchParams = _109[0], setFilterSearchParams = _109[1];
347
- var _110 = (0, react_1.useState)((_h = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _h !== void 0 ? _h : initialFilterSelection), filterSelection = _110[0], setFilterSelection = _110[1];
348
- var _111 = (0, react_1.useState)((_j = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _j !== void 0 ? _j : initialFilterReference), filterReference = _111[0], setFilterReference = _111[1];
349
- var _112 = (0, react_1.useState)({}), filterReferenceSearch = _112[0], setFilterReferenceSearch = _112[1];
350
- var _113 = (0, react_1.useState)({}), filterReferenceList = _113[0], setFilterReferenceList = _113[1];
351
- var _114 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
360
+ var _111 = (0, react_1.useState)((_f = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _f !== void 0 ? _f : initialFilterSearch), filterSearch = _111[0], setFilterSearch = _111[1];
361
+ var _112 = (0, react_1.useState)((_g = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _g !== void 0 ? _g : initialFilterSearchParams), filterSearchParams = _112[0], setFilterSearchParams = _112[1];
362
+ var _113 = (0, react_1.useState)((_h = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _h !== void 0 ? _h : initialFilterSelection), filterSelection = _113[0], setFilterSelection = _113[1];
363
+ var _114 = (0, react_1.useState)((_j = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _j !== void 0 ? _j : initialFilterReference), filterReference = _114[0], setFilterReference = _114[1];
364
+ var _115 = (0, react_1.useState)({}), filterReferenceSearch = _115[0], setFilterReferenceSearch = _115[1];
365
+ var _116 = (0, react_1.useState)({}), filterReferenceList = _116[0], setFilterReferenceList = _116[1];
366
+ var _117 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
352
367
  ? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
353
- : initialFilterReferenceDate), filterReferenceDate = _114[0], setFilterReferenceDate = _114[1];
354
- var _115 = (0, react_1.useState)(true), tableLoading = _115[0], setTableLoading = _115[1];
355
- var _116 = (0, react_1.useState)(""), cursor = _116[0], setCursor = _116[1];
356
- var _117 = (0, react_1.useState)(""), lastCursor = _117[0], setLastCursor = _117[1];
357
- var _118 = (0, react_1.useState)([]), tableData = _118[0], setTableData = _118[1];
358
- var _119 = (0, react_1.useState)([]), spaceTableData = _119[0], setSpaceTableData = _119[1];
368
+ : initialFilterReferenceDate), filterReferenceDate = _117[0], setFilterReferenceDate = _117[1];
369
+ var _118 = (0, react_1.useState)(true), tableLoading = _118[0], setTableLoading = _118[1];
370
+ var _119 = (0, react_1.useState)(""), cursor = _119[0], setCursor = _119[1];
371
+ var _120 = (0, react_1.useState)(""), lastCursor = _120[0], setLastCursor = _120[1];
372
+ var _121 = (0, react_1.useState)([]), tableData = _121[0], setTableData = _121[1];
373
+ var _122 = (0, react_1.useState)([]), spaceTableData = _122[0], setSpaceTableData = _122[1];
359
374
  // INFO: a save resolves after later renders, so it reads the table from here —
360
375
  // the state it closed over can predate an earlier save on the same row
361
376
  var tableDataRef = (0, react_1.useRef)([]);
362
377
  var spaceTableDataRef = (0, react_1.useRef)([]);
363
378
  tableDataRef.current = tableData;
364
379
  spaceTableDataRef.current = spaceTableData;
365
- var _120 = (0, react_1.useState)(0), size = _120[0], setSize = _120[1];
366
- var _121 = (0, react_1.useState)((_m = (_k = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _k !== void 0 ? _k : (_l = props.organise) === null || _l === void 0 ? void 0 : _l.pageIndex) !== null && _m !== void 0 ? _m : 0), pageIndex = _121[0], setPageIndex = _121[1];
367
- var _122 = (0, react_1.useState)([]), selectedIds = _122[0], setSelectedIds = _122[1];
368
- var _123 = (0, react_1.useState)(false), selectAll = _123[0], setSelectAll = _123[1];
369
- var _124 = (0, react_1.useState)(""), deletePasscode = _124[0], setDeletePasscode = _124[1];
370
- var _125 = (0, react_1.useState)(""), deletePasscodeInput = _125[0], setDeletePasscodeInput = _125[1];
371
- var _126 = (0, react_1.useState)(""), deleteFeedId = _126[0], setDeleteFeedId = _126[1];
380
+ var _123 = (0, react_1.useState)(0), size = _123[0], setSize = _123[1];
381
+ var _124 = (0, react_1.useState)((_m = (_k = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _k !== void 0 ? _k : (_l = props.organise) === null || _l === void 0 ? void 0 : _l.pageIndex) !== null && _m !== void 0 ? _m : 0), pageIndex = _124[0], setPageIndex = _124[1];
382
+ var _125 = (0, react_1.useState)([]), selectedIds = _125[0], setSelectedIds = _125[1];
383
+ var _126 = (0, react_1.useState)(false), selectAll = _126[0], setSelectAll = _126[1];
384
+ var _127 = (0, react_1.useState)(""), deletePasscode = _127[0], setDeletePasscode = _127[1];
385
+ var _128 = (0, react_1.useState)(""), deletePasscodeInput = _128[0], setDeletePasscodeInput = _128[1];
386
+ var _129 = (0, react_1.useState)(""), deleteFeedId = _129[0], setDeleteFeedId = _129[1];
372
387
  //INFO : Used by List Organise
373
388
  // INFO: Internal sort state that overrides props.organise?.sort when
374
389
  // persistViewState is enabled and a persisted sort exists
375
- var _127 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _o !== void 0 ? _o : undefined), persistedSort = _127[0], setPersistedSort = _127[1];
376
- var _128 = (0, react_1.useState)(false), filterDraft = _128[0], setFilterDraft = _128[1];
377
- var _129 = (0, react_1.useState)(false), addTabModal = _129[0], setAddTabModal = _129[1];
378
- var _130 = (0, react_1.useState)(-1), editTabIndex = _130[0], setEditTabIndex = _130[1];
390
+ var _130 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _o !== void 0 ? _o : undefined), persistedSort = _130[0], setPersistedSort = _130[1];
391
+ var _131 = (0, react_1.useState)(false), filterDraft = _131[0], setFilterDraft = _131[1];
392
+ var _132 = (0, react_1.useState)(false), addTabModal = _132[0], setAddTabModal = _132[1];
393
+ var _133 = (0, react_1.useState)(-1), editTabIndex = _133[0], setEditTabIndex = _133[1];
379
394
  //INFO : resolve the initial tab synchronously so the mount cond is already
380
395
  // tab-scoped — an empty initial tab caused a second wasted list fetch
381
- var _131 = (0, react_1.useState)(function () {
396
+ var _134 = (0, react_1.useState)(function () {
382
397
  var _a, _b;
383
398
  return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.viewId);
384
- }), selectedTab = _131[0], setSelectedTab = _131[1];
385
- var _132 = (0, react_1.useState)("dayGridMonth"), calendarView = _132[0], setCalendarView = _132[1];
399
+ }), selectedTab = _134[0], setSelectedTab = _134[1];
400
+ var _135 = (0, react_1.useState)("dayGridMonth"), calendarView = _135[0], setCalendarView = _135[1];
386
401
  // INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
387
402
  // (calendarView above drives the matching range query)
388
- var _133 = (0, react_1.useState)("month"), newCalendarViewMode = _133[0], setNewCalendarViewMode = _133[1];
389
- var _134 = (0, react_1.useState)(new Date()), calendarTabMonth = _134[0], setCalendarTabMonth = _134[1];
403
+ var _136 = (0, react_1.useState)("month"), newCalendarViewMode = _136[0], setNewCalendarViewMode = _136[1];
404
+ var _137 = (0, react_1.useState)(new Date()), calendarTabMonth = _137[0], setCalendarTabMonth = _137[1];
390
405
  // INFO: defaultViewSwitch picks the opening view only — the tab re-inits
391
406
  // whenever its settings change, and that must not undo the user's switch
392
407
  var calendarViewInitRef = (0, react_1.useRef)(false);
393
- var _135 = (0, react_1.useState)(true), kanbanDroppable = _135[0], setKanbanDroppable = _135[1];
394
- var _136 = (0, react_1.useState)([]), kanbanOptions = _136[0], setKanbanOptions = _136[1];
395
- var _137 = (0, react_1.useState)(false), batchUpdateModal = _137[0], setBatchUpdateModal = _137[1];
396
- var _138 = (0, react_1.useState)({
408
+ var _138 = (0, react_1.useState)(true), kanbanDroppable = _138[0], setKanbanDroppable = _138[1];
409
+ var _139 = (0, react_1.useState)([]), kanbanOptions = _139[0], setKanbanOptions = _139[1];
410
+ var _140 = (0, react_1.useState)(false), batchUpdateModal = _140[0], setBatchUpdateModal = _140[1];
411
+ var _141 = (0, react_1.useState)({
397
412
  columnId: "",
398
413
  columnData: {},
399
- }), batchUpdateData = _138[0], setBatchUpdateData = _138[1];
400
- var _139 = (0, react_1.useState)(function () {
401
- var baseModel = (props === null || props === void 0 ? void 0 : props.model) || [];
414
+ }), batchUpdateData = _141[0], setBatchUpdateData = _141[1];
415
+ // INFO: system columns (created / updated at and by, record id, number)
416
+ // join the structure hidden; the ones a user shows are kept per view
417
+ var isSystemColumnsEnabled = !!((_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareSystemColumns);
418
+ var appendedSystemColumnIds = isSystemColumnsEnabled
419
+ ? systemColumns_1.SYSTEM_COLUMN_IDS.filter(function (eachId) { var _a; return !((_a = props.model) !== null && _a !== void 0 ? _a : []).some(function (each) { return each.id === eachId; }); })
420
+ : [];
421
+ var _142 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _q !== void 0 ? _q : []), shownSystemColumnIds = _142[0], setShownSystemColumnIds = _142[1];
422
+ var handleWithSystemColumns = function (model, shownIds) {
423
+ if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
424
+ return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
425
+ };
426
+ var _143 = (0, react_1.useState)(function () {
427
+ var _a;
428
+ var baseModel = handleWithSystemColumns((props === null || props === void 0 ? void 0 : props.model) || [], (_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _a !== void 0 ? _a : []);
402
429
  if (!persistedState)
403
430
  return baseModel;
404
431
  // INFO: Apply persisted column visibility (hiddenColumnIds) and order (columnOrder)
@@ -423,8 +450,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
423
450
  });
424
451
  }
425
452
  return model;
426
- }), structure = _139[0], setStructure = _139[1];
427
- var _140 = (0, react_1.useState)(((_p = props === null || props === void 0 ? void 0 : props.organise) === null || _p === void 0 ? void 0 : _p.additionalQuery) || []), additionalQuery = _140[0], setAdditionalQuery = _140[1];
453
+ }), structure = _143[0], setStructure = _143[1];
454
+ var _144 = (0, react_1.useState)(((_r = props === null || props === void 0 ? void 0 : props.organise) === null || _r === void 0 ? void 0 : _r.additionalQuery) || []), additionalQuery = _144[0], setAdditionalQuery = _144[1];
428
455
  // INFO: State for user-configurable flex filters (Monday.com-style)
429
456
  // INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
430
457
  var defaultFlexFilterRow = [
@@ -435,9 +462,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
435
462
  value: undefined,
436
463
  },
437
464
  ];
438
- var _141 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
465
+ var _145 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
439
466
  ? persistedState.flexFilters
440
- : defaultFlexFilterRow), flexFilters = _141[0], setFlexFilters = _141[1];
467
+ : defaultFlexFilterRow), flexFilters = _145[0], setFlexFilters = _145[1];
441
468
  // INFO: always-current mirror of flexFilters, read by the imperative apply/
442
469
  // clear methods so chained calls in one tick aren't stale.
443
470
  var flexFiltersRef = (0, react_1.useRef)(flexFilters);
@@ -450,76 +477,76 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
450
477
  }, [flexFilters]);
451
478
  // INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
452
479
  // to prevent API calls on every keystroke when typing in value inputs
453
- var _142 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
480
+ var _146 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
454
481
  ? persistedState.flexFilters
455
- : defaultFlexFilterRow), flexFiltersDebounced = _142[0], setFlexFiltersDebounced = _142[1];
482
+ : defaultFlexFilterRow), flexFiltersDebounced = _146[0], setFlexFiltersDebounced = _146[1];
456
483
  // INFO: the filter rows of the export being set up — started from the
457
484
  // list's own when the export opens, so changing them leaves the list as it is
458
- var _143 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _143[0], setExportFlexFilters = _143[1];
459
- var _144 = (0, react_1.useState)({}), flexFilterReferenceOptions = _144[0], setFlexFilterReferenceOptions = _144[1];
460
- var _145 = (0, react_1.useState)({}), flexFilterReferenceSearch = _145[0], setFlexFilterReferenceSearch = _145[1];
461
- var _146 = (0, react_1.useState)(false), flexFilterModalOpen = _146[0], setFlexFilterModalOpen = _146[1];
462
- var _147 = (0, react_1.useState)(false), viewSettingsModalOpen = _147[0], setViewSettingsModalOpen = _147[1];
485
+ var _147 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _147[0], setExportFlexFilters = _147[1];
486
+ var _148 = (0, react_1.useState)({}), flexFilterReferenceOptions = _148[0], setFlexFilterReferenceOptions = _148[1];
487
+ var _149 = (0, react_1.useState)({}), flexFilterReferenceSearch = _149[0], setFlexFilterReferenceSearch = _149[1];
488
+ var _150 = (0, react_1.useState)(false), flexFilterModalOpen = _150[0], setFlexFilterModalOpen = _150[1];
489
+ var _151 = (0, react_1.useState)(false), viewSettingsModalOpen = _151[0], setViewSettingsModalOpen = _151[1];
463
490
  // INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
464
491
  // Deliberately kept out of `structure`: the props-sync effect below resets
465
492
  // structure to props.model whenever props change, which would wipe the
466
493
  // choice, and the persist effect derives schema-level hiddenColumnIds from
467
494
  // structure — writing user hides there would blur the two concepts.
468
- var _148 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _q !== void 0 ? _q : []), userHiddenColumnIds = _148[0], setUserHiddenColumnIds = _148[1];
469
- var _149 = (0, react_1.useState)(""), columnSearch = _149[0], setColumnSearch = _149[1];
470
- var _150 = (0, react_1.useState)([]), savedViews = _150[0], setSavedViews = _150[1];
471
- var _151 = (0, react_1.useState)(null), activeSavedViewId = _151[0], setActiveSavedViewId = _151[1];
495
+ var _152 = (0, react_1.useState)((_s = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _s !== void 0 ? _s : []), userHiddenColumnIds = _152[0], setUserHiddenColumnIds = _152[1];
496
+ var _153 = (0, react_1.useState)(""), columnSearch = _153[0], setColumnSearch = _153[1];
497
+ var _154 = (0, react_1.useState)([]), savedViews = _154[0], setSavedViews = _154[1];
498
+ var _155 = (0, react_1.useState)(null), activeSavedViewId = _155[0], setActiveSavedViewId = _155[1];
472
499
  // INFO: null while the name box is closed
473
- var _152 = (0, react_1.useState)(null), savedViewName = _152[0], setSavedViewName = _152[1];
474
- var _153 = (0, react_1.useState)(null), deletingSavedViewId = _153[0], setDeletingSavedViewId = _153[1];
475
- var _154 = (0, react_1.useState)(null), draggingColumnId = _154[0], setDraggingColumnId = _154[1];
500
+ var _156 = (0, react_1.useState)(null), savedViewName = _156[0], setSavedViewName = _156[1];
501
+ var _157 = (0, react_1.useState)(null), deletingSavedViewId = _157[0], setDeletingSavedViewId = _157[1];
502
+ var _158 = (0, react_1.useState)(null), draggingColumnId = _158[0], setDraggingColumnId = _158[1];
476
503
  var columnRowRefs = (0, react_1.useRef)({});
477
504
  //INFO : Used by Auth
478
- var _155 = (0, react_1.useState)({
505
+ var _159 = (0, react_1.useState)({
479
506
  email: "",
480
507
  google: "",
481
508
  phone: "",
482
509
  disabled: false,
483
510
  create: false,
484
- }), authMethods = _155[0], setAuthMethods = _155[1];
485
- var _156 = (0, react_1.useState)(""), selectedAuthMethod = _156[0], setSelectedAuthMethod = _156[1];
511
+ }), authMethods = _159[0], setAuthMethods = _159[1];
512
+ var _160 = (0, react_1.useState)(""), selectedAuthMethod = _160[0], setSelectedAuthMethod = _160[1];
486
513
  // INFO: the sign-in check of a users datasheet's record is running; the
487
514
  // panel shows a spinner rather than nothing, which read as "no login"
488
- var _157 = (0, react_1.useState)(false), authLoading = _157[0], setAuthLoading = _157[1];
515
+ var _161 = (0, react_1.useState)(false), authLoading = _161[0], setAuthLoading = _161[1];
489
516
  // INFO: a delete is running — the ref answers a second tap at once, before
490
517
  // the state has rendered, and the state disables the confirm button
491
518
  var deletingRef = (0, react_1.useRef)(false);
492
- var _158 = (0, react_1.useState)(false), deleting = _158[0], setDeleting = _158[1];
519
+ var _162 = (0, react_1.useState)(false), deleting = _162[0], setDeleting = _162[1];
493
520
  // INFO: Used by Activity Log
494
- var _159 = (0, react_1.useState)(false), activityModal = _159[0], setActivityModal = _159[1];
495
- var _160 = (0, react_1.useState)(""), activityId = _160[0], setActivityId = _160[1];
521
+ var _163 = (0, react_1.useState)(false), activityModal = _163[0], setActivityModal = _163[1];
522
+ var _164 = (0, react_1.useState)(""), activityId = _164[0], setActivityId = _164[1];
496
523
  //INFO : Used by Export
497
- var _161 = (0, react_1.useState)(null), csvFile = _161[0], setCSVFile = _161[1];
498
- var _162 = (0, react_1.useState)([]), csvFileData = _162[0], setCSVFileData = _162[1];
499
- var _163 = (0, react_1.useState)(0), stepCSVIndex = _163[0], setStepCSVIndex = _163[1];
500
- var _164 = (0, react_1.useState)({}), listCSVMapAttribute = _164[0], setListCSVMapAttribute = _164[1];
501
- var _165 = (0, react_1.useState)({}), listCSVObjAttribute = _165[0], setListCSVObjAttribute = _165[1];
502
- var _166 = (0, react_1.useState)([]), csvAPIAttribute = _166[0], setCSVAPIAttribute = _166[1];
503
- var _167 = (0, react_1.useState)(((_r = props.devSettings.currentUser) === null || _r === void 0 ? void 0 : _r.userEmail) || ""), exportCSVEmail = _167[0], setExportCSVEmail = _167[1];
504
- var _168 = (0, react_1.useState)(((_t = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.exportSettings) === null || _t === void 0 ? void 0 : _t.defaultExportPDFName) || ""), exportPDFTitle = _168[0], setExportPDFTitle = _168[1];
505
- var _169 = (0, react_1.useState)(false), exportPDFLoading = _169[0], setExportPDFLoading = _169[1];
506
- var _170 = (0, react_1.useState)(false), exportReadPDFLoading = _170[0], setExportReadPDFLoading = _170[1];
507
- var _171 = (0, react_1.useState)((_w = (_v = (_u = props.organise) === null || _u === void 0 ? void 0 : _u.exportSettings) === null || _v === void 0 ? void 0 : _v.sumColumnId) !== null && _w !== void 0 ? _w : []), exportSumAttributeIds = _171[0], setExportSumAttributeIds = _171[1];
508
- var _172 = (0, react_1.useState)((_z = (_y = (_x = props.organise) === null || _x === void 0 ? void 0 : _x.exportSettings) === null || _y === void 0 ? void 0 : _y.hideSubItems) !== null && _z !== void 0 ? _z : false), hideSubItems = _172[0], setHideSubItems = _172[1];
509
- var _173 = (0, react_1.useState)([]), importTableData = _173[0], setImportTableData = _173[1];
510
- var _174 = (0, react_1.useState)([]), queryList = _174[0], setQueryList = _174[1];
511
- var _175 = (0, react_1.useState)(undefined), allQueryList = _175[0], setAllQueryList = _175[1];
524
+ var _165 = (0, react_1.useState)(null), csvFile = _165[0], setCSVFile = _165[1];
525
+ var _166 = (0, react_1.useState)([]), csvFileData = _166[0], setCSVFileData = _166[1];
526
+ var _167 = (0, react_1.useState)(0), stepCSVIndex = _167[0], setStepCSVIndex = _167[1];
527
+ var _168 = (0, react_1.useState)({}), listCSVMapAttribute = _168[0], setListCSVMapAttribute = _168[1];
528
+ var _169 = (0, react_1.useState)({}), listCSVObjAttribute = _169[0], setListCSVObjAttribute = _169[1];
529
+ var _170 = (0, react_1.useState)([]), csvAPIAttribute = _170[0], setCSVAPIAttribute = _170[1];
530
+ var _171 = (0, react_1.useState)(((_t = props.devSettings.currentUser) === null || _t === void 0 ? void 0 : _t.userEmail) || ""), exportCSVEmail = _171[0], setExportCSVEmail = _171[1];
531
+ var _172 = (0, react_1.useState)(((_v = (_u = props.organise) === null || _u === void 0 ? void 0 : _u.exportSettings) === null || _v === void 0 ? void 0 : _v.defaultExportPDFName) || ""), exportPDFTitle = _172[0], setExportPDFTitle = _172[1];
532
+ var _173 = (0, react_1.useState)(false), exportPDFLoading = _173[0], setExportPDFLoading = _173[1];
533
+ var _174 = (0, react_1.useState)(false), exportReadPDFLoading = _174[0], setExportReadPDFLoading = _174[1];
534
+ var _175 = (0, react_1.useState)((_y = (_x = (_w = props.organise) === null || _w === void 0 ? void 0 : _w.exportSettings) === null || _x === void 0 ? void 0 : _x.sumColumnId) !== null && _y !== void 0 ? _y : []), exportSumAttributeIds = _175[0], setExportSumAttributeIds = _175[1];
535
+ var _176 = (0, react_1.useState)((_1 = (_0 = (_z = props.organise) === null || _z === void 0 ? void 0 : _z.exportSettings) === null || _0 === void 0 ? void 0 : _0.hideSubItems) !== null && _1 !== void 0 ? _1 : false), hideSubItems = _176[0], setHideSubItems = _176[1];
536
+ var _177 = (0, react_1.useState)([]), importTableData = _177[0], setImportTableData = _177[1];
537
+ var _178 = (0, react_1.useState)([]), queryList = _178[0], setQueryList = _178[1];
538
+ var _179 = (0, react_1.useState)(undefined), allQueryList = _179[0], setAllQueryList = _179[1];
512
539
  // INFO: a restored state wins over the prop; its "" is a list the user
513
540
  // ungrouped, so it opens ungrouped
514
- var _176 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
541
+ var _180 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
515
542
  ? persistedState.groupBy || undefined
516
- : (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.groupBy), groupId = _176[0], setGroupId = _176[1];
543
+ : (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.groupBy), groupId = _180[0], setGroupId = _180[1];
517
544
  // INFO: Monday-board per-group paging. Keyed by the group key that
518
- // handleBuildNewTableGroups() produces (a list option or "Unknown/No Value").
545
+ // handleBuildNewTableGroups() produces (an option, Unknown or No Value).
519
546
  // Each group tracks its own loaded cursor + total so it can lazily load its
520
547
  // next page as the user scrolls inside that band, independent of every other
521
548
  // group. Only used when renderCheckGroupPaging() is true.
522
- var _177 = (0, react_1.useState)({}), groupPageState = _177[0], setGroupPageState = _177[1];
549
+ var _181 = (0, react_1.useState)({}), groupPageState = _181[0], setGroupPageState = _181[1];
523
550
  // INFO: read fresh inside the async per-group fetch so chained scroll fires
524
551
  // in one tick do not re-fetch an already in-flight page.
525
552
  var groupPageStateRef = (0, react_1.useRef)({});
@@ -528,59 +555,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
528
555
  // list was re-read (new search, filter, sort or grouping) is dropped on
529
556
  // arrival instead of appending rows that belong to the old list
530
557
  var groupPagingGenRef = (0, react_1.useRef)(0);
531
- var _178 = (0, react_1.useState)(""), readTabSection = _178[0], setReadTabSection = _178[1];
532
- var _179 = (0, react_1.useState)(false), readFloatingNav = _179[0], setReadFloatingNav = _179[1];
558
+ var _182 = (0, react_1.useState)(""), readTabSection = _182[0], setReadTabSection = _182[1];
559
+ var _183 = (0, react_1.useState)(false), readFloatingNav = _183[0], setReadFloatingNav = _183[1];
533
560
  var readTabSectionRefs = (0, react_1.useRef)({});
534
561
  //INFO : Used by Read
535
562
  //INFO : Used by Update
536
- var _180 = (0, react_1.useState)(false), modalVisible = _180[0], setModalVisible = _180[1];
537
- var _181 = (0, react_1.useState)(false), deleteModal = _181[0], setDeleteModal = _181[1];
538
- var _182 = (0, react_1.useState)(false), excelModal = _182[0], setExcelModal = _182[1];
539
- var _183 = (0, react_1.useState)(false), exportExcel = _183[0], setExportExcel = _183[1];
540
- var _184 = (0, react_1.useState)(""), exportType = _184[0], setExportType = _184[1];
541
- var _185 = (0, react_1.useState)(false), exportQR = _185[0], setExportQR = _185[1];
542
- var _186 = (0, react_1.useState)(function () {
563
+ var _184 = (0, react_1.useState)(false), modalVisible = _184[0], setModalVisible = _184[1];
564
+ var _185 = (0, react_1.useState)(false), deleteModal = _185[0], setDeleteModal = _185[1];
565
+ var _186 = (0, react_1.useState)(false), excelModal = _186[0], setExcelModal = _186[1];
566
+ var _187 = (0, react_1.useState)(false), exportExcel = _187[0], setExportExcel = _187[1];
567
+ var _188 = (0, react_1.useState)(""), exportType = _188[0], setExportType = _188[1];
568
+ var _189 = (0, react_1.useState)(false), exportQR = _189[0], setExportQR = _189[1];
569
+ var _190 = (0, react_1.useState)(function () {
543
570
  var _a, _b;
544
571
  var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
545
572
  return firstTabId;
546
- }), activeTab = _186[0], setActiveTab = _186[1];
547
- var _187 = (0, react_1.useState)(false), signatureSigning = _187[0], setSignatureSigning = _187[1];
548
- var _188 = (0, react_1.useState)({}), selectedData = _188[0], setSelectedData = _188[1];
549
- var _189 = (0, react_1.useState)(""), selectedObjectStructureId = _189[0], setSelectedObjectStructureId = _189[1];
550
- var _190 = (0, react_1.useState)(""), selectedObjectId = _190[0], setSelectedObjectId = _190[1];
551
- var _191 = (0, react_1.useState)(""), selectedListAddressId = _191[0], setSelectedListAddressId = _191[1];
552
- var _192 = (0, react_1.useState)(-1), selectedListAddressIndex = _192[0], setSelectedListAddressIndex = _192[1];
553
- var _193 = (0, react_1.useState)({
573
+ }), activeTab = _190[0], setActiveTab = _190[1];
574
+ var _191 = (0, react_1.useState)(false), signatureSigning = _191[0], setSignatureSigning = _191[1];
575
+ var _192 = (0, react_1.useState)({}), selectedData = _192[0], setSelectedData = _192[1];
576
+ var _193 = (0, react_1.useState)(""), selectedObjectStructureId = _193[0], setSelectedObjectStructureId = _193[1];
577
+ var _194 = (0, react_1.useState)(""), selectedObjectId = _194[0], setSelectedObjectId = _194[1];
578
+ var _195 = (0, react_1.useState)(""), selectedListAddressId = _195[0], setSelectedListAddressId = _195[1];
579
+ var _196 = (0, react_1.useState)(-1), selectedListAddressIndex = _196[0], setSelectedListAddressIndex = _196[1];
580
+ var _197 = (0, react_1.useState)({
554
581
  lat: 0,
555
582
  lng: 0,
556
583
  name: "",
557
- }), selectedListAddress = _193[0], setSelectedListAddress = _193[1];
558
- var _194 = (0, react_1.useState)({}), selectedObjectData = _194[0], setSelectedObjectData = _194[1];
559
- var _195 = (0, react_1.useState)(null), objectCellEdit = _195[0], setObjectCellEdit = _195[1];
560
- var _196 = (0, react_1.useState)(false), referenceLoading = _196[0], setReferenceLoading = _196[1];
561
- var _197 = (0, react_1.useState)({}), referencesOptions = _197[0], setReferencesOptions = _197[1];
562
- var _198 = (0, react_1.useState)({}), referencesDetails = _198[0], setReferencesDetails = _198[1];
563
- var _199 = (0, react_1.useState)({}), listReferencesOptions = _199[0], setListReferencesOptions = _199[1];
564
- var _200 = (0, react_1.useState)({}), referenceDeleteTableData = _200[0], setReferenceDeleteTableData = _200[1];
565
- var _201 = (0, react_1.useState)([]), relatedSections = _201[0], setRelatedSections = _201[1];
566
- var _202 = (0, react_1.useState)(0), referenceDeleteIndex = _202[0], setReferenceDeleteIndex = _202[1];
567
- var _203 = (0, react_1.useState)({
584
+ }), selectedListAddress = _197[0], setSelectedListAddress = _197[1];
585
+ var _198 = (0, react_1.useState)({}), selectedObjectData = _198[0], setSelectedObjectData = _198[1];
586
+ var _199 = (0, react_1.useState)(null), objectCellEdit = _199[0], setObjectCellEdit = _199[1];
587
+ var _200 = (0, react_1.useState)(false), referenceLoading = _200[0], setReferenceLoading = _200[1];
588
+ var _201 = (0, react_1.useState)({}), referencesOptions = _201[0], setReferencesOptions = _201[1];
589
+ var _202 = (0, react_1.useState)({}), referencesDetails = _202[0], setReferencesDetails = _202[1];
590
+ var _203 = (0, react_1.useState)({}), listReferencesOptions = _203[0], setListReferencesOptions = _203[1];
591
+ var _204 = (0, react_1.useState)({}), referenceDeleteTableData = _204[0], setReferenceDeleteTableData = _204[1];
592
+ var _205 = (0, react_1.useState)([]), relatedSections = _205[0], setRelatedSections = _205[1];
593
+ var _206 = (0, react_1.useState)(0), referenceDeleteIndex = _206[0], setReferenceDeleteIndex = _206[1];
594
+ var _207 = (0, react_1.useState)({
568
595
  id: "",
569
596
  name: "",
570
597
  type: "string",
571
- }), referenceCreationModal = _203[0], setReferenceCreationModal = _203[1];
572
- var _204 = (0, react_1.useState)({}), referenceModelSchema = _204[0], setReferenceSchema = _204[1];
573
- var _205 = (0, react_1.useState)([]), kanbanChecked = _205[0], setKanbanChecked = _205[1];
598
+ }), referenceCreationModal = _207[0], setReferenceCreationModal = _207[1];
599
+ var _208 = (0, react_1.useState)({}), referenceModelSchema = _208[0], setReferenceSchema = _208[1];
600
+ var _209 = (0, react_1.useState)([]), kanbanChecked = _209[0], setKanbanChecked = _209[1];
574
601
  //INFO : Offline
575
- var _206 = (0, react_1.useState)(0), offlineDataLength = _206[0], setOfflineDataLength = _206[1];
576
- var _207 = (0, react_1.useState)(false), offlineModal = _207[0], setOfflineModal = _207[1];
602
+ var _210 = (0, react_1.useState)(0), offlineDataLength = _210[0], setOfflineDataLength = _210[1];
603
+ var _211 = (0, react_1.useState)(false), offlineModal = _211[0], setOfflineModal = _211[1];
577
604
  // INFO: live-stream state — driven by socket connection and navigator.onLine
578
- var _208 = (0, react_1.useState)(false), isLive = _208[0], setIsLive = _208[1];
579
- var _209 = (0, react_1.useState)(false), isLiveOffline = _209[0], setIsLiveOffline = _209[1];
605
+ var _212 = (0, react_1.useState)(false), isLive = _212[0], setIsLive = _212[1];
606
+ var _213 = (0, react_1.useState)(false), isLiveOffline = _213[0], setIsLiveOffline = _213[1];
580
607
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
581
608
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
582
609
  // Independent of SSE status so it works even when bareSocketName is not set.
583
- var _210 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _210[0], setIsNetworkOffline = _210[1];
610
+ var _214 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _214[0], setIsNetworkOffline = _214[1];
584
611
  var previousType = (0, react_1.useRef)(null);
585
612
  var previousSelectedData = (0, react_1.useRef)(null);
586
613
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -697,16 +724,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
697
724
  * viewId still wins when present: it is a deliberate destination, from a
698
725
  * shared link or a back button.
699
726
  */
700
- var defaultTabName = (_3 = (_2 = (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.extendedTabs) === null || _2 === void 0 ? void 0 : _2.find(function (eachTab) { return eachTab.defaultTab; })) === null || _3 === void 0 ? void 0 : _3.name;
727
+ var defaultTabName = (_5 = (_4 = (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.extendedTabs) === null || _4 === void 0 ? void 0 : _4.find(function (eachTab) { return eachTab.defaultTab; })) === null || _5 === void 0 ? void 0 : _5.name;
701
728
  // INFO: the pinned tab is a LIST destination. Falling back to it while a
702
729
  // record is open resolved the read view to a list tab, which renderTabContent
703
730
  // refuses — so General Details rendered nothing. Only a list falls back.
704
- var viewType = (_5 = (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.viewId) !== null && _5 !== void 0 ? _5 : (resolvedType === "list" && defaultTabName
731
+ var viewType = (_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.viewId) !== null && _7 !== void 0 ? _7 : (resolvedType === "list" && defaultTabName
705
732
  ? (0, utils_1.lowercaseTextToId)(defaultTabName)
706
733
  : "general");
707
734
  var isFirebaseClient = devSettings.server === "firebase";
708
735
  var isFirebase = isFirebaseClient || devSettings.server === "fbServer";
709
- var dbModule = isFirebaseClient ? (_6 = props.lib) === null || _6 === void 0 ? void 0 : _6.firebase : (_7 = props.lib) === null || _7 === void 0 ? void 0 : _7.axios;
736
+ var dbModule = isFirebaseClient ? (_8 = props.lib) === null || _8 === void 0 ? void 0 : _8.firebase : (_9 = props.lib) === null || _9 === void 0 ? void 0 : _9.axios;
710
737
  var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
711
738
  var selectedRelated = resolvedType === "read"
712
739
  ? relatedSections.find(function (eachSection) { return eachSection.id === viewType; })
@@ -784,32 +811,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
784
811
  }, [
785
812
  resolvedType,
786
813
  props.id,
787
- (_8 = props.space) === null || _8 === void 0 ? void 0 : _8._id,
814
+ (_10 = props.space) === null || _10 === void 0 ? void 0 : _10._id,
788
815
  props.devSettings.schemaEndpoint,
789
- (_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.showRelatedTab,
816
+ (_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.showRelatedTab,
790
817
  ]);
791
818
  /* eslint-enable */
792
819
  // INFO: the view settings panel (columns, sort, rows per page) is standard on
793
820
  // the new DTW; bareViewSettings stays the opt-in for legacy and bare DTWs
794
- var isViewSettingsEnabled = ((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareViewSettings) || ((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareNewDTW)
821
+ var isViewSettingsEnabled = ((_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareViewSettings) || ((_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareNewDTW)
795
822
  ? true
796
823
  : false;
797
824
  // INFO: a consumer that wires onChangeHide owns the hide at schema level
798
825
  // (shared by every user) — toggling writes to the model and calls back. Without it
799
826
  // the hide is this user's own and lives in userHiddenColumnIds.
800
- var isSchemaHideMode = ((_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.onChangeHide) ? true : false;
827
+ var isSchemaHideMode = ((_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.onChangeHide) ? true : false;
801
828
  // INFO: rows per page is a view setting the user can change, so it starts from
802
829
  // the persisted value and falls back to the consumer's limit
803
- var _211 = (0, react_1.useState)((_14 = (_13 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _13 !== void 0 ? _13 : props.limit) !== null && _14 !== void 0 ? _14 : 10), pageLimit = _211[0], setPageLimit = _211[1];
830
+ var _215 = (0, react_1.useState)((_16 = (_15 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _15 !== void 0 ? _15 : props.limit) !== null && _16 !== void 0 ? _16 : 10), pageLimit = _215[0], setPageLimit = _215[1];
804
831
  var limit = pageLimit;
805
- var isSavedViewsEnabled = !!((_15 = props.organise) === null || _15 === void 0 ? void 0 : _15.savedViews) && resolvedType === "list";
832
+ var isSavedViewsEnabled = !!((_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.savedViews) && resolvedType === "list";
806
833
  // INFO: an app that stores views takes over from this browser's storage, so
807
834
  // every view is the team's and nothing is kept locally
808
- var isAppViews = ((_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.sharedViews) !== undefined ||
809
- !!((_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.onChangeSharedViews);
835
+ var isAppViews = ((_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.sharedViews) !== undefined ||
836
+ !!((_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.onChangeSharedViews);
810
837
  // INFO: a saved view carries its sort, so the sort is held here as with persistViewState
811
838
  var isInternalSort = isPersistEnabled || isSavedViewsEnabled;
812
- var activeSortId = (isInternalSort && persistedSort) || ((_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.sort);
839
+ var activeSortId = (isInternalSort && persistedSort) || ((_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.sort);
813
840
  var handleSortColumn = function (value) {
814
841
  var _a, _b, _c, _d;
815
842
  if (isInternalSort)
@@ -839,7 +866,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
839
866
  // INFO: Firebase pages by document cursor and a union by skip, so neither
840
867
  // can hand over the whole set — there formula columns are not offered for
841
868
  // sorting or filtering, rather than ordering one page
842
- var isFormulaViewSupported = !isFirebase && !((_20 = (_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.unionCollections) === null || _20 === void 0 ? void 0 : _20.length);
869
+ var isFormulaViewSupported = !isFirebase && !((_22 = (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.unionCollections) === null || _22 === void 0 ? void 0 : _22.length);
843
870
  var formulaSort = isFormulaViewSupported &&
844
871
  (activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) &&
845
872
  formulaColumnIds.includes(activeSortId.sortId)
@@ -848,10 +875,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
848
875
  // INFO: a referenced record is joined by MongoWrapper's lookup and a list
849
876
  // row is matched by its Mongo path — neither Firebase nor a union read runs
850
877
  // them
851
- var flexFilterExtras = !isFirebase && !((_22 = (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.unionCollections) === null || _22 === void 0 ? void 0 : _22.length)
878
+ var flexFilterExtras = !isFirebase && !((_24 = (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.unionCollections) === null || _24 === void 0 ? void 0 : _24.length)
852
879
  ? {
853
- references: (_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareFlexFilterReferences,
854
- listObjects: (_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareFlexFilterListObjects,
880
+ references: (_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareFlexFilterReferences,
881
+ listObjects: (_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareFlexFilterListObjects,
855
882
  }
856
883
  : undefined;
857
884
  var formulaFlexQueries = isFormulaViewSupported && formulaColumnIds.length > 0
@@ -904,18 +931,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
904
931
  displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
905
932
  };
906
933
  };
907
- var _212 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _212.canUpdateRecord, canInlineUpdate = _212.canInlineUpdate, canBatchUpdate = _212.canBatchUpdate, canDeleteRecord = _212.canDeleteRecord;
908
- var isEditor = ((_25 = props.edit) === null || _25 === void 0 ? void 0 : _25.allEditable) ? true : false;
909
- var isOffline = (_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareOffline;
934
+ var _216 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _216.canUpdateRecord, canInlineUpdate = _216.canInlineUpdate, canBatchUpdate = _216.canBatchUpdate, canDeleteRecord = _216.canDeleteRecord;
935
+ var isEditor = ((_27 = props.edit) === null || _27 === void 0 ? void 0 : _27.allEditable) ? true : false;
936
+ var isOffline = (_28 = props.bareSettings) === null || _28 === void 0 ? void 0 : _28.bareOffline;
910
937
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
911
938
  // the live network state — online saves go to the server even if bareOffline
912
939
  // is true, offline saves go to IDB as normal.
913
- var isOfflineNetworkListener = isOffline && ((_27 = props.bareSettings) === null || _27 === void 0 ? void 0 : _27.bareOfflineNetworkListener);
914
- var showId = (_28 = props.space) === null || _28 === void 0 ? void 0 : _28.showId;
940
+ var isOfflineNetworkListener = isOffline && ((_29 = props.bareSettings) === null || _29 === void 0 ? void 0 : _29.bareOfflineNetworkListener);
941
+ var showId = (_30 = props.space) === null || _30 === void 0 ? void 0 : _30.showId;
915
942
  var remainId = showId || selectedObjectStructureId ? true : false;
916
- var idField = ((_29 = props.space) === null || _29 === void 0 ? void 0 : _29.idField) || ((_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.idField);
917
- var pipeline = (_31 = props === null || props === void 0 ? void 0 : props.space) === null || _31 === void 0 ? void 0 : _31.pipeline;
918
- if ((_32 = props.bareSettings) === null || _32 === void 0 ? void 0 : _32.bareListPipeline) {
943
+ var idField = ((_31 = props.space) === null || _31 === void 0 ? void 0 : _31.idField) || ((_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.idField);
944
+ var pipeline = (_33 = props === null || props === void 0 ? void 0 : props.space) === null || _33 === void 0 ? void 0 : _33.pipeline;
945
+ if ((_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareListPipeline) {
919
946
  pipeline = pipeline
920
947
  ? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
921
948
  }
@@ -928,24 +955,24 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
928
955
  * three records came back instead of five files, and each tile received the
929
956
  * whole array rather than one file, so every one of them read "Attachment".
930
957
  */
931
- var fileViewColumnId = (_36 = (_35 = ((_34 = (_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.extendedTabs) !== null && _34 !== void 0 ? _34 : []).find(function (eachTab) {
958
+ var fileViewColumnId = (_38 = (_37 = ((_36 = (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.extendedTabs) !== null && _36 !== void 0 ? _36 : []).find(function (eachTab) {
932
959
  return eachTab.viewType === "file" &&
933
960
  (0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
934
- })) === null || _35 === void 0 ? void 0 : _35.fileSettings) === null || _36 === void 0 ? void 0 : _36.columnId;
935
- var hasNavigation = ((_37 = props.organise) === null || _37 === void 0 ? void 0 : _37.handleNavigate) ? true : false;
961
+ })) === null || _37 === void 0 ? void 0 : _37.fileSettings) === null || _38 === void 0 ? void 0 : _38.columnId;
962
+ var hasNavigation = ((_39 = props.organise) === null || _39 === void 0 ? void 0 : _39.handleNavigate) ? true : false;
936
963
  var formColumn = "grid-cols-12";
937
- var useMobileView = (_39 = (_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareUpdateMobileView) !== null && _39 !== void 0 ? _39 : false;
964
+ var useMobileView = (_41 = (_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.bareUpdateMobileView) !== null && _41 !== void 0 ? _41 : false;
938
965
  var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
939
- var isActivityLog = (((_41 = (_40 = props.edit) === null || _40 === void 0 ? void 0 : _40.activityLog) === null || _41 === void 0 ? void 0 : _41.enableComments) &&
940
- ((_42 = props.edit) === null || _42 === void 0 ? void 0 : _42.activityLog.commentCollectionId)) ||
941
- (((_44 = (_43 = props.edit) === null || _43 === void 0 ? void 0 : _43.activityLog) === null || _44 === void 0 ? void 0 : _44.enableLogs) &&
942
- ((_45 = props.edit) === null || _45 === void 0 ? void 0 : _45.activityLog.logsCollectionId));
943
- var customPaginationSize = ((_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.customPaginationCount)
966
+ var isActivityLog = (((_43 = (_42 = props.edit) === null || _42 === void 0 ? void 0 : _42.activityLog) === null || _43 === void 0 ? void 0 : _43.enableComments) &&
967
+ ((_44 = props.edit) === null || _44 === void 0 ? void 0 : _44.activityLog.commentCollectionId)) ||
968
+ (((_46 = (_45 = props.edit) === null || _45 === void 0 ? void 0 : _45.activityLog) === null || _46 === void 0 ? void 0 : _46.enableLogs) &&
969
+ ((_47 = props.edit) === null || _47 === void 0 ? void 0 : _47.activityLog.logsCollectionId));
970
+ var customPaginationSize = ((_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.customPaginationCount)
944
971
  ? props.organise.customPaginationCount(size)
945
972
  : undefined;
946
973
  //TODO : Code - Pass ...devSettings, search dbEndpoint:
947
974
  var writeServerQuery = new writeQuery_1.WriteQuery({
948
- dbModule: (_47 = props.lib) === null || _47 === void 0 ? void 0 : _47.axios,
975
+ dbModule: (_49 = props.lib) === null || _49 === void 0 ? void 0 : _49.axios,
949
976
  dbType: devSettings.server,
950
977
  dbCollection: props.collectionId,
951
978
  dbEndpoint: devSettings.dbEndpoint,
@@ -953,7 +980,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
953
980
  dbUserToken: devSettings.dbUserToken,
954
981
  });
955
982
  var readServerQuery = new readQuery_1.ReadQuery({
956
- dbModule: (_48 = props.lib) === null || _48 === void 0 ? void 0 : _48.axios,
983
+ dbModule: (_50 = props.lib) === null || _50 === void 0 ? void 0 : _50.axios,
957
984
  dbType: devSettings.server,
958
985
  dbCollection: props.collectionId,
959
986
  dbEndpoint: devSettings.dbEndpoint,
@@ -961,12 +988,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
961
988
  dbUserToken: devSettings.dbUserToken,
962
989
  });
963
990
  var moreButtonPopUp = [
964
- ((_49 = props.edit) === null || _49 === void 0 ? void 0 : _49.allEditable) &&
991
+ ((_51 = props.edit) === null || _51 === void 0 ? void 0 : _51.allEditable) &&
965
992
  // INFO: the import runs on the server (importEndpoint), so a Firestore
966
993
  // datasheet served through one can import; only the browser-direct
967
994
  // Firebase client has no server to import through
968
995
  !isFirebaseClient &&
969
- !((_51 = (_50 = props.organise) === null || _50 === void 0 ? void 0 : _50.exportSettings) === null || _51 === void 0 ? void 0 : _51.hideImportCSV)
996
+ !((_53 = (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.exportSettings) === null || _53 === void 0 ? void 0 : _53.hideImportCSV)
970
997
  ? {
971
998
  text: "Import Excel",
972
999
  onClick: function () {
@@ -975,7 +1002,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
975
1002
  },
976
1003
  }
977
1004
  : null,
978
- !((_53 = (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.exportSettings) === null || _53 === void 0 ? void 0 : _53.hideExportCSV)
1005
+ !((_55 = (_54 = props.organise) === null || _54 === void 0 ? void 0 : _54.exportSettings) === null || _55 === void 0 ? void 0 : _55.hideExportCSV)
979
1006
  ? {
980
1007
  text: "Export CSV",
981
1008
  onClick: function () {
@@ -985,7 +1012,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
985
1012
  },
986
1013
  }
987
1014
  : null,
988
- !((_55 = (_54 = props.organise) === null || _54 === void 0 ? void 0 : _54.exportSettings) === null || _55 === void 0 ? void 0 : _55.hideExportExcel)
1015
+ !((_57 = (_56 = props.organise) === null || _56 === void 0 ? void 0 : _56.exportSettings) === null || _57 === void 0 ? void 0 : _57.hideExportExcel)
989
1016
  ? {
990
1017
  text: "Export Excel",
991
1018
  onClick: function () {
@@ -995,7 +1022,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
995
1022
  },
996
1023
  }
997
1024
  : null,
998
- !((_57 = (_56 = props.organise) === null || _56 === void 0 ? void 0 : _56.exportSettings) === null || _57 === void 0 ? void 0 : _57.hideExportPDF)
1025
+ !((_59 = (_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.exportSettings) === null || _59 === void 0 ? void 0 : _59.hideExportPDF)
999
1026
  ? {
1000
1027
  text: "Export PDF",
1001
1028
  onClick: function () {
@@ -1005,7 +1032,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1005
1032
  },
1006
1033
  }
1007
1034
  : null,
1008
- !((_59 = (_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.exportSettings) === null || _59 === void 0 ? void 0 : _59.hideExportQR)
1035
+ !((_61 = (_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.exportSettings) === null || _61 === void 0 ? void 0 : _61.hideExportQR)
1009
1036
  ? {
1010
1037
  text: "Export QR",
1011
1038
  onClick: function () {
@@ -1015,7 +1042,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1015
1042
  },
1016
1043
  }
1017
1044
  : null,
1018
- !((_61 = (_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.exportSettings) === null || _61 === void 0 ? void 0 : _61.hideExportQR)
1045
+ !((_63 = (_62 = props.organise) === null || _62 === void 0 ? void 0 : _62.exportSettings) === null || _63 === void 0 ? void 0 : _63.hideExportQR)
1019
1046
  ? {
1020
1047
  text: "Export QR(Data)",
1021
1048
  onClick: function () {
@@ -1025,7 +1052,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1025
1052
  },
1026
1053
  }
1027
1054
  : null,
1028
- !((_63 = (_62 = props.organise) === null || _62 === void 0 ? void 0 : _62.exportSettings) === null || _63 === void 0 ? void 0 : _63.hideExportPrint)
1055
+ !((_65 = (_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.exportSettings) === null || _65 === void 0 ? void 0 : _65.hideExportPrint)
1029
1056
  ? {
1030
1057
  text: "Print",
1031
1058
  onClick: function () {
@@ -1035,7 +1062,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1035
1062
  },
1036
1063
  }
1037
1064
  : null,
1038
- !((_65 = (_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.exportSettings) === null || _65 === void 0 ? void 0 : _65.hideExportDraft)
1065
+ !((_67 = (_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.exportSettings) === null || _67 === void 0 ? void 0 : _67.hideExportDraft)
1039
1066
  ? {
1040
1067
  text: filterDraft ? "Show All Items" : "Filter Draft",
1041
1068
  onClick: function () {
@@ -1044,7 +1071,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1044
1071
  }
1045
1072
  : null,
1046
1073
  ].filter(Boolean);
1047
- if ((_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.moreSettings)
1074
+ if ((_68 = props.organise) === null || _68 === void 0 ? void 0 : _68.moreSettings)
1048
1075
  moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
1049
1076
  //=====================================================================================
1050
1077
  //SECTION: User Column Visibility Handlers
@@ -1052,14 +1079,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1052
1079
  // INFO: a write-back carries the schema's columns plus the user's one change,
1053
1080
  // never the hide/order a personal saved view put on screen
1054
1081
  var handleUpdateSchemaStructure = function (update) {
1055
- var _a;
1082
+ var _a, _b;
1056
1083
  var schemaColumns = update((_a = schemaStructureRef.current) !== null && _a !== void 0 ? _a : structure);
1057
1084
  if (schemaStructureRef.current)
1058
1085
  schemaStructureRef.current = schemaColumns;
1059
- return schemaColumns;
1086
+ // INFO: system columns were never the host's — they are not written back
1087
+ return (0, systemColumns_1.handleStripSystemColumns)(schemaColumns, ((_b = props.model) !== null && _b !== void 0 ? _b : []).map(function (each) { return each.id; }));
1088
+ };
1089
+ var handleSetShownSystemColumns = function (nextIds) {
1090
+ setShownSystemColumnIds(nextIds);
1091
+ setStructure(function (previous) {
1092
+ return previous.map(function (eachColumn) {
1093
+ return appendedSystemColumnIds.includes(eachColumn.id)
1094
+ ? __assign(__assign({}, eachColumn), { hide: !nextIds.includes(eachColumn.id) }) : eachColumn;
1095
+ });
1096
+ });
1060
1097
  };
1061
1098
  var handleToggleUserHiddenColumn = function (columnId) {
1062
1099
  var _a, _b;
1100
+ // INFO: a system column is shown or hidden for this view only, in either
1101
+ // hide mode — the host's schema never holds it
1102
+ if (appendedSystemColumnIds.includes(columnId)) {
1103
+ handleSetShownSystemColumns(shownSystemColumnIds.includes(columnId)
1104
+ ? shownSystemColumnIds.filter(function (eachId) { return eachId !== columnId; })
1105
+ : __spreadArray(__spreadArray([], shownSystemColumnIds, true), [columnId], false));
1106
+ return;
1107
+ }
1063
1108
  if ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeHide) {
1064
1109
  var nextHide_1 = !((_b = structure.find(function (eachColumn) { return eachColumn.id === columnId; })) === null || _b === void 0 ? void 0 : _b.hide);
1065
1110
  var handleSetHide = function (columns) {
@@ -1083,6 +1128,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1083
1128
  };
1084
1129
  var handleShowAllUserHiddenColumns = function () {
1085
1130
  var _a;
1131
+ if (appendedSystemColumnIds.length)
1132
+ handleSetShownSystemColumns(appendedSystemColumnIds);
1086
1133
  if ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeHide) {
1087
1134
  var handleShowAll = function (columns) {
1088
1135
  return columns.map(function (eachColumn) { return (__assign(__assign({}, eachColumn), { hide: false })); });
@@ -1407,13 +1454,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1407
1454
  // INFO: scroll mode reloads from page 0; the anchor restores the position
1408
1455
  pageIndex: renderCheckScrollMode() ? 0 : pageIndex, hiddenColumnIds: structure.filter(function (col) { return col.hide; }).map(function (col) { return col.id; }),
1409
1456
  // INFO: raw, so switching bareViewSettings off does not wipe the user's choice
1410
- userHiddenColumnIds: userHiddenColumnIds, columnOrder: structure.map(function (col) { return col.id; }), groupBy: groupId !== null && groupId !== void 0 ? groupId : "" }, scrollCaptureRef.current));
1457
+ userHiddenColumnIds: userHiddenColumnIds, shownSystemColumnIds: shownSystemColumnIds, columnOrder: structure.map(function (col) { return col.id; }), groupBy: groupId !== null && groupId !== void 0 ? groupId : "" }, scrollCaptureRef.current));
1411
1458
  };
1412
1459
  handleRegisterViewSnapshot(handleBuildViewSnapshot);
1413
1460
  //=====================================================================================
1414
1461
  //SECTION: Saved Views
1415
1462
  //=====================================================================================
1416
- var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_67 = props.organise) === null || _67 === void 0 ? void 0 : _67.persistKey, (_68 = devSettings.currentUser) === null || _68 === void 0 ? void 0 : _68.userEmail);
1463
+ var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.persistKey, (_70 = devSettings.currentUser) === null || _70 === void 0 ? void 0 : _70.userEmail);
1417
1464
  (0, react_1.useEffect)(function () {
1418
1465
  if (isSavedViewsEnabled && !isAppViews)
1419
1466
  setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
@@ -1468,7 +1515,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1468
1515
  var lastSentSharedViewsRef = (0, react_1.useRef)(null);
1469
1516
  (0, react_1.useEffect)(function () {
1470
1517
  lastSentSharedViewsRef.current = null;
1471
- }, [(_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.sharedViews]);
1518
+ }, [(_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.sharedViews]);
1472
1519
  var handleStoreSharedViews = function (update) {
1473
1520
  var _a, _b, _c;
1474
1521
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
@@ -1504,13 +1551,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1504
1551
  /* eslint-disable */
1505
1552
  }, [
1506
1553
  isSavedViewsEnabled,
1507
- (_70 = props.organise) === null || _70 === void 0 ? void 0 : _70.initialSavedViewId,
1508
- (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.defaultSavedViewId,
1509
- (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.sharedViews,
1554
+ (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.initialSavedViewId,
1555
+ (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.defaultSavedViewId,
1556
+ (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.sharedViews,
1510
1557
  savedViews,
1511
1558
  ]);
1512
1559
  /* eslint-enable */
1513
- var defaultSavedViewIds = ((_74 = (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.defaultSavedViews) !== null && _74 !== void 0 ? _74 : [])
1560
+ var defaultSavedViewIds = ((_76 = (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.defaultSavedViews) !== null && _76 !== void 0 ? _76 : [])
1514
1561
  .map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
1515
1562
  .join("|");
1516
1563
  // INFO: keyed on the ids, not the array, so an inline literal passed on every
@@ -1526,28 +1573,43 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1526
1573
  var handleResolveViewState = function (state) {
1527
1574
  var _a, _b, _c, _d, _e, _f;
1528
1575
  var model = (_a = props.model) !== null && _a !== void 0 ? _a : [];
1529
- return ((_f = (0, viewStatePersistence_1.handlePruneStaleColumns)(__assign({ filterSearchParams: initialFilterSearchParams, filterSelection: initialFilterSelection, filterReference: initialFilterReference, filterReferenceDate: (0, viewStatePersistence_1.serializeDateFilterState)(initialFilterReferenceDate), sort: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.sort, pageLimit: (_c = props.limit) !== null && _c !== void 0 ? _c : 10, userHiddenColumnIds: [], hiddenColumnIds: model
1576
+ return ((_f = (0, viewStatePersistence_1.handlePruneStaleColumns)(__assign({ filterSearchParams: initialFilterSearchParams, filterSelection: initialFilterSelection, filterReference: initialFilterReference, filterReferenceDate: (0, viewStatePersistence_1.serializeDateFilterState)(initialFilterReferenceDate), sort: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.sort, pageLimit: (_c = props.limit) !== null && _c !== void 0 ? _c : 10, userHiddenColumnIds: [], shownSystemColumnIds: [], hiddenColumnIds: model
1530
1577
  .filter(function (eachColumn) { return eachColumn.hide; })
1531
1578
  .map(function (eachColumn) { return eachColumn.id; }), columnOrder: model.map(function (eachColumn) { return eachColumn.id; }), groupBy: (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.groupBy) !== null && _e !== void 0 ? _e : "" }, (state !== null && state !== void 0 ? state : {})), model, (0, flexFilter_1.handleBuildFlexFilterStructure)(model, flexFilterExtras))) !== null && _f !== void 0 ? _f : {});
1532
1579
  };
1533
1580
  var handleApplyViewColumns = function (columns, state) {
1534
- var _a;
1581
+ var _a, _b;
1535
1582
  var order = new Map(((_a = state.columnOrder) !== null && _a !== void 0 ? _a : []).map(function (eachId, index) { return [eachId, index]; }));
1536
1583
  var ordered = __spreadArray([], columns, true).sort(function (a, b) { var _a, _b; return ((_a = order.get(a.id)) !== null && _a !== void 0 ? _a : order.size) - ((_b = order.get(b.id)) !== null && _b !== void 0 ? _b : order.size); });
1584
+ var shownSystemIds = (_b = state.shownSystemColumnIds) !== null && _b !== void 0 ? _b : [];
1585
+ var handleSystemHide = function (columns) {
1586
+ return appendedSystemColumnIds.length
1587
+ ? columns.map(function (eachColumn) {
1588
+ return appendedSystemColumnIds.includes(eachColumn.id)
1589
+ ? __assign(__assign({}, eachColumn), { hide: !shownSystemIds.includes(eachColumn.id) }) : eachColumn;
1590
+ })
1591
+ : columns;
1592
+ };
1537
1593
  // INFO: schema-level hides move only in schema-hide mode, and only on this
1538
1594
  // screen — a personal view never writes back through onChangeHide
1539
1595
  if (!isSchemaHideMode || !state.hiddenColumnIds)
1540
- return ordered;
1541
- return ordered.map(function (eachColumn) {
1596
+ return handleSystemHide(ordered);
1597
+ return handleSystemHide(ordered.map(function (eachColumn) {
1542
1598
  var _a, _b;
1543
1599
  return (__assign(__assign({}, eachColumn), { hide: (_b = (_a = state.hiddenColumnIds) === null || _a === void 0 ? void 0 : _a.includes(eachColumn.id)) !== null && _b !== void 0 ? _b : false }));
1544
- });
1600
+ }));
1545
1601
  };
1546
1602
  // INFO: the columns a list can be grouped by — the app's own list, else
1547
- // every column the reference picker offers
1603
+ // every column the reference picker offers, else the status, checkbox and
1604
+ // person columns, monday's groupable kinds
1548
1605
  var handleGetGroupByOptions = function () {
1549
1606
  var _a, _b, _c, _d, _e, _f;
1550
- return (_f = (_c = (_b = (_a = props === null || props === void 0 ? void 0 : props.organise) === null || _a === void 0 ? void 0 : _a.renderGroupByOptions) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : (_e = (_d = props === null || props === void 0 ? void 0 : props.organise) === null || _d === void 0 ? void 0 : _d.renderReferenceLabelOptions) === null || _e === void 0 ? void 0 : _e.call(_d, props.collectionId, true)) !== null && _f !== void 0 ? _f : [];
1607
+ return (_f = (_c = (_b = (_a = props === null || props === void 0 ? void 0 : props.organise) === null || _a === void 0 ? void 0 : _a.renderGroupByOptions) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : (_e = (_d = props === null || props === void 0 ? void 0 : props.organise) === null || _d === void 0 ? void 0 : _d.renderReferenceLabelOptions) === null || _e === void 0 ? void 0 : _e.call(_d, props.collectionId, true)) !== null && _f !== void 0 ? _f : structure
1608
+ .filter(function (eachColumn) {
1609
+ return !eachColumn.hide &&
1610
+ ["list", "boolean", "person"].includes(eachColumn.type);
1611
+ })
1612
+ .map(function (eachColumn) { return ({ key: eachColumn.id, label: eachColumn.name }); });
1551
1613
  };
1552
1614
  // INFO: notify — only a user's choice is handed back; a list opening on a
1553
1615
  // view or syncing the host's own groupBy tells the host nothing new
@@ -1563,7 +1625,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1563
1625
  // so its sort is not handed back (a host saving sort would write it on
1564
1626
  // every open)
1565
1627
  var handleApplySavedView = function (view, isOpening) {
1566
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
1628
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
1567
1629
  var next = handleResolveViewState((_a = view === null || view === void 0 ? void 0 : view.state) !== null && _a !== void 0 ? _a : null);
1568
1630
  var isQueryChanged = !(0, viewStatePersistence_1.handleIsSameViewState)((0, viewStatePersistence_1.handlePickQueryState)(handleBuildViewSnapshot()), (0, viewStatePersistence_1.handlePickQueryState)(next));
1569
1631
  handleClearFlexFilterTypingTimeout();
@@ -1588,6 +1650,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1588
1650
  setPageLimit(next.pageLimit);
1589
1651
  handleChangeGroupBy((_j = next.groupBy) !== null && _j !== void 0 ? _j : "", !isOpening);
1590
1652
  setUserHiddenColumnIds((_k = next.userHiddenColumnIds) !== null && _k !== void 0 ? _k : []);
1653
+ setShownSystemColumnIds((_l = next.shownSystemColumnIds) !== null && _l !== void 0 ? _l : []);
1591
1654
  if (view) {
1592
1655
  if (!schemaStructureRef.current)
1593
1656
  schemaStructureRef.current = structure;
@@ -1602,12 +1665,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1602
1665
  pendingViewCondKeyRef.current = JSON.stringify(handleReadQueryHocCond());
1603
1666
  handleClearDataByFilter();
1604
1667
  if (pageIndex !== 0)
1605
- (_m = (_l = props.organise) === null || _l === void 0 ? void 0 : _l.onChangePagination) === null || _m === void 0 ? void 0 : _m.call(_l, 0);
1606
- (_p = (_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareListHandleFilter) === null || _p === void 0 ? void 0 : _p.call(_o, (_q = next.filterSearchParams) !== null && _q !== void 0 ? _q : {}, (_r = next.filterSelection) !== null && _r !== void 0 ? _r : {}, next.filterReferenceDate
1668
+ (_o = (_m = props.organise) === null || _m === void 0 ? void 0 : _m.onChangePagination) === null || _o === void 0 ? void 0 : _o.call(_m, 0);
1669
+ (_q = (_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareListHandleFilter) === null || _q === void 0 ? void 0 : _q.call(_p, (_r = next.filterSearchParams) !== null && _r !== void 0 ? _r : {}, (_s = next.filterSelection) !== null && _s !== void 0 ? _s : {}, next.filterReferenceDate
1607
1670
  ? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
1608
- : initialFilterReferenceDate, (_s = next.filterReference) !== null && _s !== void 0 ? _s : {});
1671
+ : initialFilterReferenceDate, (_t = next.filterReference) !== null && _t !== void 0 ? _t : {});
1609
1672
  }
1610
- setActiveSavedViewId((_t = view === null || view === void 0 ? void 0 : view.id) !== null && _t !== void 0 ? _t : null);
1673
+ setActiveSavedViewId((_u = view === null || view === void 0 ? void 0 : view.id) !== null && _u !== void 0 ? _u : null);
1611
1674
  setDeletingSavedViewId(null);
1612
1675
  };
1613
1676
  // INFO: re-read storage before each write so a change made in another browser
@@ -1752,6 +1815,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1752
1815
  structure,
1753
1816
  persistedSort,
1754
1817
  userHiddenColumnIds,
1818
+ shownSystemColumnIds,
1755
1819
  pageLimit,
1756
1820
  ]);
1757
1821
  /* eslint-enable */
@@ -1775,7 +1839,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1775
1839
  var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
1776
1840
  scrollRestoredRef.current = isSwitch || isOtherListReturn;
1777
1841
  /* eslint-disable */
1778
- }, [props.collectionId, (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.persistKey]);
1842
+ }, [props.collectionId, (_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.persistKey]);
1779
1843
  /* eslint-enable */
1780
1844
  // INFO: wait a frame — rows land in state one tick before layout
1781
1845
  (0, react_1.useEffect)(function () {
@@ -1810,7 +1874,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1810
1874
  (0, react_1.useEffect)(function () {
1811
1875
  handleOfflinePrefetch();
1812
1876
  /* eslint-disable */
1813
- }, [props.collectionId, (_76 = props.bareSettings) === null || _76 === void 0 ? void 0 : _76.bareOffline]);
1877
+ }, [props.collectionId, (_78 = props.bareSettings) === null || _78 === void 0 ? void 0 : _78.bareOffline]);
1814
1878
  /* eslint-enable */
1815
1879
  // INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
1816
1880
  // Calls through handleRefreshRef so the interval always dispatches the latest
@@ -1830,7 +1894,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1830
1894
  }, interval);
1831
1895
  return function () { return clearInterval(timer); };
1832
1896
  /* eslint-disable */
1833
- }, [(_77 = props.bareSettings) === null || _77 === void 0 ? void 0 : _77.barePollingInterval, isLive, isNetworkOffline]);
1897
+ }, [(_79 = props.bareSettings) === null || _79 === void 0 ? void 0 : _79.barePollingInterval, isLive, isNetworkOffline]);
1834
1898
  /* eslint-enable */
1835
1899
  // INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
1836
1900
  // EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
@@ -1872,7 +1936,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1872
1936
  };
1873
1937
  /* eslint-disable */
1874
1938
  }, [
1875
- (_78 = props.bareSettings) === null || _78 === void 0 ? void 0 : _78.bareSocketName,
1939
+ (_80 = props.bareSettings) === null || _80 === void 0 ? void 0 : _80.bareSocketName,
1876
1940
  props.collectionId,
1877
1941
  props.devSettings.sseEndpoint,
1878
1942
  props.devSettings.dbAPIToken,
@@ -2088,7 +2152,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2088
2152
  // restored column visibility/order from localStorage
2089
2153
  var isRestoringView = isPersistEnabled && !!persistedState && !persistedViewMountedRef.current;
2090
2154
  if (!isRestoringView) {
2091
- setStructure((_a = props.model) !== null && _a !== void 0 ? _a : []);
2155
+ setStructure(handleWithSystemColumns((_a = props.model) !== null && _a !== void 0 ? _a : []));
2092
2156
  schemaStructureRef.current = null;
2093
2157
  }
2094
2158
  persistedViewMountedRef.current = true;
@@ -2132,10 +2196,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2132
2196
  props.collectionId,
2133
2197
  props.model,
2134
2198
  props.localURLEndpoint,
2135
- (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.extendedTabs,
2136
- (_80 = props.organise) === null || _80 === void 0 ? void 0 : _80.viewId,
2137
- (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.additionalQuery,
2138
- (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.groupBy,
2199
+ (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.extendedTabs,
2200
+ (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.viewId,
2201
+ (_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.additionalQuery,
2202
+ (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.groupBy,
2139
2203
  resolvedType,
2140
2204
  ]);
2141
2205
  /**
@@ -2287,7 +2351,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2287
2351
  };
2288
2352
  }, 100);
2289
2353
  return function () { return clearTimeout(timeoutId); };
2290
- }, [(_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.showReadFloatingNav, resolvedType, props.id, loading]);
2354
+ }, [(_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.showReadFloatingNav, resolvedType, props.id, loading]);
2291
2355
  (0, react_1.useEffect)(function () {
2292
2356
  if (resolvedType !== "read")
2293
2357
  return;
@@ -2771,6 +2835,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2771
2835
  var sort = (activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) && formulaColumnIds.includes(activeSortId.sortId)
2772
2836
  ? undefined
2773
2837
  : activeSortId || undefined;
2838
+ // INFO: a date range sorts on its start, a timer on its total and the
2839
+ // Record ID column on the record's own id
2840
+ if (sort === null || sort === void 0 ? void 0 : sort.sortId) {
2841
+ var sortColumn = structure.find(function (each) { return each.id === (sort === null || sort === void 0 ? void 0 : sort.sortId); });
2842
+ if ((sortColumn === null || sortColumn === void 0 ? void 0 : sortColumn.type) === "dateRange")
2843
+ sort = __assign(__assign({}, sort), { sortId: (0, dateRange_1.handleGetDateRangeQueryId)(sortColumn.id) });
2844
+ else if ((sortColumn === null || sortColumn === void 0 ? void 0 : sortColumn.type) === "timeTracking")
2845
+ sort = __assign(__assign({}, sort), { sortId: "".concat(sortColumn.id, ".totalSeconds") });
2846
+ else
2847
+ sort = __assign(__assign({}, sort), { sortId: (0, systemColumns_1.handleGetSystemColumnQueryId)(sort.sortId) });
2848
+ }
2774
2849
  if (isFirebase) {
2775
2850
  // INFO: Firestore requires the first orderBy to match the range/startAt
2776
2851
  // field, so a search query always forces the sort onto the search column
@@ -3032,6 +3107,97 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3032
3107
  /* eslint-disable */
3033
3108
  }, [formulaSignature]);
3034
3109
  /* eslint-enable */
3110
+ // INFO: a display row is built from the columns at the time it was read —
3111
+ // a button, timer or rating cell exists only if its column did. A column
3112
+ // added, edited or removed after that left its cells blank until the list
3113
+ // was read again, so the rows held are rebuilt against the new columns
3114
+ // instead. That covers a read still in flight when the columns changed too:
3115
+ // it lands built from the old ones, and is rebuilt the same way. Hiding or
3116
+ // resizing a column changes nothing a cell shows.
3117
+ var columnSignature = JSON.stringify(structure
3118
+ .map(function (_a) {
3119
+ var hide = _a.hide, width = _a.width, eachColumn = __rest(_a, ["hide", "width"]);
3120
+ return eachColumn;
3121
+ })
3122
+ .sort(function (a, b) { return String(a.id).localeCompare(String(b.id)); }));
3123
+ // INFO: the columns the rows on screen were built from, and those a rebuild
3124
+ // under way is building them from
3125
+ var displaySignatureRef = (0, react_1.useRef)(columnSignature);
3126
+ var rebuildingSignatureRef = (0, react_1.useRef)("");
3127
+ (0, react_1.useEffect)(function () {
3128
+ // INFO: an offline list shows its stored rows as they are, with no cells
3129
+ // built from the columns
3130
+ if (isOffline || resolvedType !== "list")
3131
+ return;
3132
+ if (displaySignatureRef.current === columnSignature)
3133
+ return;
3134
+ if (rebuildingSignatureRef.current === columnSignature)
3135
+ return;
3136
+ if (spaceTableDataRef.current.length === 0 && !formulaFullReadRef.current)
3137
+ return;
3138
+ rebuildingSignatureRef.current = columnSignature;
3139
+ handleRebuildListRows().finally(function () {
3140
+ rebuildingSignatureRef.current = "";
3141
+ });
3142
+ /* eslint-disable */
3143
+ }, [columnSignature, spaceTableData]);
3144
+ /* eslint-enable */
3145
+ var handleRebuildDisplayRows = function (rows, displayRows) { return __awaiter(void 0, void 0, void 0, function () {
3146
+ var sourceRows, rebuilt;
3147
+ var _a, _b, _c, _d;
3148
+ return __generator(this, function (_e) {
3149
+ switch (_e.label) {
3150
+ case 0:
3151
+ sourceRows = rows.map(function (eachRow) {
3152
+ var _a;
3153
+ return serverId === "_id" && eachRow && eachRow["_id"] === undefined
3154
+ ? __assign(__assign({}, eachRow), { _id: (_a = eachRow.recordId) !== null && _a !== void 0 ? _a : eachRow.id }) : eachRow;
3155
+ });
3156
+ return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(sourceRows, props.devSettings, (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios, structure, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_c = props.edit) === null || _c === void 0 ? void 0 : _c.activityLog : undefined, (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListActionBtns, !canUpdateRecord, undefined, handleSeedListReferenceOptions)];
3157
+ case 1:
3158
+ rebuilt = _e.sent();
3159
+ if (rebuilt.length !== displayRows.length)
3160
+ return [2 /*return*/, null];
3161
+ // INFO: the key and grouped children stay as the list gave them
3162
+ return [2 /*return*/, rebuilt.map(function (eachRow, index) {
3163
+ var _a, _b, _c;
3164
+ return (__assign(__assign(__assign({}, eachRow), { id: (_b = (_a = displayRows[index]) === null || _a === void 0 ? void 0 : _a.id) !== null && _b !== void 0 ? _b : eachRow.id }), (((_c = displayRows[index]) === null || _c === void 0 ? void 0 : _c.children)
3165
+ ? { children: displayRows[index].children }
3166
+ : {})));
3167
+ })];
3168
+ }
3169
+ });
3170
+ }); };
3171
+ var handleRebuildListRows = function () { return __awaiter(void 0, void 0, void 0, function () {
3172
+ var cached, displayRows_1, rows, displayRows;
3173
+ return __generator(this, function (_a) {
3174
+ switch (_a.label) {
3175
+ case 0:
3176
+ cached = formulaFullReadRef.current;
3177
+ if (!cached) return [3 /*break*/, 2];
3178
+ return [4 /*yield*/, handleRebuildDisplayRows(cached.rows, cached.displayRows)];
3179
+ case 1:
3180
+ displayRows_1 = _a.sent();
3181
+ // INFO: a read that landed meanwhile already used the new columns
3182
+ if (!displayRows_1 || formulaFullReadRef.current !== cached)
3183
+ return [2 /*return*/];
3184
+ cached.displayRows = displayRows_1;
3185
+ handleShowFormulaPage(pageIndex);
3186
+ return [2 /*return*/];
3187
+ case 2:
3188
+ rows = tableDataRef.current;
3189
+ if (rows.length === 0)
3190
+ return [2 /*return*/];
3191
+ return [4 /*yield*/, handleRebuildDisplayRows(rows, spaceTableDataRef.current)];
3192
+ case 3:
3193
+ displayRows = _a.sent();
3194
+ if (!displayRows || tableDataRef.current !== rows)
3195
+ return [2 /*return*/];
3196
+ handleSetListData(rows, displayRows);
3197
+ return [2 /*return*/];
3198
+ }
3199
+ });
3200
+ }); };
3035
3201
  // INFO: the read request of the previous render. A formula sort or filter
3036
3202
  // is not part of the request, so on a view that already reads every row
3037
3203
  // (calendar, map, timeline, legacy grouped) turning one on changes nothing
@@ -3166,6 +3332,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3166
3332
  };
3167
3333
  var handleSetListData = function (newTableData, newSpaceTableData) {
3168
3334
  var _a, _b, _c, _d, _e;
3335
+ displaySignatureRef.current = columnSignature;
3169
3336
  tableDataRef.current = newTableData;
3170
3337
  spaceTableDataRef.current = newSpaceTableData;
3171
3338
  setTableData(newTableData);
@@ -5279,6 +5446,42 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5279
5446
  }
5280
5447
  });
5281
5448
  }); };
5449
+ var handleStripUnsavedFields = function (data) {
5450
+ if (!data || typeof data !== "object")
5451
+ return data;
5452
+ var stripped = __assign({}, data);
5453
+ structure.forEach(function (eachColumn) {
5454
+ var isUnsaved = eachColumn.type === "button" ||
5455
+ eachColumn.type === "timeTracking" ||
5456
+ (appendedSystemColumnIds.includes(eachColumn.id) &&
5457
+ eachColumn.id !== "baseUpdatedAt");
5458
+ if (isUnsaved)
5459
+ delete stripped[eachColumn.id];
5460
+ });
5461
+ return stripped;
5462
+ };
5463
+ // INFO: what button, timer and rating cells call — the same single-field
5464
+ // update an inline cell edit makes, gated on the same update right
5465
+ var columnTypeActions = {
5466
+ canUpdate: canUpdateRecord,
5467
+ onButtonClick: (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.onButtonClick,
5468
+ onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
5469
+ var _a;
5470
+ return __generator(this, function (_b) {
5471
+ switch (_b.label) {
5472
+ case 0:
5473
+ if (!canUpdateRecord)
5474
+ return [2 /*return*/];
5475
+ return [4 /*yield*/, handleSubmitData("update", rowId, columnId, (_a = {},
5476
+ _a[columnId] = value,
5477
+ _a))];
5478
+ case 1:
5479
+ _b.sent();
5480
+ return [2 /*return*/];
5481
+ }
5482
+ });
5483
+ }); },
5484
+ };
5282
5485
  var handleSubmitData = function (type, rowId, columnId, data, offlineId, isOfflineUpdate, isDraft) { return __awaiter(void 0, void 0, void 0, function () {
5283
5486
  var selectedId, id, createSelectedData_1, uniqueDataStructure, uniqueColumnId, res, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_3, err_20, isUniqueIdFieldCreate, isExistingDoc, newRecordData_1, changedAttributeIds, baseDraftValue, hasBaseDraftChange, offlineDataResp, clonedForOffline, tempData, selectedIndex_4, offlineData, err_21, dataToSubmit_2, changedAttributeIds, baseDraftValue, hasBaseDraftChange, operationType, currentRow, wentToServer, dataId, err_22, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_5, _a;
5284
5487
  var _b, _c, _d, _e;
@@ -5323,6 +5526,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5323
5526
  createSelectedData_1 = _z.sent();
5324
5527
  _z.label = 4;
5325
5528
  case 4:
5529
+ // INFO: a whole-form save never writes what the form cannot edit — a
5530
+ // button stores nothing, a timer moves only by start / stop (a flow may
5531
+ // have moved it since the form opened) and system columns are stamped
5532
+ // by the server. A single-cell save (columnId) writes just that cell.
5533
+ if (!columnId && createSelectedData_1 !== selectedData)
5534
+ createSelectedData_1 = handleStripUnsavedFields(createSelectedData_1);
5326
5535
  uniqueDataStructure = structure.filter(function (eachStructure) {
5327
5536
  return eachStructure.unique;
5328
5537
  });
@@ -7286,11 +7495,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7286
7495
  if (eachAttribute.id === "_id" ||
7287
7496
  eachAttribute.id === "id" ||
7288
7497
  eachAttribute.id === "baseDraft" ||
7289
- (!includeSchemaHidden && eachAttribute.hide) ||
7498
+ // INFO: a system column starts hidden yet is always offered
7499
+ (!includeSchemaHidden &&
7500
+ eachAttribute.hide &&
7501
+ !appendedSystemColumnIds.includes(eachAttribute.id)) ||
7290
7502
  utils_1.NON_TABLE_COLUMN_DATA_TYPES.includes(eachAttribute.type)) {
7291
7503
  return false;
7292
7504
  }
7293
7505
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showBaseUpdatedAt) &&
7506
+ !isSystemColumnsEnabled &&
7294
7507
  eachAttribute.id === "baseUpdatedAt") {
7295
7508
  return false;
7296
7509
  }
@@ -7313,7 +7526,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7313
7526
  var handleGetSortOptions = function () {
7314
7527
  var _a, _b, _c;
7315
7528
  var baseOptions = (_c = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.renderReferenceLabelOptions) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : (isViewSettingsEnabled
7316
- ? getViewSettingsColumns().map(function (eachColumn) {
7529
+ ? getViewSettingsColumns()
7530
+ .filter(function (eachColumn) {
7531
+ return !utils_1.NON_SORT_COLUMN_DATA_TYPES.includes(eachColumn.type);
7532
+ })
7533
+ .map(function (eachColumn) {
7317
7534
  var _a;
7318
7535
  return ({
7319
7536
  key: eachColumn.id,
@@ -7337,7 +7554,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7337
7554
  }), true);
7338
7555
  };
7339
7556
  var getIsColumnHidden = function (column) {
7340
- return isSchemaHideMode
7557
+ return isSchemaHideMode || appendedSystemColumnIds.includes(column.id)
7341
7558
  ? !!column.hide
7342
7559
  : getActiveUserHiddenColumnIds().includes(column.id);
7343
7560
  };
@@ -7394,7 +7611,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7394
7611
  react_1.default.createElement("div", { className: "grow min-w-0" },
7395
7612
  react_1.default.createElement(select_1.Select, { id: "dtw-view-sort-column", portalDropdown: true, label: "", containerClassName: "min-w-0", value: (_b = activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) !== null && _b !== void 0 ? _b : "", placeholder: "Column", darkMode: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode, options: viewColumns
7396
7613
  .filter(function (eachColumn) {
7397
- return isFormulaViewSupported || eachColumn.type !== "formula";
7614
+ return (isFormulaViewSupported ||
7615
+ eachColumn.type !== "formula") &&
7616
+ !utils_1.NON_SORT_COLUMN_DATA_TYPES.includes(eachColumn.type);
7398
7617
  })
7399
7618
  .map(function (eachColumn) {
7400
7619
  var _a;
@@ -7445,6 +7664,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7445
7664
  return null;
7446
7665
  }
7447
7666
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showBaseUpdatedAt) &&
7667
+ !isSystemColumnsEnabled &&
7448
7668
  eachAttribute.id === "baseUpdatedAt") {
7449
7669
  return null;
7450
7670
  }
@@ -8756,7 +8976,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8756
8976
  //=====================================================================================
8757
8977
  var renderDataTemplateFormContent = function (state, model, ref, isObject, isObjectList, modalInput, parentData) {
8758
8978
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
8759
- return (0, updateModule_1.renderDataTemplateForm)(state, model, ref, {
8979
+ // INFO: the server stamps system columns; a form never shows them
8980
+ var formModel = appendedSystemColumnIds.length
8981
+ ? model.filter(function (each) { return !appendedSystemColumnIds.includes(each.id); })
8982
+ : model;
8983
+ return (0, updateModule_1.renderDataTemplateForm)(state, formModel, ref, {
8760
8984
  handleOnChangeAddress: handleOnChangeAddress,
8761
8985
  handleOnChangeText: handleOnChangeText,
8762
8986
  handleOnChangeSelect: handleOnChangeSelect,
@@ -8883,7 +9107,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8883
9107
  selectedModel.enableCheckbox) {
8884
9108
  return null;
8885
9109
  }
8886
- if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showBaseUpdatedAt) && eachKey === "baseUpdatedAt") {
9110
+ if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showBaseUpdatedAt) &&
9111
+ !isSystemColumnsEnabled &&
9112
+ eachKey === "baseUpdatedAt") {
8887
9113
  return null;
8888
9114
  }
8889
9115
  if ((type === "grid" || type === "kanban") &&
@@ -9010,12 +9236,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9010
9236
  return ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.paginationType) === "scroll";
9011
9237
  };
9012
9238
  // INFO: groups page themselves only when every group is known before its
9013
- // rows load — a list column's options plus "Unknown/No Value" for any other
9014
- // value. Grouping by a free-form column builds groups from loaded rows, so a
9239
+ // rows load — a list column's options (or Yes / No) plus Unknown and No
9240
+ // Value. Grouping by a free-form column builds groups from loaded rows, so a
9015
9241
  // group absent from the first page would never appear; those keep the
9016
9242
  // global scroll instead. Firebase pages by document cursor, not by count.
9017
9243
  var renderCheckGroupPaging = function () {
9018
- var _a, _b, _c, _d, _e, _f;
9244
+ var _a, _b, _c, _d, _e;
9019
9245
  var paginationType = renderResolvedPaginationType();
9020
9246
  if (paginationType !== "scroll" && paginationType !== "page")
9021
9247
  return false;
@@ -9041,9 +9267,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9041
9267
  if (!((_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareNewDTW) ||
9042
9268
  ((_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListMobileView))
9043
9269
  return false;
9270
+ // INFO: a person column's sections come from the loaded rows — reading
9271
+ // one band per member would cost a request per member on every load
9044
9272
  var groupAttributeDS = structure.find(function (eachDS) { return eachDS.id === groupId; });
9045
- return ((groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.type) === "list" &&
9046
- ((_f = (_e = groupAttributeDS.listSelection) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0) > 0);
9273
+ return (((groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.type) === "list" ||
9274
+ (groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.type) === "boolean") &&
9275
+ !!((_e = (0, groupSections_1.handleGetGroupOptions)(groupAttributeDS)) === null || _e === void 0 ? void 0 : _e.length));
9047
9276
  };
9048
9277
  var renderResolvedPaginationType = function () {
9049
9278
  var _a;
@@ -9194,25 +9423,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9194
9423
  // from a formula over existing fields; a plain field is just a name and a
9195
9424
  // type. They need different forms, so the app says which it wants and both
9196
9425
  // report back through the one onAddColumns callback.
9426
+ // INFO: the structure on screen carries the system columns this table
9427
+ // appended itself; the host only ever gets back the columns it declared
9428
+ var handleReportColumns = function (columns) {
9429
+ var _a, _b, _c;
9430
+ (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onAddColumns) === null || _b === void 0 ? void 0 : _b.call(_a, (0, systemColumns_1.handleStripSystemColumns)(columns, ((_c = props.model) !== null && _c !== void 0 ? _c : []).map(function (each) { return each.id; })));
9431
+ };
9197
9432
  var handleAddPlainColumn = function (column) {
9198
- var _a, _b;
9199
9433
  var newColumn = __assign({}, column);
9200
9434
  // INFO: the fields a new column needs beyond a name and a type are all
9201
9435
  // things this table already knows — the collection it sits on and the
9202
9436
  // workspace's upload endpoint — so they are filled in rather than asked for.
9203
- if (["image", "file", "multipleImage", "multipleFile"].includes(column.type)) {
9437
+ if (["image", "file", "multipleImage", "multipleFile", "signature"].includes(column.type)) {
9204
9438
  newColumn.imageCollectionName = props.collectionId;
9205
9439
  newColumn.imageFileName = "".concat(column.id, ".png");
9206
9440
  if (devSettings.uploadEndpoint)
9207
9441
  newColumn.uploadEndpoint = devSettings.uploadEndpoint;
9208
9442
  }
9209
- (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onAddColumns) === null || _b === void 0 ? void 0 : _b.call(_a, __spreadArray(__spreadArray([], structure, true), [newColumn], false));
9443
+ handleReportColumns(__spreadArray(__spreadArray([], structure, true), [newColumn], false));
9210
9444
  };
9211
9445
  // INFO: a changed column replaces itself in place, under the same id, and
9212
9446
  // goes out through onAddColumns like adding and removing do. A column now
9213
9447
  // holding files is filed against this table, as a new one is.
9214
9448
  var handleEditPlainColumn = function (column) {
9215
- var _a, _b, _c, _d;
9449
+ var _a, _b;
9216
9450
  var edited = __assign({}, column);
9217
9451
  if (["image", "file", "multipleImage", "multipleFile"].includes(column.type)) {
9218
9452
  edited.imageCollectionName =
@@ -9221,7 +9455,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9221
9455
  if (devSettings.uploadEndpoint && !edited.uploadEndpoint)
9222
9456
  edited.uploadEndpoint = devSettings.uploadEndpoint;
9223
9457
  }
9224
- (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onAddColumns) === null || _d === void 0 ? void 0 : _d.call(_c, structure.map(function (eachColumn) {
9458
+ handleReportColumns(structure.map(function (eachColumn) {
9225
9459
  return eachColumn.id === column.id ? edited : eachColumn;
9226
9460
  }));
9227
9461
  };
@@ -9229,8 +9463,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9229
9463
  // consumer receives the whole model either way, so the schema has one
9230
9464
  // destination rather than a second place to be written.
9231
9465
  var handleDeletePlainColumn = function (columnId) {
9232
- var _a, _b;
9233
- (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onAddColumns) === null || _b === void 0 ? void 0 : _b.call(_a, structure.filter(function (eachColumn) { return eachColumn.id !== columnId; }));
9466
+ handleReportColumns(structure.filter(function (eachColumn) { return eachColumn.id !== columnId; }));
9234
9467
  };
9235
9468
  /**
9236
9469
  * INFO: only one tab can be the one that opens, so setting one clears the
@@ -9280,90 +9513,54 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9280
9513
  };
9281
9514
  var renderAddMathColumn = function (id, onClose) {
9282
9515
  var _a, _b, _c;
9283
- return (react_1.default.createElement(settingsModal_1.ExpressionModal, { selectedId: id, model: structure, renderReferenceLabelOptions: (_a = props.organise) === null || _a === void 0 ? void 0 : _a.renderReferenceLabelOptions, renderReferenceSpaceOptions: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.renderReferenceSpaceOptions, onAddModelSchema: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onAddColumns, onClose: onClose }));
9516
+ return (react_1.default.createElement(settingsModal_1.ExpressionModal, { selectedId: id, model: structure, renderReferenceLabelOptions: (_a = props.organise) === null || _a === void 0 ? void 0 : _a.renderReferenceLabelOptions, renderReferenceSpaceOptions: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.renderReferenceSpaceOptions, onAddModelSchema: ((_c = props.organise) === null || _c === void 0 ? void 0 : _c.onAddColumns) ? handleReportColumns : undefined, onClose: onClose }));
9517
+ };
9518
+ // INFO: the grouped column and its sections in option order — a status
9519
+ // column's options, Yes / No, or the workspace's members
9520
+ var handleGetGroupColumn = function () {
9521
+ return groupId ? structure.find(function (eachDS) { return eachDS.id === groupId; }) : undefined;
9522
+ };
9523
+ var handleGetGroupColumnOptions = function () {
9524
+ return (0, groupSections_1.handleGetGroupOptions)(handleGetGroupColumn(), props.devSettings.organisationMembers);
9284
9525
  };
9285
9526
  // INFO: for NewTable, groupBy stays inside one table — rows are handed over
9286
- // as coloured, collapsible bands keyed the same way the legacy split is
9527
+ // as coloured, collapsible sections: every option in its order, then
9528
+ // Unknown (a value outside the options) and No Value
9287
9529
  var handleBuildNewTableGroups = function () {
9288
- var _a, _b;
9530
+ var _a;
9289
9531
  if (!groupId || !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW))
9290
9532
  return undefined;
9291
- var groupAttributeDS = structure.find(function (eachDS) { return eachDS.id === groupId; });
9292
9533
  var isGroupPaging = renderCheckGroupPaging();
9293
- var listSelection = (_b = groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.listSelection) !== null && _b !== void 0 ? _b : [];
9294
- var groups = [];
9295
- // INFO: with per-group paging every option is a band from the start, even
9296
- // with no row loaded yet, so its sentinel can load it; "Unknown/No Value"
9297
- // holds every value outside the options, matching its "!in" query
9298
- if (isGroupPaging)
9299
- __spreadArray(__spreadArray([], listSelection, true), ["Unknown/No Value"], false).forEach(function (key, optionIndex) {
9300
- var _a, _b;
9301
- return groups.push({
9302
- id: key,
9303
- title: key,
9304
- colour: (_a = groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.listSelectionColour) === null || _a === void 0 ? void 0 : _a[optionIndex],
9305
- rowIds: [],
9306
- count: ((_b = groupPageState[key]) === null || _b === void 0 ? void 0 : _b.fetched)
9307
- ? groupPageState[key].size
9308
- : undefined,
9309
- });
9310
- });
9311
- (spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : []).forEach(function (eachData, index) {
9312
- var _a, _b, _c, _d, _e, _f, _g, _h;
9534
+ var sections = (0, groupSections_1.handleBuildGroupSections)({
9535
+ column: handleGetGroupColumn(),
9313
9536
  // INFO: key off the raw row — the display row holds a Tag element for a
9314
- // coloured list value, which would put every row under "Unknown"
9315
- var rawValue = (_b = (_a = tableData === null || tableData === void 0 ? void 0 : tableData[index]) === null || _a === void 0 ? void 0 : _a[groupId]) !== null && _b !== void 0 ? _b : eachData === null || eachData === void 0 ? void 0 : eachData[groupId];
9316
- var key;
9317
- if ((groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.type) === "date" && rawValue && rawValue !== " - ") {
9318
- key = (0, dayjs_1.default)(isFirebase ? (rawValue === null || rawValue === void 0 ? void 0 : rawValue._seconds) * 1000 : rawValue)
9319
- .startOf("day")
9320
- .format("YYYY-MM-DD");
9321
- }
9322
- else {
9323
- key =
9324
- rawValue && rawValue !== " - " && typeof rawValue !== "object"
9325
- ? String(rawValue)
9326
- : "Unknown/No Value";
9327
- if (isGroupPaging && !listSelection.includes(key))
9328
- key = "Unknown/No Value";
9329
- }
9330
- var rowId = (_d = (_c = tableData === null || tableData === void 0 ? void 0 : tableData[index]) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : (_e = tableData === null || tableData === void 0 ? void 0 : tableData[index]) === null || _e === void 0 ? void 0 : _e._id;
9331
- if (!rowId)
9332
- return;
9333
- var group = groups.find(function (eachGroup) { return eachGroup.id === key; });
9334
- if (!group) {
9335
- var optionIndex = (_g = (_f = groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.listSelection) === null || _f === void 0 ? void 0 : _f.indexOf(key)) !== null && _g !== void 0 ? _g : -1;
9336
- group = {
9337
- id: key,
9338
- title: key,
9339
- colour: optionIndex >= 0
9340
- ? (_h = groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.listSelectionColour) === null || _h === void 0 ? void 0 : _h[optionIndex]
9341
- : undefined,
9342
- rowIds: [],
9343
- };
9344
- groups.push(group);
9345
- }
9346
- group.rowIds.push(rowId);
9537
+ // coloured list value
9538
+ rows: tableData !== null && tableData !== void 0 ? tableData : [],
9539
+ getRowId: function (row) { var _a; return (_a = row === null || row === void 0 ? void 0 : row.id) !== null && _a !== void 0 ? _a : row === null || row === void 0 ? void 0 : row._id; },
9540
+ options: handleGetGroupColumnOptions(),
9541
+ // INFO: with per-group paging every section is there from the start,
9542
+ // even with no row loaded yet, so its sentinel can load it
9543
+ keepEmptyOptions: isGroupPaging,
9544
+ isFirebase: isFirebase,
9545
+ }).map(function (eachSection) {
9546
+ var _a;
9547
+ return (__assign(__assign({}, eachSection), { count: isGroupPaging && ((_a = groupPageState[eachSection.id]) === null || _a === void 0 ? void 0 : _a.fetched)
9548
+ ? groupPageState[eachSection.id].size
9549
+ : undefined }));
9347
9550
  });
9348
- // INFO: a group whose own query came back empty has nothing to show
9551
+ // INFO: a section whose own query came back empty has nothing to show
9349
9552
  if (isGroupPaging)
9350
- return groups.filter(function (eachGroup) {
9553
+ return sections.filter(function (eachGroup) {
9351
9554
  var _a, _b;
9352
9555
  return eachGroup.rowIds.length > 0 ||
9353
9556
  !(((_a = groupPageState[eachGroup.id]) === null || _a === void 0 ? void 0 : _a.fetched) &&
9354
9557
  ((_b = groupPageState[eachGroup.id]) === null || _b === void 0 ? void 0 : _b.size) === 0);
9355
9558
  });
9356
- return groups;
9559
+ return sections;
9357
9560
  };
9358
- // INFO: a row's band under per-group paging — its option, or
9359
- // "Unknown/No Value" for any value outside the options (the "!in" query)
9561
+ // INFO: a row's section under per-group paging
9360
9562
  var handleResolveGroupKey = function (row) {
9361
- var _a, _b;
9362
- var listSelection = (_b = (_a = structure.find(function (eachDS) { return eachDS.id === groupId; })) === null || _a === void 0 ? void 0 : _a.listSelection) !== null && _b !== void 0 ? _b : [];
9363
- var value = groupId ? row === null || row === void 0 ? void 0 : row[groupId] : undefined;
9364
- return typeof value === "string" && listSelection.includes(value)
9365
- ? value
9366
- : "Unknown/No Value";
9563
+ return (0, groupSections_1.handleGetGroupKey)(handleGetGroupColumn(), groupId ? row === null || row === void 0 ? void 0 : row[groupId] : undefined, handleGetGroupColumnOptions(), isFirebase);
9367
9564
  };
9368
9565
  var handleSetGroupPageState = function (groupKey, state) {
9369
9566
  return setGroupPageState(function (previous) {
@@ -9390,16 +9587,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9390
9587
  switch (_j.label) {
9391
9588
  case 0:
9392
9589
  generation = groupPagingGenRef.current;
9393
- groupAttributeDS = structure.find(function (eachDS) { return eachDS.id === groupId; });
9394
- groupQuery = groupKey === "Unknown/No Value"
9395
- ? [
9396
- {
9397
- type: "!in",
9398
- queryId: groupId !== null && groupId !== void 0 ? groupId : "",
9399
- value: (_a = groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.listSelection) !== null && _a !== void 0 ? _a : [],
9400
- },
9401
- ]
9402
- : [{ type: "=", queryId: groupId !== null && groupId !== void 0 ? groupId : "", value: groupKey }];
9590
+ groupAttributeDS = handleGetGroupColumn();
9591
+ if (!groupAttributeDS)
9592
+ return [2 /*return*/, undefined];
9593
+ groupQuery = (0, groupSections_1.handleGetGroupSectionQuery)(groupAttributeDS, groupKey, (_a = handleGetGroupColumnOptions()) !== null && _a !== void 0 ? _a : []);
9403
9594
  mainCond = handleReadQueryHocCond();
9404
9595
  return [4 /*yield*/, readServerQuery.call(__assign(__assign({}, mainCond), { query: __spreadArray(__spreadArray([], ((_b = mainCond.query) !== null && _b !== void 0 ? _b : []), true), groupQuery, true), cursor: cursor, limit: limit, stopLimit: undefined, skip: 0 }))];
9405
9596
  case 1:
@@ -9536,44 +9727,40 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9536
9727
  // INFO: page mode — after each fresh read every band reads its own first
9537
9728
  // page, so each shows its real total and pages on its own
9538
9729
  var handleLoadGroupFirstPages = function () {
9539
- var _a, _b;
9730
+ var _a;
9540
9731
  groupPagingGenRef.current += 1;
9541
9732
  groupPageStateRef.current = {};
9542
9733
  setGroupPageState({});
9543
- var listSelection = (_b = (_a = structure.find(function (eachDS) { return eachDS.id === groupId; })) === null || _a === void 0 ? void 0 : _a.listSelection) !== null && _b !== void 0 ? _b : [];
9544
- __spreadArray(__spreadArray([], listSelection, true), ["Unknown/No Value"], false).forEach(function (groupKey) {
9545
- return handleFetchGroupPage(groupKey, 0);
9546
- });
9734
+ __spreadArray(__spreadArray([], ((_a = handleGetGroupColumnOptions()) !== null && _a !== void 0 ? _a : []).map(function (each) { return each.key; }), true), [
9735
+ groupSections_1.GROUP_UNKNOWN_KEY,
9736
+ groupSections_1.GROUP_EMPTY_KEY,
9737
+ ], false).forEach(function (groupKey) { return handleFetchGroupPage(groupKey, 0); });
9547
9738
  };
9548
9739
  var renderGroupTable = function (multipleSelect) {
9549
9740
  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, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24;
9550
9741
  if (groupId && !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)) {
9551
- var groupAttributeDS_1 = structure.find(function (eachDS) { return eachDS.id === groupId; });
9552
- var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
9553
- var _a;
9554
- var key;
9555
- if ((groupAttributeDS_1 === null || groupAttributeDS_1 === void 0 ? void 0 : groupAttributeDS_1.type) === "date" &&
9556
- (eachData === null || eachData === void 0 ? void 0 : eachData[groupId]) &&
9557
- (eachData === null || eachData === void 0 ? void 0 : eachData[groupId]) !== " - ") {
9558
- key = (0, dayjs_1.default)(isFirebase ? ((_a = eachData[groupId]) === null || _a === void 0 ? void 0 : _a._seconds) * 1000 : eachData[groupId])
9559
- .startOf("day")
9560
- .format("YYYY-MM-DD");
9561
- }
9562
- else {
9563
- key =
9564
- (eachData === null || eachData === void 0 ? void 0 : eachData[groupId]) && (eachData === null || eachData === void 0 ? void 0 : eachData[groupId]) !== " - "
9565
- ? eachData === null || eachData === void 0 ? void 0 : eachData[groupId]
9566
- : "Unknown/No Value";
9567
- }
9568
- acc[key] = acc[key] || [];
9569
- acc[key].push(eachData);
9570
- return acc;
9571
- }, {});
9572
- if (Object.values(groupedSpaceTableData).length === 0 && !tableLoading) {
9742
+ // INFO: sections are keyed off the raw rows, in option order, with
9743
+ // Unknown and No Value last — the same sections the new table draws
9744
+ var sections = (0, groupSections_1.handleBuildGroupSections)({
9745
+ column: handleGetGroupColumn(),
9746
+ rows: tableData !== null && tableData !== void 0 ? tableData : [],
9747
+ getRowId: function (row) { var _a; return (_a = row === null || row === void 0 ? void 0 : row.id) !== null && _a !== void 0 ? _a : row === null || row === void 0 ? void 0 : row._id; },
9748
+ options: handleGetGroupColumnOptions(),
9749
+ isFirebase: isFirebase,
9750
+ });
9751
+ var displayRowById_1 = new Map();
9752
+ (tableData !== null && tableData !== void 0 ? tableData : []).forEach(function (eachRow, index) { var _a; return displayRowById_1.set((_a = eachRow === null || eachRow === void 0 ? void 0 : eachRow.id) !== null && _a !== void 0 ? _a : eachRow === null || eachRow === void 0 ? void 0 : eachRow._id, spaceTableData[index]); });
9753
+ var groupedSpaceTableData_1 = {};
9754
+ sections.forEach(function (eachSection) {
9755
+ groupedSpaceTableData_1[eachSection.title] = eachSection.rowIds
9756
+ .map(function (eachId) { return displayRowById_1.get(eachId); })
9757
+ .filter(Boolean);
9758
+ });
9759
+ if (Object.values(groupedSpaceTableData_1).length === 0 && !tableLoading) {
9573
9760
  return (react_1.default.createElement(emptyState_1.EmptyState, { text: "There is no data to display", icon: react_1.default.createElement(outline_1.InformationCircleIcon, { className: "h-10 text-gray-600" }) }));
9574
9761
  }
9575
9762
  else {
9576
- return Object.entries(groupedSpaceTableData).map(function (_a) {
9763
+ return Object.entries(groupedSpaceTableData_1).map(function (_a) {
9577
9764
  var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
9578
9765
  var eachKey = _a[0], eachValue = _a[1];
9579
9766
  var dataList = eachValue;
@@ -11414,16 +11601,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11414
11601
  setDeleteFeedId(id);
11415
11602
  } }))));
11416
11603
  };
11417
- return (react_1.default.createElement(react_1.default.Fragment, null,
11604
+ return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
11418
11605
  renderNotification("root"),
11419
- ((_85 = (_84 = props.renderSettings) === null || _84 === void 0 ? void 0 : _84.renderLoadingUI) === null || _85 === void 0 ? void 0 : _85.call(_84)) && loading ? ((_86 = props.renderSettings) === null || _86 === void 0 ? void 0 : _86.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.darkMode, darkModeBg: (_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
11606
+ ((_88 = (_87 = props.renderSettings) === null || _87 === void 0 ? void 0 : _87.renderLoadingUI) === null || _88 === void 0 ? void 0 : _88.call(_87)) && loading ? ((_89 = props.renderSettings) === null || _89 === void 0 ? void 0 : _89.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.darkMode, darkModeBg: (_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
11420
11607
  var _a, _b;
11421
11608
  if (loading)
11422
11609
  return;
11423
11610
  handlePopUpModal(false);
11424
11611
  setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
11425
11612
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
11426
- react_1.default.createElement(modal_1.Modal, { darkMode: (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.darkMode, darkModeBg: (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
11613
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.darkMode, darkModeBg: (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
11427
11614
  return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
11428
11615
  if (dataId) {
11429
11616
  var currentValue = selectedData[referenceCreationModal.id];
@@ -11439,19 +11626,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11439
11626
  }, onClose: function () {
11440
11627
  setReferenceCreationModal({ id: "", name: "", type: "string" });
11441
11628
  } }),
11442
- react_1.default.createElement(modal_1.Modal, { darkMode: (_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.darkMode, darkModeBg: (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
11629
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.darkMode, darkModeBg: (_95 = props.organise) === null || _95 === void 0 ? void 0 : _95.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
11443
11630
  setReferenceDeleteTableData({});
11444
11631
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11445
- react_1.default.createElement(modal_1.Modal, { darkMode: (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.darkMode, darkModeBg: (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
11632
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_96 = props.organise) === null || _96 === void 0 ? void 0 : _96.darkMode, darkModeBg: (_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
11446
11633
  setDeletePasscodeInput("");
11447
11634
  setDeleteModal(!deleteModal);
11448
11635
  setDeleteFeedId("");
11449
11636
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11450
- react_1.default.createElement(modal_1.Modal, { darkMode: (_95 = props.organise) === null || _95 === void 0 ? void 0 : _95.darkMode, darkModeBg: (_96 = props.organise) === null || _96 === void 0 ? void 0 : _96.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
11637
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.darkMode, darkModeBg: (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
11451
11638
  setBatchUpdateData({ columnId: "", columnData: {} });
11452
11639
  setBatchUpdateModal(false);
11453
11640
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11454
- react_1.default.createElement(modal_1.Modal, { darkMode: (_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.darkMode, darkModeBg: (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
11641
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.darkMode, darkModeBg: (_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
11455
11642
  var _a, _b;
11456
11643
  if (props.space)
11457
11644
  return (react_1.default.createElement(authModal_1.AuthModal, { space: props.space, userId: (_a = props.id) !== null && _a !== void 0 ? _a : "", client: (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, type: selectedAuthMethod, authMethods: authMethods, onComplete: handleAuthComplete }));
@@ -11466,13 +11653,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11466
11653
  (0, react_dom_1.createPortal)(
11467
11654
  // INFO: z-50 lifts it over a Modal the table may sit in (z-40)
11468
11655
  react_1.default.createElement("div", { className: "relative z-50" },
11469
- react_1.default.createElement(drawer_1.Drawer, { darkMode: (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.darkMode, darkModeBg: (_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
11656
+ react_1.default.createElement(drawer_1.Drawer, { darkMode: (_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.darkMode, darkModeBg: (_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
11470
11657
  // INFO: the record stays set while the drawer slides out — clearing it
11471
11658
  // would remount the hidden panel collection-wide and fetch again. The
11472
11659
  // toolbar's collection-wide button clears it when it opens.
11473
11660
  onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75", title: "Activity Log", content: react_1.default.createElement(activityModal_1.ActivityModal, { title: props.title && typeof props.title === "string"
11474
11661
  ? props.title
11475
- : "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((_101 = props.id) !== null && _101 !== void 0 ? _101 : "") : activityId, activityLog: (_102 = props.edit) === null || _102 === void 0 ? void 0 : _102.activityLog, model: structure }) })), document.body),
11662
+ : "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((_104 = props.id) !== null && _104 !== void 0 ? _104 : "") : activityId, activityLog: (_105 = props.edit) === null || _105 === void 0 ? void 0 : _105.activityLog, model: structure }) })), document.body),
11476
11663
  renderScrollSentinel()));
11477
11664
  });
11478
11665
  //# sourceMappingURL=index.js.map