blixify-ui-web 1.2.263 → 1.2.265

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.
@@ -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;
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;
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 _124 = (0, react_1.useState)(false), drawerPageView = _124[0], setDrawerPageView = _124[1];
257
+ var _128 = (0, react_1.useState)(false), drawerPageView = _128[0], setDrawerPageView = _128[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.
@@ -279,18 +279,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
279
279
  // INFO: the view in the url belongs to the record while its panel is open. A
280
280
  // list following it through the record's tabs cleared its rows and page and
281
281
  // read them again behind the panel, so it keeps the view it was opened on.
282
- var handleResolveListViewId = function () {
283
- var _a, _b, _c;
284
- return ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.viewId) === null || _b === void 0 ? void 0 : _b.startsWith(RELATED_VIEW_PREFIX))
285
- ? undefined
286
- : (_c = props.organise) === null || _c === void 0 ? void 0 : _c.viewId;
287
- };
288
- var hostedListViewIdRef = (0, react_1.useRef)(handleResolveListViewId());
289
- if (!isDrawerHost)
290
- hostedListViewIdRef.current = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.viewId;
291
- var listViewId = isDrawerHost
282
+ // INFO: a related tab is a view of one record, never of the list. A host
283
+ // that keeps the last view it was handed when the panel closes would leave
284
+ // the list on that tab, where it draws nothing, so the list stays on the
285
+ // view it was last on until the host names a list view again.
286
+ var isRelatedViewId = !!((_f = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.viewId) === null || _f === void 0 ? void 0 : _f.startsWith(RELATED_VIEW_PREFIX));
287
+ var hostedListViewIdRef = (0, react_1.useRef)(isRelatedViewId ? undefined : (_g = props.organise) === null || _g === void 0 ? void 0 : _g.viewId);
288
+ if (!isDrawerHost && !isRelatedViewId)
289
+ hostedListViewIdRef.current = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.viewId;
290
+ var listViewId = isDrawerHost || (resolvedType === "list" && isRelatedViewId)
292
291
  ? hostedListViewIdRef.current
293
- : (_f = props.organise) === null || _f === void 0 ? void 0 : _f.viewId;
292
+ : (_j = props.organise) === null || _j === void 0 ? void 0 : _j.viewId;
294
293
  // INFO: the route has already gone back to the list while the panel slides out,
295
294
  // so it keeps drawing what it was opened as until it is gone
296
295
  var drawerFormRef = (0, react_1.useRef)(false);
@@ -310,7 +309,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
310
309
  drawerFormEditedRef.current = false;
311
310
  }
312
311
  drawerOpenRef.current = isDrawerHost;
313
- var _125 = (0, react_1.useState)(false), drawerDiscardModal = _125[0], setDrawerDiscardModal = _125[1];
312
+ var _129 = (0, react_1.useState)(false), drawerDiscardModal = _129[0], setDrawerDiscardModal = _129[1];
314
313
  // INFO: leaving the record ends the escape, so the next row opened from the
315
314
  // list peeks in the panel again rather than inheriting a full page the user
316
315
  // asked for once. Saving a form on the full page lands on its read view, which
@@ -389,14 +388,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
389
388
  initialFilterReferenceDate: initialFilterReferenceDate,
390
389
  };
391
390
  };
392
- var _126 = intialiseDefaultFilterValues(), initialFilterSearch = _126.initialFilterSearch, initialFilterSearchParams = _126.initialFilterSearchParams, initialFilterSelection = _126.initialFilterSelection, initialFilterReference = _126.initialFilterReference, initialFilterReferenceDate = _126.initialFilterReferenceDate;
391
+ var _130 = intialiseDefaultFilterValues(), initialFilterSearch = _130.initialFilterSearch, initialFilterSearchParams = _130.initialFilterSearchParams, initialFilterSelection = _130.initialFilterSelection, initialFilterReference = _130.initialFilterReference, initialFilterReferenceDate = _130.initialFilterReferenceDate;
393
392
  // INFO: Persist view state hook — handles storage read/write for filter/sort/column state
394
- var _127 = (0, viewStatePersistence_1.usePersistedViewState)({
395
- mode: (_g = props.organise) === null || _g === void 0 ? void 0 : _g.persistViewState,
393
+ var _131 = (0, viewStatePersistence_1.usePersistedViewState)({
394
+ mode: (_k = props.organise) === null || _k === void 0 ? void 0 : _k.persistViewState,
396
395
  collectionId: props.collectionId,
397
- persistKey: (_h = props.organise) === null || _h === void 0 ? void 0 : _h.persistKey,
396
+ persistKey: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.persistKey,
398
397
  type: resolvedType,
399
- }), rawPersistedState = _127.persistedState, isPersistEnabled = _127.isEnabled, handleSaveView = _127.handleSaveView, handleRegisterViewSnapshot = _127.handleRegisterViewSnapshot;
398
+ }), rawPersistedState = _131.persistedState, isPersistEnabled = _131.isEnabled, handleSaveView = _131.handleSaveView, handleRegisterViewSnapshot = _131.handleRegisterViewSnapshot;
400
399
  // INFO: drop stored filters/sort on removed columns — they would empty the table
401
400
  var persistedState = (0, react_1.useMemo)(function () {
402
401
  var _a, _b, _c, _d;
@@ -408,12 +407,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
408
407
  }, [
409
408
  rawPersistedState,
410
409
  props.model,
411
- (_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareFlexFilterReferences,
412
- (_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareFlexFilterListObjects,
413
- (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareFlexFilterRelated,
410
+ (_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareFlexFilterReferences,
411
+ (_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareFlexFilterListObjects,
412
+ (_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareFlexFilterRelated,
414
413
  ]);
415
- var _128 = (0, react_1.useState)(false), loading = _128[0], setLoading = _128[1];
416
- var _129 = (0, react_1.useState)(), notification = _129[0], setNotification = _129[1];
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];
417
416
  // INFO: a success toast is confirmation, not a decision — it clears itself so
418
417
  // it never sits on the floating step bar; errors stay until dismissed
419
418
  (0, react_1.useEffect)(function () {
@@ -423,80 +422,80 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
423
422
  return function () { return clearTimeout(timer); };
424
423
  }, [notification]);
425
424
  //INFO : Used by List
426
- var _130 = (0, react_1.useState)((_m = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _m !== void 0 ? _m : initialFilterSearch), filterSearch = _130[0], setFilterSearch = _130[1];
427
- var _131 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _o !== void 0 ? _o : initialFilterSearchParams), filterSearchParams = _131[0], setFilterSearchParams = _131[1];
428
- var _132 = (0, react_1.useState)((_p = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _p !== void 0 ? _p : initialFilterSelection), filterSelection = _132[0], setFilterSelection = _132[1];
429
- var _133 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _q !== void 0 ? _q : initialFilterReference), filterReference = _133[0], setFilterReference = _133[1];
430
- var _134 = (0, react_1.useState)({}), filterReferenceSearch = _134[0], setFilterReferenceSearch = _134[1];
431
- var _135 = (0, react_1.useState)({}), filterReferenceList = _135[0], setFilterReferenceList = _135[1];
432
- var _136 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
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)
433
432
  ? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
434
- : initialFilterReferenceDate), filterReferenceDate = _136[0], setFilterReferenceDate = _136[1];
435
- var _137 = (0, react_1.useState)(true), tableLoading = _137[0], setTableLoading = _137[1];
436
- var _138 = (0, react_1.useState)(""), cursor = _138[0], setCursor = _138[1];
437
- var _139 = (0, react_1.useState)(""), lastCursor = _139[0], setLastCursor = _139[1];
438
- var _140 = (0, react_1.useState)([]), tableData = _140[0], setTableData = _140[1];
439
- var _141 = (0, react_1.useState)([]), spaceTableData = _141[0], setSpaceTableData = _141[1];
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];
440
439
  // INFO: a save resolves after later renders, so it reads the table from here —
441
440
  // the state it closed over can predate an earlier save on the same row
442
441
  var tableDataRef = (0, react_1.useRef)([]);
443
442
  var spaceTableDataRef = (0, react_1.useRef)([]);
444
443
  tableDataRef.current = tableData;
445
444
  spaceTableDataRef.current = spaceTableData;
446
- var _142 = (0, react_1.useState)(0), size = _142[0], setSize = _142[1];
447
- var _143 = (0, react_1.useState)((_t = (_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _r !== void 0 ? _r : (_s = props.organise) === null || _s === void 0 ? void 0 : _s.pageIndex) !== null && _t !== void 0 ? _t : 0), pageIndex = _143[0], setPageIndex = _143[1];
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];
448
447
  // INFO: every change of page, including the return to the first page when a
449
448
  // filter or search changes, which onChangePagination does not always report
450
449
  (0, react_1.useEffect)(function () {
451
450
  var _a, _b;
452
451
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePageIndex) === null || _b === void 0 ? void 0 : _b.call(_a, pageIndex);
453
452
  }, [pageIndex]);
454
- var _144 = (0, react_1.useState)([]), selectedIds = _144[0], setSelectedIds = _144[1];
455
- var _145 = (0, react_1.useState)(false), selectAll = _145[0], setSelectAll = _145[1];
456
- var _146 = (0, react_1.useState)(""), deletePasscode = _146[0], setDeletePasscode = _146[1];
457
- var _147 = (0, react_1.useState)(""), deletePasscodeInput = _147[0], setDeletePasscodeInput = _147[1];
458
- var _148 = (0, react_1.useState)(""), deleteFeedId = _148[0], setDeleteFeedId = _148[1];
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];
459
458
  //INFO : Used by List Organise
