blixify-ui-web 1.2.265 → 1.2.267

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 (26) hide show
  1. package/lib/components/data/columnTypes/groupSections.d.ts +1 -0
  2. package/lib/components/data/columnTypes/groupSections.d.ts.map +1 -1
  3. package/lib/components/data/columnTypes/groupSections.js.map +1 -1
  4. package/lib/components/data/dataTemplate/activityModal.js +91 -37
  5. package/lib/components/data/dataTemplate/activityModal.js.map +1 -1
  6. package/lib/components/data/dataTemplate/dataStateModel.d.ts +14 -1
  7. package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
  8. package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
  9. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  10. package/lib/components/data/dataTemplate/index.js +389 -274
  11. package/lib/components/data/dataTemplate/index.js.map +1 -1
  12. package/lib/components/data/dataTemplate/model.d.ts +2 -0
  13. package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
  14. package/lib/components/display/detailList/index.d.ts.map +1 -1
  15. package/lib/components/display/detailList/index.js +7 -1
  16. package/lib/components/display/detailList/index.js.map +1 -1
  17. package/lib/components/display/groupSection/index.d.ts +2 -0
  18. package/lib/components/display/groupSection/index.d.ts.map +1 -1
  19. package/lib/components/display/groupSection/index.js +8 -3
  20. package/lib/components/display/groupSection/index.js.map +1 -1
  21. package/lib/components/display/newTable/index.d.ts +1 -0
  22. package/lib/components/display/newTable/index.d.ts.map +1 -1
  23. package/lib/components/display/newTable/index.js +63 -21
  24. package/lib/components/display/newTable/index.js.map +1 -1
  25. package/lib/tail.css +1 -1
  26. package/package.json +1 -1
@@ -235,7 +235,7 @@ var handleCheckEmptyCardValue = function (value) {
235
235
  };
236
236
  exports.handleCheckEmptyCardValue = handleCheckEmptyCardValue;
237
237
  exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
238
- 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;
238
+ 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;
239
239
  // INFO: every view draws a lookup as its source column's type, read-only, so
240
240
  // no type branch below meets "lookup"; rawProps.model keeps the lookups as
241
241
  // stored for the columns handed back to the host
@@ -254,7 +254,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
254
254
  // the list never refetching while the panel is open, which fails silently.
255
255
  // INFO: the panel cannot navigate its way out — handleNavigate("read") is
256
256
  // routed straight back into it — so expand-to-full-page is local state.
257
- var _128 = (0, react_1.useState)(false), drawerPageView = _128[0], setDrawerPageView = _128[1];
257
+ var _125 = (0, react_1.useState)(false), drawerPageView = _125[0], setDrawerPageView = _125[1];
258
258
  // INFO: the panel keeps rendering the record it was opened with rather than
259
259
  // live props. Without this, navigating back to the list would re-render the
260
260
  // still-mounted panel as a second list behind the overlay.
@@ -309,7 +309,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
309
309
  drawerFormEditedRef.current = false;
310
310
  }
311
311
  drawerOpenRef.current = isDrawerHost;
312
- var _129 = (0, react_1.useState)(false), drawerDiscardModal = _129[0], setDrawerDiscardModal = _129[1];
312
+ var _126 = (0, react_1.useState)(false), drawerDiscardModal = _126[0], setDrawerDiscardModal = _126[1];
313
313
  // INFO: leaving the record ends the escape, so the next row opened from the
314
314
  // list peeks in the panel again rather than inheriting a full page the user
315
315
  // asked for once. Saving a form on the full page lands on its read view, which
@@ -388,14 +388,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
388
388
  initialFilterReferenceDate: initialFilterReferenceDate,
389
389
  };
390
390
  };
391
- var _130 = intialiseDefaultFilterValues(), initialFilterSearch = _130.initialFilterSearch, initialFilterSearchParams = _130.initialFilterSearchParams, initialFilterSelection = _130.initialFilterSelection, initialFilterReference = _130.initialFilterReference, initialFilterReferenceDate = _130.initialFilterReferenceDate;
391
+ var _127 = intialiseDefaultFilterValues(), initialFilterSearch = _127.initialFilterSearch, initialFilterSearchParams = _127.initialFilterSearchParams, initialFilterSelection = _127.initialFilterSelection, initialFilterReference = _127.initialFilterReference, initialFilterReferenceDate = _127.initialFilterReferenceDate;
392
392
  // INFO: Persist view state hook — handles storage read/write for filter/sort/column state
393
- var _131 = (0, viewStatePersistence_1.usePersistedViewState)({
393
+ var _128 = (0, viewStatePersistence_1.usePersistedViewState)({
394
394
  mode: (_k = props.organise) === null || _k === void 0 ? void 0 : _k.persistViewState,
395
395
  collectionId: props.collectionId,
396
396
  persistKey: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.persistKey,
397
397
  type: resolvedType,
398
- }), rawPersistedState = _131.persistedState, isPersistEnabled = _131.isEnabled, handleSaveView = _131.handleSaveView, handleRegisterViewSnapshot = _131.handleRegisterViewSnapshot;
398
+ }), rawPersistedState = _128.persistedState, isPersistEnabled = _128.isEnabled, handleSaveView = _128.handleSaveView, handleRegisterViewSnapshot = _128.handleRegisterViewSnapshot;
399
399
  // INFO: drop stored filters/sort on removed columns — they would empty the table
400
400
  var persistedState = (0, react_1.useMemo)(function () {
401
401
  var _a, _b, _c, _d;
@@ -411,8 +411,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
411
411
  (_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareFlexFilterListObjects,
412
412
  (_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareFlexFilterRelated,
413
413
  ]);
414
- var _132 = (0, react_1.useState)(false), loading = _132[0], setLoading = _132[1];
415
- var _133 = (0, react_1.useState)(), notification = _133[0], setNotification = _133[1];
414
+ var _129 = (0, react_1.useState)(false), loading = _129[0], setLoading = _129[1];
415
+ var _130 = (0, react_1.useState)(), notification = _130[0], setNotification = _130[1];
416
416
  // INFO: a success toast is confirmation, not a decision — it clears itself so
417
417
  // it never sits on the floating step bar; errors stay until dismissed
418
418
  (0, react_1.useEffect)(function () {
@@ -422,67 +422,67 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
422
422
  return function () { return clearTimeout(timer); };
423
423
  }, [notification]);
424
424
  //INFO : Used by List
425
- var _134 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _q !== void 0 ? _q : initialFilterSearch), filterSearch = _134[0], setFilterSearch = _134[1];
426
- var _135 = (0, react_1.useState)((_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _r !== void 0 ? _r : initialFilterSearchParams), filterSearchParams = _135[0], setFilterSearchParams = _135[1];
427
- var _136 = (0, react_1.useState)((_s = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _s !== void 0 ? _s : initialFilterSelection), filterSelection = _136[0], setFilterSelection = _136[1];
428
- var _137 = (0, react_1.useState)((_t = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _t !== void 0 ? _t : initialFilterReference), filterReference = _137[0], setFilterReference = _137[1];
429
- var _138 = (0, react_1.useState)({}), filterReferenceSearch = _138[0], setFilterReferenceSearch = _138[1];
430
- var _139 = (0, react_1.useState)({}), filterReferenceList = _139[0], setFilterReferenceList = _139[1];
431
- var _140 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
425
+ var _131 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _q !== void 0 ? _q : initialFilterSearch), filterSearch = _131[0], setFilterSearch = _131[1];
426
+ var _132 = (0, react_1.useState)((_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _r !== void 0 ? _r : initialFilterSearchParams), filterSearchParams = _132[0], setFilterSearchParams = _132[1];
427
+ var _133 = (0, react_1.useState)((_s = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _s !== void 0 ? _s : initialFilterSelection), filterSelection = _133[0], setFilterSelection = _133[1];
428
+ var _134 = (0, react_1.useState)((_t = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _t !== void 0 ? _t : initialFilterReference), filterReference = _134[0], setFilterReference = _134[1];
429
+ var _135 = (0, react_1.useState)({}), filterReferenceSearch = _135[0], setFilterReferenceSearch = _135[1];
430
+ var _136 = (0, react_1.useState)({}), filterReferenceList = _136[0], setFilterReferenceList = _136[1];
431
+ var _137 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
432
432
  ? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
433
- : initialFilterReferenceDate), filterReferenceDate = _140[0], setFilterReferenceDate = _140[1];
434
- var _141 = (0, react_1.useState)(true), tableLoading = _141[0], setTableLoading = _141[1];
435
- var _142 = (0, react_1.useState)(""), cursor = _142[0], setCursor = _142[1];
436
- var _143 = (0, react_1.useState)(""), lastCursor = _143[0], setLastCursor = _143[1];
437
- var _144 = (0, react_1.useState)([]), tableData = _144[0], setTableData = _144[1];
438
- var _145 = (0, react_1.useState)([]), spaceTableData = _145[0], setSpaceTableData = _145[1];
433
+ : initialFilterReferenceDate), filterReferenceDate = _137[0], setFilterReferenceDate = _137[1];
434
+ var _138 = (0, react_1.useState)(true), tableLoading = _138[0], setTableLoading = _138[1];
435
+ var _139 = (0, react_1.useState)(""), cursor = _139[0], setCursor = _139[1];
436
+ var _140 = (0, react_1.useState)(""), lastCursor = _140[0], setLastCursor = _140[1];
437
+ var _141 = (0, react_1.useState)([]), tableData = _141[0], setTableData = _141[1];
438
+ var _142 = (0, react_1.useState)([]), spaceTableData = _142[0], setSpaceTableData = _142[1];
439
439
  // INFO: a save resolves after later renders, so it reads the table from here —
440
440
  // the state it closed over can predate an earlier save on the same row
441
441
  var tableDataRef = (0, react_1.useRef)([]);
442
442
  var spaceTableDataRef = (0, react_1.useRef)([]);
443
443
  tableDataRef.current = tableData;
444
444
  spaceTableDataRef.current = spaceTableData;
445
- var _146 = (0, react_1.useState)(0), size = _146[0], setSize = _146[1];
446
- var _147 = (0, react_1.useState)((_w = (_u = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _u !== void 0 ? _u : (_v = props.organise) === null || _v === void 0 ? void 0 : _v.pageIndex) !== null && _w !== void 0 ? _w : 0), pageIndex = _147[0], setPageIndex = _147[1];
445
+ var _143 = (0, react_1.useState)(0), size = _143[0], setSize = _143[1];
446
+ var _144 = (0, react_1.useState)((_w = (_u = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _u !== void 0 ? _u : (_v = props.organise) === null || _v === void 0 ? void 0 : _v.pageIndex) !== null && _w !== void 0 ? _w : 0), pageIndex = _144[0], setPageIndex = _144[1];
447
447
  // INFO: every change of page, including the return to the first page when a
448
448
  // filter or search changes, which onChangePagination does not always report
449
449
  (0, react_1.useEffect)(function () {
450
450
  var _a, _b;
451
451
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePageIndex) === null || _b === void 0 ? void 0 : _b.call(_a, pageIndex);
452
452
  }, [pageIndex]);
453
- var _148 = (0, react_1.useState)([]), selectedIds = _148[0], setSelectedIds = _148[1];
454
- var _149 = (0, react_1.useState)(false), selectAll = _149[0], setSelectAll = _149[1];
455
- var _150 = (0, react_1.useState)(""), deletePasscode = _150[0], setDeletePasscode = _150[1];
456
- var _151 = (0, react_1.useState)(""), deletePasscodeInput = _151[0], setDeletePasscodeInput = _151[1];
457
- var _152 = (0, react_1.useState)(""), deleteFeedId = _152[0], setDeleteFeedId = _152[1];
453
+ var _145 = (0, react_1.useState)([]), selectedIds = _145[0], setSelectedIds = _145[1];
454
+ var _146 = (0, react_1.useState)(false), selectAll = _146[0], setSelectAll = _146[1];
455
+ var _147 = (0, react_1.useState)(""), deletePasscode = _147[0], setDeletePasscode = _147[1];
456
+ var _148 = (0, react_1.useState)(""), deletePasscodeInput = _148[0], setDeletePasscodeInput = _148[1];
457
+ var _149 = (0, react_1.useState)(""), deleteFeedId = _149[0], setDeleteFeedId = _149[1];
458
458
  //INFO : Used by List Organise
459
459
  // INFO: Internal sort state that overrides props.organise?.sort when
460
460
  // persistViewState is enabled and a persisted sort exists
461
- var _153 = (0, react_1.useState)((_x = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _x !== void 0 ? _x : undefined), persistedSort = _153[0], setPersistedSort = _153[1];
462
- var _154 = (0, react_1.useState)(false), filterDraft = _154[0], setFilterDraft = _154[1];
463
- var _155 = (0, react_1.useState)(false), addTabModal = _155[0], setAddTabModal = _155[1];
464
- var _156 = (0, react_1.useState)(-1), editTabIndex = _156[0], setEditTabIndex = _156[1];
461
+ var _150 = (0, react_1.useState)((_x = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _x !== void 0 ? _x : undefined), persistedSort = _150[0], setPersistedSort = _150[1];
462
+ var _151 = (0, react_1.useState)(false), filterDraft = _151[0], setFilterDraft = _151[1];
463
+ var _152 = (0, react_1.useState)(false), addTabModal = _152[0], setAddTabModal = _152[1];
464
+ var _153 = (0, react_1.useState)(-1), editTabIndex = _153[0], setEditTabIndex = _153[1];
465
465
  //INFO : resolve the initial tab synchronously so the mount cond is already
466
466
  // tab-scoped — an empty initial tab caused a second wasted list fetch
467
- var _157 = (0, react_1.useState)(function () {
467
+ var _154 = (0, react_1.useState)(function () {
468
468
  var _a;
469
469
  return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, listViewId);
470
- }), selectedTab = _157[0], setSelectedTab = _157[1];
471
- var _158 = (0, react_1.useState)("dayGridMonth"), calendarView = _158[0], setCalendarView = _158[1];
470
+ }), selectedTab = _154[0], setSelectedTab = _154[1];
471
+ var _155 = (0, react_1.useState)("dayGridMonth"), calendarView = _155[0], setCalendarView = _155[1];
472
472
  // INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
473
473
  // (calendarView above drives the matching range query)
474
- var _159 = (0, react_1.useState)("month"), newCalendarViewMode = _159[0], setNewCalendarViewMode = _159[1];
475
- var _160 = (0, react_1.useState)(new Date()), calendarTabMonth = _160[0], setCalendarTabMonth = _160[1];
474
+ var _156 = (0, react_1.useState)("month"), newCalendarViewMode = _156[0], setNewCalendarViewMode = _156[1];
475
+ var _157 = (0, react_1.useState)(new Date()), calendarTabMonth = _157[0], setCalendarTabMonth = _157[1];
476
476
  // INFO: defaultViewSwitch picks the opening view only — the tab re-inits
477
477
  // whenever its settings change, and that must not undo the user's switch
478
478
  var calendarViewInitRef = (0, react_1.useRef)(false);
479
- var _161 = (0, react_1.useState)(true), kanbanDroppable = _161[0], setKanbanDroppable = _161[1];
480
- var _162 = (0, react_1.useState)([]), kanbanOptions = _162[0], setKanbanOptions = _162[1];
481
- var _163 = (0, react_1.useState)(false), batchUpdateModal = _163[0], setBatchUpdateModal = _163[1];
482
- var _164 = (0, react_1.useState)({
479
+ var _158 = (0, react_1.useState)(true), kanbanDroppable = _158[0], setKanbanDroppable = _158[1];
480
+ var _159 = (0, react_1.useState)([]), kanbanOptions = _159[0], setKanbanOptions = _159[1];
481
+ var _160 = (0, react_1.useState)(false), batchUpdateModal = _160[0], setBatchUpdateModal = _160[1];
482
+ var _161 = (0, react_1.useState)({
483
483
  columnId: "",
484
484
  columnData: {},
485
- }), batchUpdateData = _164[0], setBatchUpdateData = _164[1];
485
+ }), batchUpdateData = _161[0], setBatchUpdateData = _161[1];
486
486
  // INFO: system columns (created / updated at and by, record id, number)
487
487
  // join the structure hidden; the ones a user shows are kept per view
488
488
  var isSystemColumnsEnabled = !!((_y = props.bareSettings) === null || _y === void 0 ? void 0 : _y.bareSystemColumns);
@@ -490,12 +490,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
490
490
  var appendedSystemColumnIds = isSystemColumnsEnabled
491
491
  ? 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; }); })
492
492
  : [];
493
- var _165 = (0, react_1.useState)((_0 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _0 !== void 0 ? _0 : []), shownSystemColumnIds = _165[0], setShownSystemColumnIds = _165[1];
493
+ var _162 = (0, react_1.useState)((_0 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _0 !== void 0 ? _0 : []), shownSystemColumnIds = _162[0], setShownSystemColumnIds = _162[1];
494
494
  var handleWithSystemColumns = function (model, shownIds) {
495
495
  if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
496
496
  return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
497
497
  };
498
- var _166 = (0, react_1.useState)(function () {
498
+ var _163 = (0, react_1.useState)(function () {
499
499
  var _a;
500
500
  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 : []);
501
501
  if (!persistedState)
@@ -522,8 +522,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
522
522
  });
523
523
  }
524
524
  return model;
525
- }), structure = _166[0], setStructure = _166[1];
526
- var _167 = (0, react_1.useState)(((_1 = props === null || props === void 0 ? void 0 : props.organise) === null || _1 === void 0 ? void 0 : _1.additionalQuery) || []), additionalQuery = _167[0], setAdditionalQuery = _167[1];
525
+ }), structure = _163[0], setStructure = _163[1];
526
+ var _164 = (0, react_1.useState)(((_1 = props === null || props === void 0 ? void 0 : props.organise) === null || _1 === void 0 ? void 0 : _1.additionalQuery) || []), additionalQuery = _164[0], setAdditionalQuery = _164[1];
527
527
  // INFO: State for user-configurable flex filters (Monday.com-style)
