blixify-ui-web 1.2.170 → 1.2.172

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.
@@ -456,33 +456,44 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
456
456
  create: false,
457
457
  }), authMethods = _144[0], setAuthMethods = _144[1];
458
458
  var _145 = (0, react_1.useState)(""), selectedAuthMethod = _145[0], setSelectedAuthMethod = _145[1];
459
+ // INFO: the sign-in check of a users datasheet's record is running; the
460
+ // panel shows a spinner rather than nothing, which read as "no login"
461
+ var _146 = (0, react_1.useState)(false), authLoading = _146[0], setAuthLoading = _146[1];
462
+ // INFO: a delete is running — the ref answers a second tap at once, before
463
+ // the state has rendered, and the state disables the confirm button
464
+ var deletingRef = (0, react_1.useRef)(false);
465
+ var _147 = (0, react_1.useState)(false), deleting = _147[0], setDeleting = _147[1];
459
466
  // 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];
467
+ var _148 = (0, react_1.useState)(false), activityModal = _148[0], setActivityModal = _148[1];
468
+ var _149 = (0, react_1.useState)(""), activityId = _149[0], setActivityId = _149[1];
462
469
  //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];
470
+ var _150 = (0, react_1.useState)(null), csvFile = _150[0], setCSVFile = _150[1];
471
+ var _151 = (0, react_1.useState)([]), csvFileData = _151[0], setCSVFileData = _151[1];
472
+ var _152 = (0, react_1.useState)(0), stepCSVIndex = _152[0], setStepCSVIndex = _152[1];
473
+ var _153 = (0, react_1.useState)({}), listCSVMapAttribute = _153[0], setListCSVMapAttribute = _153[1];
474
+ var _154 = (0, react_1.useState)({}), listCSVObjAttribute = _154[0], setListCSVObjAttribute = _154[1];
475
+ var _155 = (0, react_1.useState)([]), csvAPIAttribute = _155[0], setCSVAPIAttribute = _155[1];
476
+ var _156 = (0, react_1.useState)(((_p = props.devSettings.currentUser) === null || _p === void 0 ? void 0 : _p.userEmail) || ""), exportCSVEmail = _156[0], setExportCSVEmail = _156[1];
477
+ 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];
478
+ var _158 = (0, react_1.useState)(false), exportPDFLoading = _158[0], setExportPDFLoading = _158[1];
479
+ var _159 = (0, react_1.useState)(false), exportReadPDFLoading = _159[0], setExportReadPDFLoading = _159[1];
480
+ 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];
481
+ 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];
482
+ var _162 = (0, react_1.useState)([]), importTableData = _162[0], setImportTableData = _162[1];
483
+ var _163 = (0, react_1.useState)([]), queryList = _163[0], setQueryList = _163[1];
484
+ var _164 = (0, react_1.useState)(undefined), allQueryList = _164[0], setAllQueryList = _164[1];
485
+ var _165 = (0, react_1.useState)(-1), queryIndex = _165[0], setQueryIndex = _165[1];
486
+ // INFO: a restored state wins over the prop; its "" is a list the user
487
+ // ungrouped, so it opens ungrouped
488
+ var _166 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
489
+ ? persistedState.groupBy || undefined
490
+ : (_y = props.organise) === null || _y === void 0 ? void 0 : _y.groupBy), groupId = _166[0], setGroupId = _166[1];
480
491
  // INFO: Monday-board per-group paging. Keyed by the group key that
481
492
  // handleBuildNewTableGroups() produces (a list option or "Unknown/No Value").
482
493
  // Each group tracks its own loaded cursor + total so it can lazily load its
483
494
  // next page as the user scrolls inside that band, independent of every other
484
495
  // group. Only used when renderCheckGroupPaging() is true.
485
- var _165 = (0, react_1.useState)({}), groupPageState = _165[0], setGroupPageState = _165[1];
496
+ var _167 = (0, react_1.useState)({}), groupPageState = _167[0], setGroupPageState = _167[1];
486
497
  // INFO: read fresh inside the async per-group fetch so chained scroll fires
487
498
  // in one tick do not re-fetch an already in-flight page.
488
499
  var groupPageStateRef = (0, react_1.useRef)({});
@@ -491,59 +502,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
491
502
  // list was re-read (new search, filter, sort or grouping) is dropped on
492
503
  // arrival instead of appending rows that belong to the old list
493
504
  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];
505
+ var _168 = (0, react_1.useState)(""), readTabSection = _168[0], setReadTabSection = _168[1];
506
+ var _169 = (0, react_1.useState)(false), readFloatingNav = _169[0], setReadFloatingNav = _169[1];
496
507
  var readTabSectionRefs = (0, react_1.useRef)({});
497
508
  //INFO : Used by Read
498
509
  //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 () {
