blixify-ui-web 1.2.226 → 1.2.229

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 (65) hide show
  1. package/lib/components/chat/chatBase/index.d.ts +7 -0
  2. package/lib/components/chat/chatBase/index.d.ts.map +1 -1
  3. package/lib/components/chat/chatBase/index.js +44 -7
  4. package/lib/components/chat/chatBase/index.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.map +1 -1
  9. package/lib/components/data/columnTypes/dateRangeCell.js +8 -2
  10. package/lib/components/data/columnTypes/dateRangeCell.js.map +1 -1
  11. package/lib/components/data/columnTypes/dateWarning.d.ts +6 -0
  12. package/lib/components/data/columnTypes/dateWarning.d.ts.map +1 -0
  13. package/lib/components/data/columnTypes/dateWarning.js +46 -0
  14. package/lib/components/data/columnTypes/dateWarning.js.map +1 -0
  15. package/lib/components/data/columnTypes/defaultColours.d.ts +22 -0
  16. package/lib/components/data/columnTypes/defaultColours.d.ts.map +1 -0
  17. package/lib/components/data/columnTypes/defaultColours.js +101 -0
  18. package/lib/components/data/columnTypes/defaultColours.js.map +1 -0
  19. package/lib/components/data/columnTypes/groupSections.d.ts +13 -0
  20. package/lib/components/data/columnTypes/groupSections.d.ts.map +1 -1
  21. package/lib/components/data/columnTypes/groupSections.js +19 -1
  22. package/lib/components/data/columnTypes/groupSections.js.map +1 -1
  23. package/lib/components/data/dataGraph/index.d.ts.map +1 -1
  24. package/lib/components/data/dataGraph/index.js +4 -5
  25. package/lib/components/data/dataGraph/index.js.map +1 -1
  26. package/lib/components/data/dataTemplate/activityComposer.d.ts.map +1 -1
  27. package/lib/components/data/dataTemplate/activityComposer.js +17 -2
  28. package/lib/components/data/dataTemplate/activityComposer.js.map +1 -1
  29. package/lib/components/data/dataTemplate/chartBuilder.d.ts +1 -0
  30. package/lib/components/data/dataTemplate/chartBuilder.d.ts.map +1 -1
  31. package/lib/components/data/dataTemplate/chartBuilder.js +19 -15
  32. package/lib/components/data/dataTemplate/chartBuilder.js.map +1 -1
  33. package/lib/components/data/dataTemplate/chartView.d.ts.map +1 -1
  34. package/lib/components/data/dataTemplate/chartView.js +11 -9
  35. package/lib/components/data/dataTemplate/chartView.js.map +1 -1
  36. package/lib/components/data/dataTemplate/dataStateModel.d.ts +4 -0
  37. package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
  38. package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
  39. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  40. package/lib/components/data/dataTemplate/index.js +450 -242
  41. package/lib/components/data/dataTemplate/index.js.map +1 -1
  42. package/lib/components/data/dataTemplate/model.d.ts +1 -0
  43. package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
  44. package/lib/components/data/listModule.d.ts +1 -1
  45. package/lib/components/data/listModule.d.ts.map +1 -1
  46. package/lib/components/data/listModule.js +15 -2
  47. package/lib/components/data/listModule.js.map +1 -1
  48. package/lib/components/display/groupSection/index.d.ts +6 -0
  49. package/lib/components/display/groupSection/index.d.ts.map +1 -1
  50. package/lib/components/display/groupSection/index.js +5 -2
  51. package/lib/components/display/groupSection/index.js.map +1 -1
  52. package/lib/components/display/newTable/index.d.ts +13 -0
  53. package/lib/components/display/newTable/index.d.ts.map +1 -1
  54. package/lib/components/display/newTable/index.js +294 -121
  55. package/lib/components/display/newTable/index.js.map +1 -1
  56. package/lib/components/display/recordActions/index.d.ts +1 -0
  57. package/lib/components/display/recordActions/index.d.ts.map +1 -1
  58. package/lib/components/display/recordActions/index.js +6 -3
  59. package/lib/components/display/recordActions/index.js.map +1 -1
  60. package/lib/components/input/fileTransfer.d.ts +49 -0
  61. package/lib/components/input/fileTransfer.d.ts.map +1 -0
  62. package/lib/components/input/fileTransfer.js +122 -0
  63. package/lib/components/input/fileTransfer.js.map +1 -0
  64. package/lib/tail.css +1 -1
  65. package/package.json +1 -1
@@ -161,6 +161,8 @@ var authModal_1 = require("./authModal");
161
161
  var indexedDb_1 = require("./indexedDb");
162
162
  var context_1 = require("../columnTypes/context");
163
163
  var groupSections_1 = require("../columnTypes/groupSections");
164
+ var chartResults_1 = require("../dataGraph/chartResults");
165
+ var defaultColours_1 = require("../columnTypes/defaultColours");
164
166
  var systemColumns_1 = require("../columnTypes/systemColumns");
165
167
  var dateRange_1 = require("../columnTypes/dateRange");
166
168
  var socket_1 = require("./socket");
@@ -249,10 +251,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
249
251
  // Every read of the view type below uses resolvedType. The distinction matters
250
252
  // most in effect dependency arrays — following props.type there would leave
251
253
  // the list never refetching while the panel is open, which fails silently.
252
- 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, _112, _113, _114, _115, _116, _117;
254
+ 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, _112, _113, _114, _115, _116, _117, _118;
253
255
  // INFO: the panel cannot navigate its way out — handleNavigate("read") is
254
256
  // routed straight back into it — so expand-to-full-page is local state.
255
- var _118 = (0, react_1.useState)(false), drawerPageView = _118[0], setDrawerPageView = _118[1];
257
+ var _119 = (0, react_1.useState)(false), drawerPageView = _119[0], setDrawerPageView = _119[1];
256
258
  // INFO: the panel keeps rendering the record it was opened with rather than
257
259
  // live props. Without this, navigating back to the list would re-render the
258
260
  // still-mounted panel as a second list behind the overlay.
@@ -308,7 +310,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
308
310
  drawerFormEditedRef.current = false;
309
311
  }
310
312
  drawerOpenRef.current = isDrawerHost;
311
- var _119 = (0, react_1.useState)(false), drawerDiscardModal = _119[0], setDrawerDiscardModal = _119[1];
313
+ var _120 = (0, react_1.useState)(false), drawerDiscardModal = _120[0], setDrawerDiscardModal = _120[1];
312
314
  // INFO: leaving the record ends the escape, so the next row opened from the
313
315
  // list peeks in the panel again rather than inheriting a full page the user
314
316
  // asked for once. Saving a form on the full page lands on its read view, which
@@ -387,14 +389,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
387
389
  initialFilterReferenceDate: initialFilterReferenceDate,
388
390
  };
389
391
  };
390
- var _120 = intialiseDefaultFilterValues(), initialFilterSearch = _120.initialFilterSearch, initialFilterSearchParams = _120.initialFilterSearchParams, initialFilterSelection = _120.initialFilterSelection, initialFilterReference = _120.initialFilterReference, initialFilterReferenceDate = _120.initialFilterReferenceDate;
392
+ var _121 = intialiseDefaultFilterValues(), initialFilterSearch = _121.initialFilterSearch, initialFilterSearchParams = _121.initialFilterSearchParams, initialFilterSelection = _121.initialFilterSelection, initialFilterReference = _121.initialFilterReference, initialFilterReferenceDate = _121.initialFilterReferenceDate;
391
393
  // INFO: Persist view state hook — handles storage read/write for filter/sort/column state
392
- var _121 = (0, viewStatePersistence_1.usePersistedViewState)({
394
+ var _122 = (0, viewStatePersistence_1.usePersistedViewState)({
393
395
  mode: (_g = props.organise) === null || _g === void 0 ? void 0 : _g.persistViewState,
394
396
  collectionId: props.collectionId,
395
397
  persistKey: (_h = props.organise) === null || _h === void 0 ? void 0 : _h.persistKey,
396
398
  type: resolvedType,
397
- }), rawPersistedState = _121.persistedState, isPersistEnabled = _121.isEnabled, handleSaveView = _121.handleSaveView, handleRegisterViewSnapshot = _121.handleRegisterViewSnapshot;
399
+ }), rawPersistedState = _122.persistedState, isPersistEnabled = _122.isEnabled, handleSaveView = _122.handleSaveView, handleRegisterViewSnapshot = _122.handleRegisterViewSnapshot;
398
400
  // INFO: drop stored filters/sort on removed columns — they would empty the table
399
401
  var persistedState = (0, react_1.useMemo)(function () {
400
402
  var _a, _b, _c, _d;
@@ -410,8 +412,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
410
412
  (_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareFlexFilterListObjects,
411
413
  (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareFlexFilterRelated,
412
414
  ]);
413
- var _122 = (0, react_1.useState)(false), loading = _122[0], setLoading = _122[1];
414
- var _123 = (0, react_1.useState)(), notification = _123[0], setNotification = _123[1];
415
+ var _123 = (0, react_1.useState)(false), loading = _123[0], setLoading = _123[1];
416
+ var _124 = (0, react_1.useState)(), notification = _124[0], setNotification = _124[1];
415
417
  // INFO: a success toast is confirmation, not a decision — it clears itself so
416
418
  // it never sits on the floating step bar; errors stay until dismissed
417
419
  (0, react_1.useEffect)(function () {
@@ -421,67 +423,67 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
421
423
  return function () { return clearTimeout(timer); };
422
424
  }, [notification]);
423
425
  //INFO : Used by List
424
- var _124 = (0, react_1.useState)((_m = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _m !== void 0 ? _m : initialFilterSearch), filterSearch = _124[0], setFilterSearch = _124[1];
425
- var _125 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _o !== void 0 ? _o : initialFilterSearchParams), filterSearchParams = _125[0], setFilterSearchParams = _125[1];
426
- var _126 = (0, react_1.useState)((_p = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _p !== void 0 ? _p : initialFilterSelection), filterSelection = _126[0], setFilterSelection = _126[1];
427
- var _127 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _q !== void 0 ? _q : initialFilterReference), filterReference = _127[0], setFilterReference = _127[1];
428
- var _128 = (0, react_1.useState)({}), filterReferenceSearch = _128[0], setFilterReferenceSearch = _128[1];
429
- var _129 = (0, react_1.useState)({}), filterReferenceList = _129[0], setFilterReferenceList = _129[1];
430
- var _130 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
426
+ var _125 = (0, react_1.useState)((_m = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _m !== void 0 ? _m : initialFilterSearch), filterSearch = _125[0], setFilterSearch = _125[1];
427
+ var _126 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _o !== void 0 ? _o : initialFilterSearchParams), filterSearchParams = _126[0], setFilterSearchParams = _126[1];
428
+ var _127 = (0, react_1.useState)((_p = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _p !== void 0 ? _p : initialFilterSelection), filterSelection = _127[0], setFilterSelection = _127[1];
429
+ var _128 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _q !== void 0 ? _q : initialFilterReference), filterReference = _128[0], setFilterReference = _128[1];
430
+ var _129 = (0, react_1.useState)({}), filterReferenceSearch = _129[0], setFilterReferenceSearch = _129[1];
431
+ var _130 = (0, react_1.useState)({}), filterReferenceList = _130[0], setFilterReferenceList = _130[1];
432
+ var _131 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
431
433
  ? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
432
- : initialFilterReferenceDate), filterReferenceDate = _130[0], setFilterReferenceDate = _130[1];
433
- var _131 = (0, react_1.useState)(true), tableLoading = _131[0], setTableLoading = _131[1];
434
- var _132 = (0, react_1.useState)(""), cursor = _132[0], setCursor = _132[1];
435
- var _133 = (0, react_1.useState)(""), lastCursor = _133[0], setLastCursor = _133[1];
436
- var _134 = (0, react_1.useState)([]), tableData = _134[0], setTableData = _134[1];
437
- var _135 = (0, react_1.useState)([]), spaceTableData = _135[0], setSpaceTableData = _135[1];
434
+ : initialFilterReferenceDate), filterReferenceDate = _131[0], setFilterReferenceDate = _131[1];
435
+ var _132 = (0, react_1.useState)(true), tableLoading = _132[0], setTableLoading = _132[1];
436
+ var _133 = (0, react_1.useState)(""), cursor = _133[0], setCursor = _133[1];
437
+ var _134 = (0, react_1.useState)(""), lastCursor = _134[0], setLastCursor = _134[1];
438
+ var _135 = (0, react_1.useState)([]), tableData = _135[0], setTableData = _135[1];
439
+ var _136 = (0, react_1.useState)([]), spaceTableData = _136[0], setSpaceTableData = _136[1];
438
440
  // INFO: a save resolves after later renders, so it reads the table from here —
439
441
  // the state it closed over can predate an earlier save on the same row
440
442
  var tableDataRef = (0, react_1.useRef)([]);
441
443
  var spaceTableDataRef = (0, react_1.useRef)([]);
442
444
  tableDataRef.current = tableData;
443
445
  spaceTableDataRef.current = spaceTableData;
