blixify-ui-web 1.2.170 → 1.2.175

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.
@@ -237,6 +237,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
237
237
  if (drawerPageView && props.type !== "read")
238
238
  setDrawerPageView(false);
239
239
  }, [props.type, props.id, drawerPageView]);
240
+ // INFO: the list keeps rendering while the panel is open, so it never refetches
241
+ // after a record is saved or deleted there. It reloads the current page when
242
+ // the panel closes — in place, so the page, cursor and filters stay as they were.
243
+ var wasDrawerHostRef = (0, react_1.useRef)(isDrawerHost);
244
+ (0, react_1.useEffect)(function () {
245
+ var _a;
246
+ if (wasDrawerHostRef.current && !isDrawerHost && resolvedType === "list")
247
+ (_a = listRQueryHocRef.current) === null || _a === void 0 ? void 0 : _a.handleRefresh();
248
+ wasDrawerHostRef.current = isDrawerHost;
249
+ }, [isDrawerHost]);
240
250
  var intialiseDefaultFilterValues = function () {
241
251
  var _a;
242
252
  var initialFilterSearch = {};
@@ -456,33 +466,44 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
456
466
  create: false,
457
467
  }), authMethods = _144[0], setAuthMethods = _144[1];
458
468
  var _145 = (0, react_1.useState)(""), selectedAuthMethod = _145[0], setSelectedAuthMethod = _145[1];
469
+ // INFO: the sign-in check of a users datasheet's record is running; the
470
+ // panel shows a spinner rather than nothing, which read as "no login"
471
+ var _146 = (0, react_1.useState)(false), authLoading = _146[0], setAuthLoading = _146[1];
472
+ // INFO: a delete is running — the ref answers a second tap at once, before
473
+ // the state has rendered, and the state disables the confirm button
474
+ var deletingRef = (0, react_1.useRef)(false);
475
+ var _147 = (0, react_1.useState)(false), deleting = _147[0], setDeleting = _147[1];
459
476
  // INFO: Used by Activity Log
460
- var _146 = (0, react_1.useState)(false), activityModal = _146[0], setActivityModal = _146[1];
461
- var _147 = (0, react_1.useState)(""), activityId = _147[0], setActivityId = _147[1];
477
+ var _148 = (0, react_1.useState)(false), activityModal = _148[0], setActivityModal = _148[1];
478
+ var _149 = (0, react_1.useState)(""), activityId = _149[0], setActivityId = _149[1];
462
479
  //INFO : Used by Export
463
- var _148 = (0, react_1.useState)(null), csvFile = _148[0], setCSVFile = _148[1];
464
- var _149 = (0, react_1.useState)([]), csvFileData = _149[0], setCSVFileData = _149[1];
465
- var _150 = (0, react_1.useState)(0), stepCSVIndex = _150[0], setStepCSVIndex = _150[1];
466
- var _151 = (0, react_1.useState)({}), listCSVMapAttribute = _151[0], setListCSVMapAttribute = _151[1];
467
- var _152 = (0, react_1.useState)({}), listCSVObjAttribute = _152[0], setListCSVObjAttribute = _152[1];
468
- var _153 = (0, react_1.useState)([]), csvAPIAttribute = _153[0], setCSVAPIAttribute = _153[1];
469
- var _154 = (0, react_1.useState)(((_p = props.devSettings.currentUser) === null || _p === void 0 ? void 0 : _p.userEmail) || ""), exportCSVEmail = _154[0], setExportCSVEmail = _154[1];
470
- var _155 = (0, react_1.useState)(((_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.exportSettings) === null || _r === void 0 ? void 0 : _r.defaultExportPDFName) || ""), exportPDFTitle = _155[0], setExportPDFTitle = _155[1];
471
- var _156 = (0, react_1.useState)(false), exportPDFLoading = _156[0], setExportPDFLoading = _156[1];
472
- var _157 = (0, react_1.useState)(false), exportReadPDFLoading = _157[0], setExportReadPDFLoading = _157[1];
473
- var _158 = (0, react_1.useState)((_u = (_t = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.exportSettings) === null || _t === void 0 ? void 0 : _t.sumColumnId) !== null && _u !== void 0 ? _u : []), exportSumAttributeIds = _158[0], setExportSumAttributeIds = _158[1];
474
- var _159 = (0, react_1.useState)((_x = (_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.exportSettings) === null || _w === void 0 ? void 0 : _w.hideSubItems) !== null && _x !== void 0 ? _x : false), hideSubItems = _159[0], setHideSubItems = _159[1];
475
- var _160 = (0, react_1.useState)([]), importTableData = _160[0], setImportTableData = _160[1];
476
- var _161 = (0, react_1.useState)([]), queryList = _161[0], setQueryList = _161[1];
477
- var _162 = (0, react_1.useState)(undefined), allQueryList = _162[0], setAllQueryList = _162[1];
478
- var _163 = (0, react_1.useState)(-1), queryIndex = _163[0], setQueryIndex = _163[1];
479
- var _164 = (0, react_1.useState)((_y = props.organise) === null || _y === void 0 ? void 0 : _y.groupBy), groupId = _164[0], setGroupId = _164[1];
480
+ var _150 = (0, react_1.useState)(null), csvFile = _150[0], setCSVFile = _150[1];
481
+ var _151 = (0, react_1.useState)([]), csvFileData = _151[0], setCSVFileData = _151[1];
482
+ var _152 = (0, react_1.useState)(0), stepCSVIndex = _152[0], setStepCSVIndex = _152[1];
483
+ var _153 = (0, react_1.useState)({}), listCSVMapAttribute = _153[0], setListCSVMapAttribute = _153[1];
484
+ var _154 = (0, react_1.useState)({}), listCSVObjAttribute = _154[0], setListCSVObjAttribute = _154[1];
485
+ var _155 = (0, react_1.useState)([]), csvAPIAttribute = _155[0], setCSVAPIAttribute = _155[1];
486
+ var _156 = (0, react_1.useState)(((_p = props.devSettings.currentUser) === null || _p === void 0 ? void 0 : _p.userEmail) || ""), exportCSVEmail = _156[0], setExportCSVEmail = _156[1];
487
+ var _157 = (0, react_1.useState)(((_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.exportSettings) === null || _r === void 0 ? void 0 : _r.defaultExportPDFName) || ""), exportPDFTitle = _157[0], setExportPDFTitle = _157[1];
488
+ var _158 = (0, react_1.useState)(false), exportPDFLoading = _158[0], setExportPDFLoading = _158[1];
489
+ var _159 = (0, react_1.useState)(false), exportReadPDFLoading = _159[0], setExportReadPDFLoading = _159[1];
490
+ var _160 = (0, react_1.useState)((_u = (_t = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.exportSettings) === null || _t === void 0 ? void 0 : _t.sumColumnId) !== null && _u !== void 0 ? _u : []), exportSumAttributeIds = _160[0], setExportSumAttributeIds = _160[1];
491
+ var _161 = (0, react_1.useState)((_x = (_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.exportSettings) === null || _w === void 0 ? void 0 : _w.hideSubItems) !== null && _x !== void 0 ? _x : false), hideSubItems = _161[0], setHideSubItems = _161[1];
492
+ var _162 = (0, react_1.useState)([]), importTableData = _162[0], setImportTableData = _162[1];
493
+ var _163 = (0, react_1.useState)([]), queryList = _163[0], setQueryList = _163[1];
494
+ var _164 = (0, react_1.useState)(undefined), allQueryList = _164[0], setAllQueryList = _164[1];
495
+ var _165 = (0, react_1.useState)(-1), queryIndex = _165[0], setQueryIndex = _165[1];
496
+ // INFO: a restored state wins over the prop; its "" is a list the user
497
+ // ungrouped, so it opens ungrouped
498
+ var _166 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
499
+ ? persistedState.groupBy || undefined
500
+ : (_y = props.organise) === null || _y === void 0 ? void 0 : _y.groupBy), groupId = _166[0], setGroupId = _166[1];
480
501
  // INFO: Monday-board per-group paging. Keyed by the group key that