460
459
  // INFO: Internal sort state that overrides props.organise?.sort when
461
460
  // persistViewState is enabled and a persisted sort exists
462
- var _149 = (0, react_1.useState)((_u = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _u !== void 0 ? _u : undefined), persistedSort = _149[0], setPersistedSort = _149[1];
463
- var _150 = (0, react_1.useState)(false), filterDraft = _150[0], setFilterDraft = _150[1];
464
- var _151 = (0, react_1.useState)(false), addTabModal = _151[0], setAddTabModal = _151[1];
465
- var _152 = (0, react_1.useState)(-1), editTabIndex = _152[0], setEditTabIndex = _152[1];
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];
466
465
  //INFO : resolve the initial tab synchronously so the mount cond is already
467
466
  // tab-scoped — an empty initial tab caused a second wasted list fetch
468
- var _153 = (0, react_1.useState)(function () {
467
+ var _157 = (0, react_1.useState)(function () {
469
468
  var _a;
470
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);
471
- }), selectedTab = _153[0], setSelectedTab = _153[1];
472
- var _154 = (0, react_1.useState)("dayGridMonth"), calendarView = _154[0], setCalendarView = _154[1];
470
+ }), selectedTab = _157[0], setSelectedTab = _157[1];
471
+ var _158 = (0, react_1.useState)("dayGridMonth"), calendarView = _158[0], setCalendarView = _158[1];
473
472
  // INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
474
473
  // (calendarView above drives the matching range query)
475
- var _155 = (0, react_1.useState)("month"), newCalendarViewMode = _155[0], setNewCalendarViewMode = _155[1];
476
- var _156 = (0, react_1.useState)(new Date()), calendarTabMonth = _156[0], setCalendarTabMonth = _156[1];
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];
477
476
  // INFO: defaultViewSwitch picks the opening view only — the tab re-inits
478
477
  // whenever its settings change, and that must not undo the user's switch
479
478
  var calendarViewInitRef = (0, react_1.useRef)(false);
480
- var _157 = (0, react_1.useState)(true), kanbanDroppable = _157[0], setKanbanDroppable = _157[1];
481
- var _158 = (0, react_1.useState)([]), kanbanOptions = _158[0], setKanbanOptions = _158[1];
482
- var _159 = (0, react_1.useState)(false), batchUpdateModal = _159[0], setBatchUpdateModal = _159[1];
483
- var _160 = (0, react_1.useState)({
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)({
484
483
  columnId: "",
485
484
  columnData: {},
486
- }), batchUpdateData = _160[0], setBatchUpdateData = _160[1];
485
+ }), batchUpdateData = _164[0], setBatchUpdateData = _164[1];
487
486
  // INFO: system columns (created / updated at and by, record id, number)
488
487
  // join the structure hidden; the ones a user shows are kept per view
489
- var isSystemColumnsEnabled = !!((_v = props.bareSettings) === null || _v === void 0 ? void 0 : _v.bareSystemColumns);
490
- var isSystemColumnsLocked = !!((_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareSystemColumnsLocked);
488
+ var isSystemColumnsEnabled = !!((_y = props.bareSettings) === null || _y === void 0 ? void 0 : _y.bareSystemColumns);
489
+ var isSystemColumnsLocked = !!((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareSystemColumnsLocked);
491
490
  var appendedSystemColumnIds = isSystemColumnsEnabled
492
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; }); })
493
492
  : [];
494
- var _161 = (0, react_1.useState)((_x = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _x !== void 0 ? _x : []), shownSystemColumnIds = _161[0], setShownSystemColumnIds = _161[1];
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];
495
494
  var handleWithSystemColumns = function (model, shownIds) {
496
495
  if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
497
496
  return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
498
497
  };
499
- var _162 = (0, react_1.useState)(function () {
498
+ var _166 = (0, react_1.useState)(function () {
500
499
  var _a;
501
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 : []);
502
501
  if (!persistedState)
@@ -523,8 +522,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
523
522
  });
524
523
  }
525
524
  return model;
526
- }), structure = _162[0], setStructure = _162[1];
527
- var _163 = (0, react_1.useState)(((_y = props === null || props === void 0 ? void 0 : props.organise) === null || _y === void 0 ? void 0 : _y.additionalQuery) || []), additionalQuery = _163[0], setAdditionalQuery = _163[1];
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];
528
527
  // INFO: State for user-configurable flex filters (Monday.com-style)
529
528
  // INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
530
529
  var defaultFlexFilterRow = [
@@ -536,13 +535,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
536
535
  },
537
536
  ];
538
537
  // INFO: rows the host opens the list with come before a saved view's
539
- var initialFlexFilterRows = ((_z = props.organise) === null || _z === void 0 ? void 0 : _z.initialFlexFilters) &&
538
+ var initialFlexFilterRows = ((_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.initialFlexFilters) &&
540
539
  props.organise.initialFlexFilters.length > 0
541
540
  ? props.organise.initialFlexFilters
542
541
  : (persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
543
542
  ? persistedState.flexFilters
544
543
  : defaultFlexFilterRow;
545
- var _164 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _164[0], setFlexFilters = _164[1];
544
+ var _168 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _168[0], setFlexFilters = _168[1];
546
545
  // INFO: always-current mirror of flexFilters, read by the imperative apply/
547
546
  // clear methods so chained calls in one tick aren't stale.
548
547
  var flexFiltersRef = (0, react_1.useRef)(flexFilters);
@@ -555,91 +554,91 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
555
554
  }, [flexFilters]);
556
555
  // INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
557
556
  // to prevent API calls on every keystroke when typing in value inputs
558
- var _165 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _165[0], setFlexFiltersDebounced = _165[1];
557
+ var _169 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _169[0], setFlexFiltersDebounced = _169[1];
559
558
  // INFO: the filter rows of the export being set up — started from the
560
559
  // list's own when the export opens, so changing them leaves the list as it is
561
- var _166 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _166[0], setExportFlexFilters = _166[1];
562
- var _167 = (0, react_1.useState)({}), flexFilterReferenceOptions = _167[0], setFlexFilterReferenceOptions = _167[1];
563
- var _168 = (0, react_1.useState)({}), flexFilterReferenceSearch = _168[0], setFlexFilterReferenceSearch = _168[1];
564
- var _169 = (0, react_1.useState)(false), flexFilterModalOpen = _169[0], setFlexFilterModalOpen = _169[1];
565
- var _170 = (0, react_1.useState)(false), viewSettingsModalOpen = _170[0], setViewSettingsModalOpen = _170[1];
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];
566
565
  // INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
567
566
  // Deliberately kept out of `structure`: the props-sync effect below resets
568
567
  // structure to props.model whenever props change, which would wipe the
569
568
  // choice, and the persist effect derives schema-level hiddenColumnIds from
570
569
  // structure — writing user hides there would blur the two concepts.
571
- var _171 = (0, react_1.useState)((_0 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _0 !== void 0 ? _0 : []), userHiddenColumnIds = _171[0], setUserHiddenColumnIds = _171[1];
572
- var _172 = (0, react_1.useState)(""), columnSearch = _172[0], setColumnSearch = _172[1];
573
- var _173 = (0, react_1.useState)([]), savedViews = _173[0], setSavedViews = _173[1];
574
- var _174 = (0, react_1.useState)(null), activeSavedViewId = _174[0], setActiveSavedViewId = _174[1];
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];
575
574
  // INFO: the widths of the view on screen, by column id ("180px")
576
- var _175 = (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 = _175[0], setColumnWidths = _175[1];
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];
577
576
  // INFO: the columns the view on screen freezes at the left edge
578
- var _176 = (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 = _176[0], setPinnedColumnIds = _176[1];
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];
579
578
  // INFO: unsaved changes are kept only once the opening view is on screen,
580
579
  // so the defaults drawn before it never overwrite a person's own
581
- var _177 = (0, react_1.useState)(false), isViewDraftReady = _177[0], setIsViewDraftReady = _177[1];
580
+ var _181 = (0, react_1.useState)(false), isViewDraftReady = _181[0], setIsViewDraftReady = _181[1];
582
581
  // INFO: null while the name box is closed
