blixify-ui-web 1.2.198 → 1.2.200

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 (74) hide show
  1. package/lib/components/data/columnTypes/buttonCell.d.ts +3 -1
  2. package/lib/components/data/columnTypes/buttonCell.d.ts.map +1 -1
  3. package/lib/components/data/columnTypes/buttonCell.js +4 -0
  4. package/lib/components/data/columnTypes/buttonCell.js.map +1 -1
  5. package/lib/components/data/columnTypes/context.d.ts +1 -0
  6. package/lib/components/data/columnTypes/context.d.ts.map +1 -1
  7. package/lib/components/data/columnTypes/context.js.map +1 -1
  8. package/lib/components/data/columnTypes/dateRangeCell.d.ts +20 -0
  9. package/lib/components/data/columnTypes/dateRangeCell.d.ts.map +1 -0
  10. package/lib/components/data/columnTypes/dateRangeCell.js +211 -0
  11. package/lib/components/data/columnTypes/dateRangeCell.js.map +1 -0
  12. package/lib/components/data/columnTypes/index.d.ts +1 -0
  13. package/lib/components/data/columnTypes/index.d.ts.map +1 -1
  14. package/lib/components/data/columnTypes/index.js +1 -0
  15. package/lib/components/data/columnTypes/index.js.map +1 -1
  16. package/lib/components/data/columnTypes/personAvatar.d.ts +24 -0
  17. package/lib/components/data/columnTypes/personAvatar.d.ts.map +1 -0
  18. package/lib/components/data/columnTypes/personAvatar.js +89 -0
  19. package/lib/components/data/columnTypes/personAvatar.js.map +1 -0
  20. package/lib/components/data/columnTypes/timeTracking.d.ts +2 -0
  21. package/lib/components/data/columnTypes/timeTracking.d.ts.map +1 -1
  22. package/lib/components/data/columnTypes/timeTracking.js +14 -1
  23. package/lib/components/data/columnTypes/timeTracking.js.map +1 -1
  24. package/lib/components/data/columnTypes/timeTrackingCell.d.ts +7 -0
  25. package/lib/components/data/columnTypes/timeTrackingCell.d.ts.map +1 -1
  26. package/lib/components/data/columnTypes/timeTrackingCell.js +72 -17
  27. package/lib/components/data/columnTypes/timeTrackingCell.js.map +1 -1
  28. package/lib/components/data/dataTemplate/dataStateModel.d.ts +20 -1
  29. package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
  30. package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
  31. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  32. package/lib/components/data/dataTemplate/index.js +490 -216
  33. package/lib/components/data/dataTemplate/index.js.map +1 -1
  34. package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +6 -0
  35. package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
  36. package/lib/components/data/dataTemplate/viewStatePersistence.js +35 -1
  37. package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
  38. package/lib/components/data/flexFilter/index.d.ts.map +1 -1
  39. package/lib/components/data/flexFilter/index.js +1 -1
  40. package/lib/components/data/flexFilter/index.js.map +1 -1
  41. package/lib/components/data/formula/index.d.ts.map +1 -1
  42. package/lib/components/data/formula/index.js +3 -1
  43. package/lib/components/data/formula/index.js.map +1 -1
  44. package/lib/components/data/listModule.d.ts +3 -0
  45. package/lib/components/data/listModule.d.ts.map +1 -1
  46. package/lib/components/data/listModule.js +83 -68
  47. package/lib/components/data/listModule.js.map +1 -1
  48. package/lib/components/data/readModule.d.ts.map +1 -1
  49. package/lib/components/data/readModule.js +7 -14
  50. package/lib/components/data/readModule.js.map +1 -1
  51. package/lib/components/data/updateModule.d.ts.map +1 -1
  52. package/lib/components/data/updateModule.js +29 -22
  53. package/lib/components/data/updateModule.js.map +1 -1
  54. package/lib/components/data/utils.d.ts +1 -0
  55. package/lib/components/data/utils.d.ts.map +1 -1
  56. package/lib/components/data/utils.js +19 -12
  57. package/lib/components/data/utils.js.map +1 -1
  58. package/lib/components/display/newTable/columnWidth.d.ts +8 -0
  59. package/lib/components/display/newTable/columnWidth.d.ts.map +1 -0
  60. package/lib/components/display/newTable/columnWidth.js +32 -0
  61. package/lib/components/display/newTable/columnWidth.js.map +1 -0
  62. package/lib/components/display/newTable/index.d.ts +9 -0
  63. package/lib/components/display/newTable/index.d.ts.map +1 -1
  64. package/lib/components/display/newTable/index.js +379 -136
  65. package/lib/components/display/newTable/index.js.map +1 -1
  66. package/lib/components/input/select/index.d.ts +2 -0
  67. package/lib/components/input/select/index.d.ts.map +1 -1
  68. package/lib/components/input/select/index.js +62 -16
  69. package/lib/components/input/select/index.js.map +1 -1
  70. package/lib/components/input/textInput/index.d.ts.map +1 -1
  71. package/lib/components/input/textInput/index.js +16 -11
  72. package/lib/components/input/textInput/index.js.map +1 -1
  73. package/lib/tail.css +12 -2
  74. 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)) {
@@ -163,6 +174,7 @@ var relatedRecords_1 = require("./relatedRecords");
163
174
  var flexFilter_1 = require("../flexFilter");
164
175
  var viewStatePersistence_1 = require("./viewStatePersistence");
165
176
  var permissions_1 = require("./permissions");
177
+ var columnWidth_1 = require("../../display/newTable/columnWidth");
166
178
  // INFO: builds the notification message for a failed write. Callers must gate on
167
179
  // `err.response` alone, never on a specific status — a catch that only handles 400 shows
168
180
  // the user nothing at all for any other status, so a write silently disappears. A 5xx is
@@ -219,10 +231,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
219
231
  // Every read of the view type below uses resolvedType. The distinction matters
220
232
  // most in effect dependency arrays — following props.type there would leave
221
233
  // the list never refetching while the panel is open, which fails silently.
222
- 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;
234
+ 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, _106, _107, _108, _109, _110, _111;
223
235
  // INFO: the panel cannot navigate its way out — handleNavigate("read") is
224
236
  // routed straight back into it — so expand-to-full-page is local state.
225
- var _106 = (0, react_1.useState)(false), drawerPageView = _106[0], setDrawerPageView = _106[1];
237
+ var _112 = (0, react_1.useState)(false), drawerPageView = _112[0], setDrawerPageView = _112[1];
226
238
  // INFO: the panel keeps rendering the record it was opened with rather than
227
239
  // live props. Without this, navigating back to the list would re-render the
228
240
  // still-mounted panel as a second list behind the overlay.
@@ -314,14 +326,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
314
326
  initialFilterReferenceDate: initialFilterReferenceDate,
315
327
  };
316
328
  };
317
- var _107 = intialiseDefaultFilterValues(), initialFilterSearch = _107.initialFilterSearch, initialFilterSearchParams = _107.initialFilterSearchParams, initialFilterSelection = _107.initialFilterSelection, initialFilterReference = _107.initialFilterReference, initialFilterReferenceDate = _107.initialFilterReferenceDate;
329
+ var _113 = intialiseDefaultFilterValues(), initialFilterSearch = _113.initialFilterSearch, initialFilterSearchParams = _113.initialFilterSearchParams, initialFilterSelection = _113.initialFilterSelection, initialFilterReference = _113.initialFilterReference, initialFilterReferenceDate = _113.initialFilterReferenceDate;
318
330
  // INFO: Persist view state hook — handles storage read/write for filter/sort/column state
319
- var _108 = (0, viewStatePersistence_1.usePersistedViewState)({
331
+ var _114 = (0, viewStatePersistence_1.usePersistedViewState)({
320
332
  mode: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.persistViewState,
321
333
  collectionId: props.collectionId,
322
334
  persistKey: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey,
323
335
  type: resolvedType,
324
- }), rawPersistedState = _108.persistedState, isPersistEnabled = _108.isEnabled, handleSaveView = _108.handleSaveView, handleRegisterViewSnapshot = _108.handleRegisterViewSnapshot;
336
+ }), rawPersistedState = _114.persistedState, isPersistEnabled = _114.isEnabled, handleSaveView = _114.handleSaveView, handleRegisterViewSnapshot = _114.handleRegisterViewSnapshot;
325
337
  // INFO: drop stored filters/sort on removed columns — they would empty the table