481
502
  // handleBuildNewTableGroups() produces (a list option or "Unknown/No Value").
482
503
  // Each group tracks its own loaded cursor + total so it can lazily load its
483
504
  // next page as the user scrolls inside that band, independent of every other
484
505
  // group. Only used when renderCheckGroupPaging() is true.
485
- var _165 = (0, react_1.useState)({}), groupPageState = _165[0], setGroupPageState = _165[1];
506
+ var _167 = (0, react_1.useState)({}), groupPageState = _167[0], setGroupPageState = _167[1];
486
507
  // INFO: read fresh inside the async per-group fetch so chained scroll fires
487
508
  // in one tick do not re-fetch an already in-flight page.
488
509
  var groupPageStateRef = (0, react_1.useRef)({});
@@ -491,59 +512,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
491
512
  // list was re-read (new search, filter, sort or grouping) is dropped on
492
513
  // arrival instead of appending rows that belong to the old list
493
514
  var groupPagingGenRef = (0, react_1.useRef)(0);
494
- var _166 = (0, react_1.useState)(""), readTabSection = _166[0], setReadTabSection = _166[1];
495
- var _167 = (0, react_1.useState)(false), readFloatingNav = _167[0], setReadFloatingNav = _167[1];
515
+ var _168 = (0, react_1.useState)(""), readTabSection = _168[0], setReadTabSection = _168[1];
516
+ var _169 = (0, react_1.useState)(false), readFloatingNav = _169[0], setReadFloatingNav = _169[1];
496
517
  var readTabSectionRefs = (0, react_1.useRef)({});
497
518
  //INFO : Used by Read
498
519
  //INFO : Used by Update
499
- var _168 = (0, react_1.useState)(false), modalVisible = _168[0], setModalVisible = _168[1];
500
- var _169 = (0, react_1.useState)(false), deleteModal = _169[0], setDeleteModal = _169[1];
501
- var _170 = (0, react_1.useState)(false), excelModal = _170[0], setExcelModal = _170[1];
502
- var _171 = (0, react_1.useState)(false), exportExcel = _171[0], setExportExcel = _171[1];
503
- var _172 = (0, react_1.useState)(""), exportType = _172[0], setExportType = _172[1];
504
- var _173 = (0, react_1.useState)(false), exportQR = _173[0], setExportQR = _173[1];
505
- var _174 = (0, react_1.useState)(function () {
520
+ var _170 = (0, react_1.useState)(false), modalVisible = _170[0], setModalVisible = _170[1];
521
+ var _171 = (0, react_1.useState)(false), deleteModal = _171[0], setDeleteModal = _171[1];
522
+ var _172 = (0, react_1.useState)(false), excelModal = _172[0], setExcelModal = _172[1];
523
+ var _173 = (0, react_1.useState)(false), exportExcel = _173[0], setExportExcel = _173[1];
524
+ var _174 = (0, react_1.useState)(""), exportType = _174[0], setExportType = _174[1];
525
+ var _175 = (0, react_1.useState)(false), exportQR = _175[0], setExportQR = _175[1];
526
+ var _176 = (0, react_1.useState)(function () {
506
527
  var _a, _b;
507
528
  var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
508
529
  return firstTabId;
509
- }), activeTab = _174[0], setActiveTab = _174[1];
510
- var _175 = (0, react_1.useState)(false), signatureSigning = _175[0], setSignatureSigning = _175[1];
511
- var _176 = (0, react_1.useState)({}), selectedData = _176[0], setSelectedData = _176[1];
512
- var _177 = (0, react_1.useState)(""), selectedObjectStructureId = _177[0], setSelectedObjectStructureId = _177[1];
513
- var _178 = (0, react_1.useState)(""), selectedObjectId = _178[0], setSelectedObjectId = _178[1];
514
- var _179 = (0, react_1.useState)(""), selectedListAddressId = _179[0], setSelectedListAddressId = _179[1];
515
- var _180 = (0, react_1.useState)(-1), selectedListAddressIndex = _180[0], setSelectedListAddressIndex = _180[1];
516
- var _181 = (0, react_1.useState)({
530
+ }), activeTab = _176[0], setActiveTab = _176[1];
531
+ var _177 = (0, react_1.useState)(false), signatureSigning = _177[0], setSignatureSigning = _177[1];
532
+ var _178 = (0, react_1.useState)({}), selectedData = _178[0], setSelectedData = _178[1];
533
+ var _179 = (0, react_1.useState)(""), selectedObjectStructureId = _179[0], setSelectedObjectStructureId = _179[1];
534
+ var _180 = (0, react_1.useState)(""), selectedObjectId = _180[0], setSelectedObjectId = _180[1];
535
+ var _181 = (0, react_1.useState)(""), selectedListAddressId = _181[0], setSelectedListAddressId = _181[1];
536
+ var _182 = (0, react_1.useState)(-1), selectedListAddressIndex = _182[0], setSelectedListAddressIndex = _182[1];
537
+ var _183 = (0, react_1.useState)({
517
538
  lat: 0,
518
539
  lng: 0,
519
540
  name: "",
520
- }), selectedListAddress = _181[0], setSelectedListAddress = _181[1];
521
- var _182 = (0, react_1.useState)({}), selectedObjectData = _182[0], setSelectedObjectData = _182[1];
522
- var _183 = (0, react_1.useState)(null), objectCellEdit = _183[0], setObjectCellEdit = _183[1];
523
- var _184 = (0, react_1.useState)(false), referenceLoading = _184[0], setReferenceLoading = _184[1];
524
- var _185 = (0, react_1.useState)({}), referencesOptions = _185[0], setReferencesOptions = _185[1];
525
- var _186 = (0, react_1.useState)({}), referencesDetails = _186[0], setReferencesDetails = _186[1];
526
- var _187 = (0, react_1.useState)({}), listReferencesOptions = _187[0], setListReferencesOptions = _187[1];
527
- var _188 = (0, react_1.useState)({}), referenceDeleteTableData = _188[0], setReferenceDeleteTableData = _188[1];
528
- var _189 = (0, react_1.useState)([]), relatedSections = _189[0], setRelatedSections = _189[1];
529
- var _190 = (0, react_1.useState)(0), referenceDeleteIndex = _190[0], setReferenceDeleteIndex = _190[1];
530
- var _191 = (0, react_1.useState)({
541
+ }), selectedListAddress = _183[0], setSelectedListAddress = _183[1];
542
+ var _184 = (0, react_1.useState)({}), selectedObjectData = _184[0], setSelectedObjectData = _184[1];
543
+ var _185 = (0, react_1.useState)(null), objectCellEdit = _185[0], setObjectCellEdit = _185[1];
544
+ var _186 = (0, react_1.useState)(false), referenceLoading = _186[0], setReferenceLoading = _186[1];
545
+ var _187 = (0, react_1.useState)({}), referencesOptions = _187[0], setReferencesOptions = _187[1];
546
+ var _188 = (0, react_1.useState)({}), referencesDetails = _188[0], setReferencesDetails = _188[1];
547
+ var _189 = (0, react_1.useState)({}), listReferencesOptions = _189[0], setListReferencesOptions = _189[1];
548
+ var _190 = (0, react_1.useState)({}), referenceDeleteTableData = _190[0], setReferenceDeleteTableData = _190[1];
549
+ var _191 = (0, react_1.useState)([]), relatedSections = _191[0], setRelatedSections = _191[1];
550
+ var _192 = (0, react_1.useState)(0), referenceDeleteIndex = _192[0], setReferenceDeleteIndex = _192[1];
551
+ var _193 = (0, react_1.useState)({
531
552
  id: "",
532
553
  name: "",
533
554
  type: "string",
534
- }), referenceCreationModal = _191[0], setReferenceCreationModal = _191[1];
535
- var _192 = (0, react_1.useState)({}), referenceModelSchema = _192[0], setReferenceSchema = _192[1];
536
- var _193 = (0, react_1.useState)([]), kanbanChecked = _193[0], setKanbanChecked = _193[1];
555
+ }), referenceCreationModal = _193[0], setReferenceCreationModal = _193[1];
556
+ var _194 = (0, react_1.useState)({}), referenceModelSchema = _194[0], setReferenceSchema = _194[1];
557
+ var _195 = (0, react_1.useState)([]), kanbanChecked = _195[0], setKanbanChecked = _195[1];
537
558
  //INFO : Offline