528
528
  // INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
529
529
  var defaultFlexFilterRow = [
@@ -541,7 +541,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
541
541
  : (persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
542
542
  ? persistedState.flexFilters
543
543
  : defaultFlexFilterRow;
544
- var _168 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _168[0], setFlexFilters = _168[1];
544
+ var _165 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _165[0], setFlexFilters = _165[1];
545
545
  // INFO: always-current mirror of flexFilters, read by the imperative apply/
546
546
  // clear methods so chained calls in one tick aren't stale.
547
547
  var flexFiltersRef = (0, react_1.useRef)(flexFilters);
@@ -554,91 +554,97 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
554
554
  }, [flexFilters]);
555
555
  // INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
556
556
  // to prevent API calls on every keystroke when typing in value inputs
557
- var _169 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _169[0], setFlexFiltersDebounced = _169[1];
557
+ var _166 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _166[0], setFlexFiltersDebounced = _166[1];
558
558
  // INFO: the filter rows of the export being set up — started from the
559
559
  // list's own when the export opens, so changing them leaves the list as it is
560
- var _170 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _170[0], setExportFlexFilters = _170[1];
561
- var _171 = (0, react_1.useState)({}), flexFilterReferenceOptions = _171[0], setFlexFilterReferenceOptions = _171[1];
562
- var _172 = (0, react_1.useState)({}), flexFilterReferenceSearch = _172[0], setFlexFilterReferenceSearch = _172[1];
563
- var _173 = (0, react_1.useState)(false), flexFilterModalOpen = _173[0], setFlexFilterModalOpen = _173[1];
564
- var _174 = (0, react_1.useState)(false), viewSettingsModalOpen = _174[0], setViewSettingsModalOpen = _174[1];
560
+ var _167 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _167[0], setExportFlexFilters = _167[1];
561
+ var _168 = (0, react_1.useState)({}), flexFilterReferenceOptions = _168[0], setFlexFilterReferenceOptions = _168[1];
562
+ var _169 = (0, react_1.useState)({}), flexFilterReferenceSearch = _169[0], setFlexFilterReferenceSearch = _169[1];
563
+ var _170 = (0, react_1.useState)(false), flexFilterModalOpen = _170[0], setFlexFilterModalOpen = _170[1];
564
+ var _171 = (0, react_1.useState)(false), viewSettingsModalOpen = _171[0], setViewSettingsModalOpen = _171[1];
565
565
  // INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
566
566
  // Deliberately kept out of `structure`: the props-sync effect below resets
567
567
  // structure to props.model whenever props change, which would wipe the
568
568
  // choice, and the persist effect derives schema-level hiddenColumnIds from
569
569
  // structure — writing user hides there would blur the two concepts.