510
+ var _170 = (0, react_1.useState)(false), modalVisible = _170[0], setModalVisible = _170[1];
511
+ var _171 = (0, react_1.useState)(false), deleteModal = _171[0], setDeleteModal = _171[1];
512
+ var _172 = (0, react_1.useState)(false), excelModal = _172[0], setExcelModal = _172[1];
513
+ var _173 = (0, react_1.useState)(false), exportExcel = _173[0], setExportExcel = _173[1];
514
+ var _174 = (0, react_1.useState)(""), exportType = _174[0], setExportType = _174[1];
515
+ var _175 = (0, react_1.useState)(false), exportQR = _175[0], setExportQR = _175[1];
516
+ var _176 = (0, react_1.useState)(function () {
506
517
  var _a, _b;
507
518
  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
519
  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)({
520
+ }), activeTab = _176[0], setActiveTab = _176[1];
521
+ var _177 = (0, react_1.useState)(false), signatureSigning = _177[0], setSignatureSigning = _177[1];
522
+ var _178 = (0, react_1.useState)({}), selectedData = _178[0], setSelectedData = _178[1];
523
+ var _179 = (0, react_1.useState)(""), selectedObjectStructureId = _179[0], setSelectedObjectStructureId = _179[1];
524
+ var _180 = (0, react_1.useState)(""), selectedObjectId = _180[0], setSelectedObjectId = _180[1];
525
+ var _181 = (0, react_1.useState)(""), selectedListAddressId = _181[0], setSelectedListAddressId = _181[1];
526
+ var _182 = (0, react_1.useState)(-1), selectedListAddressIndex = _182[0], setSelectedListAddressIndex = _182[1];
527
+ var _183 = (0, react_1.useState)({
517
528
  lat: 0,
518
529
  lng: 0,
519
530
  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)({
531
+ }), selectedListAddress = _183[0], setSelectedListAddress = _183[1];
532
+ var _184 = (0, react_1.useState)({}), selectedObjectData = _184[0], setSelectedObjectData = _184[1];
533
+ var _185 = (0, react_1.useState)(null), objectCellEdit = _185[0], setObjectCellEdit = _185[1];
534
+ var _186 = (0, react_1.useState)(false), referenceLoading = _186[0], setReferenceLoading = _186[1];
535
+ var _187 = (0, react_1.useState)({}), referencesOptions = _187[0], setReferencesOptions = _187[1];
536
+ var _188 = (0, react_1.useState)({}), referencesDetails = _188[0], setReferencesDetails = _188[1];
537
+ var _189 = (0, react_1.useState)({}), listReferencesOptions = _189[0], setListReferencesOptions = _189[1];
538
+ var _190 = (0, react_1.useState)({}), referenceDeleteTableData = _190[0], setReferenceDeleteTableData = _190[1];
539
+ var _191 = (0, react_1.useState)([]), relatedSections = _191[0], setRelatedSections = _191[1];
540
+ var _192 = (0, react_1.useState)(0), referenceDeleteIndex = _192[0], setReferenceDeleteIndex = _192[1];
541
+ var _193 = (0, react_1.useState)({
531
542
  id: "",
532
543
  name: "",
533
544
  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];
545
+ }), referenceCreationModal = _193[0], setReferenceCreationModal = _193[1];
546
+ var _194 = (0, react_1.useState)({}), referenceModelSchema = _194[0], setReferenceSchema = _194[1];
547
+ var _195 = (0, react_1.useState)([]), kanbanChecked = _195[0], setKanbanChecked = _195[1];
537
548
  //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];
549
+ var _196 = (0, react_1.useState)(0), offlineDataLength = _196[0], setOfflineDataLength = _196[1];
550
+ var _197 = (0, react_1.useState)(false), offlineModal = _197[0], setOfflineModal = _197[1];
540
551
  // 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];
552
+ var _198 = (0, react_1.useState)(false), isLive = _198[0], setIsLive = _198[1];
553
+ var _199 = (0, react_1.useState)(false), isLiveOffline = _199[0], setIsLiveOffline = _199[1];
543
554
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
544
555
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
545
556
  // 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];
557
+ var _200 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _200[0], setIsNetworkOffline = _200[1];
547
558
  var previousType = (0, react_1.useRef)(null);
548
559
  var previousSelectedData = (0, react_1.useRef)(null);
549
560
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -760,7 +771,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
760
771
  var isSchemaHideMode = ((_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.onChangeHide) ? true : false;
761
772
  // INFO: rows per page is a view setting the user can change, so it starts from
762
773
  // 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];
774
+ 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
775
  var limit = pageLimit;
765
776
  var isSavedViewsEnabled = !!((_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.savedViews) && resolvedType === "list";
766
777
  // INFO: an app that stores views takes over from this browser's storage, so
@@ -785,7 +796,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
785
796
  setCursor("");
786
797
  setLastCursor("");
787
798
  };
788
- var _200 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _200.canUpdateRecord, canInlineUpdate = _200.canInlineUpdate, canBatchUpdate = _200.canBatchUpdate, canDeleteRecord = _200.canDeleteRecord;
799
+ var _202 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _202.canUpdateRecord, canInlineUpdate = _202.canInlineUpdate, canBatchUpdate = _202.canBatchUpdate, canDeleteRecord = _202.canDeleteRecord;
789
800
  var isEditor = ((_17 = props.edit) === null || _17 === void 0 ? void 0 : _17.allEditable) ? true : false;
790
801
  var isOffline = (_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareOffline;
791
802
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
@@ -1900,15 +1911,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1900
1911
  }); };