538
- var _194 = (0, react_1.useState)(0), offlineDataLength = _194[0], setOfflineDataLength = _194[1];
539
- var _195 = (0, react_1.useState)(false), offlineModal = _195[0], setOfflineModal = _195[1];
559
+ var _196 = (0, react_1.useState)(0), offlineDataLength = _196[0], setOfflineDataLength = _196[1];
560
+ var _197 = (0, react_1.useState)(false), offlineModal = _197[0], setOfflineModal = _197[1];
540
561
  // INFO: live-stream state — driven by socket connection and navigator.onLine
541
- var _196 = (0, react_1.useState)(false), isLive = _196[0], setIsLive = _196[1];
542
- var _197 = (0, react_1.useState)(false), isLiveOffline = _197[0], setIsLiveOffline = _197[1];
562
+ var _198 = (0, react_1.useState)(false), isLive = _198[0], setIsLive = _198[1];
563
+ var _199 = (0, react_1.useState)(false), isLiveOffline = _199[0], setIsLiveOffline = _199[1];
543
564
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
544
565
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
545
566
  // Independent of SSE status so it works even when bareSocketName is not set.
546
- var _198 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _198[0], setIsNetworkOffline = _198[1];
567
+ var _200 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _200[0], setIsNetworkOffline = _200[1];
547
568
  var previousType = (0, react_1.useRef)(null);
548
569
  var previousSelectedData = (0, react_1.useRef)(null);
549
570
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -760,7 +781,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
760
781
  var isSchemaHideMode = ((_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.onChangeHide) ? true : false;
761
782
  // INFO: rows per page is a view setting the user can change, so it starts from
762
783
  // the persisted value and falls back to the consumer's limit
763
- var _199 = (0, react_1.useState)((_12 = (_11 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _11 !== void 0 ? _11 : props.limit) !== null && _12 !== void 0 ? _12 : 10), pageLimit = _199[0], setPageLimit = _199[1];
784
+ var _201 = (0, react_1.useState)((_12 = (_11 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _11 !== void 0 ? _11 : props.limit) !== null && _12 !== void 0 ? _12 : 10), pageLimit = _201[0], setPageLimit = _201[1];
764
785
  var limit = pageLimit;
765
786
  var isSavedViewsEnabled = !!((_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.savedViews) && resolvedType === "list";
766
787
  // INFO: an app that stores views takes over from this browser's storage, so
@@ -785,7 +806,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
785
806
  setCursor("");
786
807
  setLastCursor("");
787
808
  };
788
- var _200 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _200.canUpdateRecord, canInlineUpdate = _200.canInlineUpdate, canBatchUpdate = _200.canBatchUpdate, canDeleteRecord = _200.canDeleteRecord;
809
+ var _202 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _202.canUpdateRecord, canInlineUpdate = _202.canInlineUpdate, canBatchUpdate = _202.canBatchUpdate, canDeleteRecord = _202.canDeleteRecord;
789
810
  var isEditor = ((_17 = props.edit) === null || _17 === void 0 ? void 0 : _17.allEditable) ? true : false;
790
811
  var isOffline = (_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareOffline;
791
812
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
@@ -1900,15 +1921,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1900
1921
  }); };
1901
1922
  // INFO : Set Updated Structure — skip on initial mount when persistViewState
1902
1923
  // restored column visibility/order from localStorage
1903
- if (!isPersistEnabled ||
1904
- !persistedState ||
1905
- persistedViewMountedRef.current) {
1924
+ var isRestoringView = isPersistEnabled && !!persistedState && !persistedViewMountedRef.current;
1925
+ if (!isRestoringView) {
1906
1926
  setStructure((_a = props.model) !== null && _a !== void 0 ? _a : []);
1907
1927
  schemaStructureRef.current = null;
1908
1928
  }
1909
1929
  persistedViewMountedRef.current = true;
1910
1930
  setAdditionalQuery((_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.additionalQuery) !== null && _c !== void 0 ? _c : []);
1911
- setGroupId((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.groupBy) !== null && _e !== void 0 ? _e : "");
1931
+ // INFO: the restored grouping is set at mount; a later change of the
1932
+ // host's groupBy still applies
1933
+ if (!isRestoringView)
1934
+ setGroupId((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.groupBy) !== null && _e !== void 0 ? _e : "");
1912
1935
  setExportPDFTitle((_h = (_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.exportSettings) === null || _g === void 0 ? void 0 : _g.defaultExportPDFName) !== null && _h !== void 0 ? _h : "");
1913
1936
  var currentTabProps = {
1914
1937
  id: props.id,
@@ -3243,10 +3266,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3243
3266
  return __generator(this, function (_f) {
3244
3267
  switch (_f.label) {
3245
3268
  case 0:
3246
- if (!(props.space && props.space.authDatabase)) return [3 /*break*/, 2];
3247
- return [4 /*yield*/, (0, authModule_1.handleAuthMethods)(props.space, (_a = props.id) !== null && _a !== void 0 ? _a : "", (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios)];
3269
+ if (!(props.space && props.space.authDatabase)) return [3 /*break*/, 5];
3270
+ setAuthLoading(true);
3271
+ authProviders = null;
3272
+ _f.label = 1;
3248
3273
  case 1:
3274
+ _f.trys.push([1, , 3, 4]);
3275
+ return [4 /*yield*/, (0, authModule_1.handleAuthMethods)(props.space, (_a = props.id) !== null && _a !== void 0 ? _a : "", (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios)];
3276
+ case 2:
3249
3277
  authProviders = _f.sent();
3278
+ return [3 /*break*/, 4];
3279
+ case 3:
3280
+ setAuthLoading(false);
3281
+ return [7 /*endfinally*/];
3282
+ case 4:
3250
3283
  if (authProviders)
3251
3284
  setAuthMethods(authProviders);
3252
3285
  else
@@ -3257,8 +3290,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3257
3290
  disabled: false,
3258
3291
  create: true,
3259
3292
  });
3260
- _f.label = 2;
3261
- case 2: return [2 /*return*/];
3293
+ _f.label = 5;
3294
+ case 5: return [2 /*return*/];
3262
3295
  }
3263
3296
  });
3264
3297
  }); };
@@ -4226,14 +4259,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4226
4259
  return __generator(this, function (_f) {
4227
4260
  switch (_f.label) {
4228
4261
  case 0:
4229
- _f.trys.push([0, 16, , 17]);
4262
+ if (deletingRef.current)
4263
+ return [2 /*return*/];
4264
+ deletingRef.current = true;
4265
+ setDeleting(true);
4266
+ _f.label = 1;
4267
+ case 1:
4268
+ _f.trys.push([1, 17, 18, 19]);
4230
4269
  setLoading(true);
4231
4270
  setModalVisible(true);
4232
4271
  passcodeMatch = deletePasscodeInput === deletePasscode;
4233
- if (!passcodeMatch) return [3 /*break*/, 14];
4234
- if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareOffline)) return [3 /*break*/, 3];
4272
+ if (!passcodeMatch) return [3 /*break*/, 15];
4273
+ if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareOffline)) return [3 /*break*/, 4];
4235
4274
  return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
