blixify-ui-web 1.2.181 → 1.2.183

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/lib/components/data/dataTemplate/activityChanges.d.ts.map +1 -1
  2. package/lib/components/data/dataTemplate/activityChanges.js +1 -0
  3. package/lib/components/data/dataTemplate/activityChanges.js.map +1 -1
  4. package/lib/components/data/dataTemplate/index.d.ts +1 -0
  5. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  6. package/lib/components/data/dataTemplate/index.js +664 -419
  7. package/lib/components/data/dataTemplate/index.js.map +1 -1
  8. package/lib/components/data/dataTemplate/model.d.ts +11 -2
  9. package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
  10. package/lib/components/data/flexFilter/index.d.ts.map +1 -1
  11. package/lib/components/data/flexFilter/index.js +41 -14
  12. package/lib/components/data/flexFilter/index.js.map +1 -1
  13. package/lib/components/data/formula/builder.d.ts +19 -0
  14. package/lib/components/data/formula/builder.d.ts.map +1 -0
  15. package/lib/components/data/formula/builder.js +189 -0
  16. package/lib/components/data/formula/builder.js.map +1 -0
  17. package/lib/components/data/formula/functions.d.ts +22 -0
  18. package/lib/components/data/formula/functions.d.ts.map +1 -0
  19. package/lib/components/data/formula/functions.js +773 -0
  20. package/lib/components/data/formula/functions.js.map +1 -0
  21. package/lib/components/data/formula/index.d.ts +75 -0
  22. package/lib/components/data/formula/index.d.ts.map +1 -0
  23. package/lib/components/data/formula/index.js +801 -0
  24. package/lib/components/data/formula/index.js.map +1 -0
  25. package/lib/components/data/listModule.d.ts.map +1 -1
  26. package/lib/components/data/listModule.js +7 -1
  27. package/lib/components/data/listModule.js.map +1 -1
  28. package/lib/components/data/readModule.d.ts.map +1 -1
  29. package/lib/components/data/readModule.js +25 -2
  30. package/lib/components/data/readModule.js.map +1 -1
  31. package/lib/components/data/utils.d.ts.map +1 -1
  32. package/lib/components/data/utils.js +4 -0
  33. package/lib/components/data/utils.js.map +1 -1
  34. package/lib/components/display/newTable/index.d.ts +1 -0
  35. package/lib/components/display/newTable/index.d.ts.map +1 -1
  36. package/lib/components/display/newTable/index.js +85 -30
  37. package/lib/components/display/newTable/index.js.map +1 -1
  38. package/lib/tail.css +2 -2
  39. package/package.json +1 -1
@@ -82,7 +82,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
82
82
  return (mod && mod.__esModule) ? mod : { "default": mod };
83
83
  };
84
84
  Object.defineProperty(exports, "__esModule", { value: true });
85
- exports.DataTemplate = void 0;
85
+ exports.DataTemplate = exports.FORMULA_VIEW_MAX_ROWS = void 0;
86
86
  var outline_1 = require("@heroicons/react/24/outline");
87
87
  var HeroIcons = __importStar(require("@heroicons/react/24/solid"));
88
88
  // INFO: the outline bookmark, for a tab that is not the default one. HeroIcons
@@ -135,8 +135,8 @@ var link_1 = require("../../structure/link");
135
135
  var authModule_1 = require("../authModule");
136
136
  var blobModule_1 = require("../blobModule");
137
137
  var listModule_1 = require("../listModule");
138
+ var formula_1 = require("../formula");
138
139
  var moduleUtils_1 = require("../moduleUtils");
139
- var queryForm_1 = require("../queryForm");
140
140
  var readModule_1 = require("../readModule");
141
141
  var readQuery_1 = require("../readQuery");
142
142
  var unionPagination_1 = require("./unionPagination");
@@ -146,7 +146,6 @@ var utils_1 = require("../utils");
146
146
  var writeQuery_1 = require("../writeQuery");
147
147
  var activityModal_1 = require("./activityModal");
148
148
  var authModal_1 = require("./authModal");
149
- var dataStateModel_1 = require("./dataStateModel");
150
149
  var indexedDb_1 = require("./indexedDb");
151
150
  var socket_1 = require("./socket");
152
151
  var newPagination_1 = require("../../display/newPagination");
@@ -187,6 +186,9 @@ var handleIsEmptyElement = function (element) {
187
186
  };
188
187
  // INFO: rows-per-page choices offered in the view settings panel
189
188
  var PAGE_LIMIT_OPTIONS = [10, 25, 50, 100];
189
+ // INFO: the most rows a formula sort or filter reads into the browser; each is
190
+ // evaluated, filtered and ordered locally, so a larger read could freeze the tab
191
+ exports.FORMULA_VIEW_MAX_ROWS = 5000;
190
192
  var CALENDAR_VIEW_BY_SWITCH = {
191
193
  month: "dayGridMonth",
192
194
  week: "timeGridWeek",
@@ -212,10 +214,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
212
214
  // Every read of the view type below uses resolvedType. The distinction matters
213
215
  // most in effect dependency arrays — following props.type there would leave
214
216
  // the list never refetching while the panel is open, which fails silently.
215
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92;
217
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94;
216
218
  // INFO: the panel cannot navigate its way out — handleNavigate("read") is
217
219
  // routed straight back into it — so expand-to-full-page is local state.
218
- var _93 = (0, react_1.useState)(false), drawerPageView = _93[0], setDrawerPageView = _93[1];
220
+ var _95 = (0, react_1.useState)(false), drawerPageView = _95[0], setDrawerPageView = _95[1];
219
221
  // INFO: the panel keeps rendering the record it was opened with rather than
220
222
  // live props. Without this, navigating back to the list would re-render the
221
223
  // still-mounted panel as a second list behind the overlay.
@@ -307,18 +309,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
307
309
  initialFilterReferenceDate: initialFilterReferenceDate,
308
310
  };
309
311
  };
310
- var _94 = intialiseDefaultFilterValues(), initialFilterSearch = _94.initialFilterSearch, initialFilterSearchParams = _94.initialFilterSearchParams, initialFilterSelection = _94.initialFilterSelection, initialFilterReference = _94.initialFilterReference, initialFilterReferenceDate = _94.initialFilterReferenceDate;
312
+ var _96 = intialiseDefaultFilterValues(), initialFilterSearch = _96.initialFilterSearch, initialFilterSearchParams = _96.initialFilterSearchParams, initialFilterSelection = _96.initialFilterSelection, initialFilterReference = _96.initialFilterReference, initialFilterReferenceDate = _96.initialFilterReferenceDate;
311
313
  // INFO: Persist view state hook — handles storage read/write for filter/sort/column state
312
- var _95 = (0, viewStatePersistence_1.usePersistedViewState)({
314
+ var _97 = (0, viewStatePersistence_1.usePersistedViewState)({
313
315
  mode: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.persistViewState,
314
316
  collectionId: props.collectionId,
315
317
  persistKey: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey,
316
318
  type: resolvedType,
317
- }), rawPersistedState = _95.persistedState, isPersistEnabled = _95.isEnabled, handleSaveView = _95.handleSaveView, handleRegisterViewSnapshot = _95.handleRegisterViewSnapshot;
319
+ }), rawPersistedState = _97.persistedState, isPersistEnabled = _97.isEnabled, handleSaveView = _97.handleSaveView, handleRegisterViewSnapshot = _97.handleRegisterViewSnapshot;
318
320
  // INFO: drop stored filters/sort on removed columns — they would empty the table
319
321
  var persistedState = (0, react_1.useMemo)(function () { return (0, viewStatePersistence_1.handlePruneStaleColumns)(rawPersistedState, props.model); }, [rawPersistedState, props.model]);
320
- var _96 = (0, react_1.useState)(false), loading = _96[0], setLoading = _96[1];
321
- var _97 = (0, react_1.useState)(), notification = _97[0], setNotification = _97[1];
322
+ var _98 = (0, react_1.useState)(false), loading = _98[0], setLoading = _98[1];
323
+ var _99 = (0, react_1.useState)(), notification = _99[0], setNotification = _99[1];
322
324
  // INFO: a success toast is confirmation, not a decision — it clears itself so
323
325
  // it never sits on the floating step bar; errors stay until dismissed
324
326
  (0, react_1.useEffect)(function () {
@@ -328,63 +330,62 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
328
330
  return function () { return clearTimeout(timer); };
329
331
  }, [notification]);
330
332
  //INFO : Used by List
331
- var _98 = (0, react_1.useState)((_d = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _d !== void 0 ? _d : initialFilterSearch), filterSearch = _98[0], setFilterSearch = _98[1];
332
- var _99 = (0, react_1.useState)((_e = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _e !== void 0 ? _e : initialFilterSearchParams), filterSearchParams = _99[0], setFilterSearchParams = _99[1];
333
- var _100 = (0, react_1.useState)((_f = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _f !== void 0 ? _f : initialFilterSelection), filterSelection = _100[0], setFilterSelection = _100[1];
334
- var _101 = (0, react_1.useState)((_g = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _g !== void 0 ? _g : initialFilterReference), filterReference = _101[0], setFilterReference = _101[1];
335
- var _102 = (0, react_1.useState)({}), filterReferenceSearch = _102[0], setFilterReferenceSearch = _102[1];
336
- var _103 = (0, react_1.useState)({}), filterReferenceList = _103[0], setFilterReferenceList = _103[1];
337
- var _104 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
333
+ var _100 = (0, react_1.useState)((_d = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _d !== void 0 ? _d : initialFilterSearch), filterSearch = _100[0], setFilterSearch = _100[1];
334
+ var _101 = (0, react_1.useState)((_e = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _e !== void 0 ? _e : initialFilterSearchParams), filterSearchParams = _101[0], setFilterSearchParams = _101[1];
335
+ var _102 = (0, react_1.useState)((_f = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _f !== void 0 ? _f : initialFilterSelection), filterSelection = _102[0], setFilterSelection = _102[1];
336
+ var _103 = (0, react_1.useState)((_g = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _g !== void 0 ? _g : initialFilterReference), filterReference = _103[0], setFilterReference = _103[1];
337
+ var _104 = (0, react_1.useState)({}), filterReferenceSearch = _104[0], setFilterReferenceSearch = _104[1];
338
+ var _105 = (0, react_1.useState)({}), filterReferenceList = _105[0], setFilterReferenceList = _105[1];
339
+ var _106 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
338
340
  ? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
339
- : initialFilterReferenceDate), filterReferenceDate = _104[0], setFilterReferenceDate = _104[1];
340
- var _105 = (0, react_1.useState)(true), tableLoading = _105[0], setTableLoading = _105[1];
341
- var _106 = (0, react_1.useState)(""), cursor = _106[0], setCursor = _106[1];
342
- var _107 = (0, react_1.useState)(""), lastCursor = _107[0], setLastCursor = _107[1];
343
- var _108 = (0, react_1.useState)([]), tableData = _108[0], setTableData = _108[1];
344
- var _109 = (0, react_1.useState)([]), spaceTableData = _109[0], setSpaceTableData = _109[1];
341
+ : initialFilterReferenceDate), filterReferenceDate = _106[0], setFilterReferenceDate = _106[1];
342
+ var _107 = (0, react_1.useState)(true), tableLoading = _107[0], setTableLoading = _107[1];
343
+ var _108 = (0, react_1.useState)(""), cursor = _108[0], setCursor = _108[1];
344
+ var _109 = (0, react_1.useState)(""), lastCursor = _109[0], setLastCursor = _109[1];
345
+ var _110 = (0, react_1.useState)([]), tableData = _110[0], setTableData = _110[1];
346
+ var _111 = (0, react_1.useState)([]), spaceTableData = _111[0], setSpaceTableData = _111[1];
345
347
  // INFO: a save resolves after later renders, so it reads the table from here —
346
348
  // the state it closed over can predate an earlier save on the same row
347
349
  var tableDataRef = (0, react_1.useRef)([]);
348
350
  var spaceTableDataRef = (0, react_1.useRef)([]);
349
351
  tableDataRef.current = tableData;
350
352
  spaceTableDataRef.current = spaceTableData;
351
- var _110 = (0, react_1.useState)(0), size = _110[0], setSize = _110[1];
352
- var _111 = (0, react_1.useState)((_k = (_h = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _h !== void 0 ? _h : (_j = props.organise) === null || _j === void 0 ? void 0 : _j.pageIndex) !== null && _k !== void 0 ? _k : 0), pageIndex = _111[0], setPageIndex = _111[1];
353
- var _112 = (0, react_1.useState)([]), selectedIds = _112[0], setSelectedIds = _112[1];
354
- var _113 = (0, react_1.useState)(false), selectAll = _113[0], setSelectAll = _113[1];
355
- var _114 = (0, react_1.useState)(""), deletePasscode = _114[0], setDeletePasscode = _114[1];
356
- var _115 = (0, react_1.useState)(""), deletePasscodeInput = _115[0], setDeletePasscodeInput = _115[1];
357
- var _116 = (0, react_1.useState)(""), deleteFeedId = _116[0], setDeleteFeedId = _116[1];
353
+ var _112 = (0, react_1.useState)(0), size = _112[0], setSize = _112[1];
354
+ var _113 = (0, react_1.useState)((_k = (_h = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _h !== void 0 ? _h : (_j = props.organise) === null || _j === void 0 ? void 0 : _j.pageIndex) !== null && _k !== void 0 ? _k : 0), pageIndex = _113[0], setPageIndex = _113[1];
355
+ var _114 = (0, react_1.useState)([]), selectedIds = _114[0], setSelectedIds = _114[1];
356
+ var _115 = (0, react_1.useState)(false), selectAll = _115[0], setSelectAll = _115[1];
357
+ var _116 = (0, react_1.useState)(""), deletePasscode = _116[0], setDeletePasscode = _116[1];
358
+ var _117 = (0, react_1.useState)(""), deletePasscodeInput = _117[0], setDeletePasscodeInput = _117[1];
359
+ var _118 = (0, react_1.useState)(""), deleteFeedId = _118[0], setDeleteFeedId = _118[1];
358
360
  //INFO : Used by List Organise
359
361
  // INFO: Internal sort state that overrides props.organise?.sort when
360
362
  // persistViewState is enabled and a persisted sort exists
361
- var _117 = (0, react_1.useState)((_l = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _l !== void 0 ? _l : undefined), persistedSort = _117[0], setPersistedSort = _117[1];
362
- var _118 = (0, react_1.useState)(false), filterDraft = _118[0], setFilterDraft = _118[1];
363
- var _119 = (0, react_1.useState)(false), addTabModal = _119[0], setAddTabModal = _119[1];
364
- var _120 = (0, react_1.useState)(-1), editTabIndex = _120[0], setEditTabIndex = _120[1];
363
+ var _119 = (0, react_1.useState)((_l = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _l !== void 0 ? _l : undefined), persistedSort = _119[0], setPersistedSort = _119[1];
364
+ var _120 = (0, react_1.useState)(false), filterDraft = _120[0], setFilterDraft = _120[1];
365
+ var _121 = (0, react_1.useState)(false), addTabModal = _121[0], setAddTabModal = _121[1];
366
+ var _122 = (0, react_1.useState)(-1), editTabIndex = _122[0], setEditTabIndex = _122[1];
365
367
  //INFO : resolve the initial tab synchronously so the mount cond is already
366
368
  // tab-scoped — an empty initial tab caused a second wasted list fetch
367
- var _121 = (0, react_1.useState)(function () {
369
+ var _123 = (0, react_1.useState)(function () {
368
370
  var _a, _b;
369
371
  return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.viewId);
370
- }), selectedTab = _121[0], setSelectedTab = _121[1];
371
- var _122 = (0, react_1.useState)("dayGridMonth"), calendarView = _122[0], setCalendarView = _122[1];
372
+ }), selectedTab = _123[0], setSelectedTab = _123[1];
373
+ var _124 = (0, react_1.useState)("dayGridMonth"), calendarView = _124[0], setCalendarView = _124[1];
372
374
  // INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
373
375
  // (calendarView above drives the matching range query)
374
- var _123 = (0, react_1.useState)("month"), newCalendarViewMode = _123[0], setNewCalendarViewMode = _123[1];
375
- var _124 = (0, react_1.useState)(new Date()), calendarTabMonth = _124[0], setCalendarTabMonth = _124[1];
376
+ var _125 = (0, react_1.useState)("month"), newCalendarViewMode = _125[0], setNewCalendarViewMode = _125[1];
377
+ var _126 = (0, react_1.useState)(new Date()), calendarTabMonth = _126[0], setCalendarTabMonth = _126[1];
376
378
  // INFO: defaultViewSwitch picks the opening view only — the tab re-inits
377
379
  // whenever its settings change, and that must not undo the user's switch
378
380
  var calendarViewInitRef = (0, react_1.useRef)(false);
379
- var _125 = (0, react_1.useState)(true), kanbanDroppable = _125[0], setKanbanDroppable = _125[1];
380
- var _126 = (0, react_1.useState)([]), kanbanOptions = _126[0], setKanbanOptions = _126[1];
381
- var _127 = (0, react_1.useState)(false), queryForm = _127[0], setQueryForm = _127[1];
382
- var _128 = (0, react_1.useState)(false), batchUpdateModal = _128[0], setBatchUpdateModal = _128[1];
383
- var _129 = (0, react_1.useState)({
381
+ var _127 = (0, react_1.useState)(true), kanbanDroppable = _127[0], setKanbanDroppable = _127[1];
382
+ var _128 = (0, react_1.useState)([]), kanbanOptions = _128[0], setKanbanOptions = _128[1];
383
+ var _129 = (0, react_1.useState)(false), batchUpdateModal = _129[0], setBatchUpdateModal = _129[1];
384
+ var _130 = (0, react_1.useState)({
384
385
  columnId: "",
385
386
  columnData: {},
386
- }), batchUpdateData = _129[0], setBatchUpdateData = _129[1];
387
- var _130 = (0, react_1.useState)(function () {
387
+ }), batchUpdateData = _130[0], setBatchUpdateData = _130[1];
388
+ var _131 = (0, react_1.useState)(function () {
388
389
  var baseModel = (props === null || props === void 0 ? void 0 : props.model) || [];
389
390
  if (!persistedState)
390
391
  return baseModel;
@@ -410,8 +411,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
410
411
  });
411
412
  }
412
413
  return model;
413
- }), structure = _130[0], setStructure = _130[1];
414
- var _131 = (0, react_1.useState)(((_m = props === null || props === void 0 ? void 0 : props.organise) === null || _m === void 0 ? void 0 : _m.additionalQuery) || []), additionalQuery = _131[0], setAdditionalQuery = _131[1];
414
+ }), structure = _131[0], setStructure = _131[1];
415
+ var _132 = (0, react_1.useState)(((_m = props === null || props === void 0 ? void 0 : props.organise) === null || _m === void 0 ? void 0 : _m.additionalQuery) || []), additionalQuery = _132[0], setAdditionalQuery = _132[1];
415
416
  // INFO: State for user-configurable flex filters (Monday.com-style)
416
417
  // INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
417
418
  var defaultFlexFilterRow = [
@@ -422,9 +423,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
422
423
  value: undefined,
423
424
  },
424
425
  ];
425
- var _132 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
426
+ var _133 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
426
427
  ? persistedState.flexFilters
427
- : defaultFlexFilterRow), flexFilters = _132[0], setFlexFilters = _132[1];
428
+ : defaultFlexFilterRow), flexFilters = _133[0], setFlexFilters = _133[1];
428
429
  // INFO: always-current mirror of flexFilters, read by the imperative apply/
429
430
  // clear methods so chained calls in one tick aren't stale.
430
431
  var flexFiltersRef = (0, react_1.useRef)(flexFilters);
@@ -437,74 +438,76 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
437
438
  }, [flexFilters]);
438
439
  // INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
439
440
  // to prevent API calls on every keystroke when typing in value inputs
440
- var _133 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
441
+ var _134 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
441
442
  ? persistedState.flexFilters
442
- : defaultFlexFilterRow), flexFiltersDebounced = _133[0], setFlexFiltersDebounced = _133[1];
443
- var _134 = (0, react_1.useState)({}), flexFilterReferenceOptions = _134[0], setFlexFilterReferenceOptions = _134[1];
444
- var _135 = (0, react_1.useState)({}), flexFilterReferenceSearch = _135[0], setFlexFilterReferenceSearch = _135[1];
445
- var _136 = (0, react_1.useState)(false), flexFilterModalOpen = _136[0], setFlexFilterModalOpen = _136[1];
446
- var _137 = (0, react_1.useState)(false), viewSettingsModalOpen = _137[0], setViewSettingsModalOpen = _137[1];
443
+ : defaultFlexFilterRow), flexFiltersDebounced = _134[0], setFlexFiltersDebounced = _134[1];
444
+ // INFO: the filter rows of the export being set up — started from the
445
+ // list's own when the export opens, so changing them leaves the list as it is
446
+ var _135 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _135[0], setExportFlexFilters = _135[1];
447
+ var _136 = (0, react_1.useState)({}), flexFilterReferenceOptions = _136[0], setFlexFilterReferenceOptions = _136[1];
448
+ var _137 = (0, react_1.useState)({}), flexFilterReferenceSearch = _137[0], setFlexFilterReferenceSearch = _137[1];
449
+ var _138 = (0, react_1.useState)(false), flexFilterModalOpen = _138[0], setFlexFilterModalOpen = _138[1];
450
+ var _139 = (0, react_1.useState)(false), viewSettingsModalOpen = _139[0], setViewSettingsModalOpen = _139[1];
447
451
  // INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