1901
1912
  // INFO : Set Updated Structure — skip on initial mount when persistViewState
1902
1913
  // restored column visibility/order from localStorage
1903
- if (!isPersistEnabled ||
1904
- !persistedState ||
1905
- persistedViewMountedRef.current) {
1914
+ var isRestoringView = isPersistEnabled && !!persistedState && !persistedViewMountedRef.current;
1915
+ if (!isRestoringView) {
1906
1916
  setStructure((_a = props.model) !== null && _a !== void 0 ? _a : []);
1907
1917
  schemaStructureRef.current = null;
1908
1918
  }
1909
1919
  persistedViewMountedRef.current = true;
1910
1920
  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 : "");
1921
+ // INFO: the restored grouping is set at mount; a later change of the
1922
+ // host's groupBy still applies
1923
+ if (!isRestoringView)
1924
+ setGroupId((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.groupBy) !== null && _e !== void 0 ? _e : "");
1912
1925
  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
1926
  var currentTabProps = {
1914
1927
  id: props.id,
@@ -3243,10 +3256,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3243
3256
  return __generator(this, function (_f) {
3244
3257
  switch (_f.label) {
3245
3258
  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)];
3259
+ if (!(props.space && props.space.authDatabase)) return [3 /*break*/, 5];
3260
+ setAuthLoading(true);
3261
+ authProviders = null;
3262
+ _f.label = 1;
3248
3263
  case 1:
3264
+ _f.trys.push([1, , 3, 4]);
3265
+ 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)];
3266
+ case 2:
3249
3267
  authProviders = _f.sent();
3268
+ return [3 /*break*/, 4];
3269
+ case 3:
3270
+ setAuthLoading(false);
3271
+ return [7 /*endfinally*/];
3272
+ case 4:
3250
3273
  if (authProviders)
3251
3274
  setAuthMethods(authProviders);
3252
3275
  else
@@ -3257,8 +3280,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3257
3280
  disabled: false,
3258
3281
  create: true,
3259
3282
  });
3260
- _f.label = 2;
3261
- case 2: return [2 /*return*/];
3283
+ _f.label = 5;
3284
+ case 5: return [2 /*return*/];
3262
3285
  }
3263
3286
  });
3264
3287
  }); };
@@ -4226,14 +4249,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4226
4249
  return __generator(this, function (_f) {
4227
4250
  switch (_f.label) {
4228
4251
  case 0:
4229
- _f.trys.push([0, 16, , 17]);
4252
+ if (deletingRef.current)
4253
+ return [2 /*return*/];
4254
+ deletingRef.current = true;
4255
+ setDeleting(true);
4256
+ _f.label = 1;
4257
+ case 1:
4258
+ _f.trys.push([1, 17, 18, 19]);
4230
4259
  setLoading(true);
4231
4260
  setModalVisible(true);
4232
4261
  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];
4262
+ if (!passcodeMatch) return [3 /*break*/, 15];
4263
+ if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareOffline)) return [3 /*break*/, 4];
4235
4264
  return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
4236
- case 1:
4265
+ case 2:
4237
4266
  offlineDataResp = _f.sent();
4238
4267
  offlineData = (_b = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _b !== void 0 ? _b : [];
4239
4268
  filteredData = offlineData.filter(function (eachOfflineData) {
@@ -4243,31 +4272,31 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4243
4272
  data: filteredData,
4244
4273
  type: props.collectionId,
4245
4274
  })];
4246
- case 2:
4247
- _f.sent();
4248
- return [3 /*break*/, 13];
4249
4275
  case 3:
4276
+ _f.sent();
4277
+ return [3 /*break*/, 14];
4278
+ case 4:
4250
4279
  ids = [];
4251
4280
  notReferenceId = [];
4252
- if (!selectAll) return [3 /*break*/, 7];
4281
+ if (!selectAll) return [3 /*break*/, 8];
4253
4282
  query = renderImpSearchFilterConditions();
4254
4283
  return [4 /*yield*/, readServerQuery.call({
4255
4284
  type: "list",
4256
4285
  query: query,
4257
4286
  stopLimit: true,
4258
4287
  })];
4259
- case 4:
4288
+ case 5:
4260
4289
  responseData = _f.sent();