326
338
  var persistedState = (0, react_1.useMemo)(function () {
327
339
  var _a, _b, _c;
@@ -335,8 +347,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
335
347
  (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareFlexFilterReferences,
336
348
  (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareFlexFilterListObjects,
337
349
  ]);
338
- var _109 = (0, react_1.useState)(false), loading = _109[0], setLoading = _109[1];
339
- var _110 = (0, react_1.useState)(), notification = _110[0], setNotification = _110[1];
350
+ var _115 = (0, react_1.useState)(false), loading = _115[0], setLoading = _115[1];
351
+ var _116 = (0, react_1.useState)(), notification = _116[0], setNotification = _116[1];
340
352
  // INFO: a success toast is confirmation, not a decision — it clears itself so
341
353
  // it never sits on the floating step bar; errors stay until dismissed
342
354
  (0, react_1.useEffect)(function () {
@@ -346,73 +358,73 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
346
358
  return function () { return clearTimeout(timer); };
347
359
  }, [notification]);
348
360
  //INFO : Used by List
349
- 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];
350
- 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];
351
- 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];
352
- 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];
353
- var _115 = (0, react_1.useState)({}), filterReferenceSearch = _115[0], setFilterReferenceSearch = _115[1];
354
- var _116 = (0, react_1.useState)({}), filterReferenceList = _116[0], setFilterReferenceList = _116[1];
355
- var _117 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
361
+ var _117 = (0, react_1.useState)((_f = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _f !== void 0 ? _f : initialFilterSearch), filterSearch = _117[0], setFilterSearch = _117[1];
362
+ var _118 = (0, react_1.useState)((_g = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _g !== void 0 ? _g : initialFilterSearchParams), filterSearchParams = _118[0], setFilterSearchParams = _118[1];
363
+ var _119 = (0, react_1.useState)((_h = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _h !== void 0 ? _h : initialFilterSelection), filterSelection = _119[0], setFilterSelection = _119[1];
364
+ var _120 = (0, react_1.useState)((_j = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _j !== void 0 ? _j : initialFilterReference), filterReference = _120[0], setFilterReference = _120[1];
365
+ var _121 = (0, react_1.useState)({}), filterReferenceSearch = _121[0], setFilterReferenceSearch = _121[1];
366
+ var _122 = (0, react_1.useState)({}), filterReferenceList = _122[0], setFilterReferenceList = _122[1];
367
+ var _123 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
356
368
  ? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
357
- : initialFilterReferenceDate), filterReferenceDate = _117[0], setFilterReferenceDate = _117[1];
358
- var _118 = (0, react_1.useState)(true), tableLoading = _118[0], setTableLoading = _118[1];
359
- var _119 = (0, react_1.useState)(""), cursor = _119[0], setCursor = _119[1];
360
- var _120 = (0, react_1.useState)(""), lastCursor = _120[0], setLastCursor = _120[1];
361
- var _121 = (0, react_1.useState)([]), tableData = _121[0], setTableData = _121[1];
362
- var _122 = (0, react_1.useState)([]), spaceTableData = _122[0], setSpaceTableData = _122[1];
369
+ : initialFilterReferenceDate), filterReferenceDate = _123[0], setFilterReferenceDate = _123[1];
370
+ var _124 = (0, react_1.useState)(true), tableLoading = _124[0], setTableLoading = _124[1];
371
+ var _125 = (0, react_1.useState)(""), cursor = _125[0], setCursor = _125[1];
372
+ var _126 = (0, react_1.useState)(""), lastCursor = _126[0], setLastCursor = _126[1];
373
+ var _127 = (0, react_1.useState)([]), tableData = _127[0], setTableData = _127[1];
374
+ var _128 = (0, react_1.useState)([]), spaceTableData = _128[0], setSpaceTableData = _128[1];
363
375
  // INFO: a save resolves after later renders, so it reads the table from here —
364
376
  // the state it closed over can predate an earlier save on the same row
365
377
  var tableDataRef = (0, react_1.useRef)([]);
366
378
  var spaceTableDataRef = (0, react_1.useRef)([]);
367
379
  tableDataRef.current = tableData;
368
380
  spaceTableDataRef.current = spaceTableData;
369
- var _123 = (0, react_1.useState)(0), size = _123[0], setSize = _123[1];
370
- 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];
371
- var _125 = (0, react_1.useState)([]), selectedIds = _125[0], setSelectedIds = _125[1];
372
- var _126 = (0, react_1.useState)(false), selectAll = _126[0], setSelectAll = _126[1];
373
- var _127 = (0, react_1.useState)(""), deletePasscode = _127[0], setDeletePasscode = _127[1];
374
- var _128 = (0, react_1.useState)(""), deletePasscodeInput = _128[0], setDeletePasscodeInput = _128[1];
375
- var _129 = (0, react_1.useState)(""), deleteFeedId = _129[0], setDeleteFeedId = _129[1];
381
+ var _129 = (0, react_1.useState)(0), size = _129[0], setSize = _129[1];
382
+ var _130 = (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 = _130[0], setPageIndex = _130[1];
383
+ var _131 = (0, react_1.useState)([]), selectedIds = _131[0], setSelectedIds = _131[1];
384
+ var _132 = (0, react_1.useState)(false), selectAll = _132[0], setSelectAll = _132[1];
385
+ var _133 = (0, react_1.useState)(""), deletePasscode = _133[0], setDeletePasscode = _133[1];
386
+ var _134 = (0, react_1.useState)(""), deletePasscodeInput = _134[0], setDeletePasscodeInput = _134[1];
387
+ var _135 = (0, react_1.useState)(""), deleteFeedId = _135[0], setDeleteFeedId = _135[1];
376
388
  //INFO : Used by List Organise
377
389
  // INFO: Internal sort state that overrides props.organise?.sort when
378
390
  // persistViewState is enabled and a persisted sort exists
379
- 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];
380
- var _131 = (0, react_1.useState)(false), filterDraft = _131[0], setFilterDraft = _131[1];
381
- var _132 = (0, react_1.useState)(false), addTabModal = _132[0], setAddTabModal = _132[1];
382
- var _133 = (0, react_1.useState)(-1), editTabIndex = _133[0], setEditTabIndex = _133[1];
391
+ var _136 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _o !== void 0 ? _o : undefined), persistedSort = _136[0], setPersistedSort = _136[1];
392
+ var _137 = (0, react_1.useState)(false), filterDraft = _137[0], setFilterDraft = _137[1];
393
+ var _138 = (0, react_1.useState)(false), addTabModal = _138[0], setAddTabModal = _138[1];
394
+ var _139 = (0, react_1.useState)(-1), editTabIndex = _139[0], setEditTabIndex = _139[1];
383
395
  //INFO : resolve the initial tab synchronously so the mount cond is already
384
396
  // tab-scoped — an empty initial tab caused a second wasted list fetch
385
- var _134 = (0, react_1.useState)(function () {
397
+ var _140 = (0, react_1.useState)(function () {
386
398
  var _a, _b;
387
399
  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);
388
- }), selectedTab = _134[0], setSelectedTab = _134[1];
389
- var _135 = (0, react_1.useState)("dayGridMonth"), calendarView = _135[0], setCalendarView = _135[1];
400
+ }), selectedTab = _140[0], setSelectedTab = _140[1];
401
+ var _141 = (0, react_1.useState)("dayGridMonth"), calendarView = _141[0], setCalendarView = _141[1];
390
402
  // INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
391
403
  // (calendarView above drives the matching range query)
392
- var _136 = (0, react_1.useState)("month"), newCalendarViewMode = _136[0], setNewCalendarViewMode = _136[1];
393
- var _137 = (0, react_1.useState)(new Date()), calendarTabMonth = _137[0], setCalendarTabMonth = _137[1];
404
+ var _142 = (0, react_1.useState)("month"), newCalendarViewMode = _142[0], setNewCalendarViewMode = _142[1];
405
+ var _143 = (0, react_1.useState)(new Date()), calendarTabMonth = _143[0], setCalendarTabMonth = _143[1];
394
406
  // INFO: defaultViewSwitch picks the opening view only — the tab re-inits
395
407
  // whenever its settings change, and that must not undo the user's switch
396
408
  var calendarViewInitRef = (0, react_1.useRef)(false);
397
- var _138 = (0, react_1.useState)(true), kanbanDroppable = _138[0], setKanbanDroppable = _138[1];
398
- var _139 = (0, react_1.useState)([]), kanbanOptions = _139[0], setKanbanOptions = _139[1];
399
- var _140 = (0, react_1.useState)(false), batchUpdateModal = _140[0], setBatchUpdateModal = _140[1];
400
- var _141 = (0, react_1.useState)({
409
+ var _144 = (0, react_1.useState)(true), kanbanDroppable = _144[0], setKanbanDroppable = _144[1];
410
+ var _145 = (0, react_1.useState)([]), kanbanOptions = _145[0], setKanbanOptions = _145[1];
411
+ var _146 = (0, react_1.useState)(false), batchUpdateModal = _146[0], setBatchUpdateModal = _146[1];
412
+ var _147 = (0, react_1.useState)({
401
413
  columnId: "",
402
414
  columnData: {},
403
- }), batchUpdateData = _141[0], setBatchUpdateData = _141[1];
415
+ }), batchUpdateData = _147[0], setBatchUpdateData = _147[1];
404
416
  // INFO: system columns (created / updated at and by, record id, number)
405
417
  // join the structure hidden; the ones a user shows are kept per view
406
418
  var isSystemColumnsEnabled = !!((_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareSystemColumns);
407
419
  var appendedSystemColumnIds = isSystemColumnsEnabled
408
420
  ? 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; }); })
409
421
  : [];
410
- 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 _148 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _q !== void 0 ? _q : []), shownSystemColumnIds = _148[0], setShownSystemColumnIds = _148[1];
411
423
  var handleWithSystemColumns = function (model, shownIds) {
412
424
  if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
413
425
  return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
414
426
  };
415
- var _143 = (0, react_1.useState)(function () {
427
+ var _149 = (0, react_1.useState)(function () {
416
428
  var _a;
417
429
  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 : []);
418
430
  if (!persistedState)
@@ -439,8 +451,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
439
451
  });
440
452
  }
441
453
  return model;
442
- }), structure = _143[0], setStructure = _143[1];
443
- 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];
454
+ }), structure = _149[0], setStructure = _149[1];
455
+ var _150 = (0, react_1.useState)(((_r = props === null || props === void 0 ? void 0 : props.organise) === null || _r === void 0 ? void 0 : _r.additionalQuery) || []), additionalQuery = _150[0], setAdditionalQuery = _150[1];
444
456
  // INFO: State for user-configurable flex filters (Monday.com-style)
445
457
  // INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
446
458
  var defaultFlexFilterRow = [
@@ -451,9 +463,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
451
463
  value: undefined,
452
464
  },
453
465
  ];
454
- var _145 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
466
+ var _151 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
455
467
  ? persistedState.flexFilters
456
- : defaultFlexFilterRow), flexFilters = _145[0], setFlexFilters = _145[1];
468
+ : defaultFlexFilterRow), flexFilters = _151[0], setFlexFilters = _151[1];
457
469
  // INFO: always-current mirror of flexFilters, read by the imperative apply/
458
470
  // clear methods so chained calls in one tick aren't stale.
459
471
  var flexFiltersRef = (0, react_1.useRef)(flexFilters);
@@ -466,76 +478,81 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
466
478
  }, [flexFilters]);
467
479
  // INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
468
480
  // to prevent API calls on every keystroke when typing in value inputs
469
- var _146 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
481
+ var _152 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
470
482
  ? persistedState.flexFilters
471
- : defaultFlexFilterRow), flexFiltersDebounced = _146[0], setFlexFiltersDebounced = _146[1];
483
+ : defaultFlexFilterRow), flexFiltersDebounced = _152[0], setFlexFiltersDebounced = _152[1];
472
484
  // INFO: the filter rows of the export being set up — started from the
473
485
  // list's own when the export opens, so changing them leaves the list as it is
474
- var _147 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _147[0], setExportFlexFilters = _147[1];
475
- var _148 = (0, react_1.useState)({}), flexFilterReferenceOptions = _148[0], setFlexFilterReferenceOptions = _148[1];
476
- var _149 = (0, react_1.useState)({}), flexFilterReferenceSearch = _149[0], setFlexFilterReferenceSearch = _149[1];
477
- var _150 = (0, react_1.useState)(false), flexFilterModalOpen = _150[0], setFlexFilterModalOpen = _150[1];
478
- var _151 = (0, react_1.useState)(false), viewSettingsModalOpen = _151[0], setViewSettingsModalOpen = _151[1];
486
+ var _153 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _153[0], setExportFlexFilters = _153[1];
487
+ var _154 = (0, react_1.useState)({}), flexFilterReferenceOptions = _154[0], setFlexFilterReferenceOptions = _154[1];
488
+ var _155 = (0, react_1.useState)({}), flexFilterReferenceSearch = _155[0], setFlexFilterReferenceSearch = _155[1];
489
+ var _156 = (0, react_1.useState)(false), flexFilterModalOpen = _156[0], setFlexFilterModalOpen = _156[1];
490
+ var _157 = (0, react_1.useState)(false), viewSettingsModalOpen = _157[0], setViewSettingsModalOpen = _157[1];
479
491
  // INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
480
492
  // Deliberately kept out of `structure`: the props-sync effect below resets
481
493
  // structure to props.model whenever props change, which would wipe the
482
494
  // choice, and the persist effect derives schema-level hiddenColumnIds from
483
495
  // structure — writing user hides there would blur the two concepts.
