blixify-ui-web 1.2.123 → 1.2.125

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 (33) hide show
  1. package/lib/components/data/dataTemplate/dataStateModel.d.ts +10 -1
  2. package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
  3. package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
  4. package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
  5. package/lib/components/data/dataTemplate/index.js +481 -208
  6. package/lib/components/data/dataTemplate/index.js.map +1 -1
  7. package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +40 -0
  8. package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
  9. package/lib/components/data/dataTemplate/viewStatePersistence.js +99 -1
  10. package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
  11. package/lib/components/data/flexFilter/index.d.ts.map +1 -1
  12. package/lib/components/data/flexFilter/index.js +16 -16
  13. package/lib/components/data/flexFilter/index.js.map +1 -1
  14. package/lib/components/data/writeQuery/index.d.ts +1 -0
  15. package/lib/components/data/writeQuery/index.d.ts.map +1 -1
  16. package/lib/components/data/writeQuery/index.js +2 -0
  17. package/lib/components/data/writeQuery/index.js.map +1 -1
  18. package/lib/components/display/newKanban/index.js +2 -2
  19. package/lib/components/display/newKanban/index.js.map +1 -1
  20. package/lib/components/input/datePicker/index.d.ts +2 -0
  21. package/lib/components/input/datePicker/index.d.ts.map +1 -1
  22. package/lib/components/input/datePicker/index.js +11 -3
  23. package/lib/components/input/datePicker/index.js.map +1 -1
  24. package/lib/components/input/select/index.d.ts +1 -0
  25. package/lib/components/input/select/index.d.ts.map +1 -1
  26. package/lib/components/input/select/index.js +20 -13
  27. package/lib/components/input/select/index.js.map +1 -1
  28. package/lib/components/input/textInput/index.d.ts +2 -0
  29. package/lib/components/input/textInput/index.d.ts.map +1 -1
  30. package/lib/components/input/textInput/index.js +16 -3
  31. package/lib/components/input/textInput/index.js.map +1 -1
  32. package/lib/tail.css +2 -2
  33. package/package.json +1 -1
@@ -200,10 +200,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
200
200
  // Every read of the view type below uses resolvedType. The distinction matters
201
201
  // most in effect dependency arrays — following props.type there would leave
202
202
  // the list never refetching while the panel is open, which fails silently.
203
- 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;
203
+ 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;
204
204
  // INFO: the panel cannot navigate its way out — handleNavigate("read") is
205
205
  // routed straight back into it — so expand-to-full-page is local state.
206
- var _80 = (0, react_1.useState)(false), drawerPageView = _80[0], setDrawerPageView = _80[1];
206
+ var _85 = (0, react_1.useState)(false), drawerPageView = _85[0], setDrawerPageView = _85[1];
207
207
  // INFO: the panel keeps rendering the record it was opened with rather than
208
208
  // live props. Without this, navigating back to the list would re-render the
209
209
  // still-mounted panel as a second list behind the overlay.
@@ -285,18 +285,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
285
285
  initialFilterReferenceDate: initialFilterReferenceDate,
286
286
  };
287
287
  };
288
- var _81 = intialiseDefaultFilterValues(), initialFilterSearch = _81.initialFilterSearch, initialFilterSearchParams = _81.initialFilterSearchParams, initialFilterSelection = _81.initialFilterSelection, initialFilterReference = _81.initialFilterReference, initialFilterReferenceDate = _81.initialFilterReferenceDate;
288
+ var _86 = intialiseDefaultFilterValues(), initialFilterSearch = _86.initialFilterSearch, initialFilterSearchParams = _86.initialFilterSearchParams, initialFilterSelection = _86.initialFilterSelection, initialFilterReference = _86.initialFilterReference, initialFilterReferenceDate = _86.initialFilterReferenceDate;
289
289
  // INFO: Persist view state hook — handles storage read/write for filter/sort/column state
290
- var _82 = (0, viewStatePersistence_1.usePersistedViewState)({
290
+ var _87 = (0, viewStatePersistence_1.usePersistedViewState)({
291
291
  mode: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.persistViewState,
292
292
  collectionId: props.collectionId,
293
293
  persistKey: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey,
294
294
  type: resolvedType,
295
- }), rawPersistedState = _82.persistedState, isPersistEnabled = _82.isEnabled, handleSaveView = _82.handleSaveView, handleRegisterViewSnapshot = _82.handleRegisterViewSnapshot;
295
+ }), rawPersistedState = _87.persistedState, isPersistEnabled = _87.isEnabled, handleSaveView = _87.handleSaveView, handleRegisterViewSnapshot = _87.handleRegisterViewSnapshot;
296
296
  // INFO: drop stored filters/sort on removed columns — they would empty the table
297
297
  var persistedState = (0, react_1.useMemo)(function () { return (0, viewStatePersistence_1.handlePruneStaleColumns)(rawPersistedState, props.model); }, [rawPersistedState, props.model]);
298
- var _83 = (0, react_1.useState)(false), loading = _83[0], setLoading = _83[1];
299
- var _84 = (0, react_1.useState)(), notification = _84[0], setNotification = _84[1];
298
+ var _88 = (0, react_1.useState)(false), loading = _88[0], setLoading = _88[1];
299
+ var _89 = (0, react_1.useState)(), notification = _89[0], setNotification = _89[1];
300
300
  // INFO: a success toast is confirmation, not a decision — it clears itself so
301
301
  // it never sits on the floating step bar; errors stay until dismissed
302
302
  (0, react_1.useEffect)(function () {
@@ -306,59 +306,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
306
306
  return function () { return clearTimeout(timer); };
307
307
  }, [notification]);
308
308
  //INFO : Used by List