4261
4290
  return [4 /*yield*/, handleCheckDeleteReference((_c = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _c !== void 0 ? _c : [], true)];
4262
- case 5:
4291
+ case 6:
4263
4292
  notReferenceId = _f.sent();
4264
4293
  return [4 /*yield*/, writeServerQuery.call("batchDelete", {
4265
4294
  id: notReferenceId,
4266
4295
  })];
4267
- case 6:
4296
+ case 7:
4268
4297
  ids = _f.sent();
4269
- return [3 /*break*/, 11];
4270
- case 7: return [4 /*yield*/, readServerQuery.call({
4298
+ return [3 /*break*/, 12];
4299
+ case 8: return [4 /*yield*/, readServerQuery.call({
4271
4300
  type: "list",
4272
4301
  query: [
4273
4302
  {
@@ -4278,18 +4307,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4278
4307
  ],
4279
4308
  stopLimit: true,
4280
4309
  })];
4281
- case 8:
4310
+ case 9:
4282
4311
  responseData = _f.sent();
4283
4312
  return [4 /*yield*/, handleCheckDeleteReference((_d = responseData === null || responseData === void 0 ? void 0 : responseData.data) !== null && _d !== void 0 ? _d : [], true)];
4284
- case 9:
4313
+ case 10:
4285
4314
  notReferenceId = _f.sent();
4286
4315
  return [4 /*yield*/, writeServerQuery.call("batchDelete", {
4287
4316
  id: notReferenceId,
4288
4317
  })];
4289
- case 10:
4290
- ids = _f.sent();
4291
- _f.label = 11;
4292
4318
  case 11:
4319
+ ids = _f.sent();
4320
+ _f.label = 12;
4321
+ case 12:
4293
4322
  data = new FormData();
4294
4323
  data.append("data[assetCollectionName]", props.collectionId);
4295
4324
  data.append("data[assetParentId]", JSON.stringify(ids !== null && ids !== void 0 ? ids : []));
@@ -4304,13 +4333,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4304
4333
  url: "".concat(uploadEndpoint, "/batchDeleteDirectory"),
4305
4334
  headers: { "Content-Type": "multipart/form-data" },
4306
4335
  }))];
4307
- case 12:
4336
+ case 13:
4308
4337
  _f.sent();
4309
4338
  if (mapViewRef.current)
4310
4339
  mapViewRef.current.handleClearPolygons();
4311
- _f.label = 13;
4312
- case 13: return [3 /*break*/, 15];
4313
- case 14:
4340
+ _f.label = 14;
4341
+ case 14: return [3 /*break*/, 16];
4342
+ case 15:
4314
4343
  setNotification({
4315
4344
  type: false,
4316
4345
  title: "Incorrect Passcode",
@@ -4319,11 +4348,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4319
4348
  setLoading(false);
4320
4349
  setModalVisible(false);
4321
4350
  return [2 /*return*/];
4322
- case 15: return [3 /*break*/, 17];
4323
- case 16:
4324
- err_12 = _f.sent();
4325
- return [3 /*break*/, 17];
4351
+ case 16: return [3 /*break*/, 19];
4326
4352
  case 17:
4353
+ err_12 = _f.sent();
4354
+ return [3 /*break*/, 19];
4355
+ case 18:
4356
+ deletingRef.current = false;
4357
+ setDeleting(false);
4358
+ return [7 /*endfinally*/];
4359
+ case 19:
4327
4360
  setDeletePasscodeInput("");
4328
4361
  handleRefresh();
4329
4362
  return [2 /*return*/];
@@ -4331,33 +4364,44 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4331
4364
  });
4332
4365
  }); };
4333
4366
  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;
4367
+ var deleted, deletable, selectedId_1, deleteIds, res, offlineDataResp, offlineData, selectedIndex_2, doc, err_13;
4335
4368
  var _a, _b, _c, _d, _e, _f, _g, _h, _j;