570
- var _175 = (0, react_1.useState)((_3 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _3 !== void 0 ? _3 : []), userHiddenColumnIds = _175[0], setUserHiddenColumnIds = _175[1];
571
- var _176 = (0, react_1.useState)(""), columnSearch = _176[0], setColumnSearch = _176[1];
572
- var _177 = (0, react_1.useState)([]), savedViews = _177[0], setSavedViews = _177[1];
573
- var _178 = (0, react_1.useState)(null), activeSavedViewId = _178[0], setActiveSavedViewId = _178[1];
570
+ var _172 = (0, react_1.useState)((_3 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _3 !== void 0 ? _3 : []), userHiddenColumnIds = _172[0], setUserHiddenColumnIds = _172[1];
571
+ var _173 = (0, react_1.useState)(""), columnSearch = _173[0], setColumnSearch = _173[1];
572
+ var _174 = (0, react_1.useState)([]), savedViews = _174[0], setSavedViews = _174[1];
573
+ var _175 = (0, react_1.useState)(null), activeSavedViewId = _175[0], setActiveSavedViewId = _175[1];
574
574
  // INFO: the widths of the view on screen, by column id ("180px")
575
- 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.columnWidths) !== null && _c !== void 0 ? _c : {}; }), columnWidths = _179[0], setColumnWidths = _179[1];
575
+ var _176 = (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 = _176[0], setColumnWidths = _176[1];
576
576
  // INFO: the columns the view on screen freezes at the left edge
577
- var _180 = (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 = _180[0], setPinnedColumnIds = _180[1];
577
+ var _177 = (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 = _177[0], setPinnedColumnIds = _177[1];
578
578
  // INFO: unsaved changes are kept only once the opening view is on screen,
579
579
  // so the defaults drawn before it never overwrite a person's own
580
- var _181 = (0, react_1.useState)(false), isViewDraftReady = _181[0], setIsViewDraftReady = _181[1];
580
+ var _178 = (0, react_1.useState)(false), isViewDraftReady = _178[0], setIsViewDraftReady = _178[1];
581
581
  // INFO: null while the name box is closed
582
- var _182 = (0, react_1.useState)(null), savedViewName = _182[0], setSavedViewName = _182[1];
583
- var _183 = (0, react_1.useState)(null), deletingSavedViewId = _183[0], setDeletingSavedViewId = _183[1];
584
- var _184 = (0, react_1.useState)(null), renamingSavedView = _184[0], setRenamingSavedView = _184[1];
585
- var _185 = (0, react_1.useState)(false), isSavedViewsExpanded = _185[0], setIsSavedViewsExpanded = _185[1];
586
- var _186 = (0, react_1.useState)(null), draggingColumnId = _186[0], setDraggingColumnId = _186[1];
582
+ var _179 = (0, react_1.useState)(null), savedViewName = _179[0], setSavedViewName = _179[1];
583
+ var _180 = (0, react_1.useState)(null), deletingSavedViewId = _180[0], setDeletingSavedViewId = _180[1];
584
+ var _181 = (0, react_1.useState)(null), renamingSavedView = _181[0], setRenamingSavedView = _181[1];
585
+ var _182 = (0, react_1.useState)(false), isSavedViewsExpanded = _182[0], setIsSavedViewsExpanded = _182[1];
586
+ var _183 = (0, react_1.useState)(null), draggingColumnId = _183[0], setDraggingColumnId = _183[1];
587
587
  var columnRowRefs = (0, react_1.useRef)({});
588
588
  //INFO : Used by Auth
589
- var _187 = (0, react_1.useState)({
589
+ var _184 = (0, react_1.useState)({
590
590
  email: "",
591
591
  google: "",
592
592
  phone: "",
593
593
  disabled: false,
594
594
  create: false,
595
- }), authMethods = _187[0], setAuthMethods = _187[1];
596
- var _188 = (0, react_1.useState)(""), selectedAuthMethod = _188[0], setSelectedAuthMethod = _188[1];
595
+ }), authMethods = _184[0], setAuthMethods = _184[1];
596
+ var _185 = (0, react_1.useState)(""), selectedAuthMethod = _185[0], setSelectedAuthMethod = _185[1];
597
597
  // INFO: the sign-in check of a users datasheet's record is running; the
598
598
  // panel shows a spinner rather than nothing, which read as "no login"
599
- var _189 = (0, react_1.useState)(false), authLoading = _189[0], setAuthLoading = _189[1];
599
+ var _186 = (0, react_1.useState)(false), authLoading = _186[0], setAuthLoading = _186[1];
600
600
  // INFO: a delete is running — the ref answers a second tap at once, before
601
601
  // the state has rendered, and the state disables the confirm button
602
602
  var deletingRef = (0, react_1.useRef)(false);
603
- var _190 = (0, react_1.useState)(false), deleting = _190[0], setDeleting = _190[1];
603
+ var _187 = (0, react_1.useState)(false), deleting = _187[0], setDeleting = _187[1];
604
604
  // INFO: Used by Activity Log
605
- var _191 = (0, react_1.useState)(false), activityModal = _191[0], setActivityModal = _191[1];
606
- var _192 = (0, react_1.useState)(""), activityId = _192[0], setActivityId = _192[1];
605
+ var _188 = (0, react_1.useState)(false), activityModal = _188[0], setActivityModal = _188[1];
606
+ var _189 = (0, react_1.useState)(""), activityId = _189[0], setActivityId = _189[1];
607
607
  //INFO : Used by Export
608
- var _193 = (0, react_1.useState)(null), csvFile = _193[0], setCSVFile = _193[1];
609
- var _194 = (0, react_1.useState)([]), csvFileData = _194[0], setCSVFileData = _194[1];
610
- var _195 = (0, react_1.useState)(0), stepCSVIndex = _195[0], setStepCSVIndex = _195[1];
611
- var _196 = (0, react_1.useState)({}), listCSVMapAttribute = _196[0], setListCSVMapAttribute = _196[1];
612
- var _197 = (0, react_1.useState)({}), listCSVObjAttribute = _197[0], setListCSVObjAttribute = _197[1];
613
- var _198 = (0, react_1.useState)([]), csvAPIAttribute = _198[0], setCSVAPIAttribute = _198[1];
614
- var _199 = (0, react_1.useState)(((_4 = props.devSettings.currentUser) === null || _4 === void 0 ? void 0 : _4.userEmail) || ""), exportCSVEmail = _199[0], setExportCSVEmail = _199[1];
615
- var _200 = (0, react_1.useState)(((_6 = (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.exportSettings) === null || _6 === void 0 ? void 0 : _6.defaultExportPDFName) || ""), exportPDFTitle = _200[0], setExportPDFTitle = _200[1];
616
- var _201 = (0, react_1.useState)(false), exportPDFLoading = _201[0], setExportPDFLoading = _201[1];
617
- var _202 = (0, react_1.useState)(false), exportReadPDFLoading = _202[0], setExportReadPDFLoading = _202[1];
618
- var _203 = (0, react_1.useState)((_9 = (_8 = (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.exportSettings) === null || _8 === void 0 ? void 0 : _8.sumColumnId) !== null && _9 !== void 0 ? _9 : []), exportSumAttributeIds = _203[0], setExportSumAttributeIds = _203[1];
619
- var _204 = (0, react_1.useState)((_12 = (_11 = (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.exportSettings) === null || _11 === void 0 ? void 0 : _11.hideSubItems) !== null && _12 !== void 0 ? _12 : false), hideSubItems = _204[0], setHideSubItems = _204[1];
620
- var _205 = (0, react_1.useState)([]), importTableData = _205[0], setImportTableData = _205[1];
621
- var _206 = (0, react_1.useState)([]), queryList = _206[0], setQueryList = _206[1];
622
- var _207 = (0, react_1.useState)(undefined), allQueryList = _207[0], setAllQueryList = _207[1];
608
+ var _190 = (0, react_1.useState)(null), csvFile = _190[0], setCSVFile = _190[1];
609
+ var _191 = (0, react_1.useState)([]), csvFileData = _191[0], setCSVFileData = _191[1];
610
+ var _192 = (0, react_1.useState)(0), stepCSVIndex = _192[0], setStepCSVIndex = _192[1];
611
+ var _193 = (0, react_1.useState)({}), listCSVMapAttribute = _193[0], setListCSVMapAttribute = _193[1];
612
+ var _194 = (0, react_1.useState)({}), listCSVObjAttribute = _194[0], setListCSVObjAttribute = _194[1];
613
+ var _195 = (0, react_1.useState)([]), csvAPIAttribute = _195[0], setCSVAPIAttribute = _195[1];
614
+ var _196 = (0, react_1.useState)(((_4 = props.devSettings.currentUser) === null || _4 === void 0 ? void 0 : _4.userEmail) || ""), exportCSVEmail = _196[0], setExportCSVEmail = _196[1];
615
+ var _197 = (0, react_1.useState)(((_6 = (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.exportSettings) === null || _6 === void 0 ? void 0 : _6.defaultExportPDFName) || ""), exportPDFTitle = _197[0], setExportPDFTitle = _197[1];
616
+ var _198 = (0, react_1.useState)(false), exportPDFLoading = _198[0], setExportPDFLoading = _198[1];
617
+ var _199 = (0, react_1.useState)(false), exportReadPDFLoading = _199[0], setExportReadPDFLoading = _199[1];
618
+ var _200 = (0, react_1.useState)((_9 = (_8 = (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.exportSettings) === null || _8 === void 0 ? void 0 : _8.sumColumnId) !== null && _9 !== void 0 ? _9 : []), exportSumAttributeIds = _200[0], setExportSumAttributeIds = _200[1];
619
+ var _201 = (0, react_1.useState)((_12 = (_11 = (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.exportSettings) === null || _11 === void 0 ? void 0 : _11.hideSubItems) !== null && _12 !== void 0 ? _12 : false), hideSubItems = _201[0], setHideSubItems = _201[1];
620
+ var _202 = (0, react_1.useState)([]), importTableData = _202[0], setImportTableData = _202[1];
621
+ var _203 = (0, react_1.useState)([]), queryList = _203[0], setQueryList = _203[1];
622
+ var _204 = (0, react_1.useState)(undefined), allQueryList = _204[0], setAllQueryList = _204[1];
623
623
  // INFO: a restored state wins over the prop; its "" is a list the user
624
624
  // ungrouped, so it opens ungrouped
625
- var _208 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
625
+ var _205 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
626
626
  ? persistedState.groupBy || undefined
627
- : (_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.groupBy), groupId = _208[0], setGroupId = _208[1];
627
+ : (_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.groupBy), groupId = _205[0], setGroupId = _205[1];
628
628
  // INFO: each group's total per number column, keyed by section id
629
- var _209 = (0, react_1.useState)({}), groupSummaries = _209[0], setGroupSummaries = _209[1];
629
+ var _206 = (0, react_1.useState)({}), groupSummaries = _206[0], setGroupSummaries = _206[1];
630
630
  // INFO: each group's row count over every row the filters match; null until
631
631
  // read. A band paged alone shows it until its own first page lands, and a
632
632
  // band it counts empty is left out instead of waiting to be read
633
- var _210 = (0, react_1.useState)(null), groupTotals = _210[0], setGroupTotals = _210[1];
633
+ var _207 = (0, react_1.useState)(null), groupTotals = _207[0], setGroupTotals = _207[1];
634
+ // INFO: the last read of groupTotals failed, so bands fall back to the rows
635
+ // loaded instead of waiting on a total that is not coming
636
+ var _208 = (0, react_1.useState)(false), groupTotalsFailed = _208[0], setGroupTotalsFailed = _208[1];
634
637
  var groupSummaryRequestRef = (0, react_1.useRef)(0);
635
- var _211 = (0, react_1.useState)({}), commentCounts = _211[0], setCommentCounts = _211[1];
638
+ // INFO: the grouped count waiting to go out, so a filter change can stop it
639
+ // before it sends the filters it was scheduled with
640
+ var groupSummaryTimerRef = (0, react_1.useRef)(null);
641
+ var _209 = (0, react_1.useState)({}), commentCounts = _209[0], setCommentCounts = _209[1];
636
642
  // INFO: Monday-board per-group paging. Keyed by the group key that
637
643
  // handleBuildNewTableGroups() produces (an option, Unknown or No Value).
638
644
  // Each group tracks its own loaded cursor + total so it can lazily load its
639
645
  // next page as the user scrolls inside that band, independent of every other
640
646
  // group. Only used when renderCheckGroupPaging() is true.
641
- var _212 = (0, react_1.useState)({}), groupPageState = _212[0], setGroupPageState = _212[1];
647
+ var _210 = (0, react_1.useState)({}), groupPageState = _210[0], setGroupPageState = _210[1];
642
648
  // INFO: read fresh inside the async per-group fetch so chained scroll fires
643
649
  // in one tick do not re-fetch an already in-flight page.
644
650
  var groupPageStateRef = (0, react_1.useRef)({});
@@ -653,62 +659,62 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
653
659
  var groupLoadingKeyRef = (0, react_1.useRef)(null);
654
660
  var groupLoadQueueRef = (0, react_1.useRef)([]);
655
661
  var handleFetchGroupNextPageRef = (0, react_1.useRef)(function () { });
656
- var _213 = (0, react_1.useState)(""), readTabSection = _213[0], setReadTabSection = _213[1];
657
- var _214 = (0, react_1.useState)(false), readFloatingNav = _214[0], setReadFloatingNav = _214[1];
662
+ var _211 = (0, react_1.useState)(""), readTabSection = _211[0], setReadTabSection = _211[1];
663
+ var _212 = (0, react_1.useState)(false), readFloatingNav = _212[0], setReadFloatingNav = _212[1];
658
664
  var readTabSectionRefs = (0, react_1.useRef)({});
659
665
  //INFO : Used by Read
660
666
  //INFO : Used by Update
661
- var _215 = (0, react_1.useState)(false), modalVisible = _215[0], setModalVisible = _215[1];
662
- var _216 = (0, react_1.useState)(false), deleteModal = _216[0], setDeleteModal = _216[1];
663
- var _217 = (0, react_1.useState)(false), excelModal = _217[0], setExcelModal = _217[1];
664
- var _218 = (0, react_1.useState)(false), exportExcel = _218[0], setExportExcel = _218[1];
665
- var _219 = (0, react_1.useState)(""), exportType = _219[0], setExportType = _219[1];
666
- var _220 = (0, react_1.useState)(false), exportQR = _220[0], setExportQR = _220[1];
667
- var _221 = (0, react_1.useState)(function () {
667
+ var _213 = (0, react_1.useState)(false), modalVisible = _213[0], setModalVisible = _213[1];
668
+ var _214 = (0, react_1.useState)(false), deleteModal = _214[0], setDeleteModal = _214[1];
669
+ var _215 = (0, react_1.useState)(false), excelModal = _215[0], setExcelModal = _215[1];
670
+ var _216 = (0, react_1.useState)(false), exportExcel = _216[0], setExportExcel = _216[1];
671
+ var _217 = (0, react_1.useState)(""), exportType = _217[0], setExportType = _217[1];
672
+ var _218 = (0, react_1.useState)(false), exportQR = _218[0], setExportQR = _218[1];
673
+ var _219 = (0, react_1.useState)(function () {
668
674
  var _a, _b;
669
675
  var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
670
676
  return firstTabId;
671
- }), activeTab = _221[0], setActiveTab = _221[1];
672
- var _222 = (0, react_1.useState)(false), signatureSigning = _222[0], setSignatureSigning = _222[1];
673
- var _223 = (0, react_1.useState)({}), selectedData = _223[0], setSelectedData = _223[1];
674
- var _224 = (0, react_1.useState)(""), selectedObjectStructureId = _224[0], setSelectedObjectStructureId = _224[1];
675
- var _225 = (0, react_1.useState)(""), selectedObjectId = _225[0], setSelectedObjectId = _225[1];
676
- var _226 = (0, react_1.useState)(""), selectedListAddressId = _226[0], setSelectedListAddressId = _226[1];
677
- var _227 = (0, react_1.useState)(-1), selectedListAddressIndex = _227[0], setSelectedListAddressIndex = _227[1];
678
- var _228 = (0, react_1.useState)({
677
+ }), activeTab = _219[0], setActiveTab = _219[1];
678
+ var _220 = (0, react_1.useState)(false), signatureSigning = _220[0], setSignatureSigning = _220[1];
679
+ var _221 = (0, react_1.useState)({}), selectedData = _221[0], setSelectedData = _221[1];
680
+ var _222 = (0, react_1.useState)(""), selectedObjectStructureId = _222[0], setSelectedObjectStructureId = _222[1];
681
+ var _223 = (0, react_1.useState)(""), selectedObjectId = _223[0], setSelectedObjectId = _223[1];
682
+ var _224 = (0, react_1.useState)(""), selectedListAddressId = _224[0], setSelectedListAddressId = _224[1];
683
+ var _225 = (0, react_1.useState)(-1), selectedListAddressIndex = _225[0], setSelectedListAddressIndex = _225[1];
684
+ var _226 = (0, react_1.useState)({
679
685
  lat: 0,
680
686
  lng: 0,
681
687
  name: "",
682
- }), selectedListAddress = _228[0], setSelectedListAddress = _228[1];
683
- var _229 = (0, react_1.useState)({}), selectedObjectData = _229[0], setSelectedObjectData = _229[1];
684
- var _230 = (0, react_1.useState)(null), objectCellEdit = _230[0], setObjectCellEdit = _230[1];
685
- var _231 = (0, react_1.useState)(false), referenceLoading = _231[0], setReferenceLoading = _231[1];
686
- var _232 = (0, react_1.useState)({}), referencesOptions = _232[0], setReferencesOptions = _232[1];
687
- var _233 = (0, react_1.useState)({}), referencesDetails = _233[0], setReferencesDetails = _233[1];
688
- var _234 = (0, react_1.useState)({}), listReferencesOptions = _234[0], setListReferencesOptions = _234[1];
688
+ }), selectedListAddress = _226[0], setSelectedListAddress = _226[1];
689
+ var _227 = (0, react_1.useState)({}), selectedObjectData = _227[0], setSelectedObjectData = _227[1];
690
+ var _228 = (0, react_1.useState)(null), objectCellEdit = _228[0], setObjectCellEdit = _228[1];
691
+ var _229 = (0, react_1.useState)(false), referenceLoading = _229[0], setReferenceLoading = _229[1];
692
+ var _230 = (0, react_1.useState)({}), referencesOptions = _230[0], setReferencesOptions = _230[1];
693
+ var _231 = (0, react_1.useState)({}), referencesDetails = _231[0], setReferencesDetails = _231[1];
694
+ var _232 = (0, react_1.useState)({}), listReferencesOptions = _232[0], setListReferencesOptions = _232[1];
689
695
  // INFO: the referenced records themselves, for a table cell that picks from
690
696
  // a list on one (referenceSelection)
691
- var _235 = (0, react_1.useState)({}), listReferencesDetails = _235[0], setListReferencesDetails = _235[1];
692
- var _236 = (0, react_1.useState)({}), referenceDeleteTableData = _236[0], setReferenceDeleteTableData = _236[1];
693
- var _237 = (0, react_1.useState)([]), relatedSections = _237[0], setRelatedSections = _237[1];
694
- var _238 = (0, react_1.useState)(0), referenceDeleteIndex = _238[0], setReferenceDeleteIndex = _238[1];
695
- var _239 = (0, react_1.useState)({
697
+ var _233 = (0, react_1.useState)({}), listReferencesDetails = _233[0], setListReferencesDetails = _233[1];
698
+ var _234 = (0, react_1.useState)({}), referenceDeleteTableData = _234[0], setReferenceDeleteTableData = _234[1];
699
+ var _235 = (0, react_1.useState)([]), relatedSections = _235[0], setRelatedSections = _235[1];
700
+ var _236 = (0, react_1.useState)(0), referenceDeleteIndex = _236[0], setReferenceDeleteIndex = _236[1];
701
+ var _237 = (0, react_1.useState)({
696
702
  id: "",
697
703
  name: "",
698
704
  type: "string",
699
- }), referenceCreationModal = _239[0], setReferenceCreationModal = _239[1];
700
- var _240 = (0, react_1.useState)({}), referenceModelSchema = _240[0], setReferenceSchema = _240[1];
701
- var _241 = (0, react_1.useState)([]), kanbanChecked = _241[0], setKanbanChecked = _241[1];
705
+ }), referenceCreationModal = _237[0], setReferenceCreationModal = _237[1];
706
+ var _238 = (0, react_1.useState)({}), referenceModelSchema = _238[0], setReferenceSchema = _238[1];
707
+ var _239 = (0, react_1.useState)([]), kanbanChecked = _239[0], setKanbanChecked = _239[1];
702
708
  //INFO : Offline
703
- var _242 = (0, react_1.useState)(0), offlineDataLength = _242[0], setOfflineDataLength = _242[1];
704
- var _243 = (0, react_1.useState)(false), offlineModal = _243[0], setOfflineModal = _243[1];
709
+ var _240 = (0, react_1.useState)(0), offlineDataLength = _240[0], setOfflineDataLength = _240[1];
710
+ var _241 = (0, react_1.useState)(false), offlineModal = _241[0], setOfflineModal = _241[1];
705
711
  // INFO: live-stream state — driven by socket connection and navigator.onLine
706
- var _244 = (0, react_1.useState)(false), isLive = _244[0], setIsLive = _244[1];
707
- var _245 = (0, react_1.useState)(false), isLiveOffline = _245[0], setIsLiveOffline = _245[1];
712
+ var _242 = (0, react_1.useState)(false), isLive = _242[0], setIsLive = _242[1];
713
+ var _243 = (0, react_1.useState)(false), isLiveOffline = _243[0], setIsLiveOffline = _243[1];
708
714
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
709
715
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
710
716
  // Independent of SSE status so it works even when bareSocketName is not set.
711
- var _246 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _246[0], setIsNetworkOffline = _246[1];
717
+ var _244 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _244[0], setIsNetworkOffline = _244[1];
712
718
  var previousType = (0, react_1.useRef)(null);
713
719
  var previousSelectedData = (0, react_1.useRef)(null);
714
720
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -870,6 +876,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
870
876
  // request waits for the reads to settle and goes once
871
877
  (0, react_1.useEffect)(function () {
872
878
  var timer = setTimeout(function () { return handleFetchGroupSummaries(); }, 300);
879
+ groupSummaryTimerRef.current = timer;
873
880
  return function () { return clearTimeout(timer); };
874
881
  /* eslint-disable */
875
882
  }, [groupId, tableData]);
@@ -890,7 +897,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
890
897
  return;
891
898
  var collectionId = props.collectionId;
892
899
  recordIds.forEach(function (eachId) { return commentCountedIdsRef.current.add(eachId); });
893
- onFetchCommentCounts(recordIds)
900
+ onFetchCommentCounts(recordIds, collectionId)
894
901
  .then(function (counts) {
895
902
  if (collectionId !== commentCollectionRef.current)
896
903
  return;
@@ -1036,7 +1043,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1036
1043
  var isSchemaHideMode = ((_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.onChangeHide) ? true : false;
1037
1044
  // INFO: rows per page is a view setting the user can change, so it starts from
1038
1045
  // the persisted value and falls back to the consumer's limit
1039
- var _247 = (0, react_1.useState)((_27 = (_26 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _26 !== void 0 ? _26 : props.limit) !== null && _27 !== void 0 ? _27 : 10), pageLimit = _247[0], setPageLimit = _247[1];
1046
+ var _245 = (0, react_1.useState)((_27 = (_26 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _26 !== void 0 ? _26 : props.limit) !== null && _27 !== void 0 ? _27 : 10), pageLimit = _245[0], setPageLimit = _245[1];
1040
1047
  var limit = pageLimit;
1041
1048
  var isSavedViewsEnabled = !!((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.savedViews) && resolvedType === "list";
1042
1049
  // INFO: an app that stores views takes over from this browser's storage, so
@@ -1183,7 +1190,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1183
1190
  displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
1184
1191
  };
1185
1192
  };
1186
- var _248 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _248.canUpdateRecord, canInlineUpdate = _248.canInlineUpdate, canBatchUpdate = _248.canBatchUpdate, canDeleteRecord = _248.canDeleteRecord;
1193
+ var _246 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _246.canUpdateRecord, canInlineUpdate = _246.canInlineUpdate, canBatchUpdate = _246.canBatchUpdate, canDeleteRecord = _246.canDeleteRecord;
1187
1194
  var isEditor = ((_40 = props.edit) === null || _40 === void 0 ? void 0 : _40.allEditable) ? true : false;
1188
1195
  var isOffline = (_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.bareOffline;
1189
1196
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
@@ -1219,12 +1226,62 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1219
1226
  ((_57 = props.edit) === null || _57 === void 0 ? void 0 : _57.activityLog.commentCollectionId)) ||
1220
1227
  (((_59 = (_58 = props.edit) === null || _58 === void 0 ? void 0 : _58.activityLog) === null || _59 === void 0 ? void 0 : _59.enableLogs) &&
1221
1228
  ((_60 = props.edit) === null || _60 === void 0 ? void 0 : _60.activityLog.logsCollectionId));
1222
- var customPaginationSize = ((_61 = props.organise) === null || _61 === void 0 ? void 0 : _61.customPaginationCount)
1229
+ // INFO: a record's comments and logs shown in place of the record rather than
1230
+ // in a drawer of their own — a related tab already sits inside the read
1231
+ // drawer, and a second drawer over it hid the row being discussed. It opens
1232
+ // the row through handleNavigate, so without one it stays off and the
1233
+ // drawer is used, rather than leaving a comment button that does nothing
1234
+ var isInlineActivity = !!isActivityLog &&
1235
+ !!((_61 = props.bareSettings) === null || _61 === void 0 ? void 0 : _61.bareInlineActivity) &&
1236
+ hasNavigation;
1237
+ // INFO: each row button opens what it shows: the comment button the row's
1238
+ // comments and logs alone, the eye (or the row) its details alone, so
1239
+ // neither has to be scrolled past to reach the other
1240
+ var _247 = (0, react_1.useState)(false), inlineActivityOnly = _247[0], setInlineActivityOnly = _247[1];
1241
+ var isActivityOnly = isInlineActivity && inlineActivityOnly;
1242
+ // INFO: the row whose comments were shown; going back to the list asks its
1243
+ // comment count again, as the drawer does when it closes
1244
+ var inlineActivityIdRef = (0, react_1.useRef)("");
1245
+ // INFO: the flag is cleared only on the way back from a row, not while the
1246
+ // list is still on screen — a host may open the row a render after the click
1247
+ var lastInlineTypeRef = (0, react_1.useRef)(resolvedType);
1248
+ (0, react_1.useEffect)(function () {
1249
+ var previousType = lastInlineTypeRef.current;
1250
+ lastInlineTypeRef.current = resolvedType;
1251
+ if (!isInlineActivity)
1252
+ return;
1253
+ if (resolvedType === "read" && props.id) {
1254
+ if (inlineActivityOnly)
1255
+ inlineActivityIdRef.current = props.id;
1256
+ return;
1257
+ }
1258
+ if (resolvedType !== "list" || previousType !== "read")
1259
+ return;
1260
+ setInlineActivityOnly(false);
1261
+ var shownId = inlineActivityIdRef.current;
1262
+ inlineActivityIdRef.current = "";
1263
+ if (shownId)
1264
+ handleFetchCommentCounts([shownId]);
1265
+ /* eslint-disable */
1266
+ }, [resolvedType, props.id, isInlineActivity]);
1267
+ /* eslint-enable */
1268
+ var renderActivityPanel = function (dataId) {
1269
+ var _a, _b, _c, _d;
1270
+ return (react_1.default.createElement(activityModal_1.ActivityModal, { title: props.title && typeof props.title === "string"
1271
+ ? props.title
1272
+ : "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: dataId, activityLog: (_a = props.edit) === null || _a === void 0 ? void 0 : _a.activityLog,
1273
+ // INFO: names the record in the panel's heading; without it the lookup
1274
+ // reads a "title" field most datasheets lack and the heading shows the
1275
+ // record's id. A title or name column comes first, then the first text
1276
+ // column
1277
+ 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 }));
1278
+ };
1279
+ var customPaginationSize = ((_62 = props.organise) === null || _62 === void 0 ? void 0 : _62.customPaginationCount)
1223
1280
  ? props.organise.customPaginationCount(size)
1224
1281
  : undefined;
1225
1282
  //TODO : Code - Pass ...devSettings, search dbEndpoint:
1226
1283
  var writeServerQuery = new writeQuery_1.WriteQuery({
1227
- dbModule: (_62 = props.lib) === null || _62 === void 0 ? void 0 : _62.axios,
1284
+ dbModule: (_63 = props.lib) === null || _63 === void 0 ? void 0 : _63.axios,
1228
1285
  dbType: devSettings.server,
1229
1286
  dbCollection: props.collectionId,
1230
1287
  dbEndpoint: devSettings.dbEndpoint,
@@ -1232,7 +1289,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1232
1289
  dbUserToken: devSettings.dbUserToken,
1233
1290
  });
1234
1291
  var readServerQuery = new readQuery_1.ReadQuery({
1235
- dbModule: (_63 = props.lib) === null || _63 === void 0 ? void 0 : _63.axios,
1292
+ dbModule: (_64 = props.lib) === null || _64 === void 0 ? void 0 : _64.axios,
1236
1293
  dbType: devSettings.server,
1237
1294
  dbCollection: props.collectionId,
1238
1295
  dbEndpoint: devSettings.dbEndpoint,
@@ -1240,12 +1297,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1240
1297
  dbUserToken: devSettings.dbUserToken,
1241
1298
  });
1242
1299
  var moreButtonPopUp = [
1243
- ((_64 = props.edit) === null || _64 === void 0 ? void 0 : _64.allEditable) &&
1300
+ ((_65 = props.edit) === null || _65 === void 0 ? void 0 : _65.allEditable) &&
1244
1301
  // INFO: the import runs on the server (importEndpoint), so a Firestore
1245
1302
  // datasheet served through one can import; only the browser-direct
1246
1303
  // Firebase client has no server to import through
1247
1304
  !isFirebaseClient &&
1248
- !((_66 = (_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.exportSettings) === null || _66 === void 0 ? void 0 : _66.hideImportCSV)
1305
+ !((_67 = (_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.exportSettings) === null || _67 === void 0 ? void 0 : _67.hideImportCSV)
1249
1306
  ? {
1250
1307
  text: "Import Excel",
1251
1308
  onClick: function () {
@@ -1254,7 +1311,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1254
1311
  },
1255
1312
  }
1256
1313
  : null,
1257
- !((_68 = (_67 = props.organise) === null || _67 === void 0 ? void 0 : _67.exportSettings) === null || _68 === void 0 ? void 0 : _68.hideExportCSV)
1314
+ !((_69 = (_68 = props.organise) === null || _68 === void 0 ? void 0 : _68.exportSettings) === null || _69 === void 0 ? void 0 : _69.hideExportCSV)
1258
1315
  ? {
1259
1316
  text: "Export CSV",
1260
1317
  onClick: function () {
@@ -1264,7 +1321,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1264
1321
  },
1265
1322
  }
1266
1323
  : null,
1267
- !((_70 = (_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.exportSettings) === null || _70 === void 0 ? void 0 : _70.hideExportExcel)
1324
+ !((_71 = (_70 = props.organise) === null || _70 === void 0 ? void 0 : _70.exportSettings) === null || _71 === void 0 ? void 0 : _71.hideExportExcel)
1268
1325
  ? {
1269
1326
  text: "Export Excel",
1270
1327
  onClick: function () {
@@ -1274,7 +1331,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1274
1331
  },
1275
1332
  }
1276
1333
  : null,
1277
- !((_72 = (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.exportSettings) === null || _72 === void 0 ? void 0 : _72.hideExportPDF)
1334
+ !((_73 = (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.exportSettings) === null || _73 === void 0 ? void 0 : _73.hideExportPDF)
1278
1335
  ? {
1279
1336
  text: "Export PDF",
1280
1337
  onClick: function () {
@@ -1284,7 +1341,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1284
1341
  },
1285
1342
  }
1286
1343
  : null,
1287
- !((_74 = (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.exportSettings) === null || _74 === void 0 ? void 0 : _74.hideExportQR)
1344
+ !((_75 = (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.exportSettings) === null || _75 === void 0 ? void 0 : _75.hideExportQR)
1288
1345
  ? {
1289
1346
  text: "Export QR",
1290
1347
  onClick: function () {
@@ -1294,7 +1351,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1294
1351
  },
1295
1352
  }
1296
1353
  : null,
1297
- !((_76 = (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.exportSettings) === null || _76 === void 0 ? void 0 : _76.hideExportQR)
1354
+ !((_77 = (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.exportSettings) === null || _77 === void 0 ? void 0 : _77.hideExportQR)
1298
1355
  ? {
1299
1356
  text: "Export QR(Data)",
1300
1357
  onClick: function () {
@@ -1304,7 +1361,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1304
1361
  },
1305
1362
  }
1306
1363
  : null,
1307
- !((_78 = (_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.exportSettings) === null || _78 === void 0 ? void 0 : _78.hideExportPrint)
1364
+ !((_79 = (_78 = props.organise) === null || _78 === void 0 ? void 0 : _78.exportSettings) === null || _79 === void 0 ? void 0 : _79.hideExportPrint)
1308
1365
  ? {
1309
1366
  text: "Print",
1310
1367
  onClick: function () {
@@ -1316,8 +1373,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1316
1373
  : null,
1317
1374
  // INFO: drafts only exist where the form can save one, so the filter has
1318
1375
  // nothing to find on any other page
1319
- ((_79 = props.edit) === null || _79 === void 0 ? void 0 : _79.enableUpdateDraft) &&
1320
- !((_81 = (_80 = props.organise) === null || _80 === void 0 ? void 0 : _80.exportSettings) === null || _81 === void 0 ? void 0 : _81.hideExportDraft)
1376
+ ((_80 = props.edit) === null || _80 === void 0 ? void 0 : _80.enableUpdateDraft) &&
1377
+ !((_82 = (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.exportSettings) === null || _82 === void 0 ? void 0 : _82.hideExportDraft)
1321
1378
  ? {
1322
1379
  text: filterDraft ? "Show All Items" : "Filter Draft",
1323
1380
  onClick: function () {
@@ -1326,7 +1383,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1326
1383
  }
1327
1384
  : null,
1328
1385
  ].filter(Boolean);
1329
- if ((_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.moreSettings)
1386
+ if ((_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.moreSettings)
1330
1387
  moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
1331
1388
  //=====================================================================================
1332
1389
  //SECTION: User Column Visibility Handlers
@@ -1771,14 +1828,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1771
1828
  //=====================================================================================
1772
1829
  //SECTION: Saved Views
1773
1830
  //=====================================================================================
1774
- var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.persistKey, (_84 = devSettings.currentUser) === null || _84 === void 0 ? void 0 : _84.userEmail);
1831
+ var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.persistKey, (_85 = devSettings.currentUser) === null || _85 === void 0 ? void 0 : _85.userEmail);
1775
1832
  (0, react_1.useEffect)(function () {
1776
1833
  if (isSavedViewsEnabled && !isAppViews)
1777
1834
  setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
1778
1835
  }, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
1779
1836
  // INFO: the app keeps All's settings, so every change is kept in this
1780
1837
  // browser until the person updates the view for everyone or resets it
1781
- var isViewDraftsEnabled = isSavedViewsEnabled && ((_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.allView) !== undefined;
1838
+ var isViewDraftsEnabled = isSavedViewsEnabled && ((_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.allView) !== undefined;
1782
1839
  var handleGetViewDraftKey = function (viewId) {
1783
1840
  var _a, _b;
1784
1841
  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);
@@ -1862,7 +1919,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1862
1919
  var lastSentSharedViewsRef = (0, react_1.useRef)(null);
1863
1920
  (0, react_1.useEffect)(function () {
1864
1921
  lastSentSharedViewsRef.current = null;
1865
- }, [(_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.sharedViews]);
1922
+ }, [(_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.sharedViews]);
1866
1923
  var handleStoreSharedViews = function (update) {
1867
1924
  var _a, _b, _c;
1868
1925
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
@@ -1907,13 +1964,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1907
1964
  /* eslint-disable */
1908
1965
  }, [
1909
1966
  isSavedViewsEnabled,
1910
- (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.initialSavedViewId,
1911
- (_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.defaultSavedViewId,
1912
- (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.sharedViews,
1967
+ (_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.initialSavedViewId,
1968
+ (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.defaultSavedViewId,
1969
+ (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.sharedViews,
1913
1970
  savedViews,
1914
1971
  ]);
1915
1972
  /* eslint-enable */
1916
- var defaultSavedViewIds = ((_91 = (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.defaultSavedViews) !== null && _91 !== void 0 ? _91 : [])
1973
+ var defaultSavedViewIds = ((_92 = (_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.defaultSavedViews) !== null && _92 !== void 0 ? _92 : [])
1917
1974
  .map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
1918
1975
  .join("|");
1919
1976
  // INFO: keyed on the ids, not the array, so an inline literal passed on every
@@ -2243,8 +2300,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2243
2300
  groupId,
2244
2301
  columnWidths,
2245
2302
  pinnedColumnIds,
2246
- (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.allView,
2247
- (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.sharedViews,
2303
+ (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.allView,
2304
+ (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.sharedViews,
2248
2305
  savedViews,
2249
2306
  ]);
2250
2307
  /* eslint-enable */
@@ -2284,7 +2341,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2284
2341
  var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
2285
2342
  scrollRestoredRef.current = isSwitch || isOtherListReturn;
2286
2343
  /* eslint-disable */
2287
- }, [props.collectionId, (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.persistKey]);
2344
+ }, [props.collectionId, (_95 = props.organise) === null || _95 === void 0 ? void 0 : _95.persistKey]);
2288
2345
  /* eslint-enable */
2289
2346
  // INFO: wait a frame — rows land in state one tick before layout
2290
2347
  (0, react_1.useEffect)(function () {
@@ -2319,7 +2376,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2319
2376
  (0, react_1.useEffect)(function () {
2320
2377
  handleOfflinePrefetch();
2321
2378
  /* eslint-disable */
2322
- }, [props.collectionId, (_95 = props.bareSettings) === null || _95 === void 0 ? void 0 : _95.bareOffline]);
2379
+ }, [props.collectionId, (_96 = props.bareSettings) === null || _96 === void 0 ? void 0 : _96.bareOffline]);
2323
2380
  /* eslint-enable */
2324
2381
  // INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
2325
2382
  // Calls through handleRefreshRef so the interval always dispatches the latest
@@ -2339,7 +2396,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2339
2396
  }, interval);
2340
2397
  return function () { return clearInterval(timer); };
2341
2398
  /* eslint-disable */
2342
- }, [(_96 = props.bareSettings) === null || _96 === void 0 ? void 0 : _96.barePollingInterval, isLive, isNetworkOffline]);
2399
+ }, [(_97 = props.bareSettings) === null || _97 === void 0 ? void 0 : _97.barePollingInterval, isLive, isNetworkOffline]);
2343
2400
  /* eslint-enable */
2344
2401
  // INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
2345
2402
  // EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
@@ -2381,7 +2438,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2381
2438
  };
2382
2439
  /* eslint-disable */
2383
2440
  }, [
2384
- (_97 = props.bareSettings) === null || _97 === void 0 ? void 0 : _97.bareSocketName,
2441
+ (_98 = props.bareSettings) === null || _98 === void 0 ? void 0 : _98.bareSocketName,
2385
2442
  props.collectionId,
2386
2443
  props.devSettings.sseEndpoint,
2387
2444
  props.devSettings.dbAPIToken,
@@ -2655,10 +2712,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2655
2712
  props.collectionId,
2656
2713
  props.model,
2657
2714
  props.localURLEndpoint,
2658
- (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.extendedTabs,
2715
+ (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.extendedTabs,
2659
2716
  listViewId,
2660
- (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.additionalQuery,
2661
- (_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.groupBy,
2717
+ (_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.additionalQuery,
2718
+ (_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.groupBy,
2662
2719
  resolvedType,
2663
2720
  ]);
2664
2721
  /**
@@ -2810,7 +2867,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2810
2867
  };
2811
2868
  }, 100);
2812
2869
  return function () { return clearTimeout(timeoutId); };
2813
- }, [(_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.showReadFloatingNav, resolvedType, props.id, loading]);
2870
+ }, [(_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.showReadFloatingNav, resolvedType, props.id, loading]);
2814
2871
  (0, react_1.useEffect)(function () {
2815
2872
  if (resolvedType !== "read")
2816
2873
  return;
@@ -4209,6 +4266,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
4209
4266
  groupPageStateRef.current = {};
4210
4267
  setGroupPageState({});
4211
4268
  setGroupTotals(null);
4269
+ // INFO: a grouped count still in flight counts the list being cleared;
4270
+ // moving the request on drops its reply, so a band keeps pulsing until
4271
+ // the new list's count lands instead of taking the old total
4272
+ groupSummaryRequestRef.current += 1;
4273
+ // INFO: and one still waiting to go out would send the old filters — the
4274
+ // rows of a paged list stay until the new read, so its effect never
4275
+ // clears it. The new read lands new rows, which schedule the next count
4276
+ if (groupSummaryTimerRef.current)
4277
+ clearTimeout(groupSummaryTimerRef.current);
4212
4278
  // INFO: In scroll mode, accumulated rows must be cleared on refresh/filter change
4213
4279
  // so the fresh response replaces stale data instead of being deduped away.
4214
4280
  if (renderCheckScrollMode()) {
@@ -5961,7 +6027,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5961
6027
  var columnTypeActions = {
5962
6028
  canUpdate: canUpdateRecord,
5963
6029
  dateWarnings: isDateWarnings,
5964
- onButtonClick: (_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.onButtonClick,
6030
+ onButtonClick: (_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.onButtonClick,
5965
6031
  onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
5966
6032
  var _a;
5967
6033
  return __generator(this, function (_b) {
@@ -5978,7 +6044,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5978
6044
  }
5979
6045
  });
5980
6046
  }); },
5981
- onTimeTrackingAction: ((_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.onTimeTrackingAction) && canUpdateRecord
6047
+ onTimeTrackingAction: ((_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.onTimeTrackingAction) && canUpdateRecord
5982
6048
  ? function (rowId, columnId, action) {
5983
6049
  return handleTimeTrackingAction(rowId, columnId, action);
5984
6050
  }
@@ -8224,8 +8290,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8224
8290
  : rows;
8225
8291
  };
8226
8292
  /* eslint-disable */
8227
- var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_104 = props.bareSettings) === null || _104 === void 0 ? void 0 : _104.bareNewDTW]);
8228
- var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_105 = props.bareSettings) === null || _105 === void 0 ? void 0 : _105.bareNewDTW]);
8293
+ var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_105 = props.bareSettings) === null || _105 === void 0 ? void 0 : _105.bareNewDTW]);
8294
+ var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_106 = props.bareSettings) === null || _106 === void 0 ? void 0 : _106.bareNewDTW]);
8229
8295
  /* eslint-enable */
8230
8296
  // INFO: beside a record's title, the pencil opens its edit form for whoever
8231
8297
  // may update, and the bubble opens comments and logs for anyone who can see
@@ -8237,15 +8303,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8237
8303
  handleCaptureListScroll(id);
8238
8304
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "update", id, "general");
8239
8305
  };
8240
- var handleOpenRecordActivity = function (id) {
8241
- setActivityId(id);
8242
- setActivityModal(true);
8243
- };
8244
8306
  var handleOpenRecordRead = function (id) {
8245
8307
  var _a, _b;
8246
8308
  handleCaptureListScroll(id);
8247
8309
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
8248
8310
  };
8311
+ // INFO: with the activity shown in place, a row's comment button opens that
8312
+ // row's comments and logs where the list was, rather than stacking a second
8313
+ // drawer
8314
+ var handleOpenRecordActivity = function (id) {
8315
+ if (isInlineActivity) {
8316
+ setInlineActivityOnly(true);
8317
+ handleOpenRecordRead(id);
8318
+ return;
8319
+ }
8320
+ setActivityId(id);
8321
+ setActivityModal(true);
8322
+ };
8249
8323
  var recordEditAction = canUpdateRecord ? handleOpenRecordEdit : undefined;
8250
8324
  // INFO: the chevron only navigates through handleNavigate, so a host that
8251
8325
  // routes by url gets none rather than a button that does nothing
@@ -8340,7 +8414,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8340
8414
  return !utils_1.NON_DETAIL_LIST_DATA_TYPES.includes(eachAttribute.type);
8341
8415
  })
8342
8416
  .map(function (eachAttribute) {
8343
- var _a, _b, _c, _d, _e, _f;
8417
+ var _a, _b, _c, _d, _e;
8344
8418
  var selectedDataKey = Object.keys(selectedData).find(function (eachKey) { return eachKey === eachAttribute.id; });
8345
8419
  if (selectedDataKey) {
8346
8420
  var showIdCondition = showId
@@ -8354,14 +8428,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8354
8428
  var bareReadDescFunc = (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareReadDescription;
8355
8429
  if (bareReadDescFunc === null || bareReadDescFunc === void 0 ? void 0 : bareReadDescFunc((_c = eachAttribute === null || eachAttribute === void 0 ? void 0 : eachAttribute.id) !== null && _c !== void 0 ? _c : "", selectedData[selectedDataKey]))
8356
8430
  currentValue = bareReadDescFunc === null || bareReadDescFunc === void 0 ? void 0 : bareReadDescFunc((_d = eachAttribute === null || eachAttribute === void 0 ? void 0 : eachAttribute.id) !== null && _d !== void 0 ? _d : "", selectedData[selectedDataKey]);
8357
- if (eachAttribute.type === "listReference") {
8358
- currentValue = (_e = selectedData[selectedDataKey]) === null || _e === void 0 ? void 0 : _e.map(function (eachData) {
8431
+ // INFO: a failed lookup leaves the read module's anomaly notice
8432
+ // here instead of the list, which is shown as it is
8433
+ if (eachAttribute.type === "listReference" &&
8434
+ Array.isArray(selectedData[selectedDataKey])) {
8435
+ currentValue = selectedData[selectedDataKey].map(function (eachData) {
8359
8436
  var _a, _b;
8360
8437
  return ((_b = eachData === null || eachData === void 0 ? void 0 : eachData[(_a = eachAttribute.referenceLabel) !== null && _a !== void 0 ? _a : ""]) !== null && _b !== void 0 ? _b : (0, moduleUtils_1.renderReferenceStringAttribute)(eachData));
8361
8438
  });
8362
8439
  }
8363
8440
  detailList.push({
8364
- title: (_f = eachAttribute === null || eachAttribute === void 0 ? void 0 : eachAttribute.name) !== null && _f !== void 0 ? _f : "",
8441
+ title: (_e = eachAttribute === null || eachAttribute === void 0 ? void 0 : eachAttribute.name) !== null && _e !== void 0 ? _e : "",
8365
8442
  text: currentValue,
8366
8443
  });
8367
8444
  }
@@ -8748,10 +8825,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8748
8825
  var showUpdate = !bareActionComponent && canUpdateRecord;
8749
8826
  var showExport = !!((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.exportSettings) === null || _e === void 0 ? void 0 : _e.enableExportReadPDF);
8750
8827
  var showDelete = canDeleteRecord && props.id !== "new";
8828
+ // INFO: with the activity shown in place there is no Log button, so a
8829
+ // related row with nothing else to act on draws no bar at all
8830
+ var showLog = !!isActivityLog && !isInlineActivity;
8751
8831
  if (!hasCustomActions &&
8752
8832
  !showUpdate &&
8753
8833
  !showExport &&
8754
- !isActivityLog &&
8834
+ !showLog &&
8755
8835
  !showDelete)
8756
8836
  return null;
8757
8837
  return (react_1.default.createElement("div", { "data-testid": "dtw-read-bar", className: handleActionBarClassName(true) },
@@ -8765,7 +8845,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8765
8845
  setDeleteModal(true);
8766
8846
  } })))),
8767
8847
  showExport && (react_1.default.createElement(button_1.Button, { type: "light", text: "Export PDF", size: "small", onClick: handleExportReadPDF })),
8768
- isActivityLog && (react_1.default.createElement(button_1.Button, { type: "light", text: "Log", size: "small", onClick: function () { return setActivityModal(true); } })),
8848
+ showLog && (react_1.default.createElement(button_1.Button, { type: "light", text: "Log", size: "small", onClick: function () { return setActivityModal(true); } })),
8769
8849
  hasCustomActions && bareActionComponent,
8770
8850
  showUpdate &&
8771
8851
  (hasNavigation ? (react_1.default.createElement(button_1.Button, { id: "dtw-update", text: "Update", type: "normal", size: "small", onClick: function () {
@@ -8780,7 +8860,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8780
8860
  // under the form. Its header row keeps only Delete, a destructive action that
8781
8861
  // should not sit at the end of a "continue, continue" flow.
8782
8862
  var renderActionButtons = function (type, _hasTabAlign, _uniqueTabIds) {
8783
- var _a, _b, _c, _d, _e, _f;
8863
+ var _a, _b, _c, _d, _e, _f, _g;
8784
8864
  var bareActionComponent = (_c = (_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionComponent) === null || _b === void 0 ? void 0 : _b.call(_a, selectedData, formRef, handleResolveRawData())) !== null && _c !== void 0 ? _c : undefined;
8785
8865
  // INFO: every update form carries Save / Submit in the floating bar, so
8786
8866
  // the header keeps only Delete
@@ -8814,8 +8894,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8814
8894
  }
8815
8895
  else if (type === "list") {
8816
8896
  var listActionBtns = [];
8817
- if (isActivityLog) {
8818
- listActionBtns.push(react_1.default.createElement(iconButton_1.IconButton, { icon: react_1.default.createElement(HeroIcons.ClockIcon, { className: "h-7 w-7 text-white" }), onClick: function () {
8897
+ if (isActivityLog && !((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareHideCollectionActivity)) {
8898
+ listActionBtns.push(react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-collection-activity", icon: react_1.default.createElement(HeroIcons.ClockIcon, { className: "h-7 w-7 text-white" }), onClick: function () {
8819
8899
  setActivityId("");
8820
8900
  setActivityModal(true);
8821
8901
  }, background: "bg-primary-500 hover:bg-primary-600" }));
@@ -8823,7 +8903,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8823
8903
  if (bareActionComponent) {
8824
8904
  listActionBtns.push(bareActionComponent);
8825
8905
  }
8826
- else if (((_e = props.edit) === null || _e === void 0 ? void 0 : _e.allEditable) || ((_f = props.edit) === null || _f === void 0 ? void 0 : _f.createBtn)) {
8906
+ else if (((_f = props.edit) === null || _f === void 0 ? void 0 : _f.allEditable) || ((_g = props.edit) === null || _g === void 0 ? void 0 : _g.createBtn)) {
8827
8907
  listActionBtns.push(react_1.default.createElement(react_1.default.Fragment, null,
8828
8908
  hasNavigation ? (react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-create", icon: react_1.default.createElement(outline_1.PlusIcon, { className: "h-7 w-7 text-white" }), background: "bg-primary-500 hover:bg-primary-600", onClick: function () {
8829
8909
  var _a, _b;
@@ -9037,7 +9117,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9037
9117
  handleNavigateFromDrawer("list", "");
9038
9118
  } }))); } })); };
9039
9119
  var renderContent = function () {
9040
- 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;
9120
+ 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;
9041
9121
  var isBottom = ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom) ? true : false;
9042
9122
  var tabs = renderTabs();
9043
9123
  var pages = [
@@ -9084,16 +9164,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9084
9164
  renderBareReadComp(),
9085
9165
  ((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareUpdateActionTop) &&
9086
9166
  !selectedRelated &&
9167
+ !isActivityOnly &&
9087
9168
  renderReadBar(),
9088
9169
  (anyAuthMethod ||
9089
9170
  (authLoading && ((_o = props.space) === null || _o === void 0 ? void 0 : _o.authDatabase))) && (react_1.default.createElement("div", { className: "bg-primary-100 text-gray-700 mt-3 px-5 py-3 rounded" }, authLoading ? (react_1.default.createElement("div", { className: "flex justify-center py-1", "data-testid": "dtw-auth-loading" },
9090
9171
  react_1.default.createElement(loading_1.Loading, { sizeClassName: "h-6 w-6" }))) : (renderAuthContent()))),
9091
- react_1.default.createElement("div", { ref: exportReadPDFRef },
9092
- selectedRelated ? (react_1.default.createElement(relatedRecords_1.RelatedRecords, { key: "".concat(props.id, "-").concat(selectedRelated.id), source: selectedRelated.source, recordId: (_p = props.id) !== null && _p !== void 0 ? _p : "", renderList: renderRelatedList })) : (!((_q = props.bareSettings) === null || _q === void 0 ? void 0 : _q.bareReadComponentHide) && (react_1.default.createElement("div", null, renderTabContent(tabs, resolvedType, viewType)))),
9093
- ((_r = props.bareSettings) === null || _r === void 0 ? void 0 : _r.bareReadComponentPos) !== "top" &&
9094
- renderBareReadComp()),
9095
- !((_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareUpdateActionTop) &&
9172
+ isActivityOnly && !selectedRelated ? (react_1.default.createElement("div", { "data-testid": "dt-activity-inline", className: "mt-4" }, renderActivityPanel((_p = props.id) !== null && _p !== void 0 ? _p : ""))) : (react_1.default.createElement("div", { ref: exportReadPDFRef },
9173
+ selectedRelated ? (react_1.default.createElement(relatedRecords_1.RelatedRecords, { key: "".concat(props.id, "-").concat(selectedRelated.id), source: selectedRelated.source, recordId: (_q = props.id) !== null && _q !== void 0 ? _q : "", renderList: renderRelatedList })) : (!((_r = props.bareSettings) === null || _r === void 0 ? void 0 : _r.bareReadComponentHide) && (react_1.default.createElement("div", null, renderTabContent(tabs, resolvedType, viewType)))),
9174
+ ((_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareReadComponentPos) !== "top" &&
9175
+ renderBareReadComp())),
9176
+ !((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareUpdateActionTop) &&
9096
9177
  !selectedRelated &&
9178
+ !isActivityOnly &&
9097
9179
  renderReadBar()))));
9098
9180
  case "update":
9099
9181
  if (props.id !== "new") {
@@ -9104,12 +9186,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9104
9186
  });
9105
9187
  }
9106
9188
  pages.push({
9107
- name: (_v = selectedData === null || selectedData === void 0 ? void 0 : selectedData[(_u = (_t = props.organise) === null || _t === void 0 ? void 0 : _t.breadcrumbAttributeId) !== null && _u !== void 0 ? _u : serverId]) !== null && _v !== void 0 ? _v : (props.id ? props.id : "new"),
9189
+ name: (_w = selectedData === null || selectedData === void 0 ? void 0 : selectedData[(_v = (_u = props.organise) === null || _u === void 0 ? void 0 : _u.breadcrumbAttributeId) !== null && _v !== void 0 ? _v : serverId]) !== null && _w !== void 0 ? _w : (props.id ? props.id : "new"),
9108
9190
  href: "#",
9109
9191
  current: true,
9110
9192
  });
9111
9193
  var filterModel_1 = [];
9112
- var disabledOnEnter_1 = (_x = (_w = props.organise) === null || _w === void 0 ? void 0 : _w.disabledOnEnter) !== null && _x !== void 0 ? _x : false;
9194
+ var disabledOnEnter_1 = (_y = (_x = props.organise) === null || _x === void 0 ? void 0 : _x.disabledOnEnter) !== null && _y !== void 0 ? _y : false;
9113
9195
  structure.map(function (eachModel) {
9114
9196
  var _a;
9115
9197
  var present = false;
@@ -9222,12 +9304,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9222
9304
  }
9223
9305
  }
9224
9306
  };
9225
- var hasTabAlign_1 = ((_y = props.organise) === null || _y === void 0 ? void 0 : _y.tabAlign) || ((_z = props.space) === null || _z === void 0 ? void 0 : _z.tabAlign);
9226
- var leftTabAlign = ((_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.tabAlign) === "left" ||
9227
- ((_1 = props.space) === null || _1 === void 0 ? void 0 : _1.tabAlign) === "left";
9228
- var topTabAlign = ((_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.tabAlign) === "top" || ((_3 = props.space) === null || _3 === void 0 ? void 0 : _3.tabAlign) === "top";
9229
- var stepperTabAlign = ((_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.tabAlign) === "stepper" ||
9230
- ((_5 = props.space) === null || _5 === void 0 ? void 0 : _5.tabAlign) === "stepper";
9307
+ var hasTabAlign_1 = ((_z = props.organise) === null || _z === void 0 ? void 0 : _z.tabAlign) || ((_0 = props.space) === null || _0 === void 0 ? void 0 : _0.tabAlign);
9308
+ var leftTabAlign = ((_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.tabAlign) === "left" ||
9309
+ ((_2 = props.space) === null || _2 === void 0 ? void 0 : _2.tabAlign) === "left";
9310
+ var topTabAlign = ((_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.tabAlign) === "top" || ((_4 = props.space) === null || _4 === void 0 ? void 0 : _4.tabAlign) === "top";
9311
+ var stepperTabAlign = ((_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.tabAlign) === "stepper" ||
9312
+ ((_6 = props.space) === null || _6 === void 0 ? void 0 : _6.tabAlign) === "stepper";
9231
9313
  var uniqueTabIds_2 = Array.from(new Set(filterModel_1
9232
9314
  .map(function (item) { return item.tabId; })
9233
9315
  .filter(function (id) { return id !== undefined; })));
@@ -9236,7 +9318,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9236
9318
  if (shouldIncludeOthers) {
9237
9319
  uniqueTabIds_2.push("");
9238
9320
  }
9239
- var customTabComponent_1 = (_8 = (_7 = (_6 = props.bareSettings) === null || _6 === void 0 ? void 0 : _6.bareUpdateTabComponent) === null || _7 === void 0 ? void 0 : _7.call(_6, uniqueTabIds_2)) !== null && _8 !== void 0 ? _8 : [];
9321
+ var customTabComponent_1 = (_9 = (_8 = (_7 = props.bareSettings) === null || _7 === void 0 ? void 0 : _7.bareUpdateTabComponent) === null || _8 === void 0 ? void 0 : _8.call(_7, uniqueTabIds_2)) !== null && _9 !== void 0 ? _9 : [];
9240
9322
  var stepperSteps = uniqueTabIds_2.map(function (eachTabId) {
9241
9323
  var _a, _b;
9242
9324
  var customTabMatch = customTabComponent_1.find(function (eachTab) { return eachTab.tabId === eachTabId; });
@@ -9272,7 +9354,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9272
9354
  props.id && props.id !== "new" && structure.length >= 1 && (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: readQueryHocRef, database: {
9273
9355
  dbModule: dbModule,
9274
9356
  dbType: devSettings.server,
9275
- dbCollection: (_10 = (_9 = props === null || props === void 0 ? void 0 : props.space) === null || _9 === void 0 ? void 0 : _9.pipelineDefaultSpaceId) !== null && _10 !== void 0 ? _10 : props.collectionId,
9357
+ dbCollection: (_11 = (_10 = props === null || props === void 0 ? void 0 : props.space) === null || _10 === void 0 ? void 0 : _10.pipelineDefaultSpaceId) !== null && _11 !== void 0 ? _11 : props.collectionId,
9276
9358
  dbEndpoint: devSettings.dbEndpoint,
9277
9359
  dbAPIToken: devSettings.dbAPIToken,
9278
9360
  dbUserToken: devSettings.dbUserToken,
@@ -9280,11 +9362,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9280
9362
  type: "get",
9281
9363
  id: props.id,
9282
9364
  pipeline: pipeline,
9283
- }, offline: ((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareOffline) && isNetworkOffline, onChangeData: handleRetrieveSelectedData, onError: handleGetItemError })),
9365
+ }, offline: ((_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareOffline) && isNetworkOffline, onChangeData: handleRetrieveSelectedData, onError: handleGetItemError })),
9284
9366
  renderBreadcrumb(pages),
9285
9367
  react_1.default.createElement("div", { className: "flex flex-col py-2 sm:items-center sm:flex-row" },
9286
9368
  (props.title || props.description) && (react_1.default.createElement("div", { className: "flex flex-col w-full" },
9287
- props.title && (react_1.default.createElement("p", { className: "text-xl font-medium ".concat(((_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.darkMode) ? "text-white" : "") }, props.title)),
9369
+ props.title && (react_1.default.createElement("p", { className: "text-xl font-medium ".concat(((_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.darkMode) ? "text-white" : "") }, props.title)),
9288
9370
  props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
9289
9371
  (!isBottom || hasTabAlign_1 || resolvedType === "update") &&
9290
9372
  renderActionButtons(resolvedType, hasTabAlign_1, uniqueTabIds_2)),
@@ -9303,10 +9385,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9303
9385
  var tabId = uniqueTabIds_2[stepIndex];
9304
9386
  handleUpdateTabId(tabId);
9305
9387
  } })),
9306
- ((_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareUpdateComponentAbove) &&
9307
- ((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareUpdateComponent) &&
9308
- ((_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareUpdateComponent(selectedData, handleResolveRawData())),
9309
- ((_16 = props.bareSettings) === null || _16 === void 0 ? void 0 : _16.bareUpdateActionTop) &&
9388
+ ((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareUpdateComponentAbove) &&
9389
+ ((_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareUpdateComponent) &&
9390
+ ((_16 = props.bareSettings) === null || _16 === void 0 ? void 0 : _16.bareUpdateComponent(selectedData, handleResolveRawData())),
9391
+ ((_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareUpdateActionTop) &&
9310
9392
  renderStepBar(uniqueTabIds_2),
9311
9393
  react_1.default.createElement(form_1.Form, { className: "mt-6", ref: formRef, refList: __spreadArray(__spreadArray([], modalFormInputRefs, true), flexTableRefs, true), handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: handleOnFailValidation },
9312
9394
  uniqueTabIds_2.map(function (tabId) {
@@ -9328,8 +9410,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9328
9410
  ((_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.tabDescriptions) === null || _c === void 0 ? void 0 : _c[tabId]) && (react_1.default.createElement("p", { className: "text-sm mt-0.5 ".concat(((_d = props.organise) === null || _d === void 0 ? void 0 : _d.darkMode) ? "text-gray-400" : "text-gray-500") }, props.organise.tabDescriptions[tabId])))),
9329
9411
  renderDataTemplateFormContent(selectedData, filterByTab, modalFormInputRefs, false, false, undefined, undefined)));
9330
9412
  }),
9331
- !((_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareUpdateComponentAbove) &&
9332
- ((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareUpdateComponent) && (
9413
+ !((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareUpdateComponentAbove) &&
9414
+ ((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareUpdateComponent) && (
9333
9415
  // INFO: the form is a grid-cols-12. A child with no column span is one
9334
9416
  // column, and a grid item cannot shrink below its longest word, so on a
9335
9417
  // phone it wraps one word per line. `contents` takes this wrapper out of
@@ -9339,20 +9421,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9339
9421
  react_1.default.createElement("div", { className: "contents [&>*:not([class*=col-span])]:col-span-12" }, props.bareSettings.bareUpdateComponent(selectedData, handleResolveRawData())))),
9340
9422
  react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(resolvedType)),
9341
9423
  react_1.default.createElement("div", { className: "mt-8" }, renderListObject(resolvedType)),
9342
- !((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareUpdateActionTop) &&
9424
+ !((_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareUpdateActionTop) &&
9343
9425
  renderStepBar(uniqueTabIds_2),
9344
9426
  isBottom &&
9345
9427
  resolvedType !== "update" &&
9346
9428
  renderActionButtons(resolvedType, hasTabAlign_1, uniqueTabIds_2)))) : (react_1.default.createElement("div", null,
9347
- ((_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareUpdateComponentAbove) &&
9348
- ((_21 = props.bareSettings) === null || _21 === void 0 ? void 0 : _21.bareUpdateComponent) &&
9349
- ((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareUpdateComponent(selectedData, handleResolveRawData())),
9350
- ((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareUpdateActionTop) &&
9429
+ ((_21 = props.bareSettings) === null || _21 === void 0 ? void 0 : _21.bareUpdateComponentAbove) &&
9430
+ ((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareUpdateComponent) &&
9431
+ ((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareUpdateComponent(selectedData, handleResolveRawData())),
9432
+ ((_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareUpdateActionTop) &&
9351
9433
  renderStepBar(uniqueTabIds_2),
9352
9434
  react_1.default.createElement(form_1.Form, { className: "grid ".concat(formColumn, " ").concat(gridGap, " mt-6"), ref: formRef, refList: __spreadArray(__spreadArray([], modalFormInputRefs, true), flexTableRefs, true), handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: handleOnFailValidation },
9353
9435
  renderDataTemplateFormContent(selectedData, filterModel_1, modalFormInputRefs, false, false),
9354
- !((_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareUpdateComponentAbove) &&
9355
- ((_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareUpdateComponent) && (
9436
+ !((_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareUpdateComponentAbove) &&
9437
+ ((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareUpdateComponent) && (
9356
9438
  // INFO: the form is a grid-cols-12. A child with no column span is one
9357
9439
  // column, and a grid item cannot shrink below its longest word, so on a
9358
9440
  // phone it wraps one word per line. `contents` takes this wrapper out of
@@ -9362,7 +9444,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9362
9444
  react_1.default.createElement("div", { className: "contents [&>*:not([class*=col-span])]:col-span-12" }, props.bareSettings.bareUpdateComponent(selectedData, handleResolveRawData())))),
9363
9445
  react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(resolvedType)),
9364
9446
  react_1.default.createElement("div", { className: "mt-8" }, renderListObject(resolvedType)),
9365
- !((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareUpdateActionTop) &&
9447
+ !((_27 = props.bareSettings) === null || _27 === void 0 ? void 0 : _27.bareUpdateActionTop) &&
9366
9448
  renderStepBar(uniqueTabIds_2)))));
9367
9449
  case "list":
9368
9450
  case "union":
@@ -9373,27 +9455,27 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9373
9455
  // Counts query output so the badge matches what's actually filtered.
9374
9456
  // INFO: one per filter row that filters — several rows on one related
9375
9457
  // datasheet send one condition, and a list count can send two
9376
- var activeFlexFilterCount_1 = ((_27 = props.bareSettings) === null || _27 === void 0 ? void 0 : _27.bareFlexFilters)
9458
+ var activeFlexFilterCount_1 = ((_28 = props.bareSettings) === null || _28 === void 0 ? void 0 : _28.bareFlexFilters)
9377
9459
  ? flexFilters.filter(function (eachFilter) {
9378
9460
  return (0, flexFilter_1.isFlexFilterActive)(eachFilter, structure, flexFilterExtras);
9379
9461
  }).length
9380
9462
  : 0;
9381
9463
  // INFO: without the floating bar these buttons would have nowhere to
9382
9464
  // go, so a hidden search keeps the normal header
9383
- var isMobileToolbar_1 = !!((_28 = props.bareSettings) === null || _28 === void 0 ? void 0 : _28.bareListMobileToolbar) &&
9384
- !!((_29 = props.bareSettings) === null || _29 === void 0 ? void 0 : _29.bareListMobileFloatingSearch) &&
9385
- !((_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.hideSearch);
9465
+ var isMobileToolbar_1 = !!((_29 = props.bareSettings) === null || _29 === void 0 ? void 0 : _29.bareListMobileToolbar) &&
9466
+ !!((_30 = props.bareSettings) === null || _30 === void 0 ? void 0 : _30.bareListMobileFloatingSearch) &&
9467
+ !((_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.hideSearch);
9386
9468
  var listReadQueryHOC = (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: listRQueryHocRef, database: {
9387
9469
  dbModule: dbModule,
9388
9470
  dbType: devSettings.server,
9389
- dbCollection: (_32 = (_31 = props === null || props === void 0 ? void 0 : props.space) === null || _31 === void 0 ? void 0 : _31.pipelineDefaultSpaceId) !== null && _32 !== void 0 ? _32 : props.collectionId,
9471
+ dbCollection: (_33 = (_32 = props === null || props === void 0 ? void 0 : props.space) === null || _32 === void 0 ? void 0 : _32.pipelineDefaultSpaceId) !== null && _33 !== void 0 ? _33 : props.collectionId,
9390
9472
  dbEndpoint: devSettings.dbEndpoint,
9391
9473
  dbAPIToken: devSettings.dbAPIToken,
9392
9474
  dbUserToken: devSettings.dbUserToken,
9393
- }, cond: handleReadQueryHocCond(), offline: ((_33 = props.bareSettings) === null || _33 === void 0 ? void 0 : _33.bareOffline) && isNetworkOffline, onChangeData: function (data, cond) {
9475
+ }, cond: handleReadQueryHocCond(), offline: ((_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareOffline) && isNetworkOffline, onChangeData: function (data, cond) {
9394
9476
  handleGetListData(data, "", "", cond);
9395
9477
  }, onError: handleGetItemError }));
9396
- if ((_34 = props.renderSettings) === null || _34 === void 0 ? void 0 : _34.renderListUI) {
9478
+ if ((_35 = props.renderSettings) === null || _35 === void 0 ? void 0 : _35.renderListUI) {
9397
9479
  return (react_1.default.createElement(react_1.default.Fragment, null,
9398
9480
  listReadQueryHOC,
9399
9481
  props.renderSettings.renderListUI(actionComponent, filterComponent_1, dataComponent)));
@@ -9607,47 +9689,47 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9607
9689
  listReadQueryHOC,
9608
9690
  react_1.default.createElement("div", { className: "flex py-2 ".concat(isMobileToolbar_1
9609
9691
  ? "w-full flex-row items-center md:items-end"
9610
- : ((_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareCompactMode)
9692
+ : ((_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareCompactMode)
9611
9693
  ? // INFO: the grow spacer is hidden on phones (search lives in
9612
9694
  // the floating bar), so the row itself pushes the actions right
9613
9695
  "w-full flex-row flex-wrap sm:flex-nowrap items-end justify-between sm:justify-start"
9614
9696
  : "flex-col md:items-end md:flex-row") },
9615
9697
  (props.title || props.description) && (react_1.default.createElement("div", { className: "flex min-w-0 flex-col" },
9616
9698
  props.title && (react_1.default.createElement("div", { className: "flex min-w-0 items-center gap-2" },
9617
- react_1.default.createElement("p", { className: "text-xl font-medium ".concat(isMobileToolbar_1 ? "truncate md:whitespace-normal" : "", " ").concat(((_36 = props.organise) === null || _36 === void 0 ? void 0 : _36.darkMode) ? "text-white" : "") }, props.title),
9618
- ((_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareSocketName) &&
9699
+ react_1.default.createElement("p", { className: "text-xl font-medium ".concat(isMobileToolbar_1 ? "truncate md:whitespace-normal" : "", " ").concat(((_37 = props.organise) === null || _37 === void 0 ? void 0 : _37.darkMode) ? "text-white" : "") }, props.title),
9700
+ ((_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareSocketName) &&
9619
9701
  isLive &&
9620
9702
  !isLiveOffline && (react_1.default.createElement("span", { className: "inline-flex items-center gap-1 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-700" },
9621
9703
  react_1.default.createElement("span", { className: "h-1.5 w-1.5 rounded-full bg-green-500" }),
9622
9704
  "LIVE")),
9623
- ((_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareSocketName) && isLiveOffline && (react_1.default.createElement("span", { className: "inline-flex items-center gap-1 rounded-full bg-orange-100 px-2 py-0.5 text-xs font-medium text-orange-700" },
9705
+ ((_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareSocketName) && isLiveOffline && (react_1.default.createElement("span", { className: "inline-flex items-center gap-1 rounded-full bg-orange-100 px-2 py-0.5 text-xs font-medium text-orange-700" },
9624
9706
  react_1.default.createElement("span", { className: "h-1.5 w-1.5 rounded-full bg-orange-400" }),
9625
9707
  "OFFLINE")))),
9626
9708
  props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500 ".concat(isMobileToolbar_1 ? "truncate md:whitespace-normal" : "") }, props.description)))),
9627
- react_1.default.createElement("div", { className: ((_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareCompactMode)
9709
+ react_1.default.createElement("div", { className: ((_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.bareCompactMode)
9628
9710
  ? "hidden sm:block grow"
9629
9711
  : "grow" }),
9630
9712
  react_1.default.createElement("div", { className: "ml-auto flex flex-row items-end ".concat(isMobileToolbar_1 ? "shrink-0" : "") },
9631
9713
  renderListFilterElements(),
9632
9714
  renderListActionElements())),
9633
9715
  renderListNewRowFilterElements(),
9634
- (schemaPresent || ((_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.bareReadListTabs)) && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.darkMode })),
9716
+ (schemaPresent || ((_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.bareReadListTabs)) && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.darkMode })),
9635
9717
  renderScopedTabContent(tabs, resolvedType, viewType),
9636
- ((_42 = props.bareSettings) === null || _42 === void 0 ? void 0 : _42.bareListMobileFloatingSearch) && (react_1.default.createElement("div", { className: "h-28 md:hidden", "aria-hidden": "true" })),
9637
- ((_43 = props.bareSettings) === null || _43 === void 0 ? void 0 : _43.bareListMobileFloatingSearch) &&
9718
+ ((_43 = props.bareSettings) === null || _43 === void 0 ? void 0 : _43.bareListMobileFloatingSearch) && (react_1.default.createElement("div", { className: "h-28 md:hidden", "aria-hidden": "true" })),
9719
+ ((_44 = props.bareSettings) === null || _44 === void 0 ? void 0 : _44.bareListMobileFloatingSearch) &&
9638
9720
  (0, listModule_1.renderFloatingMobileSearch)({
9639
9721
  filterSearch: filterSearch,
9640
9722
  handleNameSearch: handleNameSearch,
9641
9723
  onFilterClick: function () { return setFlexFilterModalOpen(true); },
9642
- hideSearch: (_44 = props.organise) === null || _44 === void 0 ? void 0 : _44.hideSearch,
9643
- darkMode: (_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.darkMode,
9644
- floatingOffset: (_46 = props.bareSettings) === null || _46 === void 0 ? void 0 : _46.bareListFloatingActionOffset,
9645
- hideFilter: !((_47 = props.bareSettings) === null || _47 === void 0 ? void 0 : _47.bareFlexFilters),
9646
- activeFilterCount: ((_48 = props.bareSettings) === null || _48 === void 0 ? void 0 : _48.bareFlexFilters)
9724
+ hideSearch: (_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.hideSearch,
9725
+ darkMode: (_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.darkMode,
9726
+ floatingOffset: (_47 = props.bareSettings) === null || _47 === void 0 ? void 0 : _47.bareListFloatingActionOffset,
9727
+ hideFilter: !((_48 = props.bareSettings) === null || _48 === void 0 ? void 0 : _48.bareFlexFilters),
9728
+ activeFilterCount: ((_49 = props.bareSettings) === null || _49 === void 0 ? void 0 : _49.bareFlexFilters)
9647
9729
  ? activeFlexFilterCount_1
9648
9730
  : undefined,
9649
9731
  // INFO: Hides when items are selected so NewTable's multi-action bar takes over.
9650
- hidden: selectAll || ((_49 = selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.length) !== null && _49 !== void 0 ? _49 : 0) > 0,
9732
+ hidden: selectAll || ((_50 = selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.length) !== null && _50 !== void 0 ? _50 : 0) > 0,
9651
9733
  onRefreshClick: isMobileToolbar_1 && schemaPresent
9652
9734
  ? function () { return handleRefresh(); }
9653
9735
  : undefined,
@@ -10216,20 +10298,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10216
10298
  // of its own, and a picked row opens in place instead of navigating away, so
10217
10299
  // this record's tabs stay put.
10218
10300
  var renderRelatedList = function (source, query, openId, onOpen) {
10219
- var _a, _b, _c, _d;
10220
- return (react_1.default.createElement(exports.DataTemplate, { title: "", description: "", type: openId ? "read" : "list", id: openId, collectionId: source.collectionId, model: source.schema, localURLEndpoint: props.localURLEndpoint, devSettings: __assign(__assign({}, props.devSettings), { schemaEndpoint: "" }), lib: props.lib, organise: {
10221
- darkMode: (_a = props.organise) === null || _a === void 0 ? void 0 : _a.darkMode,
10222
- darkModeBg: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.darkModeBg,
10301
+ var _a, _b, _c, _d, _e, _f, _g, _h;
10302
+ return (react_1.default.createElement(exports.DataTemplate, { title: "", description: "", type: openId ? "read" : "list", id: openId, collectionId: source.collectionId, model: source.schema, localURLEndpoint: props.localURLEndpoint, devSettings: __assign(__assign({}, props.devSettings), { schemaEndpoint: "" }), lib: props.lib,
10303
+ // INFO: comments and logs only — the edit, delete and inline-edit
10304
+ // switches are this record's sheet's, not the related sheet's, so they
10305
+ // stay off and the related rows stay read-only
10306
+ edit: ((_a = props.edit) === null || _a === void 0 ? void 0 : _a.activityLog)
10307
+ ? { activityLog: props.edit.activityLog }
10308
+ : undefined, organise: {
10309
+ darkMode: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.darkMode,
10310
+ darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg,
10223
10311
  breadcrumbType: "hidden",
10224
10312
  handleNavigate: function (type, selectedId) {
10225
10313
  return onOpen(type === "read" && selectedId ? selectedId : "");
10226
10314
  },
10315
+ // INFO: asked with the related collection's id, so a host counts the
10316
+ // comments on these rows rather than on its own sheet's
10317
+ onFetchCommentCounts: ((_d = props.edit) === null || _d === void 0 ? void 0 : _d.activityLog)
10318
+ ? (_e = props.organise) === null || _e === void 0 ? void 0 : _e.onFetchCommentCounts
10319
+ : undefined,
10227
10320
  }, bareSettings: {
10228
10321
  bareListFilterQuery: query,
10229
- bareNewDTW: (_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareNewDTW,
10322
+ bareNewDTW: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareNewDTW,
10230
10323
  // INFO: the related list sits inside this record, so it takes the
10231
10324
  // record's layout rather than the full one
10232
- bareCompactMode: (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareCompactMode,
10325
+ bareCompactMode: (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareCompactMode,
10326
+ // INFO: drawn like the table it was opened from, so the record's own
10327
+ // list and its related tabs read as one
10328
+ bareListGridLines: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareListGridLines,
10329
+ bareHideCollectionActivity: true,
10330
+ // INFO: a row's comment button opens its comments and logs alone in
10331
+ // this tab, not in a second drawer over the read drawer
10332
+ bareInlineActivity: true,
10233
10333
  } }));
10234
10334
  };
10235
10335
  var renderAddMathColumn = function (id, onClose) {
@@ -10256,7 +10356,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10256
10356
  handleCheckLookupGroupBy())
10257
10357
  return undefined;
10258
10358
  var isGroupPaging = renderCheckGroupPaging();
10259
- var sections = (0, groupSections_1.handleBuildGroupSections)({
10359
+ // INFO: the grouped count is on its way, so a band without its total yet
10360
+ // waits for it instead of counting the rows of the first page
10361
+ var isCountPending = groupTotals === null &&
10362
+ !groupTotalsFailed &&
10363
+ handleCheckGroupCountNeeded() &&
10364
+ handleCheckGroupAggregatable();
10365
+ var countedSections = (0, groupSections_1.handleBuildGroupSections)({
10260
10366
  column: handleGetGroupColumn(),
10261
10367
  // INFO: key off the raw row — the display row holds a Tag element for a
10262
10368
  // coloured list value
@@ -10285,6 +10391,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10285
10391
  ? Math.max(groupTotals[eachSection.id], eachSection.rowIds.length)
10286
10392
  : undefined }));
10287
10393
  });
10394
+ var sections = countedSections.map(function (eachSection) { return (__assign(__assign({}, eachSection), { countPending: eachSection.count === undefined && isCountPending })); });
10288
10395
  // INFO: a section whose own query came back empty has nothing to show
10289
10396
  var shownSections = isGroupPaging
10290
10397
  ? sections.filter(function (eachGroup) {
@@ -10349,6 +10456,25 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10349
10456
  })
10350
10457
  .map(function (eachColumn) { return eachColumn.id; });
10351
10458
  };
10459
+ // INFO: whether the database can sum and count the groups of this list
10460
+ var handleCheckGroupAggregatable = function () {
10461
+ var _a, _b, _c;
10462
+ return !!handleGetGroupColumn() &&
10463
+ !!isDatasheetDefaults &&
10464
+ !!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW) &&
10465
+ !isFirebase &&
10466
+ // INFO: a formula filter is applied here, not on the server, so the
10467
+ // server's sums would include rows it hides; a union list cannot take
10468
+ // an aggregate
10469
+ !isFormulaView &&
10470
+ !((_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.unionCollections) === null || _c === void 0 ? void 0 : _c.length);
10471
+ };
10472
+ // INFO: in page mode every band reads its first page at once and takes
10473
+ // its total from that; a band paged by scroll is read only once it comes
10474
+ // into view, so until then its total comes from the grouped count
10475
+ var handleCheckGroupCountNeeded = function () {
10476
+ return !renderCheckGroupPaging() || renderCheckScrollMode();
10477
+ };
10352
10478
  /**
10353
10479
  * INFO: each group's total per number column over every row the filters
10354
10480
  * match — the database sums them, one request per column, as a chart's
@@ -10358,23 +10484,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10358
10484
  */
10359
10485
  var handleFetchGroupSummaries = function () { return __awaiter(void 0, void 0, void 0, function () {
10360
10486
  var column, requestId, sumIds, isCountNeeded, query, range, _a, results, countResult, options_1, totals_1, sums_1, _b;
10361
- var _c, _d, _e, _f;
10362
- return __generator(this, function (_g) {
10363
- switch (_g.label) {
10487
+ var _c;
10488
+ return __generator(this, function (_d) {
10489
+ switch (_d.label) {
10364
10490
  case 0:
10365
10491
  column = handleGetGroupColumn();
10366
10492
  requestId = ++groupSummaryRequestRef.current;
10367
10493
  sumIds = handleGetGroupSumIds();
10368
- isCountNeeded = !renderCheckGroupPaging() || renderCheckScrollMode();
10494
+ isCountNeeded = handleCheckGroupCountNeeded();
10369
10495
  if (!column ||
10370
- !isDatasheetDefaults ||
10371
- !((_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareNewDTW) ||
10372
- isFirebase ||
10373
- // INFO: a formula filter is applied here, not on the server, so the
10374
- // server's sums would include rows it hides; a union list cannot take
10375
- // an aggregate
10376
- isFormulaView ||
10377
- !!((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.unionCollections) === null || _e === void 0 ? void 0 : _e.length) ||
10496
+ !handleCheckGroupAggregatable() ||
10378
10497
  (sumIds.length === 0 && !isCountNeeded)) {
10379
10498
  setGroupSummaries(function (previous) {
10380
10499
  return Object.keys(previous).length > 0 ? {} : previous;
@@ -10382,11 +10501,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10382
10501
  setGroupTotals(null);
10383
10502
  return [2 /*return*/];
10384
10503
  }
10385
- query = (_f = renderImpSearchFilterConditions()) !== null && _f !== void 0 ? _f : [];
10504
+ setGroupTotalsFailed(false);
10505
+ query = (_c = renderImpSearchFilterConditions()) !== null && _c !== void 0 ? _c : [];
10386
10506
  range = [(0, dayjs_1.default)().add(1, "day").format("DD/MM/YYYY HH:mm:ss")];
10387
- _g.label = 1;
10507
+ _d.label = 1;
10388
10508
  case 1:
10389
- _g.trys.push([1, 3, , 4]);
10509
+ _d.trys.push([1, 3, , 4]);
10390
10510
  return [4 /*yield*/, Promise.all([
10391
10511
  Promise.all(sumIds.map(function (eachId) {
10392
10512
  return readServerQuery.call({
@@ -10416,7 +10536,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10416
10536
  : undefined,
10417
10537
  ])];
10418
10538
  case 2:
10419
- _a = _g.sent(), results = _a[0], countResult = _a[1];
10539
+ _a = _d.sent(), results = _a[0], countResult = _a[1];
10420
10540
  if (requestId !== groupSummaryRequestRef.current)
10421
10541
  return [2 /*return*/];
10422
10542
  options_1 = handleGetGroupColumnOptions();
@@ -10440,10 +10560,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
10440
10560
  setGroupTotals(countResult ? totals_1 : null);
10441
10561
  return [3 /*break*/, 4];
10442
10562
  case 3:
10443
- _b = _g.sent();
10563
+ _b = _d.sent();
10444
10564
  if (requestId === groupSummaryRequestRef.current) {
10445
10565
  setGroupSummaries({});
10446
10566
  setGroupTotals(null);
10567
+ setGroupTotalsFailed(true);
10447
10568
  }
10448
10569
  return [3 /*break*/, 4];
10449
10570
  case 4: return [2 /*return*/];
@@ -12630,14 +12751,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12630
12751
  };
12631
12752
  return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
12632
12753
  renderNotification("root"),
12633
- ((_107 = (_106 = props.renderSettings) === null || _106 === void 0 ? void 0 : _106.renderLoadingUI) === null || _107 === void 0 ? void 0 : _107.call(_106)) && loading ? ((_108 = props.renderSettings) === null || _108 === void 0 ? void 0 : _108.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.darkMode, darkModeBg: (_110 = props.organise) === null || _110 === void 0 ? void 0 : _110.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
12754
+ ((_108 = (_107 = props.renderSettings) === null || _107 === void 0 ? void 0 : _107.renderLoadingUI) === null || _108 === void 0 ? void 0 : _108.call(_107)) && loading ? ((_109 = props.renderSettings) === null || _109 === void 0 ? void 0 : _109.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_110 = props.organise) === null || _110 === void 0 ? void 0 : _110.darkMode, darkModeBg: (_111 = props.organise) === null || _111 === void 0 ? void 0 : _111.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
12634
12755
  var _a, _b;
12635
12756
  if (loading)
12636
12757
  return;
12637
12758
  handlePopUpModal(false);
12638
12759
  setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
12639
12760
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
12640
- 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: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
12761
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_112 = props.organise) === null || _112 === void 0 ? void 0 : _112.darkMode, darkModeBg: (_113 = props.organise) === null || _113 === void 0 ? void 0 : _113.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
12641
12762
  return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
12642
12763
  if (dataId) {
12643
12764
  var currentValue = selectedData[referenceCreationModal.id];
@@ -12653,19 +12774,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12653
12774
  }, onClose: function () {
12654
12775
  setReferenceCreationModal({ id: "", name: "", type: "string" });
12655
12776
  } }),
12656
- 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: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
12777
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_114 = props.organise) === null || _114 === void 0 ? void 0 : _114.darkMode, darkModeBg: (_115 = props.organise) === null || _115 === void 0 ? void 0 : _115.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
12657
12778
  setReferenceDeleteTableData({});
12658
12779
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
12659
- 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, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
12780
+ 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, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
12660
12781
  setDeletePasscodeInput("");
12661
12782
  setDeleteModal(!deleteModal);
12662
12783
  setDeleteFeedId("");
12663
12784
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
12664
- 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: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
12785
+ 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, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
12665
12786
  setBatchUpdateData({ columnId: "", columnData: {} });
12666
12787
  setBatchUpdateModal(false);
12667
12788
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
12668
- 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, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
12789
+ 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, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
12669
12790
  var _a, _b;
12670
12791
  if (props.space)
12671
12792
  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 }));
@@ -12677,22 +12798,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12677
12798
  renderReadDrawer(),
12678
12799
  canHostDrawer && renderDrawerDiscardModal(),
12679
12800
  isActivityLog &&
12801
+ !isInlineActivity &&
12680
12802
  typeof document !== "undefined" &&
12681
12803
  (0, react_dom_1.createPortal)(
12682
12804
  // INFO: z-50 lifts it over a Modal the table may sit in (z-40)
12683
12805
  react_1.default.createElement("div", { className: "relative z-50" },
12684
- react_1.default.createElement(drawer_1.Drawer, { darkMode: (_121 = props.organise) === null || _121 === void 0 ? void 0 : _121.darkMode, darkModeBg: (_122 = props.organise) === null || _122 === void 0 ? void 0 : _122.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
12806
+ react_1.default.createElement(drawer_1.Drawer, { darkMode: (_122 = props.organise) === null || _122 === void 0 ? void 0 : _122.darkMode, darkModeBg: (_123 = props.organise) === null || _123 === void 0 ? void 0 : _123.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
12685
12807
  // INFO: the record stays set while the drawer slides out — clearing it
12686
12808
  // would remount the hidden panel collection-wide and fetch again. The
12687
12809
  // toolbar's collection-wide button clears it when it opens.
12688
- onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75", title: "Activity Log", content: react_1.default.createElement(activityModal_1.ActivityModal, { title: props.title && typeof props.title === "string"
12689
- ? props.title
12690
- : "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((_123 = props.id) !== null && _123 !== void 0 ? _123 : "") : activityId, activityLog: (_124 = props.edit) === null || _124 === void 0 ? void 0 : _124.activityLog,
12691
- // INFO: names the record in the drawer's heading; without it
12692
- // the lookup reads a "title" field most datasheets lack and
12693
- // the heading shows the record's id. A title or name column
12694
- // comes first, then the first text column
12695
- recordTitleColumn: (_127 = ((_126 = (_125 = structure.find(function (eachDS) { return eachDS.id === "title"; })) !== null && _125 !== void 0 ? _125 : structure.find(function (eachDS) { return eachDS.id === "name"; })) !== null && _126 !== void 0 ? _126 : structure.find(function (eachDS) { return eachDS.type === "string"; }))) === null || _127 === void 0 ? void 0 : _127.id, model: structure }) })), document.body),
12810
+ onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75", title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((_124 = props.id) !== null && _124 !== void 0 ? _124 : "") : activityId) })), document.body),
12696
12811
  renderScrollSentinel()));
12697
12812
  });
12698
12813
  //# sourceMappingURL=index.js.map