448
452
  // Deliberately kept out of `structure`: the props-sync effect below resets
449
453
  // structure to props.model whenever props change, which would wipe the
450
454
  // choice, and the persist effect derives schema-level hiddenColumnIds from
451
455
  // structure — writing user hides there would blur the two concepts.
452
- var _138 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _o !== void 0 ? _o : []), userHiddenColumnIds = _138[0], setUserHiddenColumnIds = _138[1];
453
- var _139 = (0, react_1.useState)(""), columnSearch = _139[0], setColumnSearch = _139[1];
454
- var _140 = (0, react_1.useState)([]), savedViews = _140[0], setSavedViews = _140[1];
455
- var _141 = (0, react_1.useState)(null), activeSavedViewId = _141[0], setActiveSavedViewId = _141[1];
456
+ var _140 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _o !== void 0 ? _o : []), userHiddenColumnIds = _140[0], setUserHiddenColumnIds = _140[1];
457
+ var _141 = (0, react_1.useState)(""), columnSearch = _141[0], setColumnSearch = _141[1];
458
+ var _142 = (0, react_1.useState)([]), savedViews = _142[0], setSavedViews = _142[1];
459
+ var _143 = (0, react_1.useState)(null), activeSavedViewId = _143[0], setActiveSavedViewId = _143[1];
456
460
  // INFO: null while the name box is closed
457
- var _142 = (0, react_1.useState)(null), savedViewName = _142[0], setSavedViewName = _142[1];
458
- var _143 = (0, react_1.useState)(null), deletingSavedViewId = _143[0], setDeletingSavedViewId = _143[1];
459
- var _144 = (0, react_1.useState)(null), draggingColumnId = _144[0], setDraggingColumnId = _144[1];
461
+ var _144 = (0, react_1.useState)(null), savedViewName = _144[0], setSavedViewName = _144[1];
462
+ var _145 = (0, react_1.useState)(null), deletingSavedViewId = _145[0], setDeletingSavedViewId = _145[1];
463
+ var _146 = (0, react_1.useState)(null), draggingColumnId = _146[0], setDraggingColumnId = _146[1];
460
464
  var columnRowRefs = (0, react_1.useRef)({});
461
465
  //INFO : Used by Auth
462
- var _145 = (0, react_1.useState)({
466
+ var _147 = (0, react_1.useState)({
463
467
  email: "",
464
468
  google: "",
465
469
  phone: "",
466
470
  disabled: false,
467
471
  create: false,
468
- }), authMethods = _145[0], setAuthMethods = _145[1];
469
- var _146 = (0, react_1.useState)(""), selectedAuthMethod = _146[0], setSelectedAuthMethod = _146[1];
472
+ }), authMethods = _147[0], setAuthMethods = _147[1];
473
+ var _148 = (0, react_1.useState)(""), selectedAuthMethod = _148[0], setSelectedAuthMethod = _148[1];
470
474
  // INFO: the sign-in check of a users datasheet's record is running; the
471
475
  // panel shows a spinner rather than nothing, which read as "no login"
472
- var _147 = (0, react_1.useState)(false), authLoading = _147[0], setAuthLoading = _147[1];
476
+ var _149 = (0, react_1.useState)(false), authLoading = _149[0], setAuthLoading = _149[1];
473
477
  // INFO: a delete is running — the ref answers a second tap at once, before
474
478
  // the state has rendered, and the state disables the confirm button
475
479
  var deletingRef = (0, react_1.useRef)(false);
476
- var _148 = (0, react_1.useState)(false), deleting = _148[0], setDeleting = _148[1];
480
+ var _150 = (0, react_1.useState)(false), deleting = _150[0], setDeleting = _150[1];
477
481
  // INFO: Used by Activity Log
478
- var _149 = (0, react_1.useState)(false), activityModal = _149[0], setActivityModal = _149[1];
479
- var _150 = (0, react_1.useState)(""), activityId = _150[0], setActivityId = _150[1];
482
+ var _151 = (0, react_1.useState)(false), activityModal = _151[0], setActivityModal = _151[1];
483
+ var _152 = (0, react_1.useState)(""), activityId = _152[0], setActivityId = _152[1];
480
484
  //INFO : Used by Export