484
- 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];
485
- var _153 = (0, react_1.useState)(""), columnSearch = _153[0], setColumnSearch = _153[1];
486
- var _154 = (0, react_1.useState)([]), savedViews = _154[0], setSavedViews = _154[1];
487
- var _155 = (0, react_1.useState)(null), activeSavedViewId = _155[0], setActiveSavedViewId = _155[1];
496
+ var _158 = (0, react_1.useState)((_s = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _s !== void 0 ? _s : []), userHiddenColumnIds = _158[0], setUserHiddenColumnIds = _158[1];
497
+ var _159 = (0, react_1.useState)(""), columnSearch = _159[0], setColumnSearch = _159[1];
498
+ var _160 = (0, react_1.useState)([]), savedViews = _160[0], setSavedViews = _160[1];
499
+ var _161 = (0, react_1.useState)(null), activeSavedViewId = _161[0], setActiveSavedViewId = _161[1];
500
+ // INFO: the widths of the view on screen, by column id ("180px")
501
+ var _162 = (0, react_1.useState)(function () { var _a, _b, _c; return (_c = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) === null || _b === void 0 ? void 0 : _b.columnWidths) !== null && _c !== void 0 ? _c : {}; }), columnWidths = _162[0], setColumnWidths = _162[1];
502
+ // INFO: unsaved changes are kept only once the opening view is on screen,
503
+ // so the defaults drawn before it never overwrite a person's own
504
+ var _163 = (0, react_1.useState)(false), isViewDraftReady = _163[0], setIsViewDraftReady = _163[1];
488
505
  // INFO: null while the name box is closed
489
- var _156 = (0, react_1.useState)(null), savedViewName = _156[0], setSavedViewName = _156[1];
490
- var _157 = (0, react_1.useState)(null), deletingSavedViewId = _157[0], setDeletingSavedViewId = _157[1];
491
- var _158 = (0, react_1.useState)(null), draggingColumnId = _158[0], setDraggingColumnId = _158[1];
506
+ var _164 = (0, react_1.useState)(null), savedViewName = _164[0], setSavedViewName = _164[1];
507
+ var _165 = (0, react_1.useState)(null), deletingSavedViewId = _165[0], setDeletingSavedViewId = _165[1];
508
+ var _166 = (0, react_1.useState)(null), draggingColumnId = _166[0], setDraggingColumnId = _166[1];
492
509
  var columnRowRefs = (0, react_1.useRef)({});
493
510
  //INFO : Used by Auth
494
- var _159 = (0, react_1.useState)({
511
+ var _167 = (0, react_1.useState)({
495
512
  email: "",
496
513
  google: "",
497
514
  phone: "",
498
515
  disabled: false,
499
516
  create: false,
500
- }), authMethods = _159[0], setAuthMethods = _159[1];
501
- var _160 = (0, react_1.useState)(""), selectedAuthMethod = _160[0], setSelectedAuthMethod = _160[1];
517
+ }), authMethods = _167[0], setAuthMethods = _167[1];
518
+ var _168 = (0, react_1.useState)(""), selectedAuthMethod = _168[0], setSelectedAuthMethod = _168[1];
502
519
  // INFO: the sign-in check of a users datasheet's record is running; the
503
520
  // panel shows a spinner rather than nothing, which read as "no login"
504
- var _161 = (0, react_1.useState)(false), authLoading = _161[0], setAuthLoading = _161[1];
521
+ var _169 = (0, react_1.useState)(false), authLoading = _169[0], setAuthLoading = _169[1];
505
522
  // INFO: a delete is running — the ref answers a second tap at once, before
506
523
  // the state has rendered, and the state disables the confirm button
507
524
  var deletingRef = (0, react_1.useRef)(false);
508
- var _162 = (0, react_1.useState)(false), deleting = _162[0], setDeleting = _162[1];
525
+ var _170 = (0, react_1.useState)(false), deleting = _170[0], setDeleting = _170[1];
509
526
  // INFO: Used by Activity Log
510
- var _163 = (0, react_1.useState)(false), activityModal = _163[0], setActivityModal = _163[1];
511
- var _164 = (0, react_1.useState)(""), activityId = _164[0], setActivityId = _164[1];
527
+ var _171 = (0, react_1.useState)(false), activityModal = _171[0], setActivityModal = _171[1];
528
+ var _172 = (0, react_1.useState)(""), activityId = _172[0], setActivityId = _172[1];
512
529
  //INFO : Used by Export