4336
4369
  return __generator(this, function (_k) {
4337
4370
  switch (_k.label) {
4338
4371
  case 0:
4339
- _k.trys.push([0, 13, , 14]);
4372
+ if (deletingRef.current)
4373
+ return [2 /*return*/];
4374
+ deletingRef.current = true;
4375
+ setDeleting(true);
4376
+ // INFO: shown before the reference check, which reads other datasheets
4377
+ // first — without it the confirm sat still and invited a second tap
4378
+ setLoading(true);
4379
+ setModalVisible(true);
4380
+ deleted = false;
4381
+ _k.label = 1;
4382
+ case 1:
4383
+ _k.trys.push([1, 14, 15, 16]);
4340
4384
  deletable = true;
4341
4385
  selectedId_1 = deleteFeedId || props.id;
4342
4386
  return [4 /*yield*/, handleCheckDeleteReference([selectedData])];
4343
- case 1:
4387
+ case 2:
4344
4388
  deleteIds = _k.sent();
4345
4389
  if (deleteIds && deleteIds.length <= 0)
4346
4390
  deletable = false;
4347
- if (!(deletable && ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateHandlePreComplete))) return [3 /*break*/, 3];
4391
+ if (!(deletable && ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateHandlePreComplete))) return [3 /*break*/, 4];
4348
4392
  return [4 /*yield*/, props.bareSettings.bareUpdateHandlePreComplete({}, handleResolveRawData())];
4349
- case 2:
4350
- deletable = _k.sent();
4351
- _k.label = 3;
4352
4393
  case 3:
4353
- if (!(selectedId_1 && deletable)) return [3 /*break*/, 12];
4394
+ deletable = _k.sent();
4395
+ _k.label = 4;
4396
+ case 4:
4397
+ if (!(selectedId_1 && deletable)) return [3 /*break*/, 13];
4354
4398
  setLoading(true);
4355
4399
  setModalVisible(true);
4356
4400
  setDeleteModal(true);
4357
4401
  res = void 0;
4358
- if (!((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareOffline)) return [3 /*break*/, 6];
4402
+ if (!((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareOffline)) return [3 /*break*/, 7];
4359
4403
  return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
4360
- case 4:
4404
+ case 5:
4361
4405
  offlineDataResp = _k.sent();
4362
4406
  offlineData = (_c = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _c !== void 0 ? _c : [];
4363
4407
  selectedIndex_2 = -1;
@@ -4390,41 +4434,51 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
4390
4434
  data: offlineData,
4391
4435
  type: props.collectionId,
4392
4436
  })];
4393
- case 5:
4437
+ case 6:
4394
4438
  _k.sent();
4395
4439
  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:
4440
+ return [3 /*break*/, 10];
4441
+ case 7: return [4 /*yield*/, handleRemoveImage((_d = devSettings.bucketName) !== null && _d !== void 0 ? _d : "")];
4442
+ case 8:
4399
4443
  _k.sent();
4400
4444
  return [4 /*yield*/, writeServerQuery.call("delete", { id: selectedId_1 })];
4401
- case 8:
4402
- res = _k.sent();
4403
- _k.label = 9;
4404
4445
  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())];
4446
+ res = _k.sent();
4447
+ _k.label = 10;
4408
4448
  case 10:
4409
- _k.sent();
4410
- _k.label = 11;
4449
+ if (!res) return [3 /*break*/, 13];
4450
+ if (!((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareUpdateHandlePostComplete)) return [3 /*break*/, 12];
4451
+ return [4 /*yield*/, props.bareSettings.bareUpdateHandlePostComplete({}, handleResolveRawData())];
4411
4452
  case 11:
4453
+ _k.sent();
4454
+ _k.label = 12;
4455
+ case 12:
4456
+ deleted = true;
4412
4457
  if (selectedTab) {
4413
4458
  (_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
4459
  }
4415
4460
  else
4416
4461
  (_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:
4462
+ _k.label = 13;
4463
+ case 13: return [3 /*break*/, 16];
4464
+ case 14:
4420
4465
  err_13 = _k.sent();
4421
4466
  setDeleteModal(false);
4422
4467
  setDeleteFeedId("");
4423
- return [3 /*break*/, 14];
4424
- case 14:
4468
+ return [3 /*break*/, 16];
4469
+ case 15:
4470
+ // INFO: released here so an early return (offline refusal) cannot leave
4471
+ // delete blocked
4472
+ deletingRef.current = false;
4473
+ setDeleting(false);
4474
+ return [7 /*endfinally*/];
4475
+ case 16:
4425
4476
  setLoading(false);
4426
4477
  setDeleteModal(false);
4427
4478
  setModalVisible(false);
4479
+ // INFO: the list it returns to still held the deleted row
4480
+ if (deleted)
4481
+ handleRefresh();
4428
4482
  return [2 /*return*/];
4429
4483
  }
4430
4484
  });
@@ -7752,7 +7806,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7752
7806
  })) })) }));
7753
7807
  };
7754
7808
  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;
7809
+ 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
7810
  var isBottom = ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom) ? true : false;
7757
7811
  var tabs = renderTabs();
7758
7812
  var pages = [
@@ -7800,12 +7854,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7800
7854
  ((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareUpdateActionTop) &&
7801
7855
  !selectedRelated &&
7802
7856
  renderReadBar(),
7803
- anyAuthMethod && (react_1.default.createElement("div", { className: "bg-primary-100 text-gray-700 mt-3 px-5 py-3 rounded" }, renderAuthContent())),
7857
+ (anyAuthMethod ||
7858
+ (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" },
7859
+ react_1.default.createElement(loading_1.Loading, { sizeClassName: "h-6 w-6" }))) : (renderAuthContent()))),
7804
7860
  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" &&
7861
+ 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)))),
7862
+ ((_r = props.bareSettings) === null || _r === void 0 ? void 0 : _r.bareReadComponentPos) !== "top" &&
7807
7863
  renderBareReadComp()),
7808
- !((_r = props.bareSettings) === null || _r === void 0 ? void 0 : _r.bareUpdateActionTop) &&
7864
+ !((_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareUpdateActionTop) &&
7809
7865
  !selectedRelated &&
7810
7866
  renderReadBar()))));
7811
7867
  case "update":
@@ -7817,12 +7873,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7817
7873
  });
7818
7874
  }
7819
7875
  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"),
7876
+ 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
7877
  href: "#",
