blixify-ui-web 1.3.27 → 1.3.29

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 +643 -347
  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 +1 -1
  12. package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
  13. package/lib/components/data/dataTemplate/settingsModal.js +68 -27
  14. package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
  15. package/lib/components/data/dataTemplate/timelineBars.d.ts +22 -0
  16. package/lib/components/data/dataTemplate/timelineBars.d.ts.map +1 -0
  17. package/lib/components/data/dataTemplate/timelineBars.js +124 -0
  18. package/lib/components/data/dataTemplate/timelineBars.js.map +1 -0
  19. package/lib/components/data/flexFilter/index.d.ts.map +1 -1
  20. package/lib/components/data/flexFilter/index.js +73 -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
@@ -178,6 +178,7 @@ var chartView_1 = require("./chartView");
178
178
  var referenceScan_1 = require("./referenceScan");
179
179
  var relatedRecords_1 = require("./relatedRecords");
180
180
  var flexFilter_1 = require("../flexFilter");
181
+ var timelineBars_1 = require("./timelineBars");
181
182
  var viewStatePersistence_1 = require("./viewStatePersistence");
182
183
  var permissions_1 = require("./permissions");
183
184
  var columnWidth_1 = require("../../display/newTable/columnWidth");
@@ -253,8 +254,12 @@ var handleCheckEmptyCardValue = function (value) {
253
254
  return false;
254
255
  };
255
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
+ var DELETE_ID_CHUNK = 1000;
256
261
  exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
257
- 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;
262
+ 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;
258
263
  // INFO: every view draws a lookup as its source column's type, read-only, so
259
264
  // no type branch below meets "lookup"; rawProps.model keeps the lookups as
260
265
  // stored for the columns handed back to the host
@@ -273,7 +278,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
273
278
  // the list never refetching while the panel is open, which fails silently.
274
279
  // INFO: the panel cannot navigate its way out — handleNavigate("read") is
275
280
  // routed straight back into it — so expand-to-full-page is local state.
276
- var _126 = (0, react_1.useState)(false), drawerPageView = _126[0], setDrawerPageView = _126[1];
281
+ var _131 = (0, react_1.useState)(false), drawerPageView = _131[0], setDrawerPageView = _131[1];
277
282
  // INFO: the panel keeps rendering the record it was opened with rather than
278
283
  // live props. Without this, navigating back to the list would re-render the
279
284
  // still-mounted panel as a second list behind the overlay.
@@ -328,7 +333,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
328
333
  drawerFormEditedRef.current = false;
329
334
  }
330
335
  drawerOpenRef.current = isDrawerHost;
331
- var _127 = (0, react_1.useState)(false), drawerDiscardModal = _127[0], setDrawerDiscardModal = _127[1];
336
+ var _132 = (0, react_1.useState)(false), drawerDiscardModal = _132[0], setDrawerDiscardModal = _132[1];
332
337
  // INFO: leaving the record ends the escape, so the next row opened from the
333
338
  // list peeks in the panel again rather than inheriting a full page the user
334
339
  // asked for once. Saving a form on the full page lands on its read view, which
@@ -407,7 +412,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
407
412
  initialFilterReferenceDate: initialFilterReferenceDate,
408
413
  };
409
414
  };
410
- var _128 = intialiseDefaultFilterValues(), initialFilterSearch = _128.initialFilterSearch, initialFilterSearchParams = _128.initialFilterSearchParams, initialFilterSelection = _128.initialFilterSelection, initialFilterReference = _128.initialFilterReference, initialFilterReferenceDate = _128.initialFilterReferenceDate;
415
+ var _133 = intialiseDefaultFilterValues(), initialFilterSearch = _133.initialFilterSearch, initialFilterSearchParams = _133.initialFilterSearchParams, initialFilterSelection = _133.initialFilterSelection, initialFilterReference = _133.initialFilterReference, initialFilterReferenceDate = _133.initialFilterReferenceDate;
411
416
  // INFO: organise.initialSearch fills the Quick find box, which sends its
412
417
  // value under "search". Without that box (hideSearch, Firebase, or a
413
418
  // "search" query taking its place) there is nothing to fill
@@ -423,19 +428,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
423
428
  // keyword: All's columns and sort, no stored filters, and nothing this
424
429
  // person kept in the browser (view drafts, persistViewState) is read or
425
430
  // written — until they pick a view, which is their own choice again
426
- 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];
431
+ 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];
427
432
  var handleSeedInitialSearch = function (params) {
428
433
  var _a;
429
434
  return isLinkOpen && ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSearch)
430
435
  ? __assign(__assign({}, params), { search: props.organise.initialSearch }) : params;
431
436
  };
432
437
  // INFO: Persist view state hook — handles storage read/write for filter/sort/column state
433
- var _130 = (0, viewStatePersistence_1.usePersistedViewState)({
438
+ var _135 = (0, viewStatePersistence_1.usePersistedViewState)({
434
439
  mode: isLinkOpen ? undefined : (_k = props.organise) === null || _k === void 0 ? void 0 : _k.persistViewState,
435
440
  collectionId: props.collectionId,
436
441
  persistKey: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.persistKey,
437
442
  type: resolvedType,
438
- }), rawPersistedState = _130.persistedState, isPersistEnabled = _130.isEnabled, handleSaveView = _130.handleSaveView, handleRegisterViewSnapshot = _130.handleRegisterViewSnapshot;
443
+ }), rawPersistedState = _135.persistedState, isPersistEnabled = _135.isEnabled, handleSaveView = _135.handleSaveView, handleRegisterViewSnapshot = _135.handleRegisterViewSnapshot;
439
444
  // INFO: drop stored filters/sort on removed columns — they would empty the table
440
445
  var persistedState = (0, react_1.useMemo)(function () {
441
446
  var _a, _b, _c, _d;
@@ -451,8 +456,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
451
456
  (_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareFlexFilterListObjects,
452
457
  (_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareFlexFilterRelated,
453
458
  ]);
454
- var _131 = (0, react_1.useState)(false), loading = _131[0], setLoading = _131[1];
455
- var _132 = (0, react_1.useState)(), notification = _132[0], setNotification = _132[1];
459
+ var _136 = (0, react_1.useState)(false), loading = _136[0], setLoading = _136[1];
460
+ var _137 = (0, react_1.useState)(), notification = _137[0], setNotification = _137[1];
456
461
  // INFO: a success toast is confirmation, not a decision — it clears itself so
457
462
  // it never sits on the floating step bar; errors stay until dismissed
458
463
  (0, react_1.useEffect)(function () {
@@ -462,86 +467,93 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
462
467
  return function () { return clearTimeout(timer); };
463
468
  }, [notification]);
464
469
  //INFO : Used by List
465
- var _133 = (0, react_1.useState)(function () {
470
+ var _138 = (0, react_1.useState)(function () {
466
471
  var _a;
467
472
  return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearch);
468
- }), filterSearch = _133[0], setFilterSearch = _133[1];
469
- var _134 = (0, react_1.useState)(function () {
473
+ }), filterSearch = _138[0], setFilterSearch = _138[1];
474
+ var _139 = (0, react_1.useState)(function () {
470
475
  var _a;
471
476
  return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearchParams);
472
- }), filterSearchParams = _134[0], setFilterSearchParams = _134[1];
473
- 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];
474
- 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];
475
- var _137 = (0, react_1.useState)({}), filterReferenceSearch = _137[0], setFilterReferenceSearch = _137[1];
476
- var _138 = (0, react_1.useState)({}), filterReferenceList = _138[0], setFilterReferenceList = _138[1];
477
- var _139 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
477
+ }), filterSearchParams = _139[0], setFilterSearchParams = _139[1];
478
+ 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];
479
+ 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];
480
+ var _142 = (0, react_1.useState)({}), filterReferenceSearch = _142[0], setFilterReferenceSearch = _142[1];
481
+ var _143 = (0, react_1.useState)({}), filterReferenceList = _143[0], setFilterReferenceList = _143[1];
482
+ var _144 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
478
483
  ? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
479
- : initialFilterReferenceDate), filterReferenceDate = _139[0], setFilterReferenceDate = _139[1];
480
- var _140 = (0, react_1.useState)(true), tableLoading = _140[0], setTableLoading = _140[1];
481
- var _141 = (0, react_1.useState)(""), cursor = _141[0], setCursor = _141[1];
482
- var _142 = (0, react_1.useState)(""), lastCursor = _142[0], setLastCursor = _142[1];
483
- var _143 = (0, react_1.useState)([]), tableData = _143[0], setTableData = _143[1];
484
- var _144 = (0, react_1.useState)([]), spaceTableData = _144[0], setSpaceTableData = _144[1];
484
+ : initialFilterReferenceDate), filterReferenceDate = _144[0], setFilterReferenceDate = _144[1];
485
+ var _145 = (0, react_1.useState)(true), tableLoading = _145[0], setTableLoading = _145[1];
486
+ var _146 = (0, react_1.useState)(""), cursor = _146[0], setCursor = _146[1];
487
+ var _147 = (0, react_1.useState)(""), lastCursor = _147[0], setLastCursor = _147[1];
488
+ var _148 = (0, react_1.useState)([]), tableData = _148[0], setTableData = _148[1];
489
+ var _149 = (0, react_1.useState)([]), spaceTableData = _149[0], setSpaceTableData = _149[1];
485
490
  // INFO: a save resolves after later renders, so it reads the table from here —
486
491
  // the state it closed over can predate an earlier save on the same row
487
492
  var tableDataRef = (0, react_1.useRef)([]);
488
493
  var spaceTableDataRef = (0, react_1.useRef)([]);
489
494
  tableDataRef.current = tableData;
490
495
  spaceTableDataRef.current = spaceTableData;
491
- var _145 = (0, react_1.useState)(0), size = _145[0], setSize = _145[1];
492
- 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];
496
+ var _150 = (0, react_1.useState)(0), size = _150[0], setSize = _150[1];
497
+ 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];
493
498
  // INFO: every change of page, including the return to the first page when a
494
499
  // filter or search changes, which onChangePagination does not always report
495
500
  (0, react_1.useEffect)(function () {
496
501
  var _a, _b;
497
502
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePageIndex) === null || _b === void 0 ? void 0 : _b.call(_a, pageIndex);
498
503
  }, [pageIndex]);
499
- var _147 = (0, react_1.useState)([]), selectedIds = _147[0], setSelectedIds = _147[1];
500
- var _148 = (0, react_1.useState)(false), selectAll = _148[0], setSelectAll = _148[1];
501
- var _149 = (0, react_1.useState)(""), deletePasscode = _149[0], setDeletePasscode = _149[1];
502
- var _150 = (0, react_1.useState)(""), deletePasscodeInput = _150[0], setDeletePasscodeInput = _150[1];
503
- var _151 = (0, react_1.useState)(""), deleteFeedId = _151[0], setDeleteFeedId = _151[1];
504
+ var _152 = (0, react_1.useState)([]), selectedIds = _152[0], setSelectedIds = _152[1];
505
+ var _153 = (0, react_1.useState)(false), selectAll = _153[0], setSelectAll = _153[1];
506
+ var _154 = (0, react_1.useState)(""), deletePasscode = _154[0], setDeletePasscode = _154[1];
507
+ var _155 = (0, react_1.useState)(""), deletePasscodeInput = _155[0], setDeletePasscodeInput = _155[1];
508
+ var _156 = (0, react_1.useState)(""), deleteFeedId = _156[0], setDeleteFeedId = _156[1];
504
509
  //INFO : Used by List Organise
505
510
  // INFO: Internal sort state that overrides props.organise?.sort when
506
511
  // persistViewState is enabled and a persisted sort exists
507
- 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];
508
- var _153 = (0, react_1.useState)(false), filterDraft = _153[0], setFilterDraft = _153[1];
509
- var _154 = (0, react_1.useState)(false), addTabModal = _154[0], setAddTabModal = _154[1];
510
- var _155 = (0, react_1.useState)(-1), editTabIndex = _155[0], setEditTabIndex = _155[1];
512
+ 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];
513
+ var _158 = (0, react_1.useState)(false), filterDraft = _158[0], setFilterDraft = _158[1];
514
+ var _159 = (0, react_1.useState)(false), addTabModal = _159[0], setAddTabModal = _159[1];
515
+ var _160 = (0, react_1.useState)(-1), editTabIndex = _160[0], setEditTabIndex = _160[1];
511
516
  //INFO : resolve the initial tab synchronously so the mount cond is already
512
517
  // tab-scoped — an empty initial tab caused a second wasted list fetch
513
- var _156 = (0, react_1.useState)(function () {
518
+ var _161 = (0, react_1.useState)(function () {
514
519
  var _a;
515
520
  return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, listViewId);
516
- }), selectedTab = _156[0], setSelectedTab = _156[1];
517
- var _157 = (0, react_1.useState)("dayGridMonth"), calendarView = _157[0], setCalendarView = _157[1];
521
+ }), selectedTab = _161[0], setSelectedTab = _161[1];
522
+ var _162 = (0, react_1.useState)("dayGridMonth"), calendarView = _162[0], setCalendarView = _162[1];
518
523
  // INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
519
524
  // (calendarView above drives the matching range query)
520
- var _158 = (0, react_1.useState)("month"), newCalendarViewMode = _158[0], setNewCalendarViewMode = _158[1];
521
- var _159 = (0, react_1.useState)(new Date()), calendarTabMonth = _159[0], setCalendarTabMonth = _159[1];
525
+ var _163 = (0, react_1.useState)("month"), newCalendarViewMode = _163[0], setNewCalendarViewMode = _163[1];
526
+ var _164 = (0, react_1.useState)(new Date()), calendarTabMonth = _164[0], setCalendarTabMonth = _164[1];
527
+ // INFO: read once per theme — it asks the browser to resolve a style
528
+ var timelinePrimaryColour = (0, react_1.useMemo)(function () { return (0, timelineBars_1.handleReadPrimaryColour)(); },
529
+ /* eslint-disable-next-line */
530
+ [(_w = props.organise) === null || _w === void 0 ? void 0 : _w.darkMode]);
531
+ // INFO: the period a timeline shows — it reads only the records whose bars
532
+ // overlap it, so a large datasheet loads one month or quarter at a time
533
+ var _165 = (0, react_1.useState)({ unit: "month", anchor: new Date() }), timelineRange = _165[0], setTimelineRange = _165[1];
522
534
  // INFO: defaultViewSwitch picks the opening view only — the tab re-inits
523
535
  // whenever its settings change, and that must not undo the user's switch
524
536
  var calendarViewInitRef = (0, react_1.useRef)(false);
525
- var _160 = (0, react_1.useState)(true), kanbanDroppable = _160[0], setKanbanDroppable = _160[1];
526
- var _161 = (0, react_1.useState)([]), kanbanOptions = _161[0], setKanbanOptions = _161[1];
527
- var _162 = (0, react_1.useState)(false), batchUpdateModal = _162[0], setBatchUpdateModal = _162[1];
528
- var _163 = (0, react_1.useState)({
537
+ var _166 = (0, react_1.useState)(true), kanbanDroppable = _166[0], setKanbanDroppable = _166[1];
538
+ var _167 = (0, react_1.useState)([]), kanbanOptions = _167[0], setKanbanOptions = _167[1];
539
+ var _168 = (0, react_1.useState)(false), batchUpdateModal = _168[0], setBatchUpdateModal = _168[1];
540
+ var _169 = (0, react_1.useState)({
529
541
  columnId: "",
530
542
  columnData: {},
531
- }), batchUpdateData = _163[0], setBatchUpdateData = _163[1];
543
+ }), batchUpdateData = _169[0], setBatchUpdateData = _169[1];
532
544
  // INFO: system columns (created / updated at and by, record id, number)