513
- var _165 = (0, react_1.useState)(null), csvFile = _165[0], setCSVFile = _165[1];
514
- var _166 = (0, react_1.useState)([]), csvFileData = _166[0], setCSVFileData = _166[1];
515
- var _167 = (0, react_1.useState)(0), stepCSVIndex = _167[0], setStepCSVIndex = _167[1];
516
- var _168 = (0, react_1.useState)({}), listCSVMapAttribute = _168[0], setListCSVMapAttribute = _168[1];
517
- var _169 = (0, react_1.useState)({}), listCSVObjAttribute = _169[0], setListCSVObjAttribute = _169[1];
518
- var _170 = (0, react_1.useState)([]), csvAPIAttribute = _170[0], setCSVAPIAttribute = _170[1];
519
- var _171 = (0, react_1.useState)(((_t = props.devSettings.currentUser) === null || _t === void 0 ? void 0 : _t.userEmail) || ""), exportCSVEmail = _171[0], setExportCSVEmail = _171[1];
520
- 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];
521
- var _173 = (0, react_1.useState)(false), exportPDFLoading = _173[0], setExportPDFLoading = _173[1];
522
- var _174 = (0, react_1.useState)(false), exportReadPDFLoading = _174[0], setExportReadPDFLoading = _174[1];
523
- 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];
524
- 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];
525
- var _177 = (0, react_1.useState)([]), importTableData = _177[0], setImportTableData = _177[1];
526
- var _178 = (0, react_1.useState)([]), queryList = _178[0], setQueryList = _178[1];
527
- var _179 = (0, react_1.useState)(undefined), allQueryList = _179[0], setAllQueryList = _179[1];
530
+ var _173 = (0, react_1.useState)(null), csvFile = _173[0], setCSVFile = _173[1];
531
+ var _174 = (0, react_1.useState)([]), csvFileData = _174[0], setCSVFileData = _174[1];
532
+ var _175 = (0, react_1.useState)(0), stepCSVIndex = _175[0], setStepCSVIndex = _175[1];
533
+ var _176 = (0, react_1.useState)({}), listCSVMapAttribute = _176[0], setListCSVMapAttribute = _176[1];
534
+ var _177 = (0, react_1.useState)({}), listCSVObjAttribute = _177[0], setListCSVObjAttribute = _177[1];
535
+ var _178 = (0, react_1.useState)([]), csvAPIAttribute = _178[0], setCSVAPIAttribute = _178[1];
536
+ var _179 = (0, react_1.useState)(((_t = props.devSettings.currentUser) === null || _t === void 0 ? void 0 : _t.userEmail) || ""), exportCSVEmail = _179[0], setExportCSVEmail = _179[1];
537
+ var _180 = (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 = _180[0], setExportPDFTitle = _180[1];
538
+ var _181 = (0, react_1.useState)(false), exportPDFLoading = _181[0], setExportPDFLoading = _181[1];
539
+ var _182 = (0, react_1.useState)(false), exportReadPDFLoading = _182[0], setExportReadPDFLoading = _182[1];
540
+ var _183 = (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 = _183[0], setExportSumAttributeIds = _183[1];
541
+ var _184 = (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 = _184[0], setHideSubItems = _184[1];
542
+ var _185 = (0, react_1.useState)([]), importTableData = _185[0], setImportTableData = _185[1];
543
+ var _186 = (0, react_1.useState)([]), queryList = _186[0], setQueryList = _186[1];
544
+ var _187 = (0, react_1.useState)(undefined), allQueryList = _187[0], setAllQueryList = _187[1];
528
545
  // INFO: a restored state wins over the prop; its "" is a list the user
529
546
  // ungrouped, so it opens ungrouped
530
- var _180 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
547
+ var _188 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
531
548
  ? persistedState.groupBy || undefined
532
- : (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.groupBy), groupId = _180[0], setGroupId = _180[1];
549
+ : (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.groupBy), groupId = _188[0], setGroupId = _188[1];
533
550
  // INFO: Monday-board per-group paging. Keyed by the group key that
534
551
  // handleBuildNewTableGroups() produces (an option, Unknown or No Value).
535
552
  // Each group tracks its own loaded cursor + total so it can lazily load its
536
553
  // next page as the user scrolls inside that band, independent of every other
537
554
  // group. Only used when renderCheckGroupPaging() is true.
538
- var _181 = (0, react_1.useState)({}), groupPageState = _181[0], setGroupPageState = _181[1];
555
+ var _189 = (0, react_1.useState)({}), groupPageState = _189[0], setGroupPageState = _189[1];
539
556
  // INFO: read fresh inside the async per-group fetch so chained scroll fires
540
557
  // in one tick do not re-fetch an already in-flight page.
541
558
  var groupPageStateRef = (0, react_1.useRef)({});
@@ -544,59 +561,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
544
561
  // list was re-read (new search, filter, sort or grouping) is dropped on
545
562
  // arrival instead of appending rows that belong to the old list
546
563
  var groupPagingGenRef = (0, react_1.useRef)(0);
547
- var _182 = (0, react_1.useState)(""), readTabSection = _182[0], setReadTabSection = _182[1];
548
- var _183 = (0, react_1.useState)(false), readFloatingNav = _183[0], setReadFloatingNav = _183[1];
564
+ var _190 = (0, react_1.useState)(""), readTabSection = _190[0], setReadTabSection = _190[1];
565
+ var _191 = (0, react_1.useState)(false), readFloatingNav = _191[0], setReadFloatingNav = _191[1];
549
566
  var readTabSectionRefs = (0, react_1.useRef)({});
550
567
  //INFO : Used by Read
551
568
  //INFO : Used by Update
552
- var _184 = (0, react_1.useState)(false), modalVisible = _184[0], setModalVisible = _184[1];
553
- var _185 = (0, react_1.useState)(false), deleteModal = _185[0], setDeleteModal = _185[1];
554
- var _186 = (0, react_1.useState)(false), excelModal = _186[0], setExcelModal = _186[1];
555
- var _187 = (0, react_1.useState)(false), exportExcel = _187[0], setExportExcel = _187[1];
556
- var _188 = (0, react_1.useState)(""), exportType = _188[0], setExportType = _188[1];
557
- var _189 = (0, react_1.useState)(false), exportQR = _189[0], setExportQR = _189[1];
558
- var _190 = (0, react_1.useState)(function () {
569
+ var _192 = (0, react_1.useState)(false), modalVisible = _192[0], setModalVisible = _192[1];
570
+ var _193 = (0, react_1.useState)(false), deleteModal = _193[0], setDeleteModal = _193[1];
571
+ var _194 = (0, react_1.useState)(false), excelModal = _194[0], setExcelModal = _194[1];
572
+ var _195 = (0, react_1.useState)(false), exportExcel = _195[0], setExportExcel = _195[1];
573
+ var _196 = (0, react_1.useState)(""), exportType = _196[0], setExportType = _196[1];
574
+ var _197 = (0, react_1.useState)(false), exportQR = _197[0], setExportQR = _197[1];
575
+ var _198 = (0, react_1.useState)(function () {
559
576
  var _a, _b;
560
577
  var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
561
578
  return firstTabId;
562
- }), activeTab = _190[0], setActiveTab = _190[1];
563
- var _191 = (0, react_1.useState)(false), signatureSigning = _191[0], setSignatureSigning = _191[1];
564
- var _192 = (0, react_1.useState)({}), selectedData = _192[0], setSelectedData = _192[1];
565
- var _193 = (0, react_1.useState)(""), selectedObjectStructureId = _193[0], setSelectedObjectStructureId = _193[1];
566
- var _194 = (0, react_1.useState)(""), selectedObjectId = _194[0], setSelectedObjectId = _194[1];
567
- var _195 = (0, react_1.useState)(""), selectedListAddressId = _195[0], setSelectedListAddressId = _195[1];
568
- var _196 = (0, react_1.useState)(-1), selectedListAddressIndex = _196[0], setSelectedListAddressIndex = _196[1];
569
- var _197 = (0, react_1.useState)({
579
+ }), activeTab = _198[0], setActiveTab = _198[1];
580
+ var _199 = (0, react_1.useState)(false), signatureSigning = _199[0], setSignatureSigning = _199[1];
581
+ var _200 = (0, react_1.useState)({}), selectedData = _200[0], setSelectedData = _200[1];
582
+ var _201 = (0, react_1.useState)(""), selectedObjectStructureId = _201[0], setSelectedObjectStructureId = _201[1];
583
+ var _202 = (0, react_1.useState)(""), selectedObjectId = _202[0], setSelectedObjectId = _202[1];
584
+ var _203 = (0, react_1.useState)(""), selectedListAddressId = _203[0], setSelectedListAddressId = _203[1];
585
+ var _204 = (0, react_1.useState)(-1), selectedListAddressIndex = _204[0], setSelectedListAddressIndex = _204[1];
586
+ var _205 = (0, react_1.useState)({
570
587
  lat: 0,
571
588
  lng: 0,
572
589
  name: "",
573
- }), selectedListAddress = _197[0], setSelectedListAddress = _197[1];
574
- var _198 = (0, react_1.useState)({}), selectedObjectData = _198[0], setSelectedObjectData = _198[1];
575
- var _199 = (0, react_1.useState)(null), objectCellEdit = _199[0], setObjectCellEdit = _199[1];
576
- var _200 = (0, react_1.useState)(false), referenceLoading = _200[0], setReferenceLoading = _200[1];
577
- var _201 = (0, react_1.useState)({}), referencesOptions = _201[0], setReferencesOptions = _201[1];
578
- var _202 = (0, react_1.useState)({}), referencesDetails = _202[0], setReferencesDetails = _202[1];
579
- var _203 = (0, react_1.useState)({}), listReferencesOptions = _203[0], setListReferencesOptions = _203[1];
580
- var _204 = (0, react_1.useState)({}), referenceDeleteTableData = _204[0], setReferenceDeleteTableData = _204[1];
581
- var _205 = (0, react_1.useState)([]), relatedSections = _205[0], setRelatedSections = _205[1];
582
- var _206 = (0, react_1.useState)(0), referenceDeleteIndex = _206[0], setReferenceDeleteIndex = _206[1];
583
- var _207 = (0, react_1.useState)({
590
+ }), selectedListAddress = _205[0], setSelectedListAddress = _205[1];
591
+ var _206 = (0, react_1.useState)({}), selectedObjectData = _206[0], setSelectedObjectData = _206[1];
592
+ var _207 = (0, react_1.useState)(null), objectCellEdit = _207[0], setObjectCellEdit = _207[1];
593
+ var _208 = (0, react_1.useState)(false), referenceLoading = _208[0], setReferenceLoading = _208[1];
594
+ var _209 = (0, react_1.useState)({}), referencesOptions = _209[0], setReferencesOptions = _209[1];
595
+ var _210 = (0, react_1.useState)({}), referencesDetails = _210[0], setReferencesDetails = _210[1];
596
+ var _211 = (0, react_1.useState)({}), listReferencesOptions = _211[0], setListReferencesOptions = _211[1];
597
+ var _212 = (0, react_1.useState)({}), referenceDeleteTableData = _212[0], setReferenceDeleteTableData = _212[1];
598
+ var _213 = (0, react_1.useState)([]), relatedSections = _213[0], setRelatedSections = _213[1];
599
+ var _214 = (0, react_1.useState)(0), referenceDeleteIndex = _214[0], setReferenceDeleteIndex = _214[1];
600
+ var _215 = (0, react_1.useState)({
584
601
  id: "",
585
602
  name: "",
586
603
  type: "string",
587
- }), referenceCreationModal = _207[0], setReferenceCreationModal = _207[1];
588
- var _208 = (0, react_1.useState)({}), referenceModelSchema = _208[0], setReferenceSchema = _208[1];
589
- var _209 = (0, react_1.useState)([]), kanbanChecked = _209[0], setKanbanChecked = _209[1];
604
+ }), referenceCreationModal = _215[0], setReferenceCreationModal = _215[1];
605
+ var _216 = (0, react_1.useState)({}), referenceModelSchema = _216[0], setReferenceSchema = _216[1];
606
+ var _217 = (0, react_1.useState)([]), kanbanChecked = _217[0], setKanbanChecked = _217[1];
590
607
  //INFO : Offline
591
- var _210 = (0, react_1.useState)(0), offlineDataLength = _210[0], setOfflineDataLength = _210[1];
592
- var _211 = (0, react_1.useState)(false), offlineModal = _211[0], setOfflineModal = _211[1];
608
+ var _218 = (0, react_1.useState)(0), offlineDataLength = _218[0], setOfflineDataLength = _218[1];
609
+ var _219 = (0, react_1.useState)(false), offlineModal = _219[0], setOfflineModal = _219[1];
593
610
  // INFO: live-stream state — driven by socket connection and navigator.onLine
594
- var _212 = (0, react_1.useState)(false), isLive = _212[0], setIsLive = _212[1];
595
- var _213 = (0, react_1.useState)(false), isLiveOffline = _213[0], setIsLiveOffline = _213[1];
611
+ var _220 = (0, react_1.useState)(false), isLive = _220[0], setIsLive = _220[1];
612
+ var _221 = (0, react_1.useState)(false), isLiveOffline = _221[0], setIsLiveOffline = _221[1];
596
613
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
597
614
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
598
615
  // Independent of SSE status so it works even when bareSocketName is not set.
599
- var _214 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _214[0], setIsNetworkOffline = _214[1];
616
+ var _222 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _222[0], setIsNetworkOffline = _222[1];
600
617
  var previousType = (0, react_1.useRef)(null);
601
618
  var previousSelectedData = (0, react_1.useRef)(null);
602
619
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -816,7 +833,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
816
833
  var isSchemaHideMode = ((_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.onChangeHide) ? true : false;
817
834
  // INFO: rows per page is a view setting the user can change, so it starts from
818
835
  // the persisted value and falls back to the consumer's limit
819
- 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];
836
+ var _223 = (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 = _223[0], setPageLimit = _223[1];
820
837
  var limit = pageLimit;
821
838
  var isSavedViewsEnabled = !!((_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.savedViews) && resolvedType === "list";
822
839
  // INFO: an app that stores views takes over from this browser's storage, so
@@ -920,7 +937,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
920
937
  displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
921
938
  };
922
939
  };
923
- var _216 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _216.canUpdateRecord, canInlineUpdate = _216.canInlineUpdate, canBatchUpdate = _216.canBatchUpdate, canDeleteRecord = _216.canDeleteRecord;
940
+ var _224 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _224.canUpdateRecord, canInlineUpdate = _224.canInlineUpdate, canBatchUpdate = _224.canBatchUpdate, canDeleteRecord = _224.canDeleteRecord;
924
941
  var isEditor = ((_27 = props.edit) === null || _27 === void 0 ? void 0 : _27.allEditable) ? true : false;
925
942
  var isOffline = (_28 = props.bareSettings) === null || _28 === void 0 ? void 0 : _28.bareOffline;
926
943
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
@@ -1443,7 +1460,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1443
1460
  // INFO: scroll mode reloads from page 0; the anchor restores the position
1444
1461
  pageIndex: renderCheckScrollMode() ? 0 : pageIndex, hiddenColumnIds: structure.filter(function (col) { return col.hide; }).map(function (col) { return col.id; }),
1445
1462
  // INFO: raw, so switching bareViewSettings off does not wipe the user's choice
1446
- userHiddenColumnIds: userHiddenColumnIds, shownSystemColumnIds: shownSystemColumnIds, columnOrder: structure.map(function (col) { return col.id; }), groupBy: groupId !== null && groupId !== void 0 ? groupId : "" }, scrollCaptureRef.current));
1463
+ userHiddenColumnIds: userHiddenColumnIds, shownSystemColumnIds: shownSystemColumnIds, columnOrder: structure.map(function (col) { return col.id; }), columnWidths: columnWidths, groupBy: groupId !== null && groupId !== void 0 ? groupId : "" }, scrollCaptureRef.current));
1447
1464
  };
1448
1465
  handleRegisterViewSnapshot(handleBuildViewSnapshot);
1449
1466
  //=====================================================================================
@@ -1454,6 +1471,35 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1454
1471
  if (isSavedViewsEnabled && !isAppViews)
1455
1472
  setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
1456
1473
  }, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
1474
+ // INFO: the app keeps All's settings, so every change is kept in this
1475
+ // browser until the person updates the view for everyone or resets it
1476
+ var isViewDraftsEnabled = isSavedViewsEnabled && ((_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.allView) !== undefined;
1477
+ var handleGetViewDraftKey = function (viewId) {
1478
+ var _a, _b;
1479
+ return (0, viewStatePersistence_1.buildViewDraftKey)(props.collectionId, viewId !== null && viewId !== void 0 ? viewId : "all", (_a = props.organise) === null || _a === void 0 ? void 0 : _a.persistKey, (_b = devSettings.currentUser) === null || _b === void 0 ? void 0 : _b.userEmail);
1480
+ };
1481
+ var handleGetStoredViewState = function (view) { var _a, _b; return view ? view.state : ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) !== null && _b !== void 0 ? _b : null); };
1482
+ // INFO: compared in a shape both sides share — a stored order is kept to
1483
+ // the columns that still exist, with new ones after in model order, and
1484
+ // hides only count where a view can apply them (schema-hide mode)
1485
+ var handleIsOnViewState = function (current, stored) {
1486
+ var _a;
1487
+ var modelIds = ((_a = props.model) !== null && _a !== void 0 ? _a : []).map(function (eachColumn) { return eachColumn.id; });
1488
+ var handleComparable = function (state) {
1489
+ var _a;
1490
+ var kept = ((_a = state.columnOrder) !== null && _a !== void 0 ? _a : []).filter(function (eachId) {
1491
+ return modelIds.includes(eachId);
1492
+ });
1493
+ return __assign(__assign({}, state), { columnOrder: __spreadArray(__spreadArray([], kept, true), modelIds.filter(function (eachId) { return !kept.includes(eachId); }), true), hiddenColumnIds: isSchemaHideMode ? state.hiddenColumnIds : undefined });
1494
+ };
1495
+ return (0, viewStatePersistence_1.handleIsSameViewState)(handleComparable((0, viewStatePersistence_1.handlePickViewState)(current)), handleComparable((0, viewStatePersistence_1.handlePickViewState)(handleResolveViewState(stored))));
1496
+ };
1497
+ var handleResizeColumn = function (columnId, pixels) {
1498
+ return setColumnWidths(function (previous) {
1499
+ var _a;
1500
+ return (__assign(__assign({}, previous), (_a = {}, _a[columnId] = (0, columnWidth_1.handleFormatColumnWidth)(pixels), _a)));
1501
+ });
1502
+ };
1457
1503
  // INFO: views belong to a tab, so another tab starts with none selected
