blixify-ui-web 1.3.28 → 1.3.30

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 (61) hide show
  1. package/lib/components/chart/ganttChart/index.d.ts +3 -0
  2. package/lib/components/chart/ganttChart/index.d.ts.map +1 -1
  3. package/lib/components/chart/ganttChart/index.js +15 -8
  4. package/lib/components/chart/ganttChart/index.js.map +1 -1
  5. package/lib/components/data/columnTypes/dateRangeCalendar.d.ts +1 -1
  6. package/lib/components/data/columnTypes/dateRangeCalendar.js +1 -1
  7. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  8. package/lib/components/data/dataTemplate/index.js +687 -379
  9. package/lib/components/data/dataTemplate/index.js.map +1 -1
  10. package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
  11. package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
  12. package/lib/components/data/dataTemplate/settingsModal.js +14 -8
  13. package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
  14. package/lib/components/data/dataTemplate/timelineBars.d.ts +15 -0
  15. package/lib/components/data/dataTemplate/timelineBars.d.ts.map +1 -1
  16. package/lib/components/data/dataTemplate/timelineBars.js +98 -1
  17. package/lib/components/data/dataTemplate/timelineBars.js.map +1 -1
  18. package/lib/components/data/flexFilter/index.d.ts +1 -0
  19. package/lib/components/data/flexFilter/index.d.ts.map +1 -1
  20. package/lib/components/data/flexFilter/index.js +74 -12
  21. package/lib/components/data/flexFilter/index.js.map +1 -1
  22. package/lib/components/data/readQuery/index.d.ts +1 -1
  23. package/lib/components/data/readQuery/index.d.ts.map +1 -1
  24. package/lib/components/data/readQuery/index.js.map +1 -1
  25. package/lib/components/data/updateModule.js +1 -1
  26. package/lib/components/data/updateModule.js.map +1 -1
  27. package/lib/components/display/mapView/routes.d.ts +14 -0
  28. package/lib/components/display/mapView/routes.d.ts.map +1 -1
  29. package/lib/components/display/mapView/routes.js +16 -1
  30. package/lib/components/display/mapView/routes.js.map +1 -1
  31. package/lib/components/display/newCalendar/index.d.ts +4 -0
  32. package/lib/components/display/newCalendar/index.d.ts.map +1 -1
  33. package/lib/components/display/newCalendar/index.js +166 -25
  34. package/lib/components/display/newCalendar/index.js.map +1 -1
  35. package/lib/components/display/newTable/index.d.ts.map +1 -1
  36. package/lib/components/display/newTable/index.js +151 -176
  37. package/lib/components/display/newTable/index.js.map +1 -1
  38. package/lib/components/display/newTable/labelPicker.d.ts +4 -3
  39. package/lib/components/display/newTable/labelPicker.d.ts.map +1 -1
  40. package/lib/components/display/newTable/labelPicker.js +6 -5
  41. package/lib/components/display/newTable/labelPicker.js.map +1 -1
  42. package/lib/components/display/newTable/tagLine.d.ts +1 -0
  43. package/lib/components/display/newTable/tagLine.d.ts.map +1 -1
  44. package/lib/components/display/newTable/tagLine.js +2 -2
  45. package/lib/components/display/newTable/tagLine.js.map +1 -1
  46. package/lib/components/display/tag/index.d.ts +3 -1
  47. package/lib/components/display/tag/index.d.ts.map +1 -1
  48. package/lib/components/display/tag/index.js +20 -4
  49. package/lib/components/display/tag/index.js.map +1 -1
  50. package/lib/components/display/tag/utils.d.ts +3 -0
  51. package/lib/components/display/tag/utils.d.ts.map +1 -1
  52. package/lib/components/display/tag/utils.js +21 -1
  53. package/lib/components/display/tag/utils.js.map +1 -1
  54. package/lib/components/input/datePicker/index.js +1 -1
  55. package/lib/components/input/datePicker/index.js.map +1 -1
  56. package/lib/components/input/select/index.d.ts.map +1 -1
  57. package/lib/components/input/select/index.js +3 -15
  58. package/lib/components/input/select/index.js.map +1 -1
  59. package/lib/components/input/utils.d.ts +1 -1
  60. package/lib/tail.css +1 -1
  61. package/package.json +1 -1
@@ -254,8 +254,14 @@ var handleCheckEmptyCardValue = function (value) {
254
254
  return false;
255
255
  };
256
256
  exports.handleCheckEmptyCardValue = handleCheckEmptyCardValue;
257
+ // INFO: rows a select-all update sends by id at most, and ids per delete
258
+ // request — both keep a request within what the server accepts
259
+ var SELECT_ALL_ID_CAP = 5000;
260
+ // INFO: the conditions a server's batch update reads the same way as a list
261
+ var BATCH_UPDATE_QUERY_TYPES = ["=", "!=", ">", "<", "in", "!in"];
262
+ var DELETE_ID_CHUNK = 1000;
257
263
  exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
258
- 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, _119, _120, _121, _122, _123, _124, _125;
264
+ 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, _119, _120, _121, _122, _123, _124, _125, _126, _127, _128, _129, _130;
259
265
  // INFO: every view draws a lookup as its source column's type, read-only, so
260
266
  // no type branch below meets "lookup"; rawProps.model keeps the lookups as
261
267
  // stored for the columns handed back to the host
@@ -274,7 +280,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
274
280
  // the list never refetching while the panel is open, which fails silently.
275
281
  // INFO: the panel cannot navigate its way out — handleNavigate("read") is
276
282
  // routed straight back into it — so expand-to-full-page is local state.
277
- var _126 = (0, react_1.useState)(false), drawerPageView = _126[0], setDrawerPageView = _126[1];
283
+ var _131 = (0, react_1.useState)(false), drawerPageView = _131[0], setDrawerPageView = _131[1];
278
284
  // INFO: the panel keeps rendering the record it was opened with rather than
279
285
  // live props. Without this, navigating back to the list would re-render the
280
286
  // still-mounted panel as a second list behind the overlay.
@@ -329,7 +335,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
329
335
  drawerFormEditedRef.current = false;
330
336
  }
331
337
  drawerOpenRef.current = isDrawerHost;
332
- var _127 = (0, react_1.useState)(false), drawerDiscardModal = _127[0], setDrawerDiscardModal = _127[1];
338
+ var _132 = (0, react_1.useState)(false), drawerDiscardModal = _132[0], setDrawerDiscardModal = _132[1];
333
339
  // INFO: leaving the record ends the escape, so the next row opened from the
334
340
  // list peeks in the panel again rather than inheriting a full page the user
335
341
  // asked for once. Saving a form on the full page lands on its read view, which
@@ -408,7 +414,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
408
414
  initialFilterReferenceDate: initialFilterReferenceDate,
409
415
  };
410
416
  };
411
- var _128 = intialiseDefaultFilterValues(), initialFilterSearch = _128.initialFilterSearch, initialFilterSearchParams = _128.initialFilterSearchParams, initialFilterSelection = _128.initialFilterSelection, initialFilterReference = _128.initialFilterReference, initialFilterReferenceDate = _128.initialFilterReferenceDate;
417
+ var _133 = intialiseDefaultFilterValues(), initialFilterSearch = _133.initialFilterSearch, initialFilterSearchParams = _133.initialFilterSearchParams, initialFilterSelection = _133.initialFilterSelection, initialFilterReference = _133.initialFilterReference, initialFilterReferenceDate = _133.initialFilterReferenceDate;
412
418
  // INFO: organise.initialSearch fills the Quick find box, which sends its
413
419
  // value under "search". Without that box (hideSearch, Firebase, or a
414
420
  // "search" query taking its place) there is nothing to fill
@@ -424,19 +430,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
424
430
  // keyword: All's columns and sort, no stored filters, and nothing this
425
431
  // person kept in the browser (view drafts, persistViewState) is read or
426
432
  // written — until they pick a view, which is their own choice again
427
- var _129 = (0, react_1.useState)(function () { var _a; return handleCanInitialSearch((_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery); }), isLinkOpen = _129[0], setIsLinkOpen = _129[1];
433
+ var _134 = (0, react_1.useState)(function () { var _a; return handleCanInitialSearch((_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery); }), isLinkOpen = _134[0], setIsLinkOpen = _134[1];
428
434
  var handleSeedInitialSearch = function (params) {
429
435
  var _a;
430
436
  return isLinkOpen && ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSearch)
431
437
  ? __assign(__assign({}, params), { search: props.organise.initialSearch }) : params;
432
438
  };
433
439
  // INFO: Persist view state hook — handles storage read/write for filter/sort/column state
434
- var _130 = (0, viewStatePersistence_1.usePersistedViewState)({
440
+ var _135 = (0, viewStatePersistence_1.usePersistedViewState)({
435
441
  mode: isLinkOpen ? undefined : (_k = props.organise) === null || _k === void 0 ? void 0 : _k.persistViewState,
436
442
  collectionId: props.collectionId,
437
443
  persistKey: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.persistKey,
438
444
  type: resolvedType,
439
- }), rawPersistedState = _130.persistedState, isPersistEnabled = _130.isEnabled, handleSaveView = _130.handleSaveView, handleRegisterViewSnapshot = _130.handleRegisterViewSnapshot;
445
+ }), rawPersistedState = _135.persistedState, isPersistEnabled = _135.isEnabled, handleSaveView = _135.handleSaveView, handleRegisterViewSnapshot = _135.handleRegisterViewSnapshot;
440
446
  // INFO: drop stored filters/sort on removed columns — they would empty the table
441
447
  var persistedState = (0, react_1.useMemo)(function () {
442
448
  var _a, _b, _c, _d;
@@ -452,8 +458,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
452
458
  (_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareFlexFilterListObjects,
453
459
  (_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareFlexFilterRelated,
454
460
  ]);
455
- var _131 = (0, react_1.useState)(false), loading = _131[0], setLoading = _131[1];
456
- var _132 = (0, react_1.useState)(), notification = _132[0], setNotification = _132[1];
461
+ var _136 = (0, react_1.useState)(false), loading = _136[0], setLoading = _136[1];
462
+ var _137 = (0, react_1.useState)(), notification = _137[0], setNotification = _137[1];
457
463
  // INFO: a success toast is confirmation, not a decision — it clears itself so
458
464
  // it never sits on the floating step bar; errors stay until dismissed
459
465
  (0, react_1.useEffect)(function () {
@@ -463,86 +469,93 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
463
469
  return function () { return clearTimeout(timer); };
464
470
  }, [notification]);
465
471
  //INFO : Used by List
466
- var _133 = (0, react_1.useState)(function () {
472
+ var _138 = (0, react_1.useState)(function () {
467
473
  var _a;
468
474
  return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearch);
469
- }), filterSearch = _133[0], setFilterSearch = _133[1];
470
- var _134 = (0, react_1.useState)(function () {
475
+ }), filterSearch = _138[0], setFilterSearch = _138[1];
476
+ var _139 = (0, react_1.useState)(function () {
471
477
  var _a;
472
478
  return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearchParams);
473
- }), filterSearchParams = _134[0], setFilterSearchParams = _134[1];
474
- var _135 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _q !== void 0 ? _q : initialFilterSelection), filterSelection = _135[0], setFilterSelection = _135[1];
475
- var _136 = (0, react_1.useState)((_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _r !== void 0 ? _r : initialFilterReference), filterReference = _136[0], setFilterReference = _136[1];
476
- var _137 = (0, react_1.useState)({}), filterReferenceSearch = _137[0], setFilterReferenceSearch = _137[1];
477
- var _138 = (0, react_1.useState)({}), filterReferenceList = _138[0], setFilterReferenceList = _138[1];
478
- var _139 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
479
+ }), filterSearchParams = _139[0], setFilterSearchParams = _139[1];
480
+ var _140 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _q !== void 0 ? _q : initialFilterSelection), filterSelection = _140[0], setFilterSelection = _140[1];
481
+ var _141 = (0, react_1.useState)((_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _r !== void 0 ? _r : initialFilterReference), filterReference = _141[0], setFilterReference = _141[1];
482
+ var _142 = (0, react_1.useState)({}), filterReferenceSearch = _142[0], setFilterReferenceSearch = _142[1];
483
+ var _143 = (0, react_1.useState)({}), filterReferenceList = _143[0], setFilterReferenceList = _143[1];
484
+ var _144 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
479
485
  ? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
480
- : initialFilterReferenceDate), filterReferenceDate = _139[0], setFilterReferenceDate = _139[1];
481
- var _140 = (0, react_1.useState)(true), tableLoading = _140[0], setTableLoading = _140[1];
482
- var _141 = (0, react_1.useState)(""), cursor = _141[0], setCursor = _141[1];
483
- var _142 = (0, react_1.useState)(""), lastCursor = _142[0], setLastCursor = _142[1];
484
- var _143 = (0, react_1.useState)([]), tableData = _143[0], setTableData = _143[1];
485
- var _144 = (0, react_1.useState)([]), spaceTableData = _144[0], setSpaceTableData = _144[1];
486
+ : initialFilterReferenceDate), filterReferenceDate = _144[0], setFilterReferenceDate = _144[1];
487
+ var _145 = (0, react_1.useState)(true), tableLoading = _145[0], setTableLoading = _145[1];
488
+ var _146 = (0, react_1.useState)(""), cursor = _146[0], setCursor = _146[1];
489
+ var _147 = (0, react_1.useState)(""), lastCursor = _147[0], setLastCursor = _147[1];
490
+ var _148 = (0, react_1.useState)([]), tableData = _148[0], setTableData = _148[1];
491
+ var _149 = (0, react_1.useState)([]), spaceTableData = _149[0], setSpaceTableData = _149[1];
486
492
  // INFO: a save resolves after later renders, so it reads the table from here —
487
493
  // the state it closed over can predate an earlier save on the same row
488
494
  var tableDataRef = (0, react_1.useRef)([]);
489
495
  var spaceTableDataRef = (0, react_1.useRef)([]);
490
496
  tableDataRef.current = tableData;
491
497
  spaceTableDataRef.current = spaceTableData;
492
- var _145 = (0, react_1.useState)(0), size = _145[0], setSize = _145[1];
493
- var _146 = (0, react_1.useState)((_u = (_s = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _s !== void 0 ? _s : (_t = props.organise) === null || _t === void 0 ? void 0 : _t.pageIndex) !== null && _u !== void 0 ? _u : 0), pageIndex = _146[0], setPageIndex = _146[1];
498
+ var _150 = (0, react_1.useState)(0), size = _150[0], setSize = _150[1];
499
+ var _151 = (0, react_1.useState)((_u = (_s = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _s !== void 0 ? _s : (_t = props.organise) === null || _t === void 0 ? void 0 : _t.pageIndex) !== null && _u !== void 0 ? _u : 0), pageIndex = _151[0], setPageIndex = _151[1];
494
500
  // INFO: every change of page, including the return to the first page when a
495
501
  // filter or search changes, which onChangePagination does not always report
496
502
  (0, react_1.useEffect)(function () {
497
503
  var _a, _b;
498
504
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePageIndex) === null || _b === void 0 ? void 0 : _b.call(_a, pageIndex);
499
505
  }, [pageIndex]);
500
- var _147 = (0, react_1.useState)([]), selectedIds = _147[0], setSelectedIds = _147[1];
501
- var _148 = (0, react_1.useState)(false), selectAll = _148[0], setSelectAll = _148[1];
502
- var _149 = (0, react_1.useState)(""), deletePasscode = _149[0], setDeletePasscode = _149[1];
503
- var _150 = (0, react_1.useState)(""), deletePasscodeInput = _150[0], setDeletePasscodeInput = _150[1];
504
- var _151 = (0, react_1.useState)(""), deleteFeedId = _151[0], setDeleteFeedId = _151[1];
506
+ var _152 = (0, react_1.useState)([]), selectedIds = _152[0], setSelectedIds = _152[1];
507
+ var _153 = (0, react_1.useState)(false), selectAll = _153[0], setSelectAll = _153[1];
508
+ var _154 = (0, react_1.useState)(""), deletePasscode = _154[0], setDeletePasscode = _154[1];
509
+ var _155 = (0, react_1.useState)(""), deletePasscodeInput = _155[0], setDeletePasscodeInput = _155[1];
510
+ var _156 = (0, react_1.useState)(""), deleteFeedId = _156[0], setDeleteFeedId = _156[1];
505
511
  //INFO : Used by List Organise
506
512
  // INFO: Internal sort state that overrides props.organise?.sort when
507
513
  // persistViewState is enabled and a persisted sort exists
508
- var _152 = (0, react_1.useState)((_v = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _v !== void 0 ? _v : undefined), persistedSort = _152[0], setPersistedSort = _152[1];
509
- var _153 = (0, react_1.useState)(false), filterDraft = _153[0], setFilterDraft = _153[1];
510
- var _154 = (0, react_1.useState)(false), addTabModal = _154[0], setAddTabModal = _154[1];
511
- var _155 = (0, react_1.useState)(-1), editTabIndex = _155[0], setEditTabIndex = _155[1];
514
+ var _157 = (0, react_1.useState)((_v = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _v !== void 0 ? _v : undefined), persistedSort = _157[0], setPersistedSort = _157[1];
515
+ var _158 = (0, react_1.useState)(false), filterDraft = _158[0], setFilterDraft = _158[1];
516
+ var _159 = (0, react_1.useState)(false), addTabModal = _159[0], setAddTabModal = _159[1];
517
+ var _160 = (0, react_1.useState)(-1), editTabIndex = _160[0], setEditTabIndex = _160[1];
512
518
  //INFO : resolve the initial tab synchronously so the mount cond is already
513
519
  // tab-scoped — an empty initial tab caused a second wasted list fetch
514
- var _156 = (0, react_1.useState)(function () {
520
+ var _161 = (0, react_1.useState)(function () {
515
521
  var _a;
516
522
  return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, listViewId);
517
- }), selectedTab = _156[0], setSelectedTab = _156[1];
518
- var _157 = (0, react_1.useState)("dayGridMonth"), calendarView = _157[0], setCalendarView = _157[1];
523
+ }), selectedTab = _161[0], setSelectedTab = _161[1];
524
+ var _162 = (0, react_1.useState)("dayGridMonth"), calendarView = _162[0], setCalendarView = _162[1];
519
525
  // INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
520
526
  // (calendarView above drives the matching range query)
521
- var _158 = (0, react_1.useState)("month"), newCalendarViewMode = _158[0], setNewCalendarViewMode = _158[1];
522
- var _159 = (0, react_1.useState)(new Date()), calendarTabMonth = _159[0], setCalendarTabMonth = _159[1];
527
+ var _163 = (0, react_1.useState)("month"), newCalendarViewMode = _163[0], setNewCalendarViewMode = _163[1];
528
+ var _164 = (0, react_1.useState)(new Date()), calendarTabMonth = _164[0], setCalendarTabMonth = _164[1];
529
+ // INFO: read once per theme — it asks the browser to resolve a style
530
+ var timelinePrimaryColour = (0, react_1.useMemo)(function () { return (0, timelineBars_1.handleReadPrimaryColour)(); },
531
+ /* eslint-disable-next-line */
532
+ [(_w = props.organise) === null || _w === void 0 ? void 0 : _w.darkMode]);
533
+ // INFO: the period a timeline shows — it reads only the records whose bars
534
+ // overlap it, so a large datasheet loads one month or quarter at a time
535
+ var _165 = (0, react_1.useState)({ unit: "month", anchor: new Date() }), timelineRange = _165[0], setTimelineRange = _165[1];
523
536
  // INFO: defaultViewSwitch picks the opening view only — the tab re-inits
524
537
  // whenever its settings change, and that must not undo the user's switch
525
538
  var calendarViewInitRef = (0, react_1.useRef)(false);
526
- var _160 = (0, react_1.useState)(true), kanbanDroppable = _160[0], setKanbanDroppable = _160[1];
527
- var _161 = (0, react_1.useState)([]), kanbanOptions = _161[0], setKanbanOptions = _161[1];
528
- var _162 = (0, react_1.useState)(false), batchUpdateModal = _162[0], setBatchUpdateModal = _162[1];
529
- var _163 = (0, react_1.useState)({
539
+ var _166 = (0, react_1.useState)(true), kanbanDroppable = _166[0], setKanbanDroppable = _166[1];
540
+ var _167 = (0, react_1.useState)([]), kanbanOptions = _167[0], setKanbanOptions = _167[1];
541
+ var _168 = (0, react_1.useState)(false), batchUpdateModal = _168[0], setBatchUpdateModal = _168[1];
542
+ var _169 = (0, react_1.useState)({
530
543
  columnId: "",
531
544
  columnData: {},
532
- }), batchUpdateData = _163[0], setBatchUpdateData = _163[1];
545
+ }), batchUpdateData = _169[0], setBatchUpdateData = _169[1];
533
546
  // INFO: system columns (created / updated at and by, record id, number)
534
547
  // join the structure hidden; the ones a user shows are kept per view
535
- var isSystemColumnsEnabled = !!((_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareSystemColumns);
536
- var isSystemColumnsLocked = !!((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareSystemColumnsLocked);
548
+ var isSystemColumnsEnabled = !!((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareSystemColumns);
549
+ var isSystemColumnsLocked = !!((_y = props.bareSettings) === null || _y === void 0 ? void 0 : _y.bareSystemColumnsLocked);
537
550
  var appendedSystemColumnIds = isSystemColumnsEnabled
538
551
  ? 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; }); })
539
552
  : [];
540
- var _164 = (0, react_1.useState)((_y = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _y !== void 0 ? _y : []), shownSystemColumnIds = _164[0], setShownSystemColumnIds = _164[1];
553
+ var _170 = (0, react_1.useState)((_z = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _z !== void 0 ? _z : []), shownSystemColumnIds = _170[0], setShownSystemColumnIds = _170[1];
541
554
  var handleWithSystemColumns = function (model, shownIds) {
542
555
  if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
543
556
  return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
544
557
  };
545
- var _165 = (0, react_1.useState)(function () {
558
+ var _171 = (0, react_1.useState)(function () {
546
559
  var _a;
547
560
  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 : []);
548
561
  if (!persistedState)
@@ -569,8 +582,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
569
582
  });
570
583
  }
571
584
  return model;
572
- }), structure = _165[0], setStructure = _165[1];
573
- var _166 = (0, react_1.useState)(((_z = props === null || props === void 0 ? void 0 : props.organise) === null || _z === void 0 ? void 0 : _z.additionalQuery) || []), additionalQuery = _166[0], setAdditionalQuery = _166[1];
585
+ }), structure = _171[0], setStructure = _171[1];
586
+ var _172 = (0, react_1.useState)(((_0 = props === null || props === void 0 ? void 0 : props.organise) === null || _0 === void 0 ? void 0 : _0.additionalQuery) || []), additionalQuery = _172[0], setAdditionalQuery = _172[1];
574
587
  // INFO: State for user-configurable flex filters (Monday.com-style)