444
- var _136 = (0, react_1.useState)(0), size = _136[0], setSize = _136[1];
445
- var _137 = (0, react_1.useState)((_t = (_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _r !== void 0 ? _r : (_s = props.organise) === null || _s === void 0 ? void 0 : _s.pageIndex) !== null && _t !== void 0 ? _t : 0), pageIndex = _137[0], setPageIndex = _137[1];
446
+ var _137 = (0, react_1.useState)(0), size = _137[0], setSize = _137[1];
447
+ var _138 = (0, react_1.useState)((_t = (_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _r !== void 0 ? _r : (_s = props.organise) === null || _s === void 0 ? void 0 : _s.pageIndex) !== null && _t !== void 0 ? _t : 0), pageIndex = _138[0], setPageIndex = _138[1];
446
448
  // INFO: every change of page, including the return to the first page when a
447
449
  // filter or search changes, which onChangePagination does not always report
448
450
  (0, react_1.useEffect)(function () {
449
451
  var _a, _b;
450
452
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePageIndex) === null || _b === void 0 ? void 0 : _b.call(_a, pageIndex);
451
453
  }, [pageIndex]);
452
- var _138 = (0, react_1.useState)([]), selectedIds = _138[0], setSelectedIds = _138[1];
453
- var _139 = (0, react_1.useState)(false), selectAll = _139[0], setSelectAll = _139[1];
454
- var _140 = (0, react_1.useState)(""), deletePasscode = _140[0], setDeletePasscode = _140[1];
455
- var _141 = (0, react_1.useState)(""), deletePasscodeInput = _141[0], setDeletePasscodeInput = _141[1];
456
- var _142 = (0, react_1.useState)(""), deleteFeedId = _142[0], setDeleteFeedId = _142[1];
454
+ var _139 = (0, react_1.useState)([]), selectedIds = _139[0], setSelectedIds = _139[1];
455
+ var _140 = (0, react_1.useState)(false), selectAll = _140[0], setSelectAll = _140[1];
456
+ var _141 = (0, react_1.useState)(""), deletePasscode = _141[0], setDeletePasscode = _141[1];
457
+ var _142 = (0, react_1.useState)(""), deletePasscodeInput = _142[0], setDeletePasscodeInput = _142[1];
458
+ var _143 = (0, react_1.useState)(""), deleteFeedId = _143[0], setDeleteFeedId = _143[1];
457
459
  //INFO : Used by List Organise
458
460
  // INFO: Internal sort state that overrides props.organise?.sort when
459
461
  // persistViewState is enabled and a persisted sort exists
460
- var _143 = (0, react_1.useState)((_u = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _u !== void 0 ? _u : undefined), persistedSort = _143[0], setPersistedSort = _143[1];
461
- var _144 = (0, react_1.useState)(false), filterDraft = _144[0], setFilterDraft = _144[1];
462
- var _145 = (0, react_1.useState)(false), addTabModal = _145[0], setAddTabModal = _145[1];
463
- var _146 = (0, react_1.useState)(-1), editTabIndex = _146[0], setEditTabIndex = _146[1];
462
+ var _144 = (0, react_1.useState)((_u = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _u !== void 0 ? _u : undefined), persistedSort = _144[0], setPersistedSort = _144[1];
463
+ var _145 = (0, react_1.useState)(false), filterDraft = _145[0], setFilterDraft = _145[1];
464
+ var _146 = (0, react_1.useState)(false), addTabModal = _146[0], setAddTabModal = _146[1];
465
+ var _147 = (0, react_1.useState)(-1), editTabIndex = _147[0], setEditTabIndex = _147[1];
464
466
  //INFO : resolve the initial tab synchronously so the mount cond is already
465
467
  // tab-scoped — an empty initial tab caused a second wasted list fetch
466
- var _147 = (0, react_1.useState)(function () {
468
+ var _148 = (0, react_1.useState)(function () {
467
469
  var _a;
468
470
  return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, listViewId);
469
- }), selectedTab = _147[0], setSelectedTab = _147[1];
470
- var _148 = (0, react_1.useState)("dayGridMonth"), calendarView = _148[0], setCalendarView = _148[1];
471
+ }), selectedTab = _148[0], setSelectedTab = _148[1];
472
+ var _149 = (0, react_1.useState)("dayGridMonth"), calendarView = _149[0], setCalendarView = _149[1];
471
473
  // INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
472
474
  // (calendarView above drives the matching range query)
473
- var _149 = (0, react_1.useState)("month"), newCalendarViewMode = _149[0], setNewCalendarViewMode = _149[1];
474
- var _150 = (0, react_1.useState)(new Date()), calendarTabMonth = _150[0], setCalendarTabMonth = _150[1];
475
+ var _150 = (0, react_1.useState)("month"), newCalendarViewMode = _150[0], setNewCalendarViewMode = _150[1];
476
+ var _151 = (0, react_1.useState)(new Date()), calendarTabMonth = _151[0], setCalendarTabMonth = _151[1];
475
477
  // INFO: defaultViewSwitch picks the opening view only — the tab re-inits
476
478
  // whenever its settings change, and that must not undo the user's switch
477
479
  var calendarViewInitRef = (0, react_1.useRef)(false);
478
- var _151 = (0, react_1.useState)(true), kanbanDroppable = _151[0], setKanbanDroppable = _151[1];
479
- var _152 = (0, react_1.useState)([]), kanbanOptions = _152[0], setKanbanOptions = _152[1];
480
- var _153 = (0, react_1.useState)(false), batchUpdateModal = _153[0], setBatchUpdateModal = _153[1];
481
- var _154 = (0, react_1.useState)({
480
+ var _152 = (0, react_1.useState)(true), kanbanDroppable = _152[0], setKanbanDroppable = _152[1];
481
+ var _153 = (0, react_1.useState)([]), kanbanOptions = _153[0], setKanbanOptions = _153[1];
482
+ var _154 = (0, react_1.useState)(false), batchUpdateModal = _154[0], setBatchUpdateModal = _154[1];
483
+ var _155 = (0, react_1.useState)({
482
484
  columnId: "",
483
485
  columnData: {},
484
- }), batchUpdateData = _154[0], setBatchUpdateData = _154[1];
486
+ }), batchUpdateData = _155[0], setBatchUpdateData = _155[1];
485
487
  // INFO: system columns (created / updated at and by, record id, number)
486
488
  // join the structure hidden; the ones a user shows are kept per view
487
489
  var isSystemColumnsEnabled = !!((_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareSystemColumns);
@@ -489,12 +491,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
489
491
  var appendedSystemColumnIds = isSystemColumnsEnabled
490
492
  ? 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; }); })
491
493
  : [];
492
- var _155 = (0, react_1.useState)((_x = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _x !== void 0 ? _x : []), shownSystemColumnIds = _155[0], setShownSystemColumnIds = _155[1];
494
+ var _156 = (0, react_1.useState)((_x = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _x !== void 0 ? _x : []), shownSystemColumnIds = _156[0], setShownSystemColumnIds = _156[1];
493
495
  var handleWithSystemColumns = function (model, shownIds) {
494
496
  if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
495
497
  return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
496
498
  };
497
- var _156 = (0, react_1.useState)(function () {
499
+ var _157 = (0, react_1.useState)(function () {
498
500
  var _a;
499
501
  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 : []);
500
502
  if (!persistedState)
@@ -521,8 +523,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
521
523
  });
522
524
  }
523
525
  return model;
524
- }), structure = _156[0], setStructure = _156[1];
525
- var _157 = (0, react_1.useState)(((_y = props === null || props === void 0 ? void 0 : props.organise) === null || _y === void 0 ? void 0 : _y.additionalQuery) || []), additionalQuery = _157[0], setAdditionalQuery = _157[1];
526
+ }), structure = _157[0], setStructure = _157[1];
527
+ var _158 = (0, react_1.useState)(((_y = props === null || props === void 0 ? void 0 : props.organise) === null || _y === void 0 ? void 0 : _y.additionalQuery) || []), additionalQuery = _158[0], setAdditionalQuery = _158[1];
526
528
  // INFO: State for user-configurable flex filters (Monday.com-style)
527
529
  // INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
528
530
  var defaultFlexFilterRow = [
@@ -533,9 +535,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
533
535
  value: undefined,
534
536
  },
535
537
  ];
536
- var _158 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
538
+ var _159 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
537
539
  ? persistedState.flexFilters
538
- : defaultFlexFilterRow), flexFilters = _158[0], setFlexFilters = _158[1];
540
+ : defaultFlexFilterRow), flexFilters = _159[0], setFlexFilters = _159[1];
539
541
  // INFO: always-current mirror of flexFilters, read by the imperative apply/
540
542
  // clear methods so chained calls in one tick aren't stale.
541
543
  var flexFiltersRef = (0, react_1.useRef)(flexFilters);
@@ -548,81 +550,85 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
548
550
  }, [flexFilters]);
549
551
  // INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
550
552
  // to prevent API calls on every keystroke when typing in value inputs
551
- var _159 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
553
+ var _160 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
552
554
  ? persistedState.flexFilters
553
- : defaultFlexFilterRow), flexFiltersDebounced = _159[0], setFlexFiltersDebounced = _159[1];
555
+ : defaultFlexFilterRow), flexFiltersDebounced = _160[0], setFlexFiltersDebounced = _160[1];
554
556
  // INFO: the filter rows of the export being set up — started from the
555
557
  // list's own when the export opens, so changing them leaves the list as it is
556
- var _160 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _160[0], setExportFlexFilters = _160[1];
557
- var _161 = (0, react_1.useState)({}), flexFilterReferenceOptions = _161[0], setFlexFilterReferenceOptions = _161[1];
558
- var _162 = (0, react_1.useState)({}), flexFilterReferenceSearch = _162[0], setFlexFilterReferenceSearch = _162[1];
559
- var _163 = (0, react_1.useState)(false), flexFilterModalOpen = _163[0], setFlexFilterModalOpen = _163[1];
560
- var _164 = (0, react_1.useState)(false), viewSettingsModalOpen = _164[0], setViewSettingsModalOpen = _164[1];
558
+ var _161 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _161[0], setExportFlexFilters = _161[1];
559
+ var _162 = (0, react_1.useState)({}), flexFilterReferenceOptions = _162[0], setFlexFilterReferenceOptions = _162[1];
560
+ var _163 = (0, react_1.useState)({}), flexFilterReferenceSearch = _163[0], setFlexFilterReferenceSearch = _163[1];
561
+ var _164 = (0, react_1.useState)(false), flexFilterModalOpen = _164[0], setFlexFilterModalOpen = _164[1];
562
+ var _165 = (0, react_1.useState)(false), viewSettingsModalOpen = _165[0], setViewSettingsModalOpen = _165[1];
561
563
  // INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
562
564
  // Deliberately kept out of `structure`: the props-sync effect below resets
563
565
  // structure to props.model whenever props change, which would wipe the
564
566
  // choice, and the persist effect derives schema-level hiddenColumnIds from
565
567
  // structure — writing user hides there would blur the two concepts.