1458
1504
  (0, react_1.useEffect)(function () {
1459
1505
  setActiveSavedViewId(null);
@@ -1504,7 +1550,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1504
1550
  var lastSentSharedViewsRef = (0, react_1.useRef)(null);
1505
1551
  (0, react_1.useEffect)(function () {
1506
1552
  lastSentSharedViewsRef.current = null;
1507
- }, [(_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.sharedViews]);
1553
+ }, [(_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.sharedViews]);
1508
1554
  var handleStoreSharedViews = function (update) {
1509
1555
  var _a, _b, _c;
1510
1556
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
@@ -1525,28 +1571,37 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1525
1571
  return;
1526
1572
  if (activeSavedViewId !== null || (isPersistEnabled && rawPersistedState)) {
1527
1573
  openingViewSettledRef.current = true;
1574
+ setIsViewDraftReady(true);
1528
1575
  return;
1529
1576
  }
1530
1577
  var wantedId = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSavedViewId) !== null && _b !== void 0 ? _b : (_c = props.organise) === null || _c === void 0 ? void 0 : _c.defaultSavedViewId;
1531
- if (!wantedId)
1578
+ if (!wantedId) {
1579
+ // INFO: All opens with its stored settings and this person's changes
1580
+ if (isViewDraftsEnabled) {
1581
+ openingViewSettledRef.current = true;
1582
+ handleApplySavedView(null, true);
1583
+ setIsViewDraftReady(true);
1584
+ }
1532
1585
  return;
1586
+ }
1533
1587
  // INFO: the app's views may still be loading
1534
1588
  if (isAppViews && ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.sharedViews) === undefined)
1535
1589
  return;
1536
1590
  openingViewSettledRef.current = true;
1537
1591
  var view = handleGetTabSavedViews().find(function (eachView) { return eachView.id === wantedId; });
1538
- if (view)
1539
- handleApplySavedView(view, true);
1592
+ if (view || isViewDraftsEnabled)
1593
+ handleApplySavedView(view !== null && view !== void 0 ? view : null, true);
1594
+ setIsViewDraftReady(true);
1540
1595
  /* eslint-disable */
1541
1596
  }, [
1542
1597
  isSavedViewsEnabled,
1543
- (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.initialSavedViewId,
1544
- (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.defaultSavedViewId,
1545
- (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.sharedViews,
1598
+ (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.initialSavedViewId,
1599
+ (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.defaultSavedViewId,
1600
+ (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.sharedViews,
1546
1601
  savedViews,
1547
1602
  ]);
1548
1603
  /* eslint-enable */
1549
- var defaultSavedViewIds = ((_76 = (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.defaultSavedViews) !== null && _76 !== void 0 ? _76 : [])
1604
+ var defaultSavedViewIds = ((_77 = (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.defaultSavedViews) !== null && _77 !== void 0 ? _77 : [])
1550
1605
  .map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
1551
1606
  .join("|");
1552
1607
  // INFO: keyed on the ids, not the array, so an inline literal passed on every
@@ -1560,11 +1615,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1560
1615
  // INFO: a view is the defaults overridden by its own fields, so a field it
1561
1616
  // leaves out is reset rather than carried over from whatever was on screen
1562
1617
  var handleResolveViewState = function (state) {
1563
- var _a, _b, _c, _d, _e, _f;
1618
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
1564
1619
  var model = (_a = props.model) !== null && _a !== void 0 ? _a : [];
1565
- 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
1620
+ return ((_j = (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
1566
1621
  .filter(function (eachColumn) { return eachColumn.hide; })
1567
- .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 : {});
1622
+ .map(function (eachColumn) { return eachColumn.id; }), columnOrder: model.map(function (eachColumn) { return eachColumn.id; }),
1623
+ // INFO: a saved view without its own widths follows All's
1624
+ columnWidths: (_f = (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.allView) === null || _e === void 0 ? void 0 : _e.columnWidths) !== null && _f !== void 0 ? _f : {}, groupBy: (_h = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.groupBy) !== null && _h !== void 0 ? _h : "" }, (state !== null && state !== void 0 ? state : {})), model, (0, flexFilter_1.handleBuildFlexFilterStructure)(model, flexFilterExtras))) !== null && _j !== void 0 ? _j : {});
1568
1625
  };
1569
1626
  var handleApplyViewColumns = function (columns, state) {
1570
1627
  var _a, _b;
@@ -1614,32 +1671,36 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1614
1671
  // so its sort is not handed back (a host saving sort would write it on
1615
1672
  // every open)
1616
1673
  var handleApplySavedView = function (view, isOpening) {
1617
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
1618
- var next = handleResolveViewState((_a = view === null || view === void 0 ? void 0 : view.state) !== null && _a !== void 0 ? _a : null);
1674
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
1675
+ // INFO: the stored view, or this person's unsaved changes to it
1676
+ var next = handleResolveViewState((_b = (isViewDraftsEnabled
1677
+ ? (0, viewStatePersistence_1.handleReadViewDraft)(handleGetViewDraftKey((_a = view === null || view === void 0 ? void 0 : view.id) !== null && _a !== void 0 ? _a : null))
1678
+ : null)) !== null && _b !== void 0 ? _b : handleGetStoredViewState(view));
1619
1679
  var isQueryChanged = !(0, viewStatePersistence_1.handleIsSameViewState)((0, viewStatePersistence_1.handlePickQueryState)(handleBuildViewSnapshot()), (0, viewStatePersistence_1.handlePickQueryState)(next));
1620
1680
  handleClearFlexFilterTypingTimeout();
1621
1681
  if (typingTimeout.current) {
1622
1682
  clearTimeout(typingTimeout.current);
1623
1683
  typingTimeout.current = null;
1624
1684
  }
1625
- setFilterSearch((_b = next.filterSearchParams) !== null && _b !== void 0 ? _b : {});
1626
- setFilterSearchParams((_c = next.filterSearchParams) !== null && _c !== void 0 ? _c : {});
1627
- setFilterSelection(((_d = next.filterSelection) !== null && _d !== void 0 ? _d : {}));
1628
- setFilterReference(((_e = next.filterReference) !== null && _e !== void 0 ? _e : {}));
1685
+ setFilterSearch((_c = next.filterSearchParams) !== null && _c !== void 0 ? _c : {});
1686
+ setFilterSearchParams((_d = next.filterSearchParams) !== null && _d !== void 0 ? _d : {});
1687
+ setFilterSelection(((_e = next.filterSelection) !== null && _e !== void 0 ? _e : {}));
1688
+ setFilterReference(((_f = next.filterReference) !== null && _f !== void 0 ? _f : {}));
1629
1689
  setFilterReferenceDate(next.filterReferenceDate
1630
1690
  ? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
1631
1691
  : initialFilterReferenceDate);
1632
- handleCommitFlexFilters(((_f = next.flexFilters) === null || _f === void 0 ? void 0 : _f.length) ? next.flexFilters : defaultFlexFilterRow);
1692
+ handleCommitFlexFilters(((_g = next.flexFilters) === null || _g === void 0 ? void 0 : _g.length) ? next.flexFilters : defaultFlexFilterRow);
1633
1693
  setPersistedSort(next.sort);
1634
1694
  if (!isOpening &&
1635
1695
  next.sort &&
1636
1696
  !(0, viewStatePersistence_1.handleIsSameViewState)(next.sort, activeSortId !== null && activeSortId !== void 0 ? activeSortId : {}))
1637
- (_h = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.onChangeSort) === null || _h === void 0 ? void 0 : _h.call(_g, next.sort);
1697
+ (_j = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.onChangeSort) === null || _j === void 0 ? void 0 : _j.call(_h, next.sort);
1638
1698
  if (next.pageLimit)
1639
1699
  setPageLimit(next.pageLimit);
1640
- handleChangeGroupBy((_j = next.groupBy) !== null && _j !== void 0 ? _j : "", !isOpening);
1641
- setUserHiddenColumnIds((_k = next.userHiddenColumnIds) !== null && _k !== void 0 ? _k : []);
1642
- setShownSystemColumnIds((_l = next.shownSystemColumnIds) !== null && _l !== void 0 ? _l : []);
1700
+ handleChangeGroupBy((_k = next.groupBy) !== null && _k !== void 0 ? _k : "", !isOpening);
1701
+ setUserHiddenColumnIds((_l = next.userHiddenColumnIds) !== null && _l !== void 0 ? _l : []);
1702
+ setShownSystemColumnIds((_m = next.shownSystemColumnIds) !== null && _m !== void 0 ? _m : []);
1703
+ setColumnWidths((_o = next.columnWidths) !== null && _o !== void 0 ? _o : {});
1643
1704
  if (view) {
1644
1705
  if (!schemaStructureRef.current)
1645
1706
  schemaStructureRef.current = structure;
@@ -1654,12 +1715,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1654
1715
  pendingViewCondKeyRef.current = JSON.stringify(handleReadQueryHocCond());
1655
1716
  handleClearDataByFilter();
1656
1717
  if (pageIndex !== 0)
1657
- (_o = (_m = props.organise) === null || _m === void 0 ? void 0 : _m.onChangePagination) === null || _o === void 0 ? void 0 : _o.call(_m, 0);
1658
- (_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
1718
+ (_q = (_p = props.organise) === null || _p === void 0 ? void 0 : _p.onChangePagination) === null || _q === void 0 ? void 0 : _q.call(_p, 0);
1719
+ (_s = (_r = props.bareSettings) === null || _r === void 0 ? void 0 : _r.bareListHandleFilter) === null || _s === void 0 ? void 0 : _s.call(_r, (_t = next.filterSearchParams) !== null && _t !== void 0 ? _t : {}, (_u = next.filterSelection) !== null && _u !== void 0 ? _u : {}, next.filterReferenceDate
1659
1720
  ? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
1660
- : initialFilterReferenceDate, (_t = next.filterReference) !== null && _t !== void 0 ? _t : {});
1721
+ : initialFilterReferenceDate, (_v = next.filterReference) !== null && _v !== void 0 ? _v : {});
1661
1722
  }
1662
- setActiveSavedViewId((_u = view === null || view === void 0 ? void 0 : view.id) !== null && _u !== void 0 ? _u : null);
1723
+ setActiveSavedViewId((_w = view === null || view === void 0 ? void 0 : view.id) !== null && _w !== void 0 ? _w : null);
1663
1724
  setDeletingSavedViewId(null);
1664
1725
  };
1665
1726
  // INFO: re-read storage before each write so a change made in another browser
@@ -1712,6 +1773,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1712
1773
  };
1713
1774
  var handleUpdateSavedView = function (id) {
1714
1775
  var state = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
1776
+ if (isViewDraftsEnabled)
1777
+ (0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(id), null);
1715
1778
  if (isAppViews) {
1716
1779
  handleStoreSharedViews(function (views) {
1717
1780
  return views.map(function (eachView) {
@@ -1808,6 +1871,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1808
1871
  pageLimit,
1809
1872
  ]);
1810
1873
  /* eslint-enable */
1874
+ // INFO: a view's settings that differ from what is stored for it are this
1875
+ // person's own until they update or reset it; back on the stored settings,
1876
+ // nothing is kept
1877
+ (0, react_1.useEffect)(function () {
1878
+ if (!isViewDraftsEnabled || !isViewDraftReady)
1879
+ return;
1880
+ var activeView = activeSavedViewId
1881
+ ? handleGetTabSavedViews().find(function (eachView) { return eachView.id === activeSavedViewId; })
1882
+ : null;
1883
+ // INFO: the view was deleted or belongs to another tab
1884
+ if (activeSavedViewId && !activeView)
1885
+ return;
1886
+ var current = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
1887
+ var stored = handleGetStoredViewState(activeView);
1888
+ (0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(activeSavedViewId), handleIsOnViewState(current, stored) ? null : current);
1889
+ /* eslint-disable */
1890
+ }, [
1891
+ isViewDraftsEnabled,
1892
+ isViewDraftReady,
1893
+ activeSavedViewId,
1894
+ filterSearchParams,
1895
+ filterSelection,
1896
+ filterReference,
1897
+ filterReferenceDate,
1898
+ flexFiltersDebounced,
1899
+ structure,
1900
+ persistedSort,
1901
+ userHiddenColumnIds,
1902
+ shownSystemColumnIds,
1903
+ pageLimit,
1904
+ groupId,
1905
+ columnWidths,
1906
+ (_78 = props.organise) === null || _78 === void 0 ? void 0 : _78.allView,
1907
+ (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.sharedViews,
1908
+ savedViews,
1909
+ ]);
1910
+ /* eslint-enable */
1911
+ // INFO: All's settings on screen become All's for everyone
1912
+ var handleUpdateAllView = function () {
1913
+ var _a;
1914
+ if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeAllView))
1915
+ return;
1916
+ props.organise.onChangeAllView((0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot()));
1917
+ (0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(null), null);
1918
+ };
1919
+ // INFO: this person's changes are dropped and the stored view shown again
1920
+ var handleResetView = function () {
1921
+ var activeView = activeSavedViewId
1922
+ ? handleGetTabSavedViews().find(function (eachView) { return eachView.id === activeSavedViewId; })
1923
+ : null;
1924
+ (0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(activeSavedViewId), null);
1925
+ handleApplySavedView(activeView !== null && activeView !== void 0 ? activeView : null);
1926
+ };
1811
1927
  // INFO: re-arm on leaving the list, so each return from a record restores once
1812
1928
  (0, react_1.useEffect)(function () {
1813
1929
  if (props.type !== "list")
@@ -1828,7 +1944,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1828
1944
  var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
1829
1945
  scrollRestoredRef.current = isSwitch || isOtherListReturn;
1830
1946
  /* eslint-disable */
1831
- }, [props.collectionId, (_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.persistKey]);
1947
+ }, [props.collectionId, (_80 = props.organise) === null || _80 === void 0 ? void 0 : _80.persistKey]);
1832
1948
  /* eslint-enable */
1833
1949
  // INFO: wait a frame — rows land in state one tick before layout
1834
1950
  (0, react_1.useEffect)(function () {
@@ -1863,7 +1979,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1863
1979
  (0, react_1.useEffect)(function () {
1864
1980
  handleOfflinePrefetch();
1865
1981
  /* eslint-disable */
1866
- }, [props.collectionId, (_78 = props.bareSettings) === null || _78 === void 0 ? void 0 : _78.bareOffline]);
1982
+ }, [props.collectionId, (_81 = props.bareSettings) === null || _81 === void 0 ? void 0 : _81.bareOffline]);
1867
1983
  /* eslint-enable */
1868
1984
  // INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
1869
1985
  // Calls through handleRefreshRef so the interval always dispatches the latest
@@ -1883,7 +1999,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1883
1999
  }, interval);
1884
2000
  return function () { return clearInterval(timer); };
1885
2001
  /* eslint-disable */
1886
- }, [(_79 = props.bareSettings) === null || _79 === void 0 ? void 0 : _79.barePollingInterval, isLive, isNetworkOffline]);
2002
+ }, [(_82 = props.bareSettings) === null || _82 === void 0 ? void 0 : _82.barePollingInterval, isLive, isNetworkOffline]);
1887
2003
  /* eslint-enable */