4236
- case 1:
4275
+ case 2:
4237
4276
  offlineDataResp = _f.sent();
4238
4277
  offlineData = (_b = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _b !== void 0 ? _b : [];
4239
4278
  filteredData = offlineData.filter(function (eachOfflineData) {
@@ -4243,31 +4282,31 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4243
4282
  data: filteredData,
4244
4283
  type: props.collectionId,
4245
4284
  })];
4246
- case 2:
4247
- _f.sent();
4248
- return [3 /*break*/, 13];
4249
4285
  case 3:
4286
+ _f.sent();
4287
+ return [3 /*break*/, 14];
4288
+ case 4:
4250
4289
  ids = [];
4251
4290
  notReferenceId = [];
4252
- if (!selectAll) return [3 /*break*/, 7];
4291
+ if (!selectAll) return [3 /*break*/, 8];
4253
4292
  query = renderImpSearchFilterConditions();
4254
4293
  return [4 /*yield*/, readServerQuery.call({
4255
4294
  type: "list",
4256
4295
  query: query,
4257
4296
  stopLimit: true,
4258
4297
  })];
4259
- case 4:
4298
+ case 5:
4260
4299
  responseData = _f.sent();
4261
4300
  return [4 /*yield*/, handleCheckDeleteReference((_c = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _c !== void 0 ? _c : [], true)];
4262
- case 5:
4301
+ case 6:
4263
4302
  notReferenceId = _f.sent();
4264
4303
  return [4 /*yield*/, writeServerQuery.call("batchDelete", {
4265
4304
  id: notReferenceId,
4266
4305
  })];
4267
- case 6:
4306
+ case 7:
4268
4307
  ids = _f.sent();
4269
- return [3 /*break*/, 11];
4270
- case 7: return [4 /*yield*/, readServerQuery.call({
4308
+ return [3 /*break*/, 12];
4309
+ case 8: return [4 /*yield*/, readServerQuery.call({
4271
4310
  type: "list",
4272
4311
  query: [
4273
4312
  {
@@ -4278,18 +4317,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4278
4317
  ],
4279
4318
  stopLimit: true,
4280
4319
  })];
4281
- case 8:
4320
+ case 9:
4282
4321
  responseData = _f.sent();
4283
4322
  return [4 /*yield*/, handleCheckDeleteReference((_d = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _d !== void 0 ? _d : [], true)];
4284
- case 9:
4323
+ case 10:
4285
4324
  notReferenceId = _f.sent();
4286
4325
  return [4 /*yield*/, writeServerQuery.call("batchDelete", {
4287
4326
  id: notReferenceId,
4288
4327
  })];
4289
- case 10:
4290
- ids = _f.sent();
4291
- _f.label = 11;
4292
4328
  case 11:
4329
+ ids = _f.sent();
4330
+ _f.label = 12;
4331
+ case 12:
4293
4332
  data = new FormData();
4294
4333
  data.append("data[assetCollectionName]", props.collectionId);
4295
4334
  data.append("data[assetParentId]", JSON.stringify(ids !== null && ids !== void 0 ? ids : []));
@@ -4304,13 +4343,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4304
4343
  url: "".concat(uploadEndpoint, "/batchDeleteDirectory"),
4305
4344
  headers: { "Content-Type": "multipart/form-data" },
4306
4345
  }))];
4307
- case 12:
4346
+ case 13:
4308
4347
  _f.sent();
4309
4348
  if (mapViewRef.current)
4310
4349
  mapViewRef.current.handleClearPolygons();
4311
- _f.label = 13;
4312
- case 13: return [3 /*break*/, 15];
4313
- case 14:
4350
+ _f.label = 14;
4351
+ case 14: return [3 /*break*/, 16];
4352
+ case 15:
4314
4353
  setNotification({
4315
4354
  type: false,
4316
4355
  title: "Incorrect Passcode",
@@ -4319,11 +4358,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4319
4358
  setLoading(false);
4320
4359
  setModalVisible(false);
4321
4360
  return [2 /*return*/];
4322
- case 15: return [3 /*break*/, 17];
4323
- case 16:
4324
- err_12 = _f.sent();
4325
- return [3 /*break*/, 17];
4361
+ case 16: return [3 /*break*/, 19];
4326
4362
  case 17:
4363
+ err_12 = _f.sent();
4364
+ return [3 /*break*/, 19];
4365
+ case 18:
4366
+ deletingRef.current = false;
4367
+ setDeleting(false);
4368
+ return [7 /*endfinally*/];
4369
+ case 19:
4327
4370
  setDeletePasscodeInput("");
4328
4371
  handleRefresh();
4329
4372
  return [2 /*return*/];
@@ -4331,33 +4374,44 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4331
4374
  });
4332
4375
  }); };