583
- var _178 = (0, react_1.useState)(null), savedViewName = _178[0], setSavedViewName = _178[1];
584
- var _179 = (0, react_1.useState)(null), deletingSavedViewId = _179[0], setDeletingSavedViewId = _179[1];
585
- var _180 = (0, react_1.useState)(null), renamingSavedView = _180[0], setRenamingSavedView = _180[1];
586
- var _181 = (0, react_1.useState)(false), isSavedViewsExpanded = _181[0], setIsSavedViewsExpanded = _181[1];
587
- var _182 = (0, react_1.useState)(null), draggingColumnId = _182[0], setDraggingColumnId = _182[1];
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];
588
587
  var columnRowRefs = (0, react_1.useRef)({});
589
588
  //INFO : Used by Auth
590
- var _183 = (0, react_1.useState)({
589
+ var _187 = (0, react_1.useState)({
591
590
  email: "",
592
591
  google: "",
593
592
  phone: "",
594
593
  disabled: false,
595
594
  create: false,
596
- }), authMethods = _183[0], setAuthMethods = _183[1];
597
- var _184 = (0, react_1.useState)(""), selectedAuthMethod = _184[0], setSelectedAuthMethod = _184[1];
595
+ }), authMethods = _187[0], setAuthMethods = _187[1];
596
+ var _188 = (0, react_1.useState)(""), selectedAuthMethod = _188[0], setSelectedAuthMethod = _188[1];
598
597
  // INFO: the sign-in check of a users datasheet's record is running; the
599
598
  // panel shows a spinner rather than nothing, which read as "no login"
600
- var _185 = (0, react_1.useState)(false), authLoading = _185[0], setAuthLoading = _185[1];
599
+ var _189 = (0, react_1.useState)(false), authLoading = _189[0], setAuthLoading = _189[1];
601
600
  // INFO: a delete is running — the ref answers a second tap at once, before
602
601
  // the state has rendered, and the state disables the confirm button
603
602
  var deletingRef = (0, react_1.useRef)(false);
604
- var _186 = (0, react_1.useState)(false), deleting = _186[0], setDeleting = _186[1];
603
+ var _190 = (0, react_1.useState)(false), deleting = _190[0], setDeleting = _190[1];
605
604
  // INFO: Used by Activity Log
606
- var _187 = (0, react_1.useState)(false), activityModal = _187[0], setActivityModal = _187[1];
607
- var _188 = (0, react_1.useState)(""), activityId = _188[0], setActivityId = _188[1];
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];
608
607
  //INFO : Used by Export
609
- var _189 = (0, react_1.useState)(null), csvFile = _189[0], setCSVFile = _189[1];
610
- var _190 = (0, react_1.useState)([]), csvFileData = _190[0], setCSVFileData = _190[1];
611
- var _191 = (0, react_1.useState)(0), stepCSVIndex = _191[0], setStepCSVIndex = _191[1];
612
- var _192 = (0, react_1.useState)({}), listCSVMapAttribute = _192[0], setListCSVMapAttribute = _192[1];
613
- var _193 = (0, react_1.useState)({}), listCSVObjAttribute = _193[0], setListCSVObjAttribute = _193[1];
614
- var _194 = (0, react_1.useState)([]), csvAPIAttribute = _194[0], setCSVAPIAttribute = _194[1];
615
- var _195 = (0, react_1.useState)(((_1 = props.devSettings.currentUser) === null || _1 === void 0 ? void 0 : _1.userEmail) || ""), exportCSVEmail = _195[0], setExportCSVEmail = _195[1];
616
- var _196 = (0, react_1.useState)(((_3 = (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.exportSettings) === null || _3 === void 0 ? void 0 : _3.defaultExportPDFName) || ""), exportPDFTitle = _196[0], setExportPDFTitle = _196[1];
617
- var _197 = (0, react_1.useState)(false), exportPDFLoading = _197[0], setExportPDFLoading = _197[1];
618
- var _198 = (0, react_1.useState)(false), exportReadPDFLoading = _198[0], setExportReadPDFLoading = _198[1];
619
- var _199 = (0, react_1.useState)((_6 = (_5 = (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.exportSettings) === null || _5 === void 0 ? void 0 : _5.sumColumnId) !== null && _6 !== void 0 ? _6 : []), exportSumAttributeIds = _199[0], setExportSumAttributeIds = _199[1];
620
- 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.hideSubItems) !== null && _9 !== void 0 ? _9 : false), hideSubItems = _200[0], setHideSubItems = _200[1];
621
- var _201 = (0, react_1.useState)([]), importTableData = _201[0], setImportTableData = _201[1];
622
- var _202 = (0, react_1.useState)([]), queryList = _202[0], setQueryList = _202[1];
623
- var _203 = (0, react_1.useState)(undefined), allQueryList = _203[0], setAllQueryList = _203[1];
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];
624
623
  // INFO: a restored state wins over the prop; its "" is a list the user
625
624
  // ungrouped, so it opens ungrouped
626
- var _204 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
625
+ var _208 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
627
626
  ? persistedState.groupBy || undefined
628
- : (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.groupBy), groupId = _204[0], setGroupId = _204[1];
627
+ : (_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.groupBy), groupId = _208[0], setGroupId = _208[1];
629
628
  // INFO: each group's total per number column, keyed by section id
630
- var _205 = (0, react_1.useState)({}), groupSummaries = _205[0], setGroupSummaries = _205[1];
629
+ var _209 = (0, react_1.useState)({}), groupSummaries = _209[0], setGroupSummaries = _209[1];
631
630
  // INFO: each group's row count over every row the filters match; null until
632
631
  // read. A band paged alone shows it until its own first page lands, and a
633
632
  // band it counts empty is left out instead of waiting to be read
634
- var _206 = (0, react_1.useState)(null), groupTotals = _206[0], setGroupTotals = _206[1];
633
+ var _210 = (0, react_1.useState)(null), groupTotals = _210[0], setGroupTotals = _210[1];
635
634
  var groupSummaryRequestRef = (0, react_1.useRef)(0);
636
- var _207 = (0, react_1.useState)({}), commentCounts = _207[0], setCommentCounts = _207[1];
635
+ var _211 = (0, react_1.useState)({}), commentCounts = _211[0], setCommentCounts = _211[1];
637
636
  // INFO: Monday-board per-group paging. Keyed by the group key that
638
637
  // handleBuildNewTableGroups() produces (an option, Unknown or No Value).
639
638
  // Each group tracks its own loaded cursor + total so it can lazily load its
640
639
  // next page as the user scrolls inside that band, independent of every other
641
640
  // group. Only used when renderCheckGroupPaging() is true.
642
- var _208 = (0, react_1.useState)({}), groupPageState = _208[0], setGroupPageState = _208[1];
641
+ var _212 = (0, react_1.useState)({}), groupPageState = _212[0], setGroupPageState = _212[1];
643
642
  // INFO: read fresh inside the async per-group fetch so chained scroll fires
644
643
  // in one tick do not re-fetch an already in-flight page.
645
644
  var groupPageStateRef = (0, react_1.useRef)({});
@@ -654,62 +653,62 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
654
653
  var groupLoadingKeyRef = (0, react_1.useRef)(null);
655
654
  var groupLoadQueueRef = (0, react_1.useRef)([]);
656
655
  var handleFetchGroupNextPageRef = (0, react_1.useRef)(function () { });
657
- var _209 = (0, react_1.useState)(""), readTabSection = _209[0], setReadTabSection = _209[1];
658
- var _210 = (0, react_1.useState)(false), readFloatingNav = _210[0], setReadFloatingNav = _210[1];
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];
659
658
  var readTabSectionRefs = (0, react_1.useRef)({});
660
659
  //INFO : Used by Read
661
660
  //INFO : Used by Update