533
545
  // join the structure hidden; the ones a user shows are kept per view
534
- var isSystemColumnsEnabled = !!((_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareSystemColumns);
535
- var isSystemColumnsLocked = !!((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareSystemColumnsLocked);
546
+ var isSystemColumnsEnabled = !!((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareSystemColumns);
547
+ var isSystemColumnsLocked = !!((_y = props.bareSettings) === null || _y === void 0 ? void 0 : _y.bareSystemColumnsLocked);
536
548
  var appendedSystemColumnIds = isSystemColumnsEnabled
537
549
  ? 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; }); })
538
550
  : [];
539
- 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];
551
+ 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];
540
552
  var handleWithSystemColumns = function (model, shownIds) {
541
553
  if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
542
554
  return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
543
555
  };
544
- var _165 = (0, react_1.useState)(function () {
556
+ var _171 = (0, react_1.useState)(function () {
545
557
  var _a;
546
558
  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 : []);
547
559
  if (!persistedState)
@@ -568,8 +580,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
568
580
  });
569
581
  }
570
582
  return model;
571
- }), structure = _165[0], setStructure = _165[1];
572
- 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];
583
+ }), structure = _171[0], setStructure = _171[1];
584
+ 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];
573
585
  // INFO: State for user-configurable flex filters (Monday.com-style)
574
586
  // INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
575
587
  var defaultFlexFilterRow = [
@@ -581,13 +593,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
581
593
  },
582
594
  ];
583
595
  // INFO: rows the host opens the list with come before a saved view's
584
- var initialFlexFilterRows = ((_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.initialFlexFilters) &&
596
+ var initialFlexFilterRows = ((_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.initialFlexFilters) &&
585
597
  props.organise.initialFlexFilters.length > 0
586
598
  ? props.organise.initialFlexFilters
587
599
  : (persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
588
600
  ? persistedState.flexFilters
589
601
  : defaultFlexFilterRow;
590
- var _167 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _167[0], setFlexFilters = _167[1];
602
+ var _173 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _173[0], setFlexFilters = _173[1];
591
603
  // INFO: always-current mirror of flexFilters, read by the imperative apply/
592
604
  // clear methods so chained calls in one tick aren't stale.
593
605
  var flexFiltersRef = (0, react_1.useRef)(flexFilters);
@@ -600,111 +612,111 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
600
612
  }, [flexFilters]);
601
613
  // INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
602
614
  // to prevent API calls on every keystroke when typing in value inputs
603
- var _168 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _168[0], setFlexFiltersDebounced = _168[1];
615
+ var _174 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _174[0], setFlexFiltersDebounced = _174[1];
604
616
  // INFO: the filter rows of the export being set up — started from the
605
617
  // list's own when the export opens, so changing them leaves the list as it is
606
- var _169 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _169[0], setExportFlexFilters = _169[1];
607
- var _170 = (0, react_1.useState)({}), flexFilterReferenceOptions = _170[0], setFlexFilterReferenceOptions = _170[1];
608
- var _171 = (0, react_1.useState)({}), flexFilterReferenceSearch = _171[0], setFlexFilterReferenceSearch = _171[1];
609
- var _172 = (0, react_1.useState)(false), flexFilterModalOpen = _172[0], setFlexFilterModalOpen = _172[1];
610
- var _173 = (0, react_1.useState)(false), viewSettingsModalOpen = _173[0], setViewSettingsModalOpen = _173[1];
618
+ var _175 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _175[0], setExportFlexFilters = _175[1];
619
+ var _176 = (0, react_1.useState)({}), flexFilterReferenceOptions = _176[0], setFlexFilterReferenceOptions = _176[1];
620
+ var _177 = (0, react_1.useState)({}), flexFilterReferenceSearch = _177[0], setFlexFilterReferenceSearch = _177[1];
621
+ var _178 = (0, react_1.useState)(false), flexFilterModalOpen = _178[0], setFlexFilterModalOpen = _178[1];
622
+ var _179 = (0, react_1.useState)(false), viewSettingsModalOpen = _179[0], setViewSettingsModalOpen = _179[1];
611
623
  // INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
612
624
  // Deliberately kept out of `structure`: the props-sync effect below resets
613
625
  // structure to props.model whenever props change, which would wipe the
614
626
  // choice, and the persist effect derives schema-level hiddenColumnIds from
615
627
  // structure — writing user hides there would blur the two concepts.
616
- 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];
617
- var _175 = (0, react_1.useState)(""), columnSearch = _175[0], setColumnSearch = _175[1];
618
- var _176 = (0, react_1.useState)([]), savedViews = _176[0], setSavedViews = _176[1];
619
- var _177 = (0, react_1.useState)(null), activeSavedViewId = _177[0], setActiveSavedViewId = _177[1];
628
+ 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];
629
+ var _181 = (0, react_1.useState)(""), columnSearch = _181[0], setColumnSearch = _181[1];
630
+ var _182 = (0, react_1.useState)([]), savedViews = _182[0], setSavedViews = _182[1];
631
+ var _183 = (0, react_1.useState)(null), activeSavedViewId = _183[0], setActiveSavedViewId = _183[1];
620
632
  // INFO: the widths of the view on screen, by column id ("180px")
621
- 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];
633
+ 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];
622
634
  // INFO: the kanban lane widths of the view on screen, by lane id ("300px")
623
- 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];
635
+ 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];
624
636
  // INFO: the read drawer's dragged width ("520px"), kept in the view with the
625
637
  // column widths. A restored persistViewState wins over All's, as a saved
626
638
  // view or draft applied at opening replaces both
627
- var _180 = (0, react_1.useState)(function () {
639
+ var _186 = (0, react_1.useState)(function () {
628
640
  var _a, _b, _c;
629
641
  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;
630
- }), drawerWidth = _180[0], setDrawerWidth = _180[1];
642
+ }), drawerWidth = _186[0], setDrawerWidth = _186[1];
631
643
  // INFO: the columns the view on screen freezes at the left edge
632
- 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];
644
+ 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];
633
645
  // INFO: unsaved changes are kept only once the opening view is on screen,
634
646
  // so the defaults drawn before it never overwrite a person's own
635
- var _182 = (0, react_1.useState)(false), isViewDraftReady = _182[0], setIsViewDraftReady = _182[1];
647
+ var _188 = (0, react_1.useState)(false), isViewDraftReady = _188[0], setIsViewDraftReady = _188[1];
636
648
  // INFO: null while the name box is closed
637
- var _183 = (0, react_1.useState)(null), savedViewName = _183[0], setSavedViewName = _183[1];
638
- var _184 = (0, react_1.useState)(null), deletingSavedViewId = _184[0], setDeletingSavedViewId = _184[1];
649
+ var _189 = (0, react_1.useState)(null), savedViewName = _189[0], setSavedViewName = _189[1];
650
+ var _190 = (0, react_1.useState)(null), deletingSavedViewId = _190[0], setDeletingSavedViewId = _190[1];
639
651
  // INFO: the view chip being dragged, to drop it in another place
640
- var _185 = (0, react_1.useState)(null), draggingSavedViewId = _185[0], setDraggingSavedViewId = _185[1];
652
+ var _191 = (0, react_1.useState)(null), draggingSavedViewId = _191[0], setDraggingSavedViewId = _191[1];
641
653
  // INFO: the tab strip in the order a drag has reached, saved once on drop
642
- var _186 = (0, react_1.useState)(null), draggedTabs = _186[0], setDraggedTabs = _186[1];
643
- var _187 = (0, react_1.useState)(null), renamingSavedView = _187[0], setRenamingSavedView = _187[1];
644
- var _188 = (0, react_1.useState)(false), isSavedViewsExpanded = _188[0], setIsSavedViewsExpanded = _188[1];
645
- var _189 = (0, react_1.useState)(null), draggingColumnId = _189[0], setDraggingColumnId = _189[1];
654
+ var _192 = (0, react_1.useState)(null), draggedTabs = _192[0], setDraggedTabs = _192[1];
655
+ var _193 = (0, react_1.useState)(null), renamingSavedView = _193[0], setRenamingSavedView = _193[1];
656
+ var _194 = (0, react_1.useState)(false), isSavedViewsExpanded = _194[0], setIsSavedViewsExpanded = _194[1];
657
+ var _195 = (0, react_1.useState)(null), draggingColumnId = _195[0], setDraggingColumnId = _195[1];
646
658
  var columnRowRefs = (0, react_1.useRef)({});
647
659
  //INFO : Used by Auth
648
- var _190 = (0, react_1.useState)({
660
+ var _196 = (0, react_1.useState)({
649
661
  email: "",
650
662
  google: "",
651
663
  phone: "",
652
664
  disabled: false,
653
665
  create: false,
654
- }), authMethods = _190[0], setAuthMethods = _190[1];
655
- var _191 = (0, react_1.useState)(""), selectedAuthMethod = _191[0], setSelectedAuthMethod = _191[1];
666
+ }), authMethods = _196[0], setAuthMethods = _196[1];
667
+ var _197 = (0, react_1.useState)(""), selectedAuthMethod = _197[0], setSelectedAuthMethod = _197[1];
656
668
  // INFO: the sign-in check of a users datasheet's record is running; the
657
669
  // panel shows a spinner rather than nothing, which read as "no login"
658
- var _192 = (0, react_1.useState)(false), authLoading = _192[0], setAuthLoading = _192[1];
670
+ var _198 = (0, react_1.useState)(false), authLoading = _198[0], setAuthLoading = _198[1];
659
671
  // INFO: a delete is running — the ref answers a second tap at once, before
660
672
  // the state has rendered, and the state disables the confirm button
661
673
  var deletingRef = (0, react_1.useRef)(false);
662
- var _193 = (0, react_1.useState)(false), deleting = _193[0], setDeleting = _193[1];
674
+ var _199 = (0, react_1.useState)(false), deleting = _199[0], setDeleting = _199[1];
663
675
  // INFO: Used by Activity Log
664
- var _194 = (0, react_1.useState)(false), activityModal = _194[0], setActivityModal = _194[1];
665
- var _195 = (0, react_1.useState)(""), activityId = _195[0], setActivityId = _195[1];
676
+ var _200 = (0, react_1.useState)(false), activityModal = _200[0], setActivityModal = _200[1];
677
+ var _201 = (0, react_1.useState)(""), activityId = _201[0], setActivityId = _201[1];
666
678
  //INFO : Used by Export
667
- var _196 = (0, react_1.useState)(null), csvFile = _196[0], setCSVFile = _196[1];
668
- var _197 = (0, react_1.useState)([]), csvFileData = _197[0], setCSVFileData = _197[1];
669
- var _198 = (0, react_1.useState)(0), stepCSVIndex = _198[0], setStepCSVIndex = _198[1];
670
- var _199 = (0, react_1.useState)({}), listCSVMapAttribute = _199[0], setListCSVMapAttribute = _199[1];
671
- var _200 = (0, react_1.useState)({}), listCSVObjAttribute = _200[0], setListCSVObjAttribute = _200[1];
672
- var _201 = (0, react_1.useState)([]), csvAPIAttribute = _201[0], setCSVAPIAttribute = _201[1];
673
- var _202 = (0, react_1.useState)(((_2 = props.devSettings.currentUser) === null || _2 === void 0 ? void 0 : _2.userEmail) || ""), exportCSVEmail = _202[0], setExportCSVEmail = _202[1];
674
- 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];
675
- var _204 = (0, react_1.useState)(false), exportPDFLoading = _204[0], setExportPDFLoading = _204[1];
676
- var _205 = (0, react_1.useState)(false), exportReadPDFLoading = _205[0], setExportReadPDFLoading = _205[1];
677
- 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];
678
- 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];
679
- var _208 = (0, react_1.useState)([]), importTableData = _208[0], setImportTableData = _208[1];
680
- var _209 = (0, react_1.useState)([]), queryList = _209[0], setQueryList = _209[1];
681
- var _210 = (0, react_1.useState)(undefined), allQueryList = _210[0], setAllQueryList = _210[1];
679
+ var _202 = (0, react_1.useState)(null), csvFile = _202[0], setCSVFile = _202[1];
680
+ var _203 = (0, react_1.useState)([]), csvFileData = _203[0], setCSVFileData = _203[1];
681
+ var _204 = (0, react_1.useState)(0), stepCSVIndex = _204[0], setStepCSVIndex = _204[1];
682
+ var _205 = (0, react_1.useState)({}), listCSVMapAttribute = _205[0], setListCSVMapAttribute = _205[1];
683
+ var _206 = (0, react_1.useState)({}), listCSVObjAttribute = _206[0], setListCSVObjAttribute = _206[1];
684
+ var _207 = (0, react_1.useState)([]), csvAPIAttribute = _207[0], setCSVAPIAttribute = _207[1];
685
+ var _208 = (0, react_1.useState)(((_3 = props.devSettings.currentUser) === null || _3 === void 0 ? void 0 : _3.userEmail) || ""), exportCSVEmail = _208[0], setExportCSVEmail = _208[1];
686
+ 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];
687
+ var _210 = (0, react_1.useState)(false), exportPDFLoading = _210[0], setExportPDFLoading = _210[1];
688
+ var _211 = (0, react_1.useState)(false), exportReadPDFLoading = _211[0], setExportReadPDFLoading = _211[1];
689
+ 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];
690
+ 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];
691
+ var _214 = (0, react_1.useState)([]), importTableData = _214[0], setImportTableData = _214[1];
692
+ var _215 = (0, react_1.useState)([]), queryList = _215[0], setQueryList = _215[1];
693
+ var _216 = (0, react_1.useState)(undefined), allQueryList = _216[0], setAllQueryList = _216[1];
682
694
  // INFO: a restored state wins over the prop; its "" is a list the user
683
695
  // ungrouped, so it opens ungrouped
684
- var _211 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
696
+ var _217 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
685
697
  ? persistedState.groupBy || undefined
686
- : (_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.groupBy), groupId = _211[0], setGroupId = _211[1];
698
+ : (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.groupBy), groupId = _217[0], setGroupId = _217[1];
687
699
  // INFO: each group's total per number column, keyed by section id
688
- var _212 = (0, react_1.useState)({}), groupSummaries = _212[0], setGroupSummaries = _212[1];
700
+ var _218 = (0, react_1.useState)({}), groupSummaries = _218[0], setGroupSummaries = _218[1];
689
701
  // INFO: each group's row count over every row the filters match; null until
690
702
  // read. A band paged alone shows it until its own first page lands, and a
691
703
  // band it counts empty is left out instead of waiting to be read
692
- var _213 = (0, react_1.useState)(null), groupTotals = _213[0], setGroupTotals = _213[1];
704
+ var _219 = (0, react_1.useState)(null), groupTotals = _219[0], setGroupTotals = _219[1];
693
705
  // INFO: the last read of groupTotals failed, so bands fall back to the rows
694
706
  // loaded instead of waiting on a total that is not coming
695
- var _214 = (0, react_1.useState)(false), groupTotalsFailed = _214[0], setGroupTotalsFailed = _214[1];
707
+ var _220 = (0, react_1.useState)(false), groupTotalsFailed = _220[0], setGroupTotalsFailed = _220[1];
696
708
  var groupSummaryRequestRef = (0, react_1.useRef)(0);
697
709
  // INFO: the grouped count waiting to go out, so a filter change can stop it
698
710
  // before it sends the filters it was scheduled with
699
711
  var groupSummaryTimerRef = (0, react_1.useRef)(null);