4333
4376
  var handleRemoveSelectedData = function () { return __awaiter(void 0, void 0, void 0, function () {
4334
- var deletable, selectedId_1, deleteIds, res, offlineDataResp, offlineData, selectedIndex_2, doc, err_13;
4377
+ var deleted, deletable, selectedId_1, deleteIds, res, offlineDataResp, offlineData, selectedIndex_2, doc, err_13;
4335
4378
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
4336
4379
  return __generator(this, function (_k) {
4337
4380
  switch (_k.label) {
4338
4381
  case 0:
4339
- _k.trys.push([0, 13, , 14]);
4382
+ if (deletingRef.current)
4383
+ return [2 /*return*/];
4384
+ deletingRef.current = true;
4385
+ setDeleting(true);
4386
+ // INFO: shown before the reference check, which reads other datasheets
4387
+ // first — without it the confirm sat still and invited a second tap
4388
+ setLoading(true);
4389
+ setModalVisible(true);
4390
+ deleted = false;
4391
+ _k.label = 1;
4392
+ case 1:
4393
+ _k.trys.push([1, 14, 15, 16]);
4340
4394
  deletable = true;
4341
4395
  selectedId_1 = deleteFeedId || props.id;
4342
4396
  return [4 /*yield*/, handleCheckDeleteReference([selectedData])];
4343
- case 1:
4397
+ case 2:
4344
4398
  deleteIds = _k.sent();
4345
4399
  if (deleteIds && deleteIds.length <= 0)
4346
4400
  deletable = false;
4347
- if (!(deletable && ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateHandlePreComplete))) return [3 /*break*/, 3];
4401
+ if (!(deletable && ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateHandlePreComplete))) return [3 /*break*/, 4];
4348
4402
  return [4 /*yield*/, props.bareSettings.bareUpdateHandlePreComplete({}, handleResolveRawData())];
4349
- case 2:
4350
- deletable = _k.sent();
4351
- _k.label = 3;
4352
4403
  case 3:
4353
- if (!(selectedId_1 && deletable)) return [3 /*break*/, 12];
4404
+ deletable = _k.sent();
4405
+ _k.label = 4;
4406
+ case 4:
4407
+ if (!(selectedId_1 && deletable)) return [3 /*break*/, 13];
4354
4408
  setLoading(true);
4355
4409
  setModalVisible(true);
4356
4410
  setDeleteModal(true);
4357
4411
  res = void 0;
4358
- if (!((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareOffline)) return [3 /*break*/, 6];
4412
+ if (!((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareOffline)) return [3 /*break*/, 7];
4359
4413
  return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
4360
- case 4:
4414
+ case 5:
4361
4415
  offlineDataResp = _k.sent();
4362
4416
  offlineData = (_c = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _c !== void 0 ? _c : [];
4363
4417
  selectedIndex_2 = -1;
@@ -4390,41 +4444,51 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4390
4444
  data: offlineData,
4391
4445
  type: props.collectionId,
4392
4446
  })];
4393
- case 5:
4447
+ case 6:
4394
4448
  _k.sent();
4395
4449
  res = true;
4396
- return [3 /*break*/, 9];
4397
- case 6: return [4 /*yield*/, handleRemoveImage((_d = devSettings.bucketName) !== null && _d !== void 0 ? _d : "")];
4398
- case 7:
4450
+ return [3 /*break*/, 10];
4451
+ case 7: return [4 /*yield*/, handleRemoveImage((_d = devSettings.bucketName) !== null && _d !== void 0 ? _d : "")];
4452
+ case 8:
4399
4453
  _k.sent();
4400
4454
  return [4 /*yield*/, writeServerQuery.call("delete", { id: selectedId_1 })];
4401
- case 8:
4402
- res = _k.sent();
4403
- _k.label = 9;
4404
4455
  case 9:
4405
- if (!res) return [3 /*break*/, 12];
4406
- if (!((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareUpdateHandlePostComplete)) return [3 /*break*/, 11];
4407
- return [4 /*yield*/, props.bareSettings.bareUpdateHandlePostComplete({}, handleResolveRawData())];
4456
+ res = _k.sent();
4457
+ _k.label = 10;
4408
4458
  case 10:
4409
- _k.sent();
4410
- _k.label = 11;
4459
+ if (!res) return [3 /*break*/, 13];
4460
+ if (!((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareUpdateHandlePostComplete)) return [3 /*break*/, 12];
4461
+ return [4 /*yield*/, props.bareSettings.bareUpdateHandlePostComplete({}, handleResolveRawData())];
4411
4462
  case 11:
4463
+ _k.sent();
4464
+ _k.label = 12;
4465
+ case 12:
4466
+ deleted = true;
4412
4467
  if (selectedTab) {
4413
4468
  (_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.handleNavigate) === null || _g === void 0 ? void 0 : _g.call(_f, "list", "", selectedTab.id);
4414
4469
  }
4415
4470
  else
4416
4471
  (_j = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.handleNavigate) === null || _j === void 0 ? void 0 : _j.call(_h, "list", "", "general");
4417
- _k.label = 12;
4418
- case 12: return [3 /*break*/, 14];
4419
- case 13:
4472
+ _k.label = 13;
4473
+ case 13: return [3 /*break*/, 16];
4474
+ case 14:
4420
4475
  err_13 = _k.sent();
4421
4476
  setDeleteModal(false);
4422
4477
  setDeleteFeedId("");
4423
- return [3 /*break*/, 14];
4424
- case 14:
4478
+ return [3 /*break*/, 16];
4479
+ case 15:
4480
+ // INFO: released here so an early return (offline refusal) cannot leave
4481
+ // delete blocked
4482
+ deletingRef.current = false;
4483
+ setDeleting(false);
4484
+ return [7 /*endfinally*/];
4485
+ case 16:
4425
4486
  setLoading(false);
4426
4487
  setDeleteModal(false);
4427
4488
  setModalVisible(false);
4489
+ // INFO: the list it returns to still held the deleted row
4490
+ if (deleted)
4491
+ handleRefresh();
4428
4492
  return [2 /*return*/];
4429
4493
  }
4430
4494
  });
@@ -7752,7 +7816,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7752
7816
  })) })) }));
7753
7817
  };
7754
7818
  var renderContent = function () {
7755
- 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;
7819
+ 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;
7756
7820
  var isBottom = ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom) ? true : false;
7757
7821
  var tabs = renderTabs();
7758
7822
  var pages = [
@@ -7800,12 +7864,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7800
7864
  ((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareUpdateActionTop) &&
7801
7865
  !selectedRelated &&
7802
7866
  renderReadBar(),
7803
- anyAuthMethod && (react_1.default.createElement("div", { className: "bg-primary-100 text-gray-700 mt-3 px-5 py-3 rounded" }, renderAuthContent())),
7867
+ (anyAuthMethod ||
7868
+ (authLoading && ((_o = props.space) === null || _o === void 0 ? void 0 : _o.authDatabase))) && (react_1.default.createElement("div", { className: "bg-primary-100 text-gray-700 mt-3 px-5 py-3 rounded" }, authLoading ? (react_1.default.createElement("div", { className: "flex justify-center py-1", "data-testid": "dtw-auth-loading" },
7869
+ react_1.default.createElement(loading_1.Loading, { sizeClassName: "h-6 w-6" }))) : (renderAuthContent()))),
7804
7870
  react_1.default.createElement("div", { ref: exportReadPDFRef },
7805
- selectedRelated ? (react_1.default.createElement(relatedRecords_1.RelatedRecords, { key: "".concat(props.id, "-").concat(selectedRelated.id), source: selectedRelated.source, recordId: (_o = props.id) !== null && _o !== void 0 ? _o : "", renderList: renderRelatedList })) : (!((_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareReadComponentHide) && (react_1.default.createElement("div", null, renderTabContent(tabs, resolvedType, viewType)))),
7806
- ((_q = props.bareSettings) === null || _q === void 0 ? void 0 : _q.bareReadComponentPos) !== "top" &&
7871
+ selectedRelated ? (react_1.default.createElement(relatedRecords_1.RelatedRecords, { key: "".concat(props.id, "-").concat(selectedRelated.id), source: selectedRelated.source, recordId: (_p = props.id) !== null && _p !== void 0 ? _p : "", renderList: renderRelatedList })) : (!((_q = props.bareSettings) === null || _q === void 0 ? void 0 : _q.bareReadComponentHide) && (react_1.default.createElement("div", null, renderTabContent(tabs, resolvedType, viewType)))),
7872
+ ((_r = props.bareSettings) === null || _r === void 0 ? void 0 : _r.bareReadComponentPos) !== "top" &&
7807
7873
  renderBareReadComp()),
7808
- !((_r = props.bareSettings) === null || _r === void 0 ? void 0 : _r.bareUpdateActionTop) &&
7874
+ !((_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareUpdateActionTop) &&
7809
7875
  !selectedRelated &&
7810
7876
  renderReadBar()))));
7811
7877
  case "update":
@@ -7817,12 +7883,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7817
7883
  });
7818
7884
  }
7819
7885
  pages.push({
7820
- name: (_u = selectedData === null || selectedData === void 0 ? void 0 : selectedData[(_t = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.breadcrumbAttributeId) !== null && _t !== void 0 ? _t : serverId]) !== null && _u !== void 0 ? _u : (props.id ? props.id : "new"),
7886
+ name: (_v = selectedData === null || selectedData === void 0 ? void 0 : selectedData[(_u = (_t = props.organise) === null || _t === void 0 ? void 0 : _t.breadcrumbAttributeId) !== null && _u !== void 0 ? _u : serverId]) !== null && _v !== void 0 ? _v : (props.id ? props.id : "new"),
7821
7887
  href: "#",
7822
7888
  current: true,
7823
7889
  });
7824
7890
  var filterModel_1 = [];
7825
- var disabledOnEnter_1 = (_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.disabledOnEnter) !== null && _w !== void 0 ? _w : false;
7891
+ var disabledOnEnter_1 = (_x = (_w = props.organise) === null || _w === void 0 ? void 0 : _w.disabledOnEnter) !== null && _x !== void 0 ? _x : false;
7826
7892
  structure.map(function (eachModel) {
7827
7893
  var _a;
7828
7894
  var present = false;
@@ -7935,12 +8001,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7935
8001
  }
7936
8002
  }
7937
8003
  };
