blixify-ui-web 1.2.264 → 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, _124, _125, _126;
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 _127 = (0, react_1.useState)(false), drawerPageView = _127[0], setDrawerPageView = _127[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.
@@ -309,7 +309,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
309
309
  drawerFormEditedRef.current = false;
310
310
  }
311
311
  drawerOpenRef.current = isDrawerHost;
312
- var _128 = (0, react_1.useState)(false), drawerDiscardModal = _128[0], setDrawerDiscardModal = _128[1];
312
+ var _129 = (0, react_1.useState)(false), drawerDiscardModal = _129[0], setDrawerDiscardModal = _129[1];
313
313
  // INFO: leaving the record ends the escape, so the next row opened from the
314
314
  // list peeks in the panel again rather than inheriting a full page the user
315
315
  // asked for once. Saving a form on the full page lands on its read view, which
@@ -388,14 +388,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
388
388
  initialFilterReferenceDate: initialFilterReferenceDate,
389
389
  };
390
390
  };
391
- var _129 = intialiseDefaultFilterValues(), initialFilterSearch = _129.initialFilterSearch, initialFilterSearchParams = _129.initialFilterSearchParams, initialFilterSelection = _129.initialFilterSelection, initialFilterReference = _129.initialFilterReference, initialFilterReferenceDate = _129.initialFilterReferenceDate;
391
+ var _130 = intialiseDefaultFilterValues(), initialFilterSearch = _130.initialFilterSearch, initialFilterSearchParams = _130.initialFilterSearchParams, initialFilterSelection = _130.initialFilterSelection, initialFilterReference = _130.initialFilterReference, initialFilterReferenceDate = _130.initialFilterReferenceDate;
392
392
  // INFO: Persist view state hook — handles storage read/write for filter/sort/column state
393
- var _130 = (0, viewStatePersistence_1.usePersistedViewState)({
393
+ var _131 = (0, viewStatePersistence_1.usePersistedViewState)({
394
394
  mode: (_k = props.organise) === null || _k === void 0 ? void 0 : _k.persistViewState,
395
395
  collectionId: props.collectionId,
396
396
  persistKey: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.persistKey,
397
397
  type: resolvedType,
398
- }), rawPersistedState = _130.persistedState, isPersistEnabled = _130.isEnabled, handleSaveView = _130.handleSaveView, handleRegisterViewSnapshot = _130.handleRegisterViewSnapshot;
398
+ }), rawPersistedState = _131.persistedState, isPersistEnabled = _131.isEnabled, handleSaveView = _131.handleSaveView, handleRegisterViewSnapshot = _131.handleRegisterViewSnapshot;
399
399
  // INFO: drop stored filters/sort on removed columns — they would empty the table