700
- var _215 = (0, react_1.useState)({}), commentCounts = _215[0], setCommentCounts = _215[1];
701
- var _216 = (0, react_1.useState)({}), commentUnread = _216[0], setCommentUnread = _216[1];
712
+ var _221 = (0, react_1.useState)({}), commentCounts = _221[0], setCommentCounts = _221[1];
713
+ var _222 = (0, react_1.useState)({}), commentUnread = _222[0], setCommentUnread = _222[1];
702
714
  // INFO: Monday-board per-group paging. Keyed by the group key that
703
715
  // handleBuildNewTableGroups() produces (an option, Unknown or No Value).
704
716
  // Each group tracks its own loaded cursor + total so it can lazily load its
705
717
  // next page as the user scrolls inside that band, independent of every other
706
718
  // group. Only used when renderCheckGroupPaging() is true.
707
- var _217 = (0, react_1.useState)({}), groupPageState = _217[0], setGroupPageState = _217[1];
719
+ var _223 = (0, react_1.useState)({}), groupPageState = _223[0], setGroupPageState = _223[1];
708
720
  // INFO: read fresh inside the async per-group fetch so chained scroll fires
709
721
  // in one tick do not re-fetch an already in-flight page.
710
722
  var groupPageStateRef = (0, react_1.useRef)({});
@@ -719,62 +731,62 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
719
731
  var groupLoadingKeyRef = (0, react_1.useRef)(null);
720
732
  var groupLoadQueueRef = (0, react_1.useRef)([]);
721
733
  var handleFetchGroupNextPageRef = (0, react_1.useRef)(function () { });
722
- var _218 = (0, react_1.useState)(""), readTabSection = _218[0], setReadTabSection = _218[1];
723
- var _219 = (0, react_1.useState)(false), readFloatingNav = _219[0], setReadFloatingNav = _219[1];
734
+ var _224 = (0, react_1.useState)(""), readTabSection = _224[0], setReadTabSection = _224[1];
735
+ var _225 = (0, react_1.useState)(false), readFloatingNav = _225[0], setReadFloatingNav = _225[1];
724
736
  var readTabSectionRefs = (0, react_1.useRef)({});
725
737
  //INFO : Used by Read
726
738
  //INFO : Used by Update
727
- var _220 = (0, react_1.useState)(false), modalVisible = _220[0], setModalVisible = _220[1];
728
- var _221 = (0, react_1.useState)(false), deleteModal = _221[0], setDeleteModal = _221[1];
729
- var _222 = (0, react_1.useState)(false), excelModal = _222[0], setExcelModal = _222[1];
730
- var _223 = (0, react_1.useState)(false), exportExcel = _223[0], setExportExcel = _223[1];
731
- var _224 = (0, react_1.useState)(""), exportType = _224[0], setExportType = _224[1];
732
- var _225 = (0, react_1.useState)(false), exportQR = _225[0], setExportQR = _225[1];
733
- var _226 = (0, react_1.useState)(function () {
739
+ var _226 = (0, react_1.useState)(false), modalVisible = _226[0], setModalVisible = _226[1];
740
+ var _227 = (0, react_1.useState)(false), deleteModal = _227[0], setDeleteModal = _227[1];
741
+ var _228 = (0, react_1.useState)(false), excelModal = _228[0], setExcelModal = _228[1];
742
+ var _229 = (0, react_1.useState)(false), exportExcel = _229[0], setExportExcel = _229[1];
743
+ var _230 = (0, react_1.useState)(""), exportType = _230[0], setExportType = _230[1];
744
+ var _231 = (0, react_1.useState)(false), exportQR = _231[0], setExportQR = _231[1];
745
+ var _232 = (0, react_1.useState)(function () {
734
746
  var _a, _b;
735
747
  var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
736
748
  return firstTabId;
737
- }), activeTab = _226[0], setActiveTab = _226[1];
738
- var _227 = (0, react_1.useState)(false), signatureSigning = _227[0], setSignatureSigning = _227[1];
739
- var _228 = (0, react_1.useState)({}), selectedData = _228[0], setSelectedData = _228[1];
740
- var _229 = (0, react_1.useState)(""), selectedObjectStructureId = _229[0], setSelectedObjectStructureId = _229[1];
741
- var _230 = (0, react_1.useState)(""), selectedObjectId = _230[0], setSelectedObjectId = _230[1];
742
- var _231 = (0, react_1.useState)(""), selectedListAddressId = _231[0], setSelectedListAddressId = _231[1];
743
- var _232 = (0, react_1.useState)(-1), selectedListAddressIndex = _232[0], setSelectedListAddressIndex = _232[1];
744
- var _233 = (0, react_1.useState)({
749
+ }), activeTab = _232[0], setActiveTab = _232[1];
750
+ var _233 = (0, react_1.useState)(false), signatureSigning = _233[0], setSignatureSigning = _233[1];
751
+ var _234 = (0, react_1.useState)({}), selectedData = _234[0], setSelectedData = _234[1];
752
+ var _235 = (0, react_1.useState)(""), selectedObjectStructureId = _235[0], setSelectedObjectStructureId = _235[1];
753
+ var _236 = (0, react_1.useState)(""), selectedObjectId = _236[0], setSelectedObjectId = _236[1];
754
+ var _237 = (0, react_1.useState)(""), selectedListAddressId = _237[0], setSelectedListAddressId = _237[1];
755
+ var _238 = (0, react_1.useState)(-1), selectedListAddressIndex = _238[0], setSelectedListAddressIndex = _238[1];
756
+ var _239 = (0, react_1.useState)({
745
757
  lat: 0,
746
758
  lng: 0,
747
759
  name: "",
748
- }), selectedListAddress = _233[0], setSelectedListAddress = _233[1];
749
- var _234 = (0, react_1.useState)({}), selectedObjectData = _234[0], setSelectedObjectData = _234[1];
750
- var _235 = (0, react_1.useState)(null), objectCellEdit = _235[0], setObjectCellEdit = _235[1];
751
- var _236 = (0, react_1.useState)(false), referenceLoading = _236[0], setReferenceLoading = _236[1];
752
- var _237 = (0, react_1.useState)({}), referencesOptions = _237[0], setReferencesOptions = _237[1];
753
- var _238 = (0, react_1.useState)({}), referencesDetails = _238[0], setReferencesDetails = _238[1];
754
- var _239 = (0, react_1.useState)({}), listReferencesOptions = _239[0], setListReferencesOptions = _239[1];
760
+ }), selectedListAddress = _239[0], setSelectedListAddress = _239[1];
761
+ var _240 = (0, react_1.useState)({}), selectedObjectData = _240[0], setSelectedObjectData = _240[1];
762
+ var _241 = (0, react_1.useState)(null), objectCellEdit = _241[0], setObjectCellEdit = _241[1];
763
+ var _242 = (0, react_1.useState)(false), referenceLoading = _242[0], setReferenceLoading = _242[1];
764
+ var _243 = (0, react_1.useState)({}), referencesOptions = _243[0], setReferencesOptions = _243[1];
765
+ var _244 = (0, react_1.useState)({}), referencesDetails = _244[0], setReferencesDetails = _244[1];
766
+ var _245 = (0, react_1.useState)({}), listReferencesOptions = _245[0], setListReferencesOptions = _245[1];
755
767
  // INFO: the referenced records themselves, for a table cell that picks from
756
768
  // a list on one (referenceSelection)
757
- var _240 = (0, react_1.useState)({}), listReferencesDetails = _240[0], setListReferencesDetails = _240[1];
758
- var _241 = (0, react_1.useState)({}), referenceDeleteTableData = _241[0], setReferenceDeleteTableData = _241[1];
759
- var _242 = (0, react_1.useState)([]), relatedSections = _242[0], setRelatedSections = _242[1];
760
- var _243 = (0, react_1.useState)(0), referenceDeleteIndex = _243[0], setReferenceDeleteIndex = _243[1];
761
- var _244 = (0, react_1.useState)({
769
+ var _246 = (0, react_1.useState)({}), listReferencesDetails = _246[0], setListReferencesDetails = _246[1];
770
+ var _247 = (0, react_1.useState)({}), referenceDeleteTableData = _247[0], setReferenceDeleteTableData = _247[1];
771
+ var _248 = (0, react_1.useState)([]), relatedSections = _248[0], setRelatedSections = _248[1];
772
+ var _249 = (0, react_1.useState)(0), referenceDeleteIndex = _249[0], setReferenceDeleteIndex = _249[1];
773
+ var _250 = (0, react_1.useState)({
762
774
  id: "",
763
775
  name: "",
764
776
  type: "string",
765
- }), referenceCreationModal = _244[0], setReferenceCreationModal = _244[1];
766
- var _245 = (0, react_1.useState)({}), referenceModelSchema = _245[0], setReferenceSchema = _245[1];
767
- var _246 = (0, react_1.useState)([]), kanbanChecked = _246[0], setKanbanChecked = _246[1];
777
+ }), referenceCreationModal = _250[0], setReferenceCreationModal = _250[1];
778
+ var _251 = (0, react_1.useState)({}), referenceModelSchema = _251[0], setReferenceSchema = _251[1];
779
+ var _252 = (0, react_1.useState)([]), kanbanChecked = _252[0], setKanbanChecked = _252[1];
768
780
  //INFO : Offline
769
- var _247 = (0, react_1.useState)(0), offlineDataLength = _247[0], setOfflineDataLength = _247[1];
770
- var _248 = (0, react_1.useState)(false), offlineModal = _248[0], setOfflineModal = _248[1];
781
+ var _253 = (0, react_1.useState)(0), offlineDataLength = _253[0], setOfflineDataLength = _253[1];
782
+ var _254 = (0, react_1.useState)(false), offlineModal = _254[0], setOfflineModal = _254[1];
771
783
  // INFO: live-stream state — driven by socket connection and navigator.onLine
772
- var _249 = (0, react_1.useState)(false), isLive = _249[0], setIsLive = _249[1];
773
- var _250 = (0, react_1.useState)(false), isLiveOffline = _250[0], setIsLiveOffline = _250[1];
784
+ var _255 = (0, react_1.useState)(false), isLive = _255[0], setIsLive = _255[1];
785
+ var _256 = (0, react_1.useState)(false), isLiveOffline = _256[0], setIsLiveOffline = _256[1];
774
786
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
775
787
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
776
788
  // Independent of SSE status so it works even when bareSocketName is not set.
777
- var _251 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _251[0], setIsNetworkOffline = _251[1];
789
+ var _257 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _257[0], setIsNetworkOffline = _257[1];
778
790
  var previousType = (0, react_1.useRef)(null);
779
791
  var previousSelectedData = (0, react_1.useRef)(null);
780
792
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -924,7 +936,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
924
936
  * viewId still wins when present: it is a deliberate destination, from a
925
937
  * shared link or a back button.
926
938
  */
927
- 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;
939
+ 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;
928
940
  // INFO: the pinned tab is a LIST destination. Falling back to it while a
929
941
  // record is open resolved the read view to a list tab, which renderTabContent
930
942
  // refuses — so General Details rendered nothing. Only a list falls back.
@@ -936,14 +948,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
936
948
  // INFO: Firestore reads and the monday wrapper join every condition with AND
937
949
  // (monday flattens all ORs into one), so a flex OR group is offered on Mongo only
938
950
  var isFlexOrSupported = !isFirebase && devSettings.server !== "mondayServer";