662
- var _211 = (0, react_1.useState)(false), modalVisible = _211[0], setModalVisible = _211[1];
663
- var _212 = (0, react_1.useState)(false), deleteModal = _212[0], setDeleteModal = _212[1];
664
- var _213 = (0, react_1.useState)(false), excelModal = _213[0], setExcelModal = _213[1];
665
- var _214 = (0, react_1.useState)(false), exportExcel = _214[0], setExportExcel = _214[1];
666
- var _215 = (0, react_1.useState)(""), exportType = _215[0], setExportType = _215[1];
667
- var _216 = (0, react_1.useState)(false), exportQR = _216[0], setExportQR = _216[1];
668
- var _217 = (0, react_1.useState)(function () {
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 () {
669
668
  var _a, _b;
670
669
  var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
671
670
  return firstTabId;
672
- }), activeTab = _217[0], setActiveTab = _217[1];
673
- var _218 = (0, react_1.useState)(false), signatureSigning = _218[0], setSignatureSigning = _218[1];
674
- var _219 = (0, react_1.useState)({}), selectedData = _219[0], setSelectedData = _219[1];
675
- var _220 = (0, react_1.useState)(""), selectedObjectStructureId = _220[0], setSelectedObjectStructureId = _220[1];
676
- var _221 = (0, react_1.useState)(""), selectedObjectId = _221[0], setSelectedObjectId = _221[1];
677
- var _222 = (0, react_1.useState)(""), selectedListAddressId = _222[0], setSelectedListAddressId = _222[1];
678
- var _223 = (0, react_1.useState)(-1), selectedListAddressIndex = _223[0], setSelectedListAddressIndex = _223[1];
679
- var _224 = (0, react_1.useState)({
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)({
680
679
  lat: 0,
681
680
  lng: 0,
682
681
  name: "",
683
- }), selectedListAddress = _224[0], setSelectedListAddress = _224[1];
684
- var _225 = (0, react_1.useState)({}), selectedObjectData = _225[0], setSelectedObjectData = _225[1];
685
- var _226 = (0, react_1.useState)(null), objectCellEdit = _226[0], setObjectCellEdit = _226[1];
686
- var _227 = (0, react_1.useState)(false), referenceLoading = _227[0], setReferenceLoading = _227[1];
687
- var _228 = (0, react_1.useState)({}), referencesOptions = _228[0], setReferencesOptions = _228[1];
688
- var _229 = (0, react_1.useState)({}), referencesDetails = _229[0], setReferencesDetails = _229[1];
689
- var _230 = (0, react_1.useState)({}), listReferencesOptions = _230[0], setListReferencesOptions = _230[1];
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];
690
689
  // INFO: the referenced records themselves, for a table cell that picks from
691
690
  // a list on one (referenceSelection)
692
- var _231 = (0, react_1.useState)({}), listReferencesDetails = _231[0], setListReferencesDetails = _231[1];
693
- var _232 = (0, react_1.useState)({}), referenceDeleteTableData = _232[0], setReferenceDeleteTableData = _232[1];
694
- var _233 = (0, react_1.useState)([]), relatedSections = _233[0], setRelatedSections = _233[1];
695
- var _234 = (0, react_1.useState)(0), referenceDeleteIndex = _234[0], setReferenceDeleteIndex = _234[1];
696
- var _235 = (0, react_1.useState)({
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
696
  id: "",
698
697
  name: "",
699
698
  type: "string",
700
- }), referenceCreationModal = _235[0], setReferenceCreationModal = _235[1];
701
- var _236 = (0, react_1.useState)({}), referenceModelSchema = _236[0], setReferenceSchema = _236[1];
702
- var _237 = (0, react_1.useState)([]), kanbanChecked = _237[0], setKanbanChecked = _237[1];
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];
703
702
  //INFO : Offline
704
- var _238 = (0, react_1.useState)(0), offlineDataLength = _238[0], setOfflineDataLength = _238[1];
705
- var _239 = (0, react_1.useState)(false), offlineModal = _239[0], setOfflineModal = _239[1];
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];
706
705
  // INFO: live-stream state — driven by socket connection and navigator.onLine
707
- var _240 = (0, react_1.useState)(false), isLive = _240[0], setIsLive = _240[1];
708
- var _241 = (0, react_1.useState)(false), isLiveOffline = _241[0], setIsLiveOffline = _241[1];
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];
709
708
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
710
709
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
711
710
  // Independent of SSE status so it works even when bareSocketName is not set.
712
- var _242 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _242[0], setIsNetworkOffline = _242[1];
711
+ var _246 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _246[0], setIsNetworkOffline = _246[1];
713
712
  var previousType = (0, react_1.useRef)(null);
714
713
  var previousSelectedData = (0, react_1.useRef)(null);
715
714
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -837,7 +836,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
837
836
  * viewId still wins when present: it is a deliberate destination, from a
838
837
  * shared link or a back button.
839
838
  */