400
400
  var persistedState = (0, react_1.useMemo)(function () {
401
401
  var _a, _b, _c, _d;
@@ -411,8 +411,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
411
411
  (_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareFlexFilterListObjects,
412
412
  (_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareFlexFilterRelated,
413
413
  ]);
414
- var _131 = (0, react_1.useState)(false), loading = _131[0], setLoading = _131[1];
415
- var _132 = (0, react_1.useState)(), notification = _132[0], setNotification = _132[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];
416
416
  // INFO: a success toast is confirmation, not a decision — it clears itself so
417
417
  // it never sits on the floating step bar; errors stay until dismissed
418
418
  (0, react_1.useEffect)(function () {
@@ -422,67 +422,67 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
422
422
  return function () { return clearTimeout(timer); };
423
423
  }, [notification]);
424
424
  //INFO : Used by List
425
- var _133 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _q !== void 0 ? _q : initialFilterSearch), filterSearch = _133[0], setFilterSearch = _133[1];
426
- var _134 = (0, react_1.useState)((_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _r !== void 0 ? _r : initialFilterSearchParams), filterSearchParams = _134[0], setFilterSearchParams = _134[1];
427
- var _135 = (0, react_1.useState)((_s = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _s !== void 0 ? _s : initialFilterSelection), filterSelection = _135[0], setFilterSelection = _135[1];
428
- var _136 = (0, react_1.useState)((_t = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _t !== void 0 ? _t : initialFilterReference), filterReference = _136[0], setFilterReference = _136[1];
429
- var _137 = (0, react_1.useState)({}), filterReferenceSearch = _137[0], setFilterReferenceSearch = _137[1];
430
- var _138 = (0, react_1.useState)({}), filterReferenceList = _138[0], setFilterReferenceList = _138[1];
431
- var _139 = (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)
432
432
  ? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
433
- : initialFilterReferenceDate), filterReferenceDate = _139[0], setFilterReferenceDate = _139[1];
434
- var _140 = (0, react_1.useState)(true), tableLoading = _140[0], setTableLoading = _140[1];
435
- var _141 = (0, react_1.useState)(""), cursor = _141[0], setCursor = _141[1];
436
- var _142 = (0, react_1.useState)(""), lastCursor = _142[0], setLastCursor = _142[1];
437
- var _143 = (0, react_1.useState)([]), tableData = _143[0], setTableData = _143[1];
438
- var _144 = (0, react_1.useState)([]), spaceTableData = _144[0], setSpaceTableData = _144[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];
439
439
  // INFO: a save resolves after later renders, so it reads the table from here —
440
440
  // the state it closed over can predate an earlier save on the same row
441
441
  var tableDataRef = (0, react_1.useRef)([]);
442
442
  var spaceTableDataRef = (0, react_1.useRef)([]);
443
443
  tableDataRef.current = tableData;
444
444
  spaceTableDataRef.current = spaceTableData;
445
- var _145 = (0, react_1.useState)(0), size = _145[0], setSize = _145[1];
446
- var _146 = (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 = _146[0], setPageIndex = _146[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];
447
447
  // INFO: every change of page, including the return to the first page when a
448
448
  // filter or search changes, which onChangePagination does not always report
449
449
  (0, react_1.useEffect)(function () {
450
450
  var _a, _b;
451
451
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePageIndex) === null || _b === void 0 ? void 0 : _b.call(_a, pageIndex);
452
452
  }, [pageIndex]);
453
- var _147 = (0, react_1.useState)([]), selectedIds = _147[0], setSelectedIds = _147[1];
454
- var _148 = (0, react_1.useState)(false), selectAll = _148[0], setSelectAll = _148[1];
455
- var _149 = (0, react_1.useState)(""), deletePasscode = _149[0], setDeletePasscode = _149[1];
456
- var _150 = (0, react_1.useState)(""), deletePasscodeInput = _150[0], setDeletePasscodeInput = _150[1];
457
- var _151 = (0, react_1.useState)(""), deleteFeedId = _151[0], setDeleteFeedId = _151[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];
458
458
  //INFO : Used by List Organise
459
459
  // INFO: Internal sort state that overrides props.organise?.sort when
460
460
  // persistViewState is enabled and a persisted sort exists
461
- var _152 = (0, react_1.useState)((_x = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _x !== void 0 ? _x : undefined), persistedSort = _152[0], setPersistedSort = _152[1];
462
- var _153 = (0, react_1.useState)(false), filterDraft = _153[0], setFilterDraft = _153[1];
463
- var _154 = (0, react_1.useState)(false), addTabModal = _154[0], setAddTabModal = _154[1];
464
- var _155 = (0, react_1.useState)(-1), editTabIndex = _155[0], setEditTabIndex = _155[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];
465
465
  //INFO : resolve the initial tab synchronously so the mount cond is already
466
466
  // tab-scoped — an empty initial tab caused a second wasted list fetch
467
- var _156 = (0, react_1.useState)(function () {
467
+ var _157 = (0, react_1.useState)(function () {
468
468
  var _a;
469
469
  return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, listViewId);
470
- }), selectedTab = _156[0], setSelectedTab = _156[1];
471
- var _157 = (0, react_1.useState)("dayGridMonth"), calendarView = _157[0], setCalendarView = _157[1];
470
+ }), selectedTab = _157[0], setSelectedTab = _157[1];
471
+ var _158 = (0, react_1.useState)("dayGridMonth"), calendarView = _158[0], setCalendarView = _158[1];
472
472
  // INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
473
473
  // (calendarView above drives the matching range query)
474
- var _158 = (0, react_1.useState)("month"), newCalendarViewMode = _158[0], setNewCalendarViewMode = _158[1];
475
- var _159 = (0, react_1.useState)(new Date()), calendarTabMonth = _159[0], setCalendarTabMonth = _159[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];
476
476
  // INFO: defaultViewSwitch picks the opening view only — the tab re-inits
477
477
  // whenever its settings change, and that must not undo the user's switch
478
478
  var calendarViewInitRef = (0, react_1.useRef)(false);
479
- var _160 = (0, react_1.useState)(true), kanbanDroppable = _160[0], setKanbanDroppable = _160[1];
480
- var _161 = (0, react_1.useState)([]), kanbanOptions = _161[0], setKanbanOptions = _161[1];
481
- var _162 = (0, react_1.useState)(false), batchUpdateModal = _162[0], setBatchUpdateModal = _162[1];
482
- var _163 = (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)({
483
483
  columnId: "",
484
484
  columnData: {},
485
- }), batchUpdateData = _163[0], setBatchUpdateData = _163[1];
485
+ }), batchUpdateData = _164[0], setBatchUpdateData = _164[1];
486
486
  // INFO: system columns (created / updated at and by, record id, number)
487
487
  // join the structure hidden; the ones a user shows are kept per view
488
488
  var isSystemColumnsEnabled = !!((_y = props.bareSettings) === null || _y === void 0 ? void 0 : _y.bareSystemColumns);
@@ -490,12 +490,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
490
490
  var appendedSystemColumnIds = isSystemColumnsEnabled
491
491
  ? systemColumns_1.SYSTEM_COLUMN_IDS.filter(function (eachId) { var _a; return !((_a = props.model) !== null && _a !== void 0 ? _a : []).some(function (each) { return each.id === eachId; }); })
492
492
  : [];
493
- var _164 = (0, react_1.useState)((_0 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _0 !== void 0 ? _0 : []), shownSystemColumnIds = _164[0], setShownSystemColumnIds = _164[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];
494
494
  var handleWithSystemColumns = function (model, shownIds) {
495
495
  if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
496
496
  return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
497
497
  };
498
- var _165 = (0, react_1.useState)(function () {
498
+ var _166 = (0, react_1.useState)(function () {
499
499
  var _a;
500
500
  var baseModel = handleWithSystemColumns((props === null || props === void 0 ? void 0 : props.model) || [], (_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _a !== void 0 ? _a : []);
501
501
  if (!persistedState)
@@ -522,8 +522,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
522
522
  });
523
523
  }
524
524
  return model;
525
- }), structure = _165[0], setStructure = _165[1];
526
- var _166 = (0, react_1.useState)(((_1 = props === null || props === void 0 ? void 0 : props.organise) === null || _1 === void 0 ? void 0 : _1.additionalQuery) || []), additionalQuery = _166[0], setAdditionalQuery = _166[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];
527
527
  // INFO: State for user-configurable flex filters (Monday.com-style)
528
528
  // INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
529
529
  var defaultFlexFilterRow = [
@@ -541,7 +541,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
541
541
  : (persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
542
542
  ? persistedState.flexFilters
543
543
  : defaultFlexFilterRow;
544
- var _167 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _167[0], setFlexFilters = _167[1];
544
+ var _168 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _168[0], setFlexFilters = _168[1];
545
545
  // INFO: always-current mirror of flexFilters, read by the imperative apply/
546
546
  // clear methods so chained calls in one tick aren't stale.
547
547
  var flexFiltersRef = (0, react_1.useRef)(flexFilters);
@@ -554,91 +554,91 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
554
554
  }, [flexFilters]);
555
555
  // INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
556
556
  // to prevent API calls on every keystroke when typing in value inputs
557
- var _168 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _168[0], setFlexFiltersDebounced = _168[1];
557
+ var _169 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _169[0], setFlexFiltersDebounced = _169[1];
558
558
  // INFO: the filter rows of the export being set up — started from the
559
559
  // list's own when the export opens, so changing them leaves the list as it is
560
- var _169 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _169[0], setExportFlexFilters = _169[1];
561
- var _170 = (0, react_1.useState)({}), flexFilterReferenceOptions = _170[0], setFlexFilterReferenceOptions = _170[1];
562
- var _171 = (0, react_1.useState)({}), flexFilterReferenceSearch = _171[0], setFlexFilterReferenceSearch = _171[1];
563
- var _172 = (0, react_1.useState)(false), flexFilterModalOpen = _172[0], setFlexFilterModalOpen = _172[1];
564
- var _173 = (0, react_1.useState)(false), viewSettingsModalOpen = _173[0], setViewSettingsModalOpen = _173[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];
565
565
  // INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
566
566
  // Deliberately kept out of `structure`: the props-sync effect below resets
567
567
  // structure to props.model whenever props change, which would wipe the
568
568
  // choice, and the persist effect derives schema-level hiddenColumnIds from
569
569
  // structure — writing user hides there would blur the two concepts.
570
- var _174 = (0, react_1.useState)((_3 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _3 !== void 0 ? _3 : []), userHiddenColumnIds = _174[0], setUserHiddenColumnIds = _174[1];
571
- var _175 = (0, react_1.useState)(""), columnSearch = _175[0], setColumnSearch = _175[1];
572
- var _176 = (0, react_1.useState)([]), savedViews = _176[0], setSavedViews = _176[1];
573
- var _177 = (0, react_1.useState)(null), activeSavedViewId = _177[0], setActiveSavedViewId = _177[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];
574
574
  // INFO: the widths of the view on screen, by column id ("180px")
575
- var _178 = (0, react_1.useState)(function () { var _a, _b, _c; return (_c = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) === null || _b === void 0 ? void 0 : _b.columnWidths) !== null && _c !== void 0 ? _c : {}; }), columnWidths = _178[0], setColumnWidths = _178[1];
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];
576
576
  // INFO: the columns the view on screen freezes at the left edge
577
- var _179 = (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 = _179[0], setPinnedColumnIds = _179[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];
578
578
  // INFO: unsaved changes are kept only once the opening view is on screen,
579
579
  // so the defaults drawn before it never overwrite a person's own
580
- var _180 = (0, react_1.useState)(false), isViewDraftReady = _180[0], setIsViewDraftReady = _180[1];
580
+ var _181 = (0, react_1.useState)(false), isViewDraftReady = _181[0], setIsViewDraftReady = _181[1];
581
581
  // INFO: null while the name box is closed
582
- var _181 = (0, react_1.useState)(null), savedViewName = _181[0], setSavedViewName = _181[1];
583
- var _182 = (0, react_1.useState)(null), deletingSavedViewId = _182[0], setDeletingSavedViewId = _182[1];
584
- var _183 = (0, react_1.useState)(null), renamingSavedView = _183[0], setRenamingSavedView = _183[1];
585
- var _184 = (0, react_1.useState)(false), isSavedViewsExpanded = _184[0], setIsSavedViewsExpanded = _184[1];
586
- var _185 = (0, react_1.useState)(null), draggingColumnId = _185[0], setDraggingColumnId = _185[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];
587
587
  var columnRowRefs = (0, react_1.useRef)({});
588
588
  //INFO : Used by Auth
589
- var _186 = (0, react_1.useState)({
589
+ var _187 = (0, react_1.useState)({
590
590
  email: "",
591
591
  google: "",
592
592
  phone: "",
593
593
  disabled: false,
594
594
  create: false,
595
- }), authMethods = _186[0], setAuthMethods = _186[1];
596
- var _187 = (0, react_1.useState)(""), selectedAuthMethod = _187[0], setSelectedAuthMethod = _187[1];
595
+ }), authMethods = _187[0], setAuthMethods = _187[1];
596
+ var _188 = (0, react_1.useState)(""), selectedAuthMethod = _188[0], setSelectedAuthMethod = _188[1];
597
597
  // INFO: the sign-in check of a users datasheet's record is running; the
598
598
  // panel shows a spinner rather than nothing, which read as "no login"
599
- var _188 = (0, react_1.useState)(false), authLoading = _188[0], setAuthLoading = _188[1];
599
+ var _189 = (0, react_1.useState)(false), authLoading = _189[0], setAuthLoading = _189[1];
600
600
  // INFO: a delete is running — the ref answers a second tap at once, before
601
601
  // the state has rendered, and the state disables the confirm button
602
602
  var deletingRef = (0, react_1.useRef)(false);
603
- var _189 = (0, react_1.useState)(false), deleting = _189[0], setDeleting = _189[1];
603
+ var _190 = (0, react_1.useState)(false), deleting = _190[0], setDeleting = _190[1];
604
604
  // INFO: Used by Activity Log
605
- var _190 = (0, react_1.useState)(false), activityModal = _190[0], setActivityModal = _190[1];
606
- var _191 = (0, react_1.useState)(""), activityId = _191[0], setActivityId = _191[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];
607
607
  //INFO : Used by Export
608
- var _192 = (0, react_1.useState)(null), csvFile = _192[0], setCSVFile = _192[1];
609
- var _193 = (0, react_1.useState)([]), csvFileData = _193[0], setCSVFileData = _193[1];
610
- var _194 = (0, react_1.useState)(0), stepCSVIndex = _194[0], setStepCSVIndex = _194[1];
611
- var _195 = (0, react_1.useState)({}), listCSVMapAttribute = _195[0], setListCSVMapAttribute = _195[1];
612
- var _196 = (0, react_1.useState)({}), listCSVObjAttribute = _196[0], setListCSVObjAttribute = _196[1];
613
- var _197 = (0, react_1.useState)([]), csvAPIAttribute = _197[0], setCSVAPIAttribute = _197[1];
614
- var _198 = (0, react_1.useState)(((_4 = props.devSettings.currentUser) === null || _4 === void 0 ? void 0 : _4.userEmail) || ""), exportCSVEmail = _198[0], setExportCSVEmail = _198[1];
615
- var _199 = (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 = _199[0], setExportPDFTitle = _199[1];
616
- var _200 = (0, react_1.useState)(false), exportPDFLoading = _200[0], setExportPDFLoading = _200[1];
617
- var _201 = (0, react_1.useState)(false), exportReadPDFLoading = _201[0], setExportReadPDFLoading = _201[1];
618
- var _202 = (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 = _202[0], setExportSumAttributeIds = _202[1];
619
- var _203 = (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 = _203[0], setHideSubItems = _203[1];
620
- var _204 = (0, react_1.useState)([]), importTableData = _204[0], setImportTableData = _204[1];
621
- var _205 = (0, react_1.useState)([]), queryList = _205[0], setQueryList = _205[1];
622
- var _206 = (0, react_1.useState)(undefined), allQueryList = _206[0], setAllQueryList = _206[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];
623
623
  // INFO: a restored state wins over the prop; its "" is a list the user
624
624
  // ungrouped, so it opens ungrouped
625
- var _207 = (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
626
626
  ? persistedState.groupBy || undefined
627
- : (_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.groupBy), groupId = _207[0], setGroupId = _207[1];
627
+ : (_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.groupBy), groupId = _208[0], setGroupId = _208[1];
628
628
  // INFO: each group's total per number column, keyed by section id
629
- var _208 = (0, react_1.useState)({}), groupSummaries = _208[0], setGroupSummaries = _208[1];
629
+ var _209 = (0, react_1.useState)({}), groupSummaries = _209[0], setGroupSummaries = _209[1];
630
630
  // INFO: each group's row count over every row the filters match; null until
631
631
  // read. A band paged alone shows it until its own first page lands, and a
632
632
  // band it counts empty is left out instead of waiting to be read
633
- var _209 = (0, react_1.useState)(null), groupTotals = _209[0], setGroupTotals = _209[1];
633
+ var _210 = (0, react_1.useState)(null), groupTotals = _210[0], setGroupTotals = _210[1];
634
634
  var groupSummaryRequestRef = (0, react_1.useRef)(0);
635
- var _210 = (0, react_1.useState)({}), commentCounts = _210[0], setCommentCounts = _210[1];
635
+ var _211 = (0, react_1.useState)({}), commentCounts = _211[0], setCommentCounts = _211[1];
636
636
  // INFO: Monday-board per-group paging. Keyed by the group key that
637
637
  // handleBuildNewTableGroups() produces (an option, Unknown or No Value).
638
638
  // Each group tracks its own loaded cursor + total so it can lazily load its
639
639
  // next page as the user scrolls inside that band, independent of every other
640
640
  // group. Only used when renderCheckGroupPaging() is true.
641
- var _211 = (0, react_1.useState)({}), groupPageState = _211[0], setGroupPageState = _211[1];
641
+ var _212 = (0, react_1.useState)({}), groupPageState = _212[0], setGroupPageState = _212[1];
642
642
  // INFO: read fresh inside the async per-group fetch so chained scroll fires
643
643
  // in one tick do not re-fetch an already in-flight page.
644
644
  var groupPageStateRef = (0, react_1.useRef)({});
@@ -653,62 +653,62 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
653
653
  var groupLoadingKeyRef = (0, react_1.useRef)(null);
654
654
  var groupLoadQueueRef = (0, react_1.useRef)([]);
655
655
  var handleFetchGroupNextPageRef = (0, react_1.useRef)(function () { });
656
- var _212 = (0, react_1.useState)(""), readTabSection = _212[0], setReadTabSection = _212[1];
657
- var _213 = (0, react_1.useState)(false), readFloatingNav = _213[0], setReadFloatingNav = _213[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];
658
658
  var readTabSectionRefs = (0, react_1.useRef)({});
659
659
  //INFO : Used by Read
660
660
  //INFO : Used by Update
661
- var _214 = (0, react_1.useState)(false), modalVisible = _214[0], setModalVisible = _214[1];
662
- var _215 = (0, react_1.useState)(false), deleteModal = _215[0], setDeleteModal = _215[1];
663
- var _216 = (0, react_1.useState)(false), excelModal = _216[0], setExcelModal = _216[1];
664
- var _217 = (0, react_1.useState)(false), exportExcel = _217[0], setExportExcel = _217[1];
665
- var _218 = (0, react_1.useState)(""), exportType = _218[0], setExportType = _218[1];
666
- var _219 = (0, react_1.useState)(false), exportQR = _219[0], setExportQR = _219[1];
667
- var _220 = (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 () {
668
668
  var _a, _b;
669
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 : "";
670
670
  return firstTabId;
671
- }), activeTab = _220[0], setActiveTab = _220[1];
672
- var _221 = (0, react_1.useState)(false), signatureSigning = _221[0], setSignatureSigning = _221[1];
673
- var _222 = (0, react_1.useState)({}), selectedData = _222[0], setSelectedData = _222[1];
674
- var _223 = (0, react_1.useState)(""), selectedObjectStructureId = _223[0], setSelectedObjectStructureId = _223[1];
675
- var _224 = (0, react_1.useState)(""), selectedObjectId = _224[0], setSelectedObjectId = _224[1];
676
- var _225 = (0, react_1.useState)(""), selectedListAddressId = _225[0], setSelectedListAddressId = _225[1];
677
- var _226 = (0, react_1.useState)(-1), selectedListAddressIndex = _226[0], setSelectedListAddressIndex = _226[1];
678
- var _227 = (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)({
679
679
  lat: 0,
680
680
  lng: 0,
681
681
  name: "",
682
- }), selectedListAddress = _227[0], setSelectedListAddress = _227[1];
683
- var _228 = (0, react_1.useState)({}), selectedObjectData = _228[0], setSelectedObjectData = _228[1];
684
- var _229 = (0, react_1.useState)(null), objectCellEdit = _229[0], setObjectCellEdit = _229[1];
685
- var _230 = (0, react_1.useState)(false), referenceLoading = _230[0], setReferenceLoading = _230[1];
686
- var _231 = (0, react_1.useState)({}), referencesOptions = _231[0], setReferencesOptions = _231[1];
687
- var _232 = (0, react_1.useState)({}), referencesDetails = _232[0], setReferencesDetails = _232[1];
688
- var _233 = (0, react_1.useState)({}), listReferencesOptions = _233[0], setListReferencesOptions = _233[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];
689
689
  // INFO: the referenced records themselves, for a table cell that picks from
690
690
  // a list on one (referenceSelection)
691
- var _234 = (0, react_1.useState)({}), listReferencesDetails = _234[0], setListReferencesDetails = _234[1];
692
- var _235 = (0, react_1.useState)({}), referenceDeleteTableData = _235[0], setReferenceDeleteTableData = _235[1];
693
- var _236 = (0, react_1.useState)([]), relatedSections = _236[0], setRelatedSections = _236[1];
694
- var _237 = (0, react_1.useState)(0), referenceDeleteIndex = _237[0], setReferenceDeleteIndex = _237[1];
695
- var _238 = (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)({
696
696
  id: "",
697
697
  name: "",
698
698
  type: "string",
699
- }), referenceCreationModal = _238[0], setReferenceCreationModal = _238[1];
700
- var _239 = (0, react_1.useState)({}), referenceModelSchema = _239[0], setReferenceSchema = _239[1];
701
- var _240 = (0, react_1.useState)([]), kanbanChecked = _240[0], setKanbanChecked = _240[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];
702
702
  //INFO : Offline
703
- var _241 = (0, react_1.useState)(0), offlineDataLength = _241[0], setOfflineDataLength = _241[1];
704
- var _242 = (0, react_1.useState)(false), offlineModal = _242[0], setOfflineModal = _242[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];
705
705
  // INFO: live-stream state — driven by socket connection and navigator.onLine
706
- var _243 = (0, react_1.useState)(false), isLive = _243[0], setIsLive = _243[1];
707
- var _244 = (0, react_1.useState)(false), isLiveOffline = _244[0], setIsLiveOffline = _244[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];
708
708
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
709
709
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
710
710
  // Independent of SSE status so it works even when bareSocketName is not set.
711
- var _245 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _245[0], setIsNetworkOffline = _245[1];
711
+ var _246 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _246[0], setIsNetworkOffline = _246[1];
712
712
  var previousType = (0, react_1.useRef)(null);
713
713
  var previousSelectedData = (0, react_1.useRef)(null);
714
714
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -1036,7 +1036,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1036
1036
  var isSchemaHideMode = ((_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.onChangeHide) ? true : false;
1037
1037
  // INFO: rows per page is a view setting the user can change, so it starts from
1038
1038
  // the persisted value and falls back to the consumer's limit
1039
- var _246 = (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 = _246[0], setPageLimit = _246[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];
1040
1040
  var limit = pageLimit;
1041
1041
  var isSavedViewsEnabled = !!((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.savedViews) && resolvedType === "list";
1042
1042
  // INFO: an app that stores views takes over from this browser's storage, so
@@ -1084,13 +1084,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1084
1084
  // INFO: a referenced record and related rows are joined by MongoWrapper's
1085
1085
  // lookups and a list row is matched by its Mongo path — neither Firebase nor
1086
1086
  // a union read runs them
1087
- var flexFilterExtras = !isFirebase && !((_35 = (_34 = props.organise) === null || _34 === void 0 ? void 0 : _34.unionCollections) === null || _35 === void 0 ? void 0 : _35.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)
1088
1091
  ? {
1089
- references: (_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareFlexFilterReferences,
1090
- listObjects: (_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareFlexFilterListObjects,
1091
- related: (_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.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,
1092
1096
  }
1093
- : undefined;
1097
+ : currentUserId
1098
+ ? { currentUserId: currentUserId }
1099
+ : undefined;
1094
1100
  // INFO: a formula filter is matched in the browser and the rest on the
1095
1101
  // server, so a group is split between them: a group of formula filters
1096
1102
  // only still matches any of them here, while a formula filter grouped with
@@ -1177,18 +1183,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1177
1183
  displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
1178
1184
  };
1179
1185
  };
1180
- var _247 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _247.canUpdateRecord, canInlineUpdate = _247.canInlineUpdate, canBatchUpdate = _247.canBatchUpdate, canDeleteRecord = _247.canDeleteRecord;
1181
- var isEditor = ((_39 = props.edit) === null || _39 === void 0 ? void 0 : _39.allEditable) ? true : false;
1182
- var isOffline = (_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.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;
1183
1189
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
1184
1190
  // the live network state — online saves go to the server even if bareOffline
1185
1191
  // is true, offline saves go to IDB as normal.
1186
- var isOfflineNetworkListener = isOffline && ((_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.bareOfflineNetworkListener);
1187
- var showId = (_42 = props.space) === null || _42 === void 0 ? void 0 : _42.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;
1188
1194
  var remainId = showId || selectedObjectStructureId ? true : false;
1189
- var idField = ((_43 = props.space) === null || _43 === void 0 ? void 0 : _43.idField) || ((_44 = props.organise) === null || _44 === void 0 ? void 0 : _44.idField);
1190
- var pipeline = (_45 = props === null || props === void 0 ? void 0 : props.space) === null || _45 === void 0 ? void 0 : _45.pipeline;
1191
- if ((_46 = props.bareSettings) === null || _46 === void 0 ? void 0 : _46.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) {
1192
1198
  pipeline = pipeline
1193
1199
  ? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
1194
1200
  }
@@ -1201,24 +1207,24 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1201
1207
  * three records came back instead of five files, and each tile received the
1202
1208
  * whole array rather than one file, so every one of them read "Attachment".
1203
1209
  */
1204
- var fileViewColumnId = (_50 = (_49 = ((_48 = (_47 = props.organise) === null || _47 === void 0 ? void 0 : _47.extendedTabs) !== null && _48 !== void 0 ? _48 : []).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) {
1205
1211
  return eachTab.viewType === "file" &&
1206
1212
  (0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
1207
- })) === null || _49 === void 0 ? void 0 : _49.fileSettings) === null || _50 === void 0 ? void 0 : _50.columnId;
1208
- var hasNavigation = ((_51 = props.organise) === null || _51 === void 0 ? void 0 : _51.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;
1209
1215
  var formColumn = "grid-cols-12";
1210
- var useMobileView = (_53 = (_52 = props.bareSettings) === null || _52 === void 0 ? void 0 : _52.bareUpdateMobileView) !== null && _53 !== void 0 ? _53 : false;
1216
+ var useMobileView = (_54 = (_53 = props.bareSettings) === null || _53 === void 0 ? void 0 : _53.bareUpdateMobileView) !== null && _54 !== void 0 ? _54 : false;
1211
1217
  var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
1212
- var isActivityLog = (((_55 = (_54 = props.edit) === null || _54 === void 0 ? void 0 : _54.activityLog) === null || _55 === void 0 ? void 0 : _55.enableComments) &&
1213
- ((_56 = props.edit) === null || _56 === void 0 ? void 0 : _56.activityLog.commentCollectionId)) ||
1214
- (((_58 = (_57 = props.edit) === null || _57 === void 0 ? void 0 : _57.activityLog) === null || _58 === void 0 ? void 0 : _58.enableLogs) &&
1215
- ((_59 = props.edit) === null || _59 === void 0 ? void 0 : _59.activityLog.logsCollectionId));
1216
- var customPaginationSize = ((_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.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)
1217
1223
  ? props.organise.customPaginationCount(size)
1218
1224
  : undefined;
1219
1225
  //TODO : Code - Pass ...devSettings, search dbEndpoint:
1220
1226
  var writeServerQuery = new writeQuery_1.WriteQuery({
1221
- dbModule: (_61 = props.lib) === null || _61 === void 0 ? void 0 : _61.axios,
1227
+ dbModule: (_62 = props.lib) === null || _62 === void 0 ? void 0 : _62.axios,
1222
1228
  dbType: devSettings.server,
1223
1229
  dbCollection: props.collectionId,
1224
1230
  dbEndpoint: devSettings.dbEndpoint,
@@ -1226,7 +1232,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1226
1232
  dbUserToken: devSettings.dbUserToken,
1227
1233
  });
1228
1234
  var readServerQuery = new readQuery_1.ReadQuery({
1229
- dbModule: (_62 = props.lib) === null || _62 === void 0 ? void 0 : _62.axios,
1235
+ dbModule: (_63 = props.lib) === null || _63 === void 0 ? void 0 : _63.axios,
1230
1236
  dbType: devSettings.server,
1231
1237
  dbCollection: props.collectionId,
1232
1238
  dbEndpoint: devSettings.dbEndpoint,
@@ -1234,12 +1240,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1234
1240
  dbUserToken: devSettings.dbUserToken,
1235
1241
  });
1236
1242
  var moreButtonPopUp = [
1237
- ((_63 = props.edit) === null || _63 === void 0 ? void 0 : _63.allEditable) &&
1243
+ ((_64 = props.edit) === null || _64 === void 0 ? void 0 : _64.allEditable) &&
1238
1244
  // INFO: the import runs on the server (importEndpoint), so a Firestore
1239
1245
  // datasheet served through one can import; only the browser-direct
1240
1246
  // Firebase client has no server to import through
1241
1247
  !isFirebaseClient &&
1242
- !((_65 = (_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.exportSettings) === null || _65 === void 0 ? void 0 : _65.hideImportCSV)
1248
+ !((_66 = (_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.exportSettings) === null || _66 === void 0 ? void 0 : _66.hideImportCSV)
1243
1249
  ? {
1244
1250
  text: "Import Excel",
1245
1251
  onClick: function () {
@@ -1248,7 +1254,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1248
1254
  },
1249
1255
  }
1250
1256
  : null,
1251
- !((_67 = (_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.exportSettings) === null || _67 === void 0 ? void 0 : _67.hideExportCSV)
1257
+ !((_68 = (_67 = props.organise) === null || _67 === void 0 ? void 0 : _67.exportSettings) === null || _68 === void 0 ? void 0 : _68.hideExportCSV)
1252
1258
  ? {
1253
1259
  text: "Export CSV",
1254
1260
  onClick: function () {
@@ -1258,7 +1264,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1258
1264
  },
1259
1265
  }
1260
1266
  : null,
1261
- !((_69 = (_68 = props.organise) === null || _68 === void 0 ? void 0 : _68.exportSettings) === null || _69 === void 0 ? void 0 : _69.hideExportExcel)
1267
+ !((_70 = (_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.exportSettings) === null || _70 === void 0 ? void 0 : _70.hideExportExcel)
1262
1268
  ? {
1263
1269
  text: "Export Excel",
1264
1270
  onClick: function () {
@@ -1268,7 +1274,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1268
1274
  },
1269
1275
  }
1270
1276
  : null,
1271
- !((_71 = (_70 = props.organise) === null || _70 === void 0 ? void 0 : _70.exportSettings) === null || _71 === void 0 ? void 0 : _71.hideExportPDF)
1277
+ !((_72 = (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.exportSettings) === null || _72 === void 0 ? void 0 : _72.hideExportPDF)
1272
1278
  ? {
1273
1279
  text: "Export PDF",
1274
1280
  onClick: function () {
@@ -1278,7 +1284,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1278
1284
  },
1279
1285
  }
1280
1286
  : null,
1281
- !((_73 = (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.exportSettings) === null || _73 === void 0 ? void 0 : _73.hideExportQR)
1287
+ !((_74 = (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.exportSettings) === null || _74 === void 0 ? void 0 : _74.hideExportQR)
1282
1288
  ? {
1283
1289
  text: "Export QR",
1284
1290
  onClick: function () {
@@ -1288,7 +1294,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1288
1294
  },
1289
1295
  }
1290
1296
  : null,
1291
- !((_75 = (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.exportSettings) === null || _75 === void 0 ? void 0 : _75.hideExportQR)
1297
+ !((_76 = (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.exportSettings) === null || _76 === void 0 ? void 0 : _76.hideExportQR)
1292
1298
  ? {
1293
1299
  text: "Export QR(Data)",
1294
1300
  onClick: function () {
@@ -1298,7 +1304,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1298
1304
  },
1299
1305
  }
1300
1306
  : null,
1301
- !((_77 = (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.exportSettings) === null || _77 === void 0 ? void 0 : _77.hideExportPrint)
1307
+ !((_78 = (_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.exportSettings) === null || _78 === void 0 ? void 0 : _78.hideExportPrint)
1302
1308
  ? {
1303
1309
  text: "Print",
1304
1310
  onClick: function () {
@@ -1310,8 +1316,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1310
1316
  : null,
1311
1317
  // INFO: drafts only exist where the form can save one, so the filter has
1312
1318
  // nothing to find on any other page
1313
- ((_78 = props.edit) === null || _78 === void 0 ? void 0 : _78.enableUpdateDraft) &&
1314
- !((_80 = (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.exportSettings) === null || _80 === void 0 ? void 0 : _80.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)
1315
1321
  ? {
1316
1322
  text: filterDraft ? "Show All Items" : "Filter Draft",
1317
1323
  onClick: function () {
@@ -1320,7 +1326,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1320
1326
  }
1321
1327
  : null,
1322
1328
  ].filter(Boolean);
1323
- if ((_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.moreSettings)
1329
+ if ((_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.moreSettings)
1324
1330
  moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
1325
1331
  //=====================================================================================
1326
1332
  //SECTION: User Column Visibility Handlers
@@ -1688,6 +1694,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1688
1694
  }
1689
1695
  }
1690
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);
1691
1702
  // INFO: a search shares the server's single $or with flex OR groups, so it
1692
1703
  // is folded into their blocks; Firestore has no OR to fold into
1693
1704
  return query && !isFirebase ? (0, flexFilter_1.handleMergeOrQueries)(query) : query;
@@ -1760,14 +1771,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1760
1771
  //=====================================================================================
1761
1772
  //SECTION: Saved Views
1762
1773
  //=====================================================================================
1763
- var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.persistKey, (_83 = devSettings.currentUser) === null || _83 === void 0 ? void 0 : _83.userEmail);
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);
1764
1775
  (0, react_1.useEffect)(function () {
1765
1776
  if (isSavedViewsEnabled && !isAppViews)
1766
1777
  setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
1767
1778
  }, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
1768
1779
  // INFO: the app keeps All's settings, so every change is kept in this
1769
1780
  // browser until the person updates the view for everyone or resets it
1770
- var isViewDraftsEnabled = isSavedViewsEnabled && ((_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.allView) !== undefined;
1781
+ var isViewDraftsEnabled = isSavedViewsEnabled && ((_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.allView) !== undefined;
1771
1782
  var handleGetViewDraftKey = function (viewId) {
1772
1783
  var _a, _b;
1773
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);
@@ -1851,7 +1862,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1851
1862
  var lastSentSharedViewsRef = (0, react_1.useRef)(null);
1852
1863
  (0, react_1.useEffect)(function () {
1853
1864
  lastSentSharedViewsRef.current = null;
1854
- }, [(_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.sharedViews]);
1865
+ }, [(_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.sharedViews]);
1855
1866
  var handleStoreSharedViews = function (update) {
1856
1867
  var _a, _b, _c;
1857
1868
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
@@ -1896,13 +1907,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
1896
1907
  /* eslint-disable */
1897
1908
  }, [
1898
1909
  isSavedViewsEnabled,
1899
- (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.initialSavedViewId,
1900
- (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.defaultSavedViewId,
1901
- (_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.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,
1902
1913
  savedViews,
1903
1914
  ]);
1904
1915
  /* eslint-enable */
1905
- var defaultSavedViewIds = ((_90 = (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.defaultSavedViews) !== null && _90 !== void 0 ? _90 : [])
1916
+ var defaultSavedViewIds = ((_91 = (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.defaultSavedViews) !== null && _91 !== void 0 ? _91 : [])
1906
1917
  .map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
1907
1918
  .join("|");
1908
1919
  // INFO: keyed on the ids, not the array, so an inline literal passed on every
@@ -2232,8 +2243,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2232
2243
  groupId,
2233
2244
  columnWidths,
2234
2245
  pinnedColumnIds,
2235
- (_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.allView,
2236
- (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.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,
2237
2248
  savedViews,
2238
2249
  ]);
2239
2250
  /* eslint-enable */
@@ -2273,7 +2284,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2273
2284
  var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
2274
2285
  scrollRestoredRef.current = isSwitch || isOtherListReturn;
2275
2286
  /* eslint-disable */
2276
- }, [props.collectionId, (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.persistKey]);
2287
+ }, [props.collectionId, (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.persistKey]);
2277
2288
  /* eslint-enable */
2278
2289
  // INFO: wait a frame — rows land in state one tick before layout
2279
2290
  (0, react_1.useEffect)(function () {
@@ -2308,7 +2319,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2308
2319
  (0, react_1.useEffect)(function () {
2309
2320
  handleOfflinePrefetch();
2310
2321
  /* eslint-disable */
2311
- }, [props.collectionId, (_94 = props.bareSettings) === null || _94 === void 0 ? void 0 : _94.bareOffline]);
2322
+ }, [props.collectionId, (_95 = props.bareSettings) === null || _95 === void 0 ? void 0 : _95.bareOffline]);
2312
2323
  /* eslint-enable */
2313
2324
  // INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
2314
2325
  // Calls through handleRefreshRef so the interval always dispatches the latest
@@ -2328,7 +2339,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2328
2339
  }, interval);
2329
2340
  return function () { return clearInterval(timer); };
2330
2341
  /* eslint-disable */
2331
- }, [(_95 = props.bareSettings) === null || _95 === void 0 ? void 0 : _95.barePollingInterval, isLive, isNetworkOffline]);
2342
+ }, [(_96 = props.bareSettings) === null || _96 === void 0 ? void 0 : _96.barePollingInterval, isLive, isNetworkOffline]);
2332
2343
  /* eslint-enable */
2333
2344
  // INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
2334
2345
  // EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
@@ -2370,7 +2381,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2370
2381
  };
2371
2382
  /* eslint-disable */
2372
2383
  }, [
2373
- (_96 = props.bareSettings) === null || _96 === void 0 ? void 0 : _96.bareSocketName,
2384
+ (_97 = props.bareSettings) === null || _97 === void 0 ? void 0 : _97.bareSocketName,
2374
2385
  props.collectionId,
2375
2386
  props.devSettings.sseEndpoint,
2376
2387
  props.devSettings.dbAPIToken,
@@ -2644,10 +2655,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2644
2655
  props.collectionId,
2645
2656
  props.model,
2646
2657
  props.localURLEndpoint,
2647
- (_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.extendedTabs,
2658
+ (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.extendedTabs,
2648
2659
  listViewId,
2649
- (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.additionalQuery,
2650
- (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.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,
2651
2662
  resolvedType,
2652
2663
  ]);
2653
2664
  /**
@@ -2799,7 +2810,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
2799
2810
  };
2800
2811
  }, 100);
2801
2812
  return function () { return clearTimeout(timeoutId); };
2802
- }, [(_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.showReadFloatingNav, resolvedType, props.id, loading]);
2813
+ }, [(_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.showReadFloatingNav, resolvedType, props.id, loading]);
2803
2814
  (0, react_1.useEffect)(function () {
2804
2815
  if (resolvedType !== "read")
2805
2816
  return;
@@ -3283,9 +3294,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
3283
3294
  var sort = (activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) && formulaColumnIds.includes(activeSortId.sortId)
3284
3295
  ? undefined
3285
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 });
3286
3302
  // INFO: a date range sorts on its start, a timer on its total and the
3287
3303
  // Record ID column on the record's own id
3288
- if (sort === null || sort === void 0 ? void 0 : sort.sortId) {
3304
+ else if (sort === null || sort === void 0 ? void 0 : sort.sortId) {
3289
3305
  var sortColumn = structure.find(function (each) { return each.id === (sort === null || sort === void 0 ? void 0 : sort.sortId); });
3290
3306
  if ((sortColumn === null || sortColumn === void 0 ? void 0 : sortColumn.type) === "dateRange")
3291
3307
  sort = __assign(__assign({}, sort), { sortId: (0, dateRange_1.handleGetDateRangeQueryId)(sortColumn.id) });
@@ -5945,7 +5961,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5945
5961
  var columnTypeActions = {
5946
5962
  canUpdate: canUpdateRecord,
5947
5963
  dateWarnings: isDateWarnings,
5948
- onButtonClick: (_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.onButtonClick,
5964
+ onButtonClick: (_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.onButtonClick,
5949
5965
  onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
5950
5966
  var _a;
5951
5967
  return __generator(this, function (_b) {
@@ -5962,7 +5978,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
5962
5978
  }
5963
5979
  });
5964
5980
  }); },
5965
- onTimeTrackingAction: ((_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.onTimeTrackingAction) && canUpdateRecord
5981
+ onTimeTrackingAction: ((_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.onTimeTrackingAction) && canUpdateRecord
5966
5982
  ? function (rowId, columnId, action) {
5967
5983
  return handleTimeTrackingAction(rowId, columnId, action);
5968
5984
  }
@@ -8149,14 +8165,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8149
8165
  react_1.default.createElement("p", { className: "text-sm font-medium ".concat(labelColor) }, "Sort"),
8150
8166
  react_1.default.createElement("div", { className: "mt-1 flex flex-row items-center gap-x-2" },
8151
8167
  react_1.default.createElement("div", { className: "grow min-w-0" },
8152
- 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
8153
- .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) {
8154
8169
  return (isFormulaViewSupported ||
8155
8170
  eachColumn.type !== "formula") &&
8156
8171
  (0, lookup_1.handleIsQueryableColumn)(eachColumn) &&
8157
8172
  !utils_1.NON_SORT_COLUMN_DATA_TYPES.includes(eachColumn.type);
8158
- })
8159
- .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) {
8160
8179
  var _a;
8161
8180
  return ({
8162
8181
  key: eachColumn.id,
@@ -8205,8 +8224,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
8205
8224
  : rows;
8206
8225
  };
8207
8226
  /* eslint-disable */
8208
- var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_103 = props.bareSettings) === null || _103 === void 0 ? void 0 : _103.bareNewDTW]);
8209
- var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_104 = props.bareSettings) === null || _104 === void 0 ? void 0 : _104.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]);
8210
8229
  /* eslint-enable */
8211
8230
  // INFO: beside a record's title, the pencil opens its edit form for whoever
8212
8231
  // may update, and the bubble opens comments and logs for anyone who can see
@@ -12611,14 +12630,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12611
12630
  };
12612
12631
  return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
12613
12632
  renderNotification("root"),
12614
- ((_106 = (_105 = props.renderSettings) === null || _105 === void 0 ? void 0 : _105.renderLoadingUI) === null || _106 === void 0 ? void 0 : _106.call(_105)) && loading ? ((_107 = props.renderSettings) === null || _107 === void 0 ? void 0 : _107.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.darkMode, darkModeBg: (_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.darkModeBg, 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 () {
12615
12634
  var _a, _b;
12616
12635
  if (loading)
12617
12636
  return;
12618
12637
  handlePopUpModal(false);
12619
12638
  setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
12620
12639
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
12621
- react_1.default.createElement(modal_1.Modal, { darkMode: (_110 = props.organise) === null || _110 === void 0 ? void 0 : _110.darkMode, darkModeBg: (_111 = props.organise) === null || _111 === void 0 ? void 0 : _111.darkModeBg, maxWidth: "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 () {
12622
12641
  return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
12623
12642
  if (dataId) {
12624
12643
  var currentValue = selectedData[referenceCreationModal.id];
@@ -12634,19 +12653,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12634
12653
  }, onClose: function () {
12635
12654
  setReferenceCreationModal({ id: "", name: "", type: "string" });
12636
12655
  } }),
12637
- react_1.default.createElement(modal_1.Modal, { darkMode: (_112 = props.organise) === null || _112 === void 0 ? void 0 : _112.darkMode, darkModeBg: (_113 = props.organise) === null || _113 === void 0 ? void 0 : _113.darkModeBg, maxWidth: "2xl", open: 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 () {
12638
12657
  setReferenceDeleteTableData({});
12639
12658
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
12640
- react_1.default.createElement(modal_1.Modal, { darkMode: (_114 = props.organise) === null || _114 === void 0 ? void 0 : _114.darkMode, darkModeBg: (_115 = props.organise) === null || _115 === void 0 ? void 0 : _115.darkModeBg, 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 () {
12641
12660
  setDeletePasscodeInput("");
12642
12661
  setDeleteModal(!deleteModal);
12643
12662
  setDeleteFeedId("");
12644
12663
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
12645
- react_1.default.createElement(modal_1.Modal, { darkMode: (_116 = props.organise) === null || _116 === void 0 ? void 0 : _116.darkMode, darkModeBg: (_117 = props.organise) === null || _117 === void 0 ? void 0 : _117.darkModeBg, open: 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 () {
12646
12665
  setBatchUpdateData({ columnId: "", columnData: {} });
12647
12666
  setBatchUpdateModal(false);
12648
12667
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
12649
- react_1.default.createElement(modal_1.Modal, { darkMode: (_118 = props.organise) === null || _118 === void 0 ? void 0 : _118.darkMode, darkModeBg: (_119 = props.organise) === null || _119 === void 0 ? void 0 : _119.darkModeBg, 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 () {
12650
12669
  var _a, _b;
12651
12670
  if (props.space)
12652
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 }));
@@ -12662,18 +12681,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
12662
12681
  (0, react_dom_1.createPortal)(
12663
12682
  // INFO: z-50 lifts it over a Modal the table may sit in (z-40)
12664
12683
  react_1.default.createElement("div", { className: "relative z-50" },
12665
- react_1.default.createElement(drawer_1.Drawer, { darkMode: (_120 = props.organise) === null || _120 === void 0 ? void 0 : _120.darkMode, darkModeBg: (_121 = props.organise) === null || _121 === void 0 ? void 0 : _121.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,
12666
12685
  // INFO: the record stays set while the drawer slides out — clearing it
12667
12686
  // would remount the hidden panel collection-wide and fetch again. The
12668
12687
  // toolbar's collection-wide button clears it when it opens.
12669
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"
12670
12689
  ? props.title
12671
- : "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((_122 = props.id) !== null && _122 !== void 0 ? _122 : "") : activityId, activityLog: (_123 = props.edit) === null || _123 === void 0 ? void 0 : _123.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,
12672
12691
  // INFO: names the record in the drawer's heading; without it
12673
12692
  // the lookup reads a "title" field most datasheets lack and
12674
12693
  // the heading shows the record's id. A title or name column
12675
12694
  // comes first, then the first text column
12676
- recordTitleColumn: (_126 = ((_125 = (_124 = structure.find(function (eachDS) { return eachDS.id === "title"; })) !== null && _124 !== void 0 ? _124 : structure.find(function (eachDS) { return eachDS.id === "name"; })) !== null && _125 !== void 0 ? _125 : structure.find(function (eachDS) { return eachDS.type === "string"; }))) === null || _126 === void 0 ? void 0 : _126.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),
12677
12696
  renderScrollSentinel()));
12678
12697
  });
12679
12698
  //# sourceMappingURL=index.js.map