939
- var isDateWarnings = !!((_15 = props.organise) === null || _15 === void 0 ? void 0 : _15.dateWarnings);
940
- var isDatasheetDefaults = !!((_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.datasheetDefaults);
951
+ var isDateWarnings = !!((_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.dateWarnings);
952
+ var isDatasheetDefaults = !!((_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.datasheetDefaults);
941
953
  // INFO: the columns as the views draw them — with datasheet defaults every
942
954
  // list option without a colour takes the palette colour of its position
943
955
  var displayStructure = isDatasheetDefaults
944
956
  ? (0, defaultColours_1.handleApplyDefaultColours)(structure)
945
957
  : structure;
946
- 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;
958
+ 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;
947
959
  var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
948
960
  var selectedRelated = resolvedType === "read"
949
961
  ? relatedSections.find(function (eachSection) { return eachSection.id === viewType; })
@@ -1137,32 +1149,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1137
1149
  }, [
1138
1150
  resolvedType,
1139
1151
  props.id,
1140
- (_19 = props.space) === null || _19 === void 0 ? void 0 : _19._id,
1152
+ (_20 = props.space) === null || _20 === void 0 ? void 0 : _20._id,
1141
1153
  props.devSettings.schemaEndpoint,
1142
- (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.showRelatedTab,
1154
+ (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.showRelatedTab,
1143
1155
  ]);
1144
1156
  /* eslint-enable */
1145
1157
  // INFO: the view settings panel (columns, sort, rows per page) is standard on
1146
1158
  // the new DTW; bareViewSettings stays the opt-in for legacy and bare DTWs
1147
- var isViewSettingsEnabled = ((_21 = props.bareSettings) === null || _21 === void 0 ? void 0 : _21.bareViewSettings) || ((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareNewDTW)
1159
+ var isViewSettingsEnabled = ((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareViewSettings) || ((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareNewDTW)
1148
1160
  ? true
1149
1161
  : false;
1150
1162
  // INFO: a consumer that wires onChangeHide owns the hide at schema level
1151
1163
  // (shared by every user) — toggling writes to the model and calls back. Without it
1152
1164
  // the hide is this user's own and lives in userHiddenColumnIds.
1153
- var isSchemaHideMode = ((_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.onChangeHide) ? true : false;
1165
+ var isSchemaHideMode = ((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.onChangeHide) ? true : false;
1154
1166
  // INFO: rows per page is a view setting the user can change, so it starts from
1155
1167
  // the persisted value and falls back to the consumer's limit
1156
- 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];
1168
+ 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];
1157
1169
  var limit = pageLimit;
1158
- var isSavedViewsEnabled = !!((_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.savedViews) && resolvedType === "list";
1170
+ var isSavedViewsEnabled = !!((_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.savedViews) && resolvedType === "list";
1171
+ // INFO: a calendar and a chart draw their own way, so columns, sort and
1172
+ // group have nothing to change there
1173
+ var isViewSettingsHiddenForTab = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "calendar" || (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "chart";
1174
+ // INFO: Group shapes a table, list or grid into sections, a map into routes
1175
+ // and a timeline into colours
1176
+ var isGroupPickerShown = !!((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.showGroupByFeature) && !isViewSettingsHiddenForTab;
1159
1177
  // INFO: an app that stores views takes over from this browser's storage, so
1160
1178
  // every view is the team's and nothing is kept locally
1161
- var isAppViews = ((_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.sharedViews) !== undefined ||
1162
- !!((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.onChangeSharedViews);
1179
+ var isAppViews = ((_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.sharedViews) !== undefined ||
1180
+ !!((_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.onChangeSharedViews);
1163
1181
  // INFO: a saved view carries its sort, so the sort is held here as with persistViewState
1164
1182
  var isInternalSort = isPersistEnabled || isSavedViewsEnabled;
1165
- var activeSortId = (isInternalSort && persistedSort) || ((_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.sort);
1183
+ var activeSortId = (isInternalSort && persistedSort) || ((_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.sort);
1166
1184
  var handleSortColumn = function (value) {
1167
1185
  var _a, _b, _c, _d;
1168
1186
  if (isInternalSort)
@@ -1192,7 +1210,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1192
1210
  // INFO: Firebase pages by document cursor and a union by skip, so neither
1193
1211
  // can hand over the whole set — there formula columns are not offered for
1194
1212
  // sorting or filtering, rather than ordering one page
1195
- var isFormulaViewSupported = !isFirebase && !((_31 = (_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.unionCollections) === null || _31 === void 0 ? void 0 : _31.length);
1213
+ var isFormulaViewSupported = !isFirebase && !((_33 = (_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.unionCollections) === null || _33 === void 0 ? void 0 : _33.length);
1196
1214
  var formulaSort = isFormulaViewSupported &&
1197
1215
  (activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) &&
1198
1216
  formulaColumnIds.includes(activeSortId.sortId)
@@ -1203,12 +1221,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1203
1221
  // a union read runs them
1204
1222
  // INFO: a people filter's "me" needs only who is signed in, which any
1205
1223
  // backend can match
1206
- var currentUserId = (_32 = props.devSettings.currentUser) === null || _32 === void 0 ? void 0 : _32.userId;
1207
- var flexFilterExtras = !isFirebase && !((_34 = (_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.unionCollections) === null || _34 === void 0 ? void 0 : _34.length)
1224
+ var currentUserId = (_34 = props.devSettings.currentUser) === null || _34 === void 0 ? void 0 : _34.userId;
1225
+ var flexFilterExtras = !isFirebase && !((_36 = (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.unionCollections) === null || _36 === void 0 ? void 0 : _36.length)
1208
1226
  ? {
1209
- references: (_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareFlexFilterReferences,
1210
- listObjects: (_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareFlexFilterListObjects,
1211
- related: (_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareFlexFilterRelated,
1227
+ references: (_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareFlexFilterReferences,
1228
+ listObjects: (_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareFlexFilterListObjects,
1229
+ related: (_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareFlexFilterRelated,
1212
1230
  currentUserId: currentUserId,
1213
1231
  }
1214
1232
  : currentUserId
@@ -1300,18 +1318,67 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1300
1318
  displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
1301
1319
  };
1302
1320
  };
1303
- var _253 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _253.canUpdateRecord, canInlineUpdate = _253.canInlineUpdate, canBatchUpdate = _253.canBatchUpdate, canDeleteRecord = _253.canDeleteRecord;
1304
- var isEditor = ((_38 = props.edit) === null || _38 === void 0 ? void 0 : _38.allEditable) ? true : false;
1305
- var isOffline = (_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareOffline;
1321
+ // INFO: a formula filter runs in the browser, so a select-all read on the
1322
+ // server matches more rows than the list shows — only the ids the formula
1323
+ // kept may be deleted or updated. null when the kept rows are not known
1324
+ var handleGetFormulaKeptIds = function () {
1325
+ if (formulaFlexQueries.length === 0)
1326
+ return null;
1327
+ var cached = formulaFullReadRef.current;
1328
+ if (!cached)
1329
+ return new Set();
1330
+ return new Set(handleApplyFormulaView(cached.rows, cached.displayRows).rows.map(function (eachRow) { return handleGetRowId(eachRow); }));
1331
+ };
1332
+ // INFO: a row's id whether it came straight from the server (its serverId)
1333
+ // or through the list, which renames _id to id
1334
+ 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 : ""); };
1335
+ // INFO: the count the reader saw when choosing select-all — a delete or
1336
+ // update refuses if what matches then is a different number, even if the
1337
+ // list has since reloaded with a new count
1338
+ var selectAllSizeRef = (0, react_1.useRef)(0);
1339
+ var handleGetChangedListMessage = function (matchedCount) {
1340
+ return "The list changed: ".concat(selectAllSizeRef.current.toLocaleString(), " records were selected but ").concat(matchedCount.toLocaleString(), " match now. Refresh and select again.");
1341
+ };
1342
+ // INFO: whether the reader narrowed the list — the app's own fixed
1343
+ // conditions (a workspace, a member's rows) are not the reader's filters
1344
+ var handleHasFilterValue = function (values) {
1345
+ return Object.values(values !== null && values !== void 0 ? values : {}).some(function (value) {
1346
+ return Array.isArray(value)
1347
+ ? value.length > 0
1348
+ : value !== undefined &&
1349
+ value !== null &&
1350
+ value !== "" &&
1351
+ (value instanceof Date ||
1352
+ !(typeof value === "object" && Object.keys(value).length === 0));
1353
+ });
1354
+ };
1355
+ var handleCheckReaderFiltered = function () {
1356
+ return [
1357
+ filterSearchParams,
1358
+ filterSelection,
1359
+ filterReference,
1360
+ filterReferenceDate,
1361
+ ].some(handleHasFilterValue) ||
1362
+ flexFiltersDebounced.some(function (eachFilter) {
1363
+ return (0, flexFilter_1.isFlexFilterActive)(eachFilter, structure, flexFilterExtras);
1364
+ });
1365
+ };
1366
+ // INFO: what a select-all covers, by count, so a delete says how much
1367
+ var handleGetSelectAllText = function () {
1368
+ return "".concat(size.toLocaleString(), " records ").concat(handleCheckReaderFiltered() ? "matching your filters" : "in this list");
1369
+ };
1370
+ var _259 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _259.canUpdateRecord, canInlineUpdate = _259.canInlineUpdate, canBatchUpdate = _259.canBatchUpdate, canDeleteRecord = _259.canDeleteRecord;
1371
+ var isEditor = ((_40 = props.edit) === null || _40 === void 0 ? void 0 : _40.allEditable) ? true : false;
1372
+ var isOffline = (_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.bareOffline;
1306
1373
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
1307
1374
  // the live network state — online saves go to the server even if bareOffline
1308
1375
  // is true, offline saves go to IDB as normal.
1309
- var isOfflineNetworkListener = isOffline && ((_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.bareOfflineNetworkListener);
1310
- var showId = (_41 = props.space) === null || _41 === void 0 ? void 0 : _41.showId;
1376
+ var isOfflineNetworkListener = isOffline && ((_42 = props.bareSettings) === null || _42 === void 0 ? void 0 : _42.bareOfflineNetworkListener);
1377
+ var showId = (_43 = props.space) === null || _43 === void 0 ? void 0 : _43.showId;
1311
1378
  var remainId = showId || selectedObjectStructureId ? true : false;
1312
- var idField = ((_42 = props.space) === null || _42 === void 0 ? void 0 : _42.idField) || ((_43 = props.organise) === null || _43 === void 0 ? void 0 : _43.idField);
1313
- var pipeline = (_44 = props === null || props === void 0 ? void 0 : props.space) === null || _44 === void 0 ? void 0 : _44.pipeline;
1314
- if ((_45 = props.bareSettings) === null || _45 === void 0 ? void 0 : _45.bareListPipeline) {
1379
+ var idField = ((_44 = props.space) === null || _44 === void 0 ? void 0 : _44.idField) || ((_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.idField);
1380
+ var pipeline = (_46 = props === null || props === void 0 ? void 0 : props.space) === null || _46 === void 0 ? void 0 : _46.pipeline;
1381
+ if ((_47 = props.bareSettings) === null || _47 === void 0 ? void 0 : _47.bareListPipeline) {
1315
1382
  pipeline = pipeline
1316
1383
  ? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
1317
1384
  }
@@ -1324,30 +1391,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1324
1391
  * three records came back instead of five files, and each tile received the
1325
1392
  * whole array rather than one file, so every one of them read "Attachment".
1326
1393
  */
1327
- var fileViewColumnId = (_49 = (_48 = ((_47 = (_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.extendedTabs) !== null && _47 !== void 0 ? _47 : []).find(function (eachTab) {
1394
+ var fileViewColumnId = (_51 = (_50 = ((_49 = (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.extendedTabs) !== null && _49 !== void 0 ? _49 : []).find(function (eachTab) {
1328
1395
  return eachTab.viewType === "file" &&
1329
1396
  (0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
1330
- })) === null || _48 === void 0 ? void 0 : _48.fileSettings) === null || _49 === void 0 ? void 0 : _49.columnId;
1331
- var hasNavigation = ((_50 = props.organise) === null || _50 === void 0 ? void 0 : _50.handleNavigate) ? true : false;
1397
+ })) === null || _50 === void 0 ? void 0 : _50.fileSettings) === null || _51 === void 0 ? void 0 : _51.columnId;
1398
+ // INFO: select-all promises "all N records", so it is offered only where N
1399
+ // is the total a delete reads — not on Firebase (N is the rows loaded so
1400
+ // far), a union of datasheets (N counts the others too), a file view (N
1401
+ // counts files, not records) or offline
1402
+ var isSelectAllUncountable = isFirebase ||
1403
+ !!((_53 = (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.unionCollections) === null || _53 === void 0 ? void 0 : _53.length) ||
1404
+ !!fileViewColumnId ||
1405
+ !!((_54 = props.bareSettings) === null || _54 === void 0 ? void 0 : _54.bareOffline);
1406
+ var hasNavigation = ((_55 = props.organise) === null || _55 === void 0 ? void 0 : _55.handleNavigate) ? true : false;
1332
1407
  var formColumn = "grid-cols-12";
1333
- var useMobileView = (_52 = (_51 = props.bareSettings) === null || _51 === void 0 ? void 0 : _51.bareUpdateMobileView) !== null && _52 !== void 0 ? _52 : false;
1408
+ var useMobileView = (_57 = (_56 = props.bareSettings) === null || _56 === void 0 ? void 0 : _56.bareUpdateMobileView) !== null && _57 !== void 0 ? _57 : false;
1334
1409
  var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
1335
- var isActivityLog = (((_54 = (_53 = props.edit) === null || _53 === void 0 ? void 0 : _53.activityLog) === null || _54 === void 0 ? void 0 : _54.enableComments) &&
1336
- ((_55 = props.edit) === null || _55 === void 0 ? void 0 : _55.activityLog.commentCollectionId)) ||
1337
- (((_57 = (_56 = props.edit) === null || _56 === void 0 ? void 0 : _56.activityLog) === null || _57 === void 0 ? void 0 : _57.enableLogs) &&
1338
- ((_58 = props.edit) === null || _58 === void 0 ? void 0 : _58.activityLog.logsCollectionId));
1410
+ var isActivityLog = (((_59 = (_58 = props.edit) === null || _58 === void 0 ? void 0 : _58.activityLog) === null || _59 === void 0 ? void 0 : _59.enableComments) &&
1411
+ ((_60 = props.edit) === null || _60 === void 0 ? void 0 : _60.activityLog.commentCollectionId)) ||
1412
+ (((_62 = (_61 = props.edit) === null || _61 === void 0 ? void 0 : _61.activityLog) === null || _62 === void 0 ? void 0 : _62.enableLogs) &&
1413
+ ((_63 = props.edit) === null || _63 === void 0 ? void 0 : _63.activityLog.logsCollectionId));
1339
1414
  // INFO: a record's comments and logs shown in place of the record rather than
1340
1415
  // in a drawer of their own — a related tab already sits inside the read
1341
1416
  // drawer, and a second drawer over it hid the row being discussed. It opens
1342
1417
  // the row through handleNavigate, so without one it stays off and the
1343
1418
  // drawer is used, rather than leaving a comment button that does nothing
1344
1419
  var isInlineActivity = !!isActivityLog &&
1345
- !!((_59 = props.bareSettings) === null || _59 === void 0 ? void 0 : _59.bareInlineActivity) &&
1420
+ !!((_64 = props.bareSettings) === null || _64 === void 0 ? void 0 : _64.bareInlineActivity) &&
1346
1421
  hasNavigation;
1347
1422
  // INFO: each row button opens what it shows: the comment button the row's
1348
1423
  // comments and logs alone, the eye (or the row) its details alone, so
1349
1424
  // neither has to be scrolled past to reach the other
1350
- var _254 = (0, react_1.useState)(false), inlineActivityOnly = _254[0], setInlineActivityOnly = _254[1];
1425
+ var _260 = (0, react_1.useState)(false), inlineActivityOnly = _260[0], setInlineActivityOnly = _260[1];
1351
1426
  var isActivityOnly = isInlineActivity && inlineActivityOnly;
1352
1427
  // INFO: the row whose comments were shown; going back to the list asks its
1353
1428
  // comment count again, as the drawer does when it closes
@@ -1386,12 +1461,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1386
1461
  // column
1387
1462
  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 }));
1388
1463
  };
1389
- var customPaginationSize = ((_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.customPaginationCount)
1464
+ var customPaginationSize = ((_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.customPaginationCount)
1390
1465
  ? props.organise.customPaginationCount(size)
1391
1466
  : undefined;
1392
1467
  //TODO : Code - Pass ...devSettings, search dbEndpoint:
1393
1468
  var writeServerQuery = new writeQuery_1.WriteQuery({
1394
- dbModule: (_61 = props.lib) === null || _61 === void 0 ? void 0 : _61.axios,
1469
+ dbModule: (_66 = props.lib) === null || _66 === void 0 ? void 0 : _66.axios,
1395
1470
  dbType: devSettings.server,
1396
1471
  dbCollection: props.collectionId,
1397
1472
  dbEndpoint: devSettings.dbEndpoint,
@@ -1399,7 +1474,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1399
1474
  dbUserToken: devSettings.dbUserToken,
1400
1475
  });
1401
1476
  var readServerQuery = new readQuery_1.ReadQuery({
1402
- dbModule: (_62 = props.lib) === null || _62 === void 0 ? void 0 : _62.axios,
1477
+ dbModule: (_67 = props.lib) === null || _67 === void 0 ? void 0 : _67.axios,
1403
1478
  dbType: devSettings.server,
1404
1479
  dbCollection: props.collectionId,
1405
1480
  dbEndpoint: devSettings.dbEndpoint,
@@ -1407,12 +1482,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1407
1482
  dbUserToken: devSettings.dbUserToken,
1408
1483
  });
1409
1484
  var moreButtonPopUp = [
1410
- ((_63 = props.edit) === null || _63 === void 0 ? void 0 : _63.allEditable) &&
1485
+ ((_68 = props.edit) === null || _68 === void 0 ? void 0 : _68.allEditable) &&
1411
1486
  // INFO: the import runs on the server (importEndpoint), so a Firestore
1412
1487
  // datasheet served through one can import; only the browser-direct
1413
1488
  // Firebase client has no server to import through
1414
1489
  !isFirebaseClient &&
1415
- !((_65 = (_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.exportSettings) === null || _65 === void 0 ? void 0 : _65.hideImportCSV)
1490
+ !((_70 = (_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.exportSettings) === null || _70 === void 0 ? void 0 : _70.hideImportCSV)
1416
1491
  ? {
1417
1492
  text: "Import Excel",
1418
1493
  onClick: function () {
@@ -1421,7 +1496,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1421
1496
  },
1422
1497
  }
1423
1498
  : null,
1424
- !((_67 = (_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.exportSettings) === null || _67 === void 0 ? void 0 : _67.hideExportCSV)
1499
+ !((_72 = (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.exportSettings) === null || _72 === void 0 ? void 0 : _72.hideExportCSV)
1425
1500
  ? {
1426
1501
  text: "Export CSV",
1427
1502
  onClick: function () {
@@ -1431,7 +1506,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1431
1506
  },
1432
1507
  }
1433
1508
  : null,
1434
- !((_69 = (_68 = props.organise) === null || _68 === void 0 ? void 0 : _68.exportSettings) === null || _69 === void 0 ? void 0 : _69.hideExportExcel)
1509
+ !((_74 = (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.exportSettings) === null || _74 === void 0 ? void 0 : _74.hideExportExcel)
1435
1510
  ? {
1436
1511
  text: "Export Excel",
1437
1512
  onClick: function () {
@@ -1441,7 +1516,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1441
1516
  },
1442
1517
  }
1443
1518
  : null,
1444
- !((_71 = (_70 = props.organise) === null || _70 === void 0 ? void 0 : _70.exportSettings) === null || _71 === void 0 ? void 0 : _71.hideExportPDF)
1519
+ !((_76 = (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.exportSettings) === null || _76 === void 0 ? void 0 : _76.hideExportPDF)
1445
1520
  ? {
1446
1521
  text: "Export PDF",
1447
1522
  onClick: function () {
@@ -1451,7 +1526,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1451
1526
  },
1452
1527
  }
1453
1528
  : null,
1454
- !((_73 = (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.exportSettings) === null || _73 === void 0 ? void 0 : _73.hideExportQR)
1529
+ !((_78 = (_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.exportSettings) === null || _78 === void 0 ? void 0 : _78.hideExportQR)
1455
1530
  ? {
1456
1531
  text: "Export QR",
1457
1532
  onClick: function () {
@@ -1461,7 +1536,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1461
1536
  },
1462
1537
  }
1463
1538
  : null,
1464
- !((_75 = (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.exportSettings) === null || _75 === void 0 ? void 0 : _75.hideExportQR)
1539
+ !((_80 = (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.exportSettings) === null || _80 === void 0 ? void 0 : _80.hideExportQR)
1465
1540
  ? {
1466
1541
  text: "Export QR(Data)",
1467
1542
  onClick: function () {
@@ -1471,7 +1546,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1471
1546
  },
1472
1547
  }
1473
1548
  : null,
1474
- !((_77 = (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.exportSettings) === null || _77 === void 0 ? void 0 : _77.hideExportPrint)
1549
+ !((_82 = (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.exportSettings) === null || _82 === void 0 ? void 0 : _82.hideExportPrint)
1475
1550
  ? {
1476
1551
  text: "Print",
1477
1552
  onClick: function () {
@@ -1483,8 +1558,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1483
1558
  : null,
1484
1559
  // INFO: drafts only exist where the form can save one, so the filter has
1485
1560
  // nothing to find on any other page
1486
- ((_78 = props.edit) === null || _78 === void 0 ? void 0 : _78.enableUpdateDraft) &&
1487
- !((_80 = (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.exportSettings) === null || _80 === void 0 ? void 0 : _80.hideExportDraft)
1561
+ ((_83 = props.edit) === null || _83 === void 0 ? void 0 : _83.enableUpdateDraft) &&
1562
+ !((_85 = (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.exportSettings) === null || _85 === void 0 ? void 0 : _85.hideExportDraft)
1488
1563
  ? {
1489
1564
  text: filterDraft ? "Show All Items" : "Filter Draft",
1490
1565
  onClick: function () {
@@ -1493,7 +1568,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1493
1568
  }
1494
1569
  : null,
1495
1570
  ].filter(Boolean);
1496
- if ((_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.moreSettings)
1571
+ if ((_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.moreSettings)
1497
1572
  moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
1498
1573
  //=====================================================================================
1499
1574
  //SECTION: User Column Visibility Handlers
@@ -1938,14 +2013,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1938
2013
  //=====================================================================================
1939
2014
  //SECTION: Saved Views
1940
2015
  //=====================================================================================
1941
- 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);
2016
+ 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);
1942
2017
  (0, react_1.useEffect)(function () {
1943
2018
  if (isSavedViewsEnabled && !isAppViews)
1944
2019
  setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
1945
2020
  }, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
1946
2021
  // INFO: the app keeps All's settings, so every change is kept in this
1947
2022
  // browser until the person updates the view for everyone or resets it
1948
- var isViewDraftsEnabled = isSavedViewsEnabled && ((_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.allView) !== undefined;
2023
+ var isViewDraftsEnabled = isSavedViewsEnabled && ((_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.allView) !== undefined;
1949
2024
  var handleGetViewDraftKey = function (viewId) {
1950
2025
  var _a, _b;
1951
2026
  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);
@@ -2074,7 +2149,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2074
2149
  var lastSentSharedViewsRef = (0, react_1.useRef)(null);
2075
2150
  (0, react_1.useEffect)(function () {
2076
2151
  lastSentSharedViewsRef.current = null;
2077
- }, [(_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.sharedViews]);
2152
+ }, [(_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.sharedViews]);
2078
2153
  var handleStoreSharedViews = function (update) {
2079
2154
  var _a, _b, _c;
2080
2155
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
@@ -2091,7 +2166,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2091
2166
  var openingViewSettledRef = (0, react_1.useRef)(false);
2092
2167
  // INFO: keyed on the ids, so a list handed in again on every render does
2093
2168
  // not re-run the opening
2094
- var starredViewIdsKey = ((_87 = (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.defaultSavedViewIds) !== null && _87 !== void 0 ? _87 : []).join("|");
2169
+ var starredViewIdsKey = ((_92 = (_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.defaultSavedViewIds) !== null && _92 !== void 0 ? _92 : []).join("|");
2095
2170
  (0, react_1.useEffect)(function () {
2096
2171
  var _a, _b, _c, _d;
2097
2172
  if (!isSavedViewsEnabled || openingViewSettledRef.current)
@@ -2129,13 +2204,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2129
2204
  /* eslint-disable */
2130
2205
  }, [
2131
2206
  isSavedViewsEnabled,
2132
- (_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.initialSavedViewId,
2207
+ (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.initialSavedViewId,
2133
2208
  starredViewIdsKey,
2134
- (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.sharedViews,
2209
+ (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.sharedViews,
2135
2210
  savedViews,
2136
2211
  ]);
2137
2212
  /* eslint-enable */
2138
- var appDefaultViewIds = ((_91 = (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.defaultSavedViews) !== null && _91 !== void 0 ? _91 : [])
2213
+ var appDefaultViewIds = ((_96 = (_95 = props.organise) === null || _95 === void 0 ? void 0 : _95.defaultSavedViews) !== null && _96 !== void 0 ? _96 : [])
2139
2214
  .map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
2140
2215
  .join("|");
2141
2216
  // INFO: keyed on the ids, not the array, so an inline literal passed on every
@@ -2546,8 +2621,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2546
2621
  laneWidths,
2547
2622
  drawerWidth,
2548
2623
  pinnedColumnIds,
2549
- (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.allView,
2550
- (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.sharedViews,
2624
+ (_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.allView,
2625
+ (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.sharedViews,
2551
2626
  savedViews,
2552
2627
  ]);
2553
2628
  /* eslint-enable */
@@ -2591,7 +2666,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2591
2666
  if (scrollRestoredRef.current)
2592
2667
  scrollCatchUpRef.current = null;
2593
2668
  /* eslint-disable */
2594
- }, [props.collectionId, (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.persistKey]);
2669
+ }, [props.collectionId, (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.persistKey]);
2595
2670
  /* eslint-enable */
2596
2671
  // INFO: wait a frame — rows land in state one tick before layout
2597
2672
  (0, react_1.useEffect)(function () {
@@ -2626,7 +2701,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2626
2701
  (0, react_1.useEffect)(function () {
2627
2702
  handleOfflinePrefetch();
2628
2703
  /* eslint-disable */
2629
- }, [props.collectionId, (_95 = props.bareSettings) === null || _95 === void 0 ? void 0 : _95.bareOffline]);
2704
+ }, [props.collectionId, (_100 = props.bareSettings) === null || _100 === void 0 ? void 0 : _100.bareOffline]);
2630
2705
  /* eslint-enable */
2631
2706
  // INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
2632
2707
  // Calls through handleRefreshRef so the interval always dispatches the latest
@@ -2646,7 +2721,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2646
2721
  }, interval);
2647
2722
  return function () { return clearInterval(timer); };
2648
2723
  /* eslint-disable */
2649
- }, [(_96 = props.bareSettings) === null || _96 === void 0 ? void 0 : _96.barePollingInterval, isLive, isNetworkOffline]);
2724
+ }, [(_101 = props.bareSettings) === null || _101 === void 0 ? void 0 : _101.barePollingInterval, isLive, isNetworkOffline]);
2650
2725
  /* eslint-enable */
2651
2726
  // INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
2652
2727
  // EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
@@ -2688,7 +2763,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2688
2763
  };
2689
2764
  /* eslint-disable */
2690
2765
  }, [
2691
- (_97 = props.bareSettings) === null || _97 === void 0 ? void 0 : _97.bareSocketName,
2766
+ (_102 = props.bareSettings) === null || _102 === void 0 ? void 0 : _102.bareSocketName,
2692
2767
  props.collectionId,
2693
2768
  props.devSettings.sseEndpoint,
2694
2769
  props.devSettings.dbAPIToken,
@@ -2962,10 +3037,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2962
3037
  props.collectionId,
2963
3038
  props.model,
2964
3039
  props.localURLEndpoint,
2965
- (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.extendedTabs,
3040
+ (_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.extendedTabs,
2966
3041
  listViewId,
2967
- (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.additionalQuery,
2968
- (_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.groupBy,
3042
+ (_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.additionalQuery,
3043
+ (_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.groupBy,
2969
3044
  resolvedType,
2970
3045
  ]);
2971
3046
  /**
@@ -3117,7 +3192,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
3117
3192
  };
3118
3193
  }, 100);
3119
3194
  return function () { return clearTimeout(timeoutId); };
3120
- }, [(_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.showReadFloatingNav, resolvedType, props.id, loading]);
3195
+ }, [(_106 = props.organise) === null || _106 === void 0 ? void 0 : _106.showReadFloatingNav, resolvedType, props.id, loading]);
3121
3196
  (0, react_1.useEffect)(function () {
3122
3197
  if (resolvedType !== "read")
3123
3198
  return;
@@ -3634,10 +3709,53 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
3634
3709
  }
3635
3710
  return sort;
3636
3711
  };
3712
+ // INFO: a timeline reads one window at a time when it has both ends to
3713
+ // compare; Firebase cannot range two columns at once, so it reads all
3714
+ var handleCheckTimelineWindow = function (settings) { return !!(settings === null || settings === void 0 ? void 0 : settings.startDate) && !!(settings === null || settings === void 0 ? void 0 : settings.endDate) && !isFirebase; };
3637
3715
  var handleReadQueryHocCond = function () {
3638
3716
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
3639
3717
  var query = (_a = renderImpSearchFilterConditions()) !== null && _a !== void 0 ? _a : [];
3640
3718
  var calendarSettings = false;
3719
+ var timelineQuerySettings = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "timeline"
3720
+ ? selectedTab.timelineSettings
3721
+ : undefined;
3722
+ if (handleCheckTimelineWindow(timelineQuerySettings)) {
3723
+ var timelineWindow = (0, timelineBars_1.handleGetTimelineWindow)(timelineRange.unit, timelineRange.anchor);
3724
+ // INFO: a bar overlaps the window when it starts before the window ends
3725
+ // and ends after it starts; one column for both ends is a plain range.
3726
+ // A reader's own filter on a date column stays — the server keeps one
3727
+ // condition per column, so the window gives way on that column
3728
+ var startId = timelineQuerySettings.startDate;
3729
+ var endId = timelineQuerySettings.endDate;
3730
+ var handleIsFiltered = function (queryId) {
3731
+ return query.some(function (eachQuery) { return eachQuery.queryId === queryId && !eachQuery.orQuery; });
3732
+ };
3733
+ if (startId === endId) {
3734
+ if (!handleIsFiltered(startId))
3735
+ query.push({
3736
+ type: "><",
3737
+ queryId: startId,
3738
+ value: [
3739
+ timelineWindow.start.toISOString(),
3740
+ timelineWindow.end.toISOString(),
3741
+ ],
3742
+ });
3743
+ }
3744
+ else {
3745
+ if (!handleIsFiltered(startId))
3746
+ query.push({
3747
+ type: "<",
3748
+ queryId: startId,
3749
+ value: timelineWindow.end.toISOString(),
3750
+ });
3751
+ if (!handleIsFiltered(endId))
3752
+ query.push({
3753
+ type: ">",
3754
+ queryId: endId,
3755
+ value: new Date(timelineWindow.start.getTime() - 1).toISOString(),
3756
+ });
3757
+ }
3758
+ }
3641
3759
  if (selectedTab && selectedTab.viewType === "calendar") {
3642
3760
  var startDate = (0, dayjs_1.default)(calendarTabMonth).toDate();
3643
3761
  var endDate = (0, dayjs_1.default)(calendarTabMonth).toDate();
@@ -4067,6 +4185,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
4067
4185
  };
4068
4186
  var handleSelectAllPages = function (value) {
4069
4187
  var _a;
4188
+ if (value)
4189
+ selectAllSizeRef.current = size;
4070
4190
  setSelectAll(value);
4071
4191
  if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListHandleSelection) {
4072
4192
  var query = renderImpSearchFilterConditions();
@@ -4140,6 +4260,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
4140
4260
  if (nextTabs.some(function (eachTab, index) { return eachTab !== allTabs[index]; }))
4141
4261
  (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onChangeTabs) === null || _d === void 0 ? void 0 : _d.call(_c, nextTabs);
4142
4262
  };
4263
+ // INFO: a tab just added opens at once — its id is its name, so it is
4264
+ // known before the app saves it. An edited tab leaves the reader where
4265
+ // they are
4266
+ var handleAddedTabs = function (nextTabs) {
4267
+ var _a, _b, _c, _d, _e;
4268
+ var previousCount = (_c = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0;
4269
+ (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.onChangeTabs) === null || _e === void 0 ? void 0 : _e.call(_d, nextTabs);
4270
+ var addedTab = nextTabs[nextTabs.length - 1];
4271
+ if (editTabIndex < 0 && nextTabs.length > previousCount && (addedTab === null || addedTab === void 0 ? void 0 : addedTab.name))
4272
+ handleSelectTab((0, utils_1.lowercaseTextToId)(addedTab.name));
4273
+ };
4143
4274
  var handleSelectTab = function (id) {
4144
4275
  var _a, _b;
4145
4276
  if (id === "blixify_new_tab") {
@@ -4493,6 +4624,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
4493
4624
  return;
4494
4625
  if (renderResolvedPaginationType() === "cursor")
4495
4626
  return;
4627
+ // INFO: a calendar, map or timeline already holds every row, and the read
4628
+ // does not change with the group — only how the rows are drawn does
4629
+ if (handleCheckFullSetView())
4630
+ return;
4496
4631
  var isFirstPage = pageIndex === 0;
4497
4632
  handleClearDataByFilter();
4498
4633
  // INFO: from page 0 the request does not change, so ask for the read
@@ -4636,7 +4771,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
4636
4771
  // the link view ends and the list opens as it normally would. A change
4637
4772
  // while a record is open (opening one drops the link from the URL) waits
4638
4773
  // until the list shows again
4639
- var lastInitialSearchRef = (0, react_1.useRef)((_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.initialSearch);
4774
+ var lastInitialSearchRef = (0, react_1.useRef)((_107 = props.organise) === null || _107 === void 0 ? void 0 : _107.initialSearch);
4640
4775
  // INFO: persistViewState reads its stored state only once the link view
4641
4776
  // has ended, a render later
4642
4777
  var isNormalOpenPendingRef = (0, react_1.useRef)(false);
@@ -4663,7 +4798,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
4663
4798
  setIsLinkOpen(true);
4664
4799
  handleApplySavedView(null, true, value);
4665
4800
  /* eslint-disable */
4666
- }, [(_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.initialSearch, resolvedType]);
4801
+ }, [(_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.initialSearch, resolvedType]);
4667
4802
  (0, react_1.useEffect)(function () {
4668
4803
  if (!isNormalOpenPendingRef.current || isLinkOpen)
4669
4804
  return;
@@ -5722,8 +5857,42 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5722
5857
  }
5723
5858
  setDeletePasscode(passcode);
5724
5859
  };
5860
+ // INFO: select-all covers what the filters matched when it was picked; a
5861
+ // changed filter is a different set, so the selection ends rather than
5862
+ // carrying over to rows the reader has not seen
5863
+ // INFO: only what the reader sets — an app's own conditions can carry a
5864
+ // fresh timestamp on every render, which is not a change of filter
5865
+ var selectAllFilterKey = JSON.stringify([
5866
+ filterSearchParams,
5867
+ filterSelection,
5868
+ filterReference,
5869
+ (0, viewStatePersistence_1.serializeDateFilterState)(filterReferenceDate),
5870
+ flexFiltersDebounced
5871
+ .filter(function (eachFilter) {
5872
+ return (0, flexFilter_1.isFlexFilterActive)(eachFilter, structure, flexFilterExtras);
5873
+ })
5874
+ .map(function (_a) {
5875
+ var _id = _a.id, rest = __rest(_a, ["id"]);
5876
+ return rest;
5877
+ }),
5878
+ formulaFlexQueries,
5879
+ selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.name,
5880
+ ]);
5881
+ var selectAllFilterKeyRef = (0, react_1.useRef)(selectAllFilterKey);
5882
+ (0, react_1.useEffect)(function () {
5883
+ if (selectAllFilterKeyRef.current === selectAllFilterKey)
5884
+ return;
5885
+ selectAllFilterKeyRef.current = selectAllFilterKey;
5886
+ // INFO: ticked rows from the old filter go too, so a delete never takes
5887
+ // rows that are no longer on screen
5888
+ if (selectAll)
5889
+ handleSelectAllPages(false);
5890
+ if (selectedIds.length > 0)
5891
+ handleSelectIds([]);
5892
+ /* eslint-disable-next-line */
5893
+ }, [selectAllFilterKey]);
5725
5894
  var handleMultipleRemoveSelectedData = function () { return __awaiter(void 0, void 0, void 0, function () {
5726
- var passcodeMatch, offlineDataResp, offlineData, filteredData, ids, notReferenceId, query, responseData, responseData, data, uploadEndpoint, err_12;
5895
+ var passcodeMatch, offlineDataResp, offlineData, filteredData, ids, notReferenceId, query, responseData, formulaKeptIds_1, matchedRows, deleteIds, start, responseData, data, uploadEndpoint, err_12;
5727
5896
  var _a, _b, _c, _d, _e;
5728
5897
  return __generator(this, function (_f) {
5729
5898
  switch (_f.label) {
@@ -5734,11 +5903,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5734
5903
  setDeleting(true);
5735
5904
  _f.label = 1;
5736
5905
  case 1:
5737
- _f.trys.push([1, 17, 18, 19]);
5906
+ _f.trys.push([1, 20, 21, 22]);
5738
5907
  setLoading(true);
5739
5908
  setModalVisible(true);
5740
5909
  passcodeMatch = deletePasscodeInput === deletePasscode;
5741
- if (!passcodeMatch) return [3 /*break*/, 15];
5910
+ if (!passcodeMatch) return [3 /*break*/, 18];
5742
5911
  if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareOffline)) return [3 /*break*/, 4];
5743
5912
  return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
5744
5913
  case 2:
@@ -5753,11 +5922,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5753
5922
  })];
5754
5923
  case 3:
5755
5924
  _f.sent();
5756
- return [3 /*break*/, 14];
5925
+ return [3 /*break*/, 17];
5757
5926
  case 4:
5758
5927
  ids = [];
5759
5928
  notReferenceId = [];
5760
- if (!selectAll) return [3 /*break*/, 8];
5929
+ if (!selectAll) return [3 /*break*/, 11];
5761
5930
  query = renderImpSearchFilterConditions();
5762
5931
  return [4 /*yield*/, readServerQuery.call({
5763
5932
  type: "list",
@@ -5766,16 +5935,43 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5766
5935
  })];
5767
5936
  case 5:
5768
5937
  responseData = _f.sent();
5769
- return [4 /*yield*/, handleCheckDeleteReference((_c = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _c !== void 0 ? _c : [], true)];
5938
+ formulaKeptIds_1 = handleGetFormulaKeptIds();
5939
+ matchedRows = ((_c = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _c !== void 0 ? _c : []).filter(function (eachRow) {
5940
+ return !formulaKeptIds_1 || formulaKeptIds_1.has(handleGetRowId(eachRow));
5941
+ });
5942
+ // INFO: the rows found now must be the ones the reader was shown
5943
+ // the count of — if the list changed underneath, delete nothing
5944
+ if (matchedRows.length !== selectAllSizeRef.current) {
5945
+ setNotification({
5946
+ type: false,
5947
+ title: "Nothing deleted",
5948
+ msg: handleGetChangedListMessage(matchedRows.length),
5949
+ });
5950
+ setLoading(false);
5951
+ setModalVisible(false);
5952
+ return [2 /*return*/];
5953
+ }
5954
+ return [4 /*yield*/, handleCheckDeleteReference(matchedRows, true)];
5770
5955
  case 6:
5771
5956
  notReferenceId = _f.sent();
5957
+ deleteIds = notReferenceId !== null && notReferenceId !== void 0 ? notReferenceId : [];
5958
+ start = 0;
5959
+ _f.label = 7;
5960
+ case 7:
5961
+ if (!(start < deleteIds.length)) return [3 /*break*/, 10];
5772
5962
  return [4 /*yield*/, writeServerQuery.call("batchDelete", {
5773
- id: notReferenceId,
5963
+ id: deleteIds.slice(start, start + DELETE_ID_CHUNK),
5774
5964
  })];
5775
- case 7:
5776
- ids = _f.sent();
5777
- return [3 /*break*/, 12];
5778
- case 8: return [4 /*yield*/, readServerQuery.call({
5965
+ case 8:
5966
+ _f.sent();
5967
+ _f.label = 9;
5968
+ case 9:
5969
+ start += DELETE_ID_CHUNK;
5970
+ return [3 /*break*/, 7];
5971
+ case 10:
5972
+ ids = deleteIds;
5973
+ return [3 /*break*/, 15];
5974
+ case 11: return [4 /*yield*/, readServerQuery.call({
5779
5975
  type: "list",
5780
5976
  query: [
5781
5977
  {
@@ -5786,18 +5982,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5786
5982
  ],
5787
5983
  stopLimit: true,
5788
5984
  })];
5789
- case 9:
5985
+ case 12:
5790
5986
  responseData = _f.sent();
5791
5987
  return [4 /*yield*/, handleCheckDeleteReference((_d = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _d !== void 0 ? _d : [], true)];
5792
- case 10:
5988
+ case 13:
5793
5989
  notReferenceId = _f.sent();
5794
5990
  return [4 /*yield*/, writeServerQuery.call("batchDelete", {
5795
5991
  id: notReferenceId,
5796
5992
  })];
5797
- case 11:
5993
+ case 14:
5798
5994
  ids = _f.sent();
5799
- _f.label = 12;
5800
- case 12:
5995
+ _f.label = 15;
5996
+ case 15:
5801
5997
  data = new FormData();
5802
5998
  data.append("data[assetCollectionName]", props.collectionId);
5803
5999
  data.append("data[assetParentId]", JSON.stringify(ids !== null && ids !== void 0 ? ids : []));
@@ -5812,13 +6008,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5812
6008
  url: "".concat(uploadEndpoint, "/batchDeleteDirectory"),
5813
6009
  headers: { "Content-Type": "multipart/form-data" },
5814
6010
  }))];
5815
- case 13:
6011
+ case 16:
5816
6012
  _f.sent();
5817
6013
  if (mapViewRef.current)
5818
6014
  mapViewRef.current.handleClearPolygons();
5819
- _f.label = 14;
5820
- case 14: return [3 /*break*/, 16];
5821
- case 15:
6015
+ _f.label = 17;
6016
+ case 17: return [3 /*break*/, 19];
6017
+ case 18:
5822
6018
  setNotification({
5823
6019
  type: false,
5824
6020
  title: "Incorrect Passcode",
@@ -5827,16 +6023,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5827
6023
  setLoading(false);
5828
6024
  setModalVisible(false);
5829
6025
  return [2 /*return*/];
5830
- case 16: return [3 /*break*/, 19];
5831
- case 17:
6026
+ case 19: return [3 /*break*/, 22];
6027
+ case 20:
5832
6028
  err_12 = _f.sent();
5833
- return [3 /*break*/, 19];
5834
- case 18:
6029
+ return [3 /*break*/, 22];
6030
+ case 21:
5835
6031
  deletingRef.current = false;
5836
6032
  setDeleting(false);
5837
6033
  return [7 /*endfinally*/];
5838
- case 19:
6034
+ case 22:
5839
6035
  setDeletePasscodeInput("");
6036
+ // INFO: the selection is gone with the rows it covered
6037
+ if (selectAll)
6038
+ handleSelectAllPages(false);
5840
6039
  handleRefresh();
5841
6040
  return [2 /*return*/];
5842
6041
  }
@@ -6111,19 +6310,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6111
6310
  });
6112
6311
  }); };
6113
6312
  var handleBatchUpdateData = function () { return __awaiter(void 0, void 0, void 0, function () {
6114
- var model_1, columnId_1, dataToSubmit_1, isFile, res, updateQuery, matchedRows, selectAllQuery, batchUpdateConfig, res, err_16;
6115
- var _a;
6116
- return __generator(this, function (_b) {
6117
- switch (_b.label) {
6313
+ var model_1, columnId_1, dataToSubmit_1, isFile, res, updateQuery, handleRefuseUpdate, formulaKeptIds_2, isById, responseData, matchedRows, countData, matchedCount, selectAllQuery, batchUpdateConfig, res, err_16;
6314
+ var _a, _b;
6315
+ return __generator(this, function (_c) {
6316
+ switch (_c.label) {
6118
6317
  case 0:
6119
6318
  if (!canBatchUpdate)
6120
6319
  return [2 /*return*/];
6121
6320
  if (isBatchUpdatingRef.current)
6122
6321
  return [2 /*return*/];
6123
6322
  isBatchUpdatingRef.current = true;
6124
- _b.label = 1;
6323
+ _c.label = 1;
6125
6324
  case 1:
6126
- _b.trys.push([1, 10, 11, 12]);
6325
+ _c.trys.push([1, 12, 13, 14]);
6127
6326
  setLoading(true);
6128
6327
  setModalVisible(true);
6129
6328
  model_1 = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
@@ -6140,13 +6339,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6140
6339
  });
6141
6340
  }); }))];
6142
6341
  case 2:
6143
- res = _b.sent();
6342
+ res = _c.sent();
6144
6343
  if (res) {
6145
6344
  setLoading(false);
6146
6345
  setModalVisible(false);
6147
6346
  setBatchUpdateModal(false);
6148
6347
  }
6149
- return [3 /*break*/, 9];
6348
+ return [3 /*break*/, 11];
6150
6349
  case 3:
6151
6350
  if (!(isFile && !dataToSubmit_1[columnId_1])) return [3 /*break*/, 5];
6152
6351
  return [4 /*yield*/, Promise.all(selectedIds.map(function (eachId) { return __awaiter(void 0, void 0, void 0, function () {
@@ -6161,28 +6360,56 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6161
6360
  });
6162
6361
  }); }))];
6163
6362
  case 4:
6164
- _b.sent();
6165
- _b.label = 5;
6363
+ _c.sent();
6364
+ _c.label = 5;
6166
6365
  case 5:
6167
6366
  updateQuery = renderImpSearchFilterConditions();
6168
- if (!(selectAll &&
6169
- (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];
6367
+ if (!selectAll) return [3 /*break*/, 9];
6368
+ handleRefuseUpdate = function (msg) {
6369
+ setNotification({ type: false, title: "Nothing updated", msg: msg });
6370
+ setLoading(false);
6371
+ setModalVisible(false);
6372
+ setBatchUpdateModal(false);
6373
+ setBatchUpdateData({ columnId: "", columnData: {} });
6374
+ };
6375
+ formulaKeptIds_2 = handleGetFormulaKeptIds();
6376
+ isById = !!formulaKeptIds_2 ||
6377
+ !!(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); }));
6378
+ if (!isById) return [3 /*break*/, 7];
6170
6379
  return [4 /*yield*/, readServerQuery.call({
6171
6380
  type: "list",
6172
6381
  query: updateQuery,
6173
6382
  stopLimit: true,
6174
6383
  })];
6175
6384
  case 6:
6176
- matchedRows = _b.sent();
6385
+ responseData = _c.sent();
6386
+ matchedRows = ((_a = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _a !== void 0 ? _a : []).filter(function (eachRow) {
6387
+ return !formulaKeptIds_2 || formulaKeptIds_2.has(handleGetRowId(eachRow));
6388
+ });
6389
+ if (matchedRows.length !== selectAllSizeRef.current)
6390
+ return [2 /*return*/, handleRefuseUpdate(handleGetChangedListMessage(matchedRows.length))];
6391
+ if (matchedRows.length > SELECT_ALL_ID_CAP)
6392
+ 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."))];
6177
6393
  updateQuery = [
6178
6394
  {
6179
6395
  queryId: serverId,
6180
6396
  type: "in",
6181
- 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]; }),
6397
+ value: matchedRows.map(function (eachRow) { return eachRow === null || eachRow === void 0 ? void 0 : eachRow[serverId]; }),
6182
6398
  },
6183
6399
  ];
6184
- _b.label = 7;
6185
- case 7:
6400
+ return [3 /*break*/, 9];
6401
+ case 7: return [4 /*yield*/, readServerQuery.call({
6402
+ type: "list",
6403
+ query: updateQuery,
6404
+ limit: 1,
6405
+ })];
6406
+ case 8:
6407
+ countData = _c.sent();
6408
+ matchedCount = (_b = countData === null || countData === void 0 ? void 0 : countData.count) !== null && _b !== void 0 ? _b : 0;
6409
+ if (matchedCount !== selectAllSizeRef.current)
6410
+ return [2 /*return*/, handleRefuseUpdate(handleGetChangedListMessage(matchedCount))];
6411
+ _c.label = 9;
6412
+ case 9:
6186
6413
  selectAllQuery = updateQuery
6187
6414
  ? updateQuery
6188
6415
  : [
@@ -6211,15 +6438,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6211
6438
  batchUpdateConfig["data"] = dataToSubmit_1;
6212
6439
  }
6213
6440
  return [4 /*yield*/, writeServerQuery.call("batchUpdate", batchUpdateConfig)];
6214
- case 8:
6215
- res = _b.sent();
6441
+ case 10:
6442
+ res = _c.sent();
6216
6443
  if (res) {
6217
6444
  handleRefresh(false, true);
6218
6445
  }
6219
- _b.label = 9;
6220
- case 9: return [3 /*break*/, 12];
6221
- case 10:
6222
- err_16 = _b.sent();
6446
+ _c.label = 11;
6447
+ case 11: return [3 /*break*/, 14];
6448
+ case 12:
6449
+ err_16 = _c.sent();
6223
6450
  if (err_16.response) {
6224
6451
  setNotification({
6225
6452
  type: false,
@@ -6227,11 +6454,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6227
6454
  msg: handleGetWriteErrorMessage(err_16.response),
6228
6455
  });
6229
6456
  }
6230
- return [3 /*break*/, 12];
6231
- case 11:
6457
+ return [3 /*break*/, 14];
6458
+ case 13:
6232
6459
  isBatchUpdatingRef.current = false;
6233
6460
  return [7 /*endfinally*/];
6234
- case 12:
6461
+ case 14:
6235
6462
  setBatchUpdateData({ columnId: "", columnData: {} });
6236
6463
  return [2 /*return*/];
6237
6464
  }
@@ -6407,7 +6634,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6407
6634
  var columnTypeActions = {
6408
6635
  canUpdate: canUpdateRecord,
6409
6636
  dateWarnings: isDateWarnings,
6410
- onButtonClick: (_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.onButtonClick,
6637
+ onButtonClick: (_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.onButtonClick,
6411
6638
  onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
6412
6639
  var _a;
6413
6640
  return __generator(this, function (_b) {
@@ -6424,7 +6651,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
6424
6651
  }
6425
6652
  });
6426
6653
  }); },
6427
- onTimeTrackingAction: ((_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.onTimeTrackingAction) && canUpdateRecord
6654
+ onTimeTrackingAction: ((_110 = props.organise) === null || _110 === void 0 ? void 0 : _110.onTimeTrackingAction) && canUpdateRecord
6428
6655
  ? function (rowId, columnId, action) {
6429
6656
  return handleTimeTrackingAction(rowId, columnId, action);
6430
6657
  }
@@ -7880,10 +8107,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
7880
8107
  formulaRows = formulaFullReadRef.current;
7881
8108
  if (formulaFlexQueries.length > 0 && formulaRows) {
7882
8109
  kept = handleApplyFormulaView(formulaRows.rows, formulaRows.displayRows).rows;
8110
+ // INFO: these rows came through the list, which renames _id to id
7883
8111
  exportQueryList.push({
7884
8112
  type: "in",
7885
8113
  queryId: serverId,
7886
- value: kept.map(function (eachRow) { return eachRow === null || eachRow === void 0 ? void 0 : eachRow[serverId]; }),
8114
+ value: kept.map(function (eachRow) { return handleGetRowId(eachRow); }),
7887
8115
  });
7888
8116
  }
7889
8117
  baseUrl = props.devSettings.functionEndpoint;
@@ -8558,7 +8786,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8558
8786
  : getActiveUserHiddenColumnIds().includes(column.id);
8559
8787
  };
8560
8788
  var renderViewSettingsContent = function () {
8561
- var _a, _b, _c, _d, _e, _f, _g;
8789
+ var _a, _b, _c, _d, _e, _f;
8562
8790
  var viewColumns = getViewSettingsColumns();
8563
8791
  var hiddenCount = viewColumns.filter(getIsColumnHidden).length;
8564
8792
  var visibleCount = viewColumns.length - hiddenCount;
@@ -8653,10 +8881,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8653
8881
  type: value,
8654
8882
  });
8655
8883
  } })))),
8656
- ((_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) },
8884
+ isGroupPickerShown && (react_1.default.createElement("div", { className: "mt-3 border-t pt-3 ".concat(dividerColor) },
8657
8885
  react_1.default.createElement("p", { className: "text-sm font-medium ".concat(labelColor) }, "Group"),
8658
8886
  react_1.default.createElement("div", { className: "mt-1" },
8659
- 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) {
8887
+ 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) {
8660
8888
  return handleChangeGroupBy(value !== null && value !== void 0 ? value : "", true);
8661
8889
  } })))),
8662
8890
  react_1.default.createElement("div", { className: "mt-3 border-t pt-3 ".concat(dividerColor) },
@@ -8678,8 +8906,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8678
8906
  : rows;
8679
8907
  };
8680
8908
  /* eslint-disable */
8681
- var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_106 = props.bareSettings) === null || _106 === void 0 ? void 0 : _106.bareNewDTW]);
8682
- var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_107 = props.bareSettings) === null || _107 === void 0 ? void 0 : _107.bareNewDTW]);
8909
+ var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_111 = props.bareSettings) === null || _111 === void 0 ? void 0 : _111.bareNewDTW]);
8910
+ var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_112 = props.bareSettings) === null || _112 === void 0 ? void 0 : _112.bareNewDTW]);
8683
8911
  /* eslint-enable */
8684
8912
  // INFO: beside a record's title, the pencil opens its edit form for whoever
8685
8913
  // may update, and the bubble opens comments and logs for anyone who can see
@@ -9885,7 +10113,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9885
10113
  props.renderSettings.renderListUI(actionComponent, filterComponent_1, dataComponent)));
9886
10114
  }
9887
10115
  var renderListFilterElements = function () {
9888
- var _a, _b, _c, _d, _e, _f, _g, _h;
10116
+ var _a, _b, _c, _d, _e, _f, _g;
9889
10117
  // INFO: When bareListFilterAsPopup is true, filters are shown in a popup instead.
9890
10118
  if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListFilterAsPopup)
9891
10119
  return null;
@@ -9910,8 +10138,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9910
10138
  }
9911
10139
  var filterElementList = [];
9912
10140
  if (!((_f = props.organise) === null || _f === void 0 ? void 0 : _f.filterComponentNewRow)) {
9913
- if ((_g = props.organise) === null || _g === void 0 ? void 0 : _g.showGroupByFeature) {
9914
- 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); } }));
10141
+ if (isGroupPickerShown) {
10142
+ 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); } }));
9915
10143
  }
9916
10144
  if (filterComponent_1 &&
9917
10145
  Array.isArray(filterComponent_1) &&
@@ -9958,7 +10186,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9958
10186
  // per page in one panel. Standard on the new DTW; videColumnEnabled
9959
10187
  // keeps it available to legacy and bare DTWs. A calendar has no
9960
10188
  // columns, sort or pages, so it gets no panel.
9961
- if (isViewSettingsEnabled && (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) !== "calendar") {
10189
+ if (isViewSettingsEnabled && !isViewSettingsHiddenForTab) {
9962
10190
  var hiddenColumnCount_1 = getViewSettingsColumns().filter(getIsColumnHidden).length;
9963
10191
  // INFO: desktop and mobile both render, CSS decides which is shown —
9964
10192
  // distinct test ids keep the two unambiguous for e2e
@@ -10069,7 +10297,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10069
10297
  return filterElementList;
10070
10298
  }
10071
10299
  if ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.filterComponentNewRow) {
10072
- if (props.organise.showGroupByFeature) {
10300
+ if (isGroupPickerShown) {
10073
10301
  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); } }));
10074
10302
  }
10075
10303
  if (filterComponent_1 &&
@@ -10139,7 +10367,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10139
10367
  : undefined,
10140
10368
  onViewSettingsClick: isMobileToolbar_1 &&
10141
10369
  isViewSettingsEnabled &&
10142
- (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) !== "calendar"
10370
+ !isViewSettingsHiddenForTab
10143
10371
  ? function () { return setViewSettingsModalOpen(true); }
10144
10372
  : undefined,
10145
10373
  viewSettingsCount: getViewSettingsColumns().filter(getIsColumnHidden).length,
@@ -11359,8 +11587,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
11359
11587
  react_1.default.createElement("div", { className: "font-semibold text-md mt-5" },
11360
11588
  "Group By ",
11361
11589
  eachKey),
11362
- 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) ||
11363
- isFormulaView, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
11590
+ 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) ||
11591
+ isFormulaView ||
11592
+ isSelectAllUncountable, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
11364
11593
  selectedIds.length > 0 &&
11365
11594
  canBatchUpdate &&
11366
11595
  !((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
@@ -11462,7 +11691,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
11462
11691
  ? function (groupKey, page) {
11463
11692
  return handleFetchGroupPage(groupKey, page);
11464
11693
  }
11465
- : 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 &&
11694
+ : 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) ||
11695
+ isFormulaView ||
11696
+ 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 &&
11466
11697
  !((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareHideTableExtraMultipleAction)
11467
11698
  ? [
11468
11699
  {
@@ -11622,7 +11853,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
11622
11853
  right: (_17 = (_16 = props.bareSettings) === null || _16 === void 0 ? void 0 : _16.bareListTablePinColumns) === null || _17 === void 0 ? void 0 : _17.right,
11623
11854
  } }));
11624
11855
  }
11625
- 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" },
11856
+ 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) ||
11857
+ isFormulaView ||
11858
+ isSelectAllUncountable, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
11626
11859
  selectedIds.length > 0 &&
11627
11860
  canBatchUpdate &&
11628
11861
  !((_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
@@ -12063,7 +12296,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12063
12296
  else if (selectedTabData.viewType === "list") {
12064
12297
  // INFO: when bareNewDTW is enabled, render NewList instead of legacy List
12065
12298
  if ((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareNewDTW) {
12066
- 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" },
12299
+ 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) ||
12300
+ isFormulaView ||
12301
+ 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" },
12067
12302
  selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
12068
12303
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
12069
12304
  handleCloneSelectedData();
@@ -12087,7 +12322,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12087
12322
  (renderCheckGroupPaging() && !renderCheckScrollMode()), customPaginationSize: customPaginationSize, mobileTooltip: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListMobileTooltip, onRowEdit: recordEditAction, onRowActivity: recordActivityAction })));
12088
12323
  }
12089
12324
  return (react_1.default.createElement(react_1.default.Fragment, null,
12090
- 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" },
12325
+ 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) ||
12326
+ isFormulaView ||
12327
+ isSelectAllUncountable, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? handleGetSelectAllText() : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
12091
12328
  selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
12092
12329
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
12093
12330
  handleCloneSelectedData();
@@ -12259,20 +12496,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12259
12496
  if (calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.startDate) {
12260
12497
  for (var _i = 0, spaceTableData_1 = spaceTableData; _i < spaceTableData_1.length; _i++) {
12261
12498
  var eachData = spaceTableData_1[_i];
12499
+ var rawStart = (0, timelineBars_1.handleReadDateText)(eachData[calendarSettings_1.startDate]);
12500
+ var rawEnd = calendarSettings_1.endDate
12501
+ ? (0, timelineBars_1.handleReadDateText)(eachData[calendarSettings_1.endDate])
12502
+ : undefined;
12262
12503
  // INFO: skip only the undated row — a union mixes collections, so
12263
12504
  // one row without a date must not hide every row after it
12264
- if (!eachData[calendarSettings_1.startDate])
12505
+ if (!rawStart)
12265
12506
  continue;
12266
- else if (!(0, dateFormat_1.handleParseListDate)(eachData[calendarSettings_1.startDate], handleFindColumnDateFormat(calendarSettings_1.startDate)).isValid()) {
12507
+ else if (!(0, dateFormat_1.handleParseListDate)(rawStart, handleFindColumnDateFormat(calendarSettings_1.startDate)).isValid()) {
12267
12508
  continue;
12268
12509
  }
12269
12510
  else {
12270
12511
  var id = eachData.id;
12271
12512
  var title = (0, readModule_1.handleCutPreviewText)(eachData[calendarSettings_1.title]);
12272
- var startDate = (0, dateFormat_1.handleParseListDate)(eachData[calendarSettings_1.startDate], handleFindColumnDateFormat(calendarSettings_1.startDate));
12273
- var endDate = calendarSettings_1.endDate &&
12274
- eachData[calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.endDate]
12275
- ? (0, dateFormat_1.handleParseListDate)(eachData[calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.endDate], handleFindColumnDateFormat(calendarSettings_1.endDate))
12513
+ var startDate = (0, dateFormat_1.handleParseListDate)(rawStart, handleFindColumnDateFormat(calendarSettings_1.startDate));
12514
+ var endDate = calendarSettings_1.endDate && rawEnd
12515
+ ? (0, dateFormat_1.handleParseListDate)(rawEnd, handleFindColumnDateFormat(calendarSettings_1.endDate))
12276
12516
  : startDate;
12277
12517
  var eventAvailability = {
12278
12518
  id: id,
@@ -12362,7 +12602,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12362
12602
  // INFO: viewSwitch — optional Month/Week/Agenda toggle. The range
12363
12603
  // query follows via calendarView ("dayGridMonth" ↔ "timeGridWeek");
12364
12604
  // agenda lists the fetched month chronologically.
12365
- var viewSwitchOptions = (_36 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.viewSwitch) !== null && _36 !== void 0 ? _36 : [];
12605
+ // INFO: a tab that names no views gets them all — a tab made from
12606
+ // "+ New Tab" saves none, and showed no switcher at all
12607
+ var viewSwitchOptions = (_36 = calendarSettings_1 === null || calendarSettings_1 === void 0 ? void 0 : calendarSettings_1.viewSwitch) !== null && _36 !== void 0 ? _36 : [
12608
+ "month",
12609
+ "week",
12610
+ "day",
12611
+ "agenda",
12612
+ ];
12366
12613
  var VIEW_VARIANT_MAP = {
12367
12614
  month: "fullMonth",
12368
12615
  week: "weekTimeGrid",
@@ -12446,6 +12693,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12446
12693
  }
12447
12694
  else if (selectedTabData.viewType === "timeline") {
12448
12695
  var timelineSettings_1 = selectedTabData.timelineSettings;
12696
+ // INFO: bars are the primary colour; a group — picked in the view or
12697
+ // saved on the tab — gives each of its values a colour of its own
12698
+ var timelineGroupId_1 = groupId || (timelineSettings_1 === null || timelineSettings_1 === void 0 ? void 0 : timelineSettings_1.groupId) || "";
12449
12699
  // INFO: pin each group value to a fixed colour — deterministic across
12450
12700
  // fetches, mirroring the calendar's groupColorMap / first-appearance
12451
12701
  // assignment so the two views colour the same data the same way
@@ -12453,22 +12703,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12453
12703
  ? JSON.parse(JSON.stringify(timelineSettings_1.groupColor))
12454
12704
  : ["red", "blue", "green", "indigo", "orange", "violet", "yellow"];
12455
12705
  var timelineValuesWithColour_1 = {};
12456
- if (timelineSettings_1 === null || timelineSettings_1 === void 0 ? void 0 : timelineSettings_1.groupColorMap) {
12706
+ if ((timelineSettings_1 === null || timelineSettings_1 === void 0 ? void 0 : timelineSettings_1.groupColorMap) &&
12707
+ timelineGroupId_1 === timelineSettings_1.groupId) {
12457
12708
  Object.assign(timelineValuesWithColour_1, timelineSettings_1.groupColorMap);
12458
12709
  }
12459
- else if (timelineSettings_1 === null || timelineSettings_1 === void 0 ? void 0 : timelineSettings_1.groupId) {
12460
- spaceTableData.map(function (eachTableData) {
12461
- var _a;
12710
+ else if (timelineGroupId_1) {
12711
+ // INFO: colours repeat past the palette rather than running out
12712
+ var colourIndex_1 = 0;
12713
+ spaceTableData.forEach(function (eachTableData) {
12462
12714
  if (timelineColorPalette_1.length === 0)
12463
- return null;
12464
- var tableValue = eachTableData[(_a = timelineSettings_1.groupId) !== null && _a !== void 0 ? _a : ""];
12465
- if (!tableValue)
12466
- return null;
12467
- if (tableValue && !timelineValuesWithColour_1[tableValue]) {
12468
- timelineValuesWithColour_1[tableValue] =
12469
- timelineColorPalette_1.splice(0, 1)[0];
12470
- }
12471
- return null;
12715
+ return;
12716
+ var groupKey = (0, timelineBars_1.handleGetGroupValueKey)(eachTableData[timelineGroupId_1]);
12717
+ if (!groupKey || timelineValuesWithColour_1[groupKey])
12718
+ return;
12719
+ timelineValuesWithColour_1[groupKey] =
12720
+ timelineColorPalette_1[colourIndex_1 % timelineColorPalette_1.length];
12721
+ colourIndex_1 += 1;
12472
12722
  });
12473
12723
  }
12474
12724
  // INFO: Tailwind palette hexes — the Gantt colours bars through Apex's
@@ -12489,8 +12739,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12489
12739
  return tasks;
12490
12740
  for (var _i = 0, _b = spaceTableData; _i < _b.length; _i++) {
12491
12741
  var eachData = _b[_i];
12492
- var rawStart = eachData[timelineSettings_1.startDate];
12493
- var rawEnd = eachData[timelineSettings_1.endDate];
12742
+ var rawStart = (0, timelineBars_1.handleReadDateText)(eachData[timelineSettings_1.startDate]);
12743
+ var rawEnd = (0, timelineBars_1.handleReadDateText)(eachData[timelineSettings_1.endDate]);
12494
12744
  // INFO: a bar needs both ends — skip only the incomplete row so one
12495
12745
  // undated record in a union does not drop every bar after it
12496
12746
  if (!rawStart || !rawEnd)
@@ -12500,30 +12750,63 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12500
12750
  if (!startDate.isValid() || !endDate.isValid())
12501
12751
  continue;
12502
12752
  var color = undefined;
12503
- if (timelineSettings_1.groupId &&
12504
- eachData[timelineSettings_1.groupId]) {
12505
- var groupValue = eachData[timelineSettings_1.groupId];
12506
- color = TIMELINE_COLOR_HEX_1[timelineValuesWithColour_1[groupValue]];
12753
+ var group = undefined;
12754
+ if (timelineGroupId_1 && eachData[timelineGroupId_1]) {
12755
+ group = (0, timelineBars_1.handleGetGroupValueKey)(eachData[timelineGroupId_1]);
12756
+ color = TIMELINE_COLOR_HEX_1[timelineValuesWithColour_1[group]];
12507
12757
  }
12508
- tasks.push({
12509
- id: eachData.id,
12510
- name: (_a = (0, readModule_1.handleCutPreviewText)(eachData[timelineSettings_1.title])) !== null && _a !== void 0 ? _a : "",
12511
- start: startDate.toDate(),
12512
- end: endDate.toDate(),
12513
- color: color,
12514
- });
12758
+ 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 }));
12515
12759
  }
12516
- return tasks;
12760
+ return timelineGroupId_1 ? (0, timelineBars_1.handleOrderByGroup)(tasks) : tasks;
12517
12761
  };
12518
12762
  var timelineTasks = renderTimelineTasks();
12519
12763
  // INFO: parallel hex list for Apex distributed bars — one colour per
12520
12764
  // task, in the same order; undefined falls back to the chart default
12521
- var timelineColors = timelineTasks.map(function (eachTask) { var _a; return (_a = eachTask.color) !== null && _a !== void 0 ? _a : "#2563eb"; });
12522
- 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) {
12523
- var _a, _b;
12524
- if (taskId)
12525
- (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", taskId, "general");
12526
- } }))));
12765
+ var timelinePrimary_1 = timelinePrimaryColour;
12766
+ var timelineColors = timelineTasks.map(function (eachTask) { var _a; return (_a = eachTask.color) !== null && _a !== void 0 ? _a : timelinePrimary_1; });
12767
+ var timelineWindow_1 = (0, timelineBars_1.handleGetTimelineWindow)(timelineRange.unit, timelineRange.anchor);
12768
+ var handleChangeTimelineRange_1 = function (next) {
12769
+ setTimelineRange(next);
12770
+ // INFO: a new window is a new query; the list refetches on it
12771
+ setTableLoading(true);
12772
+ };
12773
+ var renderTimelineRangeBar = function () {
12774
+ var _a;
12775
+ return (react_1.default.createElement("div", { className: "mb-2 flex flex-wrap items-center justify-between gap-2" },
12776
+ react_1.default.createElement("div", { className: "flex items-center gap-1" },
12777
+ react_1.default.createElement("button", { type: "button", "data-testid": "dtw-timeline-prev", "aria-label": "Previous period", onClick: function () {
12778
+ return handleChangeTimelineRange_1(__assign(__assign({}, timelineRange), { anchor: (0, timelineBars_1.handleShiftTimelineWindow)(timelineRange.unit, timelineRange.anchor, -1) }));
12779
+ }, className: "rounded-lg p-1.5 hover:bg-gray-100" },
12780
+ react_1.default.createElement(HeroIcons.ChevronLeftIcon, { className: "h-4 w-4 text-gray-500" })),
12781
+ 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),
12782
+ react_1.default.createElement("button", { type: "button", "data-testid": "dtw-timeline-next", "aria-label": "Next period", onClick: function () {
12783
+ return handleChangeTimelineRange_1(__assign(__assign({}, timelineRange), { anchor: (0, timelineBars_1.handleShiftTimelineWindow)(timelineRange.unit, timelineRange.anchor, 1) }));
12784
+ }, className: "rounded-lg p-1.5 hover:bg-gray-100" },
12785
+ react_1.default.createElement(HeroIcons.ChevronRightIcon, { className: "h-4 w-4 text-gray-500" }))),
12786
+ 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 () {
12787
+ if (unit === timelineRange.unit)
12788
+ return;
12789
+ handleChangeTimelineRange_1(__assign(__assign({}, timelineRange), { unit: unit }));
12790
+ }, className: "rounded-md px-3 py-1 text-xs font-medium capitalize ".concat(timelineRange.unit === unit
12791
+ ? "bg-primary-500 text-white"
12792
+ : "text-gray-500 hover:bg-gray-50") }, unit)); }))));
12793
+ };
12794
+ return (react_1.default.createElement("div", { className: "mt-4" },
12795
+ handleCheckTimelineWindow(timelineSettings_1) &&
12796
+ renderTimelineRangeBar(),
12797
+ 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 })) : (
12798
+ // INFO: a row per record at a readable height, scrolling past a
12799
+ // screen rather than squeezing every bar into a fixed chart
12800
+ react_1.default.createElement("div", { "data-testid": "dtw-timeline-scroll", className: "max-h-[70vh] overflow-y-auto" },
12801
+ 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)
12802
+ ? timelineWindow_1.start
12803
+ : undefined, rangeEnd: handleCheckTimelineWindow(timelineSettings_1)
12804
+ ? timelineWindow_1.end
12805
+ : undefined, axisOnTop: true, barLabelColor: "#ffffff", darkMode: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.darkMode, onClick: function (taskId) {
12806
+ var _a, _b;
12807
+ if (taskId)
12808
+ (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", taskId, "general");
12809
+ } })))));
12527
12810
  }