309
- var _85 = (0, react_1.useState)((_d = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _d !== void 0 ? _d : initialFilterSearch), filterSearch = _85[0], setFilterSearch = _85[1];
310
- var _86 = (0, react_1.useState)((_e = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _e !== void 0 ? _e : initialFilterSearchParams), filterSearchParams = _86[0], setFilterSearchParams = _86[1];
311
- var _87 = (0, react_1.useState)((_f = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _f !== void 0 ? _f : initialFilterSelection), filterSelection = _87[0], setFilterSelection = _87[1];
312
- var _88 = (0, react_1.useState)((_g = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _g !== void 0 ? _g : initialFilterReference), filterReference = _88[0], setFilterReference = _88[1];
313
- var _89 = (0, react_1.useState)({}), filterReferenceSearch = _89[0], setFilterReferenceSearch = _89[1];
314
- var _90 = (0, react_1.useState)({}), filterReferenceList = _90[0], setFilterReferenceList = _90[1];
315
- var _91 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
309
+ var _90 = (0, react_1.useState)((_d = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _d !== void 0 ? _d : initialFilterSearch), filterSearch = _90[0], setFilterSearch = _90[1];
310
+ var _91 = (0, react_1.useState)((_e = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _e !== void 0 ? _e : initialFilterSearchParams), filterSearchParams = _91[0], setFilterSearchParams = _91[1];
311
+ var _92 = (0, react_1.useState)((_f = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _f !== void 0 ? _f : initialFilterSelection), filterSelection = _92[0], setFilterSelection = _92[1];
312
+ var _93 = (0, react_1.useState)((_g = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _g !== void 0 ? _g : initialFilterReference), filterReference = _93[0], setFilterReference = _93[1];
313
+ var _94 = (0, react_1.useState)({}), filterReferenceSearch = _94[0], setFilterReferenceSearch = _94[1];
314
+ var _95 = (0, react_1.useState)({}), filterReferenceList = _95[0], setFilterReferenceList = _95[1];
315
+ var _96 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
316
316
  ? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
317
- : initialFilterReferenceDate), filterReferenceDate = _91[0], setFilterReferenceDate = _91[1];
318
- var _92 = (0, react_1.useState)(true), tableLoading = _92[0], setTableLoading = _92[1];
319
- var _93 = (0, react_1.useState)(""), cursor = _93[0], setCursor = _93[1];
320
- var _94 = (0, react_1.useState)(""), lastCursor = _94[0], setLastCursor = _94[1];
321
- var _95 = (0, react_1.useState)([]), tableData = _95[0], setTableData = _95[1];
322
- var _96 = (0, react_1.useState)([]), spaceTableData = _96[0], setSpaceTableData = _96[1];
317
+ : initialFilterReferenceDate), filterReferenceDate = _96[0], setFilterReferenceDate = _96[1];
318
+ var _97 = (0, react_1.useState)(true), tableLoading = _97[0], setTableLoading = _97[1];
319
+ var _98 = (0, react_1.useState)(""), cursor = _98[0], setCursor = _98[1];
320
+ var _99 = (0, react_1.useState)(""), lastCursor = _99[0], setLastCursor = _99[1];
321
+ var _100 = (0, react_1.useState)([]), tableData = _100[0], setTableData = _100[1];
322
+ var _101 = (0, react_1.useState)([]), spaceTableData = _101[0], setSpaceTableData = _101[1];
323
323
  // INFO: a save resolves after later renders, so it reads the table from here —
324
324
  // the state it closed over can predate an earlier save on the same row
325
325
  var tableDataRef = (0, react_1.useRef)([]);
326
326
  var spaceTableDataRef = (0, react_1.useRef)([]);
327
327
  tableDataRef.current = tableData;
328
328
  spaceTableDataRef.current = spaceTableData;
329
- var _97 = (0, react_1.useState)(0), size = _97[0], setSize = _97[1];
330
- var _98 = (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 = _98[0], setPageIndex = _98[1];
331
- var _99 = (0, react_1.useState)([]), selectedIds = _99[0], setSelectedIds = _99[1];
332
- var _100 = (0, react_1.useState)(false), selectAll = _100[0], setSelectAll = _100[1];
333
- var _101 = (0, react_1.useState)(""), deletePasscode = _101[0], setDeletePasscode = _101[1];
334
- var _102 = (0, react_1.useState)(""), deletePasscodeInput = _102[0], setDeletePasscodeInput = _102[1];
335
- var _103 = (0, react_1.useState)(""), deleteFeedId = _103[0], setDeleteFeedId = _103[1];
329
+ var _102 = (0, react_1.useState)(0), size = _102[0], setSize = _102[1];
330
+ var _103 = (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 = _103[0], setPageIndex = _103[1];
331
+ var _104 = (0, react_1.useState)([]), selectedIds = _104[0], setSelectedIds = _104[1];
332
+ var _105 = (0, react_1.useState)(false), selectAll = _105[0], setSelectAll = _105[1];
333
+ var _106 = (0, react_1.useState)(""), deletePasscode = _106[0], setDeletePasscode = _106[1];
334
+ var _107 = (0, react_1.useState)(""), deletePasscodeInput = _107[0], setDeletePasscodeInput = _107[1];
335
+ var _108 = (0, react_1.useState)(""), deleteFeedId = _108[0], setDeleteFeedId = _108[1];
336
336
  //INFO : Used by List Organise
337
337
  // INFO: Internal sort state that overrides props.organise?.sort when
338
338
  // persistViewState is enabled and a persisted sort exists
339
- var _104 = (0, react_1.useState)((_l = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _l !== void 0 ? _l : undefined), persistedSort = _104[0], setPersistedSort = _104[1];
340
- var _105 = (0, react_1.useState)(false), filterDraft = _105[0], setFilterDraft = _105[1];
341
- var _106 = (0, react_1.useState)(false), addTabModal = _106[0], setAddTabModal = _106[1];
339
+ var _109 = (0, react_1.useState)((_l = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _l !== void 0 ? _l : undefined), persistedSort = _109[0], setPersistedSort = _109[1];
340
+ var _110 = (0, react_1.useState)(false), filterDraft = _110[0], setFilterDraft = _110[1];
341
+ var _111 = (0, react_1.useState)(false), addTabModal = _111[0], setAddTabModal = _111[1];
342
342
  //INFO : resolve the initial tab synchronously so the mount cond is already
343
343
  // tab-scoped — an empty initial tab caused a second wasted list fetch
344
- var _107 = (0, react_1.useState)(function () {
344
+ var _112 = (0, react_1.useState)(function () {
345
345
  var _a, _b;
346
346
  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);
347
- }), selectedTab = _107[0], setSelectedTab = _107[1];
348
- var _108 = (0, react_1.useState)("dayGridMonth"), calendarView = _108[0], setCalendarView = _108[1];
347
+ }), selectedTab = _112[0], setSelectedTab = _112[1];
348
+ var _113 = (0, react_1.useState)("dayGridMonth"), calendarView = _113[0], setCalendarView = _113[1];
349
349
  // INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
350
350
  // (calendarView above drives the matching range query)
351
- var _109 = (0, react_1.useState)("month"), newCalendarViewMode = _109[0], setNewCalendarViewMode = _109[1];
352
- var _110 = (0, react_1.useState)(new Date()), calendarTabMonth = _110[0], setCalendarTabMonth = _110[1];
353
- var _111 = (0, react_1.useState)(true), kanbanDroppable = _111[0], setKanbanDroppable = _111[1];
354
- var _112 = (0, react_1.useState)([]), kanbanOptions = _112[0], setKanbanOptions = _112[1];
355
- var _113 = (0, react_1.useState)(false), queryForm = _113[0], setQueryForm = _113[1];
356
- var _114 = (0, react_1.useState)(false), batchUpdateModal = _114[0], setBatchUpdateModal = _114[1];
357
- var _115 = (0, react_1.useState)({
351
+ var _114 = (0, react_1.useState)("month"), newCalendarViewMode = _114[0], setNewCalendarViewMode = _114[1];
352
+ var _115 = (0, react_1.useState)(new Date()), calendarTabMonth = _115[0], setCalendarTabMonth = _115[1];
353
+ var _116 = (0, react_1.useState)(true), kanbanDroppable = _116[0], setKanbanDroppable = _116[1];
354
+ var _117 = (0, react_1.useState)([]), kanbanOptions = _117[0], setKanbanOptions = _117[1];
355
+ var _118 = (0, react_1.useState)(false), queryForm = _118[0], setQueryForm = _118[1];
356
+ var _119 = (0, react_1.useState)(false), batchUpdateModal = _119[0], setBatchUpdateModal = _119[1];
357
+ var _120 = (0, react_1.useState)({
358
358
  columnId: "",
359
359
  columnData: {},
360
- }), batchUpdateData = _115[0], setBatchUpdateData = _115[1];
361
- var _116 = (0, react_1.useState)(function () {
360
+ }), batchUpdateData = _120[0], setBatchUpdateData = _120[1];
361
+ var _121 = (0, react_1.useState)(function () {
362
362
  var baseModel = (props === null || props === void 0 ? void 0 : props.model) || [];
363
363
  if (!persistedState)
364
364
  return baseModel;
@@ -384,8 +384,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
384
384
  });
385
385
  }
386
386
  return model;
387
- }), structure = _116[0], setStructure = _116[1];
388
- var _117 = (0, react_1.useState)(((_m = props === null || props === void 0 ? void 0 : props.organise) === null || _m === void 0 ? void 0 : _m.additionalQuery) || []), additionalQuery = _117[0], setAdditionalQuery = _117[1];
387
+ }), structure = _121[0], setStructure = _121[1];
388
+ var _122 = (0, react_1.useState)(((_m = props === null || props === void 0 ? void 0 : props.organise) === null || _m === void 0 ? void 0 : _m.additionalQuery) || []), additionalQuery = _122[0], setAdditionalQuery = _122[1];
389
389
  // INFO: State for user-configurable flex filters (Monday.com-style)
390
390
  // INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
391
391
  var defaultFlexFilterRow = [
@@ -396,9 +396,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
396
396
  value: undefined,
397
397
  },
398
398
  ];
399
- var _118 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
399
+ var _123 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
400
400
  ? persistedState.flexFilters
401
- : defaultFlexFilterRow), flexFilters = _118[0], setFlexFilters = _118[1];
401
+ : defaultFlexFilterRow), flexFilters = _123[0], setFlexFilters = _123[1];
402
402
  // INFO: always-current mirror of flexFilters, read by the imperative apply/
403
403
  // clear methods so chained calls in one tick aren't stale.
404
404
  var flexFiltersRef = (0, react_1.useRef)(flexFilters);
@@ -411,104 +411,109 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
411
411
  }, [flexFilters]);
412
412
  // INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
413
413
  // to prevent API calls on every keystroke when typing in value inputs
414
- var _119 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
414
+ var _124 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
415
415
  ? persistedState.flexFilters
416
- : defaultFlexFilterRow), flexFiltersDebounced = _119[0], setFlexFiltersDebounced = _119[1];
417
- var _120 = (0, react_1.useState)({}), flexFilterReferenceOptions = _120[0], setFlexFilterReferenceOptions = _120[1];
418
- var _121 = (0, react_1.useState)({}), flexFilterReferenceSearch = _121[0], setFlexFilterReferenceSearch = _121[1];
419
- var _122 = (0, react_1.useState)(false), flexFilterModalOpen = _122[0], setFlexFilterModalOpen = _122[1];
420
- var _123 = (0, react_1.useState)(false), viewSettingsModalOpen = _123[0], setViewSettingsModalOpen = _123[1];
416
+ : defaultFlexFilterRow), flexFiltersDebounced = _124[0], setFlexFiltersDebounced = _124[1];
417
+ var _125 = (0, react_1.useState)({}), flexFilterReferenceOptions = _125[0], setFlexFilterReferenceOptions = _125[1];
418
+ var _126 = (0, react_1.useState)({}), flexFilterReferenceSearch = _126[0], setFlexFilterReferenceSearch = _126[1];
419
+ var _127 = (0, react_1.useState)(false), flexFilterModalOpen = _127[0], setFlexFilterModalOpen = _127[1];
420
+ var _128 = (0, react_1.useState)(false), viewSettingsModalOpen = _128[0], setViewSettingsModalOpen = _128[1];
421
421
  // INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
422
422
  // Deliberately kept out of `structure`: the props-sync effect below resets
423
423
  // structure to props.model whenever props change, which would wipe the
424
424
  // choice, and the persist effect derives schema-level hiddenColumnIds from
425
425
  // structure — writing user hides there would blur the two concepts.
426
- var _124 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _o !== void 0 ? _o : []), userHiddenColumnIds = _124[0], setUserHiddenColumnIds = _124[1];
427
- var _125 = (0, react_1.useState)(""), columnSearch = _125[0], setColumnSearch = _125[1];
428
- var _126 = (0, react_1.useState)(null), draggingColumnId = _126[0], setDraggingColumnId = _126[1];
426
+ var _129 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _o !== void 0 ? _o : []), userHiddenColumnIds = _129[0], setUserHiddenColumnIds = _129[1];
427
+ var _130 = (0, react_1.useState)(""), columnSearch = _130[0], setColumnSearch = _130[1];
428
+ var _131 = (0, react_1.useState)([]), savedViews = _131[0], setSavedViews = _131[1];
429
+ var _132 = (0, react_1.useState)(null), activeSavedViewId = _132[0], setActiveSavedViewId = _132[1];
430
+ // INFO: null while the name box is closed
431
+ var _133 = (0, react_1.useState)(null), savedViewName = _133[0], setSavedViewName = _133[1];
432
+ var _134 = (0, react_1.useState)(null), deletingSavedViewId = _134[0], setDeletingSavedViewId = _134[1];
433
+ var _135 = (0, react_1.useState)(null), draggingColumnId = _135[0], setDraggingColumnId = _135[1];
429
434
  var columnRowRefs = (0, react_1.useRef)({});
430
435
  //INFO : Used by Auth
431
- var _127 = (0, react_1.useState)({
436
+ var _136 = (0, react_1.useState)({
432
437
  email: "",
433
438
  google: "",
434
439
  phone: "",
435
440
  disabled: false,
436
441
  create: false,
437
- }), authMethods = _127[0], setAuthMethods = _127[1];
438
- var _128 = (0, react_1.useState)(""), selectedAuthMethod = _128[0], setSelectedAuthMethod = _128[1];
442
+ }), authMethods = _136[0], setAuthMethods = _136[1];
443
+ var _137 = (0, react_1.useState)(""), selectedAuthMethod = _137[0], setSelectedAuthMethod = _137[1];
439
444
  // INFO: Used by Activity Log
440
- var _129 = (0, react_1.useState)(false), activityModal = _129[0], setActivityModal = _129[1];
441
- var _130 = (0, react_1.useState)(""), activityId = _130[0], setActivityId = _130[1];
445
+ var _138 = (0, react_1.useState)(false), activityModal = _138[0], setActivityModal = _138[1];
446
+ var _139 = (0, react_1.useState)(""), activityId = _139[0], setActivityId = _139[1];
442
447
  //INFO : Used by Export