1888
2004
  // INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
1889
2005
  // EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
@@ -1925,7 +2041,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1925
2041
  };
1926
2042
  /* eslint-disable */
1927
2043
  }, [
1928
- (_80 = props.bareSettings) === null || _80 === void 0 ? void 0 : _80.bareSocketName,
2044
+ (_83 = props.bareSettings) === null || _83 === void 0 ? void 0 : _83.bareSocketName,
1929
2045
  props.collectionId,
1930
2046
  props.devSettings.sseEndpoint,
1931
2047
  props.devSettings.dbAPIToken,
@@ -2048,7 +2164,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2048
2164
  previousType.current = resolvedType;
2049
2165
  }, [resolvedType, props.id]);
2050
2166
  (0, react_1.useEffect)(function () {
2051
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
2167
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
2052
2168
  var handleInitTab = function () { return __awaiter(void 0, void 0, void 0, function () {
2053
2169
  var currentTab, defaultViewSwitch, kanbanSettings, kanbanTitle_1, kanbanRefRQ_1, kanbanRefOption_1, kanbanRefLabel_1, kanbanRefQuery;
2054
2170
  var _a, _b, _c, _d, _e, _f, _g, _h;
@@ -2141,25 +2257,39 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2141
2257
  // restored column visibility/order from localStorage
2142
2258
  var isRestoringView = isPersistEnabled && !!persistedState && !persistedViewMountedRef.current;
2143
2259
  if (!isRestoringView) {
2144
- setStructure(handleWithSystemColumns((_a = props.model) !== null && _a !== void 0 ? _a : []));
2260
+ // INFO: with a view's changes kept per person, the columns on screen
2261
+ // keep their order and hides when the model is handed in again
2262
+ setStructure(function (previous) {
2263
+ var _a, _b;
2264
+ return isViewDraftsEnabled
2265
+ ? handleApplyViewColumns(handleWithSystemColumns((_a = props.model) !== null && _a !== void 0 ? _a : []), {
2266
+ columnOrder: previous.map(function (eachColumn) { return eachColumn.id; }),
2267
+ hiddenColumnIds: previous
2268
+ .filter(function (eachColumn) { return eachColumn.hide; })
2269
+ .map(function (eachColumn) { return eachColumn.id; }),
2270
+ shownSystemColumnIds: shownSystemColumnIds,
2271
+ })
2272
+ : handleWithSystemColumns((_b = props.model) !== null && _b !== void 0 ? _b : []);
2273
+ });
2145
2274
  schemaStructureRef.current = null;
2146
2275
  }
2147
2276
  persistedViewMountedRef.current = true;
2148
- setAdditionalQuery((_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.additionalQuery) !== null && _c !== void 0 ? _c : []);
2277
+ setAdditionalQuery((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) !== null && _b !== void 0 ? _b : []);
2149
2278
  // INFO: the restored grouping is set at mount; a later change of the
2150
2279
  // host's groupBy still applies
2151
- if (!isRestoringView)
2152
- setGroupId((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.groupBy) !== null && _e !== void 0 ? _e : "");
2153
- setExportPDFTitle((_h = (_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.exportSettings) === null || _g === void 0 ? void 0 : _g.defaultExportPDFName) !== null && _h !== void 0 ? _h : "");
2280
+ // INFO: with views kept per person, the view applied sets the grouping
2281
+ if (!isRestoringView && !isViewDraftsEnabled)
2282
+ setGroupId((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.groupBy) !== null && _d !== void 0 ? _d : "");
2283
+ setExportPDFTitle((_g = (_f = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.exportSettings) === null || _f === void 0 ? void 0 : _f.defaultExportPDFName) !== null && _g !== void 0 ? _g : "");
2154
2284
  var currentTabProps = {
2155
2285
  id: props.id,
2156
2286
  collectionId: props.collectionId,
2157
2287
  model: props.model,
2158
2288
  localURLEndpoint: props.localURLEndpoint,
2159
- extendedTabs: (_j = props.organise) === null || _j === void 0 ? void 0 : _j.extendedTabs,
2160
- viewId: (_k = props.organise) === null || _k === void 0 ? void 0 : _k.viewId,
2161
- additionalQuery: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.additionalQuery,
2162
- groupBy: (_m = props.organise) === null || _m === void 0 ? void 0 : _m.groupBy,
2289
+ extendedTabs: (_h = props.organise) === null || _h === void 0 ? void 0 : _h.extendedTabs,
2290
+ viewId: (_j = props.organise) === null || _j === void 0 ? void 0 : _j.viewId,
2291
+ additionalQuery: (_k = props.organise) === null || _k === void 0 ? void 0 : _k.additionalQuery,
2292
+ groupBy: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.groupBy,
2163
2293
  type: resolvedType,
2164
2294
  };
2165
2295
  var safeReplacer = function () {
@@ -2185,10 +2315,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2185
2315
  props.collectionId,
2186
2316
  props.model,
2187
2317
  props.localURLEndpoint,
2188
- (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.extendedTabs,
2189
- (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.viewId,
2190
- (_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.additionalQuery,
2191
- (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.groupBy,
2318
+ (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.extendedTabs,
2319
+ (_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.viewId,
2320
+ (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.additionalQuery,
2321
+ (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.groupBy,
2192
2322
  resolvedType,
2193
2323
  ]);
2194
2324
  /**
@@ -2340,7 +2470,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2340
2470
  };
2341
2471
  }, 100);
2342
2472
  return function () { return clearTimeout(timeoutId); };
2343
- }, [(_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.showReadFloatingNav, resolvedType, props.id, loading]);
2473
+ }, [(_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.showReadFloatingNav, resolvedType, props.id, loading]);
2344
2474
  (0, react_1.useEffect)(function () {
2345
2475
  if (resolvedType !== "read")
2346
2476
  return;
@@ -3096,6 +3226,97 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3096
3226
  /* eslint-disable */
3097
3227
  }, [formulaSignature]);
3098
3228
  /* eslint-enable */
3229
+ // INFO: a display row is built from the columns at the time it was read —
3230
+ // a button, timer or rating cell exists only if its column did. A column
3231
+ // added, edited or removed after that left its cells blank until the list
3232
+ // was read again, so the rows held are rebuilt against the new columns
3233
+ // instead. That covers a read still in flight when the columns changed too:
3234
+ // it lands built from the old ones, and is rebuilt the same way. Hiding or
3235
+ // resizing a column changes nothing a cell shows.
3236
+ var columnSignature = JSON.stringify(structure
3237
+ .map(function (_a) {
3238
+ var hide = _a.hide, width = _a.width, eachColumn = __rest(_a, ["hide", "width"]);
3239
+ return eachColumn;
3240
+ })
3241
+ .sort(function (a, b) { return String(a.id).localeCompare(String(b.id)); }));
3242
+ // INFO: the columns the rows on screen were built from, and those a rebuild
3243
+ // under way is building them from
3244
+ var displaySignatureRef = (0, react_1.useRef)(columnSignature);
3245
+ var rebuildingSignatureRef = (0, react_1.useRef)("");
3246
+ (0, react_1.useEffect)(function () {
3247
+ // INFO: an offline list shows its stored rows as they are, with no cells
3248
+ // built from the columns
3249
+ if (isOffline || resolvedType !== "list")
3250
+ return;
3251
+ if (displaySignatureRef.current === columnSignature)
3252
+ return;
3253
+ if (rebuildingSignatureRef.current === columnSignature)
3254
+ return;
3255
+ if (spaceTableDataRef.current.length === 0 && !formulaFullReadRef.current)
3256
+ return;
3257
+ rebuildingSignatureRef.current = columnSignature;
3258
+ handleRebuildListRows().finally(function () {
3259
+ rebuildingSignatureRef.current = "";
3260
+ });
3261
+ /* eslint-disable */
3262
+ }, [columnSignature, spaceTableData]);
3263
+ /* eslint-enable */
3264
+ var handleRebuildDisplayRows = function (rows, displayRows) { return __awaiter(void 0, void 0, void 0, function () {
3265
+ var sourceRows, rebuilt;
3266
+ var _a, _b, _c, _d;
3267
+ return __generator(this, function (_e) {
3268
+ switch (_e.label) {
3269
+ case 0:
3270
+ sourceRows = rows.map(function (eachRow) {
3271
+ var _a;
3272
+ return serverId === "_id" && eachRow && eachRow["_id"] === undefined
3273
+ ? __assign(__assign({}, eachRow), { _id: (_a = eachRow.recordId) !== null && _a !== void 0 ? _a : eachRow.id }) : eachRow;
3274
+ });
3275
+ 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)];
3276
+ case 1:
3277
+ rebuilt = _e.sent();
3278
+ if (rebuilt.length !== displayRows.length)
3279
+ return [2 /*return*/, null];
3280
+ // INFO: the key and grouped children stay as the list gave them
3281
+ return [2 /*return*/, rebuilt.map(function (eachRow, index) {
3282
+ var _a, _b, _c;
3283
+ 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)
3284
+ ? { children: displayRows[index].children }
3285
+ : {})));
3286
+ })];
3287
+ }
3288
+ });
3289
+ }); };
3290
+ var handleRebuildListRows = function () { return __awaiter(void 0, void 0, void 0, function () {
3291
+ var cached, displayRows_1, rows, displayRows;
3292
+ return __generator(this, function (_a) {
3293
+ switch (_a.label) {
3294
+ case 0:
3295
+ cached = formulaFullReadRef.current;
3296
+ if (!cached) return [3 /*break*/, 2];
3297
+ return [4 /*yield*/, handleRebuildDisplayRows(cached.rows, cached.displayRows)];
3298
+ case 1:
3299
+ displayRows_1 = _a.sent();
3300
+ // INFO: a read that landed meanwhile already used the new columns
3301
+ if (!displayRows_1 || formulaFullReadRef.current !== cached)
3302
+ return [2 /*return*/];
3303
+ cached.displayRows = displayRows_1;
3304
+ handleShowFormulaPage(pageIndex);
3305
+ return [2 /*return*/];
3306
+ case 2:
3307
+ rows = tableDataRef.current;
3308
+ if (rows.length === 0)
3309
+ return [2 /*return*/];
3310
+ return [4 /*yield*/, handleRebuildDisplayRows(rows, spaceTableDataRef.current)];
3311
+ case 3:
3312
+ displayRows = _a.sent();
3313
+ if (!displayRows || tableDataRef.current !== rows)
3314
+ return [2 /*return*/];
3315
+ handleSetListData(rows, displayRows);
3316
+ return [2 /*return*/];
3317
+ }
3318
+ });
3319
+ }); };
3099
3320
  // INFO: the read request of the previous render. A formula sort or filter
3100
3321
  // is not part of the request, so on a view that already reads every row
3101
3322
  // (calendar, map, timeline, legacy grouped) turning one on changes nothing
@@ -3230,6 +3451,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3230
3451
  };
3231
3452
  var handleSetListData = function (newTableData, newSpaceTableData) {
3232
3453
  var _a, _b, _c, _d, _e;
3454
+ displaySignatureRef.current = columnSignature;
3233
3455
  tableDataRef.current = newTableData;
3234
3456
  spaceTableDataRef.current = newSpaceTableData;
3235
3457
  setTableData(newTableData);
@@ -5361,7 +5583,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5361
5583
  // update an inline cell edit makes, gated on the same update right
5362
5584
  var columnTypeActions = {
5363
5585
  canUpdate: canUpdateRecord,
5364
- onButtonClick: (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.onButtonClick,
5586
+ onButtonClick: (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.onButtonClick,
5365
5587
  onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
5366
5588
  var _a;
5367
5589
  return __generator(this, function (_b) {
@@ -5378,7 +5600,34 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5378
5600
  }
5379
5601
  });
5380
5602
  }); },
5603
+ onTimeTrackingAction: ((_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.onTimeTrackingAction) && canUpdateRecord
5604
+ ? function (rowId, columnId, action) {
5605
+ return handleTimeTrackingAction(rowId, columnId, action);
5606
+ }
5607
+ : undefined,
5381
5608
  };
5609
+ // INFO: the host sends the action and answers with the stored value, which
5610
+ // replaces the row's copy so every view of the list shows it
5611
+ var handleTimeTrackingAction = function (rowId, columnId, action) { return __awaiter(void 0, void 0, void 0, function () {
5612
+ var currentRow, stored;
5613
+ var _a, _b;
5614
+ var _c, _d;
5615
+ return __generator(this, function (_e) {
5616
+ switch (_e.label) {
5617
+ case 0:
5618
+ currentRow = tableDataRef.current.find(function (eachData) { return eachData.id === rowId || eachData._id === rowId; });
5619
+ return [4 /*yield*/, ((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onTimeTrackingAction) === null || _d === void 0 ? void 0 : _d.call(_c, columnId, currentRow !== null && currentRow !== void 0 ? currentRow : (_a = {}, _a[serverId] = rowId, _a), action))];
5620
+ case 1:
5621
+ stored = _e.sent();
5622
+ if (!currentRow) return [3 /*break*/, 3];
5623
+ return [4 /*yield*/, handleGetListData({ data: [__assign(__assign({}, currentRow), (_b = {}, _b[columnId] = stored, _b))] }, "update", rowId)];
5624
+ case 2:
5625
+ _e.sent();
5626
+ _e.label = 3;
5627
+ case 3: return [2 /*return*/, stored];
5628
+ }
5629
+ });
5630
+ }); };
5382
5631
  var handleSubmitData = function (type, rowId, columnId, data, offlineId, isOfflineUpdate, isDraft) { return __awaiter(void 0, void 0, void 0, function () {
5383
5632
  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;
5384
5633
  var _b, _c, _d, _e;
@@ -7424,7 +7673,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7424
7673
  var _a, _b, _c;
7425
7674
  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
7426
7675
  ? getViewSettingsColumns()
7427
- .filter(function (eachColumn) { return eachColumn.type !== "button"; })
7676
+ .filter(function (eachColumn) {
7677
+ return !utils_1.NON_SORT_COLUMN_DATA_TYPES.includes(eachColumn.type);
7678
+ })
7428
7679
  .map(function (eachColumn) {
7429
7680
  var _a;
7430
7681
  return ({
@@ -7506,7 +7757,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7506
7757
  react_1.default.createElement("div", { className: "grow min-w-0" },
7507
7758
  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
7508
7759
  .filter(function (eachColumn) {
7509
- return isFormulaViewSupported || eachColumn.type !== "formula";
7760
+ return (isFormulaViewSupported ||
7761
+ eachColumn.type !== "formula") &&
7762
+ !utils_1.NON_SORT_COLUMN_DATA_TYPES.includes(eachColumn.type);
7510
7763
  })
7511
7764
  .map(function (eachColumn) {
7512
7765
  var _a;
@@ -7544,12 +7797,31 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7544
7797
  ? "border-primary-500 text-primary-600"
7545
7798
  : "".concat(dividerColor, " ").concat(labelColor)), onClick: function () { return handleChangePageLimit(eachOption); } }, eachOption)); })))));
7546
7799
  };
7547
- var renderTableHeader = function () {
7800
+ // INFO: the new table's rows carry only the host's own row actions in the
7801
+ // actions column — see renderTableHeader. The display rows are what its
7802
+ // cells show; the plain rows are mapped too for a list without them.
7803
+ var handleKeepCustomRowActions = function (rows) {
7548
7804
  var _a;
7805
+ return ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)
7806
+ ? (rows !== null && rows !== void 0 ? rows : []).map(function (eachRow) {
7807
+ return eachRow && typeof eachRow === "object" && "update" in eachRow
7808
+ ? __assign(__assign({}, eachRow), { update: eachRow[listModule_1.ROW_CUSTOM_ACTIONS] }) : eachRow;
7809
+ })
7810
+ : rows;
7811
+ };
7812
+ /* eslint-disable */
7813
+ var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_91 = props.bareSettings) === null || _91 === void 0 ? void 0 : _91.bareNewDTW]);
7814
+ var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_92 = props.bareSettings) === null || _92 === void 0 ? void 0 : _92.bareNewDTW]);
7815
+ /* eslint-enable */
7816
+ // INFO: isNewTable — the new table opens a record from its title, edits in
7817
+ // the cell and carries the comment bubble beside the title, so its rows
7818
+ // drop the pencil and bubble column and keep only the host's own actions
7819
+ var renderTableHeader = function (isNewTable) {
7820
+ var _a, _b;
7549
7821
  var tableHeader = [];
7550
7822
  var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
7551
7823
  structure.map(function (eachAttribute) {
7552
- var _a;
7824
+ var _a, _b;
7553
7825
  if (eachAttribute.id === "baseDraft" ||
7554
7826
  utils_1.NON_TABLE_COLUMN_DATA_TYPES.includes(eachAttribute.type) ||
7555
7827
  eachAttribute.hide ||
@@ -7561,11 +7833,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7561
7833
  eachAttribute.id === "baseUpdatedAt") {
7562
7834
  return null;
7563
7835
  }
7564
- tableHeader.push(__assign(__assign({}, eachAttribute), { key: eachAttribute.id, title: eachAttribute.name, width: eachAttribute.tableColWidth }));
7836
+ tableHeader.push(__assign(__assign({}, eachAttribute), { key: eachAttribute.id, title: eachAttribute.name, width: (_b = columnWidths[eachAttribute.id]) !== null && _b !== void 0 ? _b : eachAttribute.tableColWidth }));
7565
7837
  return null;
7566
7838
  });
7567
- if (canUpdateRecord ||
7568
- ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListMultipleSelectAddtionalActions))
7839
+ if (isNewTable) {
7840
+ if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListActionBtns)
7841
+ tableHeader.push({ key: "update", title: "Actions" });
7842
+ }
7843
+ else if (canUpdateRecord ||
7844
+ ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListMultipleSelectAddtionalActions))
7569
7845
  tableHeader.push({
7570
7846
  key: "update",
7571
7847
  title: "Update",
@@ -9316,25 +9592,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9316
9592
  // from a formula over existing fields; a plain field is just a name and a
9317
9593
  // type. They need different forms, so the app says which it wants and both
9318
9594
  // report back through the one onAddColumns callback.
9595
+ // INFO: the structure on screen carries the system columns this table
9596
+ // appended itself; the host only ever gets back the columns it declared
9597
+ var handleReportColumns = function (columns) {
9598
+ var _a, _b, _c;
9599
+ (_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; })));
9600
+ };
9319
9601
  var handleAddPlainColumn = function (column) {
9320
- var _a, _b;
9321
9602
  var newColumn = __assign({}, column);
9322
9603
  // INFO: the fields a new column needs beyond a name and a type are all
9323
9604
  // things this table already knows — the collection it sits on and the
9324
9605
  // workspace's upload endpoint — so they are filled in rather than asked for.
9325
- if (["image", "file", "multipleImage", "multipleFile"].includes(column.type)) {
9606
+ if (["image", "file", "multipleImage", "multipleFile", "signature"].includes(column.type)) {
9326
9607
  newColumn.imageCollectionName = props.collectionId;
9327
9608
  newColumn.imageFileName = "".concat(column.id, ".png");
9328
9609
  if (devSettings.uploadEndpoint)
9329
9610
  newColumn.uploadEndpoint = devSettings.uploadEndpoint;
9330
9611
  }
9331
- (_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));
9612
+ handleReportColumns(__spreadArray(__spreadArray([], structure, true), [newColumn], false));
9332
9613
  };