575
588
  // INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
576
589
  var defaultFlexFilterRow = [
@@ -582,13 +595,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
582
595
  },
583
596
  ];
584
597
  // INFO: rows the host opens the list with come before a saved view's
585
- var initialFlexFilterRows = ((_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.initialFlexFilters) &&
598
+ var initialFlexFilterRows = ((_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.initialFlexFilters) &&
586
599
  props.organise.initialFlexFilters.length > 0
587
600
  ? props.organise.initialFlexFilters
588
601
  : (persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
589
602
  ? persistedState.flexFilters
590
603
  : defaultFlexFilterRow;
591
- var _167 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _167[0], setFlexFilters = _167[1];
604
+ var _173 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _173[0], setFlexFilters = _173[1];
592
605
  // INFO: always-current mirror of flexFilters, read by the imperative apply/
593
606
  // clear methods so chained calls in one tick aren't stale.
594
607
  var flexFiltersRef = (0, react_1.useRef)(flexFilters);
@@ -601,111 +614,111 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
601
614
  }, [flexFilters]);
602
615
  // INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
603
616
  // to prevent API calls on every keystroke when typing in value inputs
604
- var _168 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _168[0], setFlexFiltersDebounced = _168[1];
617
+ var _174 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _174[0], setFlexFiltersDebounced = _174[1];
605
618
  // INFO: the filter rows of the export being set up — started from the
606
619
  // list's own when the export opens, so changing them leaves the list as it is
607
- var _169 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _169[0], setExportFlexFilters = _169[1];
608
- var _170 = (0, react_1.useState)({}), flexFilterReferenceOptions = _170[0], setFlexFilterReferenceOptions = _170[1];
609
- var _171 = (0, react_1.useState)({}), flexFilterReferenceSearch = _171[0], setFlexFilterReferenceSearch = _171[1];
610
- var _172 = (0, react_1.useState)(false), flexFilterModalOpen = _172[0], setFlexFilterModalOpen = _172[1];
611
- var _173 = (0, react_1.useState)(false), viewSettingsModalOpen = _173[0], setViewSettingsModalOpen = _173[1];
620
+ var _175 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _175[0], setExportFlexFilters = _175[1];
621
+ var _176 = (0, react_1.useState)({}), flexFilterReferenceOptions = _176[0], setFlexFilterReferenceOptions = _176[1];
622
+ var _177 = (0, react_1.useState)({}), flexFilterReferenceSearch = _177[0], setFlexFilterReferenceSearch = _177[1];
623
+ var _178 = (0, react_1.useState)(false), flexFilterModalOpen = _178[0], setFlexFilterModalOpen = _178[1];
624
+ var _179 = (0, react_1.useState)(false), viewSettingsModalOpen = _179[0], setViewSettingsModalOpen = _179[1];
612
625
  // INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
613
626
  // Deliberately kept out of `structure`: the props-sync effect below resets
614
627
  // structure to props.model whenever props change, which would wipe the
615
628
  // choice, and the persist effect derives schema-level hiddenColumnIds from
616
629
  // structure — writing user hides there would blur the two concepts.
617
- var _174 = (0, react_1.useState)((_1 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _1 !== void 0 ? _1 : []), userHiddenColumnIds = _174[0], setUserHiddenColumnIds = _174[1];
618
- var _175 = (0, react_1.useState)(""), columnSearch = _175[0], setColumnSearch = _175[1];
619
- var _176 = (0, react_1.useState)([]), savedViews = _176[0], setSavedViews = _176[1];
620
- var _177 = (0, react_1.useState)(null), activeSavedViewId = _177[0], setActiveSavedViewId = _177[1];
630
+ var _180 = (0, react_1.useState)((_2 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _2 !== void 0 ? _2 : []), userHiddenColumnIds = _180[0], setUserHiddenColumnIds = _180[1];
631
+ var _181 = (0, react_1.useState)(""), columnSearch = _181[0], setColumnSearch = _181[1];
632
+ var _182 = (0, react_1.useState)([]), savedViews = _182[0], setSavedViews = _182[1];
633
+ var _183 = (0, react_1.useState)(null), activeSavedViewId = _183[0], setActiveSavedViewId = _183[1];
621
634
  // INFO: the widths of the view on screen, by column id ("180px")
622
- var _178 = (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 = _178[0], setColumnWidths = _178[1];
635
+ var _184 = (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 = _184[0], setColumnWidths = _184[1];
623
636
  // INFO: the kanban lane widths of the view on screen, by lane id ("300px")
624
- var _179 = (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.laneWidths) !== null && _c !== void 0 ? _c : {}; }), laneWidths = _179[0], setLaneWidths = _179[1];
637
+ var _185 = (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.laneWidths) !== null && _c !== void 0 ? _c : {}; }), laneWidths = _185[0], setLaneWidths = _185[1];
625
638
  // INFO: the read drawer's dragged width ("520px"), kept in the view with the
626
639
  // column widths. A restored persistViewState wins over All's, as a saved
627
640
  // view or draft applied at opening replaces both
628
- var _180 = (0, react_1.useState)(function () {
641
+ var _186 = (0, react_1.useState)(function () {
629
642
  var _a, _b, _c;
630
643
  return (_a = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.drawerWidth : undefined)) !== null && _a !== void 0 ? _a : (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.allView) === null || _c === void 0 ? void 0 : _c.drawerWidth;
631
- }), drawerWidth = _180[0], setDrawerWidth = _180[1];
644
+ }), drawerWidth = _186[0], setDrawerWidth = _186[1];
632
645
  // INFO: the columns the view on screen freezes at the left edge
633
- var _181 = (0, react_1.useState)(function () { var _a, _b; return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) === null || _b === void 0 ? void 0 : _b.pinnedColumnIds; }), pinnedColumnIds = _181[0], setPinnedColumnIds = _181[1];
646
+ var _187 = (0, react_1.useState)(function () { var _a, _b; return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) === null || _b === void 0 ? void 0 : _b.pinnedColumnIds; }), pinnedColumnIds = _187[0], setPinnedColumnIds = _187[1];
634
647
  // INFO: unsaved changes are kept only once the opening view is on screen,
635
648
  // so the defaults drawn before it never overwrite a person's own
636
- var _182 = (0, react_1.useState)(false), isViewDraftReady = _182[0], setIsViewDraftReady = _182[1];
649
+ var _188 = (0, react_1.useState)(false), isViewDraftReady = _188[0], setIsViewDraftReady = _188[1];
637
650
  // INFO: null while the name box is closed
638
- var _183 = (0, react_1.useState)(null), savedViewName = _183[0], setSavedViewName = _183[1];
639
- var _184 = (0, react_1.useState)(null), deletingSavedViewId = _184[0], setDeletingSavedViewId = _184[1];
651
+ var _189 = (0, react_1.useState)(null), savedViewName = _189[0], setSavedViewName = _189[1];
652
+ var _190 = (0, react_1.useState)(null), deletingSavedViewId = _190[0], setDeletingSavedViewId = _190[1];
640
653
  // INFO: the view chip being dragged, to drop it in another place
641
- var _185 = (0, react_1.useState)(null), draggingSavedViewId = _185[0], setDraggingSavedViewId = _185[1];
654
+ var _191 = (0, react_1.useState)(null), draggingSavedViewId = _191[0], setDraggingSavedViewId = _191[1];
642
655
  // INFO: the tab strip in the order a drag has reached, saved once on drop
643
- var _186 = (0, react_1.useState)(null), draggedTabs = _186[0], setDraggedTabs = _186[1];
644
- var _187 = (0, react_1.useState)(null), renamingSavedView = _187[0], setRenamingSavedView = _187[1];
645
- var _188 = (0, react_1.useState)(false), isSavedViewsExpanded = _188[0], setIsSavedViewsExpanded = _188[1];
646
- var _189 = (0, react_1.useState)(null), draggingColumnId = _189[0], setDraggingColumnId = _189[1];
656
+ var _192 = (0, react_1.useState)(null), draggedTabs = _192[0], setDraggedTabs = _192[1];
657
+ var _193 = (0, react_1.useState)(null), renamingSavedView = _193[0], setRenamingSavedView = _193[1];
658
+ var _194 = (0, react_1.useState)(false), isSavedViewsExpanded = _194[0], setIsSavedViewsExpanded = _194[1];
659
+ var _195 = (0, react_1.useState)(null), draggingColumnId = _195[0], setDraggingColumnId = _195[1];
647
660
  var columnRowRefs = (0, react_1.useRef)({});
648
661
  //INFO : Used by Auth
649
- var _190 = (0, react_1.useState)({
662
+ var _196 = (0, react_1.useState)({
650
663
  email: "",
651
664
  google: "",
652
665
  phone: "",
653
666
  disabled: false,
654
667
  create: false,
655
- }), authMethods = _190[0], setAuthMethods = _190[1];
656
- var _191 = (0, react_1.useState)(""), selectedAuthMethod = _191[0], setSelectedAuthMethod = _191[1];
668
+ }), authMethods = _196[0], setAuthMethods = _196[1];
669
+ var _197 = (0, react_1.useState)(""), selectedAuthMethod = _197[0], setSelectedAuthMethod = _197[1];
657
670
  // INFO: the sign-in check of a users datasheet's record is running; the
658
671
  // panel shows a spinner rather than nothing, which read as "no login"
659
- var _192 = (0, react_1.useState)(false), authLoading = _192[0], setAuthLoading = _192[1];
672
+ var _198 = (0, react_1.useState)(false), authLoading = _198[0], setAuthLoading = _198[1];
660
673
  // INFO: a delete is running — the ref answers a second tap at once, before
661
674
  // the state has rendered, and the state disables the confirm button
662
675
  var deletingRef = (0, react_1.useRef)(false);
663
- var _193 = (0, react_1.useState)(false), deleting = _193[0], setDeleting = _193[1];
676
+ var _199 = (0, react_1.useState)(false), deleting = _199[0], setDeleting = _199[1];
664
677
  // INFO: Used by Activity Log
665
- var _194 = (0, react_1.useState)(false), activityModal = _194[0], setActivityModal = _194[1];
666
- var _195 = (0, react_1.useState)(""), activityId = _195[0], setActivityId = _195[1];
678
+ var _200 = (0, react_1.useState)(false), activityModal = _200[0], setActivityModal = _200[1];
679
+ var _201 = (0, react_1.useState)(""), activityId = _201[0], setActivityId = _201[1];
667
680
  //INFO : Used by Export