7938
- var hasTabAlign_1 = ((_x = props.organise) === null || _x === void 0 ? void 0 : _x.tabAlign) || ((_y = props.space) === null || _y === void 0 ? void 0 : _y.tabAlign);
7939
- var leftTabAlign = ((_z = props.organise) === null || _z === void 0 ? void 0 : _z.tabAlign) === "left" ||
7940
- ((_0 = props.space) === null || _0 === void 0 ? void 0 : _0.tabAlign) === "left";
7941
- var topTabAlign = ((_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.tabAlign) === "top" || ((_2 = props.space) === null || _2 === void 0 ? void 0 : _2.tabAlign) === "top";
7942
- var stepperTabAlign = ((_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.tabAlign) === "stepper" ||
7943
- ((_4 = props.space) === null || _4 === void 0 ? void 0 : _4.tabAlign) === "stepper";
8004
+ var hasTabAlign_1 = ((_y = props.organise) === null || _y === void 0 ? void 0 : _y.tabAlign) || ((_z = props.space) === null || _z === void 0 ? void 0 : _z.tabAlign);
8005
+ var leftTabAlign = ((_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.tabAlign) === "left" ||
8006
+ ((_1 = props.space) === null || _1 === void 0 ? void 0 : _1.tabAlign) === "left";
8007
+ var topTabAlign = ((_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.tabAlign) === "top" || ((_3 = props.space) === null || _3 === void 0 ? void 0 : _3.tabAlign) === "top";
8008
+ var stepperTabAlign = ((_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.tabAlign) === "stepper" ||
8009
+ ((_5 = props.space) === null || _5 === void 0 ? void 0 : _5.tabAlign) === "stepper";
7944
8010
  var uniqueTabIds_2 = Array.from(new Set(filterModel_1
7945
8011
  .map(function (item) { return item.tabId; })
7946
8012
  .filter(function (id) { return id !== undefined; })));
@@ -7949,7 +8015,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7949
8015
  if (shouldIncludeOthers) {
7950
8016
  uniqueTabIds_2.push("");
7951
8017
  }
7952
- var customTabComponent_1 = (_7 = (_6 = (_5 = props.bareSettings) === null || _5 === void 0 ? void 0 : _5.bareUpdateTabComponent) === null || _6 === void 0 ? void 0 : _6.call(_5, uniqueTabIds_2)) !== null && _7 !== void 0 ? _7 : [];
8018
+ var customTabComponent_1 = (_8 = (_7 = (_6 = props.bareSettings) === null || _6 === void 0 ? void 0 : _6.bareUpdateTabComponent) === null || _7 === void 0 ? void 0 : _7.call(_6, uniqueTabIds_2)) !== null && _8 !== void 0 ? _8 : [];
7953
8019
  var stepperSteps = uniqueTabIds_2.map(function (eachTabId) {
7954
8020
  var _a, _b;
7955
8021
  var customTabMatch = customTabComponent_1.find(function (eachTab) { return eachTab.tabId === eachTabId; });
@@ -7984,7 +8050,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7984
8050
  props.id && props.id !== "new" && structure.length >= 1 && (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: readQueryHocRef, database: {
7985
8051
  dbModule: dbModule,
7986
8052
  dbType: devSettings.server,
7987
- dbCollection: (_9 = (_8 = props === null || props === void 0 ? void 0 : props.space) === null || _8 === void 0 ? void 0 : _8.pipelineDefaultSpaceId) !== null && _9 !== void 0 ? _9 : props.collectionId,
8053
+ dbCollection: (_10 = (_9 = props === null || props === void 0 ? void 0 : props.space) === null || _9 === void 0 ? void 0 : _9.pipelineDefaultSpaceId) !== null && _10 !== void 0 ? _10 : props.collectionId,
7988
8054
  dbEndpoint: devSettings.dbEndpoint,
7989
8055
  dbAPIToken: devSettings.dbAPIToken,
7990
8056
  dbUserToken: devSettings.dbUserToken,
@@ -7992,11 +8058,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7992
8058
  type: "get",
7993
8059
  id: props.id,
7994
8060
  pipeline: pipeline,
7995
- }, offline: ((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareOffline) && isNetworkOffline, onChangeData: handleRetrieveSelectedData, onError: handleGetItemError })),
8061
+ }, offline: ((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareOffline) && isNetworkOffline, onChangeData: handleRetrieveSelectedData, onError: handleGetItemError })),
7996
8062
  renderBreadcrumb(pages),
7997
8063
  react_1.default.createElement("div", { className: "flex flex-col py-2 sm:items-center sm:flex-row" },
7998
8064
  (props.title || props.description) && (react_1.default.createElement("div", { className: "flex flex-col w-full" },
7999
- props.title && (react_1.default.createElement("p", { className: "text-xl font-medium ".concat(((_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.darkMode) ? "text-white" : "") }, props.title)),
8065
+ props.title && (react_1.default.createElement("p", { className: "text-xl font-medium ".concat(((_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.darkMode) ? "text-white" : "") }, props.title)),
8000
8066
  props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
8001
8067
  (!isBottom || hasTabAlign_1 || resolvedType === "update") &&
8002
8068
  renderActionButtons(resolvedType, hasTabAlign_1, uniqueTabIds_2)),
@@ -8015,10 +8081,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8015
8081
  var tabId = uniqueTabIds_2[stepIndex];
8016
8082
  handleUpdateTabId(tabId);
8017
8083
  } })),
8018
- ((_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareUpdateComponentAbove) &&
8019
- ((_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareUpdateComponent) &&
8020
- ((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareUpdateComponent(selectedData, handleResolveRawData())),
8021
- ((_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareUpdateActionTop) &&
8084
+ ((_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareUpdateComponentAbove) &&
8085
+ ((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareUpdateComponent) &&
8086
+ ((_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareUpdateComponent(selectedData, handleResolveRawData())),
8087
+ ((_16 = props.bareSettings) === null || _16 === void 0 ? void 0 : _16.bareUpdateActionTop) &&
8022
8088
  renderStepBar(uniqueTabIds_2),
8023
8089
  react_1.default.createElement(form_1.Form, { className: "mt-6", ref: formRef, refList: __spreadArray(__spreadArray([], modalFormInputRefs, true), flexTableRefs, true), handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: handleOnFailValidation },
8024
8090
  uniqueTabIds_2.map(function (tabId) {
@@ -8040,8 +8106,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8040
8106
  ((_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.tabDescriptions) === null || _c === void 0 ? void 0 : _c[tabId]) && (react_1.default.createElement("p", { className: "text-sm mt-0.5 ".concat(((_d = props.organise) === null || _d === void 0 ? void 0 : _d.darkMode) ? "text-gray-400" : "text-gray-500") }, props.organise.tabDescriptions[tabId])))),
8041
8107
  renderDataTemplateFormContent(selectedData, filterByTab, modalFormInputRefs, false, false, undefined, undefined)));
8042
8108
  }),
8043
- !((_16 = props.bareSettings) === null || _16 === void 0 ? void 0 : _16.bareUpdateComponentAbove) &&
8044
- ((_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareUpdateComponent) && (
8109
+ !((_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareUpdateComponentAbove) &&
8110
+ ((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareUpdateComponent) && (
8045
8111
  // INFO: the form is a grid-cols-12. A child with no column span is one
8046
8112
  // column, and a grid item cannot shrink below its longest word, so on a
8047
8113
  // phone it wraps one word per line. `contents` takes this wrapper out of
@@ -8051,20 +8117,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8051
8117
  react_1.default.createElement("div", { className: "contents [&>*:not([class*=col-span])]:col-span-12" }, props.bareSettings.bareUpdateComponent(selectedData, handleResolveRawData())))),
8052
8118
  react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(resolvedType)),
8053
8119
  react_1.default.createElement("div", { className: "mt-8" }, renderListObject(resolvedType)),
8054
- !((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareUpdateActionTop) &&
8120
+ !((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareUpdateActionTop) &&
8055
8121
  renderStepBar(uniqueTabIds_2),
8056
8122
  isBottom &&
8057
8123
  resolvedType !== "update" &&
8058
8124
  renderActionButtons(resolvedType, hasTabAlign_1, uniqueTabIds_2)))) : (react_1.default.createElement("div", null,
8059
- ((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareUpdateComponentAbove) &&
8060
- ((_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareUpdateComponent) &&
8061
- ((_21 = props.bareSettings) === null || _21 === void 0 ? void 0 : _21.bareUpdateComponent(selectedData, handleResolveRawData())),
8062
- ((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareUpdateActionTop) &&
8125
+ ((_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareUpdateComponentAbove) &&
8126
+ ((_21 = props.bareSettings) === null || _21 === void 0 ? void 0 : _21.bareUpdateComponent) &&
8127
+ ((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareUpdateComponent(selectedData, handleResolveRawData())),
8128
+ ((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareUpdateActionTop) &&
8063
8129
  renderStepBar(uniqueTabIds_2),
8064
8130
  react_1.default.createElement(form_1.Form, { className: "grid ".concat(formColumn, " ").concat(gridGap, " mt-6"), ref: formRef, refList: __spreadArray(__spreadArray([], modalFormInputRefs, true), flexTableRefs, true), handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: handleOnFailValidation },
8065
8131
  renderDataTemplateFormContent(selectedData, filterModel_1, modalFormInputRefs, false, false),
8066
- !((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareUpdateComponentAbove) &&
8067
- ((_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareUpdateComponent) && (
8132
+ !((_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareUpdateComponentAbove) &&
8133
+ ((_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareUpdateComponent) && (
8068
8134
  // INFO: the form is a grid-cols-12. A child with no column span is one
8069
8135
  // column, and a grid item cannot shrink below its longest word, so on a
8070
8136
  // phone it wraps one word per line. `contents` takes this wrapper out of
@@ -8074,7 +8140,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8074
8140
  react_1.default.createElement("div", { className: "contents [&>*:not([class*=col-span])]:col-span-12" }, props.bareSettings.bareUpdateComponent(selectedData, handleResolveRawData())))),
8075
8141
  react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(resolvedType)),
8076
8142
  react_1.default.createElement("div", { className: "mt-8" }, renderListObject(resolvedType)),
8077
- !((_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareUpdateActionTop) &&
8143
+ !((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareUpdateActionTop) &&
8078
8144
  renderStepBar(uniqueTabIds_2)))));
8079
8145
  case "list":
8080
8146
  case "union":
@@ -8083,20 +8149,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8083
8149
  var actionComponent = renderActionButtons(resolvedType);
8084
8150
  // INFO: active flex filter count for the icon badge + floating search.
8085
8151
  // Counts query output so the badge matches what's actually filtered.
8086
- var activeFlexFilterCount_1 = ((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareFlexFilters)
8152
+ var activeFlexFilterCount_1 = ((_27 = props.bareSettings) === null || _27 === void 0 ? void 0 : _27.bareFlexFilters)
8087
8153
  ? (0, listModule_1.renderFlexFilterConditions)(flexFilters, structure).length
8088
8154
  : 0;
8089
8155
  var listReadQueryHOC = (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: listRQueryHocRef, database: {
8090
8156
  dbModule: dbModule,
8091
8157
  dbType: devSettings.server,
8092
- dbCollection: (_28 = (_27 = props === null || props === void 0 ? void 0 : props.space) === null || _27 === void 0 ? void 0 : _27.pipelineDefaultSpaceId) !== null && _28 !== void 0 ? _28 : props.collectionId,
8158
+ dbCollection: (_29 = (_28 = props === null || props === void 0 ? void 0 : props.space) === null || _28 === void 0 ? void 0 : _28.pipelineDefaultSpaceId) !== null && _29 !== void 0 ? _29 : props.collectionId,
8093
8159
  dbEndpoint: devSettings.dbEndpoint,
8094
8160
  dbAPIToken: devSettings.dbAPIToken,
8095
8161
  dbUserToken: devSettings.dbUserToken,
8096
- }, cond: handleReadQueryHocCond(), offline: ((_29 = props.bareSettings) === null || _29 === void 0 ? void 0 : _29.bareOffline) && isNetworkOffline, onChangeData: function (data, cond) {
8162
+ }, cond: handleReadQueryHocCond(), offline: ((_30 = props.bareSettings) === null || _30 === void 0 ? void 0 : _30.bareOffline) && isNetworkOffline, onChangeData: function (data, cond) {
8097
8163
  handleGetListData(data, "", "", cond);
8098
8164
  }, onError: handleGetItemError }));
8099
- if ((_30 = props.renderSettings) === null || _30 === void 0 ? void 0 : _30.renderListUI) {
8165
+ if ((_31 = props.renderSettings) === null || _31 === void 0 ? void 0 : _31.renderListUI) {
8100
8166
  return (react_1.default.createElement(react_1.default.Fragment, null,
8101
8167
  listReadQueryHOC,
8102
8168
  props.renderSettings.renderListUI(actionComponent, filterComponent_1, dataComponent)));
@@ -8308,47 +8374,47 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8308
8374
  };
8309
8375
  return (react_1.default.createElement(react_1.default.Fragment, null,
8310
8376
  listReadQueryHOC,
8311
- react_1.default.createElement("div", { className: "flex py-2 ".concat(((_31 = props.bareSettings) === null || _31 === void 0 ? void 0 : _31.bareCompactMode)
8377
+ react_1.default.createElement("div", { className: "flex py-2 ".concat(((_32 = props.bareSettings) === null || _32 === void 0 ? void 0 : _32.bareCompactMode)
8312
8378
  ? // INFO: the grow spacer is hidden on phones (search lives in
8313
8379
  // the floating bar), so the row itself pushes the actions right
8314
8380
  "w-full flex-row flex-wrap sm:flex-nowrap items-end justify-between sm:justify-start"
8315
8381
  : "flex-col md:items-end md:flex-row") },
8316
8382
  (props.title || props.description) && (react_1.default.createElement("div", { className: "flex flex-col" },
8317
8383
  props.title && (react_1.default.createElement("div", { className: "flex items-center gap-2" },
8318
- react_1.default.createElement("p", { className: "text-xl font-medium ".concat(((_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.darkMode) ? "text-white" : "") }, props.title),
8319
- ((_33 = props.bareSettings) === null || _33 === void 0 ? void 0 : _33.bareSocketName) &&
8384
+ react_1.default.createElement("p", { className: "text-xl font-medium ".concat(((_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.darkMode) ? "text-white" : "") }, props.title),
8385
+ ((_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareSocketName) &&
8320
8386
  isLive &&
8321
8387
  !isLiveOffline && (react_1.default.createElement("span", { className: "inline-flex items-center gap-1 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-700" },
8322
8388
  react_1.default.createElement("span", { className: "h-1.5 w-1.5 rounded-full bg-green-500" }),
8323
8389
  "LIVE")),
8324
- ((_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareSocketName) && isLiveOffline && (react_1.default.createElement("span", { className: "inline-flex items-center gap-1 rounded-full bg-orange-100 px-2 py-0.5 text-xs font-medium text-orange-700" },
8390
+ ((_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareSocketName) && isLiveOffline && (react_1.default.createElement("span", { className: "inline-flex items-center gap-1 rounded-full bg-orange-100 px-2 py-0.5 text-xs font-medium text-orange-700" },
8325
8391
  react_1.default.createElement("span", { className: "h-1.5 w-1.5 rounded-full bg-orange-400" }),
8326
8392
  "OFFLINE")))),
8327
8393
  props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
8328
- react_1.default.createElement("div", { className: ((_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareCompactMode)
8394
+ react_1.default.createElement("div", { className: ((_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareCompactMode)
8329
8395
  ? "hidden sm:block grow"
8330
8396
  : "grow" }),
8331
8397
  react_1.default.createElement("div", { className: "ml-auto flex flex-row items-end" },
8332
8398
  renderListFilterElements(),
8333
8399
  renderListActionElements())),
8334
8400
  renderListNewRowFilterElements(),
8335
- (schemaPresent || ((_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareReadListTabs)) && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (_37 = props.organise) === null || _37 === void 0 ? void 0 : _37.darkMode })),
8401
+ (schemaPresent || ((_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareReadListTabs)) && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.darkMode })),
8336
8402
  renderScopedTabContent(tabs, resolvedType, viewType),
8337
- ((_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareListMobileFloatingSearch) && (react_1.default.createElement("div", { className: "h-28 md:hidden", "aria-hidden": "true" })),
8338
- ((_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareListMobileFloatingSearch) &&
8403
+ ((_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareListMobileFloatingSearch) && (react_1.default.createElement("div", { className: "h-28 md:hidden", "aria-hidden": "true" })),
8404
+ ((_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.bareListMobileFloatingSearch) &&
8339
8405
  (0, listModule_1.renderFloatingMobileSearch)({
8340
8406
  filterSearch: filterSearch,
8341
8407
  handleNameSearch: handleNameSearch,
8342
8408
  onFilterClick: function () { return setFlexFilterModalOpen(true); },
8343
- hideSearch: (_40 = props.organise) === null || _40 === void 0 ? void 0 : _40.hideSearch,
8344
- darkMode: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.darkMode,
8345
- floatingOffset: (_42 = props.bareSettings) === null || _42 === void 0 ? void 0 : _42.bareListFloatingActionOffset,
8346
- hideFilter: !((_43 = props.bareSettings) === null || _43 === void 0 ? void 0 : _43.bareFlexFilters),
8347
- activeFilterCount: ((_44 = props.bareSettings) === null || _44 === void 0 ? void 0 : _44.bareFlexFilters)
8409
+ hideSearch: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.hideSearch,
8410
+ darkMode: (_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.darkMode,
8411
+ floatingOffset: (_43 = props.bareSettings) === null || _43 === void 0 ? void 0 : _43.bareListFloatingActionOffset,
8412
+ hideFilter: !((_44 = props.bareSettings) === null || _44 === void 0 ? void 0 : _44.bareFlexFilters),
8413
+ activeFilterCount: ((_45 = props.bareSettings) === null || _45 === void 0 ? void 0 : _45.bareFlexFilters)
8348
8414
  ? activeFlexFilterCount_1
8349
8415
  : undefined,
8350
8416
  // INFO: Hides when items are selected so NewTable's multi-action bar takes over.
8351
- hidden: selectAll || ((_45 = selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.length) !== null && _45 !== void 0 ? _45 : 0) > 0,
8417
+ hidden: selectAll || ((_46 = selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.length) !== null && _46 !== void 0 ? _46 : 0) > 0,
8352
8418
  })));
8353
8419
  default:
8354
8420
  return react_1.default.createElement(react_1.default.Fragment, null);
@@ -8618,19 +8684,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8618
8684
  // group absent from the first page would never appear; those keep the
8619
8685
  // global scroll instead. Firebase pages by document cursor, not by count.
8620
8686
  var renderCheckGroupPaging = function () {
8621
- var _a, _b, _c, _d;
8687
+ var _a, _b, _c, _d, _e, _f;
8622
8688
  var paginationType = renderResolvedPaginationType();
8623
8689
  if (paginationType !== "scroll" && paginationType !== "page")
8624
8690
  return false;
8625
8691
  if (!groupId || isFirebase)
8626
8692
  return false;
8693
+ // INFO: a union list pages by skip, which a per-band cursor cannot express,
8694
+ // so it keeps the single pager and groups the loaded rows
8695
+ if ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.unionCollections) === null || _b === void 0 ? void 0 : _b.length)
8696
+ return false;
8697
+ // INFO: bands are drawn only by the table (and a report tab); a calendar,
8698
+ // map, kanban or other tab reads its own rows, which band pages would
8699
+ // replace with one page per group
8700
+ if (selectedTab &&
8701
+ selectedTab.id !== "general" &&
8702
+ selectedTab.viewType !== "report")
8703
+ return false;
8627
8704
  // INFO: the mobile list draws no bands, so it keeps the normal pagination
8628
- if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW) ||
8629
- ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListMobileView))
8705
+ if (!((_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareNewDTW) ||
8706
+ ((_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListMobileView))
8630
8707
  return false;
8631
8708
  var groupAttributeDS = structure.find(function (eachDS) { return eachDS.id === groupId; });
8632
8709
  return ((groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.type) === "list" &&
8633
- ((_d = (_c = groupAttributeDS.listSelection) === null || _c === void 0 ? void 0 : _c.length) !== null && _d !== void 0 ? _d : 0) > 0);
8710
+ ((_f = (_e = groupAttributeDS.listSelection) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0) > 0);
8634
8711
  };
8635
8712
  var renderResolvedPaginationType = function () {
8636
8713
  var _a;
@@ -8948,7 +9025,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8948
9025
  // same prettifier so its rows carry the shape of every other row. Returns
8949
9026
  // undefined when the list was re-read while the page was in flight.
8950
9027
  var handleReadGroupPage = function (groupKey, cursor) { return __awaiter(void 0, void 0, void 0, function () {
8951
- var generation, groupAttributeDS, groupQuery, baseQuery, responseData, rawRows, count, prettierRows;
9028
+ var generation, groupAttributeDS, groupQuery, mainCond, responseData, rawRows, count, prettierRows;
8952
9029
  var _a, _b, _c, _d, _e, _f, _g, _h;
8953
9030
  return __generator(this, function (_j) {
8954
9031
  switch (_j.label) {
@@ -8964,14 +9041,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8964
9041
  },
8965
9042
  ]
8966
9043
  : [{ type: "=", queryId: groupId !== null && groupId !== void 0 ? groupId : "", value: groupKey }];
8967
- baseQuery = (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : [];
8968
- return [4 /*yield*/, readServerQuery.call({
8969
- type: "list",
8970
- query: __spreadArray(__spreadArray([], baseQuery, true), groupQuery, true),
8971
- cursor: cursor,
8972
- limit: limit,
8973
- sort: handleReadQueryHocSort(baseQuery),
8974
- })];
9044
+ mainCond = handleReadQueryHocCond();
9045
+ return [4 /*yield*/, readServerQuery.call(__assign(__assign({}, mainCond), { query: __spreadArray(__spreadArray([], ((_b = mainCond.query) !== null && _b !== void 0 ? _b : []), true), groupQuery, true), cursor: cursor, limit: limit, stopLimit: undefined, skip: 0 }))];
8975
9046
  case 1:
8976
9047
  responseData = _j.sent();
8977
9048
  if (generation !== groupPagingGenRef.current)
@@ -10896,7 +10967,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10896
10967
  setDeletePasscodeInput("");
10897
10968
  setDeleteModal(false);
10898
10969
  } }),
10899
- react_1.default.createElement(button_1.Button, { id: "dtw-delete-confirm", text: "Delete", size: "small", type: "danger", onClick: function () {
10970
+ react_1.default.createElement(button_1.Button, { id: "dtw-delete-confirm", text: "Delete", size: "small", type: "danger", disable: deleting, onClick: function () {
10900
10971
  if (selectedTab &&
10901
10972
  selectedTab.viewType === "feeds" &&
10902
10973
  deleteFeedId) {