9333
9614
  // INFO: a changed column replaces itself in place, under the same id, and
9334
9615
  // goes out through onAddColumns like adding and removing do. A column now
9335
9616
  // holding files is filed against this table, as a new one is.
9336
9617
  var handleEditPlainColumn = function (column) {
9337
- var _a, _b, _c, _d;
9618
+ var _a, _b;
9338
9619
  var edited = __assign({}, column);
9339
9620
  if (["image", "file", "multipleImage", "multipleFile"].includes(column.type)) {
9340
9621
  edited.imageCollectionName =
@@ -9343,7 +9624,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9343
9624
  if (devSettings.uploadEndpoint && !edited.uploadEndpoint)
9344
9625
  edited.uploadEndpoint = devSettings.uploadEndpoint;
9345
9626
  }
9346
- (_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) {
9627
+ handleReportColumns(structure.map(function (eachColumn) {
9347
9628
  return eachColumn.id === column.id ? edited : eachColumn;
9348
9629
  }));
9349
9630
  };
@@ -9351,8 +9632,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9351
9632
  // consumer receives the whole model either way, so the schema has one
9352
9633
  // destination rather than a second place to be written.
9353
9634
  var handleDeletePlainColumn = function (columnId) {
9354
- var _a, _b;
9355
- (_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; }));
9635
+ handleReportColumns(structure.filter(function (eachColumn) { return eachColumn.id !== columnId; }));
9356
9636
  };