668
- var _196 = (0, react_1.useState)(null), csvFile = _196[0], setCSVFile = _196[1];
669
- var _197 = (0, react_1.useState)([]), csvFileData = _197[0], setCSVFileData = _197[1];
670
- var _198 = (0, react_1.useState)(0), stepCSVIndex = _198[0], setStepCSVIndex = _198[1];
671
- var _199 = (0, react_1.useState)({}), listCSVMapAttribute = _199[0], setListCSVMapAttribute = _199[1];
672
- var _200 = (0, react_1.useState)({}), listCSVObjAttribute = _200[0], setListCSVObjAttribute = _200[1];
673
- var _201 = (0, react_1.useState)([]), csvAPIAttribute = _201[0], setCSVAPIAttribute = _201[1];
674
- var _202 = (0, react_1.useState)(((_2 = props.devSettings.currentUser) === null || _2 === void 0 ? void 0 : _2.userEmail) || ""), exportCSVEmail = _202[0], setExportCSVEmail = _202[1];
675
- var _203 = (0, react_1.useState)(((_4 = (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.exportSettings) === null || _4 === void 0 ? void 0 : _4.defaultExportPDFName) || ""), exportPDFTitle = _203[0], setExportPDFTitle = _203[1];
676
- var _204 = (0, react_1.useState)(false), exportPDFLoading = _204[0], setExportPDFLoading = _204[1];
677
- var _205 = (0, react_1.useState)(false), exportReadPDFLoading = _205[0], setExportReadPDFLoading = _205[1];
678
- var _206 = (0, react_1.useState)((_7 = (_6 = (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.exportSettings) === null || _6 === void 0 ? void 0 : _6.sumColumnId) !== null && _7 !== void 0 ? _7 : []), exportSumAttributeIds = _206[0], setExportSumAttributeIds = _206[1];
679
- var _207 = (0, react_1.useState)((_10 = (_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.exportSettings) === null || _9 === void 0 ? void 0 : _9.hideSubItems) !== null && _10 !== void 0 ? _10 : false), hideSubItems = _207[0], setHideSubItems = _207[1];
680
- var _208 = (0, react_1.useState)([]), importTableData = _208[0], setImportTableData = _208[1];
681
- var _209 = (0, react_1.useState)([]), queryList = _209[0], setQueryList = _209[1];
682
- var _210 = (0, react_1.useState)(undefined), allQueryList = _210[0], setAllQueryList = _210[1];
681
+ var _202 = (0, react_1.useState)(null), csvFile = _202[0], setCSVFile = _202[1];
682
+ var _203 = (0, react_1.useState)([]), csvFileData = _203[0], setCSVFileData = _203[1];
683
+ var _204 = (0, react_1.useState)(0), stepCSVIndex = _204[0], setStepCSVIndex = _204[1];
684
+ var _205 = (0, react_1.useState)({}), listCSVMapAttribute = _205[0], setListCSVMapAttribute = _205[1];
685
+ var _206 = (0, react_1.useState)({}), listCSVObjAttribute = _206[0], setListCSVObjAttribute = _206[1];
686
+ var _207 = (0, react_1.useState)([]), csvAPIAttribute = _207[0], setCSVAPIAttribute = _207[1];
687
+ var _208 = (0, react_1.useState)(((_3 = props.devSettings.currentUser) === null || _3 === void 0 ? void 0 : _3.userEmail) || ""), exportCSVEmail = _208[0], setExportCSVEmail = _208[1];
688
+ var _209 = (0, react_1.useState)(((_5 = (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.exportSettings) === null || _5 === void 0 ? void 0 : _5.defaultExportPDFName) || ""), exportPDFTitle = _209[0], setExportPDFTitle = _209[1];
689
+ var _210 = (0, react_1.useState)(false), exportPDFLoading = _210[0], setExportPDFLoading = _210[1];
690
+ var _211 = (0, react_1.useState)(false), exportReadPDFLoading = _211[0], setExportReadPDFLoading = _211[1];
691
+ var _212 = (0, react_1.useState)((_8 = (_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.exportSettings) === null || _7 === void 0 ? void 0 : _7.sumColumnId) !== null && _8 !== void 0 ? _8 : []), exportSumAttributeIds = _212[0], setExportSumAttributeIds = _212[1];
692
+ var _213 = (0, react_1.useState)((_11 = (_10 = (_9 = props.organise) === null || _9 === void 0 ? void 0 : _9.exportSettings) === null || _10 === void 0 ? void 0 : _10.hideSubItems) !== null && _11 !== void 0 ? _11 : false), hideSubItems = _213[0], setHideSubItems = _213[1];
693
+ var _214 = (0, react_1.useState)([]), importTableData = _214[0], setImportTableData = _214[1];
694
+ var _215 = (0, react_1.useState)([]), queryList = _215[0], setQueryList = _215[1];
695
+ var _216 = (0, react_1.useState)(undefined), allQueryList = _216[0], setAllQueryList = _216[1];
683
696
  // INFO: a restored state wins over the prop; its "" is a list the user
684
697
  // ungrouped, so it opens ungrouped
685
- var _211 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
698
+ var _217 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
686
699
  ? persistedState.groupBy || undefined
687
- : (_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.groupBy), groupId = _211[0], setGroupId = _211[1];
700
+ : (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.groupBy), groupId = _217[0], setGroupId = _217[1];
688
701
  // INFO: each group's total per number column, keyed by section id
689
- var _212 = (0, react_1.useState)({}), groupSummaries = _212[0], setGroupSummaries = _212[1];
702
+ var _218 = (0, react_1.useState)({}), groupSummaries = _218[0], setGroupSummaries = _218[1];
690
703
  // INFO: each group's row count over every row the filters match; null until
691
704
  // read. A band paged alone shows it until its own first page lands, and a
692
705
  // band it counts empty is left out instead of waiting to be read
693
- var _213 = (0, react_1.useState)(null), groupTotals = _213[0], setGroupTotals = _213[1];
706
+ var _219 = (0, react_1.useState)(null), groupTotals = _219[0], setGroupTotals = _219[1];
694
707
  // INFO: the last read of groupTotals failed, so bands fall back to the rows
695
708
  // loaded instead of waiting on a total that is not coming
696
- var _214 = (0, react_1.useState)(false), groupTotalsFailed = _214[0], setGroupTotalsFailed = _214[1];
709
+ var _220 = (0, react_1.useState)(false), groupTotalsFailed = _220[0], setGroupTotalsFailed = _220[1];
697
710
  var groupSummaryRequestRef = (0, react_1.useRef)(0);
698
711
  // INFO: the grouped count waiting to go out, so a filter change can stop it
699
712
  // before it sends the filters it was scheduled with
700
713
  var groupSummaryTimerRef = (0, react_1.useRef)(null);
701
- var _215 = (0, react_1.useState)({}), commentCounts = _215[0], setCommentCounts = _215[1];
702
- var _216 = (0, react_1.useState)({}), commentUnread = _216[0], setCommentUnread = _216[1];
714
+ var _221 = (0, react_1.useState)({}), commentCounts = _221[0], setCommentCounts = _221[1];
715
+ var _222 = (0, react_1.useState)({}), commentUnread = _222[0], setCommentUnread = _222[1];
703
716
  // INFO: Monday-board per-group paging. Keyed by the group key that
704
717
  // handleBuildNewTableGroups() produces (an option, Unknown or No Value).
705
718
  // Each group tracks its own loaded cursor + total so it can lazily load its
706
719
  // next page as the user scrolls inside that band, independent of every other
707
720
  // group. Only used when renderCheckGroupPaging() is true.
708
- var _217 = (0, react_1.useState)({}), groupPageState = _217[0], setGroupPageState = _217[1];
721
+ var _223 = (0, react_1.useState)({}), groupPageState = _223[0], setGroupPageState = _223[1];
709
722
  // INFO: read fresh inside the async per-group fetch so chained scroll fires
710
723
  // in one tick do not re-fetch an already in-flight page.
711
724
  var groupPageStateRef = (0, react_1.useRef)({});
@@ -720,62 +733,62 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
720
733
  var groupLoadingKeyRef = (0, react_1.useRef)(null);
721
734
  var groupLoadQueueRef = (0, react_1.useRef)([]);
722
735
  var handleFetchGroupNextPageRef = (0, react_1.useRef)(function () { });
723
- var _218 = (0, react_1.useState)(""), readTabSection = _218[0], setReadTabSection = _218[1];
724
- var _219 = (0, react_1.useState)(false), readFloatingNav = _219[0], setReadFloatingNav = _219[1];
736
+ var _224 = (0, react_1.useState)(""), readTabSection = _224[0], setReadTabSection = _224[1];
737
+ var _225 = (0, react_1.useState)(false), readFloatingNav = _225[0], setReadFloatingNav = _225[1];
725
738
  var readTabSectionRefs = (0, react_1.useRef)({});
726
739
  //INFO : Used by Read
727
740
  //INFO : Used by Update
728
- var _220 = (0, react_1.useState)(false), modalVisible = _220[0], setModalVisible = _220[1];
729
- var _221 = (0, react_1.useState)(false), deleteModal = _221[0], setDeleteModal = _221[1];
730
- var _222 = (0, react_1.useState)(false), excelModal = _222[0], setExcelModal = _222[1];
731
- var _223 = (0, react_1.useState)(false), exportExcel = _223[0], setExportExcel = _223[1];
732
- var _224 = (0, react_1.useState)(""), exportType = _224[0], setExportType = _224[1];
733
- var _225 = (0, react_1.useState)(false), exportQR = _225[0], setExportQR = _225[1];
734
- var _226 = (0, react_1.useState)(function () {
741
+ var _226 = (0, react_1.useState)(false), modalVisible = _226[0], setModalVisible = _226[1];
742
+ var _227 = (0, react_1.useState)(false), deleteModal = _227[0], setDeleteModal = _227[1];
743
+ var _228 = (0, react_1.useState)(false), excelModal = _228[0], setExcelModal = _228[1];
744
+ var _229 = (0, react_1.useState)(false), exportExcel = _229[0], setExportExcel = _229[1];
745
+ var _230 = (0, react_1.useState)(""), exportType = _230[0], setExportType = _230[1];
746
+ var _231 = (0, react_1.useState)(false), exportQR = _231[0], setExportQR = _231[1];
747
+ var _232 = (0, react_1.useState)(function () {
735
748
  var _a, _b;
736
749
  var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
737
750
  return firstTabId;
738
- }), activeTab = _226[0], setActiveTab = _226[1];
739
- var _227 = (0, react_1.useState)(false), signatureSigning = _227[0], setSignatureSigning = _227[1];
740
- var _228 = (0, react_1.useState)({}), selectedData = _228[0], setSelectedData = _228[1];
741
- var _229 = (0, react_1.useState)(""), selectedObjectStructureId = _229[0], setSelectedObjectStructureId = _229[1];
742
- var _230 = (0, react_1.useState)(""), selectedObjectId = _230[0], setSelectedObjectId = _230[1];
743
- var _231 = (0, react_1.useState)(""), selectedListAddressId = _231[0], setSelectedListAddressId = _231[1];
744
- var _232 = (0, react_1.useState)(-1), selectedListAddressIndex = _232[0], setSelectedListAddressIndex = _232[1];
745
- var _233 = (0, react_1.useState)({
751
+ }), activeTab = _232[0], setActiveTab = _232[1];
752
+ var _233 = (0, react_1.useState)(false), signatureSigning = _233[0], setSignatureSigning = _233[1];
753
+ var _234 = (0, react_1.useState)({}), selectedData = _234[0], setSelectedData = _234[1];
754
+ var _235 = (0, react_1.useState)(""), selectedObjectStructureId = _235[0], setSelectedObjectStructureId = _235[1];
755
+ var _236 = (0, react_1.useState)(""), selectedObjectId = _236[0], setSelectedObjectId = _236[1];
756
+ var _237 = (0, react_1.useState)(""), selectedListAddressId = _237[0], setSelectedListAddressId = _237[1];
757
+ var _238 = (0, react_1.useState)(-1), selectedListAddressIndex = _238[0], setSelectedListAddressIndex = _238[1];
758
+ var _239 = (0, react_1.useState)({
746
759
  lat: 0,
747
760
  lng: 0,
748
761
  name: "",
749
- }), selectedListAddress = _233[0], setSelectedListAddress = _233[1];
750
- var _234 = (0, react_1.useState)({}), selectedObjectData = _234[0], setSelectedObjectData = _234[1];
751
- var _235 = (0, react_1.useState)(null), objectCellEdit = _235[0], setObjectCellEdit = _235[1];
752
- var _236 = (0, react_1.useState)(false), referenceLoading = _236[0], setReferenceLoading = _236[1];
753
- var _237 = (0, react_1.useState)({}), referencesOptions = _237[0], setReferencesOptions = _237[1];
754
- var _238 = (0, react_1.useState)({}), referencesDetails = _238[0], setReferencesDetails = _238[1];
755
- var _239 = (0, react_1.useState)({}), listReferencesOptions = _239[0], setListReferencesOptions = _239[1];
762
+ }), selectedListAddress = _239[0], setSelectedListAddress = _239[1];
763
+ var _240 = (0, react_1.useState)({}), selectedObjectData = _240[0], setSelectedObjectData = _240[1];
764
+ var _241 = (0, react_1.useState)(null), objectCellEdit = _241[0], setObjectCellEdit = _241[1];
765
+ var _242 = (0, react_1.useState)(false), referenceLoading = _242[0], setReferenceLoading = _242[1];
766
+ var _243 = (0, react_1.useState)({}), referencesOptions = _243[0], setReferencesOptions = _243[1];
767
+ var _244 = (0, react_1.useState)({}), referencesDetails = _244[0], setReferencesDetails = _244[1];
768
+ var _245 = (0, react_1.useState)({}), listReferencesOptions = _245[0], setListReferencesOptions = _245[1];
756
769
  // INFO: the referenced records themselves, for a table cell that picks from
757
770
  // a list on one (referenceSelection)
758
- var _240 = (0, react_1.useState)({}), listReferencesDetails = _240[0], setListReferencesDetails = _240[1];
759
- var _241 = (0, react_1.useState)({}), referenceDeleteTableData = _241[0], setReferenceDeleteTableData = _241[1];
760
- var _242 = (0, react_1.useState)([]), relatedSections = _242[0], setRelatedSections = _242[1];
761
- var _243 = (0, react_1.useState)(0), referenceDeleteIndex = _243[0], setReferenceDeleteIndex = _243[1];
762
- var _244 = (0, react_1.useState)({
771
+ var _246 = (0, react_1.useState)({}), listReferencesDetails = _246[0], setListReferencesDetails = _246[1];
772
+ var _247 = (0, react_1.useState)({}), referenceDeleteTableData = _247[0], setReferenceDeleteTableData = _247[1];
773
+ var _248 = (0, react_1.useState)([]), relatedSections = _248[0], setRelatedSections = _248[1];
774
+ var _249 = (0, react_1.useState)(0), referenceDeleteIndex = _249[0], setReferenceDeleteIndex = _249[1];
775
+ var _250 = (0, react_1.useState)({
763
776
  id: "",
764
777
  name: "",
765
778
  type: "string",
766
- }), referenceCreationModal = _244[0], setReferenceCreationModal = _244[1];
767
- var _245 = (0, react_1.useState)({}), referenceModelSchema = _245[0], setReferenceSchema = _245[1];
768
- var _246 = (0, react_1.useState)([]), kanbanChecked = _246[0], setKanbanChecked = _246[1];
779
+ }), referenceCreationModal = _250[0], setReferenceCreationModal = _250[1];
780
+ var _251 = (0, react_1.useState)({}), referenceModelSchema = _251[0], setReferenceSchema = _251[1];
781
+ var _252 = (0, react_1.useState)([]), kanbanChecked = _252[0], setKanbanChecked = _252[1];
769
782
  //INFO : Offline
770
- var _247 = (0, react_1.useState)(0), offlineDataLength = _247[0], setOfflineDataLength = _247[1];
771
- var _248 = (0, react_1.useState)(false), offlineModal = _248[0], setOfflineModal = _248[1];
783
+ var _253 = (0, react_1.useState)(0), offlineDataLength = _253[0], setOfflineDataLength = _253[1];
784
+ var _254 = (0, react_1.useState)(false), offlineModal = _254[0], setOfflineModal = _254[1];
772
785
  // INFO: live-stream state — driven by socket connection and navigator.onLine
773
- var _249 = (0, react_1.useState)(false), isLive = _249[0], setIsLive = _249[1];
774
- var _250 = (0, react_1.useState)(false), isLiveOffline = _250[0], setIsLiveOffline = _250[1];
786
+ var _255 = (0, react_1.useState)(false), isLive = _255[0], setIsLive = _255[1];
787
+ var _256 = (0, react_1.useState)(false), isLiveOffline = _256[0], setIsLiveOffline = _256[1];
775
788
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
776
789
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
777
790
  // Independent of SSE status so it works even when bareSocketName is not set.
778
- var _251 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _251[0], setIsNetworkOffline = _251[1];
791
+ var _257 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _257[0], setIsNetworkOffline = _257[1];
779
792
  var previousType = (0, react_1.useRef)(null);
780
793
  var previousSelectedData = (0, react_1.useRef)(null);
781
794
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -925,7 +938,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
925
938
  * viewId still wins when present: it is a deliberate destination, from a
926
939
  * shared link or a back button.
927
940
  */
928
- var defaultTabName = (_14 = (_13 = (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.extendedTabs) === null || _13 === void 0 ? void 0 : _13.find(function (eachTab) { return eachTab.defaultTab; })) === null || _14 === void 0 ? void 0 : _14.name;
941
+ var defaultTabName = (_15 = (_14 = (_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.extendedTabs) === null || _14 === void 0 ? void 0 : _14.find(function (eachTab) { return eachTab.defaultTab; })) === null || _15 === void 0 ? void 0 : _15.name;
929
942
  // INFO: the pinned tab is a LIST destination. Falling back to it while a
930
943
  // record is open resolved the read view to a list tab, which renderTabContent
931
944
  // refuses — so General Details rendered nothing. Only a list falls back.
@@ -937,14 +950,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
937
950
  // INFO: Firestore reads and the monday wrapper join every condition with AND
938
951
  // (monday flattens all ORs into one), so a flex OR group is offered on Mongo only
939
952
  var isFlexOrSupported = !isFirebase && devSettings.server !== "mondayServer";
940
- var isDateWarnings = !!((_15 = props.organise) === null || _15 === void 0 ? void 0 : _15.dateWarnings);
941
- var isDatasheetDefaults = !!((_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.datasheetDefaults);
953
+ var isDateWarnings = !!((_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.dateWarnings);
954
+ var isDatasheetDefaults = !!((_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.datasheetDefaults);
942
955
  // INFO: the columns as the views draw them — with datasheet defaults every
943
956
  // list option without a colour takes the palette colour of its position
944
957
  var displayStructure = isDatasheetDefaults
945
958
  ? (0, defaultColours_1.handleApplyDefaultColours)(structure)
946
959
  : structure;
947
- var dbModule = isFirebaseClient ? (_17 = props.lib) === null || _17 === void 0 ? void 0 : _17.firebase : (_18 = props.lib) === null || _18 === void 0 ? void 0 : _18.axios;
960
+ var dbModule = isFirebaseClient ? (_18 = props.lib) === null || _18 === void 0 ? void 0 : _18.firebase : (_19 = props.lib) === null || _19 === void 0 ? void 0 : _19.axios;
948
961
  var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
949
962
  var selectedRelated = resolvedType === "read"
950
963
  ? relatedSections.find(function (eachSection) { return eachSection.id === viewType; })
@@ -1138,32 +1151,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1138
1151
  }, [
1139
1152
  resolvedType,
1140
1153
  props.id,
1141
- (_19 = props.space) === null || _19 === void 0 ? void 0 : _19._id,
1154
+ (_20 = props.space) === null || _20 === void 0 ? void 0 : _20._id,
1142
1155
  props.devSettings.schemaEndpoint,
1143
- (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.showRelatedTab,
1156
+ (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.showRelatedTab,
1144
1157
  ]);
1145
1158
  /* eslint-enable */
1146
1159
  // INFO: the view settings panel (columns, sort, rows per page) is standard on
1147
1160
  // the new DTW; bareViewSettings stays the opt-in for legacy and bare DTWs
1148
- var isViewSettingsEnabled = ((_21 = props.bareSettings) === null || _21 === void 0 ? void 0 : _21.bareViewSettings) || ((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareNewDTW)
1161
+ var isViewSettingsEnabled = ((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareViewSettings) || ((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareNewDTW)
1149
1162
  ? true
1150
1163
  : false;
1151
1164
  // INFO: a consumer that wires onChangeHide owns the hide at schema level
1152
1165
  // (shared by every user) — toggling writes to the model and calls back. Without it
1153
1166
  // the hide is this user's own and lives in userHiddenColumnIds.
1154
- var isSchemaHideMode = ((_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.onChangeHide) ? true : false;
1167
+ var isSchemaHideMode = ((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.onChangeHide) ? true : false;
1155
1168
  // INFO: rows per page is a view setting the user can change, so it starts from
1156
1169
  // the persisted value and falls back to the consumer's limit
1157
- var _252 = (0, react_1.useState)((_25 = (_24 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _24 !== void 0 ? _24 : props.limit) !== null && _25 !== void 0 ? _25 : 10), pageLimit = _252[0], setPageLimit = _252[1];
1170
+ var _258 = (0, react_1.useState)((_26 = (_25 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _25 !== void 0 ? _25 : props.limit) !== null && _26 !== void 0 ? _26 : 10), pageLimit = _258[0], setPageLimit = _258[1];
1158
1171
  var limit = pageLimit;
1159
- var isSavedViewsEnabled = !!((_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.savedViews) && resolvedType === "list";
1172
+ var isSavedViewsEnabled = !!((_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.savedViews) && resolvedType === "list";
1173
+ // INFO: a calendar and a chart draw their own way, so columns, sort and
1174
+ // group have nothing to change there
1175
+ var isViewSettingsHiddenForTab = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "calendar" || (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "chart";
1176
+ // INFO: Group shapes a table, list or grid into sections, a map into routes
1177
+ // and a timeline into colours
1178
+ var isGroupPickerShown = !!((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.showGroupByFeature) && !isViewSettingsHiddenForTab;
1160
1179
  // INFO: an app that stores views takes over from this browser's storage, so
1161
1180
  // every view is the team's and nothing is kept locally
1162
- var isAppViews = ((_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.sharedViews) !== undefined ||
1163
- !!((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.onChangeSharedViews);
1181
+ var isAppViews = ((_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.sharedViews) !== undefined ||
1182
+ !!((_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.onChangeSharedViews);
1164
1183
  // INFO: a saved view carries its sort, so the sort is held here as with persistViewState
1165
1184
  var isInternalSort = isPersistEnabled || isSavedViewsEnabled;
1166
- var activeSortId = (isInternalSort && persistedSort) || ((_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.sort);
1185
+ var activeSortId = (isInternalSort && persistedSort) || ((_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.sort);
1167
1186
  var handleSortColumn = function (value) {
1168
1187
  var _a, _b, _c, _d;
1169
1188
  if (isInternalSort)
@@ -1193,7 +1212,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1193
1212
  // INFO: Firebase pages by document cursor and a union by skip, so neither
1194
1213
  // can hand over the whole set — there formula columns are not offered for
1195
1214
  // sorting or filtering, rather than ordering one page
1196
- var isFormulaViewSupported = !isFirebase && !((_31 = (_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.unionCollections) === null || _31 === void 0 ? void 0 : _31.length);
1215
+ var isFormulaViewSupported = !isFirebase && !((_33 = (_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.unionCollections) === null || _33 === void 0 ? void 0 : _33.length);
1197
1216
  var formulaSort = isFormulaViewSupported &&
1198
1217
  (activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) &&
1199
1218
  formulaColumnIds.includes(activeSortId.sortId)
@@ -1204,17 +1223,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1204
1223
  // a union read runs them
1205
1224
  // INFO: a people filter's "me" needs only who is signed in, which any
1206
1225
  // backend can match
1207
- var currentUserId = (_32 = props.devSettings.currentUser) === null || _32 === void 0 ? void 0 : _32.userId;
1208
- var flexFilterExtras = !isFirebase && !((_34 = (_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.unionCollections) === null || _34 === void 0 ? void 0 : _34.length)
1226
+ var currentUserId = (_34 = props.devSettings.currentUser) === null || _34 === void 0 ? void 0 : _34.userId;
1227
+ var flexFilterExtras = !isFirebase && !((_36 = (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.unionCollections) === null || _36 === void 0 ? void 0 : _36.length)
1209
1228
  ? {
1210
- references: (_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareFlexFilterReferences,
1211
- listObjects: (_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareFlexFilterListObjects,
1212
- related: (_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareFlexFilterRelated,
1229
+ references: (_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareFlexFilterReferences,
1230
+ listObjects: (_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareFlexFilterListObjects,
1231
+ related: (_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareFlexFilterRelated,
1213
1232
  currentUserId: currentUserId,
1214
1233
  }
1215
- : currentUserId
1216
- ? { currentUserId: currentUserId }
1217
- : undefined;
1234
+ : isFirebase
1235
+ ? { currentUserId: currentUserId, isFirestore: true }
1236
+ : currentUserId
1237
+ ? { currentUserId: currentUserId }
1238
+ : undefined;
1218
1239
  // INFO: a formula filter is matched in the browser and the rest on the
1219
1240
  // server, so a group is split between them: a group of formula filters
1220
1241
  // only still matches any of them here, while a formula filter grouped with
@@ -1301,18 +1322,67 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1301
1322
  displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
1302
1323
  };
1303
1324
  };
1304
- var _253 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _253.canUpdateRecord, canInlineUpdate = _253.canInlineUpdate, canBatchUpdate = _253.canBatchUpdate, canDeleteRecord = _253.canDeleteRecord;
1305
- var isEditor = ((_38 = props.edit) === null || _38 === void 0 ? void 0 : _38.allEditable) ? true : false;
1306
- var isOffline = (_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareOffline;
1325
+ // INFO: a formula filter runs in the browser, so a select-all read on the
1326
+ // server matches more rows than the list shows — only the ids the formula
1327
+ // kept may be deleted or updated. null when the kept rows are not known
1328
+ var handleGetFormulaKeptIds = function () {
1329
+ if (formulaFlexQueries.length === 0)
1330
+ return null;
1331
+ var cached = formulaFullReadRef.current;
1332
+ if (!cached)
1333
+ return new Set();
1334
+ return new Set(handleApplyFormulaView(cached.rows, cached.displayRows).rows.map(function (eachRow) { return handleGetRowId(eachRow); }));
1335
+ };
1336
+ // INFO: a row's id whether it came straight from the server (its serverId)
1337
+ // or through the list, which renames _id to id
1338
+ var handleGetRowId = function (row) { var _a, _b, _c, _d; return String((_d = (_c = (_b = (_a = row === null || row === void 0 ? void 0 : row[serverId]) !== null && _a !== void 0 ? _a : row === null || row === void 0 ? void 0 : row.recordId) !== null && _b !== void 0 ? _b : row === null || row === void 0 ? void 0 : row.id) !== null && _c !== void 0 ? _c : row === null || row === void 0 ? void 0 : row._id) !== null && _d !== void 0 ? _d : ""); };
1339
+ // INFO: the count the reader saw when choosing select-all — a delete or
1340
+ // update refuses if what matches then is a different number, even if the
1341
+ // list has since reloaded with a new count
1342
+ var selectAllSizeRef = (0, react_1.useRef)(0);
1343
+ var handleGetChangedListMessage = function (matchedCount) {
1344
+ return "The list changed: ".concat(selectAllSizeRef.current.toLocaleString(), " records were selected but ").concat(matchedCount.toLocaleString(), " match now. Refresh and select again.");
1345
+ };
1346
+ // INFO: whether the reader narrowed the list — the app's own fixed
1347
+ // conditions (a workspace, a member's rows) are not the reader's filters
1348
+ var handleHasFilterValue = function (values) {
1349
+ return Object.values(values !== null && values !== void 0 ? values : {}).some(function (value) {
1350
+ return Array.isArray(value)
1351
+ ? value.length > 0
1352
+ : value !== undefined &&
1353
+ value !== null &&
1354
+ value !== "" &&
1355
+ (value instanceof Date ||
1356
+ !(typeof value === "object" && Object.keys(value).length === 0));
1357
+ });
1358
+ };
1359
+ var handleCheckReaderFiltered = function () {
1360
+ return [
1361
+ filterSearchParams,
1362
+ filterSelection,
1363
+ filterReference,
1364
+ filterReferenceDate,
1365
+ ].some(handleHasFilterValue) ||
1366
+ flexFiltersDebounced.some(function (eachFilter) {
1367
+ return (0, flexFilter_1.isFlexFilterActive)(eachFilter, structure, flexFilterExtras);
1368
+ });
1369
+ };
1370
+ // INFO: what a select-all covers, by count, so a delete says how much
1371
+ var handleGetSelectAllText = function () {
1372
+ return "".concat(size.toLocaleString(), " records ").concat(handleCheckReaderFiltered() ? "matching your filters" : "in this list");
1373
+ };
1374
+ var _259 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _259.canUpdateRecord, canInlineUpdate = _259.canInlineUpdate, canBatchUpdate = _259.canBatchUpdate, canDeleteRecord = _259.canDeleteRecord;
1375
+ var isEditor = ((_40 = props.edit) === null || _40 === void 0 ? void 0 : _40.allEditable) ? true : false;
1376
+ var isOffline = (_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.bareOffline;
1307
1377
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
1308
1378
  // the live network state — online saves go to the server even if bareOffline
1309
1379
  // is true, offline saves go to IDB as normal.
1310
- var isOfflineNetworkListener = isOffline && ((_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.bareOfflineNetworkListener);
1311
- var showId = (_41 = props.space) === null || _41 === void 0 ? void 0 : _41.showId;
1380
+ var isOfflineNetworkListener = isOffline && ((_42 = props.bareSettings) === null || _42 === void 0 ? void 0 : _42.bareOfflineNetworkListener);
1381
+ var showId = (_43 = props.space) === null || _43 === void 0 ? void 0 : _43.showId;
1312
1382
  var remainId = showId || selectedObjectStructureId ? true : false;
1313
- var idField = ((_42 = props.space) === null || _42 === void 0 ? void 0 : _42.idField) || ((_43 = props.organise) === null || _43 === void 0 ? void 0 : _43.idField);
1314
- var pipeline = (_44 = props === null || props === void 0 ? void 0 : props.space) === null || _44 === void 0 ? void 0 : _44.pipeline;
1315
- if ((_45 = props.bareSettings) === null || _45 === void 0 ? void 0 : _45.bareListPipeline) {
1383
+ var idField = ((_44 = props.space) === null || _44 === void 0 ? void 0 : _44.idField) || ((_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.idField);
1384
+ var pipeline = (_46 = props === null || props === void 0 ? void 0 : props.space) === null || _46 === void 0 ? void 0 : _46.pipeline;
1385
+ if ((_47 = props.bareSettings) === null || _47 === void 0 ? void 0 : _47.bareListPipeline) {
1316
1386
  pipeline = pipeline
1317
1387
  ? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
1318
1388
  }
@@ -1325,30 +1395,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1325
1395
  * three records came back instead of five files, and each tile received the
1326
1396
  * whole array rather than one file, so every one of them read "Attachment".
1327
1397
  */
1328
- var fileViewColumnId = (_49 = (_48 = ((_47 = (_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.extendedTabs) !== null && _47 !== void 0 ? _47 : []).find(function (eachTab) {
1398
+ var fileViewColumnId = (_51 = (_50 = ((_49 = (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.extendedTabs) !== null && _49 !== void 0 ? _49 : []).find(function (eachTab) {
1329
1399
  return eachTab.viewType === "file" &&
1330
1400
  (0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
1331
- })) === null || _48 === void 0 ? void 0 : _48.fileSettings) === null || _49 === void 0 ? void 0 : _49.columnId;
1332
- var hasNavigation = ((_50 = props.organise) === null || _50 === void 0 ? void 0 : _50.handleNavigate) ? true : false;
1401
+ })) === null || _50 === void 0 ? void 0 : _50.fileSettings) === null || _51 === void 0 ? void 0 : _51.columnId;
1402
+ // INFO: select-all promises "all N records", so it is offered only where N
1403
+ // is the total a delete reads — not on Firebase (N is the rows loaded so
1404
+ // far), a union of datasheets (N counts the others too), a file view (N
1405
+ // counts files, not records) or offline
1406
+ var isSelectAllUncountable = isFirebase ||
1407
+ !!((_53 = (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.unionCollections) === null || _53 === void 0 ? void 0 : _53.length) ||
1408
+ !!fileViewColumnId ||
1409
+ !!((_54 = props.bareSettings) === null || _54 === void 0 ? void 0 : _54.bareOffline);
1410
+ var hasNavigation = ((_55 = props.organise) === null || _55 === void 0 ? void 0 : _55.handleNavigate) ? true : false;
1333
1411
  var formColumn = "grid-cols-12";
1334
- var useMobileView = (_52 = (_51 = props.bareSettings) === null || _51 === void 0 ? void 0 : _51.bareUpdateMobileView) !== null && _52 !== void 0 ? _52 : false;
1412
+ var useMobileView = (_57 = (_56 = props.bareSettings) === null || _56 === void 0 ? void 0 : _56.bareUpdateMobileView) !== null && _57 !== void 0 ? _57 : false;
1335
1413
  var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
1336
- var isActivityLog = (((_54 = (_53 = props.edit) === null || _53 === void 0 ? void 0 : _53.activityLog) === null || _54 === void 0 ? void 0 : _54.enableComments) &&
1337
- ((_55 = props.edit) === null || _55 === void 0 ? void 0 : _55.activityLog.commentCollectionId)) ||
1338
- (((_57 = (_56 = props.edit) === null || _56 === void 0 ? void 0 : _56.activityLog) === null || _57 === void 0 ? void 0 : _57.enableLogs) &&
1339
- ((_58 = props.edit) === null || _58 === void 0 ? void 0 : _58.activityLog.logsCollectionId));
1414
+ var isActivityLog = (((_59 = (_58 = props.edit) === null || _58 === void 0 ? void 0 : _58.activityLog) === null || _59 === void 0 ? void 0 : _59.enableComments) &&
1415
+ ((_60 = props.edit) === null || _60 === void 0 ? void 0 : _60.activityLog.commentCollectionId)) ||
1416
+ (((_62 = (_61 = props.edit) === null || _61 === void 0 ? void 0 : _61.activityLog) === null || _62 === void 0 ? void 0 : _62.enableLogs) &&
1417
+ ((_63 = props.edit) === null || _63 === void 0 ? void 0 : _63.activityLog.logsCollectionId));
1340
1418
  // INFO: a record's comments and logs shown in place of the record rather than
1341
1419
  // in a drawer of their own — a related tab already sits inside the read
1342
1420
  // drawer, and a second drawer over it hid the row being discussed. It opens
1343
1421
  // the row through handleNavigate, so without one it stays off and the
1344
1422
  // drawer is used, rather than leaving a comment button that does nothing
1345
1423
  var isInlineActivity = !!isActivityLog &&
1346
- !!((_59 = props.bareSettings) === null || _59 === void 0 ? void 0 : _59.bareInlineActivity) &&
1424
+ !!((_64 = props.bareSettings) === null || _64 === void 0 ? void 0 : _64.bareInlineActivity) &&
1347
1425
  hasNavigation;
1348
1426
  // INFO: each row button opens what it shows: the comment button the row's
1349
1427
  // comments and logs alone, the eye (or the row) its details alone, so
1350
1428
  // neither has to be scrolled past to reach the other
1351
- var _254 = (0, react_1.useState)(false), inlineActivityOnly = _254[0], setInlineActivityOnly = _254[1];
1429
+ var _260 = (0, react_1.useState)(false), inlineActivityOnly = _260[0], setInlineActivityOnly = _260[1];
1352
1430
  var isActivityOnly = isInlineActivity && inlineActivityOnly;
1353
1431
  // INFO: the row whose comments were shown; going back to the list asks its
1354
1432
  // comment count again, as the drawer does when it closes
@@ -1387,12 +1465,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1387
1465
  // column
1388
1466
  recordTitleColumn: (_d = ((_c = (_b = structure.find(function (eachDS) { return eachDS.id === "title"; })) !== null && _b !== void 0 ? _b : structure.find(function (eachDS) { return eachDS.id === "name"; })) !== null && _c !== void 0 ? _c : structure.find(function (eachDS) { return eachDS.type === "string"; }))) === null || _d === void 0 ? void 0 : _d.id, model: structure }));
1389
1467
  };
1390
- var customPaginationSize = ((_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.customPaginationCount)
1468
+ var customPaginationSize = ((_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.customPaginationCount)
1391
1469
  ? props.organise.customPaginationCount(size)
1392
1470
  : undefined;
1393
1471
  //TODO : Code - Pass ...devSettings, search dbEndpoint:
1394
1472
  var writeServerQuery = new writeQuery_1.WriteQuery({
1395
- dbModule: (_61 = props.lib) === null || _61 === void 0 ? void 0 : _61.axios,
1473
+ dbModule: (_66 = props.lib) === null || _66 === void 0 ? void 0 : _66.axios,
1396
1474
  dbType: devSettings.server,
1397
1475
  dbCollection: props.collectionId,
1398
1476
  dbEndpoint: devSettings.dbEndpoint,
@@ -1400,7 +1478,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1400
1478
  dbUserToken: devSettings.dbUserToken,
1401
1479
  });
1402
1480
  var readServerQuery = new readQuery_1.ReadQuery({
1403
- dbModule: (_62 = props.lib) === null || _62 === void 0 ? void 0 : _62.axios,
1481
+ dbModule: (_67 = props.lib) === null || _67 === void 0 ? void 0 : _67.axios,
1404
1482
  dbType: devSettings.server,
1405
1483
  dbCollection: props.collectionId,
1406
1484
  dbEndpoint: devSettings.dbEndpoint,
@@ -1408,12 +1486,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1408
1486
  dbUserToken: devSettings.dbUserToken,
1409
1487
  });
1410
1488
  var moreButtonPopUp = [
1411
- ((_63 = props.edit) === null || _63 === void 0 ? void 0 : _63.allEditable) &&
1489
+ ((_68 = props.edit) === null || _68 === void 0 ? void 0 : _68.allEditable) &&
1412
1490
  // INFO: the import runs on the server (importEndpoint), so a Firestore
1413
1491
  // datasheet served through one can import; only the browser-direct
1414
1492
  // Firebase client has no server to import through
1415
1493
  !isFirebaseClient &&
1416
- !((_65 = (_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.exportSettings) === null || _65 === void 0 ? void 0 : _65.hideImportCSV)
1494
+ !((_70 = (_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.exportSettings) === null || _70 === void 0 ? void 0 : _70.hideImportCSV)
1417
1495
  ? {
1418
1496
  text: "Import Excel",
1419
1497
  onClick: function () {
@@ -1422,7 +1500,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1422
1500
  },
1423
1501
  }
1424
1502
  : null,
1425
- !((_67 = (_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.exportSettings) === null || _67 === void 0 ? void 0 : _67.hideExportCSV)
1503
+ !((_72 = (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.exportSettings) === null || _72 === void 0 ? void 0 : _72.hideExportCSV)
1426
1504
  ? {
1427
1505
  text: "Export CSV",
1428
1506
  onClick: function () {
@@ -1432,7 +1510,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1432
1510
  },
1433
1511
  }
1434
1512
  : null,
1435
- !((_69 = (_68 = props.organise) === null || _68 === void 0 ? void 0 : _68.exportSettings) === null || _69 === void 0 ? void 0 : _69.hideExportExcel)
1513
+ !((_74 = (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.exportSettings) === null || _74 === void 0 ? void 0 : _74.hideExportExcel)
1436
1514
  ? {
1437
1515
  text: "Export Excel",
1438
1516
  onClick: function () {
@@ -1442,7 +1520,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1442
1520
  },
1443
1521
  }
1444
1522
  : null,
1445
- !((_71 = (_70 = props.organise) === null || _70 === void 0 ? void 0 : _70.exportSettings) === null || _71 === void 0 ? void 0 : _71.hideExportPDF)
1523
+ !((_76 = (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.exportSettings) === null || _76 === void 0 ? void 0 : _76.hideExportPDF)
1446
1524
  ? {
1447
1525
  text: "Export PDF",
1448
1526
  onClick: function () {
@@ -1452,7 +1530,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1452
1530
  },
1453
1531
  }
1454
1532
  : null,
1455
- !((_73 = (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.exportSettings) === null || _73 === void 0 ? void 0 : _73.hideExportQR)
1533
+ !((_78 = (_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.exportSettings) === null || _78 === void 0 ? void 0 : _78.hideExportQR)
1456
1534
  ? {
1457
1535
  text: "Export QR",
1458
1536
  onClick: function () {
@@ -1462,7 +1540,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1462
1540
  },
1463
1541
  }
1464
1542
  : null,
1465
- !((_75 = (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.exportSettings) === null || _75 === void 0 ? void 0 : _75.hideExportQR)
1543
+ !((_80 = (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.exportSettings) === null || _80 === void 0 ? void 0 : _80.hideExportQR)
1466
1544
  ? {
1467
1545
  text: "Export QR(Data)",
1468
1546
  onClick: function () {
@@ -1472,7 +1550,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1472
1550
  },
1473
1551
  }
1474
1552
  : null,
1475
- !((_77 = (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.exportSettings) === null || _77 === void 0 ? void 0 : _77.hideExportPrint)
1553
+ !((_82 = (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.exportSettings) === null || _82 === void 0 ? void 0 : _82.hideExportPrint)
1476
1554
  ? {
1477
1555
  text: "Print",
1478
1556
  onClick: function () {
@@ -1484,8 +1562,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1484
1562
  : null,
1485
1563
  // INFO: drafts only exist where the form can save one, so the filter has
1486
1564
  // nothing to find on any other page
1487
- ((_78 = props.edit) === null || _78 === void 0 ? void 0 : _78.enableUpdateDraft) &&
1488
- !((_80 = (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.exportSettings) === null || _80 === void 0 ? void 0 : _80.hideExportDraft)
1565
+ ((_83 = props.edit) === null || _83 === void 0 ? void 0 : _83.enableUpdateDraft) &&
1566
+ !((_85 = (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.exportSettings) === null || _85 === void 0 ? void 0 : _85.hideExportDraft)
1489
1567
  ? {
1490
1568
  text: filterDraft ? "Show All Items" : "Filter Draft",
1491
1569
  onClick: function () {
@@ -1494,7 +1572,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1494
1572
  }
1495
1573
  : null,
1496
1574
  ].filter(Boolean);
1497
- if ((_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.moreSettings)
1575
+ if ((_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.moreSettings)
1498
1576
  moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
1499
1577
  //=====================================================================================
1500
1578
  //SECTION: User Column Visibility Handlers
@@ -1939,14 +2017,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1939
2017
  //=====================================================================================
1940
2018
  //SECTION: Saved Views
1941
2019
  //=====================================================================================
1942
- var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.persistKey, (_83 = devSettings.currentUser) === null || _83 === void 0 ? void 0 : _83.userEmail);
2020
+ var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.persistKey, (_88 = devSettings.currentUser) === null || _88 === void 0 ? void 0 : _88.userEmail);
1943
2021
  (0, react_1.useEffect)(function () {
1944
2022
  if (isSavedViewsEnabled && !isAppViews)
1945
2023
  setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
1946
2024
  }, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
1947
2025
  // INFO: the app keeps All's settings, so every change is kept in this
1948
2026
  // browser until the person updates the view for everyone or resets it
1949
- var isViewDraftsEnabled = isSavedViewsEnabled && ((_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.allView) !== undefined;
2027
+ var isViewDraftsEnabled = isSavedViewsEnabled && ((_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.allView) !== undefined;
1950
2028
  var handleGetViewDraftKey = function (viewId) {
1951
2029
  var _a, _b;
1952
2030
  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);
@@ -2075,7 +2153,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2075
2153
  var lastSentSharedViewsRef = (0, react_1.useRef)(null);
2076
2154
  (0, react_1.useEffect)(function () {
2077
2155
  lastSentSharedViewsRef.current = null;
2078
- }, [(_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.sharedViews]);
2156
+ }, [(_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.sharedViews]);
2079
2157
  var handleStoreSharedViews = function (update) {
2080
2158
  var _a, _b, _c;
2081
2159
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
@@ -2092,7 +2170,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2092
2170
  var openingViewSettledRef = (0, react_1.useRef)(false);
2093
2171
  // INFO: keyed on the ids, so a list handed in again on every render does
2094
2172
  // not re-run the opening
2095
- var starredViewIdsKey = ((_87 = (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.defaultSavedViewIds) !== null && _87 !== void 0 ? _87 : []).join("|");
2173
+ var starredViewIdsKey = ((_92 = (_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.defaultSavedViewIds) !== null && _92 !== void 0 ? _92 : []).join("|");
2096
2174
  (0, react_1.useEffect)(function () {
2097
2175
  var _a, _b, _c, _d;
2098
2176
  if (!isSavedViewsEnabled || openingViewSettledRef.current)
@@ -2130,13 +2208,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2130
2208
  /* eslint-disable */
2131
2209
  }, [
2132
2210
  isSavedViewsEnabled,
2133
- (_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.initialSavedViewId,
2211
+ (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.initialSavedViewId,
2134
2212
  starredViewIdsKey,
2135
- (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.sharedViews,
2213
+ (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.sharedViews,
2136
2214
  savedViews,
2137
2215
  ]);
2138
2216
  /* eslint-enable */
2139
- var appDefaultViewIds = ((_91 = (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.defaultSavedViews) !== null && _91 !== void 0 ? _91 : [])
2217
+ var appDefaultViewIds = ((_96 = (_95 = props.organise) === null || _95 === void 0 ? void 0 : _95.defaultSavedViews) !== null && _96 !== void 0 ? _96 : [])
2140
2218
  .map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
2141
2219
  .join("|");
2142
2220
  // INFO: keyed on the ids, not the array, so an inline literal passed on every
@@ -2547,8 +2625,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2547
2625
  laneWidths,
2548
2626
  drawerWidth,
2549
2627
  pinnedColumnIds,
2550
- (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.allView,
2551
- (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.sharedViews,
2628
+ (_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.allView,
2629
+ (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.sharedViews,
2552
2630
  savedViews,
2553
2631
  ]);
2554
2632
  /* eslint-enable */
@@ -2592,7 +2670,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2592
2670
  if (scrollRestoredRef.current)
2593
2671
  scrollCatchUpRef.current = null;
2594
2672
  /* eslint-disable */
2595
- }, [props.collectionId, (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.persistKey]);
2673
+ }, [props.collectionId, (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.persistKey]);
2596
2674
  /* eslint-enable */
2597
2675
  // INFO: wait a frame — rows land in state one tick before layout
2598
2676
  (0, react_1.useEffect)(function () {
@@ -2627,7 +2705,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2627
2705
  (0, react_1.useEffect)(function () {
2628
2706
  handleOfflinePrefetch();
2629
2707
  /* eslint-disable */
2630
- }, [props.collectionId, (_95 = props.bareSettings) === null || _95 === void 0 ? void 0 : _95.bareOffline]);
2708
+ }, [props.collectionId, (_100 = props.bareSettings) === null || _100 === void 0 ? void 0 : _100.bareOffline]);
2631
2709
  /* eslint-enable */
2632
2710
  // INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
2633
2711
  // Calls through handleRefreshRef so the interval always dispatches the latest
@@ -2647,7 +2725,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2647
2725
  }, interval);
2648
2726
  return function () { return clearInterval(timer); };
2649
2727
  /* eslint-disable */
2650
- }, [(_96 = props.bareSettings) === null || _96 === void 0 ? void 0 : _96.barePollingInterval, isLive, isNetworkOffline]);
2728
+ }, [(_101 = props.bareSettings) === null || _101 === void 0 ? void 0 : _101.barePollingInterval, isLive, isNetworkOffline]);
2651
2729
  /* eslint-enable */
2652
2730
  // INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
2653
2731
  // EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
@@ -2689,7 +2767,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2689
2767
  };
2690
2768
  /* eslint-disable */
2691
2769
  }, [
2692
- (_97 = props.bareSettings) === null || _97 === void 0 ? void 0 : _97.bareSocketName,
2770
+ (_102 = props.bareSettings) === null || _102 === void 0 ? void 0 : _102.bareSocketName,
2693
2771
  props.collectionId,
2694
2772
  props.devSettings.sseEndpoint,
2695
2773
  props.devSettings.dbAPIToken,
@@ -2963,10 +3041,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2963
3041
  props.collectionId,
2964
3042
  props.model,
2965
3043
  props.localURLEndpoint,
2966
- (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.extendedTabs,
3044
+ (_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.extendedTabs,
2967
3045
  listViewId,
2968
- (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.additionalQuery,
2969
- (_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.groupBy,
3046
+ (_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.additionalQuery,
3047
+ (_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.groupBy,
2970
3048
  resolvedType,
2971
3049
  ]);
2972
3050
  /**
@@ -3118,7 +3196,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
3118
3196
  };
3119
3197
  }, 100);
3120
3198
  return function () { return clearTimeout(timeoutId); };
3121
- }, [(_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.showReadFloatingNav, resolvedType, props.id, loading]);
3199
+ }, [(_106 = props.organise) === null || _106 === void 0 ? void 0 : _106.showReadFloatingNav, resolvedType, props.id, loading]);
3122
3200
  (0, react_1.useEffect)(function () {
3123
3201
  if (resolvedType !== "read")
3124
3202
  return;
@@ -3635,10 +3713,53 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
3635
3713
  }
3636
3714
  return sort;
3637
3715
  };
3716
+ // INFO: a timeline reads one window at a time when it has both ends to
3717
+ // compare; Firebase cannot range two columns at once, so it reads all
3718
+ var handleCheckTimelineWindow = function (settings) { return !!(settings === null || settings === void 0 ? void 0 : settings.startDate) && !!(settings === null || settings === void 0 ? void 0 : settings.endDate) && !isFirebase; };
3638
3719
  var handleReadQueryHocCond = function () {
3639
3720
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
3640
3721
  var query = (_a = renderImpSearchFilterConditions()) !== null && _a !== void 0 ? _a : [];
3641
3722
  var calendarSettings = false;
3723
+ var timelineQuerySettings = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "timeline"
3724
+ ? selectedTab.timelineSettings
3725
+ : undefined;
3726
+ if (handleCheckTimelineWindow(timelineQuerySettings)) {
3727
+ var timelineWindow = (0, timelineBars_1.handleGetTimelineWindow)(timelineRange.unit, timelineRange.anchor);
3728
+ // INFO: a bar overlaps the window when it starts before the window ends
3729
+ // and ends after it starts; one column for both ends is a plain range.
3730
+ // A reader's own filter on a date column stays — the server keeps one
3731
+ // condition per column, so the window gives way on that column
3732
+ var startId = timelineQuerySettings.startDate;
3733
+ var endId = timelineQuerySettings.endDate;
3734
+ var handleIsFiltered = function (queryId) {
3735
+ return query.some(function (eachQuery) { return eachQuery.queryId === queryId && !eachQuery.orQuery; });
3736
+ };
3737
+ if (startId === endId) {
3738
+ if (!handleIsFiltered(startId))
3739
+ query.push({
3740
+ type: "><",
3741
+ queryId: startId,
3742
+ value: [
3743
+ timelineWindow.start.toISOString(),
3744
+ timelineWindow.end.toISOString(),
3745
+ ],
3746
+ });
3747
+ }
3748
+ else {
3749
+ if (!handleIsFiltered(startId))
3750
+ query.push({
3751
+ type: "<",
3752
+ queryId: startId,
3753
+ value: timelineWindow.end.toISOString(),
3754
+ });
3755
+ if (!handleIsFiltered(endId))
3756
+ query.push({
3757
+ type: ">",
3758
+ queryId: endId,
3759
+ value: new Date(timelineWindow.start.getTime() - 1).toISOString(),
3760
+ });
3761
+ }
3762
+ }
3642
3763
  if (selectedTab && selectedTab.viewType === "calendar") {
3643
3764
  var startDate = (0, dayjs_1.default)(calendarTabMonth).toDate();
3644
3765
  var endDate = (0, dayjs_1.default)(calendarTabMonth).toDate();
@@ -4068,6 +4189,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
4068
4189
  };
4069
4190
  var handleSelectAllPages = function (value) {
4070
4191
  var _a;
4192
+ if (value)
4193
+ selectAllSizeRef.current = size;
4071
4194
  setSelectAll(value);
4072
4195
  if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListHandleSelection) {
4073
4196
  var query = renderImpSearchFilterConditions();
@@ -4505,6 +4628,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
4505
4628
  return;
4506
4629
  if (renderResolvedPaginationType() === "cursor")
4507
4630
  return;
4631
+ // INFO: a calendar, map or timeline already holds every row, and the read
4632
+ // does not change with the group — only how the rows are drawn does
4633
+ if (handleCheckFullSetView())
4634
+ return;
4508
4635
  var isFirstPage = pageIndex === 0;
4509
4636
  handleClearDataByFilter();
4510
4637
  // INFO: from page 0 the request does not change, so ask for the read
@@ -4648,7 +4775,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
4648
4775
  // the link view ends and the list opens as it normally would. A change
4649
4776
  // while a record is open (opening one drops the link from the URL) waits
4650
4777
  // until the list shows again
4651
- var lastInitialSearchRef = (0, react_1.useRef)((_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.initialSearch);
4778
+ var lastInitialSearchRef = (0, react_1.useRef)((_107 = props.organise) === null || _107 === void 0 ? void 0 : _107.initialSearch);
4652
4779
  // INFO: persistViewState reads its stored state only once the link view
4653
4780
  // has ended, a render later
4654
4781
  var isNormalOpenPendingRef = (0, react_1.useRef)(false);
@@ -4675,7 +4802,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
4675
4802
  setIsLinkOpen(true);
4676
4803
  handleApplySavedView(null, true, value);
4677
4804
  /* eslint-disable */
4678
- }, [(_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.initialSearch, resolvedType]);
4805
+ }, [(_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.initialSearch, resolvedType]);
4679
4806
  (0, react_1.useEffect)(function () {
4680
4807
  if (!isNormalOpenPendingRef.current || isLinkOpen)
4681
4808
  return;
@@ -5734,8 +5861,42 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5734
5861
  }
5735
5862
  setDeletePasscode(passcode);
5736
5863
  };
5864
+ // INFO: select-all covers what the filters matched when it was picked; a
5865
+ // changed filter is a different set, so the selection ends rather than
5866
+ // carrying over to rows the reader has not seen
5867
+ // INFO: only what the reader sets — an app's own conditions can carry a
5868
+ // fresh timestamp on every render, which is not a change of filter
5869
+ var selectAllFilterKey = JSON.stringify([
5870
+ filterSearchParams,
5871
+ filterSelection,
5872
+ filterReference,
5873
+ (0, viewStatePersistence_1.serializeDateFilterState)(filterReferenceDate),
5874
+ flexFiltersDebounced
5875
+ .filter(function (eachFilter) {
5876
+ return (0, flexFilter_1.isFlexFilterActive)(eachFilter, structure, flexFilterExtras);
5877
+ })
5878
+ .map(function (_a) {
5879
+ var _id = _a.id, rest = __rest(_a, ["id"]);
5880
+ return rest;
5881
+ }),
5882
+ formulaFlexQueries,
5883
+ selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.name,
5884
+ ]);
5885
+ var selectAllFilterKeyRef = (0, react_1.useRef)(selectAllFilterKey);
5886
+ (0, react_1.useEffect)(function () {
5887
+ if (selectAllFilterKeyRef.current === selectAllFilterKey)
5888
+ return;
5889
+ selectAllFilterKeyRef.current = selectAllFilterKey;
5890
+ // INFO: ticked rows from the old filter go too, so a delete never takes
5891
+ // rows that are no longer on screen
5892
+ if (selectAll)
5893
+ handleSelectAllPages(false);
5894
+ if (selectedIds.length > 0)
5895
+ handleSelectIds([]);
5896
+ /* eslint-disable-next-line */
5897
+ }, [selectAllFilterKey]);
5737
5898
  var handleMultipleRemoveSelectedData = function () { return __awaiter(void 0, void 0, void 0, function () {
5738
- var passcodeMatch, offlineDataResp, offlineData, filteredData, ids, notReferenceId, query, responseData, responseData, data, uploadEndpoint, err_12;
5899
+ var passcodeMatch, offlineDataResp, offlineData, filteredData, ids, notReferenceId, query, responseData, formulaKeptIds_1, matchedRows, deleteIds, deletedIds, start, chunk, err_12, responseData, data, uploadEndpoint, err_13;
5739
5900
  var _a, _b, _c, _d, _e;
5740
5901
  return __generator(this, function (_f) {
5741
5902
  switch (_f.label) {
@@ -5746,11 +5907,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5746
5907
  setDeleting(true);
5747
5908
  _f.label = 1;
5748
5909
  case 1:
5749
- _f.trys.push([1, 17, 18, 19]);
5910
+ _f.trys.push([1, 23, 24, 25]);
5750
5911
  setLoading(true);
5751
5912
  setModalVisible(true);
5752
5913
  passcodeMatch = deletePasscodeInput === deletePasscode;
5753
- if (!passcodeMatch) return [3 /*break*/, 15];
5914
+ if (!passcodeMatch) return [3 /*break*/, 21];
5754
5915
  if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareOffline)) return [3 /*break*/, 4];
5755
5916
  return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
5756
5917
  case 2:
@@ -5765,11 +5926,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5765
5926
  })];
5766
5927
  case 3:
5767
5928
  _f.sent();
5768
- return [3 /*break*/, 14];
5929
+ return [3 /*break*/, 20];
5769
5930
  case 4:
5770
5931
  ids = [];
5771
5932
  notReferenceId = [];
5772
- if (!selectAll) return [3 /*break*/, 8];
5933
+ if (!selectAll) return [3 /*break*/, 13];
5773
5934
  query = renderImpSearchFilterConditions();
5774
5935
  return [4 /*yield*/, readServerQuery.call({
5775
5936
  type: "list",
@@ -5778,16 +5939,57 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5778
5939
  })];
5779
5940
  case 5:
5780
5941
  responseData = _f.sent();
5781
- return [4 /*yield*/, handleCheckDeleteReference((_c = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _c !== void 0 ? _c : [], true)];
5942
+ formulaKeptIds_1 = handleGetFormulaKeptIds();
5943
+ matchedRows = ((_c = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _c !== void 0 ? _c : []).filter(function (eachRow) {
5944
+ return !formulaKeptIds_1 || formulaKeptIds_1.has(handleGetRowId(eachRow));
5945
+ });
5946
+ // INFO: the rows found now must be the ones the reader was shown
5947
+ // the count of — if the list changed underneath, delete nothing
5948
+ if (matchedRows.length !== selectAllSizeRef.current) {
5949
+ setNotification({
5950
+ type: false,
5951
+ title: "Nothing deleted",
5952
+ msg: handleGetChangedListMessage(matchedRows.length),
5953
+ });
5954
+ setLoading(false);
5955
+ setModalVisible(false);
5956
+ return [2 /*return*/];
5957
+ }
5958
+ return [4 /*yield*/, handleCheckDeleteReference(matchedRows, true)];
5782
5959
  case 6:
5783
5960
  notReferenceId = _f.sent();
5784
- return [4 /*yield*/, writeServerQuery.call("batchDelete", {
5785
- id: notReferenceId,
5786
- })];
5961
+ deleteIds = notReferenceId !== null && notReferenceId !== void 0 ? notReferenceId : [];
5962
+ deletedIds = [];
5963
+ start = 0;
5964
+ _f.label = 7;
5787
5965
  case 7:
5788
- ids = _f.sent();
5966
+ if (!(start < deleteIds.length)) return [3 /*break*/, 12];
5967
+ chunk = deleteIds.slice(start, start + DELETE_ID_CHUNK);
5968
+ _f.label = 8;
5969
+ case 8:
5970
+ _f.trys.push([8, 10, , 11]);
5971
+ return [4 /*yield*/, writeServerQuery.call("batchDelete", { id: chunk })];
5972
+ case 9:
5973
+ _f.sent();
5974
+ deletedIds.push.apply(deletedIds, chunk);
5975
+ return [3 /*break*/, 11];
5976
+ case 10:
5977
+ err_12 = _f.sent();
5978
+ // INFO: a part that fails stops the rest, and says how far it
5979
+ // got — the parts before it are already gone
5980
+ setNotification({
5981
+ type: false,
5982
+ title: "Delete stopped",
5983
+ msg: "".concat(deletedIds.length.toLocaleString(), " of ").concat(deleteIds.length.toLocaleString(), " records were deleted before an error. Refresh to see what is left."),
5984
+ });
5789
5985
  return [3 /*break*/, 12];
5790
- case 8: return [4 /*yield*/, readServerQuery.call({
5986
+ case 11:
5987
+ start += DELETE_ID_CHUNK;
5988
+ return [3 /*break*/, 7];
5989
+ case 12:
5990
+ ids = deletedIds;
5991
+ return [3 /*break*/, 17];
5992
+ case 13: return [4 /*yield*/, readServerQuery.call({
5791
5993
  type: "list",
5792
5994
  query: [
5793
5995
  {
@@ -5798,18 +6000,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5798
6000
  ],
5799
6001
  stopLimit: true,
5800
6002
  })];
5801
- case 9:
6003
+ case 14:
5802
6004
  responseData = _f.sent();
5803
6005
  return [4 /*yield*/, handleCheckDeleteReference((_d = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _d !== void 0 ? _d : [], true)];
5804
- case 10:
6006
+ case 15:
5805
6007
  notReferenceId = _f.sent();
5806
6008
  return [4 /*yield*/, writeServerQuery.call("batchDelete", {
5807
6009
  id: notReferenceId,
5808
6010
  })];
5809
- case 11:
6011
+ case 16:
5810
6012
  ids = _f.sent();
5811
- _f.label = 12;
5812
- case 12:
6013
+ _f.label = 17;
6014
+ case 17:
6015
+ if (!((ids !== null && ids !== void 0 ? ids : []).length > 0)) return [3 /*break*/, 19];
5813
6016
  data = new FormData();
5814
6017
  data.append("data[assetCollectionName]", props.collectionId);
5815
6018
  data.append("data[assetParentId]", JSON.stringify(ids !== null && ids !== void 0 ? ids : []));
@@ -5824,13 +6027,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5824
6027
  url: "".concat(uploadEndpoint, "/batchDeleteDirectory"),
5825
6028
  headers: { "Content-Type": "multipart/form-data" },
5826
6029
  }))];
5827
- case 13:
6030
+ case 18:
5828
6031
  _f.sent();
6032
+ _f.label = 19;
6033
+ case 19:
5829
6034
  if (mapViewRef.current)
5830
6035
  mapViewRef.current.handleClearPolygons();
5831
- _f.label = 14;
5832
- case 14: return [3 /*break*/, 16];
5833
- case 15:
6036
+ _f.label = 20;
6037
+ case 20: return [3 /*break*/, 22];
6038
+ case 21:
5834
6039
  setNotification({
5835
6040
  type: false,
5836
6041
  title: "Incorrect Passcode",
@@ -5839,23 +6044,26 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5839
6044
  setLoading(false);
5840
6045
  setModalVisible(false);
5841
6046
  return [2 /*return*/];
5842
- case 16: return [3 /*break*/, 19];
5843
- case 17:
5844
- err_12 = _f.sent();
5845
- return [3 /*break*/, 19];
5846
- case 18:
6047
+ case 22: return [3 /*break*/, 25];
6048
+ case 23:
6049
+ err_13 = _f.sent();
6050
+ return [3 /*break*/, 25];
6051
+ case 24:
5847
6052
  deletingRef.current = false;
5848
6053
  setDeleting(false);
5849
6054
  return [7 /*endfinally*/];
5850
- case 19:
6055
+ case 25:
5851
6056
  setDeletePasscodeInput("");
6057
+ // INFO: the selection is gone with the rows it covered
6058
+ if (selectAll)
6059
+ handleSelectAllPages(false);
5852
6060
  handleRefresh();
5853
6061
  return [2 /*return*/];
5854
6062
  }
5855
6063
  });
5856
6064
  }); };
5857
6065
  var handleRemoveSelectedData = function () { return __awaiter(void 0, void 0, void 0, function () {
5858
- var deleted, deletable, selectedId_1, deleteIds, res, offlineDataResp, offlineData, selectedIndex_2, doc, err_13;
6066
+ var deleted, deletable, selectedId_1, deleteIds, res, offlineDataResp, offlineData, selectedIndex_2, doc, err_14;
5859
6067
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
5860
6068
  return __generator(this, function (_k) {
5861
6069
  switch (_k.label) {
@@ -5953,7 +6161,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5953
6161
  _k.label = 13;
5954
6162
  case 13: return [3 /*break*/, 16];
5955
6163
  case 14:
5956
- err_13 = _k.sent();
6164
+ err_14 = _k.sent();
5957
6165
  setDeleteModal(false);
5958
6166
  setDeleteFeedId("");
5959
6167
  return [3 /*break*/, 16];
@@ -5975,7 +6183,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5975
6183
  });
5976
6184
  }); };
5977
6185
  var handleCheckDeleteReference = function (selectedData, multipleDelete) { return __awaiter(void 0, void 0, void 0, function () {
5978
- var existDataIds, existsData, handleFindReference_1, referenceSources_1, err_14;
6186
+ var existDataIds, existsData, handleFindReference_1, referenceSources_1, err_15;
5979
6187
  var _a, _b, _c;
5980
6188
  return __generator(this, function (_d) {
5981
6189
  switch (_d.label) {
@@ -6060,7 +6268,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6060
6268
  _d.sent();
6061
6269
  return [3 /*break*/, 5];
6062
6270
  case 4:
6063
- err_14 = _d.sent();
6271
+ err_15 = _d.sent();
6064
6272
  return [3 /*break*/, 5];
6065
6273
  case 5:
6066
6274
  setReferenceDeleteTableData(existsData);
@@ -6073,7 +6281,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6073
6281
  });
6074
6282
  }); };
6075
6283
  var handleCloneSelectedData = function () { return __awaiter(void 0, void 0, void 0, function () {
6076
- var responseData, newDataList_1, res, err_15;
6284
+ var responseData, newDataList_1, res, err_16;
6077
6285
  return __generator(this, function (_a) {
6078
6286
  switch (_a.label) {
6079
6287
  case 0:
@@ -6114,7 +6322,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6114
6322
  _a.label = 4;
6115
6323
  case 4: return [3 /*break*/, 6];
6116
6324
  case 5:
6117
- err_15 = _a.sent();
6325
+ err_16 = _a.sent();
6118
6326
  return [3 /*break*/, 6];
6119
6327
  case 6:
6120
6328
  setLoading(false);
@@ -6123,19 +6331,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6123
6331
  });
6124
6332
  }); };
6125
6333
  var handleBatchUpdateData = function () { return __awaiter(void 0, void 0, void 0, function () {
6126
- var model_1, columnId_1, dataToSubmit_1, isFile, res, updateQuery, matchedRows, selectAllQuery, batchUpdateConfig, res, err_16;
6127
- var _a;
6128
- return __generator(this, function (_b) {
6129
- switch (_b.label) {
6334
+ var model_1, columnId_1, dataToSubmit_1, isFile, res, updateQuery, handleRefuseUpdate, formulaKeptIds_2, isById, responseData, matchedRows, countData, matchedCount, selectAllQuery, batchUpdateConfig, res, err_17;
6335
+ var _a, _b;
6336
+ return __generator(this, function (_c) {
6337
+ switch (_c.label) {
6130
6338
  case 0:
6131
6339
  if (!canBatchUpdate)
6132
6340
  return [2 /*return*/];
6133
6341
  if (isBatchUpdatingRef.current)
6134
6342
  return [2 /*return*/];
6135
6343
  isBatchUpdatingRef.current = true;
6136
- _b.label = 1;
6344
+ _c.label = 1;
6137
6345
  case 1:
6138
- _b.trys.push([1, 10, 11, 12]);
6346
+ _c.trys.push([1, 12, 13, 14]);
6139
6347
  setLoading(true);
6140
6348
  setModalVisible(true);
6141
6349
  model_1 = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
@@ -6152,13 +6360,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6152
6360
  });
6153
6361
  }); }))];
6154
6362
  case 2:
6155
- res = _b.sent();
6363
+ res = _c.sent();
6156
6364
  if (res) {
6157
6365
  setLoading(false);
6158
6366
  setModalVisible(false);
6159
6367
  setBatchUpdateModal(false);
6160
6368
  }
6161
- return [3 /*break*/, 9];
6369
+ return [3 /*break*/, 11];
6162
6370
  case 3:
6163
6371
  if (!(isFile && !dataToSubmit_1[columnId_1])) return [3 /*break*/, 5];
6164
6372
  return [4 /*yield*/, Promise.all(selectedIds.map(function (eachId) { return __awaiter(void 0, void 0, void 0, function () {
@@ -6173,28 +6381,63 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6173
6381
  });
6174
6382
  }); }))];
6175
6383
  case 4:
6176
- _b.sent();
6177
- _b.label = 5;
6384
+ _c.sent();
6385
+ _c.label = 5;
6178
6386
  case 5:
6179
6387
  updateQuery = renderImpSearchFilterConditions();
6180
- if (!(selectAll &&
6181
- (updateQuery === null || updateQuery === void 0 ? void 0 : updateQuery.some(function (q) { var _a; return (_a = q.orQueryGroupId) === null || _a === void 0 ? void 0 : _a.startsWith(flexFilter_1.FLEX_OR_GROUP_PREFIX); })))) return [3 /*break*/, 7];
6388
+ if (!selectAll) return [3 /*break*/, 9];
6389
+ handleRefuseUpdate = function (msg) {
6390
+ setNotification({ type: false, title: "Nothing updated", msg: msg });
6391
+ setLoading(false);
6392
+ setModalVisible(false);
6393
+ setBatchUpdateModal(false);
6394
+ setBatchUpdateData({ columnId: "", columnData: {} });
6395
+ };
6396
+ formulaKeptIds_2 = handleGetFormulaKeptIds();
6397
+ isById = !!formulaKeptIds_2 ||
6398
+ !!(updateQuery === null || updateQuery === void 0 ? void 0 : updateQuery.some(function (q) {
6399
+ var _a;
6400
+ return !BATCH_UPDATE_QUERY_TYPES.includes(q.type) ||
6401
+ !!((_a = q.foreign) === null || _a === void 0 ? void 0 : _a.length) ||
6402
+ !!q.related ||
6403
+ !!q.orQuery ||
6404
+ !!q.orQueryGroupId;
6405
+ }));
6406
+ if (!isById) return [3 /*break*/, 7];
6182
6407
  return [4 /*yield*/, readServerQuery.call({
6183
6408
  type: "list",
6184
6409
  query: updateQuery,
6185
6410
  stopLimit: true,
6186
6411
  })];
6187
6412
  case 6:
6188
- matchedRows = _b.sent();
6413
+ responseData = _c.sent();
6414
+ matchedRows = ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _a !== void 0 ? _a : []).filter(function (eachRow) {
6415
+ return !formulaKeptIds_2 || formulaKeptIds_2.has(handleGetRowId(eachRow));
6416
+ });
6417
+ if (matchedRows.length !== selectAllSizeRef.current)
6418
+ return [2 /*return*/, handleRefuseUpdate(handleGetChangedListMessage(matchedRows.length))];
6419
+ if (matchedRows.length > SELECT_ALL_ID_CAP)
6420
+ return [2 /*return*/, handleRefuseUpdate("Up to ".concat(SELECT_ALL_ID_CAP.toLocaleString(), " records can be updated at once with these filters. Narrow the filters and try again."))];
6189
6421
  updateQuery = [
6190
6422
  {
6191
6423
  queryId: serverId,
6192
6424
  type: "in",
6193
- value: ((_a = matchedRows === null || matchedRows === void 0 ? void 0 : matchedRows.data) !== null && _a !== void 0 ? _a : []).map(function (eachRow) { return eachRow === null || eachRow === void 0 ? void 0 : eachRow[serverId]; }),
6425
+ value: matchedRows.map(function (eachRow) { return eachRow === null || eachRow === void 0 ? void 0 : eachRow[serverId]; }),
6194
6426
  },
6195
6427
  ];
6196
- _b.label = 7;
6197
- case 7:
6428
+ return [3 /*break*/, 9];
6429
+ case 7: return [4 /*yield*/, readServerQuery.call({
6430
+ type: "list",
6431
+ query: updateQuery,
6432
+ limit: 1,
6433
+ })];
6434
+ case 8:
6435
+ countData = _c.sent();
6436
+ matchedCount = (_b = countData === null || countData === void 0 ? void 0 : countData.count) !== null && _b !== void 0 ? _b : 0;
6437
+ if (matchedCount !== selectAllSizeRef.current)
6438
+ return [2 /*return*/, handleRefuseUpdate(handleGetChangedListMessage(matchedCount))];
6439
+ _c.label = 9;
6440
+ case 9:
6198
6441
  selectAllQuery = updateQuery
6199
6442
  ? updateQuery
6200
6443
  : [
@@ -6223,34 +6466,34 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6223
6466
  batchUpdateConfig["data"] = dataToSubmit_1;
6224
6467
  }
6225
6468
  return [4 /*yield*/, writeServerQuery.call("batchUpdate", batchUpdateConfig)];
6226
- case 8:
6227
- res = _b.sent();
6469
+ case 10:
6470
+ res = _c.sent();
6228
6471
  if (res) {
6229
6472
  handleRefresh(false, true);
6230
6473
  }
6231
- _b.label = 9;
6232
- case 9: return [3 /*break*/, 12];
6233
- case 10:
6234
- err_16 = _b.sent();
6235
- if (err_16.response) {
6474
+ _c.label = 11;
6475
+ case 11: return [3 /*break*/, 14];
6476
+ case 12:
6477
+ err_17 = _c.sent();
6478
+ if (err_17.response) {
6236
6479
  setNotification({
6237
6480
  type: false,
6238
6481
  title: "Error",
6239
- msg: handleGetWriteErrorMessage(err_16.response),
6482
+ msg: handleGetWriteErrorMessage(err_17.response),
6240
6483
  });
6241
6484
  }
6242
- return [3 /*break*/, 12];
6243
- case 11:
6485
+ return [3 /*break*/, 14];
6486
+ case 13:
6244
6487
  isBatchUpdatingRef.current = false;
6245
6488
  return [7 /*endfinally*/];
6246
- case 12:
6489
+ case 14:
6247
6490
  setBatchUpdateData({ columnId: "", columnData: {} });
6248
6491
  return [2 /*return*/];
6249
6492
  }
6250
6493
  });
6251
6494
  }); };
6252
6495
  var handleUploadOfflineData = function () { return __awaiter(void 0, void 0, void 0, function () {
6253
- var dataUploadedId, offlineDataResp, offlineData, offlineDataIds, updateDataRes, updateDataList, _loop_1, i, err_17, success, fullDataResp, fullData, updatedData;
6496
+ var dataUploadedId, offlineDataResp, offlineData, offlineDataIds, updateDataRes, updateDataList, _loop_1, i, err_18, success, fullDataResp, fullData, updatedData;
6254
6497
  var _a, _b, _c, _d, _e, _f;
6255
6498
  return __generator(this, function (_g) {
6256
6499
  switch (_g.label) {
@@ -6286,7 +6529,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6286
6529
  updateDataRes = _g.sent();
6287
6530
  updateDataList = (_b = updateDataRes === null || updateDataRes === void 0 ? void 0 : updateDataRes.data) !== null && _b !== void 0 ? _b : [];
6288
6531
  _loop_1 = function (i) {
6289
- var eachOfflineData, offlineDataId, storedBaseline, serverDoc, isUpdate, preComplete, res, err_18;
6532
+ var eachOfflineData, offlineDataId, storedBaseline, serverDoc, isUpdate, preComplete, res, err_19;
6290
6533
  var _h;
6291
6534
  return __generator(this, function (_j) {
6292
6535
  switch (_j.label) {
@@ -6347,7 +6590,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6347
6590
  _j.sent();
6348
6591
  return [3 /*break*/, 8];
6349
6592
  case 7:
6350
- err_18 = _j.sent();
6593
+ err_19 = _j.sent();
6351
6594
  return [3 /*break*/, 8];
6352
6595
  case 8: return [2 /*return*/];
6353
6596
  }
@@ -6366,7 +6609,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6366
6609
  return [3 /*break*/, 4];
6367
6610
  case 7: return [3 /*break*/, 9];
6368
6611
  case 8:
6369
- err_17 = _g.sent();
6612
+ err_18 = _g.sent();
6370
6613
  return [3 /*break*/, 9];
6371
6614
  case 9:
6372
6615
  success = dataUploadedId.length === offlineData.length;
@@ -6419,7 +6662,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6419
6662
  var columnTypeActions = {
6420
6663
  canUpdate: canUpdateRecord,
6421
6664
  dateWarnings: isDateWarnings,
6422
- onButtonClick: (_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.onButtonClick,
6665
+ onButtonClick: (_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.onButtonClick,
6423
6666
  onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
6424
6667
  var _a;
6425
6668
  return __generator(this, function (_b) {
@@ -6436,7 +6679,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6436
6679
  }
6437
6680
  });
6438
6681
  }); },
6439
- onTimeTrackingAction: ((_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.onTimeTrackingAction) && canUpdateRecord
6682
+ onTimeTrackingAction: ((_110 = props.organise) === null || _110 === void 0 ? void 0 : _110.onTimeTrackingAction) && canUpdateRecord
6440
6683
  ? function (rowId, columnId, action) {
6441
6684
  return handleTimeTrackingAction(rowId, columnId, action);
6442
6685
  }
@@ -6465,7 +6708,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6465
6708
  });
6466
6709
  }); };
6467
6710
  var handleSubmitData = function (type, rowId, columnId, data, offlineId, isOfflineUpdate, isDraft) { return __awaiter(void 0, void 0, void 0, function () {
6468
- var selectedId, id, handleIsSavedSubmit, createSelectedData_1, uniqueDataStructure, uniqueColumnId, res, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_3, err_19, isUniqueIdFieldCreate, isExistingDoc, newRecordData_1, changedAttributeIds, baseDraftValue, hasBaseDraftChange, offlineDataResp, clonedForOffline, tempData, selectedIndex_4, offlineData, err_20, dataToSubmit_2, changedAttributeIds, baseDraftValue, hasBaseDraftChange, operationType, currentRow, wentToServer, dataId, err_21, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_5, _a;
6711
+ var selectedId, id, handleIsSavedSubmit, createSelectedData_1, uniqueDataStructure, uniqueColumnId, res, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_3, err_20, isUniqueIdFieldCreate, isExistingDoc, newRecordData_1, changedAttributeIds, baseDraftValue, hasBaseDraftChange, offlineDataResp, clonedForOffline, tempData, selectedIndex_4, offlineData, err_21, dataToSubmit_2, changedAttributeIds, baseDraftValue, hasBaseDraftChange, operationType, currentRow, wentToServer, dataId, err_22, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_5, _a;
6469
6712
  var _b, _c, _d, _e;
6470
6713
  var _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
6471
6714
  return __generator(this, function (_z) {
@@ -6597,7 +6840,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6597
6840
  res = true;
6598
6841
  return [3 /*break*/, 9];
6599
6842
  case 8:
6600
- err_19 = _z.sent();
6843
+ err_20 = _z.sent();
6601
6844
  return [3 /*break*/, 9];
6602
6845
  case 9: return [3 /*break*/, 16];
6603
6846
  case 10:
@@ -6764,7 +7007,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6764
7007
  res = true;
6765
7008
  return [3 /*break*/, 22];
6766
7009
  case 21:
6767
- err_20 = _z.sent();
7010
+ err_21 = _z.sent();
6768
7011
  return [3 /*break*/, 22];
6769
7012
  case 22: return [3 /*break*/, 25];
6770
7013
  case 23:
@@ -6914,8 +7157,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6914
7157
  dataId = res ? id : "";
6915
7158
  return [2 /*return*/, dataId];
6916
7159
  case 39:
6917
- err_21 = _z.sent();
6918
- console.log("error", err_21);
7160
+ err_22 = _z.sent();
7161
+ console.log("error", err_22);
6919
7162
  // INFO: clear in-flight guard on failure so the next save retries as a create
6920
7163
  if (isCreatingRef.current) {
6921
7164
  isCreatingRef.current = false;
@@ -6926,7 +7169,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6926
7169
  id &&
6927
7170
  !offlineId &&
6928
7171
  !isOfflineUpdate &&
6929
- !err_21.response)) return [3 /*break*/, 44];
7172
+ !err_22.response)) return [3 /*break*/, 44];
6930
7173
  _z.label = 40;
6931
7174
  case 40:
6932
7175
  _z.trys.push([40, 43, , 44]);
@@ -6985,11 +7228,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6985
7228
  _a = _z.sent();
6986
7229
  return [3 /*break*/, 44];
6987
7230
  case 44:
6988
- if (err_21.response) {
7231
+ if (err_22.response) {
6989
7232
  setNotification({
6990
7233
  type: false,
6991
7234
  title: "Error",
6992
- msg: handleGetWriteErrorMessage(err_21.response),
7235
+ msg: handleGetWriteErrorMessage(err_22.response),
6993
7236
  });
6994
7237
  }
6995
7238
  return [3 /*break*/, 45];
@@ -7036,7 +7279,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7036
7279
  });
7037
7280
  }); };
7038
7281
  var handleSubmit = function (isDraft) { return __awaiter(void 0, void 0, void 0, function () {
7039
- var preComplete, res, updatedMarkdownData_1, uploadedData_2, uploadTypes_1, err_22;
7282
+ var preComplete, res, updatedMarkdownData_1, uploadedData_2, uploadTypes_1, err_23;
7040
7283
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
7041
7284
  return __generator(this, function (_m) {
7042
7285
  switch (_m.label) {
@@ -7169,7 +7412,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7169
7412
  isSubmittingRef.current = false;
7170
7413
  return [3 /*break*/, 9];
7171
7414
  case 8:
7172
- err_22 = _m.sent();
7415
+ err_23 = _m.sent();
7173
7416
  setModalVisible(false);
7174
7417
  setLoading(false);
7175
7418
  isSubmittingRef.current = false;
@@ -7179,7 +7422,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7179
7422
  });
7180
7423
  }); };
7181
7424
  var handleUpdateKanbanChecked = function (id, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
7182
- var err_23;
7425
+ var err_24;
7183
7426
  var _a;
7184
7427
  return __generator(this, function (_b) {
7185
7428
  switch (_b.label) {
@@ -7197,7 +7440,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7197
7440
  _b.sent();
7198
7441
  return [3 /*break*/, 4];
7199
7442
  case 3:
7200
- err_23 = _b.sent();
7443
+ err_24 = _b.sent();
7201
7444
  return [3 /*break*/, 4];
7202
7445
  case 4: return [2 /*return*/];
7203
7446
  }
@@ -7574,7 +7817,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7574
7817
  handleUpdateChangeData(clonedData);
7575
7818
  };
7576
7819
  var handleOnChangeSelect = function (id, value) { return __awaiter(void 0, void 0, void 0, function () {
7577
- var _a, data, model, isUpdate, clonedData, refetchReference, currentSchema, allowedWatchedColumnTypes_1, watchedColumns, _i, watchedColumns_1, eachWatched, dependency, referenceRQ, valueRes, err_24;
7820
+ var _a, data, model, isUpdate, clonedData, refetchReference, currentSchema, allowedWatchedColumnTypes_1, watchedColumns, _i, watchedColumns_1, eachWatched, dependency, referenceRQ, valueRes, err_25;
7578
7821
  return __generator(this, function (_b) {
7579
7822
  switch (_b.label) {
7580
7823
  case 0:
@@ -7637,7 +7880,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7637
7880
  return [3 /*break*/, 3];
7638
7881
  case 6: return [3 /*break*/, 8];
7639
7882
  case 7:
7640
- err_24 = _b.sent();
7883
+ err_25 = _b.sent();
7641
7884
  return [3 /*break*/, 8];
7642
7885
  case 8:
7643
7886
  clonedData[id] = value;
@@ -7715,7 +7958,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7715
7958
  }
7716
7959
  };
7717
7960
  var handleStepCSV = function () { return __awaiter(void 0, void 0, void 0, function () {
7718
- var csvList_1, _loop_2, _i, _a, _b, eachKey, eachValue, valid_1, errorValue_1, excelFormData, updateFields, response, open_1, err_25;
7961
+ var csvList_1, _loop_2, _i, _a, _b, eachKey, eachValue, valid_1, errorValue_1, excelFormData, updateFields, response, open_1, err_26;
7719
7962
  var _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
7720
7963
  return __generator(this, function (_p) {
7721
7964
  switch (_p.label) {
@@ -7862,12 +8105,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7862
8105
  _p.label = 5;
7863
8106
  case 5: return [3 /*break*/, 7];
7864
8107
  case 6:
7865
- err_25 = _p.sent();
8108
+ err_26 = _p.sent();
7866
8109
  setLoading(false);
7867
8110
  setNotification({
7868
8111
  type: false,
7869
8112
  title: "Import Error",
7870
- msg: err_25.message,
8113
+ msg: err_26.message,
7871
8114
  });
7872
8115
  return [3 /*break*/, 7];
7873
8116
  case 7: return [2 /*return*/];
@@ -7875,7 +8118,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7875
8118
  });
7876
8119
  }); };
7877
8120
  var handleExportCSVData = function (downloadLinkOnly, printOnly) { return __awaiter(void 0, void 0, void 0, function () {
7878
- var exportQueryList, formulaRows, kept, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg, err_26;
8121
+ var exportQueryList, formulaRows, kept, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg, err_27;
7879
8122
  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;
7880
8123
  return __generator(this, function (_2) {
7881
8124
  switch (_2.label) {
@@ -7892,10 +8135,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7892
8135
  formulaRows = formulaFullReadRef.current;
7893
8136
  if (formulaFlexQueries.length > 0 && formulaRows) {
7894
8137
  kept = handleApplyFormulaView(formulaRows.rows, formulaRows.displayRows).rows;
8138
+ // INFO: these rows came through the list, which renames _id to id
7895
8139
  exportQueryList.push({
7896
8140
  type: "in",
7897
8141
  queryId: serverId,
7898
- value: kept.map(function (eachRow) { return eachRow === null || eachRow === void 0 ? void 0 : eachRow[serverId]; }),
8142
+ value: kept.map(function (eachRow) { return handleGetRowId(eachRow); }),
7899
8143
  });
7900
8144
  }
7901
8145
  baseUrl = props.devSettings.functionEndpoint;
@@ -7960,7 +8204,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7960
8204
  setExportCSVEmail((_1 = (_0 = props.devSettings.currentUser) === null || _0 === void 0 ? void 0 : _0.userEmail) !== null && _1 !== void 0 ? _1 : "");
7961
8205
  return [3 /*break*/, 6];
7962
8206
  case 5:
7963
- err_26 = _2.sent();
8207
+ err_27 = _2.sent();
7964
8208
  setNotification({
7965
8209
  type: true,
7966
8210
  title: "Export Failed",
@@ -8016,7 +8260,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8016
8260
  });
8017
8261
  }); };
8018
8262
  var handleExportReadPDF = function () { return __awaiter(void 0, void 0, void 0, function () {
8019
- var elementToExport, dimensionsConfig, headerConfig_1, isMobile, scale, html2canvasOptions, originalStyles, captureWidth, captureHeight, canvas, pageWidth, pageHeight, orientation_1, pdf, pixelsToMm, elementWidthMm, elementHeightMm, pageSize, margin, headerHeight, imageDataURL, imageWidth_1, imageHeight_1, hasImage, hasText, img_1, err_27, textHeight, usableWidth, imgHeight, usableHeight, currentY, imgX, imgY, imgW, imgH, finalX, textY, textX, heightLeft, page, currentY, imgX, imgY, imgW, imgH, finalX, textY, textX, sourceY, sourceHeight, pageCanvas, ctx, pageData, pdfBlob, err_28;
8263
+ var elementToExport, dimensionsConfig, headerConfig_1, isMobile, scale, html2canvasOptions, originalStyles, captureWidth, captureHeight, canvas, pageWidth, pageHeight, orientation_1, pdf, pixelsToMm, elementWidthMm, elementHeightMm, pageSize, margin, headerHeight, imageDataURL, imageWidth_1, imageHeight_1, hasImage, hasText, img_1, err_28, textHeight, usableWidth, imgHeight, usableHeight, currentY, imgX, imgY, imgW, imgH, finalX, textY, textX, heightLeft, page, currentY, imgX, imgY, imgW, imgH, finalX, textY, textX, sourceY, sourceHeight, pageCanvas, ctx, pageData, pdfBlob, err_29;
8020
8264
  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;
8021
8265
  return __generator(this, function (_4) {
8022
8266
  switch (_4.label) {
@@ -8187,8 +8431,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8187
8431
  headerHeight = imageHeight_1 + 2;
8188
8432
  return [3 /*break*/, 13];
8189
8433
  case 12:
8190
- err_27 = _4.sent();
8191
- console.error("Failed to load PDF header image:", err_27);
8434
+ err_28 = _4.sent();
8435
+ console.error("Failed to load PDF header image:", err_28);
8192
8436
  console.error("Image source:", headerConfig_1.image.src);
8193
8437
  return [3 /*break*/, 13];
8194
8438
  case 13:
@@ -8329,8 +8573,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8329
8573
  }
8330
8574
  return [3 /*break*/, 17];
8331
8575
  case 15:
8332
- err_28 = _4.sent();
8333
- console.error("PDF export error:", err_28);
8576
+ err_29 = _4.sent();
8577
+ console.error("PDF export error:", err_29);
8334
8578
  setNotification({
8335
8579
  type: false,
8336
8580
  title: "Error",
@@ -8570,7 +8814,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8570
8814
  : getActiveUserHiddenColumnIds().includes(column.id);
8571
8815
  };
8572
8816
  var renderViewSettingsContent = function () {
8573
- var _a, _b, _c, _d, _e, _f, _g;
8817
+ var _a, _b, _c, _d, _e, _f;
8574
8818
  var viewColumns = getViewSettingsColumns();
8575
8819
  var hiddenCount = viewColumns.filter(getIsColumnHidden).length;
8576
8820
  var visibleCount = viewColumns.length - hiddenCount;
@@ -8665,10 +8909,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8665
8909
  type: value,
8666
8910
  });
8667
8911
  } })))),
8668
- ((_f = props.organise) === null || _f === void 0 ? void 0 : _f.showGroupByFeature) && (react_1.default.createElement("div", { className: "mt-3 border-t pt-3 ".concat(dividerColor) },
8912
+ isGroupPickerShown && (react_1.default.createElement("div", { className: "mt-3 border-t pt-3 ".concat(dividerColor) },
8669
8913
  react_1.default.createElement("p", { className: "text-sm font-medium ".concat(labelColor) }, "Group"),
8670
8914
  react_1.default.createElement("div", { className: "mt-1" },
8671
- react_1.default.createElement(select_1.Select, { id: "dtw-view-group-by", portalDropdown: true, label: "", placeholder: "Column", value: groupId !== null && groupId !== void 0 ? groupId : "", darkMode: (_g = props.organise) === null || _g === void 0 ? void 0 : _g.darkMode, options: handleGetGroupByOptions(), onChange: function (value) {
8915
+ react_1.default.createElement(select_1.Select, { id: "dtw-view-group-by", portalDropdown: true, label: "", placeholder: "Column", value: groupId !== null && groupId !== void 0 ? groupId : "", darkMode: (_f = props.organise) === null || _f === void 0 ? void 0 : _f.darkMode, options: handleGetGroupByOptions(), onChange: function (value) {
8672
8916
  return handleChangeGroupBy(value !== null && value !== void 0 ? value : "", true);
8673
8917
  } })))),
8674
8918
  react_1.default.createElement("div", { className: "mt-3 border-t pt-3 ".concat(dividerColor) },
@@ -8690,8 +8934,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8690
8934
  : rows;
8691
8935
  };
8692
8936
  /* eslint-disable */
8693
- var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_106 = props.bareSettings) === null || _106 === void 0 ? void 0 : _106.bareNewDTW]);
8694
- var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_107 = props.bareSettings) === null || _107 === void 0 ? void 0 : _107.bareNewDTW]);
8937
+ var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_111 = props.bareSettings) === null || _111 === void 0 ? void 0 : _111.bareNewDTW]);
8938
+ var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_112 = props.bareSettings) === null || _112 === void 0 ? void 0 : _112.bareNewDTW]);
8695
8939
  /* eslint-enable */
8696
8940
  // INFO: beside a record's title, the pencil opens its edit form for whoever
8697
8941
  // may update, and the bubble opens comments and logs for anyone who can see
@@ -9897,7 +10141,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9897
10141
  props.renderSettings.renderListUI(actionComponent, filterComponent_1, dataComponent)));
9898
10142
  }
9899
10143
  var renderListFilterElements = function () {
9900
- var _a, _b, _c, _d, _e, _f, _g, _h;
10144
+ var _a, _b, _c, _d, _e, _f, _g;
9901
10145
  // INFO: When bareListFilterAsPopup is true, filters are shown in a popup instead.
9902
10146
  if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListFilterAsPopup)
9903
10147
  return null;
@@ -9922,8 +10166,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9922
10166
  }
9923
10167
  var filterElementList = [];
9924
10168
  if (!((_f = props.organise) === null || _f === void 0 ? void 0 : _f.filterComponentNewRow)) {
9925
- if ((_g = props.organise) === null || _g === void 0 ? void 0 : _g.showGroupByFeature) {
9926
- filterElementList.push(react_1.default.createElement(select_1.Select, { portalDropdown: true, label: "Group", darkMode: (_h = props.organise) === null || _h === void 0 ? void 0 : _h.darkMode, options: handleGetGroupByOptions(), value: groupId !== null && groupId !== void 0 ? groupId : "", onChange: function (value) { return handleChangeGroupBy(value !== null && value !== void 0 ? value : "", true); } }));
10169
+ if (isGroupPickerShown) {
10170
+ filterElementList.push(react_1.default.createElement(select_1.Select, { portalDropdown: true, label: "Group", darkMode: (_g = props.organise) === null || _g === void 0 ? void 0 : _g.darkMode, options: handleGetGroupByOptions(), value: groupId !== null && groupId !== void 0 ? groupId : "", onChange: function (value) { return handleChangeGroupBy(value !== null && value !== void 0 ? value : "", true); } }));
9927
10171
  }
9928
10172
  if (filterComponent_1 &&
9929
10173
  Array.isArray(filterComponent_1) &&
@@ -9970,7 +10214,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9970
10214
  // per page in one panel. Standard on the new DTW; videColumnEnabled
9971
10215
  // keeps it available to legacy and bare DTWs. A calendar has no
9972
10216
  // columns, sort or pages, so it gets no panel.
9973
- if (isViewSettingsEnabled && (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) !== "calendar") {
10217
+ if (isViewSettingsEnabled && !isViewSettingsHiddenForTab) {
9974
10218
  var hiddenColumnCount_1 = getViewSettingsColumns().filter(getIsColumnHidden).length;
9975
10219
  // INFO: desktop and mobile both render, CSS decides which is shown —
9976
10220
  // distinct test ids keep the two unambiguous for e2e
@@ -10081,7 +10325,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10081
10325
  return filterElementList;
10082
10326
  }
10083
10327
  if ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.filterComponentNewRow) {
10084
- if (props.organise.showGroupByFeature) {
10328
+ if (isGroupPickerShown) {
10085
10329
  filterElementList.push(react_1.default.createElement(select_1.Select, { portalDropdown: true, label: "Group", darkMode: (_e = props.organise) === null || _e === void 0 ? void 0 : _e.darkMode, options: handleGetGroupByOptions(), value: groupId !== null && groupId !== void 0 ? groupId : "", onChange: function (value) { return handleChangeGroupBy(value !== null && value !== void 0 ? value : "", true); } }));
10086
10330
  }
10087
10331
  if (filterComponent_1 &&
@@ -10151,7 +10395,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10151
10395
  : undefined,
10152
10396
  onViewSettingsClick: isMobileToolbar_1 &&
10153
10397
  isViewSettingsEnabled &&
10154
- (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) !== "calendar"
10398
+ !isViewSettingsHiddenForTab
10155
10399
  ? function () { return setViewSettingsModalOpen(true); }
10156
10400
  : undefined,
10157
10401
  viewSettingsCount: getViewSettingsColumns().filter(getIsColumnHidden).length,
@@ -10711,7 +10955,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10711
10955
  // around it. Each is saved with only its changed fields, then patched into
10712
10956
  // the list in place
10713
10957
  var handleSaveRecordChanges = function (changes) { return __awaiter(void 0, void 0, void 0, function () {
10714
- var _loop_3, _i, changes_1, eachChange, err_29;
10958
+ var _loop_3, _i, changes_1, eachChange, err_30;
10715
10959
  var _a;
10716
10960
  return __generator(this, function (_b) {
10717
10961
  switch (_b.label) {
@@ -10760,12 +11004,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10760
11004
  return [3 /*break*/, 2];
10761
11005
  case 5: return [3 /*break*/, 8];
10762
11006
  case 6:
10763
- err_29 = _b.sent();
11007
+ err_30 = _b.sent();
10764
11008
  setNotification({
10765
11009
  type: false,
10766
11010
  title: "Error",
10767
- msg: (err_29 === null || err_29 === void 0 ? void 0 : err_29.response)
10768
- ? handleGetWriteErrorMessage(err_29.response)
11011
+ msg: (err_30 === null || err_30 === void 0 ? void 0 : err_30.response)
11012
+ ? handleGetWriteErrorMessage(err_30.response)
10769
11013
  : "The changes could not be saved",
10770
11014
  });
10771
11015
  return [3 /*break*/, 8];
@@ -11169,7 +11413,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
11169
11413
  // tableData / spaceTableData, so handleBuildNewTableGroups() keeps building
11170
11414
  // bands from one source; each group advances its own cursor
11171
11415
  var handleFetchGroupNextPage = function (groupKey) { return __awaiter(void 0, void 0, void 0, function () {
11172
- var current, groupSize, cursor, generation, page_1, existingIds_1, appendRaw_1, appendPretty_1, nextCursor, err_30, nextKey;
11416
+ var current, groupSize, cursor, generation, page_1, existingIds_1, appendRaw_1, appendPretty_1, nextCursor, err_31, nextKey;
11173
11417
  var _a, _b, _c, _d, _e, _f, _g;
11174
11418
  return __generator(this, function (_h) {
11175
11419
  switch (_h.label) {
@@ -11233,7 +11477,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
11233
11477
  });
11234
11478
  return [3 /*break*/, 5];
11235
11479
  case 3:
11236
- err_30 = _h.sent();
11480
+ err_31 = _h.sent();
11237
11481
  if (generation !== groupPagingGenRef.current)
11238
11482
  return [2 /*return*/];
11239
11483
  // INFO: clear the in-flight flag so a failed page can be retried on the
@@ -11258,7 +11502,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
11258
11502
  // INFO: page mode — swaps ONE group's rows for its page `page`; every other
11259
11503
  // group keeps the page it is on
11260
11504
  var handleFetchGroupPage = function (groupKey, page) { return __awaiter(void 0, void 0, void 0, function () {
11261
- var generation, result, keptRaw_1, keptPretty_1, loaded, err_31;
11505
+ var generation, result, keptRaw_1, keptPretty_1, loaded, err_32;
11262
11506
  return __generator(this, function (_a) {
11263
11507
  switch (_a.label) {
11264
11508
  case 0:
@@ -11294,7 +11538,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
11294
11538
  });
11295
11539
  return [3 /*break*/, 4];
11296
11540
  case 3:
11297
- err_31 = _a.sent();
11541
+ err_32 = _a.sent();
11298
11542
  if (generation !== groupPagingGenRef.current)
11299
11543
  return [2 /*return*/];
11300
11544
  handleSetGroupPageState(groupKey, { loadingMore: false });
@@ -11371,8 +11615,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
11371
11615
  react_1.default.createElement("div", { className: "font-semibold text-md mt-5" },
11372
11616
  "Group By ",
11373
11617
  eachKey),
11374
- react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], referencesOptions: listReferencesOptions, size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: ((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table) ||
11375
- isFormulaView, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
11618
+ react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], referencesOptions: listReferencesOptions, size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? handleGetSelectAllText() : "", disableSelectFullData: ((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table) ||
11619
+ isFormulaView ||
11620
+ isSelectAllUncountable, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
11376
11621
  selectedIds.length > 0 &&
11377
11622
  canBatchUpdate &&
11378
11623
  !((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
@@ -11474,7 +11719,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
11474
11719
  ? function (groupKey, page) {
11475
11720
  return handleFetchGroupPage(groupKey, page);
11476
11721
  }
11477
- : 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: ((_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.disableSelectFullData) === null || _g === void 0 ? void 0 : _g.table) || isFormulaView, maxSelectedCount: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareListMaxSelectedCount, mobileView: (_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareListMobileView, mobileTooltip: (_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareMobileTooltip, gridLines: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListGridLines, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (canBatchUpdate &&
11722
+ : 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 ? handleGetSelectAllText() : "", disableSelectFullData: ((_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.disableSelectFullData) === null || _g === void 0 ? void 0 : _g.table) ||
11723
+ isFormulaView ||
11724
+ isSelectAllUncountable, maxSelectedCount: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareListMaxSelectedCount, mobileView: (_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareListMobileView, mobileTooltip: (_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareMobileTooltip, gridLines: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListGridLines, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (canBatchUpdate &&
11478
11725
  !((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareHideTableExtraMultipleAction)
11479
11726
  ? [
11480
11727
  {
@@ -11634,7 +11881,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
11634
11881
  right: (_17 = (_16 = props.bareSettings) === null || _16 === void 0 ? void 0 : _16.bareListTablePinColumns) === null || _17 === void 0 ? void 0 : _17.right,
11635
11882
  } }));
11636
11883
  }
11637
- 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: ((_19 = (_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.disableSelectFullData) === null || _19 === void 0 ? void 0 : _19.table) || isFormulaView, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
11884
+ 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 ? handleGetSelectAllText() : "", disableSelectFullData: ((_19 = (_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.disableSelectFullData) === null || _19 === void 0 ? void 0 : _19.table) ||
11885
+ isFormulaView ||
11886
+ isSelectAllUncountable, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
11638
11887
  selectedIds.length > 0 &&
11639
11888
  canBatchUpdate &&
11640
11889
  !((_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
@@ -12075,7 +12324,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12075
12324
  else if (selectedTabData.viewType === "list") {
12076
12325
  // INFO: when bareNewDTW is enabled, render NewList instead of legacy List
12077
12326
  if ((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareNewDTW) {
12078
- return (react_1.default.createElement(newList_1.NewList, __assign({ darkModeBg: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.disableSelectFullData) === null || _w === void 0 ? void 0 : _w.list) || isFormulaView, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", maxSelectedCount: (_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareListMaxSelectedCount, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
12327
+ return (react_1.default.createElement(newList_1.NewList, __assign({ darkModeBg: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.disableSelectFullData) === null || _w === void 0 ? void 0 : _w.list) ||
12328
+ isFormulaView ||
12329
+ isSelectAllUncountable, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? handleGetSelectAllText() : "", maxSelectedCount: (_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareListMaxSelectedCount, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
12079
12330
  selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
12080
12331
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
12081
12332
  handleCloneSelectedData();
@@ -12099,7 +12350,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12099
12350
  (renderCheckGroupPaging() && !renderCheckScrollMode()), customPaginationSize: customPaginationSize, mobileTooltip: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListMobileTooltip, onRowEdit: recordEditAction, onRowActivity: recordActivityAction })));
12100
12351
  }
12101
12352
  return (react_1.default.createElement(react_1.default.Fragment, null,
12102
- react_1.default.createElement(list_1.List, { darkModeBg: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableSelectFullData) === null || _7 === void 0 ? void 0 : _7.list) || isFormulaView, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
12353
+ react_1.default.createElement(list_1.List, { darkModeBg: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableSelectFullData) === null || _7 === void 0 ? void 0 : _7.list) ||
12354
+ isFormulaView ||
12355
+ isSelectAllUncountable, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? handleGetSelectAllText() : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
12103
12356
  selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
12104
12357
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
12105
12358
  handleCloneSelectedData();
@@ -12468,6 +12721,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12468
12721
  }
12469
12722
  else if (selectedTabData.viewType === "timeline") {
12470
12723
  var timelineSettings_1 = selectedTabData.timelineSettings;
12724
+ // INFO: bars are the primary colour; a group — picked in the view or
12725
+ // saved on the tab — gives each of its values a colour of its own
12726
+ var timelineGroupId_1 = groupId || (timelineSettings_1 === null || timelineSettings_1 === void 0 ? void 0 : timelineSettings_1.groupId) || "";
12471
12727
  // INFO: pin each group value to a fixed colour — deterministic across
12472
12728
  // fetches, mirroring the calendar's groupColorMap / first-appearance
12473
12729
  // assignment so the two views colour the same data the same way
@@ -12475,22 +12731,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12475
12731
  ? JSON.parse(JSON.stringify(timelineSettings_1.groupColor))
12476
12732
  : ["red", "blue", "green", "indigo", "orange", "violet", "yellow"];
12477
12733
  var timelineValuesWithColour_1 = {};
12478
- if (timelineSettings_1 === null || timelineSettings_1 === void 0 ? void 0 : timelineSettings_1.groupColorMap) {
12734
+ if ((timelineSettings_1 === null || timelineSettings_1 === void 0 ? void 0 : timelineSettings_1.groupColorMap) &&
12735
+ timelineGroupId_1 === timelineSettings_1.groupId) {
12479
12736
  Object.assign(timelineValuesWithColour_1, timelineSettings_1.groupColorMap);
12480
12737
  }
12481
- else if (timelineSettings_1 === null || timelineSettings_1 === void 0 ? void 0 : timelineSettings_1.groupId) {
12482
- spaceTableData.map(function (eachTableData) {
12483
- var _a;
12738
+ else if (timelineGroupId_1) {
12739
+ // INFO: colours repeat past the palette rather than running out
12740
+ var colourIndex_1 = 0;
12741
+ spaceTableData.forEach(function (eachTableData) {
12484
12742
  if (timelineColorPalette_1.length === 0)
12485
- return null;
12486
- var tableValue = eachTableData[(_a = timelineSettings_1.groupId) !== null && _a !== void 0 ? _a : ""];
12487
- if (!tableValue)
12488
- return null;
12489
- if (tableValue && !timelineValuesWithColour_1[tableValue]) {
12490
- timelineValuesWithColour_1[tableValue] =
12491
- timelineColorPalette_1.splice(0, 1)[0];
12492
- }
12493
- return null;
12743
+ return;
12744
+ var groupKey = (0, timelineBars_1.handleGetGroupValueKey)(eachTableData[timelineGroupId_1]);
12745
+ if (!groupKey || timelineValuesWithColour_1[groupKey])
12746
+ return;
12747
+ timelineValuesWithColour_1[groupKey] =
12748
+ timelineColorPalette_1[colourIndex_1 % timelineColorPalette_1.length];
12749
+ colourIndex_1 += 1;
12494
12750
  });
12495
12751
  }
12496
12752
  // INFO: Tailwind palette hexes — the Gantt colours bars through Apex's
@@ -12522,24 +12778,63 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12522
12778
  if (!startDate.isValid() || !endDate.isValid())
12523
12779
  continue;
12524
12780
  var color = undefined;
12525
- if (timelineSettings_1.groupId &&
12526
- eachData[timelineSettings_1.groupId]) {
12527
- var groupValue = eachData[timelineSettings_1.groupId];
12528
- color = TIMELINE_COLOR_HEX_1[timelineValuesWithColour_1[groupValue]];
12781
+ var group = undefined;
12782
+ if (timelineGroupId_1 && eachData[timelineGroupId_1]) {
12783
+ group = (0, timelineBars_1.handleGetGroupValueKey)(eachData[timelineGroupId_1]);
12784
+ color = TIMELINE_COLOR_HEX_1[timelineValuesWithColour_1[group]];
12529
12785
  }
12530
- tasks.push(__assign(__assign({ id: eachData.id, name: (_a = (0, readModule_1.handleCutPreviewText)(eachData[timelineSettings_1.title])) !== null && _a !== void 0 ? _a : "" }, (0, timelineBars_1.handleGetTimelineSpan)(startDate, endDate)), { color: color }));
12786
+ tasks.push(__assign(__assign({ id: eachData.id, name: (_a = (0, readModule_1.handleCutPreviewText)(eachData[timelineSettings_1.title])) !== null && _a !== void 0 ? _a : "" }, (0, timelineBars_1.handleGetTimelineSpan)(startDate, endDate)), { color: color, group: group }));
12531
12787
  }
12532
- return tasks;
12788
+ return timelineGroupId_1 ? (0, timelineBars_1.handleOrderByGroup)(tasks) : tasks;
12533
12789
  };
12534
12790
  var timelineTasks = renderTimelineTasks();
12535
12791
  // INFO: parallel hex list for Apex distributed bars — one colour per
12536
12792
  // task, in the same order; undefined falls back to the chart default
12537
- var timelineColors = timelineTasks.map(function (eachTask) { var _a; return (_a = eachTask.color) !== null && _a !== void 0 ? _a : "#2563eb"; });
12538
- return (react_1.default.createElement("div", { className: "mt-4" }, tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : timelineTasks.length === 0 ? (react_1.default.createElement(emptyState_1.EmptyState, { icon: react_1.default.createElement(HeroIcons.CalendarDaysIcon, { className: "h-10 w-10 text-gray-400" }), text: "Nothing to show on the timeline", description: "Records need both a start and end date to appear here.", darkMode: (_40 = props.organise) === null || _40 === void 0 ? void 0 : _40.darkMode })) : (react_1.default.createElement(ganttChart_1.GanttChart, { title: typeof props.title === "string" ? props.title : "Timeline", tasks: timelineTasks, colors: timelineColors, chartOnly: true, barLabelColor: "#ffffff", darkMode: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.darkMode, onClick: function (taskId) {
12539
- var _a, _b;
12540
- if (taskId)
12541
- (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", taskId, "general");
12542
- } }))));
12793
+ var timelinePrimary_1 = timelinePrimaryColour;
12794
+ var timelineColors = timelineTasks.map(function (eachTask) { var _a; return (_a = eachTask.color) !== null && _a !== void 0 ? _a : timelinePrimary_1; });
12795
+ var timelineWindow_1 = (0, timelineBars_1.handleGetTimelineWindow)(timelineRange.unit, timelineRange.anchor);
12796
+ var handleChangeTimelineRange_1 = function (next) {
12797
+ setTimelineRange(next);
12798
+ // INFO: a new window is a new query; the list refetches on it
12799
+ setTableLoading(true);
12800
+ };
12801
+ var renderTimelineRangeBar = function () {
12802
+ var _a;
12803
+ return (react_1.default.createElement("div", { className: "mb-2 flex flex-wrap items-center justify-between gap-2" },
12804
+ react_1.default.createElement("div", { className: "flex items-center gap-1" },
12805
+ react_1.default.createElement("button", { type: "button", "data-testid": "dtw-timeline-prev", "aria-label": "Previous period", onClick: function () {
12806
+ return handleChangeTimelineRange_1(__assign(__assign({}, timelineRange), { anchor: (0, timelineBars_1.handleShiftTimelineWindow)(timelineRange.unit, timelineRange.anchor, -1) }));
12807
+ }, className: "rounded-lg p-1.5 hover:bg-gray-100" },
12808
+ react_1.default.createElement(HeroIcons.ChevronLeftIcon, { className: "h-4 w-4 text-gray-500" })),
12809
+ react_1.default.createElement("p", { "data-testid": "dtw-timeline-label", className: "min-w-[8rem] text-center text-sm font-bold ".concat(((_a = props.organise) === null || _a === void 0 ? void 0 : _a.darkMode) ? "text-gray-100" : "text-gray-800") }, timelineWindow_1.label),
12810
+ react_1.default.createElement("button", { type: "button", "data-testid": "dtw-timeline-next", "aria-label": "Next period", onClick: function () {
12811
+ return handleChangeTimelineRange_1(__assign(__assign({}, timelineRange), { anchor: (0, timelineBars_1.handleShiftTimelineWindow)(timelineRange.unit, timelineRange.anchor, 1) }));
12812
+ }, className: "rounded-lg p-1.5 hover:bg-gray-100" },
12813
+ react_1.default.createElement(HeroIcons.ChevronRightIcon, { className: "h-4 w-4 text-gray-500" }))),
12814
+ react_1.default.createElement("div", { className: "inline-flex rounded-lg border border-gray-200 bg-white p-0.5" }, timelineBars_1.TIMELINE_UNITS.map(function (unit) { return (react_1.default.createElement("button", { key: unit, type: "button", onClick: function () {
12815
+ if (unit === timelineRange.unit)
12816
+ return;
12817
+ handleChangeTimelineRange_1(__assign(__assign({}, timelineRange), { unit: unit }));
12818
+ }, className: "rounded-md px-3 py-1 text-xs font-medium capitalize ".concat(timelineRange.unit === unit
12819
+ ? "bg-primary-500 text-white"
12820
+ : "text-gray-500 hover:bg-gray-50") }, unit)); }))));
12821
+ };
12822
+ return (react_1.default.createElement("div", { className: "mt-4" },
12823
+ handleCheckTimelineWindow(timelineSettings_1) &&
12824
+ renderTimelineRangeBar(),
12825
+ tableLoading ? (react_1.default.createElement(loading_1.Loading, null)) : timelineTasks.length === 0 ? (react_1.default.createElement(emptyState_1.EmptyState, { icon: react_1.default.createElement(HeroIcons.CalendarDaysIcon, { className: "h-10 w-10 text-gray-400" }), text: "Nothing to show on the timeline", description: "Records need both a start and end date to appear here.", darkMode: (_40 = props.organise) === null || _40 === void 0 ? void 0 : _40.darkMode })) : (
12826
+ // INFO: a row per record at a readable height, scrolling past a
12827
+ // screen rather than squeezing every bar into a fixed chart
12828
+ react_1.default.createElement("div", { "data-testid": "dtw-timeline-scroll", className: "max-h-[70vh] overflow-y-auto" },
12829
+ react_1.default.createElement(ganttChart_1.GanttChart, { title: typeof props.title === "string" ? props.title : "Timeline", tasks: timelineTasks, colors: timelineColors, chartOnly: true, chartSize: (0, timelineBars_1.handleGetTimelineHeight)(timelineTasks.length), rangeStart: handleCheckTimelineWindow(timelineSettings_1)
12830
+ ? timelineWindow_1.start
12831
+ : undefined, rangeEnd: handleCheckTimelineWindow(timelineSettings_1)
12832
+ ? timelineWindow_1.end
12833
+ : undefined, axisOnTop: true, barLabelColor: "#ffffff", darkMode: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.darkMode, onClick: function (taskId) {
12834
+ var _a, _b;
12835
+ if (taskId)
12836
+ (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", taskId, "general");
12837
+ } })))));
12543
12838
  }
12544
12839
  else if (selectedTabData.viewType === "feeds") {
12545
12840
  var contentList_1 = [];
@@ -12621,9 +12916,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12621
12916
  else if (selectedTabData.viewType === "map") {
12622
12917
  var mapSettings_1 = selectedTabData.mapSettings;
12623
12918
  if (mapSettings_1) {
12919
+ // INFO: on a map the view's Group draws a route through each group's
12920
+ // pins, and its Sort orders the stops — the rows arrive in that
12921
+ // order, so the route follows them. Only the tab's own route columns
12922
+ // can be replanned by dragging: a picked sort column would be
12923
+ // overwritten with stop numbers
12924
+ var _66 = (0, routes_1.handleResolveViewRoute)(mapSettings_1, groupId), mapRouteBy = _66.routeBy, mapRouteOrder = _66.routeOrder, isRoutePlannable = _66.isPlannable;
12624
12925
  // INFO: pins take the route column's colour unless another column is
12625
12926
  // picked, so a trip's pins match its line with one setting
12626
- var pinGroup_1 = mapSettings_1.group || mapSettings_1.routeBy || "";
12927
+ var pinGroup_1 = groupId || mapSettings_1.group || mapSettings_1.routeBy || "";
12627
12928
  var mapMarkerList_1 = [];
12628
12929
  var uniqueGroupList_1 = [];
12629
12930
  var markerColorMap_1 = {};
@@ -12636,9 +12937,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12636
12937
  ];
12637
12938
  if (pinGroup_1) {
12638
12939
  spaceTableData.map(function (eachData) {
12639
- if (eachData[pinGroup_1] &&
12640
- !uniqueGroupList_1.includes(eachData[pinGroup_1])) {
12641
- uniqueGroupList_1.push(eachData[pinGroup_1]);
12940
+ var groupKey = (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1]);
12941
+ if (groupKey && !uniqueGroupList_1.includes(groupKey)) {
12942
+ uniqueGroupList_1.push(groupKey);
12642
12943
  }
12643
12944
  return null;
12644
12945
  });
@@ -12696,9 +12997,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12696
12997
  var _a, _b, _c, _d, _e, _f, _g, _h;
12697
12998
  var eachMarkerColor = "white";
12698
12999
  if (pinGroup_1) {
12699
- if (eachData[pinGroup_1]) {
12700
- eachMarkerColor = markerColorMap_1[eachData[pinGroup_1]];
12701
- }
13000
+ var groupKey = (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1]);
13001
+ if (groupKey)
13002
+ eachMarkerColor = markerColorMap_1[groupKey];
12702
13003
  }
12703
13004
  if (eachData[mapSettings_1.address]) {
12704
13005
  var markerData_1 = {
@@ -12713,7 +13014,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12713
13014
  ? ((_e = eachData[mapSettings_1.title]) !== null && _e !== void 0 ? _e : "")
12714
13015
  : "",
12715
13016
  address: (_g = (_f = eachData[mapSettings_1.address]) === null || _f === void 0 ? void 0 : _f.name) !== null && _g !== void 0 ? _g : "",
12716
- group: pinGroup_1 ? ((_h = eachData[pinGroup_1]) !== null && _h !== void 0 ? _h : "") : "",
13017
+ // INFO: a linked record reads by its name in the legend, a
13018
+ // coloured list value by its text
13019
+ group: pinGroup_1
13020
+ ? typeof eachData[pinGroup_1] === "object" &&
13021
+ eachData[pinGroup_1] &&
13022
+ !react_1.default.isValidElement(eachData[pinGroup_1])
13023
+ ? ((_h = eachData[pinGroup_1].name) !== null && _h !== void 0 ? _h : (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1]))
13024
+ : (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1])
13025
+ : "",
12717
13026
  },
12718
13027
  };
12719
13028
  Object.keys(eachData).forEach(function (eachKey) {
@@ -12732,7 +13041,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12732
13041
  return null;
12733
13042
  });
12734
13043
  return (react_1.default.createElement("div", { className: "w-full h-[700px]" },
12735
- react_1.default.createElement(mapView_1.MapView, { ref: mapViewRef, markerList: mapMarkerList_1, routeList: (0, routes_1.handleBuildRoutesFromRows)(spaceTableData, mapMarkerList_1, mapSettings_1.routeBy, mapSettings_1.routeOrder, mapSettings_1.routeStart, mapSettings_1.routeEnd), onChangeRoute: canUpdateRecord && mapSettings_1.routeBy
13044
+ react_1.default.createElement(mapView_1.MapView, { ref: mapViewRef, markerList: mapMarkerList_1, routeList: (0, routes_1.handleBuildRoutesFromRows)(spaceTableData, mapMarkerList_1, mapRouteBy, mapRouteOrder, mapSettings_1.routeStart, mapSettings_1.routeEnd), onChangeRoute: canUpdateRecord && isRoutePlannable
12736
13045
  ? function (change) {
12737
13046
  return handleSaveRecordChanges((0, routes_1.handleBuildRouteChanges)(spaceTableData, mapSettings_1.routeBy, mapSettings_1.routeOrder, change, [mapSettings_1.routeStart, mapSettings_1.routeEnd]));
12738
13047
  }
@@ -13193,12 +13502,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
13193
13502
  react_1.default.createElement("div", { className: "px-3 sm:px-0" },
13194
13503
  react_1.default.createElement("div", { className: "flex" },
13195
13504
  react_1.default.createElement("h2", { className: "mt-2 mb-2 text-xl font-bold ".concat(((_a = props.organise) === null || _a === void 0 ? void 0 : _a.darkMode) ? "text-white" : "text-gray-900") }, "Delete Confirmation")),
13196
- react_1.default.createElement("p", { className: "mt-2 mb-4" },
13197
- "Are you sure you want to permanently delete",
13198
- " ",
13199
- resolvedType === "list" && !deleteFeedId ? "these" : "this",
13200
- " ",
13201
- "data?"),
13505
+ react_1.default.createElement("p", { className: "mt-2 mb-4" }, resolvedType === "list" && !deleteFeedId && selectAll
13506
+ ? "Permanently delete all ".concat(handleGetSelectAllText(), "?")
13507
+ : resolvedType === "list" && !deleteFeedId
13508
+ ? "Permanently delete ".concat(selectedIds.length.toLocaleString(), " ").concat(selectedIds.length === 1 ? "record" : "records", "?")
13509
+ : "Are you sure you want to permanently delete this data?"),
13202
13510
  resolvedType === "list" && !deleteFeedId && (react_1.default.createElement(react_1.default.Fragment, null,
13203
13511
  react_1.default.createElement("p", { className: "mb-2" },
13204
13512
  "Enter passcode",
@@ -13328,14 +13636,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
13328
13636
  };
13329
13637
  return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
13330
13638
  renderNotification("root"),
13331
- ((_109 = (_108 = props.renderSettings) === null || _108 === void 0 ? void 0 : _108.renderLoadingUI) === null || _109 === void 0 ? void 0 : _109.call(_108)) && loading ? ((_110 = props.renderSettings) === null || _110 === void 0 ? void 0 : _110.renderLoadingUI()) : (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, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
13639
+ ((_114 = (_113 = props.renderSettings) === null || _113 === void 0 ? void 0 : _113.renderLoadingUI) === null || _114 === void 0 ? void 0 : _114.call(_113)) && loading ? ((_115 = props.renderSettings) === null || _115 === void 0 ? void 0 : _115.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_116 = props.organise) === null || _116 === void 0 ? void 0 : _116.darkMode, darkModeBg: (_117 = props.organise) === null || _117 === void 0 ? void 0 : _117.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
13332
13640
  var _a, _b;
13333
13641
  if (loading)
13334
13642
  return;
13335
13643
  handlePopUpModal(false);
13336
13644
  setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
13337
13645
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
13338
- 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, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
13646
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_118 = props.organise) === null || _118 === void 0 ? void 0 : _118.darkMode, darkModeBg: (_119 = props.organise) === null || _119 === void 0 ? void 0 : _119.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
13339
13647
  return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
13340
13648
  if (dataId) {
13341
13649
  var currentValue = selectedData[referenceCreationModal.id];
@@ -13351,19 +13659,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
13351
13659
  }, onClose: function () {
13352
13660
  setReferenceCreationModal({ id: "", name: "", type: "string" });
13353
13661
  } }),
13354
- react_1.default.createElement(modal_1.Modal, { darkMode: (_115 = props.organise) === null || _115 === void 0 ? void 0 : _115.darkMode, darkModeBg: (_116 = props.organise) === null || _116 === void 0 ? void 0 : _116.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
13662
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_120 = props.organise) === null || _120 === void 0 ? void 0 : _120.darkMode, darkModeBg: (_121 = props.organise) === null || _121 === void 0 ? void 0 : _121.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
13355
13663
  setReferenceDeleteTableData({});
13356
13664
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
13357
- react_1.default.createElement(modal_1.Modal, { darkMode: (_117 = props.organise) === null || _117 === void 0 ? void 0 : _117.darkMode, darkModeBg: (_118 = props.organise) === null || _118 === void 0 ? void 0 : _118.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
13665
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_122 = props.organise) === null || _122 === void 0 ? void 0 : _122.darkMode, darkModeBg: (_123 = props.organise) === null || _123 === void 0 ? void 0 : _123.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
13358
13666
  setDeletePasscodeInput("");
13359
13667
  setDeleteModal(!deleteModal);
13360
13668
  setDeleteFeedId("");
13361
13669
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
13362
- react_1.default.createElement(modal_1.Modal, { darkMode: (_119 = props.organise) === null || _119 === void 0 ? void 0 : _119.darkMode, darkModeBg: (_120 = props.organise) === null || _120 === void 0 ? void 0 : _120.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
13670
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_124 = props.organise) === null || _124 === void 0 ? void 0 : _124.darkMode, darkModeBg: (_125 = props.organise) === null || _125 === void 0 ? void 0 : _125.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
13363
13671
  setBatchUpdateData({ columnId: "", columnData: {} });
13364
13672
  setBatchUpdateModal(false);
13365
13673
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
13366
- react_1.default.createElement(modal_1.Modal, { darkMode: (_121 = props.organise) === null || _121 === void 0 ? void 0 : _121.darkMode, darkModeBg: (_122 = props.organise) === null || _122 === void 0 ? void 0 : _122.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
13674
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_126 = props.organise) === null || _126 === void 0 ? void 0 : _126.darkMode, darkModeBg: (_127 = props.organise) === null || _127 === void 0 ? void 0 : _127.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
13367
13675
  var _a, _b;
13368
13676
  if (props.space)
13369
13677
  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 }));
@@ -13380,14 +13688,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
13380
13688
  (0, react_dom_1.createPortal)(
13381
13689
  // INFO: z-50 lifts it over a Modal the table may sit in (z-40)
13382
13690
  react_1.default.createElement("div", { className: "relative z-50" },
13383
- react_1.default.createElement(drawer_1.Drawer, { darkMode: (_123 = props.organise) === null || _123 === void 0 ? void 0 : _123.darkMode, darkModeBg: (_124 = props.organise) === null || _124 === void 0 ? void 0 : _124.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
13691
+ react_1.default.createElement(drawer_1.Drawer, { darkMode: (_128 = props.organise) === null || _128 === void 0 ? void 0 : _128.darkMode, darkModeBg: (_129 = props.organise) === null || _129 === void 0 ? void 0 : _129.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
13384
13692
  // INFO: the record stays set while the drawer slides out — clearing it
13385
13693
  // would remount the hidden panel collection-wide and fetch again. The
13386
13694
  // toolbar's collection-wide button clears it when it opens.
13387
13695
  onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75",
13388
13696
  // INFO: dragged like the read drawer; the width sticks across
13389
13697
  // opens while the list stays mounted
13390
- resizable: true, title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((_125 = props.id) !== null && _125 !== void 0 ? _125 : "") : activityId) })), document.body),
13698
+ resizable: true, title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((_130 = props.id) !== null && _130 !== void 0 ? _130 : "") : activityId) })), document.body),
13391
13699
  renderScrollSentinel()));
13392
13700
  });
13393
13701
  //# sourceMappingURL=index.js.map