12528
12811
  else if (selectedTabData.viewType === "feeds") {
12529
12812
  var contentList_1 = [];
@@ -12605,9 +12888,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12605
12888
  else if (selectedTabData.viewType === "map") {
12606
12889
  var mapSettings_1 = selectedTabData.mapSettings;
12607
12890
  if (mapSettings_1) {
12891
+ // INFO: on a map the view's Group draws a route through each group's
12892
+ // pins, and its Sort orders the stops — the rows arrive in that
12893
+ // order, so the route follows them. Only the tab's own route columns
12894
+ // can be replanned by dragging: a picked sort column would be
12895
+ // overwritten with stop numbers
12896
+ var _66 = (0, routes_1.handleResolveViewRoute)(mapSettings_1, groupId), mapRouteBy = _66.routeBy, mapRouteOrder = _66.routeOrder, isRoutePlannable = _66.isPlannable;
12608
12897
  // INFO: pins take the route column's colour unless another column is
12609
12898
  // picked, so a trip's pins match its line with one setting
12610
- var pinGroup_1 = mapSettings_1.group || mapSettings_1.routeBy || "";
12899
+ var pinGroup_1 = groupId || mapSettings_1.group || mapSettings_1.routeBy || "";
12611
12900
  var mapMarkerList_1 = [];
12612
12901
  var uniqueGroupList_1 = [];
12613
12902
  var markerColorMap_1 = {};
@@ -12620,9 +12909,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12620
12909
  ];
12621
12910
  if (pinGroup_1) {
12622
12911
  spaceTableData.map(function (eachData) {
12623
- if (eachData[pinGroup_1] &&
12624
- !uniqueGroupList_1.includes(eachData[pinGroup_1])) {
12625
- uniqueGroupList_1.push(eachData[pinGroup_1]);
12912
+ var groupKey = (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1]);
12913
+ if (groupKey && !uniqueGroupList_1.includes(groupKey)) {
12914
+ uniqueGroupList_1.push(groupKey);
12626
12915
  }
12627
12916
  return null;
12628
12917
  });
@@ -12680,9 +12969,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12680
12969
  var _a, _b, _c, _d, _e, _f, _g, _h;
12681
12970
  var eachMarkerColor = "white";
12682
12971
  if (pinGroup_1) {
12683
- if (eachData[pinGroup_1]) {
12684
- eachMarkerColor = markerColorMap_1[eachData[pinGroup_1]];
12685
- }
12972
+ var groupKey = (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1]);
12973
+ if (groupKey)
12974
+ eachMarkerColor = markerColorMap_1[groupKey];
12686
12975
  }
12687
12976
  if (eachData[mapSettings_1.address]) {
12688
12977
  var markerData_1 = {
@@ -12697,7 +12986,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12697
12986
  ? ((_e = eachData[mapSettings_1.title]) !== null && _e !== void 0 ? _e : "")
12698
12987
  : "",
12699
12988
  address: (_g = (_f = eachData[mapSettings_1.address]) === null || _f === void 0 ? void 0 : _f.name) !== null && _g !== void 0 ? _g : "",
12700
- group: pinGroup_1 ? ((_h = eachData[pinGroup_1]) !== null && _h !== void 0 ? _h : "") : "",
12989
+ // INFO: a linked record reads by its name in the legend, a
12990
+ // coloured list value by its text
12991
+ group: pinGroup_1
12992
+ ? typeof eachData[pinGroup_1] === "object" &&
12993
+ eachData[pinGroup_1] &&
12994
+ !react_1.default.isValidElement(eachData[pinGroup_1])
12995
+ ? ((_h = eachData[pinGroup_1].name) !== null && _h !== void 0 ? _h : (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1]))
12996
+ : (0, timelineBars_1.handleGetGroupValueKey)(eachData[pinGroup_1])
12997
+ : "",
12701
12998
  },
12702
12999
  };
12703
13000
  Object.keys(eachData).forEach(function (eachKey) {
@@ -12716,7 +13013,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12716
13013
  return null;
12717
13014
  });
12718
13015
  return (react_1.default.createElement("div", { className: "w-full h-[700px]" },
12719
- 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
13016
+ 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
12720
13017
  ? function (change) {
12721
13018
  return handleSaveRecordChanges((0, routes_1.handleBuildRouteChanges)(spaceTableData, mapSettings_1.routeBy, mapSettings_1.routeOrder, change, [mapSettings_1.routeStart, mapSettings_1.routeEnd]));
12722
13019
  }
@@ -12957,7 +13254,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12957
13254
  } })))));