7822
7878
  current: true,
7823
7879
  });
7824
7880
  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;
7881
+ var disabledOnEnter_1 = (_x = (_w = props.organise) === null || _w === void 0 ? void 0 : _w.disabledOnEnter) !== null && _x !== void 0 ? _x : false;
7826
7882
  structure.map(function (eachModel) {
7827
7883
  var _a;
7828
7884
  var present = false;
@@ -7935,12 +7991,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7935
7991
  }
7936
7992
  }
7937
7993
  };
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";
7994
+ 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);
7995
+ var leftTabAlign = ((_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.tabAlign) === "left" ||
7996
+ ((_1 = props.space) === null || _1 === void 0 ? void 0 : _1.tabAlign) === "left";
7997
+ 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";
7998
+ var stepperTabAlign = ((_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.tabAlign) === "stepper" ||
7999
+ ((_5 = props.space) === null || _5 === void 0 ? void 0 : _5.tabAlign) === "stepper";
7944
8000
  var uniqueTabIds_2 = Array.from(new Set(filterModel_1
7945
8001
  .map(function (item) { return item.tabId; })
7946
8002
  .filter(function (id) { return id !== undefined; })));
@@ -7949,7 +8005,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7949
8005
  if (shouldIncludeOthers) {
7950
8006
  uniqueTabIds_2.push("");
7951
8007
  }
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 : [];
8008
+ 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
8009
  var stepperSteps = uniqueTabIds_2.map(function (eachTabId) {
7954
8010
  var _a, _b;
7955
8011
  var customTabMatch = customTabComponent_1.find(function (eachTab) { return eachTab.tabId === eachTabId; });
@@ -7984,7 +8040,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7984
8040
  props.id && props.id !== "new" && structure.length >= 1 && (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: readQueryHocRef, database: {
7985
8041
  dbModule: dbModule,
7986
8042
  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,
8043
+ 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
8044
  dbEndpoint: devSettings.dbEndpoint,
7989
8045
  dbAPIToken: devSettings.dbAPIToken,
7990
8046
  dbUserToken: devSettings.dbUserToken,
@@ -7992,11 +8048,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7992
8048
  type: "get",
7993
8049
  id: props.id,
7994
8050
  pipeline: pipeline,
7995
- }, offline: ((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareOffline) && isNetworkOffline, onChangeData: handleRetrieveSelectedData, onError: handleGetItemError })),
8051
+ }, offline: ((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareOffline) && isNetworkOffline, onChangeData: handleRetrieveSelectedData, onError: handleGetItemError })),
7996
8052
  renderBreadcrumb(pages),
7997
8053
  react_1.default.createElement("div", { className: "flex flex-col py-2 sm:items-center sm:flex-row" },
7998
8054
  (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)),
8055
+ 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
8056
  props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
8001
8057
  (!isBottom || hasTabAlign_1 || resolvedType === "update") &&
8002
8058
  renderActionButtons(resolvedType, hasTabAlign_1, uniqueTabIds_2)),
@@ -8015,10 +8071,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8015
8071
  var tabId = uniqueTabIds_2[stepIndex];
8016
8072
  handleUpdateTabId(tabId);
