blixify-ui-web 1.3.4 → 1.3.5
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.
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +1 -0
- package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +350 -225
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -69,6 +69,17 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
73
|
+
var t = {};
|
|
74
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
75
|
+
t[p] = s[p];
|
|
76
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
77
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
78
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
79
|
+
t[p[i]] = s[p[i]];
|
|
80
|
+
}
|
|
81
|
+
return t;
|
|
82
|
+
};
|
|
72
83
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
73
84
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
74
85
|
if (ar || !(i in from)) {
|
|
@@ -389,13 +400,34 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
389
400
|
};
|
|
390
401
|
};
|
|
391
402
|
var _127 = intialiseDefaultFilterValues(), initialFilterSearch = _127.initialFilterSearch, initialFilterSearchParams = _127.initialFilterSearchParams, initialFilterSelection = _127.initialFilterSelection, initialFilterReference = _127.initialFilterReference, initialFilterReferenceDate = _127.initialFilterReferenceDate;
|
|
403
|
+
// INFO: organise.initialSearch fills the Quick find box, which sends its
|
|
404
|
+
// value under "search". Without that box (hideSearch, Firebase, or a
|
|
405
|
+
// "search" query taking its place) there is nothing to fill
|
|
406
|
+
var handleCanInitialSearch = function (queries) {
|
|
407
|
+
var _a, _b;
|
|
408
|
+
return !!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSearch) &&
|
|
409
|
+
!((_b = props.organise) === null || _b === void 0 ? void 0 : _b.hideSearch) &&
|
|
410
|
+
props.devSettings.server !== "firebase" &&
|
|
411
|
+
props.devSettings.server !== "fbServer" &&
|
|
412
|
+
!(queries !== null && queries !== void 0 ? queries : []).some(function (eachQuery) { return eachQuery.type === "search"; });
|
|
413
|
+
};
|
|
414
|
+
// INFO: a list opened with initialSearch is a fresh datasheet with only the
|
|
415
|
+
// keyword: All's columns and sort, no stored filters, and nothing this
|
|
416
|
+
// person kept in the browser (view drafts, persistViewState) is read or
|
|
417
|
+
// written — until they pick a view, which is their own choice again
|
|
418
|
+
var _128 = (0, react_1.useState)(function () { var _a; return handleCanInitialSearch((_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery); }), isLinkOpen = _128[0], setIsLinkOpen = _128[1];
|
|
419
|
+
var handleSeedInitialSearch = function (params) {
|
|
420
|
+
var _a;
|
|
421
|
+
return isLinkOpen && ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSearch)
|
|
422
|
+
? __assign(__assign({}, params), { search: props.organise.initialSearch }) : params;
|
|
423
|
+
};
|
|
392
424
|
// INFO: Persist view state hook — handles storage read/write for filter/sort/column state
|
|
393
|
-
var
|
|
394
|
-
mode: (_k = props.organise) === null || _k === void 0 ? void 0 : _k.persistViewState,
|
|
425
|
+
var _129 = (0, viewStatePersistence_1.usePersistedViewState)({
|
|
426
|
+
mode: isLinkOpen ? undefined : (_k = props.organise) === null || _k === void 0 ? void 0 : _k.persistViewState,
|
|
395
427
|
collectionId: props.collectionId,
|
|
396
428
|
persistKey: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.persistKey,
|
|
397
429
|
type: resolvedType,
|
|
398
|
-
}), rawPersistedState =
|
|
430
|
+
}), rawPersistedState = _129.persistedState, isPersistEnabled = _129.isEnabled, handleSaveView = _129.handleSaveView, handleRegisterViewSnapshot = _129.handleRegisterViewSnapshot;
|
|
399
431
|
// INFO: drop stored filters/sort on removed columns — they would empty the table
|
|
400
432
|
var persistedState = (0, react_1.useMemo)(function () {
|
|
401
433
|
var _a, _b, _c, _d;
|
|
@@ -411,8 +443,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
411
443
|
(_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareFlexFilterListObjects,
|
|
412
444
|
(_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareFlexFilterRelated,
|
|
413
445
|
]);
|
|
414
|
-
var
|
|
415
|
-
var
|
|
446
|
+
var _130 = (0, react_1.useState)(false), loading = _130[0], setLoading = _130[1];
|
|
447
|
+
var _131 = (0, react_1.useState)(), notification = _131[0], setNotification = _131[1];
|
|
416
448
|
// INFO: a success toast is confirmation, not a decision — it clears itself so
|
|
417
449
|
// it never sits on the floating step bar; errors stay until dismissed
|
|
418
450
|
(0, react_1.useEffect)(function () {
|
|
@@ -422,80 +454,86 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
422
454
|
return function () { return clearTimeout(timer); };
|
|
423
455
|
}, [notification]);
|
|
424
456
|
//INFO : Used by List
|
|
425
|
-
var
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
var
|
|
430
|
-
|
|
431
|
-
|
|
457
|
+
var _132 = (0, react_1.useState)(function () {
|
|
458
|
+
var _a;
|
|
459
|
+
return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearch);
|
|
460
|
+
}), filterSearch = _132[0], setFilterSearch = _132[1];
|
|
461
|
+
var _133 = (0, react_1.useState)(function () {
|
|
462
|
+
var _a;
|
|
463
|
+
return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearchParams);
|
|
464
|
+
}), filterSearchParams = _133[0], setFilterSearchParams = _133[1];
|
|
465
|
+
var _134 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _q !== void 0 ? _q : initialFilterSelection), filterSelection = _134[0], setFilterSelection = _134[1];
|
|
466
|
+
var _135 = (0, react_1.useState)((_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _r !== void 0 ? _r : initialFilterReference), filterReference = _135[0], setFilterReference = _135[1];
|
|
467
|
+
var _136 = (0, react_1.useState)({}), filterReferenceSearch = _136[0], setFilterReferenceSearch = _136[1];
|
|
468
|
+
var _137 = (0, react_1.useState)({}), filterReferenceList = _137[0], setFilterReferenceList = _137[1];
|
|
469
|
+
var _138 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
|
|
432
470
|
? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
|
|
433
|
-
: initialFilterReferenceDate), filterReferenceDate =
|
|
434
|
-
var
|
|
435
|
-
var
|
|
436
|
-
var
|
|
437
|
-
var
|
|
438
|
-
var
|
|
471
|
+
: initialFilterReferenceDate), filterReferenceDate = _138[0], setFilterReferenceDate = _138[1];
|
|
472
|
+
var _139 = (0, react_1.useState)(true), tableLoading = _139[0], setTableLoading = _139[1];
|
|
473
|
+
var _140 = (0, react_1.useState)(""), cursor = _140[0], setCursor = _140[1];
|
|
474
|
+
var _141 = (0, react_1.useState)(""), lastCursor = _141[0], setLastCursor = _141[1];
|
|
475
|
+
var _142 = (0, react_1.useState)([]), tableData = _142[0], setTableData = _142[1];
|
|
476
|
+
var _143 = (0, react_1.useState)([]), spaceTableData = _143[0], setSpaceTableData = _143[1];
|
|
439
477
|
// INFO: a save resolves after later renders, so it reads the table from here —
|
|
440
478
|
// the state it closed over can predate an earlier save on the same row
|
|
441
479
|
var tableDataRef = (0, react_1.useRef)([]);
|
|
442
480
|
var spaceTableDataRef = (0, react_1.useRef)([]);
|
|
443
481
|
tableDataRef.current = tableData;
|
|
444
482
|
spaceTableDataRef.current = spaceTableData;
|
|
445
|
-
var
|
|
446
|
-
var
|
|
483
|
+
var _144 = (0, react_1.useState)(0), size = _144[0], setSize = _144[1];
|
|
484
|
+
var _145 = (0, react_1.useState)((_u = (_s = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _s !== void 0 ? _s : (_t = props.organise) === null || _t === void 0 ? void 0 : _t.pageIndex) !== null && _u !== void 0 ? _u : 0), pageIndex = _145[0], setPageIndex = _145[1];
|
|
447
485
|
// INFO: every change of page, including the return to the first page when a
|
|
448
486
|
// filter or search changes, which onChangePagination does not always report
|
|
449
487
|
(0, react_1.useEffect)(function () {
|
|
450
488
|
var _a, _b;
|
|
451
489
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePageIndex) === null || _b === void 0 ? void 0 : _b.call(_a, pageIndex);
|
|
452
490
|
}, [pageIndex]);
|
|
453
|
-
var
|
|
454
|
-
var
|
|
455
|
-
var
|
|
456
|
-
var
|
|
457
|
-
var
|
|
491
|
+
var _146 = (0, react_1.useState)([]), selectedIds = _146[0], setSelectedIds = _146[1];
|
|
492
|
+
var _147 = (0, react_1.useState)(false), selectAll = _147[0], setSelectAll = _147[1];
|
|
493
|
+
var _148 = (0, react_1.useState)(""), deletePasscode = _148[0], setDeletePasscode = _148[1];
|
|
494
|
+
var _149 = (0, react_1.useState)(""), deletePasscodeInput = _149[0], setDeletePasscodeInput = _149[1];
|
|
495
|
+
var _150 = (0, react_1.useState)(""), deleteFeedId = _150[0], setDeleteFeedId = _150[1];
|
|
458
496
|
//INFO : Used by List Organise
|
|
459
497
|
// INFO: Internal sort state that overrides props.organise?.sort when
|
|
460
498
|
// persistViewState is enabled and a persisted sort exists
|
|
461
|
-
var
|
|
462
|
-
var
|
|
463
|
-
var
|
|
464
|
-
var
|
|
499
|
+
var _151 = (0, react_1.useState)((_v = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _v !== void 0 ? _v : undefined), persistedSort = _151[0], setPersistedSort = _151[1];
|
|
500
|
+
var _152 = (0, react_1.useState)(false), filterDraft = _152[0], setFilterDraft = _152[1];
|
|
501
|
+
var _153 = (0, react_1.useState)(false), addTabModal = _153[0], setAddTabModal = _153[1];
|
|
502
|
+
var _154 = (0, react_1.useState)(-1), editTabIndex = _154[0], setEditTabIndex = _154[1];
|
|
465
503
|
//INFO : resolve the initial tab synchronously so the mount cond is already
|
|
466
504
|
// tab-scoped — an empty initial tab caused a second wasted list fetch
|
|
467
|
-
var
|
|
505
|
+
var _155 = (0, react_1.useState)(function () {
|
|
468
506
|
var _a;
|
|
469
507
|
return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, listViewId);
|
|
470
|
-
}), selectedTab =
|
|
471
|
-
var
|
|
508
|
+
}), selectedTab = _155[0], setSelectedTab = _155[1];
|
|
509
|
+
var _156 = (0, react_1.useState)("dayGridMonth"), calendarView = _156[0], setCalendarView = _156[1];
|
|
472
510
|
// INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
|
|
473
511
|
// (calendarView above drives the matching range query)
|
|
474
|
-
var
|
|
475
|
-
var
|
|
512
|
+
var _157 = (0, react_1.useState)("month"), newCalendarViewMode = _157[0], setNewCalendarViewMode = _157[1];
|
|
513
|
+
var _158 = (0, react_1.useState)(new Date()), calendarTabMonth = _158[0], setCalendarTabMonth = _158[1];
|
|
476
514
|
// INFO: defaultViewSwitch picks the opening view only — the tab re-inits
|
|
477
515
|
// whenever its settings change, and that must not undo the user's switch
|
|
478
516
|
var calendarViewInitRef = (0, react_1.useRef)(false);
|
|
479
|
-
var
|
|
480
|
-
var
|
|
481
|
-
var
|
|
482
|
-
var
|
|
517
|
+
var _159 = (0, react_1.useState)(true), kanbanDroppable = _159[0], setKanbanDroppable = _159[1];
|
|
518
|
+
var _160 = (0, react_1.useState)([]), kanbanOptions = _160[0], setKanbanOptions = _160[1];
|
|
519
|
+
var _161 = (0, react_1.useState)(false), batchUpdateModal = _161[0], setBatchUpdateModal = _161[1];
|
|
520
|
+
var _162 = (0, react_1.useState)({
|
|
483
521
|
columnId: "",
|
|
484
522
|
columnData: {},
|
|
485
|
-
}), batchUpdateData =
|
|
523
|
+
}), batchUpdateData = _162[0], setBatchUpdateData = _162[1];
|
|
486
524
|
// INFO: system columns (created / updated at and by, record id, number)
|
|
487
525
|
// join the structure hidden; the ones a user shows are kept per view
|
|
488
|
-
var isSystemColumnsEnabled = !!((
|
|
489
|
-
var isSystemColumnsLocked = !!((
|
|
526
|
+
var isSystemColumnsEnabled = !!((_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareSystemColumns);
|
|
527
|
+
var isSystemColumnsLocked = !!((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareSystemColumnsLocked);
|
|
490
528
|
var appendedSystemColumnIds = isSystemColumnsEnabled
|
|
491
529
|
? systemColumns_1.SYSTEM_COLUMN_IDS.filter(function (eachId) { var _a; return !((_a = props.model) !== null && _a !== void 0 ? _a : []).some(function (each) { return each.id === eachId; }); })
|
|
492
530
|
: [];
|
|
493
|
-
var
|
|
531
|
+
var _163 = (0, react_1.useState)((_y = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _y !== void 0 ? _y : []), shownSystemColumnIds = _163[0], setShownSystemColumnIds = _163[1];
|
|
494
532
|
var handleWithSystemColumns = function (model, shownIds) {
|
|
495
533
|
if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
|
|
496
534
|
return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
|
|
497
535
|
};
|
|
498
|
-
var
|
|
536
|
+
var _164 = (0, react_1.useState)(function () {
|
|
499
537
|
var _a;
|
|
500
538
|
var baseModel = handleWithSystemColumns((props === null || props === void 0 ? void 0 : props.model) || [], (_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _a !== void 0 ? _a : []);
|
|
501
539
|
if (!persistedState)
|
|
@@ -522,8 +560,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
522
560
|
});
|
|
523
561
|
}
|
|
524
562
|
return model;
|
|
525
|
-
}), structure =
|
|
526
|
-
var
|
|
563
|
+
}), structure = _164[0], setStructure = _164[1];
|
|
564
|
+
var _165 = (0, react_1.useState)(((_z = props === null || props === void 0 ? void 0 : props.organise) === null || _z === void 0 ? void 0 : _z.additionalQuery) || []), additionalQuery = _165[0], setAdditionalQuery = _165[1];
|
|
527
565
|
// INFO: State for user-configurable flex filters (Monday.com-style)
|
|
528
566
|
// INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
|
|
529
567
|
var defaultFlexFilterRow = [
|
|
@@ -535,13 +573,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
535
573
|
},
|
|
536
574
|
];
|
|
537
575
|
// INFO: rows the host opens the list with come before a saved view's
|
|
538
|
-
var initialFlexFilterRows = ((
|
|
576
|
+
var initialFlexFilterRows = ((_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.initialFlexFilters) &&
|
|
539
577
|
props.organise.initialFlexFilters.length > 0
|
|
540
578
|
? props.organise.initialFlexFilters
|
|
541
579
|
: (persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
542
580
|
? persistedState.flexFilters
|
|
543
581
|
: defaultFlexFilterRow;
|
|
544
|
-
var
|
|
582
|
+
var _166 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _166[0], setFlexFilters = _166[1];
|
|
545
583
|
// INFO: always-current mirror of flexFilters, read by the imperative apply/
|
|
546
584
|
// clear methods so chained calls in one tick aren't stale.
|
|
547
585
|
var flexFiltersRef = (0, react_1.useRef)(flexFilters);
|
|
@@ -554,97 +592,97 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
554
592
|
}, [flexFilters]);
|
|
555
593
|
// INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
|
|
556
594
|
// to prevent API calls on every keystroke when typing in value inputs
|
|
557
|
-
var
|
|
595
|
+
var _167 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _167[0], setFlexFiltersDebounced = _167[1];
|
|
558
596
|
// INFO: the filter rows of the export being set up — started from the
|
|
559
597
|
// list's own when the export opens, so changing them leaves the list as it is
|
|
560
|
-
var
|
|
561
|
-
var
|
|
562
|
-
var
|
|
563
|
-
var
|
|
564
|
-
var
|
|
598
|
+
var _168 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _168[0], setExportFlexFilters = _168[1];
|
|
599
|
+
var _169 = (0, react_1.useState)({}), flexFilterReferenceOptions = _169[0], setFlexFilterReferenceOptions = _169[1];
|
|
600
|
+
var _170 = (0, react_1.useState)({}), flexFilterReferenceSearch = _170[0], setFlexFilterReferenceSearch = _170[1];
|
|
601
|
+
var _171 = (0, react_1.useState)(false), flexFilterModalOpen = _171[0], setFlexFilterModalOpen = _171[1];
|
|
602
|
+
var _172 = (0, react_1.useState)(false), viewSettingsModalOpen = _172[0], setViewSettingsModalOpen = _172[1];
|
|
565
603
|
// INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
|
|
566
604
|
// Deliberately kept out of `structure`: the props-sync effect below resets
|
|
567
605
|
// structure to props.model whenever props change, which would wipe the
|
|
568
606
|
// choice, and the persist effect derives schema-level hiddenColumnIds from
|
|
569
607
|
// structure — writing user hides there would blur the two concepts.
|
|
570
|
-
var
|
|
571
|
-
var
|
|
572
|
-
var
|
|
573
|
-
var
|
|
608
|
+
var _173 = (0, react_1.useState)((_1 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _1 !== void 0 ? _1 : []), userHiddenColumnIds = _173[0], setUserHiddenColumnIds = _173[1];
|
|
609
|
+
var _174 = (0, react_1.useState)(""), columnSearch = _174[0], setColumnSearch = _174[1];
|
|
610
|
+
var _175 = (0, react_1.useState)([]), savedViews = _175[0], setSavedViews = _175[1];
|
|
611
|
+
var _176 = (0, react_1.useState)(null), activeSavedViewId = _176[0], setActiveSavedViewId = _176[1];
|
|
574
612
|
// INFO: the widths of the view on screen, by column id ("180px")
|
|
575
|
-
var
|
|
613
|
+
var _177 = (0, react_1.useState)(function () { var _a, _b, _c; return (_c = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) === null || _b === void 0 ? void 0 : _b.columnWidths) !== null && _c !== void 0 ? _c : {}; }), columnWidths = _177[0], setColumnWidths = _177[1];
|
|
576
614
|
// INFO: the columns the view on screen freezes at the left edge
|
|
577
|
-
var
|
|
615
|
+
var _178 = (0, react_1.useState)(function () { var _a, _b; return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) === null || _b === void 0 ? void 0 : _b.pinnedColumnIds; }), pinnedColumnIds = _178[0], setPinnedColumnIds = _178[1];
|
|
578
616
|
// INFO: unsaved changes are kept only once the opening view is on screen,
|
|
579
617
|
// so the defaults drawn before it never overwrite a person's own
|
|
580
|
-
var
|
|
618
|
+
var _179 = (0, react_1.useState)(false), isViewDraftReady = _179[0], setIsViewDraftReady = _179[1];
|
|
581
619
|
// INFO: null while the name box is closed
|
|
582
|
-
var
|
|
583
|
-
var
|
|
584
|
-
var
|
|
585
|
-
var
|
|
586
|
-
var
|
|
620
|
+
var _180 = (0, react_1.useState)(null), savedViewName = _180[0], setSavedViewName = _180[1];
|
|
621
|
+
var _181 = (0, react_1.useState)(null), deletingSavedViewId = _181[0], setDeletingSavedViewId = _181[1];
|
|
622
|
+
var _182 = (0, react_1.useState)(null), renamingSavedView = _182[0], setRenamingSavedView = _182[1];
|
|
623
|
+
var _183 = (0, react_1.useState)(false), isSavedViewsExpanded = _183[0], setIsSavedViewsExpanded = _183[1];
|
|
624
|
+
var _184 = (0, react_1.useState)(null), draggingColumnId = _184[0], setDraggingColumnId = _184[1];
|
|
587
625
|
var columnRowRefs = (0, react_1.useRef)({});
|
|
588
626
|
//INFO : Used by Auth
|
|
589
|
-
var
|
|
627
|
+
var _185 = (0, react_1.useState)({
|
|
590
628
|
email: "",
|
|
591
629
|
google: "",
|
|
592
630
|
phone: "",
|
|
593
631
|
disabled: false,
|
|
594
632
|
create: false,
|
|
595
|
-
}), authMethods =
|
|
596
|
-
var
|
|
633
|
+
}), authMethods = _185[0], setAuthMethods = _185[1];
|
|
634
|
+
var _186 = (0, react_1.useState)(""), selectedAuthMethod = _186[0], setSelectedAuthMethod = _186[1];
|
|
597
635
|
// INFO: the sign-in check of a users datasheet's record is running; the
|
|
598
636
|
// panel shows a spinner rather than nothing, which read as "no login"
|
|
599
|
-
var
|
|
637
|
+
var _187 = (0, react_1.useState)(false), authLoading = _187[0], setAuthLoading = _187[1];
|
|
600
638
|
// INFO: a delete is running — the ref answers a second tap at once, before
|
|
601
639
|
// the state has rendered, and the state disables the confirm button
|
|
602
640
|
var deletingRef = (0, react_1.useRef)(false);
|
|
603
|
-
var
|
|
641
|
+
var _188 = (0, react_1.useState)(false), deleting = _188[0], setDeleting = _188[1];
|
|
604
642
|
// INFO: Used by Activity Log
|
|
605
|
-
var
|
|
606
|
-
var
|
|
643
|
+
var _189 = (0, react_1.useState)(false), activityModal = _189[0], setActivityModal = _189[1];
|
|
644
|
+
var _190 = (0, react_1.useState)(""), activityId = _190[0], setActivityId = _190[1];
|
|
607
645
|
//INFO : Used by Export
|
|
608
|
-
var
|
|
609
|
-
var
|
|
610
|
-
var
|
|
611
|
-
var
|
|
612
|
-
var
|
|
613
|
-
var
|
|
614
|
-
var
|
|
615
|
-
var
|
|
616
|
-
var
|
|
617
|
-
var
|
|
618
|
-
var
|
|
619
|
-
var
|
|
620
|
-
var
|
|
621
|
-
var
|
|
622
|
-
var
|
|
646
|
+
var _191 = (0, react_1.useState)(null), csvFile = _191[0], setCSVFile = _191[1];
|
|
647
|
+
var _192 = (0, react_1.useState)([]), csvFileData = _192[0], setCSVFileData = _192[1];
|
|
648
|
+
var _193 = (0, react_1.useState)(0), stepCSVIndex = _193[0], setStepCSVIndex = _193[1];
|
|
649
|
+
var _194 = (0, react_1.useState)({}), listCSVMapAttribute = _194[0], setListCSVMapAttribute = _194[1];
|
|
650
|
+
var _195 = (0, react_1.useState)({}), listCSVObjAttribute = _195[0], setListCSVObjAttribute = _195[1];
|
|
651
|
+
var _196 = (0, react_1.useState)([]), csvAPIAttribute = _196[0], setCSVAPIAttribute = _196[1];
|
|
652
|
+
var _197 = (0, react_1.useState)(((_2 = props.devSettings.currentUser) === null || _2 === void 0 ? void 0 : _2.userEmail) || ""), exportCSVEmail = _197[0], setExportCSVEmail = _197[1];
|
|
653
|
+
var _198 = (0, react_1.useState)(((_4 = (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.exportSettings) === null || _4 === void 0 ? void 0 : _4.defaultExportPDFName) || ""), exportPDFTitle = _198[0], setExportPDFTitle = _198[1];
|
|
654
|
+
var _199 = (0, react_1.useState)(false), exportPDFLoading = _199[0], setExportPDFLoading = _199[1];
|
|
655
|
+
var _200 = (0, react_1.useState)(false), exportReadPDFLoading = _200[0], setExportReadPDFLoading = _200[1];
|
|
656
|
+
var _201 = (0, react_1.useState)((_7 = (_6 = (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.exportSettings) === null || _6 === void 0 ? void 0 : _6.sumColumnId) !== null && _7 !== void 0 ? _7 : []), exportSumAttributeIds = _201[0], setExportSumAttributeIds = _201[1];
|
|
657
|
+
var _202 = (0, react_1.useState)((_10 = (_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.exportSettings) === null || _9 === void 0 ? void 0 : _9.hideSubItems) !== null && _10 !== void 0 ? _10 : false), hideSubItems = _202[0], setHideSubItems = _202[1];
|
|
658
|
+
var _203 = (0, react_1.useState)([]), importTableData = _203[0], setImportTableData = _203[1];
|
|
659
|
+
var _204 = (0, react_1.useState)([]), queryList = _204[0], setQueryList = _204[1];
|
|
660
|
+
var _205 = (0, react_1.useState)(undefined), allQueryList = _205[0], setAllQueryList = _205[1];
|
|
623
661
|
// INFO: a restored state wins over the prop; its "" is a list the user
|
|
624
662
|
// ungrouped, so it opens ungrouped
|
|
625
|
-
var
|
|
663
|
+
var _206 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
|
|
626
664
|
? persistedState.groupBy || undefined
|
|
627
|
-
: (
|
|
665
|
+
: (_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.groupBy), groupId = _206[0], setGroupId = _206[1];
|
|
628
666
|
// INFO: each group's total per number column, keyed by section id
|
|
629
|
-
var
|
|
667
|
+
var _207 = (0, react_1.useState)({}), groupSummaries = _207[0], setGroupSummaries = _207[1];
|
|
630
668
|
// INFO: each group's row count over every row the filters match; null until
|
|
631
669
|
// read. A band paged alone shows it until its own first page lands, and a
|
|
632
670
|
// band it counts empty is left out instead of waiting to be read
|
|
633
|
-
var
|
|
671
|
+
var _208 = (0, react_1.useState)(null), groupTotals = _208[0], setGroupTotals = _208[1];
|
|
634
672
|
// INFO: the last read of groupTotals failed, so bands fall back to the rows
|
|
635
673
|
// loaded instead of waiting on a total that is not coming
|
|
636
|
-
var
|
|
674
|
+
var _209 = (0, react_1.useState)(false), groupTotalsFailed = _209[0], setGroupTotalsFailed = _209[1];
|
|
637
675
|
var groupSummaryRequestRef = (0, react_1.useRef)(0);
|
|
638
676
|
// INFO: the grouped count waiting to go out, so a filter change can stop it
|
|
639
677
|
// before it sends the filters it was scheduled with
|
|
640
678
|
var groupSummaryTimerRef = (0, react_1.useRef)(null);
|
|
641
|
-
var
|
|
679
|
+
var _210 = (0, react_1.useState)({}), commentCounts = _210[0], setCommentCounts = _210[1];
|
|
642
680
|
// INFO: Monday-board per-group paging. Keyed by the group key that
|
|
643
681
|
// handleBuildNewTableGroups() produces (an option, Unknown or No Value).
|
|
644
682
|
// Each group tracks its own loaded cursor + total so it can lazily load its
|
|
645
683
|
// next page as the user scrolls inside that band, independent of every other
|
|
646
684
|
// group. Only used when renderCheckGroupPaging() is true.
|
|
647
|
-
var
|
|
685
|
+
var _211 = (0, react_1.useState)({}), groupPageState = _211[0], setGroupPageState = _211[1];
|
|
648
686
|
// INFO: read fresh inside the async per-group fetch so chained scroll fires
|
|
649
687
|
// in one tick do not re-fetch an already in-flight page.
|
|
650
688
|
var groupPageStateRef = (0, react_1.useRef)({});
|
|
@@ -659,62 +697,62 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
659
697
|
var groupLoadingKeyRef = (0, react_1.useRef)(null);
|
|
660
698
|
var groupLoadQueueRef = (0, react_1.useRef)([]);
|
|
661
699
|
var handleFetchGroupNextPageRef = (0, react_1.useRef)(function () { });
|
|
662
|
-
var
|
|
663
|
-
var
|
|
700
|
+
var _212 = (0, react_1.useState)(""), readTabSection = _212[0], setReadTabSection = _212[1];
|
|
701
|
+
var _213 = (0, react_1.useState)(false), readFloatingNav = _213[0], setReadFloatingNav = _213[1];
|
|
664
702
|
var readTabSectionRefs = (0, react_1.useRef)({});
|
|
665
703
|
//INFO : Used by Read
|
|
666
704
|
//INFO : Used by Update
|
|
667
|
-
var
|
|
668
|
-
var
|
|
669
|
-
var
|
|
670
|
-
var
|
|
671
|
-
var
|
|
672
|
-
var
|
|
673
|
-
var
|
|
705
|
+
var _214 = (0, react_1.useState)(false), modalVisible = _214[0], setModalVisible = _214[1];
|
|
706
|
+
var _215 = (0, react_1.useState)(false), deleteModal = _215[0], setDeleteModal = _215[1];
|
|
707
|
+
var _216 = (0, react_1.useState)(false), excelModal = _216[0], setExcelModal = _216[1];
|
|
708
|
+
var _217 = (0, react_1.useState)(false), exportExcel = _217[0], setExportExcel = _217[1];
|
|
709
|
+
var _218 = (0, react_1.useState)(""), exportType = _218[0], setExportType = _218[1];
|
|
710
|
+
var _219 = (0, react_1.useState)(false), exportQR = _219[0], setExportQR = _219[1];
|
|
711
|
+
var _220 = (0, react_1.useState)(function () {
|
|
674
712
|
var _a, _b;
|
|
675
713
|
var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
|
|
676
714
|
return firstTabId;
|
|
677
|
-
}), activeTab =
|
|
678
|
-
var
|
|
679
|
-
var
|
|
680
|
-
var
|
|
681
|
-
var
|
|
682
|
-
var
|
|
683
|
-
var
|
|
684
|
-
var
|
|
715
|
+
}), activeTab = _220[0], setActiveTab = _220[1];
|
|
716
|
+
var _221 = (0, react_1.useState)(false), signatureSigning = _221[0], setSignatureSigning = _221[1];
|
|
717
|
+
var _222 = (0, react_1.useState)({}), selectedData = _222[0], setSelectedData = _222[1];
|
|
718
|
+
var _223 = (0, react_1.useState)(""), selectedObjectStructureId = _223[0], setSelectedObjectStructureId = _223[1];
|
|
719
|
+
var _224 = (0, react_1.useState)(""), selectedObjectId = _224[0], setSelectedObjectId = _224[1];
|
|
720
|
+
var _225 = (0, react_1.useState)(""), selectedListAddressId = _225[0], setSelectedListAddressId = _225[1];
|
|
721
|
+
var _226 = (0, react_1.useState)(-1), selectedListAddressIndex = _226[0], setSelectedListAddressIndex = _226[1];
|
|
722
|
+
var _227 = (0, react_1.useState)({
|
|
685
723
|
lat: 0,
|
|
686
724
|
lng: 0,
|
|
687
725
|
name: "",
|
|
688
|
-
}), selectedListAddress =
|
|
689
|
-
var
|
|
690
|
-
var
|
|
691
|
-
var
|
|
692
|
-
var
|
|
693
|
-
var
|
|
694
|
-
var
|
|
726
|
+
}), selectedListAddress = _227[0], setSelectedListAddress = _227[1];
|
|
727
|
+
var _228 = (0, react_1.useState)({}), selectedObjectData = _228[0], setSelectedObjectData = _228[1];
|
|
728
|
+
var _229 = (0, react_1.useState)(null), objectCellEdit = _229[0], setObjectCellEdit = _229[1];
|
|
729
|
+
var _230 = (0, react_1.useState)(false), referenceLoading = _230[0], setReferenceLoading = _230[1];
|
|
730
|
+
var _231 = (0, react_1.useState)({}), referencesOptions = _231[0], setReferencesOptions = _231[1];
|
|
731
|
+
var _232 = (0, react_1.useState)({}), referencesDetails = _232[0], setReferencesDetails = _232[1];
|
|
732
|
+
var _233 = (0, react_1.useState)({}), listReferencesOptions = _233[0], setListReferencesOptions = _233[1];
|
|
695
733
|
// INFO: the referenced records themselves, for a table cell that picks from
|
|
696
734
|
// a list on one (referenceSelection)
|
|
697
|
-
var
|
|
698
|
-
var
|
|
699
|
-
var
|
|
700
|
-
var
|
|
701
|
-
var
|
|
735
|
+
var _234 = (0, react_1.useState)({}), listReferencesDetails = _234[0], setListReferencesDetails = _234[1];
|
|
736
|
+
var _235 = (0, react_1.useState)({}), referenceDeleteTableData = _235[0], setReferenceDeleteTableData = _235[1];
|
|
737
|
+
var _236 = (0, react_1.useState)([]), relatedSections = _236[0], setRelatedSections = _236[1];
|
|
738
|
+
var _237 = (0, react_1.useState)(0), referenceDeleteIndex = _237[0], setReferenceDeleteIndex = _237[1];
|
|
739
|
+
var _238 = (0, react_1.useState)({
|
|
702
740
|
id: "",
|
|
703
741
|
name: "",
|
|
704
742
|
type: "string",
|
|
705
|
-
}), referenceCreationModal =
|
|
706
|
-
var
|
|
707
|
-
var
|
|
743
|
+
}), referenceCreationModal = _238[0], setReferenceCreationModal = _238[1];
|
|
744
|
+
var _239 = (0, react_1.useState)({}), referenceModelSchema = _239[0], setReferenceSchema = _239[1];
|
|
745
|
+
var _240 = (0, react_1.useState)([]), kanbanChecked = _240[0], setKanbanChecked = _240[1];
|
|
708
746
|
//INFO : Offline
|
|
709
|
-
var
|
|
710
|
-
var
|
|
747
|
+
var _241 = (0, react_1.useState)(0), offlineDataLength = _241[0], setOfflineDataLength = _241[1];
|
|
748
|
+
var _242 = (0, react_1.useState)(false), offlineModal = _242[0], setOfflineModal = _242[1];
|
|
711
749
|
// INFO: live-stream state — driven by socket connection and navigator.onLine
|
|
712
|
-
var
|
|
713
|
-
var
|
|
750
|
+
var _243 = (0, react_1.useState)(false), isLive = _243[0], setIsLive = _243[1];
|
|
751
|
+
var _244 = (0, react_1.useState)(false), isLiveOffline = _244[0], setIsLiveOffline = _244[1];
|
|
714
752
|
// INFO: true when navigator is offline — used to switch ReadQueryHoc between
|
|
715
753
|
// server reads (online, full pagination) and IndexedDB reads (offline, cached data).
|
|
716
754
|
// Independent of SSE status so it works even when bareSocketName is not set.
|
|
717
|
-
var
|
|
755
|
+
var _245 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _245[0], setIsNetworkOffline = _245[1];
|
|
718
756
|
var previousType = (0, react_1.useRef)(null);
|
|
719
757
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
720
758
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
@@ -864,7 +902,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
864
902
|
* viewId still wins when present: it is a deliberate destination, from a
|
|
865
903
|
* shared link or a back button.
|
|
866
904
|
*/
|
|
867
|
-
var defaultTabName = (
|
|
905
|
+
var defaultTabName = (_14 = (_13 = (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.extendedTabs) === null || _13 === void 0 ? void 0 : _13.find(function (eachTab) { return eachTab.defaultTab; })) === null || _14 === void 0 ? void 0 : _14.name;
|
|
868
906
|
// INFO: the pinned tab is a LIST destination. Falling back to it while a
|
|
869
907
|
// record is open resolved the read view to a list tab, which renderTabContent
|
|
870
908
|
// refuses — so General Details rendered nothing. Only a list falls back.
|
|
@@ -876,14 +914,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
876
914
|
// INFO: Firestore reads and the monday wrapper join every condition with AND
|
|
877
915
|
// (monday flattens all ORs into one), so a flex OR group is offered on Mongo only
|
|
878
916
|
var isFlexOrSupported = !isFirebase && devSettings.server !== "mondayServer";
|
|
879
|
-
var isDateWarnings = !!((
|
|
880
|
-
var isDatasheetDefaults = !!((
|
|
917
|
+
var isDateWarnings = !!((_15 = props.organise) === null || _15 === void 0 ? void 0 : _15.dateWarnings);
|
|
918
|
+
var isDatasheetDefaults = !!((_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.datasheetDefaults);
|
|
881
919
|
// INFO: the columns as the views draw them — with datasheet defaults every
|
|
882
920
|
// list option without a colour takes the palette colour of its position
|
|
883
921
|
var displayStructure = isDatasheetDefaults
|
|
884
922
|
? (0, defaultColours_1.handleApplyDefaultColours)(structure)
|
|
885
923
|
: structure;
|
|
886
|
-
var dbModule = isFirebaseClient ? (
|
|
924
|
+
var dbModule = isFirebaseClient ? (_17 = props.lib) === null || _17 === void 0 ? void 0 : _17.firebase : (_18 = props.lib) === null || _18 === void 0 ? void 0 : _18.axios;
|
|
887
925
|
var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
|
|
888
926
|
var selectedRelated = resolvedType === "read"
|
|
889
927
|
? relatedSections.find(function (eachSection) { return eachSection.id === viewType; })
|
|
@@ -1049,32 +1087,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1049
1087
|
}, [
|
|
1050
1088
|
resolvedType,
|
|
1051
1089
|
props.id,
|
|
1052
|
-
(
|
|
1090
|
+
(_19 = props.space) === null || _19 === void 0 ? void 0 : _19._id,
|
|
1053
1091
|
props.devSettings.schemaEndpoint,
|
|
1054
|
-
(
|
|
1092
|
+
(_20 = props.organise) === null || _20 === void 0 ? void 0 : _20.showRelatedTab,
|
|
1055
1093
|
]);
|
|
1056
1094
|
/* eslint-enable */
|
|
1057
1095
|
// INFO: the view settings panel (columns, sort, rows per page) is standard on
|
|
1058
1096
|
// the new DTW; bareViewSettings stays the opt-in for legacy and bare DTWs
|
|
1059
|
-
var isViewSettingsEnabled = ((
|
|
1097
|
+
var isViewSettingsEnabled = ((_21 = props.bareSettings) === null || _21 === void 0 ? void 0 : _21.bareViewSettings) || ((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareNewDTW)
|
|
1060
1098
|
? true
|
|
1061
1099
|
: false;
|
|
1062
1100
|
// INFO: a consumer that wires onChangeHide owns the hide at schema level
|
|
1063
1101
|
// (shared by every user) — toggling writes to the model and calls back. Without it
|
|
1064
1102
|
// the hide is this user's own and lives in userHiddenColumnIds.
|
|
1065
|
-
var isSchemaHideMode = ((
|
|
1103
|
+
var isSchemaHideMode = ((_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.onChangeHide) ? true : false;
|
|
1066
1104
|
// INFO: rows per page is a view setting the user can change, so it starts from
|
|
1067
1105
|
// the persisted value and falls back to the consumer's limit
|
|
1068
|
-
var
|
|
1106
|
+
var _246 = (0, react_1.useState)((_25 = (_24 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _24 !== void 0 ? _24 : props.limit) !== null && _25 !== void 0 ? _25 : 10), pageLimit = _246[0], setPageLimit = _246[1];
|
|
1069
1107
|
var limit = pageLimit;
|
|
1070
|
-
var isSavedViewsEnabled = !!((
|
|
1108
|
+
var isSavedViewsEnabled = !!((_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.savedViews) && resolvedType === "list";
|
|
1071
1109
|
// INFO: an app that stores views takes over from this browser's storage, so
|
|
1072
1110
|
// every view is the team's and nothing is kept locally
|
|
1073
|
-
var isAppViews = ((
|
|
1074
|
-
!!((
|
|
1111
|
+
var isAppViews = ((_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.sharedViews) !== undefined ||
|
|
1112
|
+
!!((_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.onChangeSharedViews);
|
|
1075
1113
|
// INFO: a saved view carries its sort, so the sort is held here as with persistViewState
|
|
1076
1114
|
var isInternalSort = isPersistEnabled || isSavedViewsEnabled;
|
|
1077
|
-
var activeSortId = (isInternalSort && persistedSort) || ((
|
|
1115
|
+
var activeSortId = (isInternalSort && persistedSort) || ((_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.sort);
|
|
1078
1116
|
var handleSortColumn = function (value) {
|
|
1079
1117
|
var _a, _b, _c, _d;
|
|
1080
1118
|
if (isInternalSort)
|
|
@@ -1104,7 +1142,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1104
1142
|
// INFO: Firebase pages by document cursor and a union by skip, so neither
|
|
1105
1143
|
// can hand over the whole set — there formula columns are not offered for
|
|
1106
1144
|
// sorting or filtering, rather than ordering one page
|
|
1107
|
-
var isFormulaViewSupported = !isFirebase && !((
|
|
1145
|
+
var isFormulaViewSupported = !isFirebase && !((_31 = (_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.unionCollections) === null || _31 === void 0 ? void 0 : _31.length);
|
|
1108
1146
|
var formulaSort = isFormulaViewSupported &&
|
|
1109
1147
|
(activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) &&
|
|
1110
1148
|
formulaColumnIds.includes(activeSortId.sortId)
|
|
@@ -1115,12 +1153,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1115
1153
|
// a union read runs them
|
|
1116
1154
|
// INFO: a people filter's "me" needs only who is signed in, which any
|
|
1117
1155
|
// backend can match
|
|
1118
|
-
var currentUserId = (
|
|
1119
|
-
var flexFilterExtras = !isFirebase && !((
|
|
1156
|
+
var currentUserId = (_32 = props.devSettings.currentUser) === null || _32 === void 0 ? void 0 : _32.userId;
|
|
1157
|
+
var flexFilterExtras = !isFirebase && !((_34 = (_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.unionCollections) === null || _34 === void 0 ? void 0 : _34.length)
|
|
1120
1158
|
? {
|
|
1121
|
-
references: (
|
|
1122
|
-
listObjects: (
|
|
1123
|
-
related: (
|
|
1159
|
+
references: (_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareFlexFilterReferences,
|
|
1160
|
+
listObjects: (_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareFlexFilterListObjects,
|
|
1161
|
+
related: (_37 = props.bareSettings) === null || _37 === void 0 ? void 0 : _37.bareFlexFilterRelated,
|
|
1124
1162
|
currentUserId: currentUserId,
|
|
1125
1163
|
}
|
|
1126
1164
|
: currentUserId
|
|
@@ -1212,18 +1250,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1212
1250
|
displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
|
|
1213
1251
|
};
|
|
1214
1252
|
};
|
|
1215
|
-
var
|
|
1216
|
-
var isEditor = ((
|
|
1217
|
-
var isOffline = (
|
|
1253
|
+
var _247 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _247.canUpdateRecord, canInlineUpdate = _247.canInlineUpdate, canBatchUpdate = _247.canBatchUpdate, canDeleteRecord = _247.canDeleteRecord;
|
|
1254
|
+
var isEditor = ((_38 = props.edit) === null || _38 === void 0 ? void 0 : _38.allEditable) ? true : false;
|
|
1255
|
+
var isOffline = (_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareOffline;
|
|
1218
1256
|
// INFO: when bareOfflineNetworkAware is true, the save path is also gated on
|
|
1219
1257
|
// the live network state — online saves go to the server even if bareOffline
|
|
1220
1258
|
// is true, offline saves go to IDB as normal.
|
|
1221
|
-
var isOfflineNetworkListener = isOffline && ((
|
|
1222
|
-
var showId = (
|
|
1259
|
+
var isOfflineNetworkListener = isOffline && ((_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.bareOfflineNetworkListener);
|
|
1260
|
+
var showId = (_41 = props.space) === null || _41 === void 0 ? void 0 : _41.showId;
|
|
1223
1261
|
var remainId = showId || selectedObjectStructureId ? true : false;
|
|
1224
|
-
var idField = ((
|
|
1225
|
-
var pipeline = (
|
|
1226
|
-
if ((
|
|
1262
|
+
var idField = ((_42 = props.space) === null || _42 === void 0 ? void 0 : _42.idField) || ((_43 = props.organise) === null || _43 === void 0 ? void 0 : _43.idField);
|
|
1263
|
+
var pipeline = (_44 = props === null || props === void 0 ? void 0 : props.space) === null || _44 === void 0 ? void 0 : _44.pipeline;
|
|
1264
|
+
if ((_45 = props.bareSettings) === null || _45 === void 0 ? void 0 : _45.bareListPipeline) {
|
|
1227
1265
|
pipeline = pipeline
|
|
1228
1266
|
? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
|
|
1229
1267
|
}
|
|
@@ -1236,30 +1274,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1236
1274
|
* three records came back instead of five files, and each tile received the
|
|
1237
1275
|
* whole array rather than one file, so every one of them read "Attachment".
|
|
1238
1276
|
*/
|
|
1239
|
-
var fileViewColumnId = (
|
|
1277
|
+
var fileViewColumnId = (_49 = (_48 = ((_47 = (_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.extendedTabs) !== null && _47 !== void 0 ? _47 : []).find(function (eachTab) {
|
|
1240
1278
|
return eachTab.viewType === "file" &&
|
|
1241
1279
|
(0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
|
|
1242
|
-
})) === null ||
|
|
1243
|
-
var hasNavigation = ((
|
|
1280
|
+
})) === null || _48 === void 0 ? void 0 : _48.fileSettings) === null || _49 === void 0 ? void 0 : _49.columnId;
|
|
1281
|
+
var hasNavigation = ((_50 = props.organise) === null || _50 === void 0 ? void 0 : _50.handleNavigate) ? true : false;
|
|
1244
1282
|
var formColumn = "grid-cols-12";
|
|
1245
|
-
var useMobileView = (
|
|
1283
|
+
var useMobileView = (_52 = (_51 = props.bareSettings) === null || _51 === void 0 ? void 0 : _51.bareUpdateMobileView) !== null && _52 !== void 0 ? _52 : false;
|
|
1246
1284
|
var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
|
|
1247
|
-
var isActivityLog = (((
|
|
1248
|
-
((
|
|
1249
|
-
(((
|
|
1250
|
-
((
|
|
1285
|
+
var isActivityLog = (((_54 = (_53 = props.edit) === null || _53 === void 0 ? void 0 : _53.activityLog) === null || _54 === void 0 ? void 0 : _54.enableComments) &&
|
|
1286
|
+
((_55 = props.edit) === null || _55 === void 0 ? void 0 : _55.activityLog.commentCollectionId)) ||
|
|
1287
|
+
(((_57 = (_56 = props.edit) === null || _56 === void 0 ? void 0 : _56.activityLog) === null || _57 === void 0 ? void 0 : _57.enableLogs) &&
|
|
1288
|
+
((_58 = props.edit) === null || _58 === void 0 ? void 0 : _58.activityLog.logsCollectionId));
|
|
1251
1289
|
// INFO: a record's comments and logs shown in place of the record rather than
|
|
1252
1290
|
// in a drawer of their own — a related tab already sits inside the read
|
|
1253
1291
|
// drawer, and a second drawer over it hid the row being discussed. It opens
|
|
1254
1292
|
// the row through handleNavigate, so without one it stays off and the
|
|
1255
1293
|
// drawer is used, rather than leaving a comment button that does nothing
|
|
1256
1294
|
var isInlineActivity = !!isActivityLog &&
|
|
1257
|
-
!!((
|
|
1295
|
+
!!((_59 = props.bareSettings) === null || _59 === void 0 ? void 0 : _59.bareInlineActivity) &&
|
|
1258
1296
|
hasNavigation;
|
|
1259
1297
|
// INFO: each row button opens what it shows: the comment button the row's
|
|
1260
1298
|
// comments and logs alone, the eye (or the row) its details alone, so
|
|
1261
1299
|
// neither has to be scrolled past to reach the other
|
|
1262
|
-
var
|
|
1300
|
+
var _248 = (0, react_1.useState)(false), inlineActivityOnly = _248[0], setInlineActivityOnly = _248[1];
|
|
1263
1301
|
var isActivityOnly = isInlineActivity && inlineActivityOnly;
|
|
1264
1302
|
// INFO: the row whose comments were shown; going back to the list asks its
|
|
1265
1303
|
// comment count again, as the drawer does when it closes
|
|
@@ -1298,12 +1336,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1298
1336
|
// column
|
|
1299
1337
|
recordTitleColumn: (_d = ((_c = (_b = structure.find(function (eachDS) { return eachDS.id === "title"; })) !== null && _b !== void 0 ? _b : structure.find(function (eachDS) { return eachDS.id === "name"; })) !== null && _c !== void 0 ? _c : structure.find(function (eachDS) { return eachDS.type === "string"; }))) === null || _d === void 0 ? void 0 : _d.id, model: structure }));
|
|
1300
1338
|
};
|
|
1301
|
-
var customPaginationSize = ((
|
|
1339
|
+
var customPaginationSize = ((_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.customPaginationCount)
|
|
1302
1340
|
? props.organise.customPaginationCount(size)
|
|
1303
1341
|
: undefined;
|
|
1304
1342
|
//TODO : Code - Pass ...devSettings, search dbEndpoint:
|
|
1305
1343
|
var writeServerQuery = new writeQuery_1.WriteQuery({
|
|
1306
|
-
dbModule: (
|
|
1344
|
+
dbModule: (_61 = props.lib) === null || _61 === void 0 ? void 0 : _61.axios,
|
|
1307
1345
|
dbType: devSettings.server,
|
|
1308
1346
|
dbCollection: props.collectionId,
|
|
1309
1347
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -1311,7 +1349,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1311
1349
|
dbUserToken: devSettings.dbUserToken,
|
|
1312
1350
|
});
|
|
1313
1351
|
var readServerQuery = new readQuery_1.ReadQuery({
|
|
1314
|
-
dbModule: (
|
|
1352
|
+
dbModule: (_62 = props.lib) === null || _62 === void 0 ? void 0 : _62.axios,
|
|
1315
1353
|
dbType: devSettings.server,
|
|
1316
1354
|
dbCollection: props.collectionId,
|
|
1317
1355
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -1319,12 +1357,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1319
1357
|
dbUserToken: devSettings.dbUserToken,
|
|
1320
1358
|
});
|
|
1321
1359
|
var moreButtonPopUp = [
|
|
1322
|
-
((
|
|
1360
|
+
((_63 = props.edit) === null || _63 === void 0 ? void 0 : _63.allEditable) &&
|
|
1323
1361
|
// INFO: the import runs on the server (importEndpoint), so a Firestore
|
|
1324
1362
|
// datasheet served through one can import; only the browser-direct
|
|
1325
1363
|
// Firebase client has no server to import through
|
|
1326
1364
|
!isFirebaseClient &&
|
|
1327
|
-
!((
|
|
1365
|
+
!((_65 = (_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.exportSettings) === null || _65 === void 0 ? void 0 : _65.hideImportCSV)
|
|
1328
1366
|
? {
|
|
1329
1367
|
text: "Import Excel",
|
|
1330
1368
|
onClick: function () {
|
|
@@ -1333,7 +1371,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1333
1371
|
},
|
|
1334
1372
|
}
|
|
1335
1373
|
: null,
|
|
1336
|
-
!((
|
|
1374
|
+
!((_67 = (_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.exportSettings) === null || _67 === void 0 ? void 0 : _67.hideExportCSV)
|
|
1337
1375
|
? {
|
|
1338
1376
|
text: "Export CSV",
|
|
1339
1377
|
onClick: function () {
|
|
@@ -1343,7 +1381,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1343
1381
|
},
|
|
1344
1382
|
}
|
|
1345
1383
|
: null,
|
|
1346
|
-
!((
|
|
1384
|
+
!((_69 = (_68 = props.organise) === null || _68 === void 0 ? void 0 : _68.exportSettings) === null || _69 === void 0 ? void 0 : _69.hideExportExcel)
|
|
1347
1385
|
? {
|
|
1348
1386
|
text: "Export Excel",
|
|
1349
1387
|
onClick: function () {
|
|
@@ -1353,7 +1391,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1353
1391
|
},
|
|
1354
1392
|
}
|
|
1355
1393
|
: null,
|
|
1356
|
-
!((
|
|
1394
|
+
!((_71 = (_70 = props.organise) === null || _70 === void 0 ? void 0 : _70.exportSettings) === null || _71 === void 0 ? void 0 : _71.hideExportPDF)
|
|
1357
1395
|
? {
|
|
1358
1396
|
text: "Export PDF",
|
|
1359
1397
|
onClick: function () {
|
|
@@ -1363,7 +1401,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1363
1401
|
},
|
|
1364
1402
|
}
|
|
1365
1403
|
: null,
|
|
1366
|
-
!((
|
|
1404
|
+
!((_73 = (_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.exportSettings) === null || _73 === void 0 ? void 0 : _73.hideExportQR)
|
|
1367
1405
|
? {
|
|
1368
1406
|
text: "Export QR",
|
|
1369
1407
|
onClick: function () {
|
|
@@ -1373,7 +1411,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1373
1411
|
},
|
|
1374
1412
|
}
|
|
1375
1413
|
: null,
|
|
1376
|
-
!((
|
|
1414
|
+
!((_75 = (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.exportSettings) === null || _75 === void 0 ? void 0 : _75.hideExportQR)
|
|
1377
1415
|
? {
|
|
1378
1416
|
text: "Export QR(Data)",
|
|
1379
1417
|
onClick: function () {
|
|
@@ -1383,7 +1421,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1383
1421
|
},
|
|
1384
1422
|
}
|
|
1385
1423
|
: null,
|
|
1386
|
-
!((
|
|
1424
|
+
!((_77 = (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.exportSettings) === null || _77 === void 0 ? void 0 : _77.hideExportPrint)
|
|
1387
1425
|
? {
|
|
1388
1426
|
text: "Print",
|
|
1389
1427
|
onClick: function () {
|
|
@@ -1395,8 +1433,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1395
1433
|
: null,
|
|
1396
1434
|
// INFO: drafts only exist where the form can save one, so the filter has
|
|
1397
1435
|
// nothing to find on any other page
|
|
1398
|
-
((
|
|
1399
|
-
!((
|
|
1436
|
+
((_78 = props.edit) === null || _78 === void 0 ? void 0 : _78.enableUpdateDraft) &&
|
|
1437
|
+
!((_80 = (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.exportSettings) === null || _80 === void 0 ? void 0 : _80.hideExportDraft)
|
|
1400
1438
|
? {
|
|
1401
1439
|
text: filterDraft ? "Show All Items" : "Filter Draft",
|
|
1402
1440
|
onClick: function () {
|
|
@@ -1405,7 +1443,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1405
1443
|
}
|
|
1406
1444
|
: null,
|
|
1407
1445
|
].filter(Boolean);
|
|
1408
|
-
if ((
|
|
1446
|
+
if ((_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.moreSettings)
|
|
1409
1447
|
moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
|
|
1410
1448
|
//=====================================================================================
|
|
1411
1449
|
//SECTION: User Column Visibility Handlers
|
|
@@ -1850,14 +1888,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1850
1888
|
//=====================================================================================
|
|
1851
1889
|
//SECTION: Saved Views
|
|
1852
1890
|
//=====================================================================================
|
|
1853
|
-
var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (
|
|
1891
|
+
var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.persistKey, (_83 = devSettings.currentUser) === null || _83 === void 0 ? void 0 : _83.userEmail);
|
|
1854
1892
|
(0, react_1.useEffect)(function () {
|
|
1855
1893
|
if (isSavedViewsEnabled && !isAppViews)
|
|
1856
1894
|
setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
|
|
1857
1895
|
}, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
|
|
1858
1896
|
// INFO: the app keeps All's settings, so every change is kept in this
|
|
1859
1897
|
// browser until the person updates the view for everyone or resets it
|
|
1860
|
-
var isViewDraftsEnabled = isSavedViewsEnabled && ((
|
|
1898
|
+
var isViewDraftsEnabled = isSavedViewsEnabled && ((_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.allView) !== undefined;
|
|
1861
1899
|
var handleGetViewDraftKey = function (viewId) {
|
|
1862
1900
|
var _a, _b;
|
|
1863
1901
|
return (0, viewStatePersistence_1.buildViewDraftKey)(props.collectionId, viewId !== null && viewId !== void 0 ? viewId : "all", (_a = props.organise) === null || _a === void 0 ? void 0 : _a.persistKey, (_b = devSettings.currentUser) === null || _b === void 0 ? void 0 : _b.userEmail);
|
|
@@ -1941,7 +1979,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1941
1979
|
var lastSentSharedViewsRef = (0, react_1.useRef)(null);
|
|
1942
1980
|
(0, react_1.useEffect)(function () {
|
|
1943
1981
|
lastSentSharedViewsRef.current = null;
|
|
1944
|
-
}, [(
|
|
1982
|
+
}, [(_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.sharedViews]);
|
|
1945
1983
|
var handleStoreSharedViews = function (update) {
|
|
1946
1984
|
var _a, _b, _c;
|
|
1947
1985
|
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
|
|
@@ -1957,15 +1995,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1957
1995
|
// longer exists, or is on another tab, leaves the list on All.
|
|
1958
1996
|
var openingViewSettledRef = (0, react_1.useRef)(false);
|
|
1959
1997
|
(0, react_1.useEffect)(function () {
|
|
1960
|
-
var _a, _b, _c, _d;
|
|
1998
|
+
var _a, _b, _c, _d, _e;
|
|
1961
1999
|
if (!isSavedViewsEnabled || openingViewSettledRef.current)
|
|
1962
2000
|
return;
|
|
2001
|
+
// INFO: a link opens on All with only its keyword, never on a ★ view
|
|
2002
|
+
if (isLinkOpen && ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSearch)) {
|
|
2003
|
+
openingViewSettledRef.current = true;
|
|
2004
|
+
handleApplySavedView(null, true, props.organise.initialSearch);
|
|
2005
|
+
setIsViewDraftReady(true);
|
|
2006
|
+
return;
|
|
2007
|
+
}
|
|
1963
2008
|
if (activeSavedViewId !== null || (isPersistEnabled && rawPersistedState)) {
|
|
1964
2009
|
openingViewSettledRef.current = true;
|
|
1965
2010
|
setIsViewDraftReady(true);
|
|
1966
2011
|
return;
|
|
1967
2012
|
}
|
|
1968
|
-
var wantedId = (
|
|
2013
|
+
var wantedId = (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.initialSavedViewId) !== null && _c !== void 0 ? _c : (_d = props.organise) === null || _d === void 0 ? void 0 : _d.defaultSavedViewId;
|
|
1969
2014
|
if (!wantedId) {
|
|
1970
2015
|
// INFO: All opens with its stored settings and this person's changes
|
|
1971
2016
|
if (isViewDraftsEnabled) {
|
|
@@ -1976,7 +2021,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1976
2021
|
return;
|
|
1977
2022
|
}
|
|
1978
2023
|
// INFO: the app's views may still be loading
|
|
1979
|
-
if (isAppViews && ((
|
|
2024
|
+
if (isAppViews && ((_e = props.organise) === null || _e === void 0 ? void 0 : _e.sharedViews) === undefined)
|
|
1980
2025
|
return;
|
|
1981
2026
|
openingViewSettledRef.current = true;
|
|
1982
2027
|
var view = handleGetTabSavedViews().find(function (eachView) { return eachView.id === wantedId; });
|
|
@@ -1986,13 +2031,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1986
2031
|
/* eslint-disable */
|
|
1987
2032
|
}, [
|
|
1988
2033
|
isSavedViewsEnabled,
|
|
1989
|
-
(
|
|
1990
|
-
(
|
|
1991
|
-
(
|
|
2034
|
+
(_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.initialSavedViewId,
|
|
2035
|
+
(_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.defaultSavedViewId,
|
|
2036
|
+
(_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.sharedViews,
|
|
1992
2037
|
savedViews,
|
|
1993
2038
|
]);
|
|
1994
2039
|
/* eslint-enable */
|
|
1995
|
-
var defaultSavedViewIds = ((
|
|
2040
|
+
var defaultSavedViewIds = ((_90 = (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.defaultSavedViews) !== null && _90 !== void 0 ? _90 : [])
|
|
1996
2041
|
.map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
|
|
1997
2042
|
.join("|");
|
|
1998
2043
|
// INFO: keyed on the ids, not the array, so an inline literal passed on every
|
|
@@ -2068,37 +2113,57 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2068
2113
|
// INFO: isOpening — the list opening on a view tells the host nothing new,
|
|
2069
2114
|
// so its sort is not handed back (a host saving sort would write it on
|
|
2070
2115
|
// every open)
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2116
|
+
// INFO: linkSearch — the list opens as a fresh datasheet with only that
|
|
2117
|
+
// keyword: All's columns and sort, none of its filters, and no draft.
|
|
2118
|
+
// restoredState — the state persistViewState kept, applied in place of a view
|
|
2119
|
+
var handleApplySavedView = function (view, isOpening, linkSearch, restoredState) {
|
|
2120
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
2121
|
+
var next;
|
|
2122
|
+
if (linkSearch) {
|
|
2123
|
+
// INFO: the filter keys are left out, not set to undefined, so the
|
|
2124
|
+
// app's own additionalQuery defaults still apply
|
|
2125
|
+
var _y = (_a = handleGetStoredViewState(null)) !== null && _a !== void 0 ? _a : {}, _search = _y.filterSearchParams, _selection = _y.filterSelection, _reference = _y.filterReference, _date = _y.filterReferenceDate, _flex = _y.flexFilters, allLayout = __rest(_y, ["filterSearchParams", "filterSelection", "filterReference", "filterReferenceDate", "flexFilters"]);
|
|
2126
|
+
next = handleResolveViewState(allLayout);
|
|
2127
|
+
next = __assign(__assign({}, next), { filterSearchParams: __assign(__assign({}, next.filterSearchParams), { search: linkSearch }) });
|
|
2128
|
+
}
|
|
2129
|
+
else if (restoredState) {
|
|
2130
|
+
next = handleResolveViewState(restoredState);
|
|
2131
|
+
}
|
|
2132
|
+
else {
|
|
2133
|
+
// INFO: the stored view, or this person's unsaved changes to it
|
|
2134
|
+
next = handleResolveViewState((_c = (isViewDraftsEnabled
|
|
2135
|
+
? (0, viewStatePersistence_1.handleReadViewDraft)(handleGetViewDraftKey((_b = view === null || view === void 0 ? void 0 : view.id) !== null && _b !== void 0 ? _b : null))
|
|
2136
|
+
: null)) !== null && _c !== void 0 ? _c : handleGetStoredViewState(view));
|
|
2137
|
+
}
|
|
2138
|
+
// INFO: picking a view is the person's own choice, so their browser's
|
|
2139
|
+
// drafts and persisted state apply again
|
|
2140
|
+
if (!isOpening)
|
|
2141
|
+
setIsLinkOpen(false);
|
|
2077
2142
|
var isQueryChanged = !(0, viewStatePersistence_1.handleIsSameViewState)((0, viewStatePersistence_1.handlePickQueryState)(handleBuildViewSnapshot()), (0, viewStatePersistence_1.handlePickQueryState)(next));
|
|
2078
2143
|
handleClearFlexFilterTypingTimeout();
|
|
2079
2144
|
if (typingTimeout.current) {
|
|
2080
2145
|
clearTimeout(typingTimeout.current);
|
|
2081
2146
|
typingTimeout.current = null;
|
|
2082
2147
|
}
|
|
2083
|
-
setFilterSearch((
|
|
2084
|
-
setFilterSearchParams((
|
|
2085
|
-
setFilterSelection(((
|
|
2086
|
-
setFilterReference(((
|
|
2148
|
+
setFilterSearch((_d = next.filterSearchParams) !== null && _d !== void 0 ? _d : {});
|
|
2149
|
+
setFilterSearchParams((_e = next.filterSearchParams) !== null && _e !== void 0 ? _e : {});
|
|
2150
|
+
setFilterSelection(((_f = next.filterSelection) !== null && _f !== void 0 ? _f : {}));
|
|
2151
|
+
setFilterReference(((_g = next.filterReference) !== null && _g !== void 0 ? _g : {}));
|
|
2087
2152
|
setFilterReferenceDate(next.filterReferenceDate
|
|
2088
2153
|
? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
|
|
2089
2154
|
: initialFilterReferenceDate);
|
|
2090
|
-
handleCommitFlexFilters(((
|
|
2155
|
+
handleCommitFlexFilters(((_h = next.flexFilters) === null || _h === void 0 ? void 0 : _h.length) ? next.flexFilters : defaultFlexFilterRow);
|
|
2091
2156
|
setPersistedSort(next.sort);
|
|
2092
2157
|
if (!isOpening &&
|
|
2093
2158
|
next.sort &&
|
|
2094
2159
|
!(0, viewStatePersistence_1.handleIsSameViewState)(next.sort, activeSortId !== null && activeSortId !== void 0 ? activeSortId : {}))
|
|
2095
|
-
(
|
|
2160
|
+
(_k = (_j = props.organise) === null || _j === void 0 ? void 0 : _j.onChangeSort) === null || _k === void 0 ? void 0 : _k.call(_j, next.sort);
|
|
2096
2161
|
if (next.pageLimit)
|
|
2097
2162
|
setPageLimit(next.pageLimit);
|
|
2098
|
-
handleChangeGroupBy((
|
|
2099
|
-
setUserHiddenColumnIds((
|
|
2100
|
-
setShownSystemColumnIds((
|
|
2101
|
-
setColumnWidths((
|
|
2163
|
+
handleChangeGroupBy((_l = next.groupBy) !== null && _l !== void 0 ? _l : "", !isOpening);
|
|
2164
|
+
setUserHiddenColumnIds((_m = next.userHiddenColumnIds) !== null && _m !== void 0 ? _m : []);
|
|
2165
|
+
setShownSystemColumnIds((_o = next.shownSystemColumnIds) !== null && _o !== void 0 ? _o : []);
|
|
2166
|
+
setColumnWidths((_p = next.columnWidths) !== null && _p !== void 0 ? _p : {});
|
|
2102
2167
|
setPinnedColumnIds(next.pinnedColumnIds);
|
|
2103
2168
|
if (view) {
|
|
2104
2169
|
if (!schemaStructureRef.current)
|
|
@@ -2114,12 +2179,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2114
2179
|
pendingViewCondKeyRef.current = JSON.stringify(handleReadQueryHocCond());
|
|
2115
2180
|
handleClearDataByFilter();
|
|
2116
2181
|
if (pageIndex !== 0)
|
|
2117
|
-
(
|
|
2118
|
-
(
|
|
2182
|
+
(_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.onChangePagination) === null || _r === void 0 ? void 0 : _r.call(_q, 0);
|
|
2183
|
+
(_t = (_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareListHandleFilter) === null || _t === void 0 ? void 0 : _t.call(_s, (_u = next.filterSearchParams) !== null && _u !== void 0 ? _u : {}, (_v = next.filterSelection) !== null && _v !== void 0 ? _v : {}, next.filterReferenceDate
|
|
2119
2184
|
? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
|
|
2120
|
-
: initialFilterReferenceDate, (
|
|
2185
|
+
: initialFilterReferenceDate, (_w = next.filterReference) !== null && _w !== void 0 ? _w : {});
|
|
2121
2186
|
}
|
|
2122
|
-
setActiveSavedViewId((
|
|
2187
|
+
setActiveSavedViewId((_x = view === null || view === void 0 ? void 0 : view.id) !== null && _x !== void 0 ? _x : null);
|
|
2123
2188
|
setDeletingSavedViewId(null);
|
|
2124
2189
|
};
|
|
2125
2190
|
// INFO: re-read storage before each write so a change made in another browser
|
|
@@ -2316,7 +2381,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2316
2381
|
// person's own until they update or reset it; back on the stored settings,
|
|
2317
2382
|
// nothing is kept
|
|
2318
2383
|
(0, react_1.useEffect)(function () {
|
|
2319
|
-
if (!isViewDraftsEnabled || !isViewDraftReady)
|
|
2384
|
+
if (!isViewDraftsEnabled || !isViewDraftReady || isLinkOpen)
|
|
2320
2385
|
return;
|
|
2321
2386
|
var activeView = activeSavedViewId
|
|
2322
2387
|
? handleGetTabSavedViews().find(function (eachView) { return eachView.id === activeSavedViewId; })
|
|
@@ -2331,6 +2396,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2331
2396
|
}, [
|
|
2332
2397
|
isViewDraftsEnabled,
|
|
2333
2398
|
isViewDraftReady,
|
|
2399
|
+
isLinkOpen,
|
|
2334
2400
|
activeSavedViewId,
|
|
2335
2401
|
filterSearchParams,
|
|
2336
2402
|
filterSelection,
|
|
@@ -2345,8 +2411,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2345
2411
|
groupId,
|
|
2346
2412
|
columnWidths,
|
|
2347
2413
|
pinnedColumnIds,
|
|
2348
|
-
(
|
|
2349
|
-
(
|
|
2414
|
+
(_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.allView,
|
|
2415
|
+
(_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.sharedViews,
|
|
2350
2416
|
savedViews,
|
|
2351
2417
|
]);
|
|
2352
2418
|
/* eslint-enable */
|
|
@@ -2390,7 +2456,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2390
2456
|
if (scrollRestoredRef.current)
|
|
2391
2457
|
scrollCatchUpRef.current = null;
|
|
2392
2458
|
/* eslint-disable */
|
|
2393
|
-
}, [props.collectionId, (
|
|
2459
|
+
}, [props.collectionId, (_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.persistKey]);
|
|
2394
2460
|
/* eslint-enable */
|
|
2395
2461
|
// INFO: wait a frame — rows land in state one tick before layout
|
|
2396
2462
|
(0, react_1.useEffect)(function () {
|
|
@@ -2425,7 +2491,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2425
2491
|
(0, react_1.useEffect)(function () {
|
|
2426
2492
|
handleOfflinePrefetch();
|
|
2427
2493
|
/* eslint-disable */
|
|
2428
|
-
}, [props.collectionId, (
|
|
2494
|
+
}, [props.collectionId, (_94 = props.bareSettings) === null || _94 === void 0 ? void 0 : _94.bareOffline]);
|
|
2429
2495
|
/* eslint-enable */
|
|
2430
2496
|
// INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
|
|
2431
2497
|
// Calls through handleRefreshRef so the interval always dispatches the latest
|
|
@@ -2445,7 +2511,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2445
2511
|
}, interval);
|
|
2446
2512
|
return function () { return clearInterval(timer); };
|
|
2447
2513
|
/* eslint-disable */
|
|
2448
|
-
}, [(
|
|
2514
|
+
}, [(_95 = props.bareSettings) === null || _95 === void 0 ? void 0 : _95.barePollingInterval, isLive, isNetworkOffline]);
|
|
2449
2515
|
/* eslint-enable */
|
|
2450
2516
|
// INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
|
|
2451
2517
|
// EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
|
|
@@ -2487,7 +2553,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2487
2553
|
};
|
|
2488
2554
|
/* eslint-disable */
|
|
2489
2555
|
}, [
|
|
2490
|
-
(
|
|
2556
|
+
(_96 = props.bareSettings) === null || _96 === void 0 ? void 0 : _96.bareSocketName,
|
|
2491
2557
|
props.collectionId,
|
|
2492
2558
|
props.devSettings.sseEndpoint,
|
|
2493
2559
|
props.devSettings.dbAPIToken,
|
|
@@ -2761,10 +2827,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2761
2827
|
props.collectionId,
|
|
2762
2828
|
props.model,
|
|
2763
2829
|
props.localURLEndpoint,
|
|
2764
|
-
(
|
|
2830
|
+
(_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.extendedTabs,
|
|
2765
2831
|
listViewId,
|
|
2766
|
-
(
|
|
2767
|
-
(
|
|
2832
|
+
(_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.additionalQuery,
|
|
2833
|
+
(_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.groupBy,
|
|
2768
2834
|
resolvedType,
|
|
2769
2835
|
]);
|
|
2770
2836
|
/**
|
|
@@ -2916,7 +2982,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2916
2982
|
};
|
|
2917
2983
|
}, 100);
|
|
2918
2984
|
return function () { return clearTimeout(timeoutId); };
|
|
2919
|
-
}, [(
|
|
2985
|
+
}, [(_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.showReadFloatingNav, resolvedType, props.id, loading]);
|
|
2920
2986
|
(0, react_1.useEffect)(function () {
|
|
2921
2987
|
if (resolvedType !== "read")
|
|
2922
2988
|
return;
|
|
@@ -4392,6 +4458,60 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4392
4458
|
handleFilterDataSelected("search", clonedFilterSearchParams);
|
|
4393
4459
|
}, 500);
|
|
4394
4460
|
};
|
|
4461
|
+
// INFO: the list as it opens without a link — the state persistViewState
|
|
4462
|
+
// kept, else the ★ view or All, with this person's draft
|
|
4463
|
+
var handleOpenListNormally = function () {
|
|
4464
|
+
var _a, _b, _c;
|
|
4465
|
+
if (isPersistEnabled && persistedState) {
|
|
4466
|
+
handleApplySavedView(null, true, undefined, persistedState);
|
|
4467
|
+
return;
|
|
4468
|
+
}
|
|
4469
|
+
var wantedId = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSavedViewId) !== null && _b !== void 0 ? _b : (_c = props.organise) === null || _c === void 0 ? void 0 : _c.defaultSavedViewId;
|
|
4470
|
+
var view = isSavedViewsEnabled && wantedId
|
|
4471
|
+
? handleGetTabSavedViews().find(function (eachView) { return eachView.id === wantedId; })
|
|
4472
|
+
: undefined;
|
|
4473
|
+
handleApplySavedView(view !== null && view !== void 0 ? view : null, true);
|
|
4474
|
+
};
|
|
4475
|
+
// INFO: a new initialSearch while the list is open opens it fresh again on
|
|
4476
|
+
// that keyword; the mount value was seeded into the filter state. Cleared,
|
|
4477
|
+
// the link view ends and the list opens as it normally would. A change
|
|
4478
|
+
// while a record is open (opening one drops the link from the URL) waits
|
|
4479
|
+
// until the list shows again
|
|
4480
|
+
var lastInitialSearchRef = (0, react_1.useRef)((_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.initialSearch);
|
|
4481
|
+
// INFO: persistViewState reads its stored state only once the link view
|
|
4482
|
+
// has ended, a render later
|
|
4483
|
+
var isNormalOpenPendingRef = (0, react_1.useRef)(false);
|
|
4484
|
+
(0, react_1.useEffect)(function () {
|
|
4485
|
+
var _a, _b;
|
|
4486
|
+
if (resolvedType !== "list")
|
|
4487
|
+
return;
|
|
4488
|
+
var value = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSearch;
|
|
4489
|
+
if (value === lastInitialSearchRef.current)
|
|
4490
|
+
return;
|
|
4491
|
+
lastInitialSearchRef.current = value;
|
|
4492
|
+
if (!value) {
|
|
4493
|
+
if (!isLinkOpen)
|
|
4494
|
+
return;
|
|
4495
|
+
setIsLinkOpen(false);
|
|
4496
|
+
if ((_b = props.organise) === null || _b === void 0 ? void 0 : _b.persistViewState)
|
|
4497
|
+
isNormalOpenPendingRef.current = true;
|
|
4498
|
+
else
|
|
4499
|
+
handleOpenListNormally();
|
|
4500
|
+
return;
|
|
4501
|
+
}
|
|
4502
|
+
if (!handleCanInitialSearch(additionalQuery))
|
|
4503
|
+
return;
|
|
4504
|
+
setIsLinkOpen(true);
|
|
4505
|
+
handleApplySavedView(null, true, value);
|
|
4506
|
+
/* eslint-disable */
|
|
4507
|
+
}, [(_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.initialSearch, resolvedType]);
|
|
4508
|
+
(0, react_1.useEffect)(function () {
|
|
4509
|
+
if (!isNormalOpenPendingRef.current || isLinkOpen)
|
|
4510
|
+
return;
|
|
4511
|
+
isNormalOpenPendingRef.current = false;
|
|
4512
|
+
handleOpenListNormally();
|
|
4513
|
+
}, [isLinkOpen, persistedState]);
|
|
4514
|
+
/* eslint-enable */
|
|
4395
4515
|
var handleRangeFilterOnChange = function (_id, value, type) {
|
|
4396
4516
|
handleClearDataByFilter("date");
|
|
4397
4517
|
var clonedRangeFilter = JSON.parse(JSON.stringify(filterReferenceDate));
|
|
@@ -11317,9 +11437,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11317
11437
|
var views = handleGetTabSavedViews();
|
|
11318
11438
|
var activeView = views.find(function (eachView) { return eachView.id === activeSavedViewId; });
|
|
11319
11439
|
var currentState = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
|
|
11320
|
-
|
|
11440
|
+
// INFO: a link-opened list is not a change to any view — nothing is kept
|
|
11441
|
+
// from it, so there is nothing to update or reset
|
|
11442
|
+
var isModified = !isLinkOpen &&
|
|
11443
|
+
!!activeView &&
|
|
11444
|
+
!handleIsOnViewState(currentState, activeView.state);
|
|
11321
11445
|
// INFO: All differs from its stored settings only where the app keeps them
|
|
11322
|
-
var isAllModified = !
|
|
11446
|
+
var isAllModified = !isLinkOpen &&
|
|
11447
|
+
!activeView &&
|
|
11323
11448
|
isViewDraftsEnabled &&
|
|
11324
11449
|
!handleIsOnViewState(currentState, (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) !== null && _b !== void 0 ? _b : null);
|
|
11325
11450
|
var defaultViewId = (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.defaultSavedViewId) !== null && _d !== void 0 ? _d : null;
|