481
- var _151 = (0, react_1.useState)(null), csvFile = _151[0], setCSVFile = _151[1];
482
- var _152 = (0, react_1.useState)([]), csvFileData = _152[0], setCSVFileData = _152[1];
483
- var _153 = (0, react_1.useState)(0), stepCSVIndex = _153[0], setStepCSVIndex = _153[1];
484
- var _154 = (0, react_1.useState)({}), listCSVMapAttribute = _154[0], setListCSVMapAttribute = _154[1];
485
- var _155 = (0, react_1.useState)({}), listCSVObjAttribute = _155[0], setListCSVObjAttribute = _155[1];
486
- var _156 = (0, react_1.useState)([]), csvAPIAttribute = _156[0], setCSVAPIAttribute = _156[1];
487
- var _157 = (0, react_1.useState)(((_p = props.devSettings.currentUser) === null || _p === void 0 ? void 0 : _p.userEmail) || ""), exportCSVEmail = _157[0], setExportCSVEmail = _157[1];
488
- var _158 = (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 = _158[0], setExportPDFTitle = _158[1];
489
- var _159 = (0, react_1.useState)(false), exportPDFLoading = _159[0], setExportPDFLoading = _159[1];
490
- var _160 = (0, react_1.useState)(false), exportReadPDFLoading = _160[0], setExportReadPDFLoading = _160[1];
491
- var _161 = (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 = _161[0], setExportSumAttributeIds = _161[1];
492
- var _162 = (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 = _162[0], setHideSubItems = _162[1];
493
- var _163 = (0, react_1.useState)([]), importTableData = _163[0], setImportTableData = _163[1];
494
- var _164 = (0, react_1.useState)([]), queryList = _164[0], setQueryList = _164[1];
495
- var _165 = (0, react_1.useState)(undefined), allQueryList = _165[0], setAllQueryList = _165[1];
496
- var _166 = (0, react_1.useState)(-1), queryIndex = _166[0], setQueryIndex = _166[1];
485
+ var _153 = (0, react_1.useState)(null), csvFile = _153[0], setCSVFile = _153[1];
486
+ var _154 = (0, react_1.useState)([]), csvFileData = _154[0], setCSVFileData = _154[1];
487
+ var _155 = (0, react_1.useState)(0), stepCSVIndex = _155[0], setStepCSVIndex = _155[1];
488
+ var _156 = (0, react_1.useState)({}), listCSVMapAttribute = _156[0], setListCSVMapAttribute = _156[1];
489
+ var _157 = (0, react_1.useState)({}), listCSVObjAttribute = _157[0], setListCSVObjAttribute = _157[1];
490
+ var _158 = (0, react_1.useState)([]), csvAPIAttribute = _158[0], setCSVAPIAttribute = _158[1];
491
+ var _159 = (0, react_1.useState)(((_p = props.devSettings.currentUser) === null || _p === void 0 ? void 0 : _p.userEmail) || ""), exportCSVEmail = _159[0], setExportCSVEmail = _159[1];
492
+ var _160 = (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 = _160[0], setExportPDFTitle = _160[1];
493
+ var _161 = (0, react_1.useState)(false), exportPDFLoading = _161[0], setExportPDFLoading = _161[1];
494
+ var _162 = (0, react_1.useState)(false), exportReadPDFLoading = _162[0], setExportReadPDFLoading = _162[1];
495
+ var _163 = (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 = _163[0], setExportSumAttributeIds = _163[1];
496
+ var _164 = (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 = _164[0], setHideSubItems = _164[1];
497
+ var _165 = (0, react_1.useState)([]), importTableData = _165[0], setImportTableData = _165[1];
498
+ var _166 = (0, react_1.useState)([]), queryList = _166[0], setQueryList = _166[1];
499
+ var _167 = (0, react_1.useState)(undefined), allQueryList = _167[0], setAllQueryList = _167[1];
497
500
  // INFO: a restored state wins over the prop; its "" is a list the user
498
501
  // ungrouped, so it opens ungrouped
499
- var _167 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
502
+ var _168 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
500
503
  ? persistedState.groupBy || undefined
501
- : (_y = props.organise) === null || _y === void 0 ? void 0 : _y.groupBy), groupId = _167[0], setGroupId = _167[1];
504
+ : (_y = props.organise) === null || _y === void 0 ? void 0 : _y.groupBy), groupId = _168[0], setGroupId = _168[1];
502
505
  // INFO: Monday-board per-group paging. Keyed by the group key that
503
506
  // handleBuildNewTableGroups() produces (a list option or "Unknown/No Value").
504
507
  // Each group tracks its own loaded cursor + total so it can lazily load its
505
508
  // next page as the user scrolls inside that band, independent of every other
506
509
  // group. Only used when renderCheckGroupPaging() is true.
507
- var _168 = (0, react_1.useState)({}), groupPageState = _168[0], setGroupPageState = _168[1];
510
+ var _169 = (0, react_1.useState)({}), groupPageState = _169[0], setGroupPageState = _169[1];
508
511
  // INFO: read fresh inside the async per-group fetch so chained scroll fires
509
512
  // in one tick do not re-fetch an already in-flight page.
510
513
  var groupPageStateRef = (0, react_1.useRef)({});
@@ -513,59 +516,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
513
516
  // list was re-read (new search, filter, sort or grouping) is dropped on
514
517
  // arrival instead of appending rows that belong to the old list
515
518
  var groupPagingGenRef = (0, react_1.useRef)(0);
516
- var _169 = (0, react_1.useState)(""), readTabSection = _169[0], setReadTabSection = _169[1];
517
- var _170 = (0, react_1.useState)(false), readFloatingNav = _170[0], setReadFloatingNav = _170[1];
519
+ var _170 = (0, react_1.useState)(""), readTabSection = _170[0], setReadTabSection = _170[1];
520
+ var _171 = (0, react_1.useState)(false), readFloatingNav = _171[0], setReadFloatingNav = _171[1];
518
521
  var readTabSectionRefs = (0, react_1.useRef)({});
519
522
  //INFO : Used by Read
520
523
  //INFO : Used by Update
521
- var _171 = (0, react_1.useState)(false), modalVisible = _171[0], setModalVisible = _171[1];
522
- var _172 = (0, react_1.useState)(false), deleteModal = _172[0], setDeleteModal = _172[1];
523
- var _173 = (0, react_1.useState)(false), excelModal = _173[0], setExcelModal = _173[1];
524
- var _174 = (0, react_1.useState)(false), exportExcel = _174[0], setExportExcel = _174[1];
525
- var _175 = (0, react_1.useState)(""), exportType = _175[0], setExportType = _175[1];
526
- var _176 = (0, react_1.useState)(false), exportQR = _176[0], setExportQR = _176[1];
527
- var _177 = (0, react_1.useState)(function () {
524
+ var _172 = (0, react_1.useState)(false), modalVisible = _172[0], setModalVisible = _172[1];
525
+ var _173 = (0, react_1.useState)(false), deleteModal = _173[0], setDeleteModal = _173[1];
526
+ var _174 = (0, react_1.useState)(false), excelModal = _174[0], setExcelModal = _174[1];
527
+ var _175 = (0, react_1.useState)(false), exportExcel = _175[0], setExportExcel = _175[1];
528
+ var _176 = (0, react_1.useState)(""), exportType = _176[0], setExportType = _176[1];
529
+ var _177 = (0, react_1.useState)(false), exportQR = _177[0], setExportQR = _177[1];
530
+ var _178 = (0, react_1.useState)(function () {
528
531
  var _a, _b;
529
532
  var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
530
533
  return firstTabId;
531
- }), activeTab = _177[0], setActiveTab = _177[1];
532
- var _178 = (0, react_1.useState)(false), signatureSigning = _178[0], setSignatureSigning = _178[1];
533
- var _179 = (0, react_1.useState)({}), selectedData = _179[0], setSelectedData = _179[1];
534
- var _180 = (0, react_1.useState)(""), selectedObjectStructureId = _180[0], setSelectedObjectStructureId = _180[1];
535
- var _181 = (0, react_1.useState)(""), selectedObjectId = _181[0], setSelectedObjectId = _181[1];
536
- var _182 = (0, react_1.useState)(""), selectedListAddressId = _182[0], setSelectedListAddressId = _182[1];
537
- var _183 = (0, react_1.useState)(-1), selectedListAddressIndex = _183[0], setSelectedListAddressIndex = _183[1];
538
- var _184 = (0, react_1.useState)({
534
+ }), activeTab = _178[0], setActiveTab = _178[1];
535
+ var _179 = (0, react_1.useState)(false), signatureSigning = _179[0], setSignatureSigning = _179[1];
536
+ var _180 = (0, react_1.useState)({}), selectedData = _180[0], setSelectedData = _180[1];
537
+ var _181 = (0, react_1.useState)(""), selectedObjectStructureId = _181[0], setSelectedObjectStructureId = _181[1];
538
+ var _182 = (0, react_1.useState)(""), selectedObjectId = _182[0], setSelectedObjectId = _182[1];
539
+ var _183 = (0, react_1.useState)(""), selectedListAddressId = _183[0], setSelectedListAddressId = _183[1];
540
+ var _184 = (0, react_1.useState)(-1), selectedListAddressIndex = _184[0], setSelectedListAddressIndex = _184[1];
541
+ var _185 = (0, react_1.useState)({
539
542
  lat: 0,
540
543
  lng: 0,
541
544
  name: "",
542
- }), selectedListAddress = _184[0], setSelectedListAddress = _184[1];
543
- var _185 = (0, react_1.useState)({}), selectedObjectData = _185[0], setSelectedObjectData = _185[1];
544
- var _186 = (0, react_1.useState)(null), objectCellEdit = _186[0], setObjectCellEdit = _186[1];
545
- var _187 = (0, react_1.useState)(false), referenceLoading = _187[0], setReferenceLoading = _187[1];
546
- var _188 = (0, react_1.useState)({}), referencesOptions = _188[0], setReferencesOptions = _188[1];
547
- var _189 = (0, react_1.useState)({}), referencesDetails = _189[0], setReferencesDetails = _189[1];
548
- var _190 = (0, react_1.useState)({}), listReferencesOptions = _190[0], setListReferencesOptions = _190[1];
549
- var _191 = (0, react_1.useState)({}), referenceDeleteTableData = _191[0], setReferenceDeleteTableData = _191[1];
550
- var _192 = (0, react_1.useState)([]), relatedSections = _192[0], setRelatedSections = _192[1];
551
- var _193 = (0, react_1.useState)(0), referenceDeleteIndex = _193[0], setReferenceDeleteIndex = _193[1];
552
- var _194 = (0, react_1.useState)({
545
+ }), selectedListAddress = _185[0], setSelectedListAddress = _185[1];
546
+ var _186 = (0, react_1.useState)({}), selectedObjectData = _186[0], setSelectedObjectData = _186[1];
547
+ var _187 = (0, react_1.useState)(null), objectCellEdit = _187[0], setObjectCellEdit = _187[1];
548
+ var _188 = (0, react_1.useState)(false), referenceLoading = _188[0], setReferenceLoading = _188[1];
549
+ var _189 = (0, react_1.useState)({}), referencesOptions = _189[0], setReferencesOptions = _189[1];
550
+ var _190 = (0, react_1.useState)({}), referencesDetails = _190[0], setReferencesDetails = _190[1];
551
+ var _191 = (0, react_1.useState)({}), listReferencesOptions = _191[0], setListReferencesOptions = _191[1];
552
+ var _192 = (0, react_1.useState)({}), referenceDeleteTableData = _192[0], setReferenceDeleteTableData = _192[1];
553
+ var _193 = (0, react_1.useState)([]), relatedSections = _193[0], setRelatedSections = _193[1];
554
+ var _194 = (0, react_1.useState)(0), referenceDeleteIndex = _194[0], setReferenceDeleteIndex = _194[1];
555
+ var _195 = (0, react_1.useState)({
553
556
  id: "",
554
557
  name: "",
555
558
  type: "string",
556
- }), referenceCreationModal = _194[0], setReferenceCreationModal = _194[1];
557
- var _195 = (0, react_1.useState)({}), referenceModelSchema = _195[0], setReferenceSchema = _195[1];
558
- var _196 = (0, react_1.useState)([]), kanbanChecked = _196[0], setKanbanChecked = _196[1];
559
+ }), referenceCreationModal = _195[0], setReferenceCreationModal = _195[1];
560
+ var _196 = (0, react_1.useState)({}), referenceModelSchema = _196[0], setReferenceSchema = _196[1];
561
+ var _197 = (0, react_1.useState)([]), kanbanChecked = _197[0], setKanbanChecked = _197[1];
559
562
  //INFO : Offline
560
- var _197 = (0, react_1.useState)(0), offlineDataLength = _197[0], setOfflineDataLength = _197[1];
561
- var _198 = (0, react_1.useState)(false), offlineModal = _198[0], setOfflineModal = _198[1];
563
+ var _198 = (0, react_1.useState)(0), offlineDataLength = _198[0], setOfflineDataLength = _198[1];
564
+ var _199 = (0, react_1.useState)(false), offlineModal = _199[0], setOfflineModal = _199[1];
562
565
  // INFO: live-stream state — driven by socket connection and navigator.onLine
563
- var _199 = (0, react_1.useState)(false), isLive = _199[0], setIsLive = _199[1];
564
- var _200 = (0, react_1.useState)(false), isLiveOffline = _200[0], setIsLiveOffline = _200[1];
566
+ var _200 = (0, react_1.useState)(false), isLive = _200[0], setIsLive = _200[1];
567
+ var _201 = (0, react_1.useState)(false), isLiveOffline = _201[0], setIsLiveOffline = _201[1];
565
568
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
566
569
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
567
570
  // Independent of SSE status so it works even when bareSocketName is not set.
568
- var _201 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _201[0], setIsNetworkOffline = _201[1];
571
+ var _202 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _202[0], setIsNetworkOffline = _202[1];
569
572
  var previousType = (0, react_1.useRef)(null);
570
573
  var previousSelectedData = (0, react_1.useRef)(null);
571
574
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -785,7 +788,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
785
788
  var isSchemaHideMode = ((_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.onChangeHide) ? true : false;
786
789
  // INFO: rows per page is a view setting the user can change, so it starts from
787
790
  // the persisted value and falls back to the consumer's limit
788
- var _202 = (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 = _202[0], setPageLimit = _202[1];
791
+ var _203 = (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 = _203[0], setPageLimit = _203[1];
789
792
  var limit = pageLimit;
790
793
  var isSavedViewsEnabled = !!((_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.savedViews) && resolvedType === "list";
791
794
  // INFO: an app that stores views takes over from this browser's storage, so
@@ -810,18 +813,88 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
810
813
  setCursor("");
811
814
  setLastCursor("");
812
815
  };
813
- var _203 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _203.canUpdateRecord, canInlineUpdate = _203.canInlineUpdate, canBatchUpdate = _203.canBatchUpdate, canDeleteRecord = _203.canDeleteRecord;
814
- var isEditor = ((_17 = props.edit) === null || _17 === void 0 ? void 0 : _17.allEditable) ? true : false;
815
- var isOffline = (_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareOffline;
816
+ //=====================================================================================
817
+ //SECTION: Formula columns — sorted and filtered on their computed value
818
+ //=====================================================================================
819
+ // INFO: a formula has no stored field, so a server sort or filter on one
820
+ // matches nothing. monday sorts and filters a formula on the value it shows,
821
+ // so the list does the same: the request leaves the formula out, reads every
822
+ // matching row, and the rows are filtered and ordered here. Only
823
+ // type "formula" columns take part — math columns behave as they always have.
824
+ var formulaColumnIds = structure
825
+ .filter(function (eachModel) { return eachModel.type === "formula"; })
826
+ .map(function (eachModel) { return eachModel.id; });
827
+ // INFO: Firebase pages by document cursor and a union by skip, so neither
828
+ // can hand over the whole set — there formula columns are not offered for
829
+ // sorting or filtering, rather than ordering one page
830
+ var isFormulaViewSupported = !isFirebase && !((_18 = (_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.unionCollections) === null || _18 === void 0 ? void 0 : _18.length);
831
+ var formulaSort = isFormulaViewSupported &&
832
+ (activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) &&
833
+ formulaColumnIds.includes(activeSortId.sortId)
834
+ ? activeSortId
835
+ : undefined;
836
+ var formulaFlexQueries = isFormulaViewSupported && formulaColumnIds.length > 0
837
+ ? (0, listModule_1.renderFlexFilterConditions)(flexFiltersDebounced, structure).filter(function (eachQuery) { var _a; return formulaColumnIds.includes((_a = eachQuery.queryId) !== null && _a !== void 0 ? _a : ""); })
838
+ : [];
839
+ var isFormulaView = !!formulaSort || formulaFlexQueries.length > 0;
840
+ // INFO: the columns the flex filters offer — formulas only where they can
841
+ // be filtered on
842
+ var flexFilterStructure = isFormulaViewSupported
843
+ ? structure
844
+ : structure.filter(function (eachModel) { return eachModel.type !== "formula"; });
845
+ // INFO: an export's filters run on the export server, which cannot work out
846
+ // a formula, so its rows leave formula columns out — a formula filter on
847
+ // the list still narrows the export, by the ids of the rows it kept
848
+ var exportFilterStructure = structure.filter(function (eachModel) { return eachModel.type !== "formula"; });
849
+ // INFO: every matching row of a formula view, unsorted — pages are cut
850
+ // from it locally, so paging does not read the collection again
851
+ // INFO: the formula sort and filter the row cap was last announced for
852
+ var formulaCapNoticeRef = (0, react_1.useRef)("");
853
+ var formulaFullReadRef = (0, react_1.useRef)(null);
854
+ var handleApplyFormulaView = function (rows, displayRows) {
855
+ if (!isFormulaView)
856
+ return { rows: rows, displayRows: displayRows };
857
+ var entries = rows.map(function (eachRow, index) { return ({
858
+ row: eachRow,
859
+ displayRow: displayRows[index],
860
+ results: (0, formula_1.handleEvaluateFormulaRow)(eachRow, displayRows[index], structure),
861
+ }); });
862
+ var filtered = entries.filter(function (eachEntry) {
863
+ return formulaFlexQueries.every(function (eachQuery) {
864
+ var _a;
865
+ return (0, formula_1.handleMatchFormulaQuery)(eachEntry.results[(_a = eachQuery.queryId) !== null && _a !== void 0 ? _a : ""], eachQuery);
866
+ });
867
+ });
868
+ if (formulaSort) {
869
+ var direction_1 = formulaSort.type === "asc" ? 1 : -1;
870
+ filtered.sort(function (a, b) {
871
+ var aResult = a.results[formulaSort.sortId];
872
+ var bResult = b.results[formulaSort.sortId];
873
+ var aEmpty = (0, formula_1.handleIsFormulaEmpty)(aResult);
874
+ var bEmpty = (0, formula_1.handleIsFormulaEmpty)(bResult);
875
+ // INFO: blanks and errors sink to the bottom in either direction
876
+ if (aEmpty || bEmpty)
877
+ return aEmpty === bEmpty ? 0 : aEmpty ? 1 : -1;
878
+ return direction_1 * (0, formula_1.handleCompareFormulaResults)(aResult, bResult);
879
+ });
880
+ }
881
+ return {
882
+ rows: filtered.map(function (eachEntry) { return eachEntry.row; }),
883
+ displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
884
+ };
885
+ };
886
+ var _204 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _204.canUpdateRecord, canInlineUpdate = _204.canInlineUpdate, canBatchUpdate = _204.canBatchUpdate, canDeleteRecord = _204.canDeleteRecord;
887
+ var isEditor = ((_19 = props.edit) === null || _19 === void 0 ? void 0 : _19.allEditable) ? true : false;
888
+ var isOffline = (_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareOffline;
816
889
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
817
890
  // the live network state — online saves go to the server even if bareOffline
818
891
  // is true, offline saves go to IDB as normal.
819
- var isOfflineNetworkListener = isOffline && ((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareOfflineNetworkListener);
820
- var showId = (_20 = props.space) === null || _20 === void 0 ? void 0 : _20.showId;
892
+ var isOfflineNetworkListener = isOffline && ((_21 = props.bareSettings) === null || _21 === void 0 ? void 0 : _21.bareOfflineNetworkListener);
893
+ var showId = (_22 = props.space) === null || _22 === void 0 ? void 0 : _22.showId;
821
894
  var remainId = showId || selectedObjectStructureId ? true : false;
822
- var idField = ((_21 = props.space) === null || _21 === void 0 ? void 0 : _21.idField) || ((_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.idField);
823
- var pipeline = (_23 = props === null || props === void 0 ? void 0 : props.space) === null || _23 === void 0 ? void 0 : _23.pipeline;
824
- if ((_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareListPipeline) {
895
+ var idField = ((_23 = props.space) === null || _23 === void 0 ? void 0 : _23.idField) || ((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.idField);
896
+ var pipeline = (_25 = props === null || props === void 0 ? void 0 : props.space) === null || _25 === void 0 ? void 0 : _25.pipeline;
897
+ if ((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareListPipeline) {
825
898
  pipeline = pipeline
826
899
  ? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
827
900
  }
@@ -834,24 +907,24 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
834
907
  * three records came back instead of five files, and each tile received the
835
908
  * whole array rather than one file, so every one of them read "Attachment".
836
909
  */
837
- var fileViewColumnId = (_28 = (_27 = ((_26 = (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.extendedTabs) !== null && _26 !== void 0 ? _26 : []).find(function (eachTab) {
910
+ var fileViewColumnId = (_30 = (_29 = ((_28 = (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.extendedTabs) !== null && _28 !== void 0 ? _28 : []).find(function (eachTab) {
838
911
  return eachTab.viewType === "file" &&
839
912
  (0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
840
- })) === null || _27 === void 0 ? void 0 : _27.fileSettings) === null || _28 === void 0 ? void 0 : _28.columnId;
841
- var hasNavigation = ((_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.handleNavigate) ? true : false;
913
+ })) === null || _29 === void 0 ? void 0 : _29.fileSettings) === null || _30 === void 0 ? void 0 : _30.columnId;
914
+ var hasNavigation = ((_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.handleNavigate) ? true : false;
842
915
  var formColumn = "grid-cols-12";
843
- var useMobileView = (_31 = (_30 = props.bareSettings) === null || _30 === void 0 ? void 0 : _30.bareUpdateMobileView) !== null && _31 !== void 0 ? _31 : false;
916
+ var useMobileView = (_33 = (_32 = props.bareSettings) === null || _32 === void 0 ? void 0 : _32.bareUpdateMobileView) !== null && _33 !== void 0 ? _33 : false;
844
917
  var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
845
- var isActivityLog = (((_33 = (_32 = props.edit) === null || _32 === void 0 ? void 0 : _32.activityLog) === null || _33 === void 0 ? void 0 : _33.enableComments) &&
846
- ((_34 = props.edit) === null || _34 === void 0 ? void 0 : _34.activityLog.commentCollectionId)) ||
847
- (((_36 = (_35 = props.edit) === null || _35 === void 0 ? void 0 : _35.activityLog) === null || _36 === void 0 ? void 0 : _36.enableLogs) &&
848
- ((_37 = props.edit) === null || _37 === void 0 ? void 0 : _37.activityLog.logsCollectionId));
849
- var customPaginationSize = ((_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.customPaginationCount)
918
+ var isActivityLog = (((_35 = (_34 = props.edit) === null || _34 === void 0 ? void 0 : _34.activityLog) === null || _35 === void 0 ? void 0 : _35.enableComments) &&
919
+ ((_36 = props.edit) === null || _36 === void 0 ? void 0 : _36.activityLog.commentCollectionId)) ||
920
+ (((_38 = (_37 = props.edit) === null || _37 === void 0 ? void 0 : _37.activityLog) === null || _38 === void 0 ? void 0 : _38.enableLogs) &&
921
+ ((_39 = props.edit) === null || _39 === void 0 ? void 0 : _39.activityLog.logsCollectionId));
922
+ var customPaginationSize = ((_40 = props.organise) === null || _40 === void 0 ? void 0 : _40.customPaginationCount)
850
923
  ? props.organise.customPaginationCount(size)
851
924
  : undefined;
852
925
  //TODO : Code - Pass ...devSettings, search dbEndpoint:
853
926
  var writeServerQuery = new writeQuery_1.WriteQuery({
854
- dbModule: (_39 = props.lib) === null || _39 === void 0 ? void 0 : _39.axios,
927
+ dbModule: (_41 = props.lib) === null || _41 === void 0 ? void 0 : _41.axios,
855
928
  dbType: devSettings.server,
856
929
  dbCollection: props.collectionId,
857
930
  dbEndpoint: devSettings.dbEndpoint,
@@ -859,7 +932,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
859
932
  dbUserToken: devSettings.dbUserToken,
860
933
  });
861
934
  var readServerQuery = new readQuery_1.ReadQuery({
862
- dbModule: (_40 = props.lib) === null || _40 === void 0 ? void 0 : _40.axios,
935
+ dbModule: (_42 = props.lib) === null || _42 === void 0 ? void 0 : _42.axios,
863
936
  dbType: devSettings.server,
864
937
  dbCollection: props.collectionId,
865
938
  dbEndpoint: devSettings.dbEndpoint,
@@ -867,12 +940,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
867
940
  dbUserToken: devSettings.dbUserToken,
868
941
  });
869
942
  var moreButtonPopUp = [
870
- ((_41 = props.edit) === null || _41 === void 0 ? void 0 : _41.allEditable) &&
943
+ ((_43 = props.edit) === null || _43 === void 0 ? void 0 : _43.allEditable) &&
871
944
  // INFO: the import runs on the server (importEndpoint), so a Firestore
872
945
  // datasheet served through one can import; only the browser-direct
873
946
  // Firebase client has no server to import through
874
947
  !isFirebaseClient &&
875
- !((_43 = (_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.exportSettings) === null || _43 === void 0 ? void 0 : _43.hideImportCSV)
948
+ !((_45 = (_44 = props.organise) === null || _44 === void 0 ? void 0 : _44.exportSettings) === null || _45 === void 0 ? void 0 : _45.hideImportCSV)
876
949
  ? {
877
950
  text: "Import Excel",
878
951
  onClick: function () {
@@ -881,7 +954,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
881
954
  },
882
955
  }
883
956
  : null,
884
- !((_45 = (_44 = props.organise) === null || _44 === void 0 ? void 0 : _44.exportSettings) === null || _45 === void 0 ? void 0 : _45.hideExportCSV)
957
+ !((_47 = (_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.exportSettings) === null || _47 === void 0 ? void 0 : _47.hideExportCSV)
885
958
  ? {
886
959
  text: "Export CSV",
887
960
  onClick: function () {
@@ -891,7 +964,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
891
964
  },
892
965
  }
893
966
  : null,
894
- !((_47 = (_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.exportSettings) === null || _47 === void 0 ? void 0 : _47.hideExportExcel)
967
+ !((_49 = (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.exportSettings) === null || _49 === void 0 ? void 0 : _49.hideExportExcel)
895
968
  ? {
896
969
  text: "Export Excel",
897
970
  onClick: function () {
@@ -901,7 +974,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
901
974
  },
902
975
  }
903
976
  : null,
904
- !((_49 = (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.exportSettings) === null || _49 === void 0 ? void 0 : _49.hideExportPDF)
977
+ !((_51 = (_50 = props.organise) === null || _50 === void 0 ? void 0 : _50.exportSettings) === null || _51 === void 0 ? void 0 : _51.hideExportPDF)
905
978
  ? {
906
979
  text: "Export PDF",
907
980
  onClick: function () {
@@ -911,7 +984,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
911
984
  },
912
985
  }
913
986
  : null,
914
- !((_51 = (_50 = props.organise) === null || _50 === void 0 ? void 0 : _50.exportSettings) === null || _51 === void 0 ? void 0 : _51.hideExportQR)
987
+ !((_53 = (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.exportSettings) === null || _53 === void 0 ? void 0 : _53.hideExportQR)
915
988
  ? {
916
989
  text: "Export QR",
917
990
  onClick: function () {
@@ -921,7 +994,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
921
994
  },
922
995
  }
923
996
  : null,
924
- !((_53 = (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.exportSettings) === null || _53 === void 0 ? void 0 : _53.hideExportQR)
997
+ !((_55 = (_54 = props.organise) === null || _54 === void 0 ? void 0 : _54.exportSettings) === null || _55 === void 0 ? void 0 : _55.hideExportQR)
925
998
  ? {
926
999
  text: "Export QR(Data)",
927
1000
  onClick: function () {
@@ -931,7 +1004,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
931
1004
  },
932
1005
  }
933
1006
  : null,
934
- !((_55 = (_54 = props.organise) === null || _54 === void 0 ? void 0 : _54.exportSettings) === null || _55 === void 0 ? void 0 : _55.hideExportPrint)
1007
+ !((_57 = (_56 = props.organise) === null || _56 === void 0 ? void 0 : _56.exportSettings) === null || _57 === void 0 ? void 0 : _57.hideExportPrint)
935
1008
  ? {
936
1009
  text: "Print",
937
1010
  onClick: function () {
@@ -941,7 +1014,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
941
1014
  },
942
1015
  }
943
1016
  : null,
944
- !((_57 = (_56 = props.organise) === null || _56 === void 0 ? void 0 : _56.exportSettings) === null || _57 === void 0 ? void 0 : _57.hideExportDraft)
1017
+ !((_59 = (_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.exportSettings) === null || _59 === void 0 ? void 0 : _59.hideExportDraft)
945
1018
  ? {
946
1019
  text: filterDraft ? "Show All Items" : "Filter Draft",
947
1020
  onClick: function () {
@@ -950,7 +1023,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
950
1023
  }
951
1024
  : null,
952
1025
  ].filter(Boolean);
953
- if ((_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.moreSettings)
1026
+ if ((_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.moreSettings)
954
1027
  moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
955
1028
  //=====================================================================================
956
1029
  //SECTION: User Column Visibility Handlers
@@ -1175,8 +1248,61 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1175
1248
  return (__assign(__assign({}, prev), (_a = {}, _a[columnId] = search, _a)));
1176
1249
  });
1177
1250
  };
1178
- var renderImpSearchFilterConditions = function () {
1251
+ // INFO: the export's own filter rows, handled like the list's but never
1252
+ // reading the list again — a reference column's options are shared with it
1253
+ var handleNewExportFilterRow = function () { return ({
1254
+ id: (0, uuid_1.v4)(),
1255
+ columnId: "",
1256
+ operator: "=",
1257
+ value: undefined,
1258
+ }); };
1259
+ var exportFlexActions = {
1260
+ handleAddFilter: function () {
1261
+ return setExportFlexFilters(function (previous) { return __spreadArray(__spreadArray([], previous, true), [
1262
+ handleNewExportFilterRow(),
1263
+ ], false); });
1264
+ },
1265
+ handleRemoveFilter: function (filterId) {
1266
+ return setExportFlexFilters(function (previous) {
1267
+ var remaining = previous.filter(function (each) { return each.id !== filterId; });
1268
+ return remaining.length > 0 ? remaining : [handleNewExportFilterRow()];
1269
+ });
1270
+ },
1271
+ handleClearAllFilters: function () {
1272
+ return setExportFlexFilters([handleNewExportFilterRow()]);
1273
+ },
1274
+ handleColumnChange: function (filterId, columnId) {
1275
+ return setExportFlexFilters(function (previous) {
1276
+ return previous.map(function (each) {
1277
+ var _a, _b, _c;
1278
+ if (each.id !== filterId)
1279
+ return each;
1280
+ var operators = flexFilter_1.FLEX_FILTER_OPERATOR_MAP[(_b = (_a = structure.find(function (eachModel) { return eachModel.id === columnId; })) === null || _a === void 0 ? void 0 : _a.type) !== null && _b !== void 0 ? _b : ""];
1281
+ return __assign(__assign({}, each), { columnId: columnId, operator: (_c = operators === null || operators === void 0 ? void 0 : operators[0]) !== null && _c !== void 0 ? _c : "=", value: undefined });
1282
+ });
1283
+ });
1284
+ },
1285
+ handleOperatorChange: function (filterId, operator) {
1286
+ return setExportFlexFilters(function (previous) {
1287
+ return previous.map(function (each) {
1288
+ return each.id === filterId ? __assign(__assign({}, each), { operator: operator, value: undefined }) : each;
1289
+ });
1290
+ });
1291
+ },
1292
+ handleValueChange: function (filterId, value) {
1293
+ return setExportFlexFilters(function (previous) {
1294
+ return previous.map(function (each) {
1295
+ return each.id === filterId ? __assign(__assign({}, each), { value: value }) : each;
1296
+ });
1297
+ });
1298
+ },
1299
+ handleReferenceOptionsLoaded: handleFlexFilterReferenceOptionsLoaded,
1300
+ handleReferenceSearch: handleFlexFilterReferenceSearch,
1301
+ };
1302
+ // INFO: flexRows defaults to the list's filters; an export passes its own
1303
+ var renderImpSearchFilterConditions = function (flexRows) {
1179
1304
  var _a;
1305
+ if (flexRows === void 0) { flexRows = flexFiltersDebounced; }
1180
1306
  var query = (0, listModule_1.renderSearchFilterConditions)(structure, devSettings, {
1181
1307
  filterSearchParams: filterSearchParams,
1182
1308
  filterSelection: filterSelection,
@@ -1185,8 +1311,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1185
1311
  filterDraft: filterDraft,
1186
1312
  }, additionalQuery !== null && additionalQuery !== void 0 ? additionalQuery : [], (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListFilterQuery, selectedTab);
1187
1313
  // INFO: Merge flex filter conditions into the query array (uses debounced state to avoid API calls on every keystroke)
1188
- if (flexFiltersDebounced.length > 0) {
1189
- var flexQuery = (0, listModule_1.renderFlexFilterConditions)(flexFiltersDebounced, structure);
1314
+ if (flexRows.length > 0) {
1315
+ // INFO: formula conditions never reach the server — the field is not
1316
+ // stored — and are applied to the rows by handleApplyFormulaView
1317
+ var flexQuery = (0, listModule_1.renderFlexFilterConditions)(flexRows, structure).filter(function (eachQuery) { var _a; return !formulaColumnIds.includes((_a = eachQuery.queryId) !== null && _a !== void 0 ? _a : ""); });
1190
1318
  if (flexQuery.length > 0) {
1191
1319
  if (query) {
1192
1320
  query = __spreadArray(__spreadArray([], query, true), flexQuery, true);
@@ -1261,7 +1389,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1261
1389
  //=====================================================================================
1262
1390
  //SECTION: Saved Views
1263
1391
  //=====================================================================================
1264
- var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_59 = props.organise) === null || _59 === void 0 ? void 0 : _59.persistKey, (_60 = devSettings.currentUser) === null || _60 === void 0 ? void 0 : _60.userEmail);
1392
+ var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_61 = props.organise) === null || _61 === void 0 ? void 0 : _61.persistKey, (_62 = devSettings.currentUser) === null || _62 === void 0 ? void 0 : _62.userEmail);
1265
1393
  (0, react_1.useEffect)(function () {
1266
1394
  if (isSavedViewsEnabled && !isAppViews)
1267
1395
  setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
@@ -1316,7 +1444,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1316
1444
  var lastSentSharedViewsRef = (0, react_1.useRef)(null);
1317
1445
  (0, react_1.useEffect)(function () {
1318
1446
  lastSentSharedViewsRef.current = null;
1319
- }, [(_61 = props.organise) === null || _61 === void 0 ? void 0 : _61.sharedViews]);
1447
+ }, [(_63 = props.organise) === null || _63 === void 0 ? void 0 : _63.sharedViews]);
1320
1448
  var handleStoreSharedViews = function (update) {
1321
1449
  var _a, _b, _c;
1322
1450
  if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
@@ -1352,13 +1480,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1352
1480
  /* eslint-disable */
1353
1481
  }, [
1354
1482
  isSavedViewsEnabled,
1355
- (_62 = props.organise) === null || _62 === void 0 ? void 0 : _62.initialSavedViewId,
1356
- (_63 = props.organise) === null || _63 === void 0 ? void 0 : _63.defaultSavedViewId,
1357
- (_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.sharedViews,
1483
+ (_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.initialSavedViewId,
1484
+ (_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.defaultSavedViewId,
1485
+ (_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.sharedViews,
1358
1486
  savedViews,
1359
1487
  ]);
1360
1488
  /* eslint-enable */
1361
- var defaultSavedViewIds = ((_66 = (_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.defaultSavedViews) !== null && _66 !== void 0 ? _66 : [])
1489
+ var defaultSavedViewIds = ((_68 = (_67 = props.organise) === null || _67 === void 0 ? void 0 : _67.defaultSavedViews) !== null && _68 !== void 0 ? _68 : [])
1362
1490
  .map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
1363
1491
  .join("|");
1364
1492
  // INFO: keyed on the ids, not the array, so an inline literal passed on every
@@ -1623,7 +1751,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1623
1751
  var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
1624
1752
  scrollRestoredRef.current = isSwitch || isOtherListReturn;
1625
1753
  /* eslint-disable */
1626
- }, [props.collectionId, (_67 = props.organise) === null || _67 === void 0 ? void 0 : _67.persistKey]);
1754
+ }, [props.collectionId, (_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.persistKey]);
1627
1755
  /* eslint-enable */
1628
1756
  // INFO: wait a frame — rows land in state one tick before layout
1629
1757
  (0, react_1.useEffect)(function () {
@@ -1658,7 +1786,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1658
1786
  (0, react_1.useEffect)(function () {
1659
1787
  handleOfflinePrefetch();
1660
1788
  /* eslint-disable */
1661
- }, [props.collectionId, (_68 = props.bareSettings) === null || _68 === void 0 ? void 0 : _68.bareOffline]);
1789
+ }, [props.collectionId, (_70 = props.bareSettings) === null || _70 === void 0 ? void 0 : _70.bareOffline]);
1662
1790
  /* eslint-enable */
1663
1791
  // INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
1664
1792
  // Calls through handleRefreshRef so the interval always dispatches the latest
@@ -1678,7 +1806,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1678
1806
  }, interval);
1679
1807
  return function () { return clearInterval(timer); };
1680
1808
  /* eslint-disable */
1681
- }, [(_69 = props.bareSettings) === null || _69 === void 0 ? void 0 : _69.barePollingInterval, isLive, isNetworkOffline]);
1809
+ }, [(_71 = props.bareSettings) === null || _71 === void 0 ? void 0 : _71.barePollingInterval, isLive, isNetworkOffline]);
1682
1810
  /* eslint-enable */
1683
1811
  // INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
1684
1812
  // EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
@@ -1720,7 +1848,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1720
1848
  };
1721
1849
  /* eslint-disable */
1722
1850
  }, [
1723
- (_70 = props.bareSettings) === null || _70 === void 0 ? void 0 : _70.bareSocketName,
1851
+ (_72 = props.bareSettings) === null || _72 === void 0 ? void 0 : _72.bareSocketName,
1724
1852
  props.collectionId,
1725
1853
  props.devSettings.sseEndpoint,
1726
1854
  props.devSettings.dbAPIToken,
@@ -1980,10 +2108,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1980
2108
  props.collectionId,
1981
2109
  props.model,
1982
2110
  props.localURLEndpoint,
1983
- (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.extendedTabs,
1984
- (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.viewId,
1985
- (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.additionalQuery,
1986
- (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.groupBy,
2111
+ (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.extendedTabs,
2112
+ (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.viewId,
2113
+ (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.additionalQuery,
2114
+ (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.groupBy,
1987
2115
  resolvedType,
1988
2116
  ]);
1989
2117
  /**
@@ -2041,6 +2169,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2041
2169
  if (props.devSettings.schemaReference)
2042
2170
  setReferenceSchema(props.devSettings.schemaReference);
2043
2171
  }, [props.devSettings.schemaReference]);
2172
+ // INFO: an export starts from the filters the list shows, formula rows
2173
+ // aside (see exportFilterStructure)
2174
+ (0, react_1.useEffect)(function () {
2175
+ if (!exportExcel && !exportQR)
2176
+ return;
2177
+ var rows = flexFiltersRef.current.filter(function (eachFilter) { return !formulaColumnIds.includes(eachFilter.columnId); });
2178
+ setExportFlexFilters(rows.length > 0
2179
+ ? JSON.parse(JSON.stringify(rows))
2180
+ : [handleNewExportFilterRow()]);
2181
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2182
+ }, [exportExcel, exportQR]);
2044
2183
  (0, react_1.useEffect)(function () {
2045
2184
  var _a;
2046
2185
  var newQuery = renderImpSearchFilterConditions();
@@ -2124,7 +2263,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2124
2263
  };
2125
2264
  }, 100);
2126
2265
  return function () { return clearTimeout(timeoutId); };
2127
- }, [(_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.showReadFloatingNav, resolvedType, props.id, loading]);
2266
+ }, [(_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.showReadFloatingNav, resolvedType, props.id, loading]);
2128
2267
  (0, react_1.useEffect)(function () {
2129
2268
  if (resolvedType !== "read")
2130
2269
  return;
@@ -2604,7 +2743,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2604
2743
  };
2605
2744
  var handleReadQueryHocSort = function (query) {
2606
2745
  // INFO: Use persisted sort when persistViewState is active, otherwise fall back to prop sort
2607
- var sort = activeSortId || undefined;
2746
+ // INFO: a formula sort is applied to the rows, so the server gets none
2747
+ var sort = (activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) && formulaColumnIds.includes(activeSortId.sortId)
2748
+ ? undefined
2749
+ : activeSortId || undefined;
2608
2750
  if (isFirebase) {
2609
2751
  // INFO: Firestore requires the first orderBy to match the range/startAt
2610
2752
  // field, so a search query always forces the sort onto the search column
@@ -2779,8 +2921,123 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2779
2921
  cond.skip = (0, unionPagination_1.handleGetUnionPageSkip)(pageIndex, limit);
2780
2922
  cond.sort = (0, unionPagination_1.handleBuildUnionPageSort)(handleReadQueryHocSort(query));
2781
2923
  }
2924
+ // INFO: sorting or filtering on a formula reads the matching rows, as
2925
+ // monday orders the whole board and not just the page on screen — up to
2926
+ // FORMULA_VIEW_MAX_ROWS, so one header click cannot pull a whole large
2927
+ // collection into the browser. The cursor is left out so paging cuts from
2928
+ // the rows already read.
2929
+ if (isFormulaView) {
2930
+ cond.limit = exports.FORMULA_VIEW_MAX_ROWS;
2931
+ cond.stopLimit = undefined;
2932
+ cond.cursor = undefined;
2933
+ cond.skip = 0;
2934
+ // INFO: past the cap the server picks which rows come back, so a fixed
2935
+ // order keeps those rows the same from one read to the next
2936
+ if (!cond.sort)
2937
+ cond.sort = { sortId: serverId, type: "asc" };
2938
+ }
2782
2939
  return cond;
2783
2940
  };
2941
+ // INFO: views that draw every row at once rather than a page of them — the
2942
+ // same views handleReadQueryHocCond reads in full
2943
+ var handleCheckFullSetView = function () {
2944
+ var _a;
2945
+ return (!!selectedTab &&
2946
+ (selectedTab.viewType === "calendar" ||
2947
+ selectedTab.viewType === "map" ||
2948
+ selectedTab.viewType === "timeline")) ||
2949
+ (!!groupId && !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW));
2950
+ };
2951
+ var handleShowFormulaPage = function (index) {
2952
+ var _a;
2953
+ var cached = formulaFullReadRef.current;
2954
+ if (!cached)
2955
+ return;
2956
+ var view = handleApplyFormulaView(cached.rows, cached.displayRows);
2957
+ // INFO: page mode shows one page at a time, and so does NewTable in
2958
+ // cursor mode — it draws whatever rows it is given, where the legacy
2959
+ // Table cuts cursor pages itself. Scroll mode holds every row. A calendar,
2960
+ // map, timeline or legacy grouped list draws every row, so it is never cut.
2961
+ var paginationType = renderResolvedPaginationType();
2962
+ if (!handleCheckFullSetView() &&
2963
+ (paginationType === "page" ||
2964
+ (paginationType === "cursor" && !!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)))) {
2965
+ var start = index * limit;
2966
+ handleSetListData(view.rows.slice(start, start + limit), view.displayRows.slice(start, start + limit));
2967
+ }
2968
+ else {
2969
+ handleSetListData(view.rows, view.displayRows);
2970
+ setCursor("");
2971
+ }
2972
+ setSize(view.rows.length);
2973
+ setTableLoading(false);
2974
+ };
2975
+ // INFO: adding or changing a formula changes no stored value, so nothing is
2976
+ // read again — the formula cells on screen are worked out afresh, as a
2977
+ // monday formula updates the moment it is set
2978
+ var formulaSignature = JSON.stringify(structure
2979
+ .filter(function (eachModel) { return eachModel.type === "formula"; })
2980
+ .map(function (eachModel) { return [eachModel.id, eachModel.formulaExpression]; }));
2981
+ var previousFormulaSignatureRef = (0, react_1.useRef)(formulaSignature);
2982
+ (0, react_1.useEffect)(function () {
2983
+ if (previousFormulaSignatureRef.current === formulaSignature)
2984
+ return;
2985
+ previousFormulaSignatureRef.current = formulaSignature;
2986
+ var handleRecomputeCells = function (rows, displayRows) {
2987
+ return displayRows.map(function (eachDisplayRow, index) {
2988
+ if (!eachDisplayRow || !rows[index])
2989
+ return eachDisplayRow;
2990
+ var nextDisplayRow = __assign({}, eachDisplayRow);
2991
+ var results = (0, formula_1.handleEvaluateFormulaRow)(rows[index], eachDisplayRow, structure);
2992
+ Object.entries(results).forEach(function (_a) {
2993
+ var columnId = _a[0], result = _a[1];
2994
+ nextDisplayRow[columnId] = (0, formula_1.handleFormatFormulaValue)(result);
2995
+ });
2996
+ return nextDisplayRow;
2997
+ });
2998
+ };
2999
+ var cached = formulaFullReadRef.current;
3000
+ if (cached) {
3001
+ cached.displayRows = handleRecomputeCells(cached.rows, cached.displayRows);
3002
+ handleShowFormulaPage(pageIndex);
3003
+ return;
3004
+ }
3005
+ if (tableDataRef.current.length === 0)
3006
+ return;
3007
+ handleSetListData(tableDataRef.current, handleRecomputeCells(tableDataRef.current, spaceTableDataRef.current));
3008
+ /* eslint-disable */
3009
+ }, [formulaSignature]);
3010
+ /* eslint-enable */
3011
+ // INFO: the read request of the previous render. A formula sort or filter
3012
+ // is not part of the request, so on a view that already reads every row
3013
+ // (calendar, map, timeline, legacy grouped) turning one on changes nothing
3014
+ // the reader would see — then the read is asked for here.
3015
+ var formulaCondKeyRef = (0, react_1.useRef)("");
3016
+ (0, react_1.useEffect)(function () {
3017
+ var _a;
3018
+ if (formulaFullReadRef.current) {
3019
+ // INFO: a page, page-size or formula change needs no new read — the
3020
+ // matching rows are already held
3021
+ handleShowFormulaPage(pageIndex);
3022
+ }
3023
+ else if (isFormulaView &&
3024
+ formulaCondKeyRef.current === JSON.stringify(handleReadQueryHocCond())) {
3025
+ (_a = listRQueryHocRef.current) === null || _a === void 0 ? void 0 : _a.handleRefresh();
3026
+ }
3027
+ /* eslint-disable */
3028
+ }, [
3029
+ pageIndex,
3030
+ limit,
3031
+ JSON.stringify(formulaSort !== null && formulaSort !== void 0 ? formulaSort : null),
3032
+ JSON.stringify(formulaFlexQueries),
3033
+ ]);
3034
+ /* eslint-enable */
3035
+ (0, react_1.useEffect)(function () {
3036
+ // INFO: a table without formula columns does no formula bookkeeping
3037
+ if (formulaColumnIds.length === 0)
3038
+ return;
3039
+ formulaCondKeyRef.current = JSON.stringify(handleReadQueryHocCond());
3040
+ });
2784
3041
  var handleSelectIds = function (selectedIds) {
2785
3042
  var _a;
2786
3043
  setSelectedIds(selectedIds);
@@ -2914,16 +3171,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2914
3171
  }
2915
3172
  };
2916
3173
  var handleGetListData = function (responseData, type, rowId, requestCond) { return __awaiter(void 0, void 0, void 0, function () {
2917
- var dataList, prettierDataList, clonedTableData, clonedSpaceTableData, dummyPrettierDataList_1, resolvedData, selectedIndex_1, isScrollMode, newTableData, newPrettierTableData, isFirstPage, listedIds_1, newIndexes, isExists, cursorResp, lastDataId, err_1;
2918
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
2919
- return __generator(this, function (_l) {
2920
- switch (_l.label) {
3174
+ var dataList, prettierDataList, clonedTableData, clonedSpaceTableData, dummyPrettierDataList_1, resolvedData, selectedIndex_1, cachedFormulaRows, cachedIndex, capKey, isScrollMode, newTableData, newPrettierTableData, isFirstPage, listedIds_1, newIndexes, isExists, cursorResp, lastDataId, err_1;
3175
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
3176
+ return __generator(this, function (_p) {
3177
+ switch (_p.label) {
2921
3178
  case 0:
2922
3179
  dataList = [];
2923
3180
  prettierDataList = [];
2924
- _l.label = 1;
3181
+ _p.label = 1;
2925
3182
  case 1:
2926
- _l.trys.push([1, 7, , 8]);
3183
+ _p.trys.push([1, 7, , 8]);
2927
3184
  clonedTableData = __spreadArray([], tableDataRef.current, true);
2928
3185
  clonedSpaceTableData = __spreadArray([], spaceTableDataRef.current, true);
2929
3186
  if (!(responseData === null || responseData === void 0 ? void 0 : responseData.data)) return [3 /*break*/, 6];
@@ -2931,7 +3188,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2931
3188
  dummyPrettierDataList_1 = [];
2932
3189
  return [4 /*yield*/, handleResolveOfflineReferences(responseData.data)];
2933
3190
  case 2:
2934
- resolvedData = _l.sent();
3191
+ resolvedData = _p.sent();
2935
3192
  resolvedData.map(function (eachData) {
2936
3193
  var _a, _b;
2937
3194
  var tempData = eachData;
@@ -2943,7 +3200,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2943
3200
  return [3 /*break*/, 5];
2944
3201
  case 3: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, structure, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.handleNavigate, setActivityModal, setActivityId, isActivityLog ? (_d = props.edit) === null || _d === void 0 ? void 0 : _d.activityLog : undefined, (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListActionBtns, !canUpdateRecord, undefined, handleSeedListReferenceOptions)];
2945
3202
  case 4:
2946
- prettierDataList = _l.sent();
3203
+ prettierDataList = _p.sent();
2947
3204
  if (props.groupId) {
2948
3205
  prettierDataList.forEach(function (item, idx) {
2949
3206
  var _a, _b;
@@ -2952,7 +3209,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2952
3209
  }
2953
3210
  });
2954
3211
  }
2955
- _l.label = 5;
3212
+ _p.label = 5;
2956
3213
  case 5:
2957
3214
  (_f = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _f === void 0 ? void 0 : _f.map(function (eachData, eachIndex) {
2958
3215
  if (eachData["_id"]) {
@@ -2978,7 +3235,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2978
3235
  return null;
2979
3236
  });
2980
3237
  dataList = responseData.data;
2981
- _l.label = 6;
3238
+ _p.label = 6;
2982
3239
  case 6:
2983
3240
  if (type === "update" || type === "create") {
2984
3241
  try {
@@ -2998,15 +3255,54 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
2998
3255
  clonedTableData.push((_h = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _h === void 0 ? void 0 : _h[0]);
2999
3256
  clonedSpaceTableData.push(prettierDataList === null || prettierDataList === void 0 ? void 0 : prettierDataList[0]);
3000
3257
  }
3001
- handleSetListData(clonedTableData, clonedSpaceTableData);
3258
+ cachedFormulaRows = formulaFullReadRef.current;
3259
+ if (cachedFormulaRows) {
3260
+ cachedIndex = cachedFormulaRows.rows.findIndex(function (eachData) {
3261
+ return (eachData === null || eachData === void 0 ? void 0 : eachData.id) === rowId || (eachData === null || eachData === void 0 ? void 0 : eachData.recordId) === rowId;
3262
+ });
3263
+ if (type === "update" && cachedIndex > -1) {
3264
+ cachedFormulaRows.rows[cachedIndex] = (_j = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _j === void 0 ? void 0 : _j[0];
3265
+ cachedFormulaRows.displayRows[cachedIndex] =
3266
+ prettierDataList === null || prettierDataList === void 0 ? void 0 : prettierDataList[0];
3267
+ }
3268
+ else if (type === "create") {
3269
+ cachedFormulaRows.rows.push((_k = responseData === null || responseData === void 0 ? void 0 : responseData.data) === null || _k === void 0 ? void 0 : _k[0]);
3270
+ cachedFormulaRows.displayRows.push(prettierDataList === null || prettierDataList === void 0 ? void 0 : prettierDataList[0]);
3271
+ }
3272
+ handleShowFormulaPage(pageIndex);
3273
+ }
3274
+ else
3275
+ handleSetListData(clonedTableData, clonedSpaceTableData);
3002
3276
  }
3003
3277
  catch (err) { }
3004
3278
  }
3279
+ else if (isFormulaView &&
3280
+ (requestCond === null || requestCond === void 0 ? void 0 : requestCond.limit) === exports.FORMULA_VIEW_MAX_ROWS &&
3281
+ !(requestCond === null || requestCond === void 0 ? void 0 : requestCond.cursor)) {
3282
+ // INFO: a formula view's read — held, then filtered, ordered and paged
3283
+ // from here
3284
+ formulaFullReadRef.current = {
3285
+ rows: dataList,
3286
+ displayRows: prettierDataList,
3287
+ };
3288
+ handleShowFormulaPage(pageIndex);
3289
+ capKey = JSON.stringify([formulaSort, formulaFlexQueries]);
3290
+ if (((_l = responseData.count) !== null && _l !== void 0 ? _l : 0) > dataList.length &&
3291
+ formulaCapNoticeRef.current !== capKey) {
3292
+ formulaCapNoticeRef.current = capKey;
3293
+ setNotification({
3294
+ type: true,
3295
+ title: "Sorted and filtered within ".concat(exports.FORMULA_VIEW_MAX_ROWS.toLocaleString("en-US"), " rows"),
3296
+ msg: "A formula sort or filter reads at most ".concat(exports.FORMULA_VIEW_MAX_ROWS.toLocaleString("en-US"), " of the ").concat(Number(responseData.count).toLocaleString("en-US"), " matching rows."),
3297
+ });
3298
+ }
3299
+ }
3005
3300
  else {
3301
+ formulaFullReadRef.current = null;
3006
3302
  isScrollMode = renderCheckScrollMode();
3007
3303
  if (!isScrollMode && !isFirebase) {
3008
3304
  handleSetListData(dataList, prettierDataList);
3009
- setSize((_j = responseData.count) !== null && _j !== void 0 ? _j : 0);
3305
+ setSize((_m = responseData.count) !== null && _m !== void 0 ? _m : 0);
3010
3306
  if (renderCheckGroupPaging())
3011
3307
  handleLoadGroupFirstPages();
3012
3308
  }
@@ -3066,13 +3362,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
3066
3362
  }
3067
3363
  setCursor(cursorResp);
3068
3364
  if (isScrollMode && !isFirebase) {
3069
- setSize((_k = responseData.count) !== null && _k !== void 0 ? _k : 0);
3365
+ setSize((_o = responseData.count) !== null && _o !== void 0 ? _o : 0);
3070
3366
  }
3071
3367
  }
3072
3368
  }
3073
3369
  return [3 /*break*/, 8];
3074
3370
  case 7:
3075
- err_1 = _l.sent();
3371
+ err_1 = _p.sent();
3076
3372
  return [3 /*break*/, 8];
3077
3373
  case 8:
3078
3374
  // INFO: inline writes update rows too, but do not finish a pending list read.
@@ -6340,18 +6636,27 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6340
6636
  });
6341
6637
  }); };
6342
6638
  var handleExportCSVData = function (downloadLinkOnly, printOnly) { return __awaiter(void 0, void 0, void 0, function () {
6343
- var exportQueryList, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg, err_27;
6344
- 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;
6345
- return __generator(this, function (_1) {
6346
- switch (_1.label) {
6639
+ var exportQueryList, formulaRows, kept, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg, err_27;
6640
+ 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;
6641
+ return __generator(this, function (_2) {
6642
+ switch (_2.label) {
6347
6643
  case 0:
6348
- _1.trys.push([0, 5, , 6]);
6644
+ _2.trys.push([0, 5, , 6]);
6349
6645
  setLoading(true);
6350
- exportQueryList = JSON.parse(JSON.stringify(queryList));
6351
- if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareCSVExportSettings) {
6646
+ exportQueryList = ((_a = renderImpSearchFilterConditions(exportFlexFilters)) !== null && _a !== void 0 ? _a : []).filter(function (eachQuery) { return eachQuery.type !== "search"; });
6647
+ if ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareCSVExportSettings) {
6352
6648
  if (props.bareSettings.bareListFilterQuery)
6353
6649
  exportQueryList.push.apply(exportQueryList, props.bareSettings.bareListFilterQuery);
6354
6650
  }
6651
+ formulaRows = formulaFullReadRef.current;
6652
+ if (formulaFlexQueries.length > 0 && formulaRows) {
6653
+ kept = handleApplyFormulaView(formulaRows.rows, formulaRows.displayRows).rows;
6654
+ exportQueryList.push({
6655
+ type: "in",
6656
+ queryId: serverId,
6657
+ value: kept.map(function (eachRow) { return eachRow === null || eachRow === void 0 ? void 0 : eachRow[serverId]; }),
6658
+ });
6659
+ }
6355
6660
  baseUrl = props.devSettings.functionEndpoint;
6356
6661
  apiEndpoint = baseUrl;
6357
6662
  switch (exportType) {
@@ -6369,20 +6674,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6369
6674
  apiEndpoint += "/handleExportCSV";
6370
6675
  reqData = __assign(__assign({ spaceId: props.collectionId, query: exportQueryList, userData: {
6371
6676
  userEmail: downloadLinkOnly ? "" : exportCSVEmail,
6372
- userName: (_c = (_b = props.devSettings.currentUser) === null || _b === void 0 ? void 0 : _b.userName) !== null && _c !== void 0 ? _c : "",
6373
- }, downloadLinkOnly: downloadLinkOnly, exportType: exportType === "excel" ? "excel" : undefined, excludeReferenceId: (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.exportSettings) === null || _e === void 0 ? void 0 : _e.excludeReferenceId, excludeSecondaryLabel: (_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.exportSettings) === null || _g === void 0 ? void 0 : _g.excludeSecondaryLabel, csvHeaderUseName: (_j = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.exportSettings) === null || _j === void 0 ? void 0 : _j.csvHeaderUseName, dateFormatString: (_l = (_k = props.organise) === null || _k === void 0 ? void 0 : _k.exportSettings) === null || _l === void 0 ? void 0 : _l.dateFormatString, excludeDataId: (_o = (_m = props.organise) === null || _m === void 0 ? void 0 : _m.exportSettings) === null || _o === void 0 ? void 0 : _o.excludeDataId, columnIds: (_q = (_p = props.organise) === null || _p === void 0 ? void 0 : _p.exportSettings) === null || _q === void 0 ? void 0 : _q.columnIds, sort: (_s = (_r = props.organise) === null || _r === void 0 ? void 0 : _r.exportSettings) === null || _s === void 0 ? void 0 : _s.sort, groupBy: groupId, sumAttributeId: exportSumAttributeIds, viewId: (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.id) !== "general" ? selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.name : undefined }, (exportType === "qr-data" && {
6677
+ userName: (_d = (_c = props.devSettings.currentUser) === null || _c === void 0 ? void 0 : _c.userName) !== null && _d !== void 0 ? _d : "",
6678
+ }, downloadLinkOnly: downloadLinkOnly, exportType: exportType === "excel" ? "excel" : undefined, excludeReferenceId: (_f = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.exportSettings) === null || _f === void 0 ? void 0 : _f.excludeReferenceId, excludeSecondaryLabel: (_h = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.exportSettings) === null || _h === void 0 ? void 0 : _h.excludeSecondaryLabel, csvHeaderUseName: (_k = (_j = props.organise) === null || _j === void 0 ? void 0 : _j.exportSettings) === null || _k === void 0 ? void 0 : _k.csvHeaderUseName, dateFormatString: (_m = (_l = props.organise) === null || _l === void 0 ? void 0 : _l.exportSettings) === null || _m === void 0 ? void 0 : _m.dateFormatString, excludeDataId: (_p = (_o = props.organise) === null || _o === void 0 ? void 0 : _o.exportSettings) === null || _p === void 0 ? void 0 : _p.excludeDataId, columnIds: (_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.exportSettings) === null || _r === void 0 ? void 0 : _r.columnIds, sort: (_t = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.exportSettings) === null || _t === void 0 ? void 0 : _t.sort, groupBy: groupId, sumAttributeId: exportSumAttributeIds, viewId: (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.id) !== "general" ? selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.name : undefined }, (exportType === "qr-data" && {
6374
6679
  public: true,
6375
6680
  publicLink: window.location.origin,
6376
6681
  })), { hideSubItems: hideSubItems });
6377
- return [4 /*yield*/, ((_t = props.lib) === null || _t === void 0 ? void 0 : _t.axios({
6682
+ return [4 /*yield*/, ((_u = props.lib) === null || _u === void 0 ? void 0 : _u.axios({
6378
6683
  url: apiEndpoint,
6379
6684
  method: "post",
6380
6685
  data: { data: reqData },
6381
6686
  }))];
6382
6687
  case 1:
6383
- res = _1.sent();
6384
- if (!(downloadLinkOnly && ((_u = res === null || res === void 0 ? void 0 : res.data) === null || _u === void 0 ? void 0 : _u.dataList))) return [3 /*break*/, 4];
6385
- dataList = (_v = res === null || res === void 0 ? void 0 : res.data) === null || _v === void 0 ? void 0 : _v.dataList;
6688
+ res = _2.sent();
6689
+ if (!(downloadLinkOnly && ((_v = res === null || res === void 0 ? void 0 : res.data) === null || _v === void 0 ? void 0 : _v.dataList))) return [3 /*break*/, 4];
6690
+ dataList = (_w = res === null || res === void 0 ? void 0 : res.data) === null || _w === void 0 ? void 0 : _w.dataList;
6386
6691
  if (!(dataList && typeof dataList === "object")) return [3 /*break*/, 4];
6387
6692
  csvDownloadLink = Object.values(dataList)[0];
6388
6693
  if (!(exportType === "csv" ||
@@ -6394,10 +6699,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6394
6699
  if (!(exportType === "pdf" ||
6395
6700
  printOnly ||
6396
6701
  exportType === "print")) return [3 /*break*/, 4];
6397
- return [4 /*yield*/, (0, listModule_1.handleExportPDF)(csvDownloadLink, exportPDFTitle, printOnly, (_y = (_x = (_w = props.organise) === null || _w === void 0 ? void 0 : _w.exportSettings) === null || _x === void 0 ? void 0 : _x.generateBy) !== null && _y !== void 0 ? _y : "Admin")];
6702
+ return [4 /*yield*/, (0, listModule_1.handleExportPDF)(csvDownloadLink, exportPDFTitle, printOnly, (_z = (_y = (_x = props.organise) === null || _x === void 0 ? void 0 : _x.exportSettings) === null || _y === void 0 ? void 0 : _y.generateBy) !== null && _z !== void 0 ? _z : "Admin")];
6398
6703
  case 3:
6399
- _1.sent();
6400
- _1.label = 4;
6704
+ _2.sent();
6705
+ _2.label = 4;
6401
6706
  case 4:
6402
6707
  notificaitonMsg = "A download link will be sent to your email. This may take a while if the data is huge, contact our team if you do not receive any email after 10 minutes (Check your Junk Email too).";
6403
6708
  if (downloadLinkOnly)
@@ -6411,10 +6716,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6411
6716
  }
6412
6717
  setLoading(false);
6413
6718
  handlePopUpModal(false);
6414
- setExportCSVEmail((_0 = (_z = props.devSettings.currentUser) === null || _z === void 0 ? void 0 : _z.userEmail) !== null && _0 !== void 0 ? _0 : "");
6719
+ setExportCSVEmail((_1 = (_0 = props.devSettings.currentUser) === null || _0 === void 0 ? void 0 : _0.userEmail) !== null && _1 !== void 0 ? _1 : "");
6415
6720
  return [3 /*break*/, 6];
6416
6721
  case 5:
6417
- err_27 = _1.sent();
6722
+ err_27 = _2.sent();
6418
6723
  setNotification({
6419
6724
  type: true,
6420
6725
  title: "Export Failed",
@@ -6800,43 +7105,6 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6800
7105
  }
6801
7106
  });
6802
7107
  }); };
6803
- var handleViewQuery = function (index) {
6804
- setQueryIndex(index);
6805
- setQueryForm(!queryForm);
6806
- };
6807
- var handleSortQuery = function (index, sortType) {
6808
- var _a;
6809
- var sortList = JSON.parse(JSON.stringify(queryList));
6810
- var ascIndex = sortType === "up" ? index - 1 : index + 1;
6811
- _a = [
6812
- sortList[ascIndex],
6813
- sortList[index],
6814
- ], sortList[index] = _a[0], sortList[ascIndex] = _a[1];
6815
- setQueryList(sortList);
6816
- };
6817
- var handlePushQueryList = function (queryInput, queryIndex) {
6818
- var tempQueryList = [];
6819
- tempQueryList = queryList;
6820
- if (!tempQueryList.some(function (eachQuery) { return eachQuery.queryId === queryInput.queryId; })) {
6821
- tempQueryList.push(queryInput);
6822
- setQueryList(tempQueryList);
6823
- setQueryForm(false);
6824
- }
6825
- else if (queryIndex >= 0) {
6826
- var newQueryList = tempQueryList.map(function (eachQuery) {
6827
- return eachQuery.queryId === queryInput.queryId ? queryInput : eachQuery;
6828
- });
6829
- setQueryList(newQueryList);
6830
- handleViewQuery(-1);
6831
- }
6832
- else {
6833
- setNotification({
6834
- type: false,
6835
- title: "Failed to add",
6836
- msg: "Query with column ID already exists",
6837
- });
6838
- }
6839
- };
6840
7108
  //=====================================================================================
6841
7109
  //SECTION: Handle Utils
6842
7110
  //=====================================================================================
@@ -6901,16 +7169,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6901
7169
  var header = Object.keys(csvFileData[0]);
6902
7170
  var dataList = [];
6903
7171
  csvAPIAttribute.map(function (eachAttribute) {
7172
+ var _a, _b;
6904
7173
  dataList.push({
6905
7174
  header: header[eachAttribute.ori],
6906
- detail: eachAttribute.id,
7175
+ // INFO: the field's name, as the mapping step showed it
7176
+ detail: (_b = (_a = structure.find(function (eachModel) { return eachModel.id === eachAttribute.id; })) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : eachAttribute.id,
6907
7177
  });
6908
7178
  return null;
6909
7179
  });
6910
7180
  return dataList;
6911
7181
  };
6912
7182
  var renderStepCSV = function () {
6913
- var _a;
7183
+ var _a, _b;
6914
7184
  switch (stepCSVIndex) {
6915
7185
  case 0:
6916
7186
  return (react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios }, label: "Please insert a csv file", fileDescription: "CSV file thats doesn't exceeds 30MB and row not more than 100 data", accept: ".csv", hidePreview: true, onChange: handleOnChangeCSV }));
@@ -6926,37 +7196,47 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6926
7196
  }
6927
7197
  return "";
6928
7198
  });
6929
- return (react_1.default.createElement(react_1.default.Fragment, null, csvFileData.length > 0 && (react_1.default.createElement("div", { className: "pb-32" }, Object.entries(csvFileData[0]).map(function (eachRow, index) {
6930
- var eachKey = eachRow[0];
6931
- if (!eachKey)
6932
- return null;
6933
- var clonedListValue = JSON.parse(JSON.stringify(listCSVMapAttribute));
6934
- var selectedObjectModel = structure.find(function (eachModel) {
6935
- return ((eachModel.id === clonedListValue[index] &&
6936
- eachModel.type === "listObject") ||
6937
- (eachModel.id === clonedListValue[index] &&
6938
- eachModel.type === "object"));
6939
- });
6940
- return (react_1.default.createElement(react_1.default.Fragment, null,
6941
- react_1.default.createElement("div", { className: "grid items-center grid-cols-3 mt-6" },
6942
- eachKey,
6943
- react_1.default.createElement(select_1.Select, { portalDropdown: true, containerClassName: selectedObjectModel ? "ml-2" : "ml-2 col-span-2", label: "", options: filterOptions_1, value: clonedListValue[index], onChange: function (value) {
6944
- var clonedListValueAttribute = JSON.parse(JSON.stringify(listCSVMapAttribute));
6945
- clonedListValueAttribute[index] = value;
6946
- setListCSVMapAttribute(clonedListValueAttribute);
6947
- } }),
6948
- selectedObjectModel && (react_1.default.createElement(select_1.Select, { portalDropdown: true, containerClassName: "ml-4", label: "", options: (0, readModule_1.renderObjectOptions)(selectedObjectModel.objectData), value: listCSVObjAttribute[index], onChange: function (value) {
6949
- var clonedListObjectValueAttribute = JSON.parse(JSON.stringify(listCSVObjAttribute));
6950
- clonedListObjectValueAttribute[index] = value;
6951
- setListCSVObjAttribute(clonedListObjectValueAttribute);
6952
- } })))));
6953
- })))));
7199
+ return (react_1.default.createElement(react_1.default.Fragment, null, csvFileData.length > 0 && (
7200
+ // INFO: one compact row per Excel column — its header, then the
7201
+ // field it fills — so a wide sheet maps without a long form
7202
+ react_1.default.createElement("div", { className: "pb-32" },
7203
+ react_1.default.createElement("div", { className: "grid grid-cols-[minmax(0,2fr)_1rem_minmax(0,3fr)] items-center gap-x-2 border-b pb-1 text-xs font-medium ".concat(((_b = props.organise) === null || _b === void 0 ? void 0 : _b.darkMode) ? "border-gray-700 text-gray-400" : "border-gray-200 text-gray-500") },
7204
+ react_1.default.createElement("span", null, "Excel column"),
7205
+ react_1.default.createElement("span", null),
7206
+ react_1.default.createElement("span", null, "Field")),
7207
+ Object.entries(csvFileData[0]).map(function (eachRow, index) {
7208
+ var _a;
7209
+ var eachKey = eachRow[0];
7210
+ if (!eachKey)
7211
+ return null;
7212
+ var clonedListValue = JSON.parse(JSON.stringify(listCSVMapAttribute));
7213
+ var selectedObjectModel = structure.find(function (eachModel) {
7214
+ return ((eachModel.id === clonedListValue[index] &&
7215
+ eachModel.type === "listObject") ||
7216
+ (eachModel.id === clonedListValue[index] &&
7217
+ eachModel.type === "object"));
7218
+ });
7219
+ return (react_1.default.createElement("div", { key: "".concat(eachKey, "-").concat(index), className: "grid grid-cols-[minmax(0,2fr)_1rem_minmax(0,3fr)] items-center gap-x-2 py-1.5" },
7220
+ react_1.default.createElement("span", { className: "truncate text-sm ".concat(((_a = props.organise) === null || _a === void 0 ? void 0 : _a.darkMode) ? "text-gray-200" : "text-gray-700") }, eachKey),
7221
+ react_1.default.createElement(outline_1.ArrowRightIcon, { className: "h-4 w-4 text-gray-400", "aria-hidden": "true" }),
7222
+ react_1.default.createElement("div", { className: "flex min-w-0 gap-x-2" },
7223
+ react_1.default.createElement(select_1.Select, { portalDropdown: true, size: "xs", containerClassName: "min-w-0 flex-1", label: "", options: filterOptions_1, value: clonedListValue[index], onChange: function (value) {
7224
+ var clonedListValueAttribute = JSON.parse(JSON.stringify(listCSVMapAttribute));
7225
+ clonedListValueAttribute[index] = value;
7226
+ setListCSVMapAttribute(clonedListValueAttribute);
7227
+ } }),
7228
+ selectedObjectModel && (react_1.default.createElement(select_1.Select, { portalDropdown: true, size: "xs", containerClassName: "min-w-0 flex-1", label: "", options: (0, readModule_1.renderObjectOptions)(selectedObjectModel.objectData), value: listCSVObjAttribute[index], onChange: function (value) {
7229
+ var clonedListObjectValueAttribute = JSON.parse(JSON.stringify(listCSVObjAttribute));
7230
+ clonedListObjectValueAttribute[index] = value;
7231
+ setListCSVObjAttribute(clonedListObjectValueAttribute);
7232
+ } })))));
7233
+ })))));
6954
7234
  case 2:
6955
7235
  return (react_1.default.createElement(react_1.default.Fragment, null,
6956
7236
  react_1.default.createElement("div", { className: "flex flex-col mx-auto mt-2" }, "Mapped Column"),
6957
7237
  react_1.default.createElement(table_1.Table, { loading: false, data: renderExcelReviewData(), hidePagination: true, limit: csvAPIAttribute.length + 1, header: [
6958
- { key: "header", title: "Excel Column" },
6959
- { key: "detail", title: "Mapping Column" },
7238
+ { key: "header", title: "Excel column" },
7239
+ { key: "detail", title: "Field" },
6960
7240
  ] })));
6961
7241
  case 3:
6962
7242
  return (react_1.default.createElement(react_1.default.Fragment, null,
@@ -6969,40 +7249,6 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
6969
7249
  return null;
6970
7250
  }
6971
7251
  };
6972
- var renderQueryData = function () {
6973
- var queryStructureView = [];
6974
- var sortComponent = undefined;
6975
- queryList.map(function (data, index) {
6976
- if (queryList.length > 1) {
6977
- var upData_1 = index === queryList.length - 1;
6978
- sortComponent = (react_1.default.createElement("div", { className: "ml-2 cursor-pointer", onClick: function () {
6979
- handleSortQuery(index, upData_1 ? "up" : "down");
6980
- } }, upData_1 ? (react_1.default.createElement(outline_1.ArrowUpIcon, { className: "block w-5 h-5 text-primary-600" })) : (react_1.default.createElement(outline_1.ArrowDownIcon, { className: "block w-5 h-5 text-primary-600" }))));
6981
- }
6982
- var value = data.value;
6983
- var isDate = (0, dayjs_1.default)(value);
6984
- if (isDate.isValid())
6985
- value = (0, dayjs_1.default)(value).format("DD/MM/YYYY h:mm a");
6986
- queryStructureView.push({
6987
- key: index,
6988
- name: data.queryId,
6989
- value: value,
6990
- sort: sortComponent,
6991
- view: (react_1.default.createElement("div", { className: "ml-2 cursor-pointer", onClick: function () {
6992
- handleViewQuery(index);
6993
- } },
6994
- react_1.default.createElement(outline_1.EyeIcon, { className: "block w-5 h-5 text-primary-600" }))),
6995
- del: (react_1.default.createElement("div", { className: "ml-2 cursor-pointer", onClick: function () {
6996
- var temp = JSON.parse(JSON.stringify(queryList));
6997
- temp.splice(index, 1);
6998
- setQueryList(temp);
6999
- } },
7000
- react_1.default.createElement(outline_1.TrashIcon, { className: "block w-5 h-5 text-primary-600" }))),
7001
- });
7002
- return "";
7003
- });
7004
- return queryStructureView;
7005
- };
7006
7252
  //=====================================================================================
7007
7253
  //SECTION: Render CRUD
7008
7254
  //=====================================================================================
@@ -7037,6 +7283,35 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7037
7283
  // INFO: in schema-hide mode a hidden column must stay listed so it can be
7038
7284
  // shown again; in per-user mode a developer-hidden column is never togglable
7039
7285
  var getViewSettingsColumns = function () { return getTogglableColumns(isSchemaHideMode); };
7286
+ // INFO: the header sort options, unchanged for every other column. Formula
7287
+ // columns sort on their computed value, so they are added where that is
7288
+ // supported and left out where it is not (Firebase, union).
7289
+ var handleGetSortOptions = function () {
7290
+ var _a, _b, _c;
7291
+ var baseOptions = (_c = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.renderReferenceLabelOptions) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : (isViewSettingsEnabled
7292
+ ? getViewSettingsColumns().map(function (eachColumn) {
7293
+ var _a;
7294
+ return ({
7295
+ key: eachColumn.id,
7296
+ label: (_a = eachColumn.name) !== null && _a !== void 0 ? _a : eachColumn.id,
7297
+ });
7298
+ })
7299
+ : undefined);
7300
+ if (!baseOptions || formulaColumnIds.length === 0)
7301
+ return baseOptions;
7302
+ var otherOptions = baseOptions.filter(function (eachOption) { return !formulaColumnIds.includes(eachOption.key); });
7303
+ if (!isFormulaViewSupported)
7304
+ return otherOptions;
7305
+ return __spreadArray(__spreadArray([], otherOptions, true), structure
7306
+ .filter(function (eachModel) { return eachModel.type === "formula"; })
7307
+ .map(function (eachModel) {
7308
+ var _a;
7309
+ return ({
7310
+ key: eachModel.id,
7311
+ label: (_a = eachModel.name) !== null && _a !== void 0 ? _a : eachModel.id,
7312
+ });
7313
+ }), true);
7314
+ };
7040
7315
  var getIsColumnHidden = function (column) {
7041
7316
  return isSchemaHideMode
7042
7317
  ? !!column.hide
@@ -7093,7 +7368,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
7093
7368
  react_1.default.createElement("p", { className: "text-sm font-medium ".concat(labelColor) }, "Sort"),
7094
7369
  react_1.default.createElement("div", { className: "mt-1 flex flex-row items-center gap-x-2" },
7095
7370
  react_1.default.createElement("div", { className: "grow min-w-0" },
7096
- react_1.default.createElement(select_1.Select, { id: "dtw-view-sort-column", portalDropdown: true, label: "", containerClassName: "min-w-0", value: (_b = activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) !== null && _b !== void 0 ? _b : "", placeholder: "Column", darkMode: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode, options: viewColumns.map(function (eachColumn) {
7371
+ react_1.default.createElement(select_1.Select, { id: "dtw-view-sort-column", portalDropdown: true, label: "", containerClassName: "min-w-0", value: (_b = activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) !== null && _b !== void 0 ? _b : "", placeholder: "Column", darkMode: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode, options: viewColumns
7372
+ .filter(function (eachColumn) {
7373
+ return isFormulaViewSupported || eachColumn.type !== "formula";
7374
+ })
7375
+ .map(function (eachColumn) {
7097
7376
  var _a;
7098
7377
  return ({
7099
7378
  key: eachColumn.id,
@@ -8329,7 +8608,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8329
8608
  };
8330
8609
  // INFO: Desktop — PopUp (hidden on mobile)
8331
8610
  actionElementList.push(react_1.default.createElement("div", { className: "hidden md:block" },
8332
- react_1.default.createElement(popUp_1.PopUp, { darkMode: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.darkMode, ctaComp: flexFilterIconBtn(), renderComp: (0, flexFilter_1.renderFlexFilterPopupContent)(flexFilters, structure, devSettings, dbModule, flexFilterReferenceOptions, flexFilterReferenceSearch, flexActions, (_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareListFilterQuery, searchInput, (_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareListFilterAddComponent, undefined, {
8611
+ react_1.default.createElement(popUp_1.PopUp, { darkMode: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.darkMode, ctaComp: flexFilterIconBtn(), renderComp: (0, flexFilter_1.renderFlexFilterPopupContent)(flexFilters, flexFilterStructure, devSettings, dbModule, flexFilterReferenceOptions, flexFilterReferenceSearch, flexActions, (_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareListFilterQuery, searchInput, (_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareListFilterAddComponent, undefined, {
8333
8612
  darkMode: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.darkMode,
8334
8613
  darkModeBg: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.darkModeBg,
8335
8614
  }), anchor: "right", excludePortalIds: ["datepicker-portal", "select-portal"], lib: { Transition: (_3 = props === null || props === void 0 ? void 0 : props.lib) === null || _3 === void 0 ? void 0 : _3.Transition } })));
@@ -8337,7 +8616,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8337
8616
  actionElementList.push(react_1.default.createElement("div", { className: "block md:hidden" },
8338
8617
  !((_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListMobileFloatingSearch) &&
8339
8618
  flexFilterIconBtn(true),
8340
- (0, flexFilter_1.renderFlexFilterModal)(flexFilterModalOpen, flexFilters, structure, devSettings, dbModule, flexFilterReferenceOptions, flexFilterReferenceSearch, flexActions, function () { return setFlexFilterModalOpen(false); }, (_5 = props.bareSettings) === null || _5 === void 0 ? void 0 : _5.bareListFilterQuery, searchInput, (_6 = props.bareSettings) === null || _6 === void 0 ? void 0 : _6.bareListFilterAddComponent, {
8619
+ (0, flexFilter_1.renderFlexFilterModal)(flexFilterModalOpen, flexFilters, flexFilterStructure, devSettings, dbModule, flexFilterReferenceOptions, flexFilterReferenceSearch, flexActions, function () { return setFlexFilterModalOpen(false); }, (_5 = props.bareSettings) === null || _5 === void 0 ? void 0 : _5.bareListFilterQuery, searchInput, (_6 = props.bareSettings) === null || _6 === void 0 ? void 0 : _6.bareListFilterAddComponent, {
8341
8620
  darkMode: (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.darkMode,
8342
8621
  darkModeBg: (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.darkModeBg,
8343
8622
  })));
@@ -8714,6 +8993,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8714
8993
  return false;
8715
8994
  if (!groupId || isFirebase)
8716
8995
  return false;
8996
+ // INFO: a formula sort or filter needs every row read and ordered at
8997
+ // once; band pages come straight from the server without it, so the bands
8998
+ // are built from the formula-ordered rows instead
8999
+ if (isFormulaView)
9000
+ return false;
8717
9001
  // INFO: a union list pages by skip, which a per-band cursor cannot express,
8718
9002
  // so it keeps the single pager and groups the loaded rows
8719
9003
  if ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.unionCollections) === null || _b === void 0 ? void 0 : _b.length)
@@ -9234,7 +9518,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9234
9518
  });
9235
9519
  };
9236
9520
  var renderGroupTable = function (multipleSelect) {
9237
- 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;
9521
+ 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;
9238
9522
  if (groupId && !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)) {
9239
9523
  var groupAttributeDS_1 = structure.find(function (eachDS) { return eachDS.id === groupId; });
9240
9524
  var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
@@ -9262,7 +9546,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9262
9546
  }
9263
9547
  else {
9264
9548
  return Object.entries(groupedSpaceTableData).map(function (_a) {
9265
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
9549
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
9266
9550
  var eachKey = _a[0], eachValue = _a[1];
9267
9551
  var dataList = eachValue;
9268
9552
  var ids = (dataList === null || dataList === void 0 ? void 0 : dataList.map(function (eachData) { return eachData._id; })) || [];
@@ -9273,7 +9557,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9273
9557
  react_1.default.createElement("div", { className: "font-semibold text-md mt-5" },
9274
9558
  "Group By ",
9275
9559
  eachKey),
9276
- react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], referencesOptions: listReferencesOptions, size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
9560
+ react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], referencesOptions: listReferencesOptions, size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: ((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table) ||
9561
+ isFormulaView, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
9277
9562
  selectedIds.length > 0 &&
9278
9563
  canBatchUpdate &&
9279
9564
  !((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
@@ -9308,15 +9593,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9308
9593
  // INFO: per-column header filter is replaced by the flex filters
9309
9594
  filterEnabled: false,
9310
9595
  sortId: activeSortId,
9311
- sortOptions: (_t = (_s = (_r = props.organise) === null || _r === void 0 ? void 0 : _r.renderReferenceLabelOptions) === null || _s === void 0 ? void 0 : _s.call(_r)) !== null && _t !== void 0 ? _t : (isViewSettingsEnabled
9312
- ? getViewSettingsColumns().map(function (eachColumn) {
9313
- var _a;
9314
- return ({
9315
- key: eachColumn.id,
9316
- label: (_a = eachColumn.name) !== null && _a !== void 0 ? _a : eachColumn.id,
9317
- });
9318
- })
9319
- : undefined),
9596
+ sortOptions: handleGetSortOptions(),
9320
9597
  onSortColumn: handleSortColumn,
9321
9598
  // INFO: header drag and the panel handle run the same reorder, so the
9322
9599
  // order persists identically whichever one the user grabs
@@ -9354,7 +9631,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9354
9631
  });
9355
9632
  }); },
9356
9633
  }, onObjectEdit: handleObjectCellEdit, addable: {
9357
- active: ((_u = props.edit) === null || _u === void 0 ? void 0 : _u.listAddable) ? true : false,
9634
+ active: ((_r = props.edit) === null || _r === void 0 ? void 0 : _r.listAddable) ? true : false,
9358
9635
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
9359
9636
  var createdId;
9360
9637
  return __generator(this, function (_a) {
@@ -9368,7 +9645,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9368
9645
  }
9369
9646
  });
9370
9647
  }); },
9371
- }, darkMode: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.darkMode, hidePagination: true, disableEllipsisOnLongWord: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.disableEllipsisOnLongWord })));
9648
+ }, darkMode: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.darkMode, hidePagination: true, disableEllipsisOnLongWord: (_t = props.organise) === null || _t === void 0 ? void 0 : _t.disableEllipsisOnLongWord })));
9372
9649
  });
9373
9650
  }
9374
9651
  }
@@ -9384,7 +9661,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9384
9661
  ? function (groupKey, page) {
9385
9662
  return handleFetchGroupPage(groupKey, page);
9386
9663
  }
9387
- : undefined, groupLoadingStatus: renderCheckGroupPaging() ? groupPageState : undefined, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.disableSelectFullData) === null || _e === void 0 ? void 0 : _e.table, maxSelectedCount: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListMaxSelectedCount, mobileView: (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListMobileView, mobileTooltip: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (canBatchUpdate &&
9664
+ : undefined, groupLoadingStatus: renderCheckGroupPaging() ? groupPageState : undefined, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: ((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.disableSelectFullData) === null || _e === void 0 ? void 0 : _e.table) || isFormulaView, maxSelectedCount: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListMaxSelectedCount, mobileView: (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListMobileView, mobileTooltip: (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (canBatchUpdate &&
9388
9665
  !((_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareHideTableExtraMultipleAction)
9389
9666
  ? [
9390
9667
  {
@@ -9454,28 +9731,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9454
9731
  return structure.find(function (eachColumn) { return eachColumn.id === columnId; });
9455
9732
  }
9456
9733
  : undefined,
9457
- renderAddColumnElements: ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareAddColumns)
9734
+ getSchema: ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareAddColumns)
9735
+ ? function () { return structure; }
9736
+ : undefined,
9737
+ renderAddColumnElements: ((_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareAddColumns)
9458
9738
  ? undefined
9459
9739
  : renderAddMathColumn,
9460
9740
  // INFO: the popup's reference pickers read from the same providers
9461
9741
  // the schema editor uses — without them a reference column would be
9462
9742
  // created with no target and resolve nothing
9463
- renderReferenceSpaceOptions: (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.renderReferenceSpaceOptions,
9464
- renderReferenceLabelOptions: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.renderReferenceLabelOptions,
9743
+ renderReferenceSpaceOptions: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.renderReferenceSpaceOptions,
9744
+ renderReferenceLabelOptions: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.renderReferenceLabelOptions,
9465
9745
  dragEnabled: isViewSettingsEnabled,
9466
9746
  sortEnabled: isViewSettingsEnabled,
9467
9747
  // INFO: per-column header filter is replaced by the flex filters
9468
9748
  filterEnabled: false,
9469
9749
  sortId: activeSortId,
9470
- sortOptions: (_4 = (_3 = (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.renderReferenceLabelOptions) === null || _3 === void 0 ? void 0 : _3.call(_2)) !== null && _4 !== void 0 ? _4 : (isViewSettingsEnabled
9471
- ? getViewSettingsColumns().map(function (eachColumn) {
9472
- var _a;
9473
- return ({
9474
- key: eachColumn.id,
9475
- label: (_a = eachColumn.name) !== null && _a !== void 0 ? _a : eachColumn.id,
9476
- });
9477
- })
9478
- : undefined),
9750
+ sortOptions: handleGetSortOptions(),
9479
9751
  onSortColumn: handleSortColumn,
9480
9752
  // INFO: header drag and the panel handle run the same reorder, so the
9481
9753
  // order persists identically whichever one the user grabs
@@ -9514,7 +9786,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9514
9786
  });
9515
9787
  }); },
9516
9788
  }, onObjectEdit: handleObjectCellEdit, addable: {
9517
- active: ((_5 = props.edit) === null || _5 === void 0 ? void 0 : _5.listAddable) ? true : false,
9789
+ active: ((_3 = props.edit) === null || _3 === void 0 ? void 0 : _3.listAddable) ? true : false,
9518
9790
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
9519
9791
  var createdId;
9520
9792
  return __generator(this, function (_a) {
@@ -9528,16 +9800,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9528
9800
  }
9529
9801
  });
9530
9802
  }); },
9531
- }, darkMode: (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.darkMode,
9803
+ }, darkMode: (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.darkMode,
9532
9804
  // INFO: each band pages itself, so the list-wide pager would only
9533
9805
  // page the read that seeded them
9534
- hidePagination: ((_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.hidePagination) ||
9535
- (renderCheckGroupPaging() && !renderCheckScrollMode()), customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.disableEllipsisOnLongWord, pinColumns: (_9 = props.bareSettings) === null || _9 === void 0 ? void 0 : _9.bareListTablePinColumns }));
9806
+ hidePagination: ((_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.hidePagination) ||
9807
+ (renderCheckGroupPaging() && !renderCheckScrollMode()), customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableEllipsisOnLongWord, pinColumns: (_7 = props.bareSettings) === null || _7 === void 0 ? void 0 : _7.bareListTablePinColumns }));
9536
9808
  }
9537
- return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_11 = (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.disableSelectFullData) === null || _11 === void 0 ? void 0 : _11.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
9809
+ return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: ((_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.disableSelectFullData) === null || _9 === void 0 ? void 0 : _9.table) || isFormulaView, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
9538
9810
  selectedIds.length > 0 &&
9539
9811
  canBatchUpdate &&
9540
- !((_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
9812
+ !((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
9541
9813
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
9542
9814
  handleBatchDraftData();
9543
9815
  } }),
@@ -9551,8 +9823,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9551
9823
  !isFirebase && canBatchUpdate && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
9552
9824
  setBatchUpdateModal(true);
9553
9825
  } })),
9554
- ((_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareListMultipleSelectAddtionalActions) &&
9555
- ((_15 = (_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareListMultipleSelectAddtionalActions) === null || _15 === void 0 ? void 0 : _15.map(function (eachButton) {
9826
+ ((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareListMultipleSelectAddtionalActions) &&
9827
+ ((_13 = (_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareListMultipleSelectAddtionalActions) === null || _13 === void 0 ? void 0 : _13.map(function (eachButton) {
9556
9828
  return (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm ".concat(eachButton.className), text: eachButton.text, onClick: function () {
9557
9829
  var _a, _b;
9558
9830
  (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
@@ -9561,25 +9833,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9561
9833
  var _a, _b;
9562
9834
  handleCaptureListScroll(id);
9563
9835
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
9564
- }, linkType: props.linkType, custom: props.custom, newTabUrl: (_17 = (_16 = props.newTabUrl) === null || _16 === void 0 ? void 0 : _16.default) !== null && _17 !== void 0 ? _17 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_19 = (_18 = props.newTabUrl) === null || _18 === void 0 ? void 0 : _18.addons) !== null && _19 !== void 0 ? _19 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
9836
+ }, linkType: props.linkType, custom: props.custom, newTabUrl: (_15 = (_14 = props.newTabUrl) === null || _14 === void 0 ? void 0 : _14.default) !== null && _15 !== void 0 ? _15 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_17 = (_16 = props.newTabUrl) === null || _16 === void 0 ? void 0 : _16.addons) !== null && _17 !== void 0 ? _17 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
9565
9837
  handlePagination(value);
9566
- }, className: "mt-5", lib: { axios: (_20 = props.lib) === null || _20 === void 0 ? void 0 : _20.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.fixedPagination, advSettings: {
9567
- addColumnEnabled: (_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.addColumnEnabled,
9838
+ }, className: "mt-5", lib: { axios: (_18 = props.lib) === null || _18 === void 0 ? void 0 : _18.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.fixedPagination, advSettings: {
9839
+ addColumnEnabled: (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.addColumnEnabled,
9568
9840
  renderAddColumnElements: renderAddMathColumn,
9569
9841
  dragEnabled: isViewSettingsEnabled,
9570
9842
  sortEnabled: isViewSettingsEnabled,
9571
9843
  // INFO: per-column header filter is replaced by the flex filters
9572
9844
  filterEnabled: false,
9573
9845
  sortId: activeSortId,
9574
- sortOptions: (_25 = (_24 = (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.renderReferenceLabelOptions) === null || _24 === void 0 ? void 0 : _24.call(_23)) !== null && _25 !== void 0 ? _25 : (isViewSettingsEnabled
9575
- ? getViewSettingsColumns().map(function (eachColumn) {
9576
- var _a;
9577
- return ({
9578
- key: eachColumn.id,
9579
- label: (_a = eachColumn.name) !== null && _a !== void 0 ? _a : eachColumn.id,
9580
- });
9581
- })
9582
- : undefined),
9846
+ sortOptions: handleGetSortOptions(),
9583
9847
  onSortColumn: handleSortColumn,
9584
9848
  // INFO: header drag and the panel handle run the same reorder, so the
9585
9849
  // order persists identically whichever one the user grabs
@@ -9615,7 +9879,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9615
9879
  });
9616
9880
  }); },
9617
9881
  }, onObjectEdit: handleObjectCellEdit, addable: {
9618
- active: ((_26 = props.edit) === null || _26 === void 0 ? void 0 : _26.listAddable) ? true : false,
9882
+ active: ((_21 = props.edit) === null || _21 === void 0 ? void 0 : _21.listAddable) ? true : false,
9619
9883
  onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
9620
9884
  var createdId;
9621
9885
  return __generator(this, function (_a) {
@@ -9629,7 +9893,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9629
9893
  }
9630
9894
  });
9631
9895
  }); },
9632
- }, darkMode: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.darkMode, hidePagination: (_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.disableEllipsisOnLongWord }));
9896
+ }, darkMode: (_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.darkMode, hidePagination: (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.disableEllipsisOnLongWord }));
9633
9897
  }
9634
9898
  };
9635
9899
  // INFO: `hidden` keeps the markers out of space-y spacing
@@ -9932,7 +10196,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9932
10196
  else if (selectedTabData.viewType === "list") {
9933
10197
  // INFO: when bareNewDTW is enabled, render NewList instead of legacy List
9934
10198
  if ((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareNewDTW) {
9935
- return (react_1.default.createElement(newList_1.NewList, { darkModeBg: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.disableSelectFullData) === null || _w === void 0 ? void 0 : _w.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", maxSelectedCount: (_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareListMaxSelectedCount, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
10199
+ return (react_1.default.createElement(newList_1.NewList, { darkModeBg: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.disableSelectFullData) === null || _w === void 0 ? void 0 : _w.list) || isFormulaView, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", maxSelectedCount: (_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareListMaxSelectedCount, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
9936
10200
  selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
9937
10201
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
9938
10202
  handleBatchDraftData();
@@ -9955,7 +10219,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9955
10219
  }, darkMode: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.darkMode, className: "mt-5", hidePagination: (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.hidePagination, customPaginationSize: customPaginationSize, mobileTooltip: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListMobileTooltip }));
9956
10220
  }
9957
10221
  return (react_1.default.createElement(react_1.default.Fragment, null,
9958
- react_1.default.createElement(list_1.List, { darkModeBg: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: (_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableSelectFullData) === null || _7 === void 0 ? void 0 : _7.list, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
10222
+ react_1.default.createElement(list_1.List, { darkModeBg: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableSelectFullData) === null || _7 === void 0 ? void 0 : _7.list) || isFormulaView, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
9959
10223
  selectedIds.length > 0 && canBatchUpdate && (react_1.default.createElement(react_1.default.Fragment, null,
9960
10224
  react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
9961
10225
  handleBatchDraftData();
@@ -10728,52 +10992,37 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10728
10992
  }
10729
10993
  else if (exportExcel || exportQR) {
10730
10994
  var showEmail = exportType !== "pdf" && !((_f = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.exportSettings) === null || _f === void 0 ? void 0 : _f.disableEmail);
10731
- return (react_1.default.createElement(react_1.default.Fragment, null, queryForm ? (react_1.default.createElement(queryForm_1.QueryForm, { dbModule: (_g = props.lib) === null || _g === void 0 ? void 0 : _g.axios, model: structure, updateQuery: queryIndex >= 0 ? queryList[queryIndex] : undefined, devSettings: props.devSettings, handleCloseForm: function () {
10732
- handleViewQuery(-1);
10733
- }, handleQueryOnComplete: function (queryData) {
10734
- handlePushQueryList(queryData, queryIndex);
10735
- }, renderReferenceLabelOptions: ((_h = props.organise) === null || _h === void 0 ? void 0 : _h.renderReferenceLabelOptions)
10736
- ? (_j = props.organise) === null || _j === void 0 ? void 0 : _j.renderReferenceLabelOptions
10737
- : function () {
10738
- return [];
10739
- } })) : (react_1.default.createElement("div", null,
10740
- showEmail ? (react_1.default.createElement(react_1.default.Fragment, null,
10741
- react_1.default.createElement("div", null,
10742
- react_1.default.createElement("h1", null, "Download file or send it via email."),
10743
- react_1.default.createElement("p", { className: "pt-2 mb-4 text-sm text-gray-600" },
10744
- exportExcel
10745
- ? "Export your data to .csv format to be viewable on Excel."
10746
- : "Export your data to .pdf format to be viewable on Adobe/Browser.",
10747
- "Filter your data exported based on conditions by creating queries at the table below."),
10748
- react_1.default.createElement(react_1.default.Fragment, null,
10749
- react_1.default.createElement(textInput_1.TextInput, { ref: exportCSVEmailInputRef, value: exportCSVEmail, type: "email", label: "Email", subLabel: "A download link will be sent to your email", placeholder: (_l = (_k = props.devSettings.currentUser) === null || _k === void 0 ? void 0 : _k.userEmail) !== null && _l !== void 0 ? _l : "Enter your email", onChange: function (e) { return setExportCSVEmail(e.target.value); } }),
10750
- react_1.default.createElement("div", { className: "flex mt-5 items-center justify-end" },
10751
- react_1.default.createElement(iconButton_1.IconButton, { className: "sm", icon: react_1.default.createElement(outline_1.PlusCircleIcon, { className: "w-6 h-6 text-white" }), background: "bg-primary-500 hover:bg-primary-600", onClick: function () { return setQueryForm(!queryForm); } })))),
10752
- react_1.default.createElement(table_1.Table, { className: "mt-5", header: dataStateModel_1.queryTableHeader, data: renderQueryData(), loading: false }))) : (react_1.default.createElement(react_1.default.Fragment, null,
10753
- react_1.default.createElement("p", null, "Click the button below to download."),
10754
- (exportType === "pdf" || exportType === "print") && (react_1.default.createElement(textInput_1.TextInput, { containerClassName: "mt-5", value: exportPDFTitle, type: "text", label: "Title (Optional)", placeholder: (_p = (_o = (_m = props.organise) === null || _m === void 0 ? void 0 : _m.exportSettings) === null || _o === void 0 ? void 0 : _o.defaultExportPDFName) !== null && _p !== void 0 ? _p : "Enter your report title", onChange: function (e) { return setExportPDFTitle(e.target.value); } })),
10755
- (exportType === "pdf" || exportType === "print") && (react_1.default.createElement(select_1.Select, { portalDropdown: true, label: "Sum Attribute", containerClassName: "mt-5", value: exportSumAttributeIds, options: (_s = (_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.renderReferenceLabelOptions) === null || _r === void 0 ? void 0 : _r.call(_q, "", false, "number")) !== null && _s !== void 0 ? _s : [], staticDropdown: true, onChange: function (value) {
10756
- setExportSumAttributeIds(value);
10757
- } })))),
10758
- react_1.default.createElement("div", { className: "mt-5 flex items-center justify-between" },
10759
- react_1.default.createElement("label", { className: "text-sm font-medium ".concat(((_t = props.organise) === null || _t === void 0 ? void 0 : _t.darkMode) ? "text-gray-200" : "text-gray-700") }, "Hide Sub Items"),
10760
- react_1.default.createElement(toggle_1.Toggle, { text: "", direction: "right", value: hideSubItems, onClick: function () { return setHideSubItems(!hideSubItems); } })),
10761
- react_1.default.createElement("div", { className: "flex justify-end mt-5 " },
10762
- showEmail && (react_1.default.createElement(button_1.Button, { text: "Send to email", size: "small", type: "normal", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
10763
- return __generator(this, function (_a) {
10764
- switch (_a.label) {
10765
- case 0: return [4 /*yield*/, exportCSVEmailInputRef.current.handleSubmit()];
10766
- case 1:
10767
- if (_a.sent()) {
10768
- handleExportCSVData();
10769
- }
10770
- return [2 /*return*/];
10771
- }
10772
- });
10773
- }); } })),
10774
- react_1.default.createElement(button_1.Button, { type: "normal", text: "Download", size: "small", className: "ml-3", onClick: function () {
10775
- return handleExportCSVData(true, exportType === "print");
10776
- } }))))));
10995
+ return (react_1.default.createElement(react_1.default.Fragment, null,
10996
+ react_1.default.createElement("div", null,
10997
+ showEmail ? (react_1.default.createElement(textInput_1.TextInput, { ref: exportCSVEmailInputRef, value: exportCSVEmail, type: "email", label: "Email", size: "xs", placeholder: (_h = (_g = props.devSettings.currentUser) === null || _g === void 0 ? void 0 : _g.userEmail) !== null && _h !== void 0 ? _h : "Enter your email", onChange: function (e) { return setExportCSVEmail(e.target.value); } })) : (react_1.default.createElement(react_1.default.Fragment, null,
10998
+ react_1.default.createElement("p", null, "Click the button below to download."),
10999
+ (exportType === "pdf" || exportType === "print") && (react_1.default.createElement(textInput_1.TextInput, { containerClassName: "mt-5", value: exportPDFTitle, type: "text", label: "Title (Optional)", placeholder: (_l = (_k = (_j = props.organise) === null || _j === void 0 ? void 0 : _j.exportSettings) === null || _k === void 0 ? void 0 : _k.defaultExportPDFName) !== null && _l !== void 0 ? _l : "Enter your report title", onChange: function (e) { return setExportPDFTitle(e.target.value); } })),
11000
+ (exportType === "pdf" || exportType === "print") && (react_1.default.createElement(select_1.Select, { portalDropdown: true, label: "Sum Attribute", containerClassName: "mt-5", value: exportSumAttributeIds, options: (_p = (_o = (_m = props.organise) === null || _m === void 0 ? void 0 : _m.renderReferenceLabelOptions) === null || _o === void 0 ? void 0 : _o.call(_m, "", false, "number")) !== null && _p !== void 0 ? _p : [], staticDropdown: true, onChange: function (value) {
11001
+ setExportSumAttributeIds(value);
11002
+ } })))),
11003
+ react_1.default.createElement("div", { className: "mt-3 -mx-4 [&>div]:w-full [&>div]:max-w-none" }, (0, flexFilter_1.renderFlexFilterPopupContent)(exportFlexFilters, exportFilterStructure, devSettings, dbModule, flexFilterReferenceOptions, flexFilterReferenceSearch, exportFlexActions, (_q = props.bareSettings) === null || _q === void 0 ? void 0 : _q.bareListFilterQuery, undefined, undefined, true, {
11004
+ darkMode: (_r = props.organise) === null || _r === void 0 ? void 0 : _r.darkMode,
11005
+ darkModeBg: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.darkModeBg,
11006
+ })),
11007
+ react_1.default.createElement("div", { className: "mt-3 flex items-center justify-between" },
11008
+ react_1.default.createElement("label", { className: "text-sm font-medium ".concat(((_t = props.organise) === null || _t === void 0 ? void 0 : _t.darkMode) ? "text-gray-200" : "text-gray-700") }, "Hide Sub Items"),
11009
+ react_1.default.createElement(toggle_1.Toggle, { text: "", direction: "right", value: hideSubItems, onClick: function () { return setHideSubItems(!hideSubItems); } })),
11010
+ react_1.default.createElement("div", { className: "flex justify-end mt-5 " },
11011
+ showEmail && (react_1.default.createElement(button_1.Button, { text: "Send to email", size: "small", type: "normal", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
11012
+ return __generator(this, function (_a) {
11013
+ switch (_a.label) {
11014
+ case 0: return [4 /*yield*/, exportCSVEmailInputRef.current.handleSubmit()];
11015
+ case 1:
11016
+ if (_a.sent()) {
11017
+ handleExportCSVData();
11018
+ }
11019
+ return [2 /*return*/];
11020
+ }
11021
+ });
11022
+ }); } })),
11023
+ react_1.default.createElement(button_1.Button, { type: "normal", text: "Download", size: "small", className: "ml-3", onClick: function () {
11024
+ return handleExportCSVData(true, exportType === "print");
11025
+ } })))));
10777
11026
  }
10778
11027
  else if (addTabModal) {
10779
11028
  return (react_1.default.createElement(settingsModal_1.TabModal, { type: resolvedType, tabs: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.extendedTabs, editIndex: editTabIndex >= 0 ? editTabIndex : undefined, onChangeTabs: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.onChangeTabs, model: structure, collectionId: props.collectionId, renderReferenceLabelOptions: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.renderReferenceLabelOptions, onClose: function () {
@@ -11131,18 +11380,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11131
11380
  };
11132
11381
  return (react_1.default.createElement(react_1.default.Fragment, null,
11133
11382
  renderNotification("root"),
11134
- ((_77 = (_76 = props.renderSettings) === null || _76 === void 0 ? void 0 : _76.renderLoadingUI) === null || _77 === void 0 ? void 0 : _77.call(_76)) && loading ? ((_78 = props.renderSettings) === null || _78 === void 0 ? void 0 : _78.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.darkMode, darkModeBg: (_80 = props.organise) === null || _80 === void 0 ? void 0 : _80.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
11383
+ ((_79 = (_78 = props.renderSettings) === null || _78 === void 0 ? void 0 : _78.renderLoadingUI) === null || _79 === void 0 ? void 0 : _79.call(_78)) && loading ? ((_80 = props.renderSettings) === null || _80 === void 0 ? void 0 : _80.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.darkMode, darkModeBg: (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
11135
11384
  var _a, _b;
11136
11385
  if (loading)
11137
11386
  return;
11138
- if (queryForm)
11139
- handleViewQuery(-1);
11140
- else {
11141
- handlePopUpModal(false);
11142
- setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
11143
- }
11387
+ handlePopUpModal(false);
11388
+ setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
11144
11389
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
11145
- react_1.default.createElement(modal_1.Modal, { darkMode: (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.darkMode, darkModeBg: (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
11390
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.darkMode, darkModeBg: (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
11146
11391
  return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
11147
11392
  if (dataId) {
11148
11393
  var currentValue = selectedData[referenceCreationModal.id];
@@ -11158,19 +11403,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11158
11403
  }, onClose: function () {
11159
11404
  setReferenceCreationModal({ id: "", name: "", type: "string" });
11160
11405
  } }),
11161
- react_1.default.createElement(modal_1.Modal, { darkMode: (_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.darkMode, darkModeBg: (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
11406
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.darkMode, darkModeBg: (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
11162
11407
  setReferenceDeleteTableData({});
11163
11408
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11164
- react_1.default.createElement(modal_1.Modal, { darkMode: (_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.darkMode, darkModeBg: (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
11409
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.darkMode, darkModeBg: (_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
11165
11410
  setDeletePasscodeInput("");
11166
11411
  setDeleteModal(!deleteModal);
11167
11412
  setDeleteFeedId("");
11168
11413
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11169
- react_1.default.createElement(modal_1.Modal, { darkMode: (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.darkMode, darkModeBg: (_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
11414
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.darkMode, darkModeBg: (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
11170
11415
  setBatchUpdateData({ columnId: "", columnData: {} });
11171
11416
  setBatchUpdateModal(false);
11172
11417
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
11173
- react_1.default.createElement(modal_1.Modal, { darkMode: (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.darkMode, darkModeBg: (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
11418
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.darkMode, darkModeBg: (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
11174
11419
  var _a, _b;
11175
11420
  if (props.space)
11176
11421
  return (react_1.default.createElement(authModal_1.AuthModal, { space: props.space, userId: (_a = props.id) !== null && _a !== void 0 ? _a : "", client: (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, type: selectedAuthMethod, authMethods: authMethods, onComplete: handleAuthComplete }));
@@ -11178,7 +11423,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
11178
11423
  }, onClose: function () {
11179
11424
  setSelectedAuthMethod("");
11180
11425
  } }),
11181
- isActivityLog && (react_1.default.createElement(modal_1.Modal, { darkMode: (_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.darkMode, darkModeBg: (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.darkModeBg, open: activityModal, title: "Activity Log", renderContent: function () {
11426
+ isActivityLog && (react_1.default.createElement(modal_1.Modal, { darkMode: (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.darkMode, darkModeBg: (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.darkModeBg, open: activityModal, title: "Activity Log", renderContent: function () {
11182
11427
  var _a, _b;
11183
11428
  return (react_1.default.createElement(activityModal_1.ActivityModal, { title: props.title && typeof props.title === "string"
11184
11429
  ? props.title