12958
13255
  }
12959
13256
  else if (addTabModal) {
12960
- return (react_1.default.createElement(settingsModal_1.TabModal, { type: resolvedType, tabs: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.extendedTabs, editIndex: editTabIndex >= 0 ? editTabIndex : undefined, hiddenViewTypes: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.hiddenTabViewTypes, onChangeTabs: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.onChangeTabs, model: structure, collectionId: props.collectionId, renderReferenceLabelOptions: (_x = props.organise) === null || _x === void 0 ? void 0 : _x.renderReferenceLabelOptions, onClose: function () {
13257
+ return (react_1.default.createElement(settingsModal_1.TabModal, { type: resolvedType, tabs: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.extendedTabs, editIndex: editTabIndex >= 0 ? editTabIndex : undefined, hiddenViewTypes: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.hiddenTabViewTypes, onChangeTabs: ((_w = props.organise) === null || _w === void 0 ? void 0 : _w.onChangeTabs) ? handleAddedTabs : undefined, model: structure, collectionId: props.collectionId, renderReferenceLabelOptions: (_x = props.organise) === null || _x === void 0 ? void 0 : _x.renderReferenceLabelOptions, onClose: function () {
12961
13258
  handlePopUpModal(false);
12962
13259
  } }));
12963
13260
  }
@@ -13177,12 +13474,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
13177
13474
  react_1.default.createElement("div", { className: "px-3 sm:px-0" },
13178
13475
  react_1.default.createElement("div", { className: "flex" },
13179
13476
  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")),
13180
- react_1.default.createElement("p", { className: "mt-2 mb-4" },
13181
- "Are you sure you want to permanently delete",
13182
- " ",
13183
- resolvedType === "list" && !deleteFeedId ? "these" : "this",
13184
- " ",
13185
- "data?"),
13477
+ react_1.default.createElement("p", { className: "mt-2 mb-4" }, resolvedType === "list" && !deleteFeedId && selectAll
13478
+ ? "Permanently delete all ".concat(handleGetSelectAllText(), "?")
13479
+ : resolvedType === "list" && !deleteFeedId
13480
+ ? "Permanently delete ".concat(selectedIds.length.toLocaleString(), " ").concat(selectedIds.length === 1 ? "record" : "records", "?")
13481
+ : "Are you sure you want to permanently delete this data?"),
13186
13482
  resolvedType === "list" && !deleteFeedId && (react_1.default.createElement(react_1.default.Fragment, null,
13187
13483
  react_1.default.createElement("p", { className: "mb-2" },
13188
13484
  "Enter passcode",
@@ -13312,14 +13608,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
13312
13608
  };
13313
13609
  return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
13314
13610
  renderNotification("root"),
13315
- ((_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 () {
13611
+ ((_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 () {
13316
13612
  var _a, _b;
13317
13613
  if (loading)
13318
13614
  return;
13319
13615
  handlePopUpModal(false);
13320
13616
  setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
13321
13617
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
13322
- 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 () {
13618
+ 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 () {
13323
13619
  return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
13324
13620
  if (dataId) {
13325
13621
  var currentValue = selectedData[referenceCreationModal.id];
@@ -13335,19 +13631,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
13335
13631
  }, onClose: function () {
13336
13632
  setReferenceCreationModal({ id: "", name: "", type: "string" });
13337
13633
  } }),
13338
- 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 () {
13634
+ 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 () {
13339
13635
  setReferenceDeleteTableData({});
13340
13636
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
13341
- 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 () {
13637
+ 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 () {
13342
13638
  setDeletePasscodeInput("");
13343
13639
  setDeleteModal(!deleteModal);
13344
13640
  setDeleteFeedId("");
13345
13641
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
13346
- 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 () {
13642
+ 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 () {
13347
13643
  setBatchUpdateData({ columnId: "", columnData: {} });
13348
13644
  setBatchUpdateModal(false);
13349
13645
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
13350
- 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 () {
13646
+ 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 () {
13351
13647
  var _a, _b;
13352
13648
  if (props.space)
13353
13649
  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 }));
@@ -13364,14 +13660,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
13364
13660
  (0, react_dom_1.createPortal)(
13365
13661
  // INFO: z-50 lifts it over a Modal the table may sit in (z-40)
13366
13662
  react_1.default.createElement("div", { className: "relative z-50" },
13367
- 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,
13663
+ 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,
13368
13664
  // INFO: the record stays set while the drawer slides out — clearing it
13369
13665
  // would remount the hidden panel collection-wide and fetch again. The
13370
13666
  // toolbar's collection-wide button clears it when it opens.
13371
13667
  onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75",
13372
13668
  // INFO: dragged like the read drawer; the width sticks across
13373
13669
  // opens while the list stays mounted
13374
- resizable: true, title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((_125 = props.id) !== null && _125 !== void 0 ? _125 : "") : activityId) })), document.body),
13670
+ resizable: true, title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((_130 = props.id) !== null && _130 !== void 0 ? _130 : "") : activityId) })), document.body),
13375
13671
  renderScrollSentinel()));
13376
13672
  });
13377
13673
  //# sourceMappingURL=index.js.map