566
- var _165 = (0, react_1.useState)((_z = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _z !== void 0 ? _z : []), userHiddenColumnIds = _165[0], setUserHiddenColumnIds = _165[1];
567
- var _166 = (0, react_1.useState)(""), columnSearch = _166[0], setColumnSearch = _166[1];
568
- var _167 = (0, react_1.useState)([]), savedViews = _167[0], setSavedViews = _167[1];
569
- var _168 = (0, react_1.useState)(null), activeSavedViewId = _168[0], setActiveSavedViewId = _168[1];
568
+ var _166 = (0, react_1.useState)((_z = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _z !== void 0 ? _z : []), userHiddenColumnIds = _166[0], setUserHiddenColumnIds = _166[1];
569
+ var _167 = (0, react_1.useState)(""), columnSearch = _167[0], setColumnSearch = _167[1];
570
+ var _168 = (0, react_1.useState)([]), savedViews = _168[0], setSavedViews = _168[1];
571
+ var _169 = (0, react_1.useState)(null), activeSavedViewId = _169[0], setActiveSavedViewId = _169[1];
570
572
  // INFO: the widths of the view on screen, by column id ("180px")
571
- var _169 = (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 = _169[0], setColumnWidths = _169[1];
573
+ var _170 = (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 = _170[0], setColumnWidths = _170[1];
572
574
  // INFO: unsaved changes are kept only once the opening view is on screen,
573
575
  // so the defaults drawn before it never overwrite a person's own
574
- var _170 = (0, react_1.useState)(false), isViewDraftReady = _170[0], setIsViewDraftReady = _170[1];
576
+ var _171 = (0, react_1.useState)(false), isViewDraftReady = _171[0], setIsViewDraftReady = _171[1];
575
577
  // INFO: null while the name box is closed
576
- var _171 = (0, react_1.useState)(null), savedViewName = _171[0], setSavedViewName = _171[1];
577
- var _172 = (0, react_1.useState)(null), deletingSavedViewId = _172[0], setDeletingSavedViewId = _172[1];
578
- var _173 = (0, react_1.useState)(null), draggingColumnId = _173[0], setDraggingColumnId = _173[1];
578
+ var _172 = (0, react_1.useState)(null), savedViewName = _172[0], setSavedViewName = _172[1];
579
+ var _173 = (0, react_1.useState)(null), deletingSavedViewId = _173[0], setDeletingSavedViewId = _173[1];
580
+ var _174 = (0, react_1.useState)(null), draggingColumnId = _174[0], setDraggingColumnId = _174[1];
579
581
  var columnRowRefs = (0, react_1.useRef)({});
580
582
  //INFO : Used by Auth
581
- var _174 = (0, react_1.useState)({
583
+ var _175 = (0, react_1.useState)({
582
584
  email: "",
583
585
  google: "",
584
586
  phone: "",
585
587
  disabled: false,
586
588
  create: false,
587
- }), authMethods = _174[0], setAuthMethods = _174[1];
588
- var _175 = (0, react_1.useState)(""), selectedAuthMethod = _175[0], setSelectedAuthMethod = _175[1];
589
+ }), authMethods = _175[0], setAuthMethods = _175[1];
590
+ var _176 = (0, react_1.useState)(""), selectedAuthMethod = _176[0], setSelectedAuthMethod = _176[1];
589
591
  // INFO: the sign-in check of a users datasheet's record is running; the
590
592
  // panel shows a spinner rather than nothing, which read as "no login"
591
- var _176 = (0, react_1.useState)(false), authLoading = _176[0], setAuthLoading = _176[1];
593
+ var _177 = (0, react_1.useState)(false), authLoading = _177[0], setAuthLoading = _177[1];
592
594
  // INFO: a delete is running — the ref answers a second tap at once, before
593
595
  // the state has rendered, and the state disables the confirm button
594
596
  var deletingRef = (0, react_1.useRef)(false);
595
- var _177 = (0, react_1.useState)(false), deleting = _177[0], setDeleting = _177[1];
597
+ var _178 = (0, react_1.useState)(false), deleting = _178[0], setDeleting = _178[1];
596
598
  // INFO: Used by Activity Log
597
- var _178 = (0, react_1.useState)(false), activityModal = _178[0], setActivityModal = _178[1];
598
- var _179 = (0, react_1.useState)(""), activityId = _179[0], setActivityId = _179[1];
599
+ var _179 = (0, react_1.useState)(false), activityModal = _179[0], setActivityModal = _179[1];
600
+ var _180 = (0, react_1.useState)(""), activityId = _180[0], setActivityId = _180[1];
599
601
  //INFO : Used by Export
600
- var _180 = (0, react_1.useState)(null), csvFile = _180[0], setCSVFile = _180[1];
601
- var _181 = (0, react_1.useState)([]), csvFileData = _181[0], setCSVFileData = _181[1];
602
- var _182 = (0, react_1.useState)(0), stepCSVIndex = _182[0], setStepCSVIndex = _182[1];
603
- var _183 = (0, react_1.useState)({}), listCSVMapAttribute = _183[0], setListCSVMapAttribute = _183[1];
604
- var _184 = (0, react_1.useState)({}), listCSVObjAttribute = _184[0], setListCSVObjAttribute = _184[1];
605
- var _185 = (0, react_1.useState)([]), csvAPIAttribute = _185[0], setCSVAPIAttribute = _185[1];
606
- var _186 = (0, react_1.useState)(((_0 = props.devSettings.currentUser) === null || _0 === void 0 ? void 0 : _0.userEmail) || ""), exportCSVEmail = _186[0], setExportCSVEmail = _186[1];
607
- var _187 = (0, react_1.useState)(((_2 = (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.exportSettings) === null || _2 === void 0 ? void 0 : _2.defaultExportPDFName) || ""), exportPDFTitle = _187[0], setExportPDFTitle = _187[1];
608
- var _188 = (0, react_1.useState)(false), exportPDFLoading = _188[0], setExportPDFLoading = _188[1];
609
- var _189 = (0, react_1.useState)(false), exportReadPDFLoading = _189[0], setExportReadPDFLoading = _189[1];
610
- var _190 = (0, react_1.useState)((_5 = (_4 = (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.exportSettings) === null || _4 === void 0 ? void 0 : _4.sumColumnId) !== null && _5 !== void 0 ? _5 : []), exportSumAttributeIds = _190[0], setExportSumAttributeIds = _190[1];
611
- var _191 = (0, react_1.useState)((_8 = (_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.exportSettings) === null || _7 === void 0 ? void 0 : _7.hideSubItems) !== null && _8 !== void 0 ? _8 : false), hideSubItems = _191[0], setHideSubItems = _191[1];
612
- var _192 = (0, react_1.useState)([]), importTableData = _192[0], setImportTableData = _192[1];
613
- var _193 = (0, react_1.useState)([]), queryList = _193[0], setQueryList = _193[1];
614
- var _194 = (0, react_1.useState)(undefined), allQueryList = _194[0], setAllQueryList = _194[1];
602
+ var _181 = (0, react_1.useState)(null), csvFile = _181[0], setCSVFile = _181[1];
603
+ var _182 = (0, react_1.useState)([]), csvFileData = _182[0], setCSVFileData = _182[1];
604
+ var _183 = (0, react_1.useState)(0), stepCSVIndex = _183[0], setStepCSVIndex = _183[1];
605
+ var _184 = (0, react_1.useState)({}), listCSVMapAttribute = _184[0], setListCSVMapAttribute = _184[1];
606
+ var _185 = (0, react_1.useState)({}), listCSVObjAttribute = _185[0], setListCSVObjAttribute = _185[1];
607
+ var _186 = (0, react_1.useState)([]), csvAPIAttribute = _186[0], setCSVAPIAttribute = _186[1];
608
+ var _187 = (0, react_1.useState)(((_0 = props.devSettings.currentUser) === null || _0 === void 0 ? void 0 : _0.userEmail) || ""), exportCSVEmail = _187[0], setExportCSVEmail = _187[1];
609
+ var _188 = (0, react_1.useState)(((_2 = (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.exportSettings) === null || _2 === void 0 ? void 0 : _2.defaultExportPDFName) || ""), exportPDFTitle = _188[0], setExportPDFTitle = _188[1];
610
+ var _189 = (0, react_1.useState)(false), exportPDFLoading = _189[0], setExportPDFLoading = _189[1];
611
+ var _190 = (0, react_1.useState)(false), exportReadPDFLoading = _190[0], setExportReadPDFLoading = _190[1];
612
+ var _191 = (0, react_1.useState)((_5 = (_4 = (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.exportSettings) === null || _4 === void 0 ? void 0 : _4.sumColumnId) !== null && _5 !== void 0 ? _5 : []), exportSumAttributeIds = _191[0], setExportSumAttributeIds = _191[1];
613
+ var _192 = (0, react_1.useState)((_8 = (_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.exportSettings) === null || _7 === void 0 ? void 0 : _7.hideSubItems) !== null && _8 !== void 0 ? _8 : false), hideSubItems = _192[0], setHideSubItems = _192[1];
614
+ var _193 = (0, react_1.useState)([]), importTableData = _193[0], setImportTableData = _193[1];
615
+ var _194 = (0, react_1.useState)([]), queryList = _194[0], setQueryList = _194[1];
616
+ var _195 = (0, react_1.useState)(undefined), allQueryList = _195[0], setAllQueryList = _195[1];
615
617
  // INFO: a restored state wins over the prop; its "" is a list the user
616
618
  // ungrouped, so it opens ungrouped
617
- var _195 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
619
+ var _196 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
618
620
  ? persistedState.groupBy || undefined
619
- : (_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.groupBy), groupId = _195[0], setGroupId = _195[1];
621
+ : (_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.groupBy), groupId = _196[0], setGroupId = _196[1];
622
+ // INFO: each group's total per number column, keyed by section id
623
+ var _197 = (0, react_1.useState)({}), groupSummaries = _197[0], setGroupSummaries = _197[1];
624
+ var groupSummaryRequestRef = (0, react_1.useRef)(0);
625
+ var _198 = (0, react_1.useState)({}), commentCounts = _198[0], setCommentCounts = _198[1];
620
626
  // INFO: Monday-board per-group paging. Keyed by the group key that
621
627
  // handleBuildNewTableGroups() produces (an option, Unknown or No Value).
622
628
  // Each group tracks its own loaded cursor + total so it can lazily load its
623
629
  // next page as the user scrolls inside that band, independent of every other
624
630
  // group. Only used when renderCheckGroupPaging() is true.
625
- var _196 = (0, react_1.useState)({}), groupPageState = _196[0], setGroupPageState = _196[1];
631
+ var _199 = (0, react_1.useState)({}), groupPageState = _199[0], setGroupPageState = _199[1];
626
632
  // INFO: read fresh inside the async per-group fetch so chained scroll fires
627
633
  // in one tick do not re-fetch an already in-flight page.
628
634
  var groupPageStateRef = (0, react_1.useRef)({});
@@ -631,59 +637,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
631
637
  // list was re-read (new search, filter, sort or grouping) is dropped on
632
638
  // arrival instead of appending rows that belong to the old list
633
639
  var groupPagingGenRef = (0, react_1.useRef)(0);
634
- var _197 = (0, react_1.useState)(""), readTabSection = _197[0], setReadTabSection = _197[1];
635
- var _198 = (0, react_1.useState)(false), readFloatingNav = _198[0], setReadFloatingNav = _198[1];
640
+ var _200 = (0, react_1.useState)(""), readTabSection = _200[0], setReadTabSection = _200[1];
641
+ var _201 = (0, react_1.useState)(false), readFloatingNav = _201[0], setReadFloatingNav = _201[1];
636
642
  var readTabSectionRefs = (0, react_1.useRef)({});
637
643
  //INFO : Used by Read
638
644
  //INFO : Used by Update
639
- var _199 = (0, react_1.useState)(false), modalVisible = _199[0], setModalVisible = _199[1];
640
- var _200 = (0, react_1.useState)(false), deleteModal = _200[0], setDeleteModal = _200[1];
641
- var _201 = (0, react_1.useState)(false), excelModal = _201[0], setExcelModal = _201[1];
642
- var _202 = (0, react_1.useState)(false), exportExcel = _202[0], setExportExcel = _202[1];
643
- var _203 = (0, react_1.useState)(""), exportType = _203[0], setExportType = _203[1];
644
- var _204 = (0, react_1.useState)(false), exportQR = _204[0], setExportQR = _204[1];
645
- var _205 = (0, react_1.useState)(function () {
645
+ var _202 = (0, react_1.useState)(false), modalVisible = _202[0], setModalVisible = _202[1];
646
+ var _203 = (0, react_1.useState)(false), deleteModal = _203[0], setDeleteModal = _203[1];
647
+ var _204 = (0, react_1.useState)(false), excelModal = _204[0], setExcelModal = _204[1];
648
+ var _205 = (0, react_1.useState)(false), exportExcel = _205[0], setExportExcel = _205[1];
649
+ var _206 = (0, react_1.useState)(""), exportType = _206[0], setExportType = _206[1];
650
+ var _207 = (0, react_1.useState)(false), exportQR = _207[0], setExportQR = _207[1];
651
+ var _208 = (0, react_1.useState)(function () {
646
652
  var _a, _b;
647
653
  var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
648
654
  return firstTabId;
649
- }), activeTab = _205[0], setActiveTab = _205[1];
650
- var _206 = (0, react_1.useState)(false), signatureSigning = _206[0], setSignatureSigning = _206[1];
651
- var _207 = (0, react_1.useState)({}), selectedData = _207[0], setSelectedData = _207[1];
652
- var _208 = (0, react_1.useState)(""), selectedObjectStructureId = _208[0], setSelectedObjectStructureId = _208[1];
653
- var _209 = (0, react_1.useState)(""), selectedObjectId = _209[0], setSelectedObjectId = _209[1];
654
- var _210 = (0, react_1.useState)(""), selectedListAddressId = _210[0], setSelectedListAddressId = _210[1];
655
- var _211 = (0, react_1.useState)(-1), selectedListAddressIndex = _211[0], setSelectedListAddressIndex = _211[1];
656
- var _212 = (0, react_1.useState)({
655
+ }), activeTab = _208[0], setActiveTab = _208[1];
656
+ var _209 = (0, react_1.useState)(false), signatureSigning = _209[0], setSignatureSigning = _209[1];
657
+ var _210 = (0, react_1.useState)({}), selectedData = _210[0], setSelectedData = _210[1];
658
+ var _211 = (0, react_1.useState)(""), selectedObjectStructureId = _211[0], setSelectedObjectStructureId = _211[1];
659
+ var _212 = (0, react_1.useState)(""), selectedObjectId = _212[0], setSelectedObjectId = _212[1];
660
+ var _213 = (0, react_1.useState)(""), selectedListAddressId = _213[0], setSelectedListAddressId = _213[1];
661
+ var _214 = (0, react_1.useState)(-1), selectedListAddressIndex = _214[0], setSelectedListAddressIndex = _214[1];
662
+ var _215 = (0, react_1.useState)({
657
663
  lat: 0,
658
664
  lng: 0,
659
665
  name: "",
660
- }), selectedListAddress = _212[0], setSelectedListAddress = _212[1];
661
- var _213 = (0, react_1.useState)({}), selectedObjectData = _213[0], setSelectedObjectData = _213[1];
662
- var _214 = (0, react_1.useState)(null), objectCellEdit = _214[0], setObjectCellEdit = _214[1];
663
- var _215 = (0, react_1.useState)(false), referenceLoading = _215[0], setReferenceLoading = _215[1];
664
- var _216 = (0, react_1.useState)({}), referencesOptions = _216[0], setReferencesOptions = _216[1];
665
- var _217 = (0, react_1.useState)({}), referencesDetails = _217[0], setReferencesDetails = _217[1];
666
- var _218 = (0, react_1.useState)({}), listReferencesOptions = _218[0], setListReferencesOptions = _218[1];
667
- var _219 = (0, react_1.useState)({}), referenceDeleteTableData = _219[0], setReferenceDeleteTableData = _219[1];
668
- var _220 = (0, react_1.useState)([]), relatedSections = _220[0], setRelatedSections = _220[1];
669
- var _221 = (0, react_1.useState)(0), referenceDeleteIndex = _221[0], setReferenceDeleteIndex = _221[1];
670
- var _222 = (0, react_1.useState)({
666
+ }), selectedListAddress = _215[0], setSelectedListAddress = _215[1];
667
+ var _216 = (0, react_1.useState)({}), selectedObjectData = _216[0], setSelectedObjectData = _216[1];
668
+ var _217 = (0, react_1.useState)(null), objectCellEdit = _217[0], setObjectCellEdit = _217[1];
669
+ var _218 = (0, react_1.useState)(false), referenceLoading = _218[0], setReferenceLoading = _218[1];
670
+ var _219 = (0, react_1.useState)({}), referencesOptions = _219[0], setReferencesOptions = _219[1];
671
+ var _220 = (0, react_1.useState)({}), referencesDetails = _220[0], setReferencesDetails = _220[1];
672
+ var _221 = (0, react_1.useState)({}), listReferencesOptions = _221[0], setListReferencesOptions = _221[1];
673
+ var _222 = (0, react_1.useState)({}), referenceDeleteTableData = _222[0], setReferenceDeleteTableData = _222[1];
674
+ var _223 = (0, react_1.useState)([]), relatedSections = _223[0], setRelatedSections = _223[1];
675
+ var _224 = (0, react_1.useState)(0), referenceDeleteIndex = _224[0], setReferenceDeleteIndex = _224[1];
676
+ var _225 = (0, react_1.useState)({
671
677
  id: "",
672
678
  name: "",
673
679
  type: "string",
674
- }), referenceCreationModal = _222[0], setReferenceCreationModal = _222[1];
675
- var _223 = (0, react_1.useState)({}), referenceModelSchema = _223[0], setReferenceSchema = _223[1];
676
- var _224 = (0, react_1.useState)([]), kanbanChecked = _224[0], setKanbanChecked = _224[1];
680
+ }), referenceCreationModal = _225[0], setReferenceCreationModal = _225[1];
681
+ var _226 = (0, react_1.useState)({}), referenceModelSchema = _226[0], setReferenceSchema = _226[1];
682
+ var _227 = (0, react_1.useState)([]), kanbanChecked = _227[0], setKanbanChecked = _227[1];
677
683
  //INFO : Offline
678
- var _225 = (0, react_1.useState)(0), offlineDataLength = _225[0], setOfflineDataLength = _225[1];
679
- var _226 = (0, react_1.useState)(false), offlineModal = _226[0], setOfflineModal = _226[1];
684
+ var _228 = (0, react_1.useState)(0), offlineDataLength = _228[0], setOfflineDataLength = _228[1];
685
+ var _229 = (0, react_1.useState)(false), offlineModal = _229[0], setOfflineModal = _229[1];
680
686
  // INFO: live-stream state — driven by socket connection and navigator.onLine
681
- var _227 = (0, react_1.useState)(false), isLive = _227[0], setIsLive = _227[1];
682
- var _228 = (0, react_1.useState)(false), isLiveOffline = _228[0], setIsLiveOffline = _228[1];
687
+ var _230 = (0, react_1.useState)(false), isLive = _230[0], setIsLive = _230[1];
688
+ var _231 = (0, react_1.useState)(false), isLiveOffline = _231[0], setIsLiveOffline = _231[1];
683
689
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
684
690
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
685
691
  // Independent of SSE status so it works even when bareSocketName is not set.
686
- var _229 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _229[0], setIsNetworkOffline = _229[1];
692
+ var _232 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _232[0], setIsNetworkOffline = _232[1];
687
693
  var previousType = (0, react_1.useRef)(null);
688
694
  var previousSelectedData = (0, react_1.useRef)(null);
689
695
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -809,7 +815,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
809
815
  : "general");
810
816
  var isFirebaseClient = devSettings.server === "firebase";
811
817
  var isFirebase = isFirebaseClient || devSettings.server === "fbServer";
812
- var dbModule = isFirebaseClient ? (_13 = props.lib) === null || _13 === void 0 ? void 0 : _13.firebase : (_14 = props.lib) === null || _14 === void 0 ? void 0 : _14.axios;
818
+ var isDateWarnings = !!((_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.dateWarnings);
819
+ // INFO: the columns as the views draw them — every list option without a
820
+ // colour takes the palette colour of its position
821
+ var displayStructure = (0, defaultColours_1.handleApplyDefaultColours)(structure);
822
+ var dbModule = isFirebaseClient ? (_14 = props.lib) === null || _14 === void 0 ? void 0 : _14.firebase : (_15 = props.lib) === null || _15 === void 0 ? void 0 : _15.axios;
813
823
  var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
814
824
  var selectedRelated = resolvedType === "read"
815
825
  ? relatedSections.find(function (eachSection) { return eachSection.id === viewType; })
@@ -818,6 +828,49 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
818
828
  var _a, _b;
819
829
  (_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListHandleLoading) === null || _b === void 0 ? void 0 : _b.call(_a, tableLoading);
820
830
  }, [tableLoading]);
831
+ // INFO: group totals follow the rows — each read of the list, a filter or a
832
+ // saved edit, asks again
833
+ // INFO: per-group paging lands one read per group at first load, so the
834
+ // request waits for the reads to settle and goes once
835
+ (0, react_1.useEffect)(function () {
836
+ var timer = setTimeout(function () { return handleFetchGroupSummaries(); }, 300);
837
+ return function () { return clearTimeout(timer); };
838
+ /* eslint-disable */
839
+ }, [groupId, tableData]);
840
+ /* eslint-enable */
841
+ // INFO: comments are asked for again only when the rows on screen change,
842
+ // not on every edit of one of them
843
+ var commentCountKey = (tableData !== null && tableData !== void 0 ? tableData : [])
844
+ .map(function (eachRow) { var _a; return (_a = eachRow === null || eachRow === void 0 ? void 0 : eachRow.id) !== null && _a !== void 0 ? _a : eachRow === null || eachRow === void 0 ? void 0 : eachRow._id; })
845
+ .join(",");
846
+ (0, react_1.useEffect)(function () {
847
+ var _a;
848
+ var onFetchCommentCounts = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onFetchCommentCounts;
849
+ if (!onFetchCommentCounts)
850
+ return;
851
+ var recordIds = (tableData !== null && tableData !== void 0 ? tableData : [])
852
+ .map(function (eachRow) { var _a; return (_a = eachRow === null || eachRow === void 0 ? void 0 : eachRow.id) !== null && _a !== void 0 ? _a : eachRow === null || eachRow === void 0 ? void 0 : eachRow._id; })
853
+ .filter(Boolean);
854
+ if (recordIds.length === 0) {
855
+ setCommentCounts({});
856
+ return;
857
+ }
858
+ var isCurrent = true;
859
+ var timer = setTimeout(function () {
860
+ onFetchCommentCounts(recordIds)
861
+ .then(function (counts) {
862
+ if (isCurrent)
863
+ setCommentCounts(counts !== null && counts !== void 0 ? counts : {});
864
+ })
865
+ .catch(function () { });
866
+ }, 300);
867
+ return function () {
868
+ isCurrent = false;
869
+ clearTimeout(timer);
870
+ };
871
+ /* eslint-disable */
872
+ }, [commentCountKey]);
873
+ /* eslint-enable */
821
874
  // INFO: each other space whose rows point at this record becomes a tab of
822
875
  // the read view, so the counts are taken with the record — one schema query
823
876
  // plus one single-row query per referencing column. The rows themselves load
@@ -891,32 +944,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
891
944
  }, [
892
945
  resolvedType,
893
946
  props.id,
894
- (_15 = props.space) === null || _15 === void 0 ? void 0 : _15._id,
947
+ (_16 = props.space) === null || _16 === void 0 ? void 0 : _16._id,
895
948
  props.devSettings.schemaEndpoint,
896
- (_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.showRelatedTab,
949
+ (_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.showRelatedTab,
897
950
  ]);
898
951
  /* eslint-enable */
899
952
  // INFO: the view settings panel (columns, sort, rows per page) is standard on
900
953
  // the new DTW; bareViewSettings stays the opt-in for legacy and bare DTWs
901
- var isViewSettingsEnabled = ((_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareViewSettings) || ((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareNewDTW)
954
+ var isViewSettingsEnabled = ((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareViewSettings) || ((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareNewDTW)
902
955
  ? true
903
956
  : false;
904
957
  // INFO: a consumer that wires onChangeHide owns the hide at schema level
905
958
  // (shared by every user) — toggling writes to the model and calls back. Without it
906
959
  // the hide is this user's own and lives in userHiddenColumnIds.
907
- var isSchemaHideMode = ((_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.onChangeHide) ? true : false;
960
+ var isSchemaHideMode = ((_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.onChangeHide) ? true : false;
908
961
  // INFO: rows per page is a view setting the user can change, so it starts from
909
962
  // the persisted value and falls back to the consumer's limit
910
- var _230 = (0, react_1.useState)((_21 = (_20 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _20 !== void 0 ? _20 : props.limit) !== null && _21 !== void 0 ? _21 : 10), pageLimit = _230[0], setPageLimit = _230[1];
963
+ var _233 = (0, react_1.useState)((_22 = (_21 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _21 !== void 0 ? _21 : props.limit) !== null && _22 !== void 0 ? _22 : 10), pageLimit = _233[0], setPageLimit = _233[1];
911
964
  var limit = pageLimit;
912
- var isSavedViewsEnabled = !!((_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.savedViews) && resolvedType === "list";
965
+ var isSavedViewsEnabled = !!((_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.savedViews) && resolvedType === "list";
913
966
  // INFO: an app that stores views takes over from this browser's storage, so
914
967
  // every view is the team's and nothing is kept locally
915
- var isAppViews = ((_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.sharedViews) !== undefined ||
916
- !!((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.onChangeSharedViews);
968
+ var isAppViews = ((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.sharedViews) !== undefined ||
969
+ !!((_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.onChangeSharedViews);
917
970
  // INFO: a saved view carries its sort, so the sort is held here as with persistViewState
918
971
  var isInternalSort = isPersistEnabled || isSavedViewsEnabled;
919
- var activeSortId = (isInternalSort && persistedSort) || ((_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.sort);
972
+ var activeSortId = (isInternalSort && persistedSort) || ((_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.sort);
920
973
  var handleSortColumn = function (value) {
921
974
  var _a, _b, _c, _d;
922
975
  if (isInternalSort)
@@ -946,7 +999,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
946
999
  // INFO: Firebase pages by document cursor and a union by skip, so neither
947
1000
  // can hand over the whole set — there formula columns are not offered for
948
1001
  // sorting or filtering, rather than ordering one page
949
- var isFormulaViewSupported = !isFirebase && !((_27 = (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.unionCollections) === null || _27 === void 0 ? void 0 : _27.length);
1002
+ var isFormulaViewSupported = !isFirebase && !((_28 = (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.unionCollections) === null || _28 === void 0 ? void 0 : _28.length);
950
1003
  var formulaSort = isFormulaViewSupported &&
951
1004
  (activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) &&
952
1005
  formulaColumnIds.includes(activeSortId.sortId)
@@ -955,11 +1008,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
955
1008
  // INFO: a referenced record and related rows are joined by MongoWrapper's
956
1009
  // lookups and a list row is matched by its Mongo path — neither Firebase nor
957
1010
  // a union read runs them
958
- var flexFilterExtras = !isFirebase && !((_29 = (_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.unionCollections) === null || _29 === void 0 ? void 0 : _29.length)
1011
+ var flexFilterExtras = !isFirebase && !((_30 = (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.unionCollections) === null || _30 === void 0 ? void 0 : _30.length)
959
1012
  ? {
960
- references: (_30 = props.bareSettings) === null || _30 === void 0 ? void 0 : _30.bareFlexFilterReferences,
961
- listObjects: (_31 = props.bareSettings) === null || _31 === void 0 ? void 0 : _31.bareFlexFilterListObjects,
962
- related: (_32 = props.bareSettings) === null || _32 === void 0 ? void 0 : _32.bareFlexFilterRelated,
1013
+ references: (_31 = props.bareSettings) === null || _31 === void 0 ? void 0 : _31.bareFlexFilterReferences,
1014
+ listObjects: (_32 = props.bareSettings) === null || _32 === void 0 ? void 0 : _32.bareFlexFilterListObjects,
1015
+ related: (_33 = props.bareSettings) === null || _33 === void 0 ? void 0 : _33.bareFlexFilterRelated,
963
1016
  }
964
1017
  : undefined;
965
1018
  var formulaFlexQueries = isFormulaViewSupported && formulaColumnIds.length > 0
@@ -1020,18 +1073,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1020
1073
  displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
1021
1074
  };
1022
1075
  };
1023
- var _231 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _231.canUpdateRecord, canInlineUpdate = _231.canInlineUpdate, canBatchUpdate = _231.canBatchUpdate, canDeleteRecord = _231.canDeleteRecord;
1024
- var isEditor = ((_33 = props.edit) === null || _33 === void 0 ? void 0 : _33.allEditable) ? true : false;
1025
- var isOffline = (_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareOffline;
1076
+ var _234 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _234.canUpdateRecord, canInlineUpdate = _234.canInlineUpdate, canBatchUpdate = _234.canBatchUpdate, canDeleteRecord = _234.canDeleteRecord;
1077
+ var isEditor = ((_34 = props.edit) === null || _34 === void 0 ? void 0 : _34.allEditable) ? true : false;
1078
+ var isOffline = (_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareOffline;
1026
1079
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
1027
1080
  // the live network state — online saves go to the server even if bareOffline
1028
1081
  // is true, offline saves go to IDB as normal.
1029
- var isOfflineNetworkListener = isOffline && ((_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareOfflineNetworkListener);
1030
- var showId = (_36 = props.space) === null || _36 === void 0 ? void 0 : _36.showId;
1082
+ var isOfflineNetworkListener = isOffline && ((_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareOfflineNetworkListener);
1083
+ var showId = (_37 = props.space) === null || _37 === void 0 ? void 0 : _37.showId;
1031
1084
  var remainId = showId || selectedObjectStructureId ? true : false;
1032
- var idField = ((_37 = props.space) === null || _37 === void 0 ? void 0 : _37.idField) || ((_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.idField);
1033
- var pipeline = (_39 = props === null || props === void 0 ? void 0 : props.space) === null || _39 === void 0 ? void 0 : _39.pipeline;
1034
- if ((_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.bareListPipeline) {
1085
+ var idField = ((_38 = props.space) === null || _38 === void 0 ? void 0 : _38.idField) || ((_39 = props.organise) === null || _39 === void 0 ? void 0 : _39.idField);
1086
+ var pipeline = (_40 = props === null || props === void 0 ? void 0 : props.space) === null || _40 === void 0 ? void 0 : _40.pipeline;
1087
+ if ((_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.bareListPipeline) {
1035
1088
  pipeline = pipeline
1036
1089
  ? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
1037
1090
  }
@@ -1044,24 +1097,24 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1044
1097
  * three records came back instead of five files, and each tile received the
1045
1098
  * whole array rather than one file, so every one of them read "Attachment".
1046
1099
  */
1047
- var fileViewColumnId = (_44 = (_43 = ((_42 = (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.extendedTabs) !== null && _42 !== void 0 ? _42 : []).find(function (eachTab) {
1100
+ var fileViewColumnId = (_45 = (_44 = ((_43 = (_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.extendedTabs) !== null && _43 !== void 0 ? _43 : []).find(function (eachTab) {
1048
1101
  return eachTab.viewType === "file" &&
1049
1102
  (0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
1050
- })) === null || _43 === void 0 ? void 0 : _43.fileSettings) === null || _44 === void 0 ? void 0 : _44.columnId;
1051
- var hasNavigation = ((_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.handleNavigate) ? true : false;
1103
+ })) === null || _44 === void 0 ? void 0 : _44.fileSettings) === null || _45 === void 0 ? void 0 : _45.columnId;
1104
+ var hasNavigation = ((_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.handleNavigate) ? true : false;
1052
1105
  var formColumn = "grid-cols-12";
1053
- var useMobileView = (_47 = (_46 = props.bareSettings) === null || _46 === void 0 ? void 0 : _46.bareUpdateMobileView) !== null && _47 !== void 0 ? _47 : false;
1106
+ var useMobileView = (_48 = (_47 = props.bareSettings) === null || _47 === void 0 ? void 0 : _47.bareUpdateMobileView) !== null && _48 !== void 0 ? _48 : false;
1054
1107
  var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
1055
- var isActivityLog = (((_49 = (_48 = props.edit) === null || _48 === void 0 ? void 0 : _48.activityLog) === null || _49 === void 0 ? void 0 : _49.enableComments) &&
1056
- ((_50 = props.edit) === null || _50 === void 0 ? void 0 : _50.activityLog.commentCollectionId)) ||
1057
- (((_52 = (_51 = props.edit) === null || _51 === void 0 ? void 0 : _51.activityLog) === null || _52 === void 0 ? void 0 : _52.enableLogs) &&
1058
- ((_53 = props.edit) === null || _53 === void 0 ? void 0 : _53.activityLog.logsCollectionId));
1059
- var customPaginationSize = ((_54 = props.organise) === null || _54 === void 0 ? void 0 : _54.customPaginationCount)
1108
+ var isActivityLog = (((_50 = (_49 = props.edit) === null || _49 === void 0 ? void 0 : _49.activityLog) === null || _50 === void 0 ? void 0 : _50.enableComments) &&
1109
+ ((_51 = props.edit) === null || _51 === void 0 ? void 0 : _51.activityLog.commentCollectionId)) ||
1110
+ (((_53 = (_52 = props.edit) === null || _52 === void 0 ? void 0 : _52.activityLog) === null || _53 === void 0 ? void 0 : _53.enableLogs) &&
1111
+ ((_54 = props.edit) === null || _54 === void 0 ? void 0 : _54.activityLog.logsCollectionId));
1112
+ var customPaginationSize = ((_55 = props.organise) === null || _55 === void 0 ? void 0 : _55.customPaginationCount)
1060
1113
  ? props.organise.customPaginationCount(size)
1061
1114
  : undefined;
1062
1115
  //TODO : Code - Pass ...devSettings, search dbEndpoint:
1063
1116
  var writeServerQuery = new writeQuery_1.WriteQuery({
1064
- dbModule: (_55 = props.lib) === null || _55 === void 0 ? void 0 : _55.axios,
1117
+ dbModule: (_56 = props.lib) === null || _56 === void 0 ? void 0 : _56.axios,
1065
1118
  dbType: devSettings.server,
1066
1119
  dbCollection: props.collectionId,
1067
1120
  dbEndpoint: devSettings.dbEndpoint,
@@ -1069,7 +1122,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1069
1122
  dbUserToken: devSettings.dbUserToken,
1070
1123
  });
1071
1124
  var readServerQuery = new readQuery_1.ReadQuery({
1072
- dbModule: (_56 = props.lib) === null || _56 === void 0 ? void 0 : _56.axios,
1125
+ dbModule: (_57 = props.lib) === null || _57 === void 0 ? void 0 : _57.axios,
1073
1126
  dbType: devSettings.server,
1074
1127
  dbCollection: props.collectionId,
1075
1128
  dbEndpoint: devSettings.dbEndpoint,
@@ -1077,12 +1130,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1077
1130
  dbUserToken: devSettings.dbUserToken,
1078
1131
  });
1079
1132
  var moreButtonPopUp = [
1080
- ((_57 = props.edit) === null || _57 === void 0 ? void 0 : _57.allEditable) &&
1133
+ ((_58 = props.edit) === null || _58 === void 0 ? void 0 : _58.allEditable) &&
1081
1134
  // INFO: the import runs on the server (importEndpoint), so a Firestore
1082
1135
  // datasheet served through one can import; only the browser-direct
1083
1136
  // Firebase client has no server to import through
1084
1137
  !isFirebaseClient &&
1085
- !((_59 = (_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.exportSettings) === null || _59 === void 0 ? void 0 : _59.hideImportCSV)
1138
+ !((_60 = (_59 = props.organise) === null || _59 === void 0 ? void 0 : _59.exportSettings) === null || _60 === void 0 ? void 0 : _60.hideImportCSV)
1086
1139
  ? {
1087
1140
  text: "Import Excel",
1088
1141
  onClick: function () {
@@ -1091,7 +1144,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1091
1144
  },
1092
1145
  }
1093
1146
  : null,
1094
- !((_61 = (_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.exportSettings) === null || _61 === void 0 ? void 0 : _61.hideExportCSV)
1147
+ !((_62 = (_61 = props.organise) === null || _61 === void 0 ? void 0 : _61.exportSettings) === null || _62 === void 0 ? void 0 : _62.hideExportCSV)
1095
1148
  ? {
1096
1149
  text: "Export CSV",
1097
1150
  onClick: function () {
@@ -1101,7 +1154,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1101
1154
  },
1102
1155
  }
1103
1156
  : null,
1104
- !((_63 = (_62 = props.organise) === null || _62 === void 0 ? void 0 : _62.exportSettings) === null || _63 === void 0 ? void 0 : _63.hideExportExcel)
1157
+ !((_64 = (_63 = props.organise) === null || _63 === void 0 ? void 0 : _63.exportSettings) === null || _64 === void 0 ? void 0 : _64.hideExportExcel)
1105
1158
  ? {
1106
1159
  text: "Export Excel",
1107
1160
  onClick: function () {
@@ -1111,7 +1164,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1111
1164
  },
1112
1165
  }
1113
1166
  : null,
1114
- !((_65 = (_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.exportSettings) === null || _65 === void 0 ? void 0 : _65.hideExportPDF)
1167
+ !((_66 = (_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.exportSettings) === null || _66 === void 0 ? void 0 : _66.hideExportPDF)
1115
1168
  ? {
1116
1169
  text: "Export PDF",
1117
1170
  onClick: function () {
@@ -1121,7 +1174,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1121
1174
  },
1122
1175
  }
1123
1176
  : null,
1124
- !((_67 = (_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.exportSettings) === null || _67 === void 0 ? void 0 : _67.hideExportQR)
1177
+ !((_68 = (_67 = props.organise) === null || _67 === void 0 ? void 0 : _67.exportSettings) === null || _68 === void 0 ? void 0 : _68.hideExportQR)
1125
1178
  ? {
1126
1179
  text: "Export QR",
1127
1180
  onClick: function () {
@@ -1131,7 +1184,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1131
1184
  },
1132
1185
  }
1133
1186
  : null,
1134
- !((_69 = (_68 = props.organise) === null || _68 === void 0 ? void 0 : _68.exportSettings) === null || _69 === void 0 ? void 0 : _69.hideExportQR)
1187
+ !((_70 = (_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.exportSettings) === null || _70 === void 0 ? void 0 : _70.hideExportQR)
1135
1188
  ? {
1136
1189
  text: "Export QR(Data)",
1137
1190
  onClick: function () {
@@ -1141,7 +1194,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1141
1194
  },
1142
1195
  }
1143
1196
  : null,
1144
- !((_71 = (_70 = props.organise) === null || _70 === void 0 ? void 0 : _70.exportSettings) === null || _71 === void 0 ? void 0 : _71.hideExportPrint)
1197
+ !((_72 = (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.exportSettings) === null || _72 === void 0 ? void 0 : _72.hideExportPrint)
1145
1198
  ? {
1146
1199
  text: "Print",
1147
1200
  onClick: function () {
@@ -1153,8 +1206,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1153
1206
  : null,
1154
1207
  // INFO: drafts only exist where the form can save one, so the filter has
1155
1208
  // nothing to find on any other page
1156
- ((_72 = props.edit) === null || _72 === void 0 ? void 0 : _72.enableUpdateDraft) &&
1157
- !((_74 = (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.exportSettings) === null || _74 === void 0 ? void 0 : _74.hideExportDraft)
1209
+ ((_73 = props.edit) === null || _73 === void 0 ? void 0 : _73.enableUpdateDraft) &&
1210
+ !((_75 = (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.exportSettings) === null || _75 === void 0 ? void 0 : _75.hideExportDraft)
1158
1211
  ? {
1159
1212
  text: filterDraft ? "Show All Items" : "Filter Draft",
1160
1213
  onClick: function () {
@@ -1163,7 +1216,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1163
1216
  }
1164
1217
  : null,
1165
1218
  ].filter(Boolean);
1166
- if ((_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.moreSettings)
1219
+ if ((_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.moreSettings)
1167
1220
  moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
1168
1221
  //=====================================================================================
1169
1222
  //SECTION: User Column Visibility Handlers
@@ -1557,14 +1610,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1557
1610
  //=====================================================================================
1558
1611
  //SECTION: Saved Views
1559
1612
  //=====================================================================================
1560
- var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.persistKey, (_77 = devSettings.currentUser) === null || _77 === void 0 ? void 0 : _77.userEmail);
1613
+ var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.persistKey, (_78 = devSettings.currentUser) === null || _78 === void 0 ? void 0 : _78.userEmail);
1561
1614
  (0, react_1.useEffect)(function () {
1562
1615
  if (isSavedViewsEnabled && !isAppViews)
1563
1616
  setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
1564
1617
  }, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
1565
1618
  // INFO: the app keeps All's settings, so every change is kept in this
1566
1619
  // browser until the person updates the view for everyone or resets it
1567
- var isViewDraftsEnabled = isSavedViewsEnabled && ((_78 = props.organise) === null || _78 === void 0 ? void 0 : _78.allView) !== undefined;
1620
+ var isViewDraftsEnabled = isSavedViewsEnabled && ((_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.allView) !== undefined;
1568
1621
  var handleGetViewDraftKey = function (viewId) {
1569
1622
  var _a, _b;
1570
1623
  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);
@@ -1641,7 +1694,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1641
1694
  var lastSentSharedViewsRef = (0, react_1.useRef)(null);
1642
1695
  (0, react_1.useEffect)(function () {
1643
1696
  lastSentSharedViewsRef.current = null;
1644
- }, [(_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.sharedViews]);
1697
+ }, [(_80 = props.organise) === null || _80 === void 0 ? void 0 : _80.sharedViews]);
1645
1698
  var handleStoreSharedViews = function (update) {
1646
1699
  var _a, _b, _c;
1647
1700
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
@@ -1686,13 +1739,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1686
1739
  /* eslint-disable */
1687
1740
  }, [
1688
1741
  isSavedViewsEnabled,
1689
- (_80 = props.organise) === null || _80 === void 0 ? void 0 : _80.initialSavedViewId,
1690
- (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.defaultSavedViewId,
1691
- (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.sharedViews,
1742
+ (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.initialSavedViewId,
1743
+ (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.defaultSavedViewId,
1744
+ (_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.sharedViews,
1692
1745
  savedViews,
1693
1746
  ]);
1694
1747
  /* eslint-enable */
1695
- var defaultSavedViewIds = ((_84 = (_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.defaultSavedViews) !== null && _84 !== void 0 ? _84 : [])
1748
+ var defaultSavedViewIds = ((_85 = (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.defaultSavedViews) !== null && _85 !== void 0 ? _85 : [])
1696
1749
  .map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
1697
1750
  .join("|");
1698
1751
  // INFO: keyed on the ids, not the array, so an inline literal passed on every
@@ -1994,8 +2047,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1994
2047
  pageLimit,
1995
2048
  groupId,
1996
2049
  columnWidths,
1997
- (_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.allView,
1998
- (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.sharedViews,
2050
+ (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.allView,
2051
+ (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.sharedViews,
1999
2052
  savedViews,
2000
2053
  ]);
2001
2054
  /* eslint-enable */
@@ -2035,7 +2088,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2035
2088
  var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
2036
2089
  scrollRestoredRef.current = isSwitch || isOtherListReturn;
2037
2090
  /* eslint-disable */
2038
- }, [props.collectionId, (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.persistKey]);
2091
+ }, [props.collectionId, (_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.persistKey]);
2039
2092
  /* eslint-enable */
2040
2093
  // INFO: wait a frame — rows land in state one tick before layout
2041
2094
  (0, react_1.useEffect)(function () {
@@ -2070,7 +2123,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2070
2123
  (0, react_1.useEffect)(function () {
2071
2124
  handleOfflinePrefetch();
2072
2125
  /* eslint-disable */
2073
- }, [props.collectionId, (_88 = props.bareSettings) === null || _88 === void 0 ? void 0 : _88.bareOffline]);
2126
+ }, [props.collectionId, (_89 = props.bareSettings) === null || _89 === void 0 ? void 0 : _89.bareOffline]);
2074
2127
  /* eslint-enable */
2075
2128
  // INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
2076
2129
  // Calls through handleRefreshRef so the interval always dispatches the latest
@@ -2090,7 +2143,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2090
2143
  }, interval);
2091
2144
  return function () { return clearInterval(timer); };
2092
2145
  /* eslint-disable */
2093
- }, [(_89 = props.bareSettings) === null || _89 === void 0 ? void 0 : _89.barePollingInterval, isLive, isNetworkOffline]);
2146
+ }, [(_90 = props.bareSettings) === null || _90 === void 0 ? void 0 : _90.barePollingInterval, isLive, isNetworkOffline]);
2094
2147
  /* eslint-enable */
2095
2148
  // INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
2096
2149
  // EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
@@ -2132,7 +2185,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2132
2185
  };
2133
2186
  /* eslint-disable */
2134
2187
  }, [
2135
- (_90 = props.bareSettings) === null || _90 === void 0 ? void 0 : _90.bareSocketName,
2188
+ (_91 = props.bareSettings) === null || _91 === void 0 ? void 0 : _91.bareSocketName,
2136
2189
  props.collectionId,
2137
2190
  props.devSettings.sseEndpoint,
2138
2191
  props.devSettings.dbAPIToken,
@@ -2406,10 +2459,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2406
2459
  props.collectionId,
2407
2460
  props.model,
2408
2461
  props.localURLEndpoint,
2409
- (_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.extendedTabs,
2462
+ (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.extendedTabs,
2410
2463
  listViewId,
2411
- (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.additionalQuery,
2412
- (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.groupBy,
2464
+ (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.additionalQuery,
2465
+ (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.groupBy,
2413
2466
  resolvedType,
2414
2467
  ]);
2415
2468
  /**
@@ -2561,7 +2614,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2561
2614
  };
2562
2615
  }, 100);
2563
2616
  return function () { return clearTimeout(timeoutId); };
2564
- }, [(_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.showReadFloatingNav, resolvedType, props.id, loading]);
2617
+ }, [(_95 = props.organise) === null || _95 === void 0 ? void 0 : _95.showReadFloatingNav, resolvedType, props.id, loading]);
2565
2618
  (0, react_1.useEffect)(function () {
2566
2619
  if (resolvedType !== "read")
2567
2620
  return;
@@ -2860,7 +2913,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2860
2913
  (0, listModule_1.handleDataEditButton)(tempData, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListActionBtns, undefined, undefined, undefined, !canUpdateRecord);
2861
2914
  return tempData;
2862
2915
  })];
2863
- case 2: return [2 /*return*/, (0, listModule_1.handleListDataBasedOnModel)(records, 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)];
2916
+ case 2: return [2 /*return*/, (0, listModule_1.handleListDataBasedOnModel)(records, props.devSettings, (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios, displayStructure, (_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, isDateWarnings)];
2864
2917
  }
2865
2918
  });
2866
2919
  }); };
@@ -3363,7 +3416,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3363
3416
  return serverId === "_id" && eachRow && eachRow["_id"] === undefined
3364
3417
  ? __assign(__assign({}, eachRow), { _id: (_a = eachRow.recordId) !== null && _a !== void 0 ? _a : eachRow.id }) : eachRow;
3365
3418
  });
3366
- 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)];
3419
+ return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(sourceRows, props.devSettings, (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios, displayStructure, (_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, isDateWarnings)];
3367
3420
  case 1:
3368
3421
  rebuilt = _e.sent();
3369
3422
  if (rebuilt.length !== displayRows.length)
@@ -3599,7 +3652,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3599
3652
  });
3600
3653
  prettierDataList = dummyPrettierDataList_1;
3601
3654
  return [3 /*break*/, 5];
3602
- case 3: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, structure, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_d = props.edit) === null || _d === void 0 ? void 0 : _d.activityLog : undefined, (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListActionBtns, !canUpdateRecord, undefined, handleSeedListReferenceOptions)];
3655
+ case 3: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, displayStructure, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_d = props.edit) === null || _d === void 0 ? void 0 : _d.activityLog : undefined, (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListActionBtns, !canUpdateRecord, undefined, handleSeedListReferenceOptions, isDateWarnings)];
3603
3656
  case 4:
3604
3657
  prettierDataList = _p.sent();
3605
3658
  if (props.groupId) {
@@ -5637,7 +5690,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5637
5690
  // update an inline cell edit makes, gated on the same update right
5638
5691
  var columnTypeActions = {
5639
5692
  canUpdate: canUpdateRecord,
5640
- onButtonClick: (_95 = props.organise) === null || _95 === void 0 ? void 0 : _95.onButtonClick,
5693
+ dateWarnings: isDateWarnings,
5694
+ onButtonClick: (_96 = props.organise) === null || _96 === void 0 ? void 0 : _96.onButtonClick,
5641
5695
  onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
5642
5696
  var _a;
5643
5697
  return __generator(this, function (_b) {
@@ -5654,7 +5708,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
5654
5708
  }
5655
5709
  });
5656
5710
  }); },
5657
- onTimeTrackingAction: ((_96 = props.organise) === null || _96 === void 0 ? void 0 : _96.onTimeTrackingAction) && canUpdateRecord
5711
+ onTimeTrackingAction: ((_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.onTimeTrackingAction) && canUpdateRecord
5658
5712
  ? function (rowId, columnId, action) {
5659
5713
  return handleTimeTrackingAction(rowId, columnId, action);
5660
5714
  }
@@ -7872,8 +7926,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7872
7926
  : rows;
7873
7927
  };
7874
7928
  /* eslint-disable */
7875
- var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_97 = props.bareSettings) === null || _97 === void 0 ? void 0 : _97.bareNewDTW]);
7876
- var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_98 = props.bareSettings) === null || _98 === void 0 ? void 0 : _98.bareNewDTW]);
7929
+ var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_98 = props.bareSettings) === null || _98 === void 0 ? void 0 : _98.bareNewDTW]);
7930
+ var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_99 = props.bareSettings) === null || _99 === void 0 ? void 0 : _99.bareNewDTW]);
7877
7931
  /* eslint-enable */
7878
7932
  // INFO: the pencil beside a record's title opens the same form the Update
7879
7933
  // column's pencil did, for whoever may update; the bubble beside it opens
@@ -7898,7 +7952,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7898
7952
  var _a, _b;
7899
7953
  var tableHeader = [];
7900
7954
  var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
7901
- structure.map(function (eachAttribute) {
7955
+ displayStructure.map(function (eachAttribute) {
7902
7956
  var _a, _b;
7903
7957
  if (eachAttribute.id === "baseDraft" ||
7904
7958
  utils_1.NON_TABLE_COLUMN_DATA_TYPES.includes(eachAttribute.type) ||
@@ -9819,7 +9873,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9819
9873
  // INFO: the grouped column and its sections in option order — a status
9820
9874
  // column's options, Yes / No, or the workspace's members
9821
9875
  var handleGetGroupColumn = function () {
9822
- return groupId ? structure.find(function (eachDS) { return eachDS.id === groupId; }) : undefined;
9876
+ return groupId
9877
+ ? displayStructure.find(function (eachDS) { return eachDS.id === groupId; })
9878
+ : undefined;
9823
9879
  };
9824
9880
  var handleGetGroupColumnOptions = function () {
9825
9881
  return (0, groupSections_1.handleGetGroupOptions)(handleGetGroupColumn(), props.devSettings.organisationMembers);
@@ -9850,15 +9906,165 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9850
9906
  : undefined }));
9851
9907
  });
9852
9908
  // INFO: a section whose own query came back empty has nothing to show
9853
- if (isGroupPaging)
9854
- return sections.filter(function (eachGroup) {
9909
+ var shownSections = isGroupPaging
9910
+ ? sections.filter(function (eachGroup) {
9855
9911
  var _a, _b;
9856
9912
  return eachGroup.rowIds.length > 0 ||
9857
9913
  !(((_a = groupPageState[eachGroup.id]) === null || _a === void 0 ? void 0 : _a.fetched) &&
9858
9914
  ((_b = groupPageState[eachGroup.id]) === null || _b === void 0 ? void 0 : _b.size) === 0);
9859
- });
9860
- return sections;
9915
+ })
9916
+ : sections;
9917
+ return handleApplyGroupDefaults(shownSections);
9918
+ };
9919
+ // INFO: every section is coloured — by its option's
9920
+ // position, so a group keeps its colour as others empty — person groups
9921
+ // show the person's face, and a section that one value stands for can be
9922
+ // joined by adding a row in it or dragging one onto it
9923
+ var handleApplyGroupDefaults = function (sections) {
9924
+ var _a, _b;
9925
+ var column = handleGetGroupColumn();
9926
+ var options = (_a = handleGetGroupColumnOptions()) !== null && _a !== void 0 ? _a : [];
9927
+ var members = (_b = props.devSettings.organisationMembers) !== null && _b !== void 0 ? _b : [];
9928
+ return sections.map(function (eachSection, index) {
9929
+ var _a;
9930
+ var _b, _c;
9931
+ var isSpecial = eachSection.id === groupSections_1.GROUP_UNKNOWN_KEY ||
9932
+ eachSection.id === groupSections_1.GROUP_EMPTY_KEY;
9933
+ var optionIndex = options.findIndex(function (eachOption) { return eachOption.key === eachSection.id; });
9934
+ var member = (column === null || column === void 0 ? void 0 : column.type) === "person" && !isSpecial
9935
+ ? members.find(function (eachMember) { return eachMember.key === eachSection.id; })
9936
+ : undefined;
9937
+ var join = handleGetGroupJoin(column, eachSection.id);
9938
+ return __assign(__assign({}, eachSection), { colour: (_b = eachSection.colour) !== null && _b !== void 0 ? _b : (isSpecial
9939
+ ? undefined
9940
+ : (0, defaultColours_1.handleGetDefaultColour)(optionIndex >= 0 ? optionIndex : index)), avatar: (column === null || column === void 0 ? void 0 : column.type) === "person" && !isSpecial
9941
+ ? { label: (_c = member === null || member === void 0 ? void 0 : member.label) !== null && _c !== void 0 ? _c : eachSection.title, image: member === null || member === void 0 ? void 0 : member.image }
9942
+ : undefined, joinValues: column && join ? (_a = {}, _a[column.id] = join.value, _a) : undefined,
9943
+ // INFO: drawn once the totals are in. The count is shown only when it
9944
+ // is the group's real total — a group built from one page of the list
9945
+ // would otherwise count that page beside sums of every row
9946
+ summary: groupSummaries[eachSection.id]
9947
+ ? {
9948
+ count: eachSection.count,
9949
+ sums: groupSummaries[eachSection.id],
9950
+ }
9951
+ : undefined });
9952
+ });
9953
+ };
9954
+ // INFO: the number columns on screen, which each group totals
9955
+ var handleGetGroupSumIds = function () {
9956
+ var hiddenIds = getActiveUserHiddenColumnIds();
9957
+ return displayStructure
9958
+ .filter(function (eachColumn) {
9959
+ return eachColumn.type === "number" &&
9960
+ !eachColumn.ratingMax &&
9961
+ !eachColumn.hide &&
9962
+ !hiddenIds.includes(eachColumn.id);
9963
+ })
9964
+ .map(function (eachColumn) { return eachColumn.id; });
9965
+ };
9966
+ /**
9967
+ * INFO: each group's total per number column over every row the filters
9968
+ * match — the database sums them, one request per column, as a chart's
9969
+ * grouped sum does, so a group showing one page of its rows still totals
9970
+ * all of them. The latest request wins; a reply to filters since changed is
9971
+ * dropped.
9972
+ */
9973
+ var handleFetchGroupSummaries = function () { return __awaiter(void 0, void 0, void 0, function () {
9974
+ var column, requestId, sumIds, query, range, results, options_1, sums_1, _a;
9975
+ var _b, _c, _d, _e;
9976
+ return __generator(this, function (_f) {
9977
+ switch (_f.label) {
9978
+ case 0:
9979
+ column = handleGetGroupColumn();
9980
+ requestId = ++groupSummaryRequestRef.current;
9981
+ sumIds = handleGetGroupSumIds();
9982
+ if (!column ||
9983
+ !((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareNewDTW) ||
9984
+ isFirebase ||
9985
+ // INFO: a formula filter is applied here, not on the server, so the
9986
+ // server's sums would include rows it hides; a union list cannot take
9987
+ // an aggregate
9988
+ isFormulaView ||
9989
+ !!((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.unionCollections) === null || _d === void 0 ? void 0 : _d.length) ||
9990
+ sumIds.length === 0) {
9991
+ setGroupSummaries(function (previous) {
9992
+ return Object.keys(previous).length > 0 ? {} : previous;
9993
+ });
9994
+ return [2 /*return*/];
9995
+ }
9996
+ query = (_e = renderImpSearchFilterConditions()) !== null && _e !== void 0 ? _e : [];
9997
+ range = [(0, dayjs_1.default)().add(1, "day").format("DD/MM/YYYY HH:mm:ss")];
9998
+ _f.label = 1;
9999
+ case 1:
10000
+ _f.trys.push([1, 3, , 4]);
10001
+ return [4 /*yield*/, Promise.all(sumIds.map(function (eachId) {
10002
+ return readServerQuery.call({
10003
+ type: "list",
10004
+ query: query,
10005
+ aggregate: {
10006
+ type: "sum",
10007
+ queryId: eachId,
10008
+ groupId: column.id,
10009
+ range: range,
10010
+ timezone: dayjs_1.default.tz.guess(),
10011
+ },
10012
+ });
10013
+ }))];
10014
+ case 2:
10015
+ results = _f.sent();
10016
+ if (requestId !== groupSummaryRequestRef.current)
10017
+ return [2 /*return*/];
10018
+ options_1 = handleGetGroupColumnOptions();
10019
+ sums_1 = {};
10020
+ results.forEach(function (eachResult, index) {
10021
+ (0, chartResults_1.handleFlattenGroupedResult)(eachResult === null || eachResult === void 0 ? void 0 : eachResult.data).forEach(function (eachGroup) {
10022
+ var _a, _b, _c;
10023
+ var sectionId = (0, groupSections_1.handleGetGroupKey)(column, eachGroup.key, options_1, isFirebase);
10024
+ var sectionSums = (sums_1[sectionId] = (_a = sums_1[sectionId]) !== null && _a !== void 0 ? _a : {});
10025
+ sectionSums[sumIds[index]] =
10026
+ ((_b = sectionSums[sumIds[index]]) !== null && _b !== void 0 ? _b : 0) + ((_c = eachGroup.value) !== null && _c !== void 0 ? _c : 0);
10027
+ });
10028
+ });
10029
+ setGroupSummaries(sums_1);
10030
+ return [3 /*break*/, 4];
10031
+ case 3:
10032
+ _a = _f.sent();
10033
+ if (requestId === groupSummaryRequestRef.current)
10034
+ setGroupSummaries({});
10035
+ return [3 /*break*/, 4];
10036
+ case 4: return [2 /*return*/];
10037
+ }
10038
+ });
10039
+ }); };
10040
+ // INFO: a required column cannot be emptied, so its No Value group takes
10041
+ // no new or moved row — as a kanban's Unassigned column does not
10042
+ var handleGetGroupJoin = function (column, sectionId) {
10043
+ return sectionId === groupSections_1.GROUP_EMPTY_KEY && !(column === null || column === void 0 ? void 0 : column.optional)
10044
+ ? undefined
10045
+ : (0, groupSections_1.handleGetGroupSectionValue)(column, sectionId);
9861
10046
  };
10047
+ // INFO: a row dropped on a group saves that group's value, as a card moved
10048
+ // to another kanban column does
10049
+ var handleMoveRowToGroup = function (rowId, sectionId) { return __awaiter(void 0, void 0, void 0, function () {
10050
+ var column, join;
10051
+ var _a;
10052
+ return __generator(this, function (_b) {
10053
+ switch (_b.label) {
10054
+ case 0:
10055
+ column = handleGetGroupColumn();
10056
+ join = handleGetGroupJoin(column, sectionId);
10057
+ if (!column || !join || !canUpdateRecord)
10058
+ return [2 /*return*/];
10059
+ return [4 /*yield*/, handleSubmitData("update", rowId, column.id, (_a = {},
10060
+ _a[column.id] = join.value,
10061
+ _a))];
10062
+ case 1:
10063
+ _b.sent();
10064
+ return [2 /*return*/];
10065
+ }
10066
+ });
10067
+ }); };
9862
10068
  // INFO: a row's section under per-group paging
9863
10069
  var handleResolveGroupKey = function (row) {
9864
10070
  return (0, groupSections_1.handleGetGroupKey)(handleGetGroupColumn(), groupId ? row === null || row === void 0 ? void 0 : row[groupId] : undefined, handleGetGroupColumnOptions(), isFirebase);
@@ -9902,7 +10108,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9902
10108
  count = (_d = responseData === null || responseData === void 0 ? void 0 : responseData.count) !== null && _d !== void 0 ? _d : 0;
9903
10109
  prettierRows = [];
9904
10110
  if (!(rawRows.length > 0)) return [3 /*break*/, 3];
9905
- return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(rawRows, props.devSettings, (_e = props.lib) === null || _e === void 0 ? void 0 : _e.axios, structure, (_f = props.organise) === null || _f === void 0 ? void 0 : _f.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_g = props.edit) === null || _g === void 0 ? void 0 : _g.activityLog : undefined, (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareListActionBtns, !canUpdateRecord, undefined, handleSeedListReferenceOptions)];
10111
+ return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(rawRows, props.devSettings, (_e = props.lib) === null || _e === void 0 ? void 0 : _e.axios, displayStructure, (_f = props.organise) === null || _f === void 0 ? void 0 : _f.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_g = props.edit) === null || _g === void 0 ? void 0 : _g.activityLog : undefined, (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareListActionBtns, !canUpdateRecord, undefined, handleSeedListReferenceOptions, isDateWarnings)];
9906
10112
  case 2:
9907
10113
  prettierRows = _j.sent();
9908
10114
  rawRows.forEach(function (eachData) {
@@ -10071,7 +10277,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10071
10277
  };
10072
10278
  };
10073
10279
  var renderGroupTable = function (multipleSelect) {
10074
- 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;
10280
+ 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;
10075
10281
  if (groupId && !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)) {
10076
10282
  // INFO: sections are keyed off the raw rows, in option order, with
10077
10283
  // Unknown and No Value last — the same sections the new table draws
@@ -10198,7 +10404,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10198
10404
  else {
10199
10405
  // INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
10200
10406
  if ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareNewDTW) {
10201
- 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(), onRowActivity: recordActivityAction, onRowEdit: recordEditAction,
10407
+ 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(), onRowActivity: recordActivityAction, onRowEdit: recordEditAction, commentCounts: ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.onFetchCommentCounts) ? commentCounts : undefined, onMoveRowToGroup: canUpdateRecord && groupId
10408
+ ? handleMoveRowToGroup
10409
+ : undefined,
10202
10410
  // INFO: per-group paging — scroll appends inside a band, page
10203
10411
  // mode gives each band its own pager; undefined = bands as before
10204
10412
  onGroupLoadMore: renderCheckGroupPaging() && renderCheckScrollMode()
@@ -10207,8 +10415,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10207
10415
  ? function (groupKey, page) {
10208
10416
  return handleFetchGroupPage(groupKey, page);
10209
10417
  }
10210
- : undefined, groupLoadingStatus: renderCheckGroupPaging() ? groupPageState : undefined, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: ((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.disableSelectFullData) === null || _e === void 0 ? void 0 : _e.table) || isFormulaView, maxSelectedCount: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListMaxSelectedCount, mobileView: (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListMobileView, mobileTooltip: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (canBatchUpdate &&
10211
- !((_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareHideTableExtraMultipleAction)
10418
+ : undefined, groupLoadingStatus: renderCheckGroupPaging() ? groupPageState : undefined, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: ((_f = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.disableSelectFullData) === null || _f === void 0 ? void 0 : _f.table) || isFormulaView, maxSelectedCount: (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListMaxSelectedCount, mobileView: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareListMobileView, mobileTooltip: (_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (canBatchUpdate &&
10419
+ !((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareHideTableExtraMultipleAction)
10212
10420
  ? [
10213
10421
  {
10214
10422
  id: "clone",
@@ -10236,7 +10444,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10236
10444
  onClick: function () { return setBatchUpdateModal(true); },
10237
10445
  },
10238
10446
  ]
10239
- : []), true), (((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareListMultipleSelectAddtionalActions)
10447
+ : []), true), (((_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListMultipleSelectAddtionalActions)
10240
10448
  ? props.bareSettings.bareListMultipleSelectAddtionalActions.map(function (eachButton) { return ({
10241
10449
  id: "dt-list-multi-action-btn-" + eachButton.text,
10242
10450
  btnText: eachButton.text,
@@ -10245,43 +10453,43 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10245
10453
  return (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
10246
10454
  },
10247
10455
  }); })
10248
- : []), 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) {
10456
+ : []), true), multiActionFloatingOffset: (_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(true), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
10249
10457
  var _a, _b;
10250
10458
  handleCaptureListScroll(id);
10251
10459
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
10252
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_o = (_m = props.newTabUrl) === null || _m === void 0 ? void 0 : _m.default) !== null && _o !== void 0 ? _o : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_q = (_p = props.newTabUrl) === null || _p === void 0 ? void 0 : _p.addons) !== null && _q !== void 0 ? _q : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
10460
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_p = (_o = props.newTabUrl) === null || _o === void 0 ? void 0 : _o.default) !== null && _p !== void 0 ? _p : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_r = (_q = props.newTabUrl) === null || _q === void 0 ? void 0 : _q.addons) !== null && _r !== void 0 ? _r : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
10253
10461
  handlePagination(value);
10254
- }, className: "mt-5", devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_r = props.organise) === null || _r === void 0 ? void 0 : _r.fixedPagination, advSettings: {
10462
+ }, className: "mt-5", devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.fixedPagination, advSettings: {
10255
10463
  // INFO: bareAddColumns routes the + to the name/type popup; without
10256
10464
  // it the flag behaves as it always did and opens the formula builder
10257
- flat: (_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareFlatTable,
10258
- addColumnEnabled: ((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareAddColumns) ||
10259
- ((_u = props.organise) === null || _u === void 0 ? void 0 : _u.addColumnEnabled),
10260
- onAddColumn: ((_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareAddColumns)
10465
+ flat: (_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareFlatTable,
10466
+ addColumnEnabled: ((_u = props.bareSettings) === null || _u === void 0 ? void 0 : _u.bareAddColumns) ||
10467
+ ((_v = props.organise) === null || _v === void 0 ? void 0 : _v.addColumnEnabled),
10468
+ onAddColumn: ((_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareAddColumns)
10261
10469
  ? handleAddPlainColumn
10262
10470
  : undefined,
10263
- onDeleteColumn: ((_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareAddColumns)
10471
+ onDeleteColumn: ((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareAddColumns)
10264
10472
  ? handleDeletePlainColumn
10265
10473
  : undefined,
10266
- onEditColumn: ((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareAddColumns)
10474
+ onEditColumn: ((_y = props.bareSettings) === null || _y === void 0 ? void 0 : _y.bareAddColumns)
10267
10475
  ? handleEditPlainColumn
10268
10476
  : undefined,
10269
- getColumnSchema: ((_y = props.bareSettings) === null || _y === void 0 ? void 0 : _y.bareAddColumns)
10477
+ getColumnSchema: ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareAddColumns)
10270
10478
  ? function (columnId) {
10271
- return structure.find(function (eachColumn) { return eachColumn.id === columnId; });
10479
+ return displayStructure.find(function (eachColumn) { return eachColumn.id === columnId; });
10272
10480
  }
10273
10481
  : undefined,
10274
- getSchema: ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareAddColumns)
10482
+ getSchema: ((_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareAddColumns)
10275
10483
  ? function () { return structure; }
10276
10484
  : undefined,
10277
- renderAddColumnElements: ((_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareAddColumns)
10485
+ renderAddColumnElements: ((_1 = props.bareSettings) === null || _1 === void 0 ? void 0 : _1.bareAddColumns)
10278
10486
  ? undefined
10279
10487
  : renderAddMathColumn,
10280
10488
  // INFO: the popup's reference pickers read from the same providers
10281
10489
  // the schema editor uses — without them a reference column would be
10282
10490
  // created with no target and resolve nothing
10283
- renderReferenceSpaceOptions: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.renderReferenceSpaceOptions,
10284
- renderReferenceLabelOptions: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.renderReferenceLabelOptions,
10491
+ renderReferenceSpaceOptions: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.renderReferenceSpaceOptions,
10492
+ renderReferenceLabelOptions: (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.renderReferenceLabelOptions,
10285
10493
  dragEnabled: isViewSettingsEnabled,
10286
10494
  sortEnabled: isViewSettingsEnabled,
10287
10495
  // INFO: per-column header filter is replaced by the flex filters
@@ -10327,7 +10535,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10327
10535
  });
10328
10536
  }); },
10329
10537
  }, onObjectEdit: handleObjectCellEdit, addable: {
10330
- active: ((_3 = props.edit) === null || _3 === void 0 ? void 0 : _3.listAddable) ? true : false,
10538
+ active: ((_4 = props.edit) === null || _4 === void 0 ? void 0 : _4.listAddable) ? true : false,
10331
10539
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
10332
10540
  var createdId;
10333
10541
  return __generator(this, function (_a) {
@@ -10341,16 +10549,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10341
10549
  }
10342
10550
  });
10343
10551
  }); },
10344
- }, darkMode: (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.darkMode,
10552
+ }, darkMode: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.darkMode,
10345
10553
  // INFO: each band pages itself, so the list-wide pager would only
10346
10554
  // page the read that seeded them
10347
- hidePagination: ((_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.hidePagination) ||
10348
- (renderCheckGroupPaging() && !renderCheckScrollMode()), customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableEllipsisOnLongWord, pinColumns: (_7 = props.bareSettings) === null || _7 === void 0 ? void 0 : _7.bareListTablePinColumns }));
10555
+ hidePagination: ((_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.hidePagination) ||
10556
+ (renderCheckGroupPaging() && !renderCheckScrollMode()), customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.disableEllipsisOnLongWord, pinColumns: (_8 = props.bareSettings) === null || _8 === void 0 ? void 0 : _8.bareListTablePinColumns }));
10349
10557
  }
10350
- return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: ((_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.disableSelectFullData) === null || _9 === void 0 ? void 0 : _9.table) || isFormulaView, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
10558
+ return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: ((_10 = (_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.disableSelectFullData) === null || _10 === void 0 ? void 0 : _10.table) || isFormulaView, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
10351
10559
  selectedIds.length > 0 &&
10352
10560
  canBatchUpdate &&
10353
- !((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
10561
+ !((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
10354
10562
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
10355
10563
  handleCloneSelectedData();
10356
10564
  } }))),
@@ -10361,8 +10569,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10361
10569
  !isFirebase && canBatchUpdate && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
10362
10570
  setBatchUpdateModal(true);
10363
10571
  } })),
10364
- ((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareListMultipleSelectAddtionalActions) &&
10365
- ((_13 = (_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareListMultipleSelectAddtionalActions) === null || _13 === void 0 ? void 0 : _13.map(function (eachButton) {
10572
+ ((_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareListMultipleSelectAddtionalActions) &&
10573
+ ((_14 = (_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareListMultipleSelectAddtionalActions) === null || _14 === void 0 ? void 0 : _14.map(function (eachButton) {
10366
10574
  return (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm ".concat(eachButton.className), text: eachButton.text, onClick: function () {
10367
10575
  var _a, _b;
10368
10576
  (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
@@ -10371,10 +10579,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10371
10579
  var _a, _b;
10372
10580
  handleCaptureListScroll(id);
10373
10581
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
10374
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_15 = (_14 = props.newTabUrl) === null || _14 === void 0 ? void 0 : _14.default) !== null && _15 !== void 0 ? _15 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_17 = (_16 = props.newTabUrl) === null || _16 === void 0 ? void 0 : _16.addons) !== null && _17 !== void 0 ? _17 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
10582
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_16 = (_15 = props.newTabUrl) === null || _15 === void 0 ? void 0 : _15.default) !== null && _16 !== void 0 ? _16 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_18 = (_17 = props.newTabUrl) === null || _17 === void 0 ? void 0 : _17.addons) !== null && _18 !== void 0 ? _18 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
10375
10583
  handlePagination(value);
10376
- }, className: "mt-5", lib: { axios: (_18 = props.lib) === null || _18 === void 0 ? void 0 : _18.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.fixedPagination, advSettings: {
10377
- addColumnEnabled: (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.addColumnEnabled,
10584
+ }, className: "mt-5", lib: { axios: (_19 = props.lib) === null || _19 === void 0 ? void 0 : _19.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.fixedPagination, advSettings: {
10585
+ addColumnEnabled: (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.addColumnEnabled,
10378
10586
  renderAddColumnElements: renderAddMathColumn,
10379
10587
  dragEnabled: isViewSettingsEnabled,
10380
10588
  sortEnabled: isViewSettingsEnabled,
@@ -10417,7 +10625,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10417
10625
  });
10418
10626
  }); },
10419
10627
  }, onObjectEdit: handleObjectCellEdit, addable: {
10420
- active: ((_21 = props.edit) === null || _21 === void 0 ? void 0 : _21.listAddable) ? true : false,
10628
+ active: ((_22 = props.edit) === null || _22 === void 0 ? void 0 : _22.listAddable) ? true : false,
10421
10629
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
10422
10630
  var createdId;
10423
10631
  return __generator(this, function (_a) {
@@ -10431,7 +10639,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10431
10639
  }
10432
10640
  });
10433
10641
  }); },
10434
- }, darkMode: (_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.darkMode, hidePagination: (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.disableEllipsisOnLongWord }));
10642
+ }, darkMode: (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.darkMode, hidePagination: (_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.disableEllipsisOnLongWord }));
10435
10643
  }
10436
10644
  };
10437
10645
  // INFO: `hidden` keeps the markers out of space-y spacing
@@ -11920,14 +12128,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11920
12128
  };
11921
12129
  return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
11922
12130
  renderNotification("root"),
11923
- ((_100 = (_99 = props.renderSettings) === null || _99 === void 0 ? void 0 : _99.renderLoadingUI) === null || _100 === void 0 ? void 0 : _100.call(_99)) && loading ? ((_101 = props.renderSettings) === null || _101 === void 0 ? void 0 : _101.renderLoadingUI()) : (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, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
12131
+ ((_101 = (_100 = props.renderSettings) === null || _100 === void 0 ? void 0 : _100.renderLoadingUI) === null || _101 === void 0 ? void 0 : _101.call(_100)) && loading ? ((_102 = props.renderSettings) === null || _102 === void 0 ? void 0 : _102.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.darkMode, darkModeBg: (_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
11924
12132
  var _a, _b;
11925
12133
  if (loading)
11926
12134
  return;
11927
12135
  handlePopUpModal(false);
11928
12136
  setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
11929
12137
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
11930
- 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, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
12138
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.darkMode, darkModeBg: (_106 = props.organise) === null || _106 === void 0 ? void 0 : _106.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
11931
12139
  return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
11932
12140
  if (dataId) {
11933
12141
  var currentValue = selectedData[referenceCreationModal.id];
@@ -11943,19 +12151,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11943
12151
  }, onClose: function () {
11944
12152
  setReferenceCreationModal({ id: "", name: "", type: "string" });
11945
12153
  } }),
11946
- 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, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
12154
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_107 = props.organise) === null || _107 === void 0 ? void 0 : _107.darkMode, darkModeBg: (_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
11947
12155
  setReferenceDeleteTableData({});
11948
12156
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11949
- react_1.default.createElement(modal_1.Modal, { darkMode: (_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.darkMode, darkModeBg: (_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
12157
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.darkMode, darkModeBg: (_110 = props.organise) === null || _110 === void 0 ? void 0 : _110.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
11950
12158
  setDeletePasscodeInput("");
11951
12159
  setDeleteModal(!deleteModal);
11952
12160
  setDeleteFeedId("");
11953
12161
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11954
- react_1.default.createElement(modal_1.Modal, { darkMode: (_110 = props.organise) === null || _110 === void 0 ? void 0 : _110.darkMode, darkModeBg: (_111 = props.organise) === null || _111 === void 0 ? void 0 : _111.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
12162
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_111 = props.organise) === null || _111 === void 0 ? void 0 : _111.darkMode, darkModeBg: (_112 = props.organise) === null || _112 === void 0 ? void 0 : _112.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
11955
12163
  setBatchUpdateData({ columnId: "", columnData: {} });
11956
12164
  setBatchUpdateModal(false);
11957
12165
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11958
- react_1.default.createElement(modal_1.Modal, { darkMode: (_112 = props.organise) === null || _112 === void 0 ? void 0 : _112.darkMode, darkModeBg: (_113 = props.organise) === null || _113 === void 0 ? void 0 : _113.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
12166
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_113 = props.organise) === null || _113 === void 0 ? void 0 : _113.darkMode, darkModeBg: (_114 = props.organise) === null || _114 === void 0 ? void 0 : _114.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
11959
12167
  var _a, _b;
11960
12168
  if (props.space)
11961
12169
  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 }));
@@ -11971,13 +12179,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11971
12179
  (0, react_dom_1.createPortal)(
11972
12180
  // INFO: z-50 lifts it over a Modal the table may sit in (z-40)
11973
12181
  react_1.default.createElement("div", { className: "relative z-50" },
11974
- react_1.default.createElement(drawer_1.Drawer, { darkMode: (_114 = props.organise) === null || _114 === void 0 ? void 0 : _114.darkMode, darkModeBg: (_115 = props.organise) === null || _115 === void 0 ? void 0 : _115.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
12182
+ react_1.default.createElement(drawer_1.Drawer, { darkMode: (_115 = props.organise) === null || _115 === void 0 ? void 0 : _115.darkMode, darkModeBg: (_116 = props.organise) === null || _116 === void 0 ? void 0 : _116.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
11975
12183
  // INFO: the record stays set while the drawer slides out — clearing it
11976
12184
  // would remount the hidden panel collection-wide and fetch again. The
11977
12185
  // toolbar's collection-wide button clears it when it opens.
11978
12186
  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"
11979
12187
  ? props.title
11980
- : "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((_116 = props.id) !== null && _116 !== void 0 ? _116 : "") : activityId, activityLog: (_117 = props.edit) === null || _117 === void 0 ? void 0 : _117.activityLog, model: structure }) })), document.body),
12188
+ : "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((_117 = props.id) !== null && _117 !== void 0 ? _117 : "") : activityId, activityLog: (_118 = props.edit) === null || _118 === void 0 ? void 0 : _118.activityLog, model: structure }) })), document.body),
11981
12189
  renderScrollSentinel()));
11982
12190
  });
11983
12191
  //# sourceMappingURL=index.js.map