840
- var defaultTabName = (_13 = (_12 = (_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.extendedTabs) === null || _12 === void 0 ? void 0 : _12.find(function (eachTab) { return eachTab.defaultTab; })) === null || _13 === void 0 ? void 0 : _13.name;
839
+ var defaultTabName = (_16 = (_15 = (_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.extendedTabs) === null || _15 === void 0 ? void 0 : _15.find(function (eachTab) { return eachTab.defaultTab; })) === null || _16 === void 0 ? void 0 : _16.name;
841
840
  // INFO: the pinned tab is a LIST destination. Falling back to it while a
842
841
  // record is open resolved the read view to a list tab, which renderTabContent
843
842
  // refuses — so General Details rendered nothing. Only a list falls back.
@@ -849,14 +848,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
849
848
  // INFO: Firestore reads and the monday wrapper join every condition with AND
850
849
  // (monday flattens all ORs into one), so a flex OR group is offered on Mongo only
851
850
  var isFlexOrSupported = !isFirebase && devSettings.server !== "mondayServer";
852
- var isDateWarnings = !!((_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.dateWarnings);
853
- var isDatasheetDefaults = !!((_15 = props.organise) === null || _15 === void 0 ? void 0 : _15.datasheetDefaults);
851
+ var isDateWarnings = !!((_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.dateWarnings);
852
+ var isDatasheetDefaults = !!((_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.datasheetDefaults);
854
853
  // INFO: the columns as the views draw them — with datasheet defaults every
855
854
  // list option without a colour takes the palette colour of its position
856
855
  var displayStructure = isDatasheetDefaults
857
856
  ? (0, defaultColours_1.handleApplyDefaultColours)(structure)
858
857
  : structure;
859
- var dbModule = isFirebaseClient ? (_16 = props.lib) === null || _16 === void 0 ? void 0 : _16.firebase : (_17 = props.lib) === null || _17 === void 0 ? void 0 : _17.axios;
858
+ var dbModule = isFirebaseClient ? (_19 = props.lib) === null || _19 === void 0 ? void 0 : _19.firebase : (_20 = props.lib) === null || _20 === void 0 ? void 0 : _20.axios;
860
859
  var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
861
860
  var selectedRelated = resolvedType === "read"
862
861
  ? relatedSections.find(function (eachSection) { return eachSection.id === viewType; })
@@ -1021,32 +1020,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1021
1020
  }, [
1022
1021
  resolvedType,
1023
1022
  props.id,
1024
- (_18 = props.space) === null || _18 === void 0 ? void 0 : _18._id,
1023
+ (_21 = props.space) === null || _21 === void 0 ? void 0 : _21._id,
1025
1024
  props.devSettings.schemaEndpoint,
1026
- (_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.showRelatedTab,
1025
+ (_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.showRelatedTab,
1027
1026
  ]);
1028
1027
  /* eslint-enable */
1029
1028
  // INFO: the view settings panel (columns, sort, rows per page) is standard on
1030
1029
  // the new DTW; bareViewSettings stays the opt-in for legacy and bare DTWs
1031
- var isViewSettingsEnabled = ((_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareViewSettings) || ((_21 = props.bareSettings) === null || _21 === void 0 ? void 0 : _21.bareNewDTW)
1030
+ var isViewSettingsEnabled = ((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareViewSettings) || ((_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareNewDTW)
1032
1031
  ? true
1033
1032
  : false;
1034
1033
  // INFO: a consumer that wires onChangeHide owns the hide at schema level
1035
1034
  // (shared by every user) — toggling writes to the model and calls back. Without it
1036
1035
  // the hide is this user's own and lives in userHiddenColumnIds.
1037
- var isSchemaHideMode = ((_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.onChangeHide) ? true : false;
1036
+ var isSchemaHideMode = ((_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.onChangeHide) ? true : false;
1038
1037
  // INFO: rows per page is a view setting the user can change, so it starts from
1039
1038
  // the persisted value and falls back to the consumer's limit
1040
- var _243 = (0, react_1.useState)((_24 = (_23 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _23 !== void 0 ? _23 : props.limit) !== null && _24 !== void 0 ? _24 : 10), pageLimit = _243[0], setPageLimit = _243[1];
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];
1041
1040
  var limit = pageLimit;
1042
- var isSavedViewsEnabled = !!((_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.savedViews) && resolvedType === "list";
1041
+ var isSavedViewsEnabled = !!((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.savedViews) && resolvedType === "list";
1043
1042
  // INFO: an app that stores views takes over from this browser's storage, so
1044
1043
  // every view is the team's and nothing is kept locally
1045
- var isAppViews = ((_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.sharedViews) !== undefined ||
1046
- !!((_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.onChangeSharedViews);
1044
+ var isAppViews = ((_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.sharedViews) !== undefined ||
1045
+ !!((_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.onChangeSharedViews);
1047
1046
  // INFO: a saved view carries its sort, so the sort is held here as with persistViewState
1048
1047
  var isInternalSort = isPersistEnabled || isSavedViewsEnabled;
1049
- var activeSortId = (isInternalSort && persistedSort) || ((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.sort);
1048
+ var activeSortId = (isInternalSort && persistedSort) || ((_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.sort);
1050
1049
  var handleSortColumn = function (value) {
1051
1050
  var _a, _b, _c, _d;
1052
1051
  if (isInternalSort)
@@ -1076,7 +1075,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1076
1075
  // INFO: Firebase pages by document cursor and a union by skip, so neither
1077
1076
  // can hand over the whole set — there formula columns are not offered for
1078
1077
  // sorting or filtering, rather than ordering one page
1079
- var isFormulaViewSupported = !isFirebase && !((_30 = (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.unionCollections) === null || _30 === void 0 ? void 0 : _30.length);
1078
+ var isFormulaViewSupported = !isFirebase && !((_33 = (_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.unionCollections) === null || _33 === void 0 ? void 0 : _33.length);
1080
1079
  var formulaSort = isFormulaViewSupported &&
1081
1080
  (activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) &&
1082
1081
  formulaColumnIds.includes(activeSortId.sortId)
@@ -1085,13 +1084,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1085
1084
  // INFO: a referenced record and related rows are joined by MongoWrapper's
1086
1085
  // lookups and a list row is matched by its Mongo path — neither Firebase nor
1087
1086
  // a union read runs them
1088
- var flexFilterExtras = !isFirebase && !((_32 = (_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.unionCollections) === null || _32 === void 0 ? void 0 : _32.length)
1087
+ // INFO: a people filter's "me" needs only who is signed in, which any
1088
+ // backend can match
1089
+ var currentUserId = (_34 = props.devSettings.currentUser) === null || _34 === void 0 ? void 0 : _34.userId;
1090
+ var flexFilterExtras = !isFirebase && !((_36 = (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.unionCollections) === null || _36 === void 0 ? void 0 : _36.length)
1089
1091
  ? {
1090
- references: (_33 = props.bareSettings) === null || _33 === void 0 ? void 0 : _33.bareFlexFilterReferences,
1091
- listObjects: (_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareFlexFilterListObjects,
1092
- related: (_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareFlexFilterRelated,
1092
+ references: (_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareFlexFilterReferences,
1093
+ listObjects: (_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareFlexFilterListObjects,
1094
+ related: (_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareFlexFilterRelated,
1095
+ currentUserId: currentUserId,
1093
1096
  }
1094
- : undefined;
1097
+ : currentUserId
1098
+ ? { currentUserId: currentUserId }
1099
+ : undefined;
1095
1100
  // INFO: a formula filter is matched in the browser and the rest on the
1096
1101
  // server, so a group is split between them: a group of formula filters
1097
1102
  // only still matches any of them here, while a formula filter grouped with
@@ -1178,18 +1183,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1178
1183
  displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
1179
1184
  };
1180
1185
  };
1181
- var _244 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _244.canUpdateRecord, canInlineUpdate = _244.canInlineUpdate, canBatchUpdate = _244.canBatchUpdate, canDeleteRecord = _244.canDeleteRecord;
1182
- var isEditor = ((_36 = props.edit) === null || _36 === void 0 ? void 0 : _36.allEditable) ? true : false;
1183
- var isOffline = (_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareOffline;
1186
+ var _248 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _248.canUpdateRecord, canInlineUpdate = _248.canInlineUpdate, canBatchUpdate = _248.canBatchUpdate, canDeleteRecord = _248.canDeleteRecord;
1187
+ var isEditor = ((_40 = props.edit) === null || _40 === void 0 ? void 0 : _40.allEditable) ? true : false;
1188
+ var isOffline = (_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.bareOffline;
1184
1189
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
1185
1190
  // the live network state — online saves go to the server even if bareOffline
1186
1191
  // is true, offline saves go to IDB as normal.
1187
- var isOfflineNetworkListener = isOffline && ((_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareOfflineNetworkListener);
1188
- var showId = (_39 = props.space) === null || _39 === void 0 ? void 0 : _39.showId;
1192
+ var isOfflineNetworkListener = isOffline && ((_42 = props.bareSettings) === null || _42 === void 0 ? void 0 : _42.bareOfflineNetworkListener);
1193
+ var showId = (_43 = props.space) === null || _43 === void 0 ? void 0 : _43.showId;
1189
1194
  var remainId = showId || selectedObjectStructureId ? true : false;
1190
- var idField = ((_40 = props.space) === null || _40 === void 0 ? void 0 : _40.idField) || ((_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.idField);
1191
- var pipeline = (_42 = props === null || props === void 0 ? void 0 : props.space) === null || _42 === void 0 ? void 0 : _42.pipeline;
1192
- if ((_43 = props.bareSettings) === null || _43 === void 0 ? void 0 : _43.bareListPipeline) {
1195
+ var idField = ((_44 = props.space) === null || _44 === void 0 ? void 0 : _44.idField) || ((_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.idField);
1196
+ var pipeline = (_46 = props === null || props === void 0 ? void 0 : props.space) === null || _46 === void 0 ? void 0 : _46.pipeline;
1197
+ if ((_47 = props.bareSettings) === null || _47 === void 0 ? void 0 : _47.bareListPipeline) {
1193
1198
  pipeline = pipeline
1194
1199
  ? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
1195
1200
  }
@@ -1202,24 +1207,24 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1202
1207
  * three records came back instead of five files, and each tile received the
1203
1208
  * whole array rather than one file, so every one of them read "Attachment".
1204
1209
  */
1205
- var fileViewColumnId = (_47 = (_46 = ((_45 = (_44 = props.organise) === null || _44 === void 0 ? void 0 : _44.extendedTabs) !== null && _45 !== void 0 ? _45 : []).find(function (eachTab) {
1210
+ var fileViewColumnId = (_51 = (_50 = ((_49 = (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.extendedTabs) !== null && _49 !== void 0 ? _49 : []).find(function (eachTab) {
1206
1211
  return eachTab.viewType === "file" &&
1207
1212
  (0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
1208
- })) === null || _46 === void 0 ? void 0 : _46.fileSettings) === null || _47 === void 0 ? void 0 : _47.columnId;
1209
- var hasNavigation = ((_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.handleNavigate) ? true : false;
1213
+ })) === null || _50 === void 0 ? void 0 : _50.fileSettings) === null || _51 === void 0 ? void 0 : _51.columnId;
1214
+ var hasNavigation = ((_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.handleNavigate) ? true : false;
1210
1215
  var formColumn = "grid-cols-12";
1211
- var useMobileView = (_50 = (_49 = props.bareSettings) === null || _49 === void 0 ? void 0 : _49.bareUpdateMobileView) !== null && _50 !== void 0 ? _50 : false;
1216
+ var useMobileView = (_54 = (_53 = props.bareSettings) === null || _53 === void 0 ? void 0 : _53.bareUpdateMobileView) !== null && _54 !== void 0 ? _54 : false;
1212
1217
  var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
1213
- var isActivityLog = (((_52 = (_51 = props.edit) === null || _51 === void 0 ? void 0 : _51.activityLog) === null || _52 === void 0 ? void 0 : _52.enableComments) &&
1214
- ((_53 = props.edit) === null || _53 === void 0 ? void 0 : _53.activityLog.commentCollectionId)) ||
1215
- (((_55 = (_54 = props.edit) === null || _54 === void 0 ? void 0 : _54.activityLog) === null || _55 === void 0 ? void 0 : _55.enableLogs) &&
1216
- ((_56 = props.edit) === null || _56 === void 0 ? void 0 : _56.activityLog.logsCollectionId));
1217
- var customPaginationSize = ((_57 = props.organise) === null || _57 === void 0 ? void 0 : _57.customPaginationCount)
1218
+ var isActivityLog = (((_56 = (_55 = props.edit) === null || _55 === void 0 ? void 0 : _55.activityLog) === null || _56 === void 0 ? void 0 : _56.enableComments) &&
1219
+ ((_57 = props.edit) === null || _57 === void 0 ? void 0 : _57.activityLog.commentCollectionId)) ||
1220
+ (((_59 = (_58 = props.edit) === null || _58 === void 0 ? void 0 : _58.activityLog) === null || _59 === void 0 ? void 0 : _59.enableLogs) &&
1221
+ ((_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)
1218
1223
  ? props.organise.customPaginationCount(size)
1219
1224
  : undefined;
1220
1225
  //TODO : Code - Pass ...devSettings, search dbEndpoint:
1221
1226
  var writeServerQuery = new writeQuery_1.WriteQuery({
1222
- dbModule: (_58 = props.lib) === null || _58 === void 0 ? void 0 : _58.axios,
1227
+ dbModule: (_62 = props.lib) === null || _62 === void 0 ? void 0 : _62.axios,
1223
1228
  dbType: devSettings.server,
1224
1229
  dbCollection: props.collectionId,
1225
1230
  dbEndpoint: devSettings.dbEndpoint,
@@ -1227,7 +1232,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1227
1232
  dbUserToken: devSettings.dbUserToken,
1228
1233
  });
1229
1234
  var readServerQuery = new readQuery_1.ReadQuery({
1230
- dbModule: (_59 = props.lib) === null || _59 === void 0 ? void 0 : _59.axios,
1235
+ dbModule: (_63 = props.lib) === null || _63 === void 0 ? void 0 : _63.axios,
1231
1236
  dbType: devSettings.server,
1232
1237
  dbCollection: props.collectionId,
1233
1238
  dbEndpoint: devSettings.dbEndpoint,
@@ -1235,12 +1240,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1235
1240
  dbUserToken: devSettings.dbUserToken,
1236
1241
  });
1237
1242
  var moreButtonPopUp = [
1238
- ((_60 = props.edit) === null || _60 === void 0 ? void 0 : _60.allEditable) &&
1243
+ ((_64 = props.edit) === null || _64 === void 0 ? void 0 : _64.allEditable) &&
1239
1244
  // INFO: the import runs on the server (importEndpoint), so a Firestore
1240
1245
  // datasheet served through one can import; only the browser-direct
1241
1246
  // Firebase client has no server to import through
1242
1247
  !isFirebaseClient &&
1243
- !((_62 = (_61 = props.organise) === null || _61 === void 0 ? void 0 : _61.exportSettings) === null || _62 === void 0 ? void 0 : _62.hideImportCSV)
1248
+ !((_66 = (_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.exportSettings) === null || _66 === void 0 ? void 0 : _66.hideImportCSV)
1244
1249
  ? {
1245
1250
  text: "Import Excel",
1246
1251
  onClick: function () {
@@ -1249,7 +1254,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1249
1254
  },
1250
1255
  }
1251
1256
  : null,
1252
- !((_64 = (_63 = props.organise) === null || _63 === void 0 ? void 0 : _63.exportSettings) === null || _64 === void 0 ? void 0 : _64.hideExportCSV)
1257
+ !((_68 = (_67 = props.organise) === null || _67 === void 0 ? void 0 : _67.exportSettings) === null || _68 === void 0 ? void 0 : _68.hideExportCSV)
1253
1258
  ? {
1254
1259
  text: "Export CSV",
1255
1260
  onClick: function () {
@@ -1259,7 +1264,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1259
1264
  },
1260
1265
  }
1261
1266
  : null,
1262
- !((_66 = (_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.exportSettings) === null || _66 === void 0 ? void 0 : _66.hideExportExcel)
1267
+ !((_70 = (_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.exportSettings) === null || _70 === void 0 ? void 0 : _70.hideExportExcel)
1263
1268
  ? {
1264
1269
  text: "Export Excel",
1265
1270
  onClick: function () {
@@ -1269,7 +1274,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1269
1274
  },
1270
1275
  }
1271
1276
  : null,
1272
- !((_68 = (_67 = props.organise) === null || _67 === void 0 ? void 0 : _67.exportSettings) === null || _68 === void 0 ? void 0 : _68.hideExportPDF)
1277
+ !((_72 = (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.exportSettings) === null || _72 === void 0 ? void 0 : _72.hideExportPDF)
1273
1278
  ? {
1274
1279
  text: "Export PDF",
1275
1280
  onClick: function () {
@@ -1279,7 +1284,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1279
1284
  },
1280
1285
  }
1281
1286
  : null,
1282
- !((_70 = (_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.exportSettings) === null || _70 === void 0 ? void 0 : _70.hideExportQR)
1287
+ !((_74 = (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.exportSettings) === null || _74 === void 0 ? void 0 : _74.hideExportQR)
1283
1288
  ? {
1284
1289
  text: "Export QR",
1285
1290
  onClick: function () {
@@ -1289,7 +1294,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1289
1294
  },
1290
1295
  }
1291
1296
  : null,
1292
- !((_72 = (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.exportSettings) === null || _72 === void 0 ? void 0 : _72.hideExportQR)
1297
+ !((_76 = (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.exportSettings) === null || _76 === void 0 ? void 0 : _76.hideExportQR)
1293
1298
  ? {
1294
1299
  text: "Export QR(Data)",
1295
1300
  onClick: function () {
@@ -1299,7 +1304,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1299
1304
  },
1300
1305
  }
1301
1306
  : null,
1302
- !((_74 = (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.exportSettings) === null || _74 === void 0 ? void 0 : _74.hideExportPrint)
1307
+ !((_78 = (_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.exportSettings) === null || _78 === void 0 ? void 0 : _78.hideExportPrint)
1303
1308
  ? {
1304
1309
  text: "Print",
1305
1310
  onClick: function () {
@@ -1311,8 +1316,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1311
1316
  : null,
1312
1317
  // INFO: drafts only exist where the form can save one, so the filter has
1313
1318
  // nothing to find on any other page
1314
- ((_75 = props.edit) === null || _75 === void 0 ? void 0 : _75.enableUpdateDraft) &&
1315
- !((_77 = (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.exportSettings) === null || _77 === void 0 ? void 0 : _77.hideExportDraft)
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)
1316
1321
  ? {
1317
1322
  text: filterDraft ? "Show All Items" : "Filter Draft",
1318
1323
  onClick: function () {
@@ -1321,7 +1326,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1321
1326
  }
1322
1327
  : null,
1323
1328
  ].filter(Boolean);
1324
- if ((_78 = props.organise) === null || _78 === void 0 ? void 0 : _78.moreSettings)
1329
+ if ((_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.moreSettings)
1325
1330
  moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
1326
1331
  //=====================================================================================
1327
1332
  //SECTION: User Column Visibility Handlers
@@ -1689,6 +1694,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1689
1694
  }
1690
1695
  }
1691
1696
  }
1697
+ // INFO: a sort on a linked record's field needs that record joined in,
1698
+ // which a condition every row passes carries to the server
1699
+ var linkedSort = (0, flexFilter_1.handleResolveReferenceSort)(activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId, structure, flexFilterExtras);
1700
+ if (linkedSort)
1701
+ query = __spreadArray(__spreadArray([], (query !== null && query !== void 0 ? query : []), true), [linkedSort.lookup], false);
1692
1702
  // INFO: a search shares the server's single $or with flex OR groups, so it
1693
1703
  // is folded into their blocks; Firestore has no OR to fold into
1694
1704
  return query && !isFirebase ? (0, flexFilter_1.handleMergeOrQueries)(query) : query;
@@ -1761,14 +1771,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1761
1771
  //=====================================================================================
1762
1772
  //SECTION: Saved Views
1763
1773
  //=====================================================================================
1764
- var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.persistKey, (_80 = devSettings.currentUser) === null || _80 === void 0 ? void 0 : _80.userEmail);
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);
1765
1775
  (0, react_1.useEffect)(function () {
1766
1776
  if (isSavedViewsEnabled && !isAppViews)
1767
1777
  setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
1768
1778
  }, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
1769
1779
  // INFO: the app keeps All's settings, so every change is kept in this
1770
1780
  // browser until the person updates the view for everyone or resets it
1771
- var isViewDraftsEnabled = isSavedViewsEnabled && ((_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.allView) !== undefined;
1781
+ var isViewDraftsEnabled = isSavedViewsEnabled && ((_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.allView) !== undefined;
1772
1782
  var handleGetViewDraftKey = function (viewId) {
1773
1783
  var _a, _b;
1774
1784
  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);
@@ -1852,7 +1862,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1852
1862
  var lastSentSharedViewsRef = (0, react_1.useRef)(null);
1853
1863
  (0, react_1.useEffect)(function () {
1854
1864
  lastSentSharedViewsRef.current = null;
1855
- }, [(_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.sharedViews]);
1865
+ }, [(_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.sharedViews]);
1856
1866
  var handleStoreSharedViews = function (update) {
1857
1867
  var _a, _b, _c;
1858
1868
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
@@ -1897,13 +1907,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1897
1907
  /* eslint-disable */
1898
1908
  }, [
1899
1909
  isSavedViewsEnabled,
1900
- (_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.initialSavedViewId,
1901
- (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.defaultSavedViewId,
1902
- (_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.sharedViews,
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,
1903
1913
  savedViews,
1904
1914
  ]);
1905
1915
  /* eslint-enable */
1906
- var defaultSavedViewIds = ((_87 = (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.defaultSavedViews) !== null && _87 !== void 0 ? _87 : [])
1916
+ var defaultSavedViewIds = ((_91 = (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.defaultSavedViews) !== null && _91 !== void 0 ? _91 : [])
1907
1917
  .map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
1908
1918
  .join("|");
1909
1919
  // INFO: keyed on the ids, not the array, so an inline literal passed on every
@@ -2233,8 +2243,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2233
2243
  groupId,
2234
2244
  columnWidths,
2235
2245
  pinnedColumnIds,
2236
- (_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.allView,
2237
- (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.sharedViews,
2246
+ (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.allView,
2247
+ (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.sharedViews,
2238
2248
  savedViews,
2239
2249
  ]);
2240
2250
  /* eslint-enable */
@@ -2274,7 +2284,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2274
2284
  var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
2275
2285
  scrollRestoredRef.current = isSwitch || isOtherListReturn;
2276
2286
  /* eslint-disable */
2277
- }, [props.collectionId, (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.persistKey]);
2287
+ }, [props.collectionId, (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.persistKey]);
2278
2288
  /* eslint-enable */
2279
2289
  // INFO: wait a frame — rows land in state one tick before layout
2280
2290
  (0, react_1.useEffect)(function () {
@@ -2309,7 +2319,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2309
2319
  (0, react_1.useEffect)(function () {
2310
2320
  handleOfflinePrefetch();
2311
2321
  /* eslint-disable */
2312
- }, [props.collectionId, (_91 = props.bareSettings) === null || _91 === void 0 ? void 0 : _91.bareOffline]);
2322
+ }, [props.collectionId, (_95 = props.bareSettings) === null || _95 === void 0 ? void 0 : _95.bareOffline]);
2313
2323
  /* eslint-enable */
2314
2324
  // INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
2315
2325
  // Calls through handleRefreshRef so the interval always dispatches the latest
@@ -2329,7 +2339,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2329
2339
  }, interval);
2330
2340
  return function () { return clearInterval(timer); };
2331
2341
  /* eslint-disable */
2332
- }, [(_92 = props.bareSettings) === null || _92 === void 0 ? void 0 : _92.barePollingInterval, isLive, isNetworkOffline]);
2342
+ }, [(_96 = props.bareSettings) === null || _96 === void 0 ? void 0 : _96.barePollingInterval, isLive, isNetworkOffline]);
2333
2343
  /* eslint-enable */
2334
2344
  // INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
2335
2345
  // EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
@@ -2371,7 +2381,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2371
2381
  };
2372
2382
  /* eslint-disable */
2373
2383
  }, [
2374
- (_93 = props.bareSettings) === null || _93 === void 0 ? void 0 : _93.bareSocketName,
2384
+ (_97 = props.bareSettings) === null || _97 === void 0 ? void 0 : _97.bareSocketName,
2375
2385
  props.collectionId,
2376
2386
  props.devSettings.sseEndpoint,
2377
2387
  props.devSettings.dbAPIToken,
@@ -2645,10 +2655,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2645
2655
  props.collectionId,
2646
2656
  props.model,
2647
2657
  props.localURLEndpoint,
2648
- (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.extendedTabs,
2658
+ (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.extendedTabs,
2649
2659
  listViewId,
2650
- (_95 = props.organise) === null || _95 === void 0 ? void 0 : _95.additionalQuery,
2651
- (_96 = props.organise) === null || _96 === void 0 ? void 0 : _96.groupBy,
2660
+ (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.additionalQuery,
2661
+ (_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.groupBy,
2652
2662
  resolvedType,
2653
2663
  ]);
2654
2664
  /**
@@ -2800,7 +2810,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2800
2810
  };
2801
2811
  }, 100);
2802
2812
  return function () { return clearTimeout(timeoutId); };
2803
- }, [(_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.showReadFloatingNav, resolvedType, props.id, loading]);
2813
+ }, [(_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.showReadFloatingNav, resolvedType, props.id, loading]);
2804
2814
  (0, react_1.useEffect)(function () {
2805
2815
  if (resolvedType !== "read")
2806
2816
  return;
@@ -3284,9 +3294,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
3284
3294
  var sort = (activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) && formulaColumnIds.includes(activeSortId.sortId)
3285
3295
  ? undefined
3286
3296
  : activeSortId || undefined;
3297
+ // INFO: a linked record's field sorts on the joined record, whose lookup
3298
+ // renderImpSearchFilterConditions adds to the query
3299
+ var linkedSort = (0, flexFilter_1.handleResolveReferenceSort)(sort === null || sort === void 0 ? void 0 : sort.sortId, structure, flexFilterExtras);
3300
+ if (sort && linkedSort)
3301
+ sort = __assign(__assign({}, sort), { sortId: linkedSort.sortId });
3287
3302
  // INFO: a date range sorts on its start, a timer on its total and the
3288
3303
  // Record ID column on the record's own id
3289
- if (sort === null || sort === void 0 ? void 0 : sort.sortId) {
3304
+ else if (sort === null || sort === void 0 ? void 0 : sort.sortId) {
3290
3305
  var sortColumn = structure.find(function (each) { return each.id === (sort === null || sort === void 0 ? void 0 : sort.sortId); });
3291
3306
  if ((sortColumn === null || sortColumn === void 0 ? void 0 : sortColumn.type) === "dateRange")
3292
3307
  sort = __assign(__assign({}, sort), { sortId: (0, dateRange_1.handleGetDateRangeQueryId)(sortColumn.id) });
@@ -5946,7 +5961,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5946
5961
  var columnTypeActions = {
5947
5962
  canUpdate: canUpdateRecord,
5948
5963
  dateWarnings: isDateWarnings,
5949
- onButtonClick: (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.onButtonClick,
5964
+ onButtonClick: (_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.onButtonClick,
5950
5965
  onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
5951
5966
  var _a;
5952
5967
  return __generator(this, function (_b) {
@@ -5963,7 +5978,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5963
5978
  }
5964
5979
  });
5965
5980
  }); },
5966
- onTimeTrackingAction: ((_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.onTimeTrackingAction) && canUpdateRecord
5981
+ onTimeTrackingAction: ((_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.onTimeTrackingAction) && canUpdateRecord
5967
5982
  ? function (rowId, columnId, action) {
5968
5983
  return handleTimeTrackingAction(rowId, columnId, action);
5969
5984
  }
@@ -8150,14 +8165,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8150
8165
  react_1.default.createElement("p", { className: "text-sm font-medium ".concat(labelColor) }, "Sort"),
8151
8166
  react_1.default.createElement("div", { className: "mt-1 flex flex-row items-center gap-x-2" },
8152
8167
  react_1.default.createElement("div", { className: "grow min-w-0" },
8153
- react_1.default.createElement(select_1.Select, { id: "dtw-view-sort-column", portalDropdown: true, label: "", containerClassName: "min-w-0", value: (_b = activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) !== null && _b !== void 0 ? _b : "", placeholder: "Column", darkMode: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode, options: viewColumns
8154
- .filter(function (eachColumn) {
8168
+ react_1.default.createElement(select_1.Select, { id: "dtw-view-sort-column", portalDropdown: true, label: "", containerClassName: "min-w-0", value: (_b = activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) !== null && _b !== void 0 ? _b : "", placeholder: "Column", darkMode: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode, options: __spreadArray(__spreadArray([], viewColumns.filter(function (eachColumn) {
8155
8169
  return (isFormulaViewSupported ||
8156
8170
  eachColumn.type !== "formula") &&
8157
8171
  (0, lookup_1.handleIsQueryableColumn)(eachColumn) &&
8158
8172
  !utils_1.NON_SORT_COLUMN_DATA_TYPES.includes(eachColumn.type);
8159
- })
8160
- .map(function (eachColumn) {
8173
+ }), true), ((flexFilterExtras === null || flexFilterExtras === void 0 ? void 0 : flexFilterExtras.references)
8174
+ ? flexFilterStructure.filter(function (eachColumn) {
8175
+ return eachColumn.id.includes(">") &&
8176
+ !utils_1.NON_SORT_COLUMN_DATA_TYPES.includes(eachColumn.type);
8177
+ })
8178
+ : []), true).map(function (eachColumn) {
8161
8179
  var _a;
8162
8180
  return ({
8163
8181
  key: eachColumn.id,
@@ -8206,8 +8224,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8206
8224
  : rows;
8207
8225
  };
8208
8226
  /* eslint-disable */
8209
- var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_100 = props.bareSettings) === null || _100 === void 0 ? void 0 : _100.bareNewDTW]);
8210
- var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_101 = props.bareSettings) === null || _101 === void 0 ? void 0 : _101.bareNewDTW]);
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]);
8211
8229
  /* eslint-enable */
8212
8230
  // INFO: beside a record's title, the pencil opens its edit form for whoever
8213
8231
  // may update, and the bubble opens comments and logs for anyone who can see
@@ -8955,17 +8973,26 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8955
8973
  if ((_a = target.closest) === null || _a === void 0 ? void 0 : _a.call(target, 'button, [role="option"], [role="menuitem"], li'))
8956
8974
  handleMarkDrawerFormEdited();
8957
8975
  };
8976
+ // INFO: the panel goes back to the list it was opened over, on the tab it
8977
+ // was opened from. Opening a record names "general" as its view, and closing
8978
+ // named none, so a list opened on List, Kanban or Grid came back on Table
8979
+ // View. The record inside the panel is a nested instance that cannot see the
8980
+ // list's tab, so its own way back (delete, a failed load) goes through here
8981
+ // too.
8982
+ var handleNavigateFromDrawer = function (type, selectedId, viewId) {
8983
+ var _a, _b, _c;
8984
+ return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, type, selectedId, type === "list" ? ((_c = hostedListViewIdRef.current) !== null && _c !== void 0 ? _c : viewId) : viewId);
8985
+ };
8958
8986
  var renderReadDrawer = function () {
8959
- var _a, _b, _c, _d;
8987
+ var _a, _b, _c, _d, _e;
8960
8988
  if (!canHostDrawer)
8961
8989
  return null;
8962
8990
  var isForm = drawerFormRef.current;
8963
8991
  var handleCloseDrawer = function () {
8964
- var _a, _b;
8965
8992
  setDrawerDiscardModal(false);
8966
- (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "list", "");
8993
+ handleNavigateFromDrawer("list", "");
8967
8994
  };
8968
- var _e = (_b = (_a = props.viewSettings) === null || _a === void 0 ? void 0 : _a.readDrawer) !== null && _b !== void 0 ? _b : {}, anchor = _e.anchor, maxWidth = _e.maxWidth, maxHeight = _e.maxHeight, desc = _e.desc, disableExpand = _e.disableExpand, disableResize = _e.disableResize, title = _e.title;
8995
+ var _f = (_b = (_a = props.viewSettings) === null || _a === void 0 ? void 0 : _a.readDrawer) !== null && _b !== void 0 ? _b : {}, anchor = _f.anchor, maxWidth = _f.maxWidth, maxHeight = _f.maxHeight, desc = _f.desc, disableExpand = _f.disableExpand, disableResize = _f.disableResize, title = _f.title;
8969
8996
  return (react_1.default.createElement(drawer_1.Drawer, { darkMode: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode, darkModeBg: (_d = props.organise) === null || _d === void 0 ? void 0 : _d.darkModeBg, testId: isForm ? "dt-form-drawer" : "dt-read-drawer", open: isDrawerHost, onClose: handleCloseDrawer, unmountOnClose: true, anchor: anchor !== null && anchor !== void 0 ? anchor : "responsive", maxWidth: maxWidth !== null && maxWidth !== void 0 ? maxWidth : "3xl",
8970
8997
  // INFO: a phone keyboard takes half the screen, which leaves a form in a
8971
8998
  // three-quarter sheet almost no room for the field being typed in. It
@@ -8988,7 +9015,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8988
9015
  // INFO: the panel header already names the record, and a
8989
9016
  // list/detail breadcrumb is meaningless while the list is still on
8990
9017
  // screen behind it
8991
- title: "", description: "", organise: __assign(__assign({}, props.organise), { breadcrumbType: "hidden" }), bareSettings: __assign(__assign(__assign({
9018
+ title: "", description: "", organise: __assign(__assign(__assign({}, props.organise), { breadcrumbType: "hidden" }), (((_e = props.organise) === null || _e === void 0 ? void 0 : _e.handleNavigate) && {
9019
+ handleNavigate: handleNavigateFromDrawer,
9020
+ })), bareSettings: __assign(__assign(__assign({
8992
9021
  // INFO: DetailList's stacked rows waste a panel this narrow —
8993
9022
  // compact puts label and value on one row. Overridable.
8994
9023
  bareCompactMode: !isForm }, props.bareSettings), {
@@ -9004,9 +9033,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
9004
9033
  var renderDrawerDiscardModal = function () { return (react_1.default.createElement(modal_1.Modal, { open: drawerDiscardModal, onClose: function () { return setDrawerDiscardModal(false); }, title: "Discard changes?", renderContent: function () { return (react_1.default.createElement("div", { className: "flex flex-row justify-end pt-5 space-x-2" },
9005
9034
  react_1.default.createElement(button_1.Button, { id: "dtw-form-keep", text: "Keep Editing", size: "small", type: "light", onClick: function () { return setDrawerDiscardModal(false); } }),
9006
9035
  react_1.default.createElement(button_1.Button, { id: "dtw-form-discard", text: "Discard", size: "small", type: "danger", onClick: function () {
9007
- var _a, _b;
9008
9036
  setDrawerDiscardModal(false);
9009
- (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "list", "");
9037
+ handleNavigateFromDrawer("list", "");
9010
9038
  } }))); } })); };
9011
9039
  var renderContent = function () {
9012
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;
@@ -12602,14 +12630,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12602
12630
  };
12603
12631
  return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
12604
12632
  renderNotification("root"),
12605
- ((_103 = (_102 = props.renderSettings) === null || _102 === void 0 ? void 0 : _102.renderLoadingUI) === null || _103 === void 0 ? void 0 : _103.call(_102)) && loading ? ((_104 = props.renderSettings) === null || _104 === void 0 ? void 0 : _104.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.darkMode, darkModeBg: (_106 = props.organise) === null || _106 === void 0 ? void 0 : _106.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
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 () {
12606
12634
  var _a, _b;
12607
12635
  if (loading)
12608
12636
  return;
12609
12637
  handlePopUpModal(false);
12610
12638
  setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
12611
12639
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
12612
- react_1.default.createElement(modal_1.Modal, { darkMode: (_107 = props.organise) === null || _107 === void 0 ? void 0 : _107.darkMode, darkModeBg: (_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
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 () {
12613
12641
  return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
12614
12642
  if (dataId) {
12615
12643
  var currentValue = selectedData[referenceCreationModal.id];
@@ -12625,19 +12653,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12625
12653
  }, onClose: function () {
12626
12654
  setReferenceCreationModal({ id: "", name: "", type: "string" });
12627
12655
  } }),
12628
- 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: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
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 () {
12629
12657
  setReferenceDeleteTableData({});
12630
12658
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
12631
- react_1.default.createElement(modal_1.Modal, { darkMode: (_111 = props.organise) === null || _111 === void 0 ? void 0 : _111.darkMode, darkModeBg: (_112 = props.organise) === null || _112 === void 0 ? void 0 : _112.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
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 () {
12632
12660
  setDeletePasscodeInput("");
12633
12661
  setDeleteModal(!deleteModal);
12634
12662
  setDeleteFeedId("");
12635
12663
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
12636
- 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, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
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 () {
12637
12665
  setBatchUpdateData({ columnId: "", columnData: {} });
12638
12666
  setBatchUpdateModal(false);
12639
12667
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
12640
- 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, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
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 () {
12641
12669
  var _a, _b;
12642
12670
  if (props.space)
12643
12671
  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 }));
@@ -12653,18 +12681,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12653
12681
  (0, react_dom_1.createPortal)(
12654
12682
  // INFO: z-50 lifts it over a Modal the table may sit in (z-40)
12655
12683
  react_1.default.createElement("div", { className: "relative z-50" },
12656
- react_1.default.createElement(drawer_1.Drawer, { darkMode: (_117 = props.organise) === null || _117 === void 0 ? void 0 : _117.darkMode, darkModeBg: (_118 = props.organise) === null || _118 === void 0 ? void 0 : _118.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
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,
12657
12685
  // INFO: the record stays set while the drawer slides out — clearing it
12658
12686
  // would remount the hidden panel collection-wide and fetch again. The
12659
12687
  // toolbar's collection-wide button clears it when it opens.
12660
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"
12661
12689
  ? props.title
12662
- : "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((_119 = props.id) !== null && _119 !== void 0 ? _119 : "") : activityId, activityLog: (_120 = props.edit) === null || _120 === void 0 ? void 0 : _120.activityLog,
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,
12663
12691
  // INFO: names the record in the drawer's heading; without it
12664
12692
  // the lookup reads a "title" field most datasheets lack and
12665
12693
  // the heading shows the record's id. A title or name column
12666
12694
  // comes first, then the first text column
12667
- recordTitleColumn: (_123 = ((_122 = (_121 = structure.find(function (eachDS) { return eachDS.id === "title"; })) !== null && _121 !== void 0 ? _121 : structure.find(function (eachDS) { return eachDS.id === "name"; })) !== null && _122 !== void 0 ? _122 : structure.find(function (eachDS) { return eachDS.type === "string"; }))) === null || _123 === void 0 ? void 0 : _123.id, model: structure }) })), document.body),
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),
12668
12696
  renderScrollSentinel()));
12669
12697
  });
12670
12698
  //# sourceMappingURL=index.js.map