9357
9637
  /**
9358
9638
  * INFO: only one tab can be the one that opens, so setting one clears the
@@ -9402,7 +9682,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9402
9682
  };
9403
9683
  var renderAddMathColumn = function (id, onClose) {
9404
9684
  var _a, _b, _c;
9405
- 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 }));
9685
+ 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 }));
9406
9686
  };
9407
9687
  // INFO: the grouped column and its sections in option order — a status
9408
9688
  // column's options, Yes / No, or the workspace's members
@@ -9756,7 +10036,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9756
10036
  else {
9757
10037
  // INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
9758
10038
  if ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareNewDTW) {
9759
- return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, groups: handleBuildNewTableGroups(),
10039
+ return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: newTableRows, spaceData: newTableSpaceRows !== null && newTableSpaceRows !== void 0 ? newTableSpaceRows : [], referencesOptions: listReferencesOptions, groups: handleBuildNewTableGroups(),
9760
10040
  // INFO: the bubble beside each record's title opens its comments and
9761
10041
  // logs, for anyone who can see the row — not only those who can edit
9762
10042
  onRowActivity: isActivityLog
@@ -9817,7 +10097,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9817
10097
  return (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
9818
10098
  },
9819
10099
  }); })
9820
- : []), true), multiActionFloatingOffset: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
10100
+ : []), true), multiActionFloatingOffset: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(true), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
9821
10101
  var _a, _b;
9822
10102
  handleCaptureListScroll(id);
9823
10103
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
@@ -9864,6 +10144,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9864
10144
  // INFO: header drag and the panel handle run the same reorder, so the
9865
10145
  // order persists identically whichever one the user grabs
9866
10146
  onDragColumn: handleReorderColumn,
10147
+ onResizeColumn: handleResizeColumn,
9867
10148
  onHideColumn: isViewSettingsEnabled
9868
10149
  ? handleToggleUserHiddenColumn
9869
10150
  : undefined,
@@ -10010,31 +10291,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10010
10291
  };
10011
10292
  // INFO: `hidden` keeps the markers out of space-y spacing
10012
10293
  var renderSavedViews = function () {
10013
- var _a, _b, _c, _d, _e, _f;
10294
+ var _a, _b, _c, _d, _e, _f, _g, _h;
10014
10295
  if (!isSavedViewsEnabled)
10015
10296
  return null;
10016
10297
  var views = handleGetTabSavedViews();
10017
10298
  var activeView = views.find(function (eachView) { return eachView.id === activeSavedViewId; });
10018
10299
  var currentState = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
10019
- // INFO: compared in a shape both sides share — a stored order is kept to
10020
- // the columns that still exist, with new ones after in model order, and
10021
- // hides only count where a view can apply them (schema-hide mode)
10022
- var modelIds = ((_a = props.model) !== null && _a !== void 0 ? _a : []).map(function (eachColumn) { return eachColumn.id; });
10023
- var handleComparable = function (state) {
10024
- var _a;
10025
- var kept = ((_a = state.columnOrder) !== null && _a !== void 0 ? _a : []).filter(function (eachId) {
10026
- return modelIds.includes(eachId);
10027
- });
10028
- return __assign(__assign({}, state), { columnOrder: __spreadArray(__spreadArray([], kept, true), modelIds.filter(function (eachId) { return !kept.includes(eachId); }), true), hiddenColumnIds: isSchemaHideMode ? state.hiddenColumnIds : undefined });
10029
- };
10030
- var handleIsOnState = function (state) {
10031
- return (0, viewStatePersistence_1.handleIsSameViewState)(handleComparable(currentState), handleComparable((0, viewStatePersistence_1.handlePickViewState)(handleResolveViewState(state))));
10032
- };
10033
- var isModified = !!activeView && !handleIsOnState(activeView.state);
10034
- var defaultViewId = (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.defaultSavedViewId) !== null && _c !== void 0 ? _c : null;
10035
- var canStarViews = !!((_d = props.organise) === null || _d === void 0 ? void 0 : _d.onChangeDefaultSavedViewId);
10036
- var canSaveViews = !isAppViews || !!((_e = props.organise) === null || _e === void 0 ? void 0 : _e.onChangeSharedViews);
10037
- var darkMode = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.darkMode;
10300
+ var isModified = !!activeView && !handleIsOnViewState(currentState, activeView.state);
10301
+ // INFO: All differs from its stored settings only where the app keeps them
10302
+ var isAllModified = !activeView &&
10303
+ isViewDraftsEnabled &&
10304
+ !handleIsOnViewState(currentState, (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) !== null && _b !== void 0 ? _b : null);
10305
+ var defaultViewId = (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.defaultSavedViewId) !== null && _d !== void 0 ? _d : null;
10306
+ var canStarViews = !!((_e = props.organise) === null || _e === void 0 ? void 0 : _e.onChangeDefaultSavedViewId);
10307
+ var canSaveViews = !isAppViews || !!((_f = props.organise) === null || _f === void 0 ? void 0 : _f.onChangeSharedViews);
10308
+ var darkMode = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.darkMode;
10038
10309
  var renderChipClass = function (active) {
10039
10310
  return "inline-flex items-center gap-1 rounded-full border px-3 py-1 text-xs font-medium ".concat(active
10040
10311
  ? "border-primary-500 bg-primary-50 text-primary-700"
@@ -10074,6 +10345,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10074
10345
  "Update \u201C",
10075
10346
  activeView.name,
10076
10347
  "\u201D")),
10348
+ isAllModified && ((_h = props.organise) === null || _h === void 0 ? void 0 : _h.onChangeAllView) && (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-update-all", className: actionClass, onClick: handleUpdateAllView }, "Update All")),
10349
+ ((activeView && isModified && isViewDraftsEnabled) ||
10350
+ isAllModified) && (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-reset", className: "text-xs font-medium ".concat(darkMode ? "text-gray-300" : "text-gray-500", " hover:underline"), onClick: handleResetView }, "Reset")),
10077
10351
  !canSaveViews ? null : savedViewName === null ? (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-new", className: actionClass, onClick: function () { return setSavedViewName(""); } }, "+ Save view")) : (
10078
10352
  // INFO: a form, so a mobile keyboard's Done saves the view; stopPropagation
10079
10353
  // keeps the submit from reaching any form around the template
@@ -11492,14 +11766,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11492
11766
  };
11493
11767
  return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
11494
11768
  renderNotification("root"),
11495
- ((_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 () {
11769
+ ((_94 = (_93 = props.renderSettings) === null || _93 === void 0 ? void 0 : _93.renderLoadingUI) === null || _94 === void 0 ? void 0 : _94.call(_93)) && loading ? ((_95 = props.renderSettings) === null || _95 === void 0 ? void 0 : _95.renderLoadingUI()) : (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, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
11496
11770
  var _a, _b;
11497
11771
  if (loading)
11498
11772
  return;
11499
11773
  handlePopUpModal(false);
11500
11774
  setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
11501
11775
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
11502
- 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 () {
11776
+ 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, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
11503
11777
  return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
11504
11778
  if (dataId) {
11505
11779
  var currentValue = selectedData[referenceCreationModal.id];
@@ -11515,19 +11789,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11515
11789
  }, onClose: function () {
11516
11790
  setReferenceCreationModal({ id: "", name: "", type: "string" });
11517
11791
  } }),
11518
- 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 () {
11792
+ 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, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
11519
11793
  setReferenceDeleteTableData({});
11520
11794
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11521
- 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 () {
11795
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.darkMode, darkModeBg: (_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
11522
11796
  setDeletePasscodeInput("");
11523
11797
  setDeleteModal(!deleteModal);
11524
11798
  setDeleteFeedId("");
11525
11799
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11526
- 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 () {
11800
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.darkMode, darkModeBg: (_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
11527
11801
  setBatchUpdateData({ columnId: "", columnData: {} });
11528
11802
  setBatchUpdateModal(false);
11529
11803
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11530
- 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 () {
11804
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_106 = props.organise) === null || _106 === void 0 ? void 0 : _106.darkMode, darkModeBg: (_107 = props.organise) === null || _107 === void 0 ? void 0 : _107.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
11531
11805
  var _a, _b;
11532
11806
  if (props.space)
11533
11807
  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 }));
@@ -11542,13 +11816,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11542
11816
  (0, react_dom_1.createPortal)(
11543
11817
  // INFO: z-50 lifts it over a Modal the table may sit in (z-40)
11544
11818
  react_1.default.createElement("div", { className: "relative z-50" },
11545
- 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,
11819
+ react_1.default.createElement(drawer_1.Drawer, { darkMode: (_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.darkMode, darkModeBg: (_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
11546
11820
  // INFO: the record stays set while the drawer slides out — clearing it
11547
11821
  // would remount the hidden panel collection-wide and fetch again. The
11548
11822
  // toolbar's collection-wide button clears it when it opens.
11549
11823
  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"
11550
11824
  ? props.title
11551
- : "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),
11825
+ : "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((_110 = props.id) !== null && _110 !== void 0 ? _110 : "") : activityId, activityLog: (_111 = props.edit) === null || _111 === void 0 ? void 0 : _111.activityLog, model: structure }) })), document.body),
11552
11826
  renderScrollSentinel()));
11553
11827
  });
11554
11828
  //# sourceMappingURL=index.js.map