8017
8073
  } })),
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) &&
8074
+ ((_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareUpdateComponentAbove) &&
8075
+ ((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareUpdateComponent) &&
8076
+ ((_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareUpdateComponent(selectedData, handleResolveRawData())),
8077
+ ((_16 = props.bareSettings) === null || _16 === void 0 ? void 0 : _16.bareUpdateActionTop) &&
8022
8078
  renderStepBar(uniqueTabIds_2),
8023
8079
  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
8080
  uniqueTabIds_2.map(function (tabId) {
@@ -8040,8 +8096,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8040
8096
  ((_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
8097
  renderDataTemplateFormContent(selectedData, filterByTab, modalFormInputRefs, false, false, undefined, undefined)));
8042
8098
  }),
8043
- !((_16 = props.bareSettings) === null || _16 === void 0 ? void 0 : _16.bareUpdateComponentAbove) &&
8044
- ((_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareUpdateComponent) && (
8099
+ !((_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareUpdateComponentAbove) &&
8100
+ ((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareUpdateComponent) && (
8045
8101
  // INFO: the form is a grid-cols-12. A child with no column span is one
8046
8102
  // column, and a grid item cannot shrink below its longest word, so on a
8047
8103
  // phone it wraps one word per line. `contents` takes this wrapper out of
@@ -8051,20 +8107,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8051
8107
  react_1.default.createElement("div", { className: "contents [&>*:not([class*=col-span])]:col-span-12" }, props.bareSettings.bareUpdateComponent(selectedData, handleResolveRawData())))),
8052
8108
  react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(resolvedType)),
8053
8109
  react_1.default.createElement("div", { className: "mt-8" }, renderListObject(resolvedType)),
8054
- !((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareUpdateActionTop) &&
8110
+ !((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareUpdateActionTop) &&
8055
8111
  renderStepBar(uniqueTabIds_2),
8056
8112
  isBottom &&
8057
8113
  resolvedType !== "update" &&
8058
8114
  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) &&
8115
+ ((_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareUpdateComponentAbove) &&
8116
+ ((_21 = props.bareSettings) === null || _21 === void 0 ? void 0 : _21.bareUpdateComponent) &&
8117
+ ((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareUpdateComponent(selectedData, handleResolveRawData())),
8118
+ ((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareUpdateActionTop) &&
8063
8119
  renderStepBar(uniqueTabIds_2),
8064
8120
  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
8121
  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) && (
8122
+ !((_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareUpdateComponentAbove) &&
8123
+ ((_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareUpdateComponent) && (
8068
8124
  // INFO: the form is a grid-cols-12. A child with no column span is one
8069
8125
  // column, and a grid item cannot shrink below its longest word, so on a
8070
8126
  // phone it wraps one word per line. `contents` takes this wrapper out of
@@ -8074,7 +8130,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8074
8130
  react_1.default.createElement("div", { className: "contents [&>*:not([class*=col-span])]:col-span-12" }, props.bareSettings.bareUpdateComponent(selectedData, handleResolveRawData())))),
8075
8131
  react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(resolvedType)),
8076
8132
  react_1.default.createElement("div", { className: "mt-8" }, renderListObject(resolvedType)),
8077
- !((_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareUpdateActionTop) &&
8133
+ !((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareUpdateActionTop) &&
8078
8134
  renderStepBar(uniqueTabIds_2)))));
8079
8135
  case "list":
8080
8136
  case "union":
@@ -8083,20 +8139,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8083
8139
  var actionComponent = renderActionButtons(resolvedType);
8084
8140
  // INFO: active flex filter count for the icon badge + floating search.
8085
8141
  // 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)
8142
+ var activeFlexFilterCount_1 = ((_27 = props.bareSettings) === null || _27 === void 0 ? void 0 : _27.bareFlexFilters)
8087
8143
  ? (0, listModule_1.renderFlexFilterConditions)(flexFilters, structure).length
8088
8144
  : 0;
8089
8145
  var listReadQueryHOC = (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: listRQueryHocRef, database: {
8090
8146
  dbModule: dbModule,
8091
8147
  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,
8148
+ 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
8149
  dbEndpoint: devSettings.dbEndpoint,
8094
8150
  dbAPIToken: devSettings.dbAPIToken,
8095
8151
  dbUserToken: devSettings.dbUserToken,
8096
- }, cond: handleReadQueryHocCond(), offline: ((_29 = props.bareSettings) === null || _29 === void 0 ? void 0 : _29.bareOffline) && isNetworkOffline, onChangeData: function (data, cond) {
8152
+ }, cond: handleReadQueryHocCond(), offline: ((_30 = props.bareSettings) === null || _30 === void 0 ? void 0 : _30.bareOffline) && isNetworkOffline, onChangeData: function (data, cond) {
8097
8153
  handleGetListData(data, "", "", cond);
8098
8154
  }, onError: handleGetItemError }));
8099
- if ((_30 = props.renderSettings) === null || _30 === void 0 ? void 0 : _30.renderListUI) {
8155
+ if ((_31 = props.renderSettings) === null || _31 === void 0 ? void 0 : _31.renderListUI) {
8100
8156
  return (react_1.default.createElement(react_1.default.Fragment, null,
8101
8157
  listReadQueryHOC,
8102
8158
  props.renderSettings.renderListUI(actionComponent, filterComponent_1, dataComponent)));
@@ -8308,47 +8364,47 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8308
8364
  };
8309
8365
  return (react_1.default.createElement(react_1.default.Fragment, null,
8310
8366
  listReadQueryHOC,
8311
- react_1.default.createElement("div", { className: "flex py-2 ".concat(((_31 = props.bareSettings) === null || _31 === void 0 ? void 0 : _31.bareCompactMode)
8367
+ react_1.default.createElement("div", { className: "flex py-2 ".concat(((_32 = props.bareSettings) === null || _32 === void 0 ? void 0 : _32.bareCompactMode)
8312
8368
  ? // INFO: the grow spacer is hidden on phones (search lives in
8313
8369
  // the floating bar), so the row itself pushes the actions right
8314
8370
  "w-full flex-row flex-wrap sm:flex-nowrap items-end justify-between sm:justify-start"
8315
8371
  : "flex-col md:items-end md:flex-row") },
8316
8372
  (props.title || props.description) && (react_1.default.createElement("div", { className: "flex flex-col" },
8317
8373
  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) &&
8374
+ 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),
8375
+ ((_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareSocketName) &&
8320
8376
  isLive &&
8321
8377
  !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
8378
  react_1.default.createElement("span", { className: "h-1.5 w-1.5 rounded-full bg-green-500" }),
8323
8379
  "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" },
8380
+ ((_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
8381
  react_1.default.createElement("span", { className: "h-1.5 w-1.5 rounded-full bg-orange-400" }),
8326
8382
  "OFFLINE")))),
8327
8383
  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)
8384
+ react_1.default.createElement("div", { className: ((_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareCompactMode)
8329
8385
  ? "hidden sm:block grow"
8330
8386
  : "grow" }),
8331
8387
  react_1.default.createElement("div", { className: "ml-auto flex flex-row items-end" },
8332
8388
  renderListFilterElements(),
8333
8389
  renderListActionElements())),
8334
8390
  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 })),
8391
+ (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
8392
  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) &&
8393
+ ((_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareListMobileFloatingSearch) && (react_1.default.createElement("div", { className: "h-28 md:hidden", "aria-hidden": "true" })),
8394
+ ((_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.bareListMobileFloatingSearch) &&
8339
8395
  (0, listModule_1.renderFloatingMobileSearch)({
8340
8396
  filterSearch: filterSearch,
8341
8397
  handleNameSearch: handleNameSearch,
8342
8398
  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)
8399
+ hideSearch: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.hideSearch,
8400
+ darkMode: (_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.darkMode,
8401
+ floatingOffset: (_43 = props.bareSettings) === null || _43 === void 0 ? void 0 : _43.bareListFloatingActionOffset,
8402
+ hideFilter: !((_44 = props.bareSettings) === null || _44 === void 0 ? void 0 : _44.bareFlexFilters),
8403
+ activeFilterCount: ((_45 = props.bareSettings) === null || _45 === void 0 ? void 0 : _45.bareFlexFilters)
8348
8404
  ? activeFlexFilterCount_1
8349
8405
  : undefined,
8350
8406
  // 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,
8407
+ hidden: selectAll || ((_46 = selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.length) !== null && _46 !== void 0 ? _46 : 0) > 0,
8352
8408
  })));
8353
8409
  default:
8354
8410
  return react_1.default.createElement(react_1.default.Fragment, null);
@@ -8618,19 +8674,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8618
8674
  // group absent from the first page would never appear; those keep the
8619
8675
  // global scroll instead. Firebase pages by document cursor, not by count.
8620
8676
  var renderCheckGroupPaging = function () {
8621
- var _a, _b, _c, _d;
8677
+ var _a, _b, _c, _d, _e, _f;
8622
8678
  var paginationType = renderResolvedPaginationType();
8623
8679
  if (paginationType !== "scroll" && paginationType !== "page")
8624
8680
  return false;
8625
8681
  if (!groupId || isFirebase)
8626
8682
  return false;
8683
+ // INFO: a union list pages by skip, which a per-band cursor cannot express,
8684
+ // so it keeps the single pager and groups the loaded rows
8685
+ if ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.unionCollections) === null || _b === void 0 ? void 0 : _b.length)
8686
+ return false;
8627
8687
  // 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))
8688
+ if (!((_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareNewDTW) ||
8689
+ ((_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListMobileView))
8630
8690
  return false;
8631
8691
  var groupAttributeDS = structure.find(function (eachDS) { return eachDS.id === groupId; });
8632
8692
  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);
8693
+ ((_f = (_e = groupAttributeDS.listSelection) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0) > 0);
8634
8694
  };
8635
8695
  var renderResolvedPaginationType = function () {
8636
8696
  var _a;
@@ -8948,7 +9008,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8948
9008
  // same prettifier so its rows carry the shape of every other row. Returns
8949
9009
  // undefined when the list was re-read while the page was in flight.
8950
9010
  var handleReadGroupPage = function (groupKey, cursor) { return __awaiter(void 0, void 0, void 0, function () {
8951
- var generation, groupAttributeDS, groupQuery, baseQuery, responseData, rawRows, count, prettierRows;
9011
+ var generation, groupAttributeDS, groupQuery, mainCond, responseData, rawRows, count, prettierRows;
8952
9012
  var _a, _b, _c, _d, _e, _f, _g, _h;
8953
9013
  return __generator(this, function (_j) {
8954
9014
  switch (_j.label) {
@@ -8964,14 +9024,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8964
9024
  },
8965
9025
  ]
8966
9026
  : [{ 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
- })];
9027
+ mainCond = handleReadQueryHocCond();
9028
+ 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
9029
  case 1:
8976
9030
  responseData = _j.sent();
8977
9031
  if (generation !== groupPagingGenRef.current)
@@ -10896,7 +10950,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10896
10950
  setDeletePasscodeInput("");
10897
10951
  setDeleteModal(false);
10898
10952
  } }),
10899
- react_1.default.createElement(button_1.Button, { id: "dtw-delete-confirm", text: "Delete", size: "small", type: "danger", onClick: function () {
10953
+ react_1.default.createElement(button_1.Button, { id: "dtw-delete-confirm", text: "Delete", size: "small", type: "danger", disable: deleting, onClick: function () {
10900
10954
  if (selectedTab &&
10901
10955
  selectedTab.viewType === "feeds" &&
10902
10956
  deleteFeedId) {