443
- var _131 = (0, react_1.useState)(null), csvFile = _131[0], setCSVFile = _131[1];
444
- var _132 = (0, react_1.useState)([]), csvFileData = _132[0], setCSVFileData = _132[1];
445
- var _133 = (0, react_1.useState)(0), stepCSVIndex = _133[0], setStepCSVIndex = _133[1];
446
- var _134 = (0, react_1.useState)({}), listCSVMapAttribute = _134[0], setListCSVMapAttribute = _134[1];
447
- var _135 = (0, react_1.useState)({}), listCSVObjAttribute = _135[0], setListCSVObjAttribute = _135[1];
448
- var _136 = (0, react_1.useState)([]), csvAPIAttribute = _136[0], setCSVAPIAttribute = _136[1];
449
- var _137 = (0, react_1.useState)(((_p = props.devSettings.currentUser) === null || _p === void 0 ? void 0 : _p.userEmail) || ""), exportCSVEmail = _137[0], setExportCSVEmail = _137[1];
450
- var _138 = (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 = _138[0], setExportPDFTitle = _138[1];
451
- var _139 = (0, react_1.useState)(false), exportPDFLoading = _139[0], setExportPDFLoading = _139[1];
452
- var _140 = (0, react_1.useState)(false), exportReadPDFLoading = _140[0], setExportReadPDFLoading = _140[1];
453
- var _141 = (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 = _141[0], setExportSumAttributeIds = _141[1];
454
- var _142 = (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 = _142[0], setHideSubItems = _142[1];
455
- var _143 = (0, react_1.useState)([]), importTableData = _143[0], setImportTableData = _143[1];
456
- var _144 = (0, react_1.useState)([]), queryList = _144[0], setQueryList = _144[1];
457
- var _145 = (0, react_1.useState)(undefined), allQueryList = _145[0], setAllQueryList = _145[1];
458
- var _146 = (0, react_1.useState)(-1), queryIndex = _146[0], setQueryIndex = _146[1];
459
- var _147 = (0, react_1.useState)((_y = props.organise) === null || _y === void 0 ? void 0 : _y.groupBy), groupId = _147[0], setGroupId = _147[1];
460
- var _148 = (0, react_1.useState)(""), readTabSection = _148[0], setReadTabSection = _148[1];
461
- var _149 = (0, react_1.useState)(false), readFloatingNav = _149[0], setReadFloatingNav = _149[1];
448
+ var _140 = (0, react_1.useState)(null), csvFile = _140[0], setCSVFile = _140[1];
449
+ var _141 = (0, react_1.useState)([]), csvFileData = _141[0], setCSVFileData = _141[1];
450
+ var _142 = (0, react_1.useState)(0), stepCSVIndex = _142[0], setStepCSVIndex = _142[1];
451
+ var _143 = (0, react_1.useState)({}), listCSVMapAttribute = _143[0], setListCSVMapAttribute = _143[1];
452
+ var _144 = (0, react_1.useState)({}), listCSVObjAttribute = _144[0], setListCSVObjAttribute = _144[1];
453
+ var _145 = (0, react_1.useState)([]), csvAPIAttribute = _145[0], setCSVAPIAttribute = _145[1];
454
+ var _146 = (0, react_1.useState)(((_p = props.devSettings.currentUser) === null || _p === void 0 ? void 0 : _p.userEmail) || ""), exportCSVEmail = _146[0], setExportCSVEmail = _146[1];
455
+ var _147 = (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 = _147[0], setExportPDFTitle = _147[1];
456
+ var _148 = (0, react_1.useState)(false), exportPDFLoading = _148[0], setExportPDFLoading = _148[1];
457
+ var _149 = (0, react_1.useState)(false), exportReadPDFLoading = _149[0], setExportReadPDFLoading = _149[1];
458
+ var _150 = (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 = _150[0], setExportSumAttributeIds = _150[1];
459
+ var _151 = (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 = _151[0], setHideSubItems = _151[1];
460
+ var _152 = (0, react_1.useState)([]), importTableData = _152[0], setImportTableData = _152[1];
461
+ var _153 = (0, react_1.useState)([]), queryList = _153[0], setQueryList = _153[1];
462
+ var _154 = (0, react_1.useState)(undefined), allQueryList = _154[0], setAllQueryList = _154[1];
463
+ var _155 = (0, react_1.useState)(-1), queryIndex = _155[0], setQueryIndex = _155[1];
464
+ var _156 = (0, react_1.useState)((_y = props.organise) === null || _y === void 0 ? void 0 : _y.groupBy), groupId = _156[0], setGroupId = _156[1];
465
+ var _157 = (0, react_1.useState)(""), readTabSection = _157[0], setReadTabSection = _157[1];
466
+ var _158 = (0, react_1.useState)(false), readFloatingNav = _158[0], setReadFloatingNav = _158[1];
462
467
  var readTabSectionRefs = (0, react_1.useRef)({});
463
468
  //INFO : Used by Read
464
469
  //INFO : Used by Update
465
- var _150 = (0, react_1.useState)(false), modalVisible = _150[0], setModalVisible = _150[1];
466
- var _151 = (0, react_1.useState)(false), deleteModal = _151[0], setDeleteModal = _151[1];
467
- var _152 = (0, react_1.useState)(false), excelModal = _152[0], setExcelModal = _152[1];
468
- var _153 = (0, react_1.useState)(false), exportExcel = _153[0], setExportExcel = _153[1];
469
- var _154 = (0, react_1.useState)(""), exportType = _154[0], setExportType = _154[1];
470
- var _155 = (0, react_1.useState)(false), exportQR = _155[0], setExportQR = _155[1];
471
- var _156 = (0, react_1.useState)(function () {
470
+ var _159 = (0, react_1.useState)(false), modalVisible = _159[0], setModalVisible = _159[1];
471
+ var _160 = (0, react_1.useState)(false), deleteModal = _160[0], setDeleteModal = _160[1];
472
+ var _161 = (0, react_1.useState)(false), excelModal = _161[0], setExcelModal = _161[1];
473
+ var _162 = (0, react_1.useState)(false), exportExcel = _162[0], setExportExcel = _162[1];
474
+ var _163 = (0, react_1.useState)(""), exportType = _163[0], setExportType = _163[1];
475
+ var _164 = (0, react_1.useState)(false), exportQR = _164[0], setExportQR = _164[1];
476
+ var _165 = (0, react_1.useState)(function () {
472
477
  var _a, _b;
473
478
  var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
474
479
  return firstTabId;
475
- }), activeTab = _156[0], setActiveTab = _156[1];
476
- var _157 = (0, react_1.useState)(false), signatureSigning = _157[0], setSignatureSigning = _157[1];
477
- var _158 = (0, react_1.useState)({}), selectedData = _158[0], setSelectedData = _158[1];
478
- var _159 = (0, react_1.useState)(""), selectedObjectStructureId = _159[0], setSelectedObjectStructureId = _159[1];
479
- var _160 = (0, react_1.useState)(""), selectedObjectId = _160[0], setSelectedObjectId = _160[1];
480
- var _161 = (0, react_1.useState)(""), selectedListAddressId = _161[0], setSelectedListAddressId = _161[1];
481
- var _162 = (0, react_1.useState)(-1), selectedListAddressIndex = _162[0], setSelectedListAddressIndex = _162[1];
482
- var _163 = (0, react_1.useState)({
480
+ }), activeTab = _165[0], setActiveTab = _165[1];
481
+ var _166 = (0, react_1.useState)(false), signatureSigning = _166[0], setSignatureSigning = _166[1];
482
+ var _167 = (0, react_1.useState)({}), selectedData = _167[0], setSelectedData = _167[1];
483
+ var _168 = (0, react_1.useState)(""), selectedObjectStructureId = _168[0], setSelectedObjectStructureId = _168[1];
484
+ var _169 = (0, react_1.useState)(""), selectedObjectId = _169[0], setSelectedObjectId = _169[1];
485
+ var _170 = (0, react_1.useState)(""), selectedListAddressId = _170[0], setSelectedListAddressId = _170[1];
486
+ var _171 = (0, react_1.useState)(-1), selectedListAddressIndex = _171[0], setSelectedListAddressIndex = _171[1];
487
+ var _172 = (0, react_1.useState)({
483
488
  lat: 0,
484
489
  lng: 0,
485
490
  name: "",
486
- }), selectedListAddress = _163[0], setSelectedListAddress = _163[1];
487
- var _164 = (0, react_1.useState)({}), selectedObjectData = _164[0], setSelectedObjectData = _164[1];
488
- var _165 = (0, react_1.useState)(null), objectCellEdit = _165[0], setObjectCellEdit = _165[1];
489
- var _166 = (0, react_1.useState)(false), referenceLoading = _166[0], setReferenceLoading = _166[1];
490
- var _167 = (0, react_1.useState)({}), referencesOptions = _167[0], setReferencesOptions = _167[1];
491
- var _168 = (0, react_1.useState)({}), referencesDetails = _168[0], setReferencesDetails = _168[1];
492
- var _169 = (0, react_1.useState)({}), listReferencesOptions = _169[0], setListReferencesOptions = _169[1];
493
- var _170 = (0, react_1.useState)({}), referenceDeleteTableData = _170[0], setReferenceDeleteTableData = _170[1];
494
- var _171 = (0, react_1.useState)(0), referenceDeleteIndex = _171[0], setReferenceDeleteIndex = _171[1];
495
- var _172 = (0, react_1.useState)({
491
+ }), selectedListAddress = _172[0], setSelectedListAddress = _172[1];
492
+ var _173 = (0, react_1.useState)({}), selectedObjectData = _173[0], setSelectedObjectData = _173[1];
493
+ var _174 = (0, react_1.useState)(null), objectCellEdit = _174[0], setObjectCellEdit = _174[1];
494
+ var _175 = (0, react_1.useState)(false), referenceLoading = _175[0], setReferenceLoading = _175[1];
495
+ var _176 = (0, react_1.useState)({}), referencesOptions = _176[0], setReferencesOptions = _176[1];
496
+ var _177 = (0, react_1.useState)({}), referencesDetails = _177[0], setReferencesDetails = _177[1];
497
+ var _178 = (0, react_1.useState)({}), listReferencesOptions = _178[0], setListReferencesOptions = _178[1];
498
+ var _179 = (0, react_1.useState)({}), referenceDeleteTableData = _179[0], setReferenceDeleteTableData = _179[1];
499
+ var _180 = (0, react_1.useState)(0), referenceDeleteIndex = _180[0], setReferenceDeleteIndex = _180[1];
500
+ var _181 = (0, react_1.useState)({
496
501
  id: "",
497
502
  name: "",
498
503
  type: "string",
499
- }), referenceCreationModal = _172[0], setReferenceCreationModal = _172[1];
500
- var _173 = (0, react_1.useState)({}), referenceModelSchema = _173[0], setReferenceSchema = _173[1];
501
- var _174 = (0, react_1.useState)([]), kanbanChecked = _174[0], setKanbanChecked = _174[1];
504
+ }), referenceCreationModal = _181[0], setReferenceCreationModal = _181[1];
505
+ var _182 = (0, react_1.useState)({}), referenceModelSchema = _182[0], setReferenceSchema = _182[1];
506
+ var _183 = (0, react_1.useState)([]), kanbanChecked = _183[0], setKanbanChecked = _183[1];
502
507
  //INFO : Offline
503
- var _175 = (0, react_1.useState)(0), offlineDataLength = _175[0], setOfflineDataLength = _175[1];
504
- var _176 = (0, react_1.useState)(false), offlineModal = _176[0], setOfflineModal = _176[1];
508
+ var _184 = (0, react_1.useState)(0), offlineDataLength = _184[0], setOfflineDataLength = _184[1];
509
+ var _185 = (0, react_1.useState)(false), offlineModal = _185[0], setOfflineModal = _185[1];
505
510
  // INFO: live-stream state — driven by socket connection and navigator.onLine
506
- var _177 = (0, react_1.useState)(false), isLive = _177[0], setIsLive = _177[1];
507
- var _178 = (0, react_1.useState)(false), isLiveOffline = _178[0], setIsLiveOffline = _178[1];
511
+ var _186 = (0, react_1.useState)(false), isLive = _186[0], setIsLive = _186[1];
512
+ var _187 = (0, react_1.useState)(false), isLiveOffline = _187[0], setIsLiveOffline = _187[1];
508
513
  // INFO: true when navigator is offline — used to switch ReadQueryHoc between
509
514
  // server reads (online, full pagination) and IndexedDB reads (offline, cached data).
510
515
  // Independent of SSE status so it works even when bareSocketName is not set.
511
- var _179 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _179[0], setIsNetworkOffline = _179[1];
516
+ var _188 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _188[0], setIsNetworkOffline = _188[1];
512
517
  var previousType = (0, react_1.useRef)(null);
513
518
  var previousSelectedData = (0, react_1.useRef)(null);
514
519
  var scrollSentinelRef = (0, react_1.useRef)(null);
@@ -582,6 +587,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
582
587
  var exportCSVEmailInputRef = (0, react_1.createRef)();
583
588
  var readQueryHocRef = (0, react_1.useRef)(null);
584
589
  var listRQueryHocRef = (0, react_1.useRef)(null);
590
+ // INFO: the list request as it was before a saved view was applied; checked
591
+ // after the next render to tell whether the view changed what is fetched
592
+ var pendingViewCondKeyRef = (0, react_1.useRef)(null);
593
+ // INFO: the schema's own columns while a saved view overlays hide/order on
594
+ // screen; null when nothing is overlaid and structure is the schema itself
595
+ var schemaStructureRef = (0, react_1.useRef)(null);
585
596
  var typingTimeout = (0, react_1.useRef)(null);
586
597
  var flexFilterTypingTimeout = (0, react_1.useRef)(null);
587
598
  var mapViewRef = (0, react_1.useRef)(null);
@@ -629,32 +640,35 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
629
640
  ? true
630
641
  : false;
631
642
  // INFO: a consumer that wires onChangeHide owns the hide at schema level
632
- // (Space, Sun Luan) — toggling writes to the model and calls back. Without it
643
+ // (shared by every user) — toggling writes to the model and calls back. Without it
633
644
  // the hide is this user's own and lives in userHiddenColumnIds.
634
645
  var isSchemaHideMode = ((_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.onChangeHide) ? true : false;
635
646
  // INFO: rows per page is a view setting the user can change, so it starts from
636
647
  // the persisted value and falls back to the consumer's limit
637
- var _180 = (0, react_1.useState)((_10 = (_9 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _9 !== void 0 ? _9 : props.limit) !== null && _10 !== void 0 ? _10 : 10), pageLimit = _180[0], setPageLimit = _180[1];
648
+ var _189 = (0, react_1.useState)((_10 = (_9 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _9 !== void 0 ? _9 : props.limit) !== null && _10 !== void 0 ? _10 : 10), pageLimit = _189[0], setPageLimit = _189[1];
638
649
  var limit = pageLimit;
639
- var activeSortId = (isPersistEnabled && persistedSort) || ((_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.sort);
650
+ var isSavedViewsEnabled = !!((_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.savedViews) && resolvedType === "list";
651
+ // INFO: a saved view carries its sort, so the sort is held here as with persistViewState
652
+ var isInternalSort = isPersistEnabled || isSavedViewsEnabled;
653
+ var activeSortId = (isInternalSort && persistedSort) || ((_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.sort);
640
654
  var handleSortColumn = function (value) {
641
655
  var _a, _b;
642
- if (isPersistEnabled)
656
+ if (isInternalSort)
643
657
  setPersistedSort(value);
644
658
  (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSort) === null || _b === void 0 ? void 0 : _b.call(_a, value);
645
659
  };
646
- var _181 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _181.canUpdateRecord, canInlineUpdate = _181.canInlineUpdate, canBatchUpdate = _181.canBatchUpdate, canDeleteRecord = _181.canDeleteRecord;
647
- var isEditor = ((_12 = props.edit) === null || _12 === void 0 ? void 0 : _12.allEditable) ? true : false;
648
- var isOffline = (_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareOffline;
660
+ var _190 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _190.canUpdateRecord, canInlineUpdate = _190.canInlineUpdate, canBatchUpdate = _190.canBatchUpdate, canDeleteRecord = _190.canDeleteRecord;
661
+ var isEditor = ((_13 = props.edit) === null || _13 === void 0 ? void 0 : _13.allEditable) ? true : false;
662
+ var isOffline = (_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareOffline;
649
663
  // INFO: when bareOfflineNetworkAware is true, the save path is also gated on
650
664
  // the live network state — online saves go to the server even if bareOffline
651
665
  // is true, offline saves go to IDB as normal.
652
- var isOfflineNetworkListener = isOffline && ((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareOfflineNetworkListener);
653
- var showId = (_15 = props.space) === null || _15 === void 0 ? void 0 : _15.showId;
666
+ var isOfflineNetworkListener = isOffline && ((_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareOfflineNetworkListener);
667
+ var showId = (_16 = props.space) === null || _16 === void 0 ? void 0 : _16.showId;
654
668
  var remainId = showId || selectedObjectStructureId ? true : false;
655
- var idField = ((_16 = props.space) === null || _16 === void 0 ? void 0 : _16.idField) || ((_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.idField);
656
- var pipeline = (_18 = props === null || props === void 0 ? void 0 : props.space) === null || _18 === void 0 ? void 0 : _18.pipeline;
657
- if ((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareListPipeline) {
669
+ var idField = ((_17 = props.space) === null || _17 === void 0 ? void 0 : _17.idField) || ((_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.idField);
670
+ var pipeline = (_19 = props === null || props === void 0 ? void 0 : props.space) === null || _19 === void 0 ? void 0 : _19.pipeline;
671
+ if ((_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareListPipeline) {
658
672
  pipeline = pipeline
659
673
  ? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
660
674
  }
@@ -667,24 +681,24 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
667
681
  * three records came back instead of five files, and each tile received the
668
682
  * whole array rather than one file, so every one of them read "Attachment".
669
683
  */
670
- var fileViewColumnId = (_23 = (_22 = ((_21 = (_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.extendedTabs) !== null && _21 !== void 0 ? _21 : []).find(function (eachTab) {
684
+ var fileViewColumnId = (_24 = (_23 = ((_22 = (_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.extendedTabs) !== null && _22 !== void 0 ? _22 : []).find(function (eachTab) {
671
685
  return eachTab.viewType === "file" &&
672
686
  (0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
673
- })) === null || _22 === void 0 ? void 0 : _22.fileSettings) === null || _23 === void 0 ? void 0 : _23.columnId;
674
- var hasNavigation = ((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.handleNavigate) ? true : false;
687
+ })) === null || _23 === void 0 ? void 0 : _23.fileSettings) === null || _24 === void 0 ? void 0 : _24.columnId;
688
+ var hasNavigation = ((_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.handleNavigate) ? true : false;
675
689
  var formColumn = "grid-cols-12";
676
- var useMobileView = (_26 = (_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareUpdateMobileView) !== null && _26 !== void 0 ? _26 : false;
690
+ var useMobileView = (_27 = (_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareUpdateMobileView) !== null && _27 !== void 0 ? _27 : false;
677
691
  var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
678
- var isActivityLog = (((_28 = (_27 = props.edit) === null || _27 === void 0 ? void 0 : _27.activityLog) === null || _28 === void 0 ? void 0 : _28.enableComments) &&
679
- ((_29 = props.edit) === null || _29 === void 0 ? void 0 : _29.activityLog.commentCollectionId)) ||
680
- (((_31 = (_30 = props.edit) === null || _30 === void 0 ? void 0 : _30.activityLog) === null || _31 === void 0 ? void 0 : _31.enableLogs) &&
681
- ((_32 = props.edit) === null || _32 === void 0 ? void 0 : _32.activityLog.logsCollectionId));
682
- var customPaginationSize = ((_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.customPaginationCount)
692
+ var isActivityLog = (((_29 = (_28 = props.edit) === null || _28 === void 0 ? void 0 : _28.activityLog) === null || _29 === void 0 ? void 0 : _29.enableComments) &&
693
+ ((_30 = props.edit) === null || _30 === void 0 ? void 0 : _30.activityLog.commentCollectionId)) ||
694
+ (((_32 = (_31 = props.edit) === null || _31 === void 0 ? void 0 : _31.activityLog) === null || _32 === void 0 ? void 0 : _32.enableLogs) &&
695
+ ((_33 = props.edit) === null || _33 === void 0 ? void 0 : _33.activityLog.logsCollectionId));
696
+ var customPaginationSize = ((_34 = props.organise) === null || _34 === void 0 ? void 0 : _34.customPaginationCount)
683
697
  ? props.organise.customPaginationCount(size)
684
698
  : undefined;
685
699
  //TODO : Code - Pass ...devSettings, search dbEndpoint:
686
700
  var writeServerQuery = new writeQuery_1.WriteQuery({
687
- dbModule: (_34 = props.lib) === null || _34 === void 0 ? void 0 : _34.axios,
701
+ dbModule: (_35 = props.lib) === null || _35 === void 0 ? void 0 : _35.axios,
688
702
  dbType: devSettings.server,
689
703
  dbCollection: props.collectionId,
690
704
  dbEndpoint: devSettings.dbEndpoint,
@@ -692,7 +706,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
692
706
  dbUserToken: devSettings.dbUserToken,
693
707
  });
694
708
  var readServerQuery = new readQuery_1.ReadQuery({
695
- dbModule: (_35 = props.lib) === null || _35 === void 0 ? void 0 : _35.axios,
709
+ dbModule: (_36 = props.lib) === null || _36 === void 0 ? void 0 : _36.axios,
696
710
  dbType: devSettings.server,
697
711
  dbCollection: props.collectionId,
698
712
  dbEndpoint: devSettings.dbEndpoint,
@@ -700,9 +714,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
700
714
  dbUserToken: devSettings.dbUserToken,
701
715
  });
702
716
  var moreButtonPopUp = [
703
- ((_36 = props.edit) === null || _36 === void 0 ? void 0 : _36.allEditable) &&
717
+ ((_37 = props.edit) === null || _37 === void 0 ? void 0 : _37.allEditable) &&
704
718
  !isFirebase &&
705
- !((_38 = (_37 = props.organise) === null || _37 === void 0 ? void 0 : _37.exportSettings) === null || _38 === void 0 ? void 0 : _38.hideImportCSV)
719
+ !((_39 = (_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.exportSettings) === null || _39 === void 0 ? void 0 : _39.hideImportCSV)
706
720
  ? {
707
721
  text: "Import Excel",
708
722
  onClick: function () {
@@ -711,7 +725,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
711
725
  },
712
726
  }
713
727
  : null,
714
- !((_40 = (_39 = props.organise) === null || _39 === void 0 ? void 0 : _39.exportSettings) === null || _40 === void 0 ? void 0 : _40.hideExportCSV)
728
+ !((_41 = (_40 = props.organise) === null || _40 === void 0 ? void 0 : _40.exportSettings) === null || _41 === void 0 ? void 0 : _41.hideExportCSV)
715
729
  ? {
716
730
  text: "Export CSV",
717
731
  onClick: function () {
@@ -721,7 +735,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
721
735
  },
722
736
  }
723
737
  : null,
724
- !((_42 = (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.exportSettings) === null || _42 === void 0 ? void 0 : _42.hideExportExcel)
738
+ !((_43 = (_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.exportSettings) === null || _43 === void 0 ? void 0 : _43.hideExportExcel)
725
739
  ? {
726
740
  text: "Export Excel",
727
741
  onClick: function () {
@@ -731,7 +745,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
731
745
  },
732
746
  }
733
747
  : null,
734
- !((_44 = (_43 = props.organise) === null || _43 === void 0 ? void 0 : _43.exportSettings) === null || _44 === void 0 ? void 0 : _44.hideExportPDF)
748
+ !((_45 = (_44 = props.organise) === null || _44 === void 0 ? void 0 : _44.exportSettings) === null || _45 === void 0 ? void 0 : _45.hideExportPDF)
735
749
  ? {
736
750
  text: "Export PDF",
737
751
  onClick: function () {
@@ -741,7 +755,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
741
755
  },
742
756
  }
743
757
  : null,
744
- !((_46 = (_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.exportSettings) === null || _46 === void 0 ? void 0 : _46.hideExportQR)
758
+ !((_47 = (_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.exportSettings) === null || _47 === void 0 ? void 0 : _47.hideExportQR)
745
759
  ? {
746
760
  text: "Export QR",
747
761
  onClick: function () {
@@ -751,7 +765,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
751
765
  },
752
766
  }
753
767
  : null,
754
- !((_48 = (_47 = props.organise) === null || _47 === void 0 ? void 0 : _47.exportSettings) === null || _48 === void 0 ? void 0 : _48.hideExportQR)
768
+ !((_49 = (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.exportSettings) === null || _49 === void 0 ? void 0 : _49.hideExportQR)
755
769
  ? {
756
770
  text: "Export QR(Data)",
757
771
  onClick: function () {
@@ -761,7 +775,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
761
775
  },
762
776
  }
763
777
  : null,
764
- !((_50 = (_49 = props.organise) === null || _49 === void 0 ? void 0 : _49.exportSettings) === null || _50 === void 0 ? void 0 : _50.hideExportPrint)
778
+ !((_51 = (_50 = props.organise) === null || _50 === void 0 ? void 0 : _50.exportSettings) === null || _51 === void 0 ? void 0 : _51.hideExportPrint)
765
779
  ? {
766
780
  text: "Print",
767
781
  onClick: function () {
@@ -771,7 +785,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
771
785
  },
772
786
  }
773
787
  : null,
774
- !((_52 = (_51 = props.organise) === null || _51 === void 0 ? void 0 : _51.exportSettings) === null || _52 === void 0 ? void 0 : _52.hideExportDraft)
788
+ !((_53 = (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.exportSettings) === null || _53 === void 0 ? void 0 : _53.hideExportDraft)
775
789
  ? {
776
790
  text: filterDraft ? "Show All Items" : "Filter Draft",
777
791
  onClick: function () {
@@ -780,20 +794,35 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
780
794
  }
781
795
  : null,
782
796
  ].filter(Boolean);
783
- if ((_53 = props.organise) === null || _53 === void 0 ? void 0 : _53.moreSettings)
797
+ if ((_54 = props.organise) === null || _54 === void 0 ? void 0 : _54.moreSettings)
784
798
  moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
785
799
  //=====================================================================================
786
800
  //SECTION: User Column Visibility Handlers
787
801
  //=====================================================================================
788
- var handleToggleUserHiddenColumn = function (columnId) {
802
+ // INFO: a write-back carries the schema's columns plus the user's one change,
803
+ // never the hide/order a personal saved view put on screen
804
+ var handleUpdateSchemaStructure = function (update) {
789
805
  var _a;
806
+ var schemaColumns = update((_a = schemaStructureRef.current) !== null && _a !== void 0 ? _a : structure);
807
+ if (schemaStructureRef.current)
808
+ schemaStructureRef.current = schemaColumns;
809
+ return schemaColumns;
810
+ };
811
+ var handleToggleUserHiddenColumn = function (columnId) {
812
+ var _a, _b;
790
813
  if ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeHide) {
791
- var updatedModel = structure.map(function (eachColumn) {
792
- return eachColumn.id === columnId
793
- ? __assign(__assign({}, eachColumn), { hide: !eachColumn.hide }) : eachColumn;
814
+ var nextHide_1 = !((_b = structure.find(function (eachColumn) { return eachColumn.id === columnId; })) === null || _b === void 0 ? void 0 : _b.hide);
815
+ var handleSetHide = function (columns) {
816
+ return columns.map(function (eachColumn) {
817
+ return eachColumn.id === columnId
818
+ ? __assign(__assign({}, eachColumn), { hide: nextHide_1 }) : eachColumn;
819
+ });
820
+ };
821
+ setStructure(handleSetHide(structure));
822
+ props.organise.onChangeHide(handleUpdateSchemaStructure(handleSetHide), {
823
+ columnId: columnId,
824
+ hide: nextHide_1,
794
825
  });
795
- setStructure(updatedModel);
796
- props.organise.onChangeHide(updatedModel);
797
826
  return;
798
827
  }
799
828
  setUserHiddenColumnIds(function (prevIds) {
@@ -805,9 +834,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
805
834
  var handleShowAllUserHiddenColumns = function () {
806
835
  var _a;
807
836
  if ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeHide) {
808
- var updatedModel = structure.map(function (eachColumn) { return (__assign(__assign({}, eachColumn), { hide: false })); });
809
- setStructure(updatedModel);
810
- props.organise.onChangeHide(updatedModel);
837
+ var handleShowAll = function (columns) {
838
+ return columns.map(function (eachColumn) { return (__assign(__assign({}, eachColumn), { hide: false })); });
839
+ };
840
+ setStructure(handleShowAll(structure));
841
+ props.organise.onChangeHide(handleUpdateSchemaStructure(handleShowAll), {
842
+ showAll: true,
843
+ });
811
844
  return;
812
845
  }
813
846
  setUserHiddenColumnIds([]);
@@ -818,15 +851,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
818
851
  var _a, _b;
819
852
  if (dragId === dropId)
820
853
  return;
821
- var dragIndex = structure.findIndex(function (eachCol) { return eachCol.id === dragId; });
822
- var dropIndex = structure.findIndex(function (eachCol) { return eachCol.id === dropId; });
823
- if (dragIndex < 0 || dropIndex < 0)
854
+ var handleMove = function (columns) {
855
+ var dragIndex = columns.findIndex(function (eachCol) { return eachCol.id === dragId; });
856
+ var dropIndex = columns.findIndex(function (eachCol) { return eachCol.id === dropId; });
857
+ if (dragIndex < 0 || dropIndex < 0)
858
+ return columns;
859
+ var moved = __spreadArray([], columns, true);
860
+ var dragged = moved.splice(dragIndex, 1)[0];
861
+ moved.splice(dropIndex, 0, dragged);
862
+ return moved;
863
+ };
864
+ var updatedModel = handleMove(structure);
865
+ if (updatedModel === structure)
824
866
  return;
825
- var updatedModel = __spreadArray([], structure, true);
826
- var moved = updatedModel.splice(dragIndex, 1)[0];
827
- updatedModel.splice(dropIndex, 0, moved);
828
867
  setStructure(updatedModel);
829
- (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeDrag) === null || _b === void 0 ? void 0 : _b.call(_a, dragId, dropId, updatedModel.map(function (eachCol) { return ({
868
+ (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeDrag) === null || _b === void 0 ? void 0 : _b.call(_a, dragId, dropId, handleUpdateSchemaStructure(handleMove).map(function (eachCol) { return ({
830
869
  key: eachCol.id,
831
870
  title: eachCol.name,
832
871
  }); }));
@@ -1056,13 +1095,181 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1056
1095
  ? flexFiltersDebounced.filter(function (eachFilter) {
1057
1096
  return (0, flexFilter_1.isFlexFilterActive)(eachFilter, structure);
1058
1097
  })
1059
- : undefined, sort: persistedSort !== null && persistedSort !== void 0 ? persistedSort : (_a = props.organise) === null || _a === void 0 ? void 0 : _a.sort,
1098
+ : undefined, sort: persistedSort !== null && persistedSort !== void 0 ? persistedSort : (_a = props.organise) === null || _a === void 0 ? void 0 : _a.sort, pageLimit: pageLimit,
1060
1099
  // INFO: scroll mode reloads from page 0; the anchor restores the position
1061
1100
  pageIndex: renderCheckScrollMode() ? 0 : pageIndex, hiddenColumnIds: structure.filter(function (col) { return col.hide; }).map(function (col) { return col.id; }),
1062
1101
  // INFO: raw, so switching bareViewSettings off does not wipe the user's choice
1063
1102
  userHiddenColumnIds: userHiddenColumnIds, columnOrder: structure.map(function (col) { return col.id; }) }, scrollCaptureRef.current));
1064
1103
  };
1065
1104
  handleRegisterViewSnapshot(handleBuildViewSnapshot);
1105
+ //=====================================================================================
1106
+ //SECTION: Saved Views
1107
+ //=====================================================================================
1108
+ var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_55 = props.organise) === null || _55 === void 0 ? void 0 : _55.persistKey, (_56 = devSettings.currentUser) === null || _56 === void 0 ? void 0 : _56.userEmail);
1109
+ (0, react_1.useEffect)(function () {
1110
+ if (isSavedViewsEnabled)
1111
+ setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
1112
+ }, [isSavedViewsEnabled, savedViewsKey]);
1113
+ // INFO: views belong to a tab, so another tab starts with none selected
1114
+ (0, react_1.useEffect)(function () {
1115
+ setActiveSavedViewId(null);
1116
+ setSavedViewName(null);
1117
+ setDeletingSavedViewId(null);
1118
+ }, [viewType]);
1119
+ // INFO: a view can change the saved state without changing the request —
1120
+ // rows per page on a calendar, map or grouped tab (no limit is sent), or a
1121
+ // filter with no value. ReadQueryHoc only reads when its cond changes, so
1122
+ // the loading set by the apply would never clear; ask for the read here.
1123
+ (0, react_1.useEffect)(function () {
1124
+ var _a;
1125
+ if (pendingViewCondKeyRef.current === null)
1126
+ return;
1127
+ var isSameRequest = pendingViewCondKeyRef.current ===
1128
+ JSON.stringify(handleReadQueryHocCond());
1129
+ pendingViewCondKeyRef.current = null;
1130
+ if (isSameRequest)
1131
+ (_a = listRQueryHocRef.current) === null || _a === void 0 ? void 0 : _a.handleRefresh();
1132
+ });
1133
+ // INFO: fallback ids are numbered over the full list, before the tab filter,
1134
+ // so one default view keeps the same id on every tab it shows on
1135
+ var handleGetTabSavedViews = function () {
1136
+ var _a, _b;
1137
+ return __spreadArray(__spreadArray([], ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.defaultSavedViews) !== null && _b !== void 0 ? _b : [])
1138
+ .map(function (eachView, index) {
1139
+ var _a, _b;
1140
+ return ({
1141
+ id: (_a = eachView.id) !== null && _a !== void 0 ? _a : "default-".concat(index),
1142
+ name: eachView.name,
1143
+ tabId: (_b = eachView.tabId) !== null && _b !== void 0 ? _b : viewType,
1144
+ state: eachView.state,
1145
+ locked: true,
1146
+ });
1147
+ })
1148
+ .filter(function (eachView) { return eachView.tabId === viewType; }), true), savedViews.filter(function (eachView) { return eachView.tabId === viewType; }), true);
1149
+ };
1150
+ var defaultSavedViewIds = ((_58 = (_57 = props.organise) === null || _57 === void 0 ? void 0 : _57.defaultSavedViews) !== null && _58 !== void 0 ? _58 : [])
1151
+ .map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
1152
+ .join("|");
1153
+ // INFO: keyed on the ids, not the array, so an inline literal passed on every
1154
+ // render does not repeat the warning on every render
1155
+ (0, react_1.useEffect)(function () {
1156
+ var ids = defaultSavedViewIds.split("|").filter(Boolean);
1157
+ var repeated = ids.filter(function (eachId, index) { return ids.indexOf(eachId) !== index; });
1158
+ if (repeated.length > 0)
1159
+ console.warn("DataTemplate: defaultSavedViews ids must be unique, repeated: ".concat(Array.from(new Set(repeated)).join(", ")));
1160
+ }, [defaultSavedViewIds]);
1161
+ // INFO: a view is the defaults overridden by its own fields, so a field it
1162
+ // leaves out is reset rather than carried over from whatever was on screen
1163
+ var handleResolveViewState = function (state) {
1164
+ var _a, _b, _c, _d;
1165
+ var model = (_a = props.model) !== null && _a !== void 0 ? _a : [];
1166
+ return ((_d = (0, viewStatePersistence_1.handlePruneStaleColumns)(__assign({ filterSearchParams: initialFilterSearchParams, filterSelection: initialFilterSelection, filterReference: initialFilterReference, filterReferenceDate: (0, viewStatePersistence_1.serializeDateFilterState)(initialFilterReferenceDate), sort: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.sort, pageLimit: (_c = props.limit) !== null && _c !== void 0 ? _c : 10, userHiddenColumnIds: [], hiddenColumnIds: model
1167
+ .filter(function (eachColumn) { return eachColumn.hide; })
1168
+ .map(function (eachColumn) { return eachColumn.id; }), columnOrder: model.map(function (eachColumn) { return eachColumn.id; }) }, (state !== null && state !== void 0 ? state : {})), model)) !== null && _d !== void 0 ? _d : {});
1169
+ };
1170
+ var handleApplyViewColumns = function (columns, state) {
1171
+ var _a;
1172
+ var order = new Map(((_a = state.columnOrder) !== null && _a !== void 0 ? _a : []).map(function (eachId, index) { return [eachId, index]; }));
1173
+ var ordered = __spreadArray([], columns, true).sort(function (a, b) { var _a, _b; return ((_a = order.get(a.id)) !== null && _a !== void 0 ? _a : order.size) - ((_b = order.get(b.id)) !== null && _b !== void 0 ? _b : order.size); });
1174
+ // INFO: schema-level hides move only in schema-hide mode, and only on this
1175
+ // screen — a personal view never writes back through onChangeHide
1176
+ if (!isSchemaHideMode || !state.hiddenColumnIds)
1177
+ return ordered;
1178
+ return ordered.map(function (eachColumn) {
1179
+ var _a, _b;
1180
+ return (__assign(__assign({}, eachColumn), { hide: (_b = (_a = state.hiddenColumnIds) === null || _a === void 0 ? void 0 : _a.includes(eachColumn.id)) !== null && _b !== void 0 ? _b : false }));
1181
+ });
1182
+ };
1183
+ var handleApplySavedView = function (view) {
1184
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
1185
+ var next = handleResolveViewState((_a = view === null || view === void 0 ? void 0 : view.state) !== null && _a !== void 0 ? _a : null);
1186
+ var isQueryChanged = !(0, viewStatePersistence_1.handleIsSameViewState)((0, viewStatePersistence_1.handlePickQueryState)(handleBuildViewSnapshot()), (0, viewStatePersistence_1.handlePickQueryState)(next));
1187
+ handleClearFlexFilterTypingTimeout();
1188
+ if (typingTimeout.current) {
1189
+ clearTimeout(typingTimeout.current);
1190
+ typingTimeout.current = null;
1191
+ }
1192
+ setFilterSearch((_b = next.filterSearchParams) !== null && _b !== void 0 ? _b : {});
1193
+ setFilterSearchParams((_c = next.filterSearchParams) !== null && _c !== void 0 ? _c : {});
1194
+ setFilterSelection(((_d = next.filterSelection) !== null && _d !== void 0 ? _d : {}));
1195
+ setFilterReference(((_e = next.filterReference) !== null && _e !== void 0 ? _e : {}));
1196
+ setFilterReferenceDate(next.filterReferenceDate
1197
+ ? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
1198
+ : initialFilterReferenceDate);
1199
+ handleCommitFlexFilters(((_f = next.flexFilters) === null || _f === void 0 ? void 0 : _f.length) ? next.flexFilters : defaultFlexFilterRow);
1200
+ setPersistedSort(next.sort);
1201
+ if (next.sort && !(0, viewStatePersistence_1.handleIsSameViewState)(next.sort, activeSortId !== null && activeSortId !== void 0 ? activeSortId : {}))
1202
+ (_h = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.onChangeSort) === null || _h === void 0 ? void 0 : _h.call(_g, next.sort);
1203
+ if (next.pageLimit)
1204
+ setPageLimit(next.pageLimit);
1205
+ setUserHiddenColumnIds((_j = next.userHiddenColumnIds) !== null && _j !== void 0 ? _j : []);
1206
+ if (view) {
1207
+ if (!schemaStructureRef.current)
1208
+ schemaStructureRef.current = structure;
1209
+ }
1210
+ else {
1211
+ schemaStructureRef.current = null;
1212
+ }
1213
+ setStructure(function (prev) { return handleApplyViewColumns(prev, next); });
1214
+ if (isQueryChanged) {
1215
+ // INFO: the list loads until a new read lands; whether the request itself
1216
+ // changed is only known after this render, so the effect below compares
1217
+ pendingViewCondKeyRef.current = JSON.stringify(handleReadQueryHocCond());
1218
+ handleClearDataByFilter();
1219
+ if (pageIndex !== 0)
1220
+ (_l = (_k = props.organise) === null || _k === void 0 ? void 0 : _k.onChangePagination) === null || _l === void 0 ? void 0 : _l.call(_k, 0);
1221
+ (_o = (_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareListHandleFilter) === null || _o === void 0 ? void 0 : _o.call(_m, (_p = next.filterSearchParams) !== null && _p !== void 0 ? _p : {}, (_q = next.filterSelection) !== null && _q !== void 0 ? _q : {}, next.filterReferenceDate
1222
+ ? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
1223
+ : initialFilterReferenceDate, (_r = next.filterReference) !== null && _r !== void 0 ? _r : {});
1224
+ }
1225
+ setActiveSavedViewId((_s = view === null || view === void 0 ? void 0 : view.id) !== null && _s !== void 0 ? _s : null);
1226
+ setDeletingSavedViewId(null);
1227
+ };
1228
+ // INFO: re-read storage before each write so a change made in another browser
1229
+ // tab on the same list is kept rather than overwritten by this tab's copy;
1230
+ // with storage unavailable the in-memory list is the only copy, so it is used
1231
+ var handleStoreSavedViews = function (update) {
1232
+ var views = update((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey, savedViews));
1233
+ setSavedViews(views);
1234
+ (0, viewStatePersistence_1.handleWriteSavedViews)(savedViewsKey, views);
1235
+ };
1236
+ // INFO: a name already used on this tab is overwritten
1237
+ var handleSaveSavedView = function (name) {
1238
+ var trimmed = name.trim();
1239
+ if (!trimmed)
1240
+ return;
1241
+ var state = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
1242
+ var savedId = "";
1243
+ handleStoreSavedViews(function (views) {
1244
+ var existing = views.find(function (eachView) { return eachView.tabId === viewType && eachView.name === trimmed; });
1245
+ var saved = existing
1246
+ ? __assign(__assign({}, existing), { state: state }) : { id: (0, uuid_1.v4)(), name: trimmed, tabId: viewType, state: state };
1247
+ savedId = saved.id;
1248
+ return existing
1249
+ ? views.map(function (eachView) {
1250
+ return eachView.id === existing.id ? saved : eachView;
1251
+ })
1252
+ : __spreadArray(__spreadArray([], views, true), [saved], false);
1253
+ });
1254
+ setActiveSavedViewId(savedId);
1255
+ setSavedViewName(null);
1256
+ };
1257
+ var handleUpdateSavedView = function (id) {
1258
+ var state = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
1259
+ handleStoreSavedViews(function (views) {
1260
+ return views.map(function (eachView) {
1261
+ return eachView.id === id ? __assign(__assign({}, eachView), { state: state }) : eachView;
1262
+ });
1263
+ });
1264
+ };
1265
+ var handleDeleteSavedView = function (id) {
1266
+ handleStoreSavedViews(function (views) {
1267
+ return views.filter(function (eachView) { return eachView.id !== id; });
1268
+ });
1269
+ if (activeSavedViewId === id)
1270
+ setActiveSavedViewId(null);
1271
+ setDeletingSavedViewId(null);
1272
+ };
1066
1273
  // INFO: called in the row click, while the list is still mounted and scrolled
1067
1274
  var handleCaptureListScroll = function (recordId) {
1068
1275
  var _a, _b;
@@ -1124,6 +1331,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1124
1331
  structure,
1125
1332
  persistedSort,
1126
1333
  userHiddenColumnIds,
1334
+ pageLimit,
1127
1335
  ]);
1128
1336
  /* eslint-enable */
1129
1337
  // INFO: re-arm on leaving the list, so each return from a record restores once
@@ -1146,7 +1354,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1146
1354
  var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
1147
1355
  scrollRestoredRef.current = isSwitch || isOtherListReturn;
1148
1356
  /* eslint-disable */
1149
- }, [props.collectionId, (_54 = props.organise) === null || _54 === void 0 ? void 0 : _54.persistKey]);
1357
+ }, [props.collectionId, (_59 = props.organise) === null || _59 === void 0 ? void 0 : _59.persistKey]);
1150
1358
  /* eslint-enable */
1151
1359
  // INFO: wait a frame — rows land in state one tick before layout
1152
1360
  (0, react_1.useEffect)(function () {
@@ -1181,7 +1389,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1181
1389
  (0, react_1.useEffect)(function () {
1182
1390
  handleOfflinePrefetch();
1183
1391
  /* eslint-disable */
1184
- }, [props.collectionId, (_55 = props.bareSettings) === null || _55 === void 0 ? void 0 : _55.bareOffline]);
1392
+ }, [props.collectionId, (_60 = props.bareSettings) === null || _60 === void 0 ? void 0 : _60.bareOffline]);
1185
1393
  /* eslint-enable */
1186
1394
  // INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
1187
1395
  // Calls through handleRefreshRef so the interval always dispatches the latest
@@ -1201,7 +1409,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1201
1409
  }, interval);
1202
1410
  return function () { return clearInterval(timer); };
1203
1411
  /* eslint-disable */
1204
- }, [(_56 = props.bareSettings) === null || _56 === void 0 ? void 0 : _56.barePollingInterval, isLive, isNetworkOffline]);
1412
+ }, [(_61 = props.bareSettings) === null || _61 === void 0 ? void 0 : _61.barePollingInterval, isLive, isNetworkOffline]);
1205
1413
  /* eslint-enable */
1206
1414
  // INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
1207
1415
  // EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
@@ -1243,7 +1451,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1243
1451
  };
1244
1452
  /* eslint-disable */
1245
1453
  }, [
1246
- (_57 = props.bareSettings) === null || _57 === void 0 ? void 0 : _57.bareSocketName,
1454
+ (_62 = props.bareSettings) === null || _62 === void 0 ? void 0 : _62.bareSocketName,
1247
1455
  props.collectionId,
1248
1456
  props.devSettings.sseEndpoint,
1249
1457
  props.devSettings.dbAPIToken,
@@ -1449,6 +1657,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1449
1657
  !persistedState ||
1450
1658
  persistedViewMountedRef.current) {
1451
1659
  setStructure((_a = props.model) !== null && _a !== void 0 ? _a : []);
1660
+ schemaStructureRef.current = null;
1452
1661
  }
1453
1662
  persistedViewMountedRef.current = true;
1454
1663
  setAdditionalQuery((_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.additionalQuery) !== null && _c !== void 0 ? _c : []);
@@ -1488,10 +1697,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1488
1697
  props.collectionId,
1489
1698
  props.model,
1490
1699
  props.localURLEndpoint,
1491
- (_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.extendedTabs,
1492
- (_59 = props.organise) === null || _59 === void 0 ? void 0 : _59.viewId,
1493
- (_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.additionalQuery,
1494
- (_61 = props.organise) === null || _61 === void 0 ? void 0 : _61.groupBy,
1700
+ (_63 = props.organise) === null || _63 === void 0 ? void 0 : _63.extendedTabs,
1701
+ (_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.viewId,
1702
+ (_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.additionalQuery,
1703
+ (_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.groupBy,
1495
1704
  resolvedType,
1496
1705
  ]);
1497
1706
  /**
@@ -1632,7 +1841,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
1632
1841
  };
1633
1842
  }, 100);
1634
1843
  return function () { return clearTimeout(timeoutId); };
1635
- }, [(_62 = props.organise) === null || _62 === void 0 ? void 0 : _62.showReadFloatingNav, resolvedType, props.id, loading]);
1844
+ }, [(_67 = props.organise) === null || _67 === void 0 ? void 0 : _67.showReadFloatingNav, resolvedType, props.id, loading]);
1636
1845
  (0, react_1.useEffect)(function () {
1637
1846
  if (resolvedType !== "read")
1638
1847
  return;
@@ -8736,7 +8945,68 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
8736
8945
  }
8737
8946
  };
8738
8947
  // INFO: `hidden` keeps the markers out of space-y spacing
8948
+ var renderSavedViews = function () {
8949
+ var _a;
8950
+ if (!isSavedViewsEnabled)
8951
+ return null;
8952
+ var views = handleGetTabSavedViews();
8953
+ var activeView = views.find(function (eachView) { return eachView.id === activeSavedViewId; });
8954
+ var isModified = !!activeView &&
8955
+ !(0, viewStatePersistence_1.handleIsSameViewState)((0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot()), (0, viewStatePersistence_1.handlePickViewState)(handleResolveViewState(activeView.state)));
8956
+ var darkMode = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.darkMode;
8957
+ var renderChipClass = function (active) {
8958
+ return "inline-flex items-center gap-1 rounded-full border px-3 py-1 text-xs font-medium ".concat(active
8959
+ ? "border-primary-500 bg-primary-50 text-primary-700"
8960
+ : darkMode
8961
+ ? "border-gray-600 text-gray-200 hover:bg-gray-700"
8962
+ : "border-gray-300 text-gray-600 hover:bg-gray-50");
8963
+ };
8964
+ var actionClass = "text-xs font-medium ".concat(darkMode ? "text-primary-300" : "text-primary-600", " hover:underline");
8965
+ return (react_1.default.createElement("div", { "data-testid": "dtw-saved-views", className: "mt-3 flex flex-wrap items-center gap-2" },
8966
+ react_1.default.createElement("span", { className: "text-xs font-medium ".concat(darkMode ? "text-gray-400" : "text-gray-500") }, "Views"),
8967
+ react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-all", className: renderChipClass(!activeView), onClick: function () { return handleApplySavedView(null); } }, "All"),
8968
+ views.map(function (eachView) {
8969
+ return deletingSavedViewId === eachView.id ? (react_1.default.createElement("span", { key: eachView.id, className: renderChipClass(false) },
8970
+ "Delete \u201C",
8971
+ eachView.name,
8972
+ "\u201D?",
8973
+ react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-confirm-delete-".concat(eachView.id), className: "font-semibold text-red-600", onClick: function () { return handleDeleteSavedView(eachView.id); } }, "Delete"),
8974
+ react_1.default.createElement("button", { type: "button", className: "text-gray-500", onClick: function () { return setDeletingSavedViewId(null); } }, "Keep"))) : (react_1.default.createElement("span", { key: eachView.id, className: renderChipClass(eachView.id === (activeView === null || activeView === void 0 ? void 0 : activeView.id)) },
8975
+ react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-".concat(eachView.id), title: eachView.id === (activeView === null || activeView === void 0 ? void 0 : activeView.id) && isModified
8976
+ ? "Changed since saved"
8977
+ : undefined, onClick: function () { return handleApplySavedView(eachView); } },
8978
+ eachView.name,
8979
+ eachView.id === (activeView === null || activeView === void 0 ? void 0 : activeView.id) && isModified ? " •" : ""),
8980
+ !eachView.locked && (react_1.default.createElement("button", { type: "button", "aria-label": "Delete ".concat(eachView.name), "data-testid": "dtw-saved-view-delete-".concat(eachView.id), onClick: function () { return setDeletingSavedViewId(eachView.id); } },
8981
+ react_1.default.createElement(outline_1.XMarkIcon, { className: "h-3.5 w-3.5" })))));
8982
+ }),
8983
+ activeView && isModified && !activeView.locked && (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-update", className: actionClass, onClick: function () { return handleUpdateSavedView(activeView.id); } },
8984
+ "Update \u201C",
8985
+ activeView.name,
8986
+ "\u201D")),
8987
+ savedViewName === null ? (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-new", className: actionClass, onClick: function () { return setSavedViewName(""); } }, "+ Save view")) : (
8988
+ // INFO: a form, so a mobile keyboard's Done saves the view; stopPropagation
8989
+ // keeps the submit from reaching any form around the template
8990
+ react_1.default.createElement("form", { "data-testid": "dtw-saved-view-form", className: "flex items-center gap-1", onSubmit: function (event) {
8991
+ event.preventDefault();
8992
+ event.stopPropagation();
8993
+ handleSaveSavedView(savedViewName);
8994
+ } },
8995
+ react_1.default.createElement(textInput_1.TextInput, { id: "dtw-saved-view-name", type: "text", label: "", size: "xs", autoFocus: true, enterKeyHint: "done", darkMode: darkMode, value: savedViewName, placeholder: "View name", containerClassName: "w-32 sm:w-44", onChange: function (event) { return setSavedViewName(event.target.value); }, onKeyDown: function (event) {
8996
+ if (event.key === "Escape")
8997
+ setSavedViewName(null);
8998
+ // INFO: some mobile keyboards send only the keyCode
8999
+ if (event.key === "Enter" || event.keyCode === 13) {
9000
+ event.preventDefault();
9001
+ event.stopPropagation();
9002
+ handleSaveSavedView(savedViewName);
9003
+ }
9004
+ } }),
9005
+ react_1.default.createElement("button", { type: "submit", className: actionClass }, "Save"),
9006
+ react_1.default.createElement("button", { type: "button", className: "text-xs text-gray-500", onClick: function () { return setSavedViewName(null); } }, "Cancel")))));
9007
+ };
8739
9008
  var renderScopedTabContent = function (tabs, dataType, requestedViewType) { return (react_1.default.createElement(react_1.default.Fragment, null,
9009
+ renderSavedViews(),
8740
9010
  react_1.default.createElement("span", { ref: scrollScopeStartRef, hidden: true, "aria-hidden": "true" }),
8741
9011
  renderTabContent(tabs, dataType, requestedViewType),
8742
9012
  react_1.default.createElement("span", { ref: scrollScopeEndRef, hidden: true, "aria-hidden": "true" }))); };
@@ -9465,36 +9735,39 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
9465
9735
  var kanbanData = renderGridAndListData("", "kanban", kanbanTitle_2, kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.useColumnName);
9466
9736
  // INFO: when bareNewDTW is enabled, render NewKanban instead of legacy Kanban
9467
9737
  if ((_54 = props.bareSettings) === null || _54 === void 0 ? void 0 : _54.bareNewDTW) {
9468
- return (react_1.default.createElement(newKanban_1.NewKanban, { className: "inline-flex", data: kanbanData, loading: tableLoading, groupBy: groupBy_1, groupId: kanbanTitle_2 !== null && kanbanTitle_2 !== void 0 ? kanbanTitle_2 : "", groupLabel: groupLabel_1.length > 0 ? groupLabel_1 : undefined, nullColumn: nullColumn_1, alertMessage: kanbanData.length === limit
9469
- ? "Data has exceeded limit, please apply filters"
9470
- : "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: canUpdateRecord, droppable: canUpdateRecord && kanbanDroppable, mobileView: (_55 = props.bareSettings) === null || _55 === void 0 ? void 0 : _55.bareListMobileView, onUpdateData: canUpdateRecord
9471
- ? function (cardId, _fromCol, toCol) { return __awaiter(void 0, void 0, void 0, function () {
9472
- var _a;
9473
- return __generator(this, function (_b) {
9474
- switch (_b.label) {
9475
- case 0:
9476
- setKanbanDroppable(false);
9477
- _b.label = 1;
9478
- case 1:
9479
- _b.trys.push([1, , 3, 4]);
9480
- return [4 /*yield*/, handleSubmitData("update", cardId, kanbanTitle_2, (_a = {},
9481
- _a[kanbanTitle_2] = toCol,
9482
- _a))];
9483
- case 2:
9484
- _b.sent();
9485
- return [3 /*break*/, 4];
9486
- case 3:
9487
- setKanbanDroppable(true);
9488
- return [7 /*endfinally*/];
9489
- case 4: return [2 /*return*/];
9490
- }
9491
- });
9492
- }); }
9493
- : undefined, onClickData: function (id) {
9494
- var _a, _b;
9495
- handleCaptureListScroll(id);
9496
- (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
9497
- }, darkMode: (_56 = props.organise) === null || _56 === void 0 ? void 0 : _56.darkMode, darkModeBg: (_57 = props.organise) === null || _57 === void 0 ? void 0 : _57.darkModeBg }));
9738
+ return (
9739
+ // INFO: the same top spacing as the table, list and grid
9740
+ react_1.default.createElement("div", { className: "mt-5" },
9741
+ react_1.default.createElement(newKanban_1.NewKanban, { className: "inline-flex", data: kanbanData, loading: tableLoading, groupBy: groupBy_1, groupId: kanbanTitle_2 !== null && kanbanTitle_2 !== void 0 ? kanbanTitle_2 : "", groupLabel: groupLabel_1.length > 0 ? groupLabel_1 : undefined, nullColumn: nullColumn_1, alertMessage: kanbanData.length === limit
9742
+ ? "Data has exceeded limit, please apply filters"
9743
+ : "", groupCluster: kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.groupCluster, draggable: canUpdateRecord, droppable: canUpdateRecord && kanbanDroppable, mobileView: (_55 = props.bareSettings) === null || _55 === void 0 ? void 0 : _55.bareListMobileView, onUpdateData: canUpdateRecord
9744
+ ? function (cardId, _fromCol, toCol) { return __awaiter(void 0, void 0, void 0, function () {
9745
+ var _a;
9746
+ return __generator(this, function (_b) {
9747
+ switch (_b.label) {
9748
+ case 0:
9749
+ setKanbanDroppable(false);
9750
+ _b.label = 1;
9751
+ case 1:
9752
+ _b.trys.push([1, , 3, 4]);
9753
+ return [4 /*yield*/, handleSubmitData("update", cardId, kanbanTitle_2, (_a = {},
9754
+ _a[kanbanTitle_2] = toCol,
9755
+ _a))];
9756
+ case 2:
9757
+ _b.sent();
9758
+ return [3 /*break*/, 4];
9759
+ case 3:
9760
+ setKanbanDroppable(true);
9761
+ return [7 /*endfinally*/];
9762
+ case 4: return [2 /*return*/];
9763
+ }
9764
+ });
9765
+ }); }
9766
+ : undefined, onClickData: function (id) {
9767
+ var _a, _b;
9768
+ handleCaptureListScroll(id);
9769
+ (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
9770
+ }, darkMode: (_56 = props.organise) === null || _56 === void 0 ? void 0 : _56.darkMode, darkModeBg: (_57 = props.organise) === null || _57 === void 0 ? void 0 : _57.darkModeBg })));
9498
9771
  }
9499
9772
  return (react_1.default.createElement(kanban_1.Kanban, { className: "inline-flex", data: kanbanData, loading: tableLoading, groupBy: groupBy_1, groupId: kanbanTitle_2 !== null && kanbanTitle_2 !== void 0 ? kanbanTitle_2 : "", groupLabel: groupLabel_1.length > 0 ? groupLabel_1 : undefined, nullColumn: nullColumn_1, alertMessage: kanbanData.length === limit
9500
9773
  ? "Data has exceeded limit, please apply filters"
@@ -10007,7 +10280,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10007
10280
  };
10008
10281
  return (react_1.default.createElement(react_1.default.Fragment, null,
10009
10282
  renderNotification("root"),
10010
- ((_64 = (_63 = props.renderSettings) === null || _63 === void 0 ? void 0 : _63.renderLoadingUI) === null || _64 === void 0 ? void 0 : _64.call(_63)) && loading ? ((_65 = props.renderSettings) === null || _65 === void 0 ? void 0 : _65.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.darkMode, darkModeBg: (_67 = props.organise) === null || _67 === void 0 ? void 0 : _67.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
10283
+ ((_69 = (_68 = props.renderSettings) === null || _68 === void 0 ? void 0 : _68.renderLoadingUI) === null || _69 === void 0 ? void 0 : _69.call(_68)) && loading ? ((_70 = props.renderSettings) === null || _70 === void 0 ? void 0 : _70.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.darkMode, darkModeBg: (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
10011
10284
  var _a, _b;
10012
10285
  if (loading)
10013
10286
  return;
@@ -10018,7 +10291,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10018
10291
  setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
10019
10292
  }
10020
10293
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
10021
- react_1.default.createElement(modal_1.Modal, { darkMode: (_68 = props.organise) === null || _68 === void 0 ? void 0 : _68.darkMode, darkModeBg: (_69 = props.organise) === null || _69 === void 0 ? void 0 : _69.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
10294
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.darkMode, darkModeBg: (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
10022
10295
  return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
10023
10296
  if (dataId) {
10024
10297
  var currentValue = selectedData[referenceCreationModal.id];
@@ -10034,19 +10307,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10034
10307
  }, onClose: function () {
10035
10308
  setReferenceCreationModal({ id: "", name: "", type: "string" });
10036
10309
  } }),
10037
- react_1.default.createElement(modal_1.Modal, { darkMode: (_70 = props.organise) === null || _70 === void 0 ? void 0 : _70.darkMode, darkModeBg: (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
10310
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.darkMode, darkModeBg: (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
10038
10311
  setReferenceDeleteTableData({});
10039
10312
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
10040
- react_1.default.createElement(modal_1.Modal, { darkMode: (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.darkMode, darkModeBg: (_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
10313
+ react_1.default.createElement(modal_1.Modal, { darkMode: (_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.darkMode, darkModeBg: (_78 = props.organise) === null || _78 === void 0 ? void 0 : _78.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
10041
10314
  setDeletePasscodeInput("");
10042
10315
  setDeleteModal(!deleteModal);
10043
10316
  setDeleteFeedId("");
10044
10317
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
10045
- react_1.default.createElement(modal_1.Modal, { darkMode: (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.darkMode, darkModeBg: (_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
10318
+ 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, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
10046
10319
  setBatchUpdateData({ columnId: "", columnData: {} });
10047
10320
  setBatchUpdateModal(false);
10048
10321
  }, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
10049
- react_1.default.createElement(modal_1.Modal, { darkMode: (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.darkMode, darkModeBg: (_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
10322
+ 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, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
10050
10323
  var _a;
10051
10324
  if (props.space)
10052
10325
  return (react_1.default.createElement(authModal_1.AuthModal, { space: props.space, userId: (_a = props.id) !== null && _a !== void 0 ? _a : "", type: selectedAuthMethod, authMethods: authMethods, onComplete: handleAuthComplete }));
@@ -10054,7 +10327,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
10054
10327
  }, onClose: function () {
10055
10328
  setSelectedAuthMethod("");
10056
10329
  } }),
10057
- isActivityLog && (react_1.default.createElement(modal_1.Modal, { darkMode: (_78 = props.organise) === null || _78 === void 0 ? void 0 : _78.darkMode, darkModeBg: (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.darkModeBg, open: activityModal, title: "Activity Log", renderContent: function () {
10330
+ isActivityLog && (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, open: activityModal, title: "Activity Log", renderContent: function () {
10058
10331
  var _a, _b;
10059
10332
  return (react_1.default.createElement(activityModal_1.ActivityModal, { title: props.title && typeof props.title === "string"
10060
10333
  ? props.title