blixify-ui-web 1.3.11 → 1.3.13
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 +3 -2
- 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 +295 -198
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +98 -56
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/display/scrollShadow/index.d.ts +2 -0
- package/lib/components/display/scrollShadow/index.d.ts.map +1 -1
- package/lib/components/display/scrollShadow/index.js +163 -11
- package/lib/components/display/scrollShadow/index.js.map +1 -1
- package/lib/components/display/table/index.d.ts +4 -0
- package/lib/components/display/table/index.d.ts.map +1 -1
- package/lib/components/display/table/index.js +18 -2
- package/lib/components/display/table/index.js.map +1 -1
- package/lib/components/navigation/tabs/index.d.ts +1 -0
- package/lib/components/navigation/tabs/index.d.ts.map +1 -1
- package/lib/components/navigation/tabs/index.js +16 -2
- package/lib/components/navigation/tabs/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -247,7 +247,7 @@ var handleCheckEmptyCardValue = function (value) {
|
|
|
247
247
|
};
|
|
248
248
|
exports.handleCheckEmptyCardValue = handleCheckEmptyCardValue;
|
|
249
249
|
exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
250
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124;
|
|
250
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111, _112, _113, _114, _115, _116, _117, _118, _119, _120, _121, _122, _123, _124, _125;
|
|
251
251
|
// INFO: every view draws a lookup as its source column's type, read-only, so
|
|
252
252
|
// no type branch below meets "lookup"; rawProps.model keeps the lookups as
|
|
253
253
|
// stored for the columns handed back to the host
|
|
@@ -266,7 +266,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
266
266
|
// the list never refetching while the panel is open, which fails silently.
|
|
267
267
|
// INFO: the panel cannot navigate its way out — handleNavigate("read") is
|
|
268
268
|
// routed straight back into it — so expand-to-full-page is local state.
|
|
269
|
-
var
|
|
269
|
+
var _126 = (0, react_1.useState)(false), drawerPageView = _126[0], setDrawerPageView = _126[1];
|
|
270
270
|
// INFO: the panel keeps rendering the record it was opened with rather than
|
|
271
271
|
// live props. Without this, navigating back to the list would re-render the
|
|
272
272
|
// still-mounted panel as a second list behind the overlay.
|
|
@@ -321,7 +321,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
321
321
|
drawerFormEditedRef.current = false;
|
|
322
322
|
}
|
|
323
323
|
drawerOpenRef.current = isDrawerHost;
|
|
324
|
-
var
|
|
324
|
+
var _127 = (0, react_1.useState)(false), drawerDiscardModal = _127[0], setDrawerDiscardModal = _127[1];
|
|
325
325
|
// INFO: leaving the record ends the escape, so the next row opened from the
|
|
326
326
|
// list peeks in the panel again rather than inheriting a full page the user
|
|
327
327
|
// asked for once. Saving a form on the full page lands on its read view, which
|
|
@@ -400,7 +400,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
400
400
|
initialFilterReferenceDate: initialFilterReferenceDate,
|
|
401
401
|
};
|
|
402
402
|
};
|
|
403
|
-
var
|
|
403
|
+
var _128 = intialiseDefaultFilterValues(), initialFilterSearch = _128.initialFilterSearch, initialFilterSearchParams = _128.initialFilterSearchParams, initialFilterSelection = _128.initialFilterSelection, initialFilterReference = _128.initialFilterReference, initialFilterReferenceDate = _128.initialFilterReferenceDate;
|
|
404
404
|
// INFO: organise.initialSearch fills the Quick find box, which sends its
|
|
405
405
|
// value under "search". Without that box (hideSearch, Firebase, or a
|
|
406
406
|
// "search" query taking its place) there is nothing to fill
|
|
@@ -416,19 +416,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
416
416
|
// keyword: All's columns and sort, no stored filters, and nothing this
|
|
417
417
|
// person kept in the browser (view drafts, persistViewState) is read or
|
|
418
418
|
// written — until they pick a view, which is their own choice again
|
|
419
|
-
var
|
|
419
|
+
var _129 = (0, react_1.useState)(function () { var _a; return handleCanInitialSearch((_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery); }), isLinkOpen = _129[0], setIsLinkOpen = _129[1];
|
|
420
420
|
var handleSeedInitialSearch = function (params) {
|
|
421
421
|
var _a;
|
|
422
422
|
return isLinkOpen && ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSearch)
|
|
423
423
|
? __assign(__assign({}, params), { search: props.organise.initialSearch }) : params;
|
|
424
424
|
};
|
|
425
425
|
// INFO: Persist view state hook — handles storage read/write for filter/sort/column state
|
|
426
|
-
var
|
|
426
|
+
var _130 = (0, viewStatePersistence_1.usePersistedViewState)({
|
|
427
427
|
mode: isLinkOpen ? undefined : (_k = props.organise) === null || _k === void 0 ? void 0 : _k.persistViewState,
|
|
428
428
|
collectionId: props.collectionId,
|
|
429
429
|
persistKey: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.persistKey,
|
|
430
430
|
type: resolvedType,
|
|
431
|
-
}), rawPersistedState =
|
|
431
|
+
}), rawPersistedState = _130.persistedState, isPersistEnabled = _130.isEnabled, handleSaveView = _130.handleSaveView, handleRegisterViewSnapshot = _130.handleRegisterViewSnapshot;
|
|
432
432
|
// INFO: drop stored filters/sort on removed columns — they would empty the table
|
|
433
433
|
var persistedState = (0, react_1.useMemo)(function () {
|
|
434
434
|
var _a, _b, _c, _d;
|
|
@@ -444,8 +444,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
444
444
|
(_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareFlexFilterListObjects,
|
|
445
445
|
(_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareFlexFilterRelated,
|
|
446
446
|
]);
|
|
447
|
-
var
|
|
448
|
-
var
|
|
447
|
+
var _131 = (0, react_1.useState)(false), loading = _131[0], setLoading = _131[1];
|
|
448
|
+
var _132 = (0, react_1.useState)(), notification = _132[0], setNotification = _132[1];
|
|
449
449
|
// INFO: a success toast is confirmation, not a decision — it clears itself so
|
|
450
450
|
// it never sits on the floating step bar; errors stay until dismissed
|
|
451
451
|
(0, react_1.useEffect)(function () {
|
|
@@ -455,73 +455,73 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
455
455
|
return function () { return clearTimeout(timer); };
|
|
456
456
|
}, [notification]);
|
|
457
457
|
//INFO : Used by List
|
|
458
|
-
var
|
|
458
|
+
var _133 = (0, react_1.useState)(function () {
|
|
459
459
|
var _a;
|
|
460
460
|
return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearch);
|
|
461
|
-
}), filterSearch =
|
|
462
|
-
var
|
|
461
|
+
}), filterSearch = _133[0], setFilterSearch = _133[1];
|
|
462
|
+
var _134 = (0, react_1.useState)(function () {
|
|
463
463
|
var _a;
|
|
464
464
|
return handleSeedInitialSearch((_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _a !== void 0 ? _a : initialFilterSearchParams);
|
|
465
|
-
}), filterSearchParams =
|
|
466
|
-
var
|
|
467
|
-
var
|
|
468
|
-
var
|
|
469
|
-
var
|
|
470
|
-
var
|
|
465
|
+
}), filterSearchParams = _134[0], setFilterSearchParams = _134[1];
|
|
466
|
+
var _135 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _q !== void 0 ? _q : initialFilterSelection), filterSelection = _135[0], setFilterSelection = _135[1];
|
|
467
|
+
var _136 = (0, react_1.useState)((_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _r !== void 0 ? _r : initialFilterReference), filterReference = _136[0], setFilterReference = _136[1];
|
|
468
|
+
var _137 = (0, react_1.useState)({}), filterReferenceSearch = _137[0], setFilterReferenceSearch = _137[1];
|
|
469
|
+
var _138 = (0, react_1.useState)({}), filterReferenceList = _138[0], setFilterReferenceList = _138[1];
|
|
470
|
+
var _139 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
|
|
471
471
|
? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
|
|
472
|
-
: initialFilterReferenceDate), filterReferenceDate =
|
|
473
|
-
var
|
|
474
|
-
var
|
|
475
|
-
var
|
|
476
|
-
var
|
|
477
|
-
var
|
|
472
|
+
: initialFilterReferenceDate), filterReferenceDate = _139[0], setFilterReferenceDate = _139[1];
|
|
473
|
+
var _140 = (0, react_1.useState)(true), tableLoading = _140[0], setTableLoading = _140[1];
|
|
474
|
+
var _141 = (0, react_1.useState)(""), cursor = _141[0], setCursor = _141[1];
|
|
475
|
+
var _142 = (0, react_1.useState)(""), lastCursor = _142[0], setLastCursor = _142[1];
|
|
476
|
+
var _143 = (0, react_1.useState)([]), tableData = _143[0], setTableData = _143[1];
|
|
477
|
+
var _144 = (0, react_1.useState)([]), spaceTableData = _144[0], setSpaceTableData = _144[1];
|
|
478
478
|
// INFO: a save resolves after later renders, so it reads the table from here —
|
|
479
479
|
// the state it closed over can predate an earlier save on the same row
|
|
480
480
|
var tableDataRef = (0, react_1.useRef)([]);
|
|
481
481
|
var spaceTableDataRef = (0, react_1.useRef)([]);
|
|
482
482
|
tableDataRef.current = tableData;
|
|
483
483
|
spaceTableDataRef.current = spaceTableData;
|
|
484
|
-
var
|
|
485
|
-
var
|
|
484
|
+
var _145 = (0, react_1.useState)(0), size = _145[0], setSize = _145[1];
|
|
485
|
+
var _146 = (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 = _146[0], setPageIndex = _146[1];
|
|
486
486
|
// INFO: every change of page, including the return to the first page when a
|
|
487
487
|
// filter or search changes, which onChangePagination does not always report
|
|
488
488
|
(0, react_1.useEffect)(function () {
|
|
489
489
|
var _a, _b;
|
|
490
490
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePageIndex) === null || _b === void 0 ? void 0 : _b.call(_a, pageIndex);
|
|
491
491
|
}, [pageIndex]);
|
|
492
|
-
var
|
|
493
|
-
var
|
|
494
|
-
var
|
|
495
|
-
var
|
|
496
|
-
var
|
|
492
|
+
var _147 = (0, react_1.useState)([]), selectedIds = _147[0], setSelectedIds = _147[1];
|
|
493
|
+
var _148 = (0, react_1.useState)(false), selectAll = _148[0], setSelectAll = _148[1];
|
|
494
|
+
var _149 = (0, react_1.useState)(""), deletePasscode = _149[0], setDeletePasscode = _149[1];
|
|
495
|
+
var _150 = (0, react_1.useState)(""), deletePasscodeInput = _150[0], setDeletePasscodeInput = _150[1];
|
|
496
|
+
var _151 = (0, react_1.useState)(""), deleteFeedId = _151[0], setDeleteFeedId = _151[1];
|
|
497
497
|
//INFO : Used by List Organise
|
|
498
498
|
// INFO: Internal sort state that overrides props.organise?.sort when
|
|
499
499
|
// persistViewState is enabled and a persisted sort exists
|
|
500
|
-
var
|
|
501
|
-
var
|
|
502
|
-
var
|
|
503
|
-
var
|
|
500
|
+
var _152 = (0, react_1.useState)((_v = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _v !== void 0 ? _v : undefined), persistedSort = _152[0], setPersistedSort = _152[1];
|
|
501
|
+
var _153 = (0, react_1.useState)(false), filterDraft = _153[0], setFilterDraft = _153[1];
|
|
502
|
+
var _154 = (0, react_1.useState)(false), addTabModal = _154[0], setAddTabModal = _154[1];
|
|
503
|
+
var _155 = (0, react_1.useState)(-1), editTabIndex = _155[0], setEditTabIndex = _155[1];
|
|
504
504
|
//INFO : resolve the initial tab synchronously so the mount cond is already
|
|
505
505
|
// tab-scoped — an empty initial tab caused a second wasted list fetch
|
|
506
|
-
var
|
|
506
|
+
var _156 = (0, react_1.useState)(function () {
|
|
507
507
|
var _a;
|
|
508
508
|
return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, listViewId);
|
|
509
|
-
}), selectedTab =
|
|
510
|
-
var
|
|
509
|
+
}), selectedTab = _156[0], setSelectedTab = _156[1];
|
|
510
|
+
var _157 = (0, react_1.useState)("dayGridMonth"), calendarView = _157[0], setCalendarView = _157[1];
|
|
511
511
|
// INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
|
|
512
512
|
// (calendarView above drives the matching range query)
|
|
513
|
-
var
|
|
514
|
-
var
|
|
513
|
+
var _158 = (0, react_1.useState)("month"), newCalendarViewMode = _158[0], setNewCalendarViewMode = _158[1];
|
|
514
|
+
var _159 = (0, react_1.useState)(new Date()), calendarTabMonth = _159[0], setCalendarTabMonth = _159[1];
|
|
515
515
|
// INFO: defaultViewSwitch picks the opening view only — the tab re-inits
|
|
516
516
|
// whenever its settings change, and that must not undo the user's switch
|
|
517
517
|
var calendarViewInitRef = (0, react_1.useRef)(false);
|
|
518
|
-
var
|
|
519
|
-
var
|
|
520
|
-
var
|
|
521
|
-
var
|
|
518
|
+
var _160 = (0, react_1.useState)(true), kanbanDroppable = _160[0], setKanbanDroppable = _160[1];
|
|
519
|
+
var _161 = (0, react_1.useState)([]), kanbanOptions = _161[0], setKanbanOptions = _161[1];
|
|
520
|
+
var _162 = (0, react_1.useState)(false), batchUpdateModal = _162[0], setBatchUpdateModal = _162[1];
|
|
521
|
+
var _163 = (0, react_1.useState)({
|
|
522
522
|
columnId: "",
|
|
523
523
|
columnData: {},
|
|
524
|
-
}), batchUpdateData =
|
|
524
|
+
}), batchUpdateData = _163[0], setBatchUpdateData = _163[1];
|
|
525
525
|
// INFO: system columns (created / updated at and by, record id, number)
|
|
526
526
|
// join the structure hidden; the ones a user shows are kept per view
|
|
527
527
|
var isSystemColumnsEnabled = !!((_w = props.bareSettings) === null || _w === void 0 ? void 0 : _w.bareSystemColumns);
|
|
@@ -529,12 +529,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
529
529
|
var appendedSystemColumnIds = isSystemColumnsEnabled
|
|
530
530
|
? 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; }); })
|
|
531
531
|
: [];
|
|
532
|
-
var
|
|
532
|
+
var _164 = (0, react_1.useState)((_y = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _y !== void 0 ? _y : []), shownSystemColumnIds = _164[0], setShownSystemColumnIds = _164[1];
|
|
533
533
|
var handleWithSystemColumns = function (model, shownIds) {
|
|
534
534
|
if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
|
|
535
535
|
return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
|
|
536
536
|
};
|
|
537
|
-
var
|
|
537
|
+
var _165 = (0, react_1.useState)(function () {
|
|
538
538
|
var _a;
|
|
539
539
|
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 : []);
|
|
540
540
|
if (!persistedState)
|
|
@@ -561,8 +561,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
561
561
|
});
|
|
562
562
|
}
|
|
563
563
|
return model;
|
|
564
|
-
}), structure =
|
|
565
|
-
var
|
|
564
|
+
}), structure = _165[0], setStructure = _165[1];
|
|
565
|
+
var _166 = (0, react_1.useState)(((_z = props === null || props === void 0 ? void 0 : props.organise) === null || _z === void 0 ? void 0 : _z.additionalQuery) || []), additionalQuery = _166[0], setAdditionalQuery = _166[1];
|
|
566
566
|
// INFO: State for user-configurable flex filters (Monday.com-style)
|
|
567
567
|
// INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
|
|
568
568
|
var defaultFlexFilterRow = [
|
|
@@ -580,7 +580,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
580
580
|
: (persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
581
581
|
? persistedState.flexFilters
|
|
582
582
|
: defaultFlexFilterRow;
|
|
583
|
-
var
|
|
583
|
+
var _167 = (0, react_1.useState)(initialFlexFilterRows), flexFilters = _167[0], setFlexFilters = _167[1];
|
|
584
584
|
// INFO: always-current mirror of flexFilters, read by the imperative apply/
|
|
585
585
|
// clear methods so chained calls in one tick aren't stale.
|
|
586
586
|
var flexFiltersRef = (0, react_1.useRef)(flexFilters);
|
|
@@ -593,97 +593,101 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
593
593
|
}, [flexFilters]);
|
|
594
594
|
// INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
|
|
595
595
|
// to prevent API calls on every keystroke when typing in value inputs
|
|
596
|
-
var
|
|
596
|
+
var _168 = (0, react_1.useState)(initialFlexFilterRows), flexFiltersDebounced = _168[0], setFlexFiltersDebounced = _168[1];
|
|
597
597
|
// INFO: the filter rows of the export being set up — started from the
|
|
598
598
|
// list's own when the export opens, so changing them leaves the list as it is
|
|
599
|
-
var
|
|
600
|
-
var
|
|
601
|
-
var
|
|
602
|
-
var
|
|
603
|
-
var
|
|
599
|
+
var _169 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _169[0], setExportFlexFilters = _169[1];
|
|
600
|
+
var _170 = (0, react_1.useState)({}), flexFilterReferenceOptions = _170[0], setFlexFilterReferenceOptions = _170[1];
|
|
601
|
+
var _171 = (0, react_1.useState)({}), flexFilterReferenceSearch = _171[0], setFlexFilterReferenceSearch = _171[1];
|
|
602
|
+
var _172 = (0, react_1.useState)(false), flexFilterModalOpen = _172[0], setFlexFilterModalOpen = _172[1];
|
|
603
|
+
var _173 = (0, react_1.useState)(false), viewSettingsModalOpen = _173[0], setViewSettingsModalOpen = _173[1];
|
|
604
604
|
// INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
|
|
605
605
|
// Deliberately kept out of `structure`: the props-sync effect below resets
|
|
606
606
|
// structure to props.model whenever props change, which would wipe the
|
|
607
607
|
// choice, and the persist effect derives schema-level hiddenColumnIds from
|
|
608
608
|
// structure — writing user hides there would blur the two concepts.
|
|
609
|
-
var
|
|
610
|
-
var
|
|
611
|
-
var
|
|
612
|
-
var
|
|
609
|
+
var _174 = (0, react_1.useState)((_1 = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _1 !== void 0 ? _1 : []), userHiddenColumnIds = _174[0], setUserHiddenColumnIds = _174[1];
|
|
610
|
+
var _175 = (0, react_1.useState)(""), columnSearch = _175[0], setColumnSearch = _175[1];
|
|
611
|
+
var _176 = (0, react_1.useState)([]), savedViews = _176[0], setSavedViews = _176[1];
|
|
612
|
+
var _177 = (0, react_1.useState)(null), activeSavedViewId = _177[0], setActiveSavedViewId = _177[1];
|
|
613
613
|
// INFO: the widths of the view on screen, by column id ("180px")
|
|
614
|
-
var
|
|
614
|
+
var _178 = (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 = _178[0], setColumnWidths = _178[1];
|
|
615
615
|
// INFO: the columns the view on screen freezes at the left edge
|
|
616
|
-
var
|
|
616
|
+
var _179 = (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 = _179[0], setPinnedColumnIds = _179[1];
|
|
617
617
|
// INFO: unsaved changes are kept only once the opening view is on screen,
|
|
618
618
|
// so the defaults drawn before it never overwrite a person's own
|
|
619
|
-
var
|
|
619
|
+
var _180 = (0, react_1.useState)(false), isViewDraftReady = _180[0], setIsViewDraftReady = _180[1];
|
|
620
620
|
// INFO: null while the name box is closed
|
|
621
|
-
var
|
|
622
|
-
var
|
|
623
|
-
|
|
624
|
-
var _183 = (0, react_1.useState)(
|
|
625
|
-
|
|
621
|
+
var _181 = (0, react_1.useState)(null), savedViewName = _181[0], setSavedViewName = _181[1];
|
|
622
|
+
var _182 = (0, react_1.useState)(null), deletingSavedViewId = _182[0], setDeletingSavedViewId = _182[1];
|
|
623
|
+
// INFO: the view chip being dragged, to drop it in another place
|
|
624
|
+
var _183 = (0, react_1.useState)(null), draggingSavedViewId = _183[0], setDraggingSavedViewId = _183[1];
|
|
625
|
+
// INFO: the tab strip in the order a drag has reached, saved once on drop
|
|
626
|
+
var _184 = (0, react_1.useState)(null), draggedTabs = _184[0], setDraggedTabs = _184[1];
|
|
627
|
+
var _185 = (0, react_1.useState)(null), renamingSavedView = _185[0], setRenamingSavedView = _185[1];
|
|
628
|
+
var _186 = (0, react_1.useState)(false), isSavedViewsExpanded = _186[0], setIsSavedViewsExpanded = _186[1];
|
|
629
|
+
var _187 = (0, react_1.useState)(null), draggingColumnId = _187[0], setDraggingColumnId = _187[1];
|
|
626
630
|
var columnRowRefs = (0, react_1.useRef)({});
|
|
627
631
|
//INFO : Used by Auth
|
|
628
|
-
var
|
|
632
|
+
var _188 = (0, react_1.useState)({
|
|
629
633
|
email: "",
|
|
630
634
|
google: "",
|
|
631
635
|
phone: "",
|
|
632
636
|
disabled: false,
|
|
633
637
|
create: false,
|
|
634
|
-
}), authMethods =
|
|
635
|
-
var
|
|
638
|
+
}), authMethods = _188[0], setAuthMethods = _188[1];
|
|
639
|
+
var _189 = (0, react_1.useState)(""), selectedAuthMethod = _189[0], setSelectedAuthMethod = _189[1];
|
|
636
640
|
// INFO: the sign-in check of a users datasheet's record is running; the
|
|
637
641
|
// panel shows a spinner rather than nothing, which read as "no login"
|
|
638
|
-
var
|
|
642
|
+
var _190 = (0, react_1.useState)(false), authLoading = _190[0], setAuthLoading = _190[1];
|
|
639
643
|
// INFO: a delete is running — the ref answers a second tap at once, before
|
|
640
644
|
// the state has rendered, and the state disables the confirm button
|
|
641
645
|
var deletingRef = (0, react_1.useRef)(false);
|
|
642
|
-
var
|
|
646
|
+
var _191 = (0, react_1.useState)(false), deleting = _191[0], setDeleting = _191[1];
|
|
643
647
|
// INFO: Used by Activity Log
|
|
644
|
-
var
|
|
645
|
-
var
|
|
648
|
+
var _192 = (0, react_1.useState)(false), activityModal = _192[0], setActivityModal = _192[1];
|
|
649
|
+
var _193 = (0, react_1.useState)(""), activityId = _193[0], setActivityId = _193[1];
|
|
646
650
|
//INFO : Used by Export
|
|
647
|
-
var
|
|
648
|
-
var
|
|
649
|
-
var
|
|
650
|
-
var
|
|
651
|
-
var
|
|
652
|
-
var
|
|
653
|
-
var
|
|
654
|
-
var
|
|
655
|
-
var
|
|
656
|
-
var
|
|
657
|
-
var
|
|
658
|
-
var
|
|
659
|
-
var
|
|
660
|
-
var
|
|
661
|
-
var
|
|
651
|
+
var _194 = (0, react_1.useState)(null), csvFile = _194[0], setCSVFile = _194[1];
|
|
652
|
+
var _195 = (0, react_1.useState)([]), csvFileData = _195[0], setCSVFileData = _195[1];
|
|
653
|
+
var _196 = (0, react_1.useState)(0), stepCSVIndex = _196[0], setStepCSVIndex = _196[1];
|
|
654
|
+
var _197 = (0, react_1.useState)({}), listCSVMapAttribute = _197[0], setListCSVMapAttribute = _197[1];
|
|
655
|
+
var _198 = (0, react_1.useState)({}), listCSVObjAttribute = _198[0], setListCSVObjAttribute = _198[1];
|
|
656
|
+
var _199 = (0, react_1.useState)([]), csvAPIAttribute = _199[0], setCSVAPIAttribute = _199[1];
|
|
657
|
+
var _200 = (0, react_1.useState)(((_2 = props.devSettings.currentUser) === null || _2 === void 0 ? void 0 : _2.userEmail) || ""), exportCSVEmail = _200[0], setExportCSVEmail = _200[1];
|
|
658
|
+
var _201 = (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 = _201[0], setExportPDFTitle = _201[1];
|
|
659
|
+
var _202 = (0, react_1.useState)(false), exportPDFLoading = _202[0], setExportPDFLoading = _202[1];
|
|
660
|
+
var _203 = (0, react_1.useState)(false), exportReadPDFLoading = _203[0], setExportReadPDFLoading = _203[1];
|
|
661
|
+
var _204 = (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 = _204[0], setExportSumAttributeIds = _204[1];
|
|
662
|
+
var _205 = (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 = _205[0], setHideSubItems = _205[1];
|
|
663
|
+
var _206 = (0, react_1.useState)([]), importTableData = _206[0], setImportTableData = _206[1];
|
|
664
|
+
var _207 = (0, react_1.useState)([]), queryList = _207[0], setQueryList = _207[1];
|
|
665
|
+
var _208 = (0, react_1.useState)(undefined), allQueryList = _208[0], setAllQueryList = _208[1];
|
|
662
666
|
// INFO: a restored state wins over the prop; its "" is a list the user
|
|
663
667
|
// ungrouped, so it opens ungrouped
|
|
664
|
-
var
|
|
668
|
+
var _209 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
|
|
665
669
|
? persistedState.groupBy || undefined
|
|
666
|
-
: (_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.groupBy), groupId =
|
|
670
|
+
: (_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.groupBy), groupId = _209[0], setGroupId = _209[1];
|
|
667
671
|
// INFO: each group's total per number column, keyed by section id
|
|
668
|
-
var
|
|
672
|
+
var _210 = (0, react_1.useState)({}), groupSummaries = _210[0], setGroupSummaries = _210[1];
|
|
669
673
|
// INFO: each group's row count over every row the filters match; null until
|
|
670
674
|
// read. A band paged alone shows it until its own first page lands, and a
|
|
671
675
|
// band it counts empty is left out instead of waiting to be read
|
|
672
|
-
var
|
|
676
|
+
var _211 = (0, react_1.useState)(null), groupTotals = _211[0], setGroupTotals = _211[1];
|
|
673
677
|
// INFO: the last read of groupTotals failed, so bands fall back to the rows
|
|
674
678
|
// loaded instead of waiting on a total that is not coming
|
|
675
|
-
var
|
|
679
|
+
var _212 = (0, react_1.useState)(false), groupTotalsFailed = _212[0], setGroupTotalsFailed = _212[1];
|
|
676
680
|
var groupSummaryRequestRef = (0, react_1.useRef)(0);
|
|
677
681
|
// INFO: the grouped count waiting to go out, so a filter change can stop it
|
|
678
682
|
// before it sends the filters it was scheduled with
|
|
679
683
|
var groupSummaryTimerRef = (0, react_1.useRef)(null);
|
|
680
|
-
var
|
|
684
|
+
var _213 = (0, react_1.useState)({}), commentCounts = _213[0], setCommentCounts = _213[1];
|
|
681
685
|
// INFO: Monday-board per-group paging. Keyed by the group key that
|
|
682
686
|
// handleBuildNewTableGroups() produces (an option, Unknown or No Value).
|
|
683
687
|
// Each group tracks its own loaded cursor + total so it can lazily load its
|
|
684
688
|
// next page as the user scrolls inside that band, independent of every other
|
|
685
689
|
// group. Only used when renderCheckGroupPaging() is true.
|
|
686
|
-
var
|
|
690
|
+
var _214 = (0, react_1.useState)({}), groupPageState = _214[0], setGroupPageState = _214[1];
|
|
687
691
|
// INFO: read fresh inside the async per-group fetch so chained scroll fires
|
|
688
692
|
// in one tick do not re-fetch an already in-flight page.
|
|
689
693
|
var groupPageStateRef = (0, react_1.useRef)({});
|
|
@@ -698,62 +702,62 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
698
702
|
var groupLoadingKeyRef = (0, react_1.useRef)(null);
|
|
699
703
|
var groupLoadQueueRef = (0, react_1.useRef)([]);
|
|
700
704
|
var handleFetchGroupNextPageRef = (0, react_1.useRef)(function () { });
|
|
701
|
-
var
|
|
702
|
-
var
|
|
705
|
+
var _215 = (0, react_1.useState)(""), readTabSection = _215[0], setReadTabSection = _215[1];
|
|
706
|
+
var _216 = (0, react_1.useState)(false), readFloatingNav = _216[0], setReadFloatingNav = _216[1];
|
|
703
707
|
var readTabSectionRefs = (0, react_1.useRef)({});
|
|
704
708
|
//INFO : Used by Read
|
|
705
709
|
//INFO : Used by Update
|
|
706
|
-
var
|
|
707
|
-
var
|
|
708
|
-
var
|
|
709
|
-
var
|
|
710
|
-
var
|
|
711
|
-
var
|
|
712
|
-
var
|
|
710
|
+
var _217 = (0, react_1.useState)(false), modalVisible = _217[0], setModalVisible = _217[1];
|
|
711
|
+
var _218 = (0, react_1.useState)(false), deleteModal = _218[0], setDeleteModal = _218[1];
|
|
712
|
+
var _219 = (0, react_1.useState)(false), excelModal = _219[0], setExcelModal = _219[1];
|
|
713
|
+
var _220 = (0, react_1.useState)(false), exportExcel = _220[0], setExportExcel = _220[1];
|
|
714
|
+
var _221 = (0, react_1.useState)(""), exportType = _221[0], setExportType = _221[1];
|
|
715
|
+
var _222 = (0, react_1.useState)(false), exportQR = _222[0], setExportQR = _222[1];
|
|
716
|
+
var _223 = (0, react_1.useState)(function () {
|
|
713
717
|
var _a, _b;
|
|
714
718
|
var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
|
|
715
719
|
return firstTabId;
|
|
716
|
-
}), activeTab =
|
|
717
|
-
var
|
|
718
|
-
var
|
|
719
|
-
var
|
|
720
|
-
var
|
|
721
|
-
var
|
|
722
|
-
var
|
|
723
|
-
var
|
|
720
|
+
}), activeTab = _223[0], setActiveTab = _223[1];
|
|
721
|
+
var _224 = (0, react_1.useState)(false), signatureSigning = _224[0], setSignatureSigning = _224[1];
|
|
722
|
+
var _225 = (0, react_1.useState)({}), selectedData = _225[0], setSelectedData = _225[1];
|
|
723
|
+
var _226 = (0, react_1.useState)(""), selectedObjectStructureId = _226[0], setSelectedObjectStructureId = _226[1];
|
|
724
|
+
var _227 = (0, react_1.useState)(""), selectedObjectId = _227[0], setSelectedObjectId = _227[1];
|
|
725
|
+
var _228 = (0, react_1.useState)(""), selectedListAddressId = _228[0], setSelectedListAddressId = _228[1];
|
|
726
|
+
var _229 = (0, react_1.useState)(-1), selectedListAddressIndex = _229[0], setSelectedListAddressIndex = _229[1];
|
|
727
|
+
var _230 = (0, react_1.useState)({
|
|
724
728
|
lat: 0,
|
|
725
729
|
lng: 0,
|
|
726
730
|
name: "",
|
|
727
|
-
}), selectedListAddress =
|
|
728
|
-
var
|
|
729
|
-
var
|
|
730
|
-
var
|
|
731
|
-
var
|
|
732
|
-
var
|
|
733
|
-
var
|
|
731
|
+
}), selectedListAddress = _230[0], setSelectedListAddress = _230[1];
|
|
732
|
+
var _231 = (0, react_1.useState)({}), selectedObjectData = _231[0], setSelectedObjectData = _231[1];
|
|
733
|
+
var _232 = (0, react_1.useState)(null), objectCellEdit = _232[0], setObjectCellEdit = _232[1];
|
|
734
|
+
var _233 = (0, react_1.useState)(false), referenceLoading = _233[0], setReferenceLoading = _233[1];
|
|
735
|
+
var _234 = (0, react_1.useState)({}), referencesOptions = _234[0], setReferencesOptions = _234[1];
|
|
736
|
+
var _235 = (0, react_1.useState)({}), referencesDetails = _235[0], setReferencesDetails = _235[1];
|
|
737
|
+
var _236 = (0, react_1.useState)({}), listReferencesOptions = _236[0], setListReferencesOptions = _236[1];
|
|
734
738
|
// INFO: the referenced records themselves, for a table cell that picks from
|
|
735
739
|
// a list on one (referenceSelection)
|
|
736
|
-
var
|
|
737
|
-
var
|
|
738
|
-
var
|
|
739
|
-
var
|
|
740
|
-
var
|
|
740
|
+
var _237 = (0, react_1.useState)({}), listReferencesDetails = _237[0], setListReferencesDetails = _237[1];
|
|
741
|
+
var _238 = (0, react_1.useState)({}), referenceDeleteTableData = _238[0], setReferenceDeleteTableData = _238[1];
|
|
742
|
+
var _239 = (0, react_1.useState)([]), relatedSections = _239[0], setRelatedSections = _239[1];
|
|
743
|
+
var _240 = (0, react_1.useState)(0), referenceDeleteIndex = _240[0], setReferenceDeleteIndex = _240[1];
|
|
744
|
+
var _241 = (0, react_1.useState)({
|
|
741
745
|
id: "",
|
|
742
746
|
name: "",
|
|
743
747
|
type: "string",
|
|
744
|
-
}), referenceCreationModal =
|
|
745
|
-
var
|
|
746
|
-
var
|
|
748
|
+
}), referenceCreationModal = _241[0], setReferenceCreationModal = _241[1];
|
|
749
|
+
var _242 = (0, react_1.useState)({}), referenceModelSchema = _242[0], setReferenceSchema = _242[1];
|
|
750
|
+
var _243 = (0, react_1.useState)([]), kanbanChecked = _243[0], setKanbanChecked = _243[1];
|
|
747
751
|
//INFO : Offline
|
|
748
|
-
var
|
|
749
|
-
var
|
|
752
|
+
var _244 = (0, react_1.useState)(0), offlineDataLength = _244[0], setOfflineDataLength = _244[1];
|
|
753
|
+
var _245 = (0, react_1.useState)(false), offlineModal = _245[0], setOfflineModal = _245[1];
|
|
750
754
|
// INFO: live-stream state — driven by socket connection and navigator.onLine
|
|
751
|
-
var
|
|
752
|
-
var
|
|
755
|
+
var _246 = (0, react_1.useState)(false), isLive = _246[0], setIsLive = _246[1];
|
|
756
|
+
var _247 = (0, react_1.useState)(false), isLiveOffline = _247[0], setIsLiveOffline = _247[1];
|
|
753
757
|
// INFO: true when navigator is offline — used to switch ReadQueryHoc between
|
|
754
758
|
// server reads (online, full pagination) and IndexedDB reads (offline, cached data).
|
|
755
759
|
// Independent of SSE status so it works even when bareSocketName is not set.
|
|
756
|
-
var
|
|
760
|
+
var _248 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _248[0], setIsNetworkOffline = _248[1];
|
|
757
761
|
var previousType = (0, react_1.useRef)(null);
|
|
758
762
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
759
763
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
@@ -1104,7 +1108,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1104
1108
|
var isSchemaHideMode = ((_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.onChangeHide) ? true : false;
|
|
1105
1109
|
// INFO: rows per page is a view setting the user can change, so it starts from
|
|
1106
1110
|
// the persisted value and falls back to the consumer's limit
|
|
1107
|
-
var
|
|
1111
|
+
var _249 = (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 = _249[0], setPageLimit = _249[1];
|
|
1108
1112
|
var limit = pageLimit;
|
|
1109
1113
|
var isSavedViewsEnabled = !!((_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.savedViews) && resolvedType === "list";
|
|
1110
1114
|
// INFO: an app that stores views takes over from this browser's storage, so
|
|
@@ -1251,7 +1255,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1251
1255
|
displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
|
|
1252
1256
|
};
|
|
1253
1257
|
};
|
|
1254
|
-
var
|
|
1258
|
+
var _250 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _250.canUpdateRecord, canInlineUpdate = _250.canInlineUpdate, canBatchUpdate = _250.canBatchUpdate, canDeleteRecord = _250.canDeleteRecord;
|
|
1255
1259
|
var isEditor = ((_38 = props.edit) === null || _38 === void 0 ? void 0 : _38.allEditable) ? true : false;
|
|
1256
1260
|
var isOffline = (_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareOffline;
|
|
1257
1261
|
// INFO: when bareOfflineNetworkAware is true, the save path is also gated on
|
|
@@ -1298,7 +1302,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1298
1302
|
// INFO: each row button opens what it shows: the comment button the row's
|
|
1299
1303
|
// comments and logs alone, the eye (or the row) its details alone, so
|
|
1300
1304
|
// neither has to be scrolled past to reach the other
|
|
1301
|
-
var
|
|
1305
|
+
var _251 = (0, react_1.useState)(false), inlineActivityOnly = _251[0], setInlineActivityOnly = _251[1];
|
|
1302
1306
|
var isActivityOnly = isInlineActivity && inlineActivityOnly;
|
|
1303
1307
|
// INFO: the row whose comments were shown; going back to the list asks its
|
|
1304
1308
|
// comment count again, as the drawer does when it closes
|
|
@@ -1930,12 +1934,31 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1930
1934
|
return (__assign(__assign({}, previous), (_a = {}, _a[columnId] = (0, columnWidth_1.handleFormatColumnWidth)(pixels), _a)));
|
|
1931
1935
|
});
|
|
1932
1936
|
};
|
|
1933
|
-
// INFO: views belong to a tab, so another tab
|
|
1937
|
+
// INFO: views belong to a tab, so another tab opens on its own ★ view, or
|
|
1938
|
+
// on All when the view on screen belonged to the tab just left. A host that
|
|
1939
|
+
// keeps the list mounted across tabs would otherwise leave every other tab
|
|
1940
|
+
// on whatever the first tab opened with.
|
|
1941
|
+
var lastViewTypeRef = (0, react_1.useRef)(viewType);
|
|
1934
1942
|
(0, react_1.useEffect)(function () {
|
|
1943
|
+
var wasOnView = activeSavedViewId !== null;
|
|
1935
1944
|
setActiveSavedViewId(null);
|
|
1936
1945
|
setSavedViewName(null);
|
|
1937
1946
|
setDeletingSavedViewId(null);
|
|
1947
|
+
if (lastViewTypeRef.current === viewType)
|
|
1948
|
+
return;
|
|
1949
|
+
lastViewTypeRef.current = viewType;
|
|
1950
|
+
if (!isSavedViewsEnabled || !openingViewSettledRef.current || isLinkOpen)
|
|
1951
|
+
return;
|
|
1952
|
+
var views = handleGetTabSavedViews();
|
|
1953
|
+
var starredId = handleGetStarredViewId(views);
|
|
1954
|
+
var starred = views.find(function (eachView) { return eachView.id === starredId; });
|
|
1955
|
+
if (starred)
|
|
1956
|
+
handleApplySavedView(starred, true);
|
|
1957
|
+
else if (wasOnView)
|
|
1958
|
+
handleApplySavedView(null, true);
|
|
1959
|
+
/* eslint-disable */
|
|
1938
1960
|
}, [viewType]);
|
|
1961
|
+
/* eslint-enable */
|
|
1939
1962
|
// INFO: a view can change the saved state without changing the request —
|
|
1940
1963
|
// rows per page on a calendar, map or grouped tab (no limit is sent), or a
|
|
1941
1964
|
// filter with no value. ReadQueryHoc only reads when its cond changes, so
|
|
@@ -1974,6 +1997,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1974
1997
|
})
|
|
1975
1998
|
: savedViews.filter(function (eachView) { return eachView.tabId === viewType; })), true);
|
|
1976
1999
|
};
|
|
2000
|
+
// INFO: at most one ★ per tab — the starred id whose view is on this tab
|
|
2001
|
+
var handleGetStarredViewId = function (views) {
|
|
2002
|
+
var _a, _b, _c, _d;
|
|
2003
|
+
if (views === void 0) { views = handleGetTabSavedViews(); }
|
|
2004
|
+
var starredIds = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.defaultSavedViewIds) !== null && _b !== void 0 ? _b : [];
|
|
2005
|
+
return ((_d = (_c = views.find(function (eachView) { return starredIds.includes(eachView.id); })) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : null);
|
|
2006
|
+
};
|
|
2007
|
+
// INFO: a ★ replaces only the star on its own tab, and the ★ on the starred
|
|
2008
|
+
// view takes it off, so that tab opens on All
|
|
2009
|
+
var handleStarSavedView = function (id) {
|
|
2010
|
+
var _a, _b, _c, _d;
|
|
2011
|
+
var tabViewIds = handleGetTabSavedViews().map(function (eachView) { return eachView.id; });
|
|
2012
|
+
var otherTabIds = ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.defaultSavedViewIds) !== null && _b !== void 0 ? _b : []).filter(function (eachId) { return !tabViewIds.includes(eachId); });
|
|
2013
|
+
(_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onChangeDefaultSavedViewIds) === null || _d === void 0 ? void 0 : _d.call(_c, handleGetStarredViewId() === id ? otherTabIds : __spreadArray(__spreadArray([], otherTabIds, true), [id], false));
|
|
2014
|
+
};
|
|
1977
2015
|
// INFO: the app owns the list, so each change hands it the whole list to
|
|
1978
2016
|
// store; nothing is written to this browser. A second change before the app
|
|
1979
2017
|
// passes the list back builds on the one just sent, not the stale prop.
|
|
@@ -1995,8 +2033,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
1995
2033
|
// view already picked or a state persistViewState restored. A view that no
|
|
1996
2034
|
// longer exists, or is on another tab, leaves the list on All.
|
|
1997
2035
|
var openingViewSettledRef = (0, react_1.useRef)(false);
|
|
2036
|
+
// INFO: keyed on the ids, so a list handed in again on every render does
|
|
2037
|
+
// not re-run the opening
|
|
2038
|
+
var starredViewIdsKey = ((_87 = (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.defaultSavedViewIds) !== null && _87 !== void 0 ? _87 : []).join("|");
|
|
1998
2039
|
(0, react_1.useEffect)(function () {
|
|
1999
|
-
var _a, _b, _c, _d
|
|
2040
|
+
var _a, _b, _c, _d;
|
|
2000
2041
|
if (!isSavedViewsEnabled || openingViewSettledRef.current)
|
|
2001
2042
|
return;
|
|
2002
2043
|
// INFO: a link opens on All with only its keyword, never on a ★ view
|
|
@@ -2011,7 +2052,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2011
2052
|
setIsViewDraftReady(true);
|
|
2012
2053
|
return;
|
|
2013
2054
|
}
|
|
2014
|
-
var wantedId = (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.initialSavedViewId) !== null && _c !== void 0 ? _c : (
|
|
2055
|
+
var wantedId = (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.initialSavedViewId) !== null && _c !== void 0 ? _c : handleGetStarredViewId();
|
|
2015
2056
|
if (!wantedId) {
|
|
2016
2057
|
// INFO: All opens with its stored settings and this person's changes
|
|
2017
2058
|
if (isViewDraftsEnabled) {
|
|
@@ -2022,7 +2063,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2022
2063
|
return;
|
|
2023
2064
|
}
|
|
2024
2065
|
// INFO: the app's views may still be loading
|
|
2025
|
-
if (isAppViews && ((
|
|
2066
|
+
if (isAppViews && ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.sharedViews) === undefined)
|
|
2026
2067
|
return;
|
|
2027
2068
|
openingViewSettledRef.current = true;
|
|
2028
2069
|
var view = handleGetTabSavedViews().find(function (eachView) { return eachView.id === wantedId; });
|
|
@@ -2032,23 +2073,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2032
2073
|
/* eslint-disable */
|
|
2033
2074
|
}, [
|
|
2034
2075
|
isSavedViewsEnabled,
|
|
2035
|
-
(
|
|
2036
|
-
|
|
2037
|
-
(
|
|
2076
|
+
(_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.initialSavedViewId,
|
|
2077
|
+
starredViewIdsKey,
|
|
2078
|
+
(_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.sharedViews,
|
|
2038
2079
|
savedViews,
|
|
2039
2080
|
]);
|
|
2040
2081
|
/* eslint-enable */
|
|
2041
|
-
var
|
|
2082
|
+
var appDefaultViewIds = ((_91 = (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.defaultSavedViews) !== null && _91 !== void 0 ? _91 : [])
|
|
2042
2083
|
.map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
|
|
2043
2084
|
.join("|");
|
|
2044
2085
|
// INFO: keyed on the ids, not the array, so an inline literal passed on every
|
|
2045
2086
|
// render does not repeat the warning on every render
|
|
2046
2087
|
(0, react_1.useEffect)(function () {
|
|
2047
|
-
var ids =
|
|
2088
|
+
var ids = appDefaultViewIds.split("|").filter(Boolean);
|
|
2048
2089
|
var repeated = ids.filter(function (eachId, index) { return ids.indexOf(eachId) !== index; });
|
|
2049
2090
|
if (repeated.length > 0)
|
|
2050
2091
|
console.warn("DataTemplate: defaultSavedViews ids must be unique, repeated: ".concat(Array.from(new Set(repeated)).join(", ")));
|
|
2051
|
-
}, [
|
|
2092
|
+
}, [appDefaultViewIds]);
|
|
2052
2093
|
// INFO: a view is the defaults overridden by its own fields, so a field it
|
|
2053
2094
|
// leaves out is reset rather than carried over from whatever was on screen
|
|
2054
2095
|
var handleResolveViewState = function (state) {
|
|
@@ -2273,11 +2314,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2273
2314
|
else
|
|
2274
2315
|
handleStoreSavedViews(rename);
|
|
2275
2316
|
};
|
|
2317
|
+
// INFO: the dragged view takes the place of the one it is dropped on, in the
|
|
2318
|
+
// stored list that keeps every tab's views
|
|
2319
|
+
var handleMoveSavedView = function (fromId, toId) {
|
|
2320
|
+
if (!fromId || fromId === toId)
|
|
2321
|
+
return;
|
|
2322
|
+
var move = function (list) {
|
|
2323
|
+
var fromIndex = list.findIndex(function (eachView) { return eachView.id === fromId; });
|
|
2324
|
+
var toIndex = list.findIndex(function (eachView) { return eachView.id === toId; });
|
|
2325
|
+
if (fromIndex < 0 || toIndex < 0)
|
|
2326
|
+
return list;
|
|
2327
|
+
var next = __spreadArray([], list, true);
|
|
2328
|
+
var moved = next.splice(fromIndex, 1)[0];
|
|
2329
|
+
next.splice(toIndex, 0, moved);
|
|
2330
|
+
return next;
|
|
2331
|
+
};
|
|
2332
|
+
if (isAppViews)
|
|
2333
|
+
handleStoreSharedViews(move);
|
|
2334
|
+
else
|
|
2335
|
+
handleStoreSavedViews(move);
|
|
2336
|
+
};
|
|
2276
2337
|
var handleDeleteSavedView = function (id) {
|
|
2277
|
-
var _a, _b, _c;
|
|
2278
|
-
// INFO: a deleted
|
|
2279
|
-
|
|
2280
|
-
|
|
2338
|
+
var _a, _b, _c, _d;
|
|
2339
|
+
// INFO: a deleted ★ view leaves its tab opening on All
|
|
2340
|
+
var starredIds = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.defaultSavedViewIds) !== null && _b !== void 0 ? _b : [];
|
|
2341
|
+
if (starredIds.includes(id))
|
|
2342
|
+
(_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onChangeDefaultSavedViewIds) === null || _d === void 0 ? void 0 : _d.call(_c, starredIds.filter(function (eachId) { return eachId !== id; }));
|
|
2281
2343
|
if (isAppViews)
|
|
2282
2344
|
handleStoreSharedViews(function (views) {
|
|
2283
2345
|
return views.filter(function (eachView) { return eachView.id !== id; });
|
|
@@ -2414,8 +2476,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2414
2476
|
groupId,
|
|
2415
2477
|
columnWidths,
|
|
2416
2478
|
pinnedColumnIds,
|
|
2417
|
-
(
|
|
2418
|
-
(
|
|
2479
|
+
(_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.allView,
|
|
2480
|
+
(_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.sharedViews,
|
|
2419
2481
|
savedViews,
|
|
2420
2482
|
]);
|
|
2421
2483
|
/* eslint-enable */
|
|
@@ -2459,7 +2521,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2459
2521
|
if (scrollRestoredRef.current)
|
|
2460
2522
|
scrollCatchUpRef.current = null;
|
|
2461
2523
|
/* eslint-disable */
|
|
2462
|
-
}, [props.collectionId, (
|
|
2524
|
+
}, [props.collectionId, (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.persistKey]);
|
|
2463
2525
|
/* eslint-enable */
|
|
2464
2526
|
// INFO: wait a frame — rows land in state one tick before layout
|
|
2465
2527
|
(0, react_1.useEffect)(function () {
|
|
@@ -2494,7 +2556,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2494
2556
|
(0, react_1.useEffect)(function () {
|
|
2495
2557
|
handleOfflinePrefetch();
|
|
2496
2558
|
/* eslint-disable */
|
|
2497
|
-
}, [props.collectionId, (
|
|
2559
|
+
}, [props.collectionId, (_95 = props.bareSettings) === null || _95 === void 0 ? void 0 : _95.bareOffline]);
|
|
2498
2560
|
/* eslint-enable */
|
|
2499
2561
|
// INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
|
|
2500
2562
|
// Calls through handleRefreshRef so the interval always dispatches the latest
|
|
@@ -2514,7 +2576,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2514
2576
|
}, interval);
|
|
2515
2577
|
return function () { return clearInterval(timer); };
|
|
2516
2578
|
/* eslint-disable */
|
|
2517
|
-
}, [(
|
|
2579
|
+
}, [(_96 = props.bareSettings) === null || _96 === void 0 ? void 0 : _96.barePollingInterval, isLive, isNetworkOffline]);
|
|
2518
2580
|
/* eslint-enable */
|
|
2519
2581
|
// INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
|
|
2520
2582
|
// EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
|
|
@@ -2556,7 +2618,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2556
2618
|
};
|
|
2557
2619
|
/* eslint-disable */
|
|
2558
2620
|
}, [
|
|
2559
|
-
(
|
|
2621
|
+
(_97 = props.bareSettings) === null || _97 === void 0 ? void 0 : _97.bareSocketName,
|
|
2560
2622
|
props.collectionId,
|
|
2561
2623
|
props.devSettings.sseEndpoint,
|
|
2562
2624
|
props.devSettings.dbAPIToken,
|
|
@@ -2830,10 +2892,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2830
2892
|
props.collectionId,
|
|
2831
2893
|
props.model,
|
|
2832
2894
|
props.localURLEndpoint,
|
|
2833
|
-
(
|
|
2895
|
+
(_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.extendedTabs,
|
|
2834
2896
|
listViewId,
|
|
2835
|
-
(
|
|
2836
|
-
(
|
|
2897
|
+
(_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.additionalQuery,
|
|
2898
|
+
(_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.groupBy,
|
|
2837
2899
|
resolvedType,
|
|
2838
2900
|
]);
|
|
2839
2901
|
/**
|
|
@@ -2985,7 +3047,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2985
3047
|
};
|
|
2986
3048
|
}, 100);
|
|
2987
3049
|
return function () { return clearTimeout(timeoutId); };
|
|
2988
|
-
}, [(
|
|
3050
|
+
}, [(_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.showReadFloatingNav, resolvedType, props.id, loading]);
|
|
2989
3051
|
(0, react_1.useEffect)(function () {
|
|
2990
3052
|
if (resolvedType !== "read")
|
|
2991
3053
|
return;
|
|
@@ -3984,6 +4046,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
3984
4046
|
setActiveTab(tabId);
|
|
3985
4047
|
(_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateTabId) === null || _b === void 0 ? void 0 : _b.call(_a, tabId);
|
|
3986
4048
|
};
|
|
4049
|
+
// INFO: Table View stays first, so a drag only moves the tabs after it
|
|
4050
|
+
var handleDragTabs = function (nextTabs) { return setDraggedTabs(nextTabs); };
|
|
4051
|
+
// INFO: the order is saved once, on drop, rather than on every tab the drag
|
|
4052
|
+
// passes; tabs of the other type (read or list) keep their places
|
|
4053
|
+
var handleDropTabs = function () {
|
|
4054
|
+
var _a, _b, _c, _d;
|
|
4055
|
+
if (!draggedTabs)
|
|
4056
|
+
return;
|
|
4057
|
+
var orderIds = draggedTabs.map(function (eachTab) { return eachTab.id; });
|
|
4058
|
+
var allTabs = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) !== null && _b !== void 0 ? _b : [];
|
|
4059
|
+
var handleIndex = function (eachTab) {
|
|
4060
|
+
return orderIds.indexOf((0, utils_1.lowercaseTextToId)(eachTab.name));
|
|
4061
|
+
};
|
|
4062
|
+
var moved = allTabs
|
|
4063
|
+
.filter(function (eachTab) { return eachTab.type === resolvedType; })
|
|
4064
|
+
.sort(function (left, right) { return handleIndex(left) - handleIndex(right); });
|
|
4065
|
+
var movedIndex = 0;
|
|
4066
|
+
var nextTabs = allTabs.map(function (eachTab) {
|
|
4067
|
+
return eachTab.type === resolvedType ? moved[movedIndex++] : eachTab;
|
|
4068
|
+
});
|
|
4069
|
+
setDraggedTabs(null);
|
|
4070
|
+
if (nextTabs.some(function (eachTab, index) { return eachTab !== allTabs[index]; }))
|
|
4071
|
+
(_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onChangeTabs) === null || _d === void 0 ? void 0 : _d.call(_c, nextTabs);
|
|
4072
|
+
};
|
|
3987
4073
|
var handleSelectTab = function (id) {
|
|
3988
4074
|
var _a, _b;
|
|
3989
4075
|
if (id === "blixify_new_tab") {
|
|
@@ -4464,12 +4550,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4464
4550
|
// INFO: the list as it opens without a link — the state persistViewState
|
|
4465
4551
|
// kept, else the ★ view or All, with this person's draft
|
|
4466
4552
|
var handleOpenListNormally = function () {
|
|
4467
|
-
var _a, _b
|
|
4553
|
+
var _a, _b;
|
|
4468
4554
|
if (isPersistEnabled && persistedState) {
|
|
4469
4555
|
handleApplySavedView(null, true, undefined, persistedState);
|
|
4470
4556
|
return;
|
|
4471
4557
|
}
|
|
4472
|
-
var wantedId = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSavedViewId) !== null && _b !== void 0 ? _b : (
|
|
4558
|
+
var wantedId = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSavedViewId) !== null && _b !== void 0 ? _b : handleGetStarredViewId();
|
|
4473
4559
|
var view = isSavedViewsEnabled && wantedId
|
|
4474
4560
|
? handleGetTabSavedViews().find(function (eachView) { return eachView.id === wantedId; })
|
|
4475
4561
|
: undefined;
|
|
@@ -4480,7 +4566,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4480
4566
|
// the link view ends and the list opens as it normally would. A change
|
|
4481
4567
|
// while a record is open (opening one drops the link from the URL) waits
|
|
4482
4568
|
// until the list shows again
|
|
4483
|
-
var lastInitialSearchRef = (0, react_1.useRef)((
|
|
4569
|
+
var lastInitialSearchRef = (0, react_1.useRef)((_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.initialSearch);
|
|
4484
4570
|
// INFO: persistViewState reads its stored state only once the link view
|
|
4485
4571
|
// has ended, a render later
|
|
4486
4572
|
var isNormalOpenPendingRef = (0, react_1.useRef)(false);
|
|
@@ -4507,7 +4593,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4507
4593
|
setIsLinkOpen(true);
|
|
4508
4594
|
handleApplySavedView(null, true, value);
|
|
4509
4595
|
/* eslint-disable */
|
|
4510
|
-
}, [(
|
|
4596
|
+
}, [(_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.initialSearch, resolvedType]);
|
|
4511
4597
|
(0, react_1.useEffect)(function () {
|
|
4512
4598
|
if (!isNormalOpenPendingRef.current || isLinkOpen)
|
|
4513
4599
|
return;
|
|
@@ -6244,7 +6330,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6244
6330
|
var columnTypeActions = {
|
|
6245
6331
|
canUpdate: canUpdateRecord,
|
|
6246
6332
|
dateWarnings: isDateWarnings,
|
|
6247
|
-
onButtonClick: (
|
|
6333
|
+
onButtonClick: (_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.onButtonClick,
|
|
6248
6334
|
onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6249
6335
|
var _a;
|
|
6250
6336
|
return __generator(this, function (_b) {
|
|
@@ -6261,7 +6347,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6261
6347
|
}
|
|
6262
6348
|
});
|
|
6263
6349
|
}); },
|
|
6264
|
-
onTimeTrackingAction: ((
|
|
6350
|
+
onTimeTrackingAction: ((_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.onTimeTrackingAction) && canUpdateRecord
|
|
6265
6351
|
? function (rowId, columnId, action) {
|
|
6266
6352
|
return handleTimeTrackingAction(rowId, columnId, action);
|
|
6267
6353
|
}
|
|
@@ -8505,8 +8591,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8505
8591
|
: rows;
|
|
8506
8592
|
};
|
|
8507
8593
|
/* eslint-disable */
|
|
8508
|
-
var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (
|
|
8509
|
-
var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (
|
|
8594
|
+
var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_106 = props.bareSettings) === null || _106 === void 0 ? void 0 : _106.bareNewDTW]);
|
|
8595
|
+
var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_107 = props.bareSettings) === null || _107 === void 0 ? void 0 : _107.bareNewDTW]);
|
|
8510
8596
|
/* eslint-enable */
|
|
8511
8597
|
// INFO: beside a record's title, the pencil opens its edit form for whoever
|
|
8512
8598
|
// may update, and the bubble opens comments and logs for anyone who can see
|
|
@@ -9332,7 +9418,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
9332
9418
|
handleNavigateFromDrawer("list", "");
|
|
9333
9419
|
} }))); } })); };
|
|
9334
9420
|
var renderContent = function () {
|
|
9335
|
-
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;
|
|
9421
|
+
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;
|
|
9336
9422
|
var isBottom = ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom) ? true : false;
|
|
9337
9423
|
var tabs = renderTabs();
|
|
9338
9424
|
var pages = [
|
|
@@ -9928,23 +10014,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
9928
10014
|
renderListFilterElements(),
|
|
9929
10015
|
renderListActionElements())),
|
|
9930
10016
|
renderListNewRowFilterElements(),
|
|
9931
|
-
(schemaPresent || ((_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.bareReadListTabs)) && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); },
|
|
10017
|
+
(schemaPresent || ((_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.bareReadListTabs)) && (react_1.default.createElement(tabs_1.Tabs, { tabs: draggedTabs !== null && draggedTabs !== void 0 ? draggedTabs : tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, draggable: isEditor && !!((_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.onChangeTabs), handleChangeTabs: handleDragTabs, handleDropEnd: handleDropTabs, darkMode: (_43 = props.organise) === null || _43 === void 0 ? void 0 : _43.darkMode })),
|
|
9932
10018
|
renderScopedTabContent(tabs, resolvedType, viewType),
|
|
9933
|
-
((
|
|
9934
|
-
((
|
|
10019
|
+
((_44 = props.bareSettings) === null || _44 === void 0 ? void 0 : _44.bareListMobileFloatingSearch) && (react_1.default.createElement("div", { className: "h-28 md:hidden", "aria-hidden": "true" })),
|
|
10020
|
+
((_45 = props.bareSettings) === null || _45 === void 0 ? void 0 : _45.bareListMobileFloatingSearch) &&
|
|
9935
10021
|
(0, listModule_1.renderFloatingMobileSearch)({
|
|
9936
10022
|
filterSearch: filterSearch,
|
|
9937
10023
|
handleNameSearch: handleNameSearch,
|
|
9938
10024
|
onFilterClick: function () { return setFlexFilterModalOpen(true); },
|
|
9939
|
-
hideSearch: (
|
|
9940
|
-
darkMode: (
|
|
9941
|
-
floatingOffset: (
|
|
9942
|
-
hideFilter: !((
|
|
9943
|
-
activeFilterCount: ((
|
|
10025
|
+
hideSearch: (_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.hideSearch,
|
|
10026
|
+
darkMode: (_47 = props.organise) === null || _47 === void 0 ? void 0 : _47.darkMode,
|
|
10027
|
+
floatingOffset: (_48 = props.bareSettings) === null || _48 === void 0 ? void 0 : _48.bareListFloatingActionOffset,
|
|
10028
|
+
hideFilter: !((_49 = props.bareSettings) === null || _49 === void 0 ? void 0 : _49.bareFlexFilters),
|
|
10029
|
+
activeFilterCount: ((_50 = props.bareSettings) === null || _50 === void 0 ? void 0 : _50.bareFlexFilters)
|
|
9944
10030
|
? activeFlexFilterCount_1
|
|
9945
10031
|
: undefined,
|
|
9946
10032
|
// INFO: Hides when items are selected so NewTable's multi-action bar takes over.
|
|
9947
|
-
hidden: selectAll || ((
|
|
10033
|
+
hidden: selectAll || ((_51 = selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.length) !== null && _51 !== void 0 ? _51 : 0) > 0,
|
|
9948
10034
|
onRefreshClick: isMobileToolbar_1 && schemaPresent
|
|
9949
10035
|
? function () { return handleRefresh(); }
|
|
9950
10036
|
: undefined,
|
|
@@ -10346,6 +10432,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10346
10432
|
{
|
|
10347
10433
|
id: "general",
|
|
10348
10434
|
name: resolvedType === "list" ? "Table View" : "Card View",
|
|
10435
|
+
fixed: true,
|
|
10349
10436
|
href: "".concat(props.localURLEndpoint, "?data=").concat(props.id, "&type=").concat(resolvedType, "&collection=").concat(props.collectionId, "&view=general"),
|
|
10350
10437
|
},
|
|
10351
10438
|
];
|
|
@@ -10441,6 +10528,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10441
10528
|
id: "blixify_new_tab",
|
|
10442
10529
|
name: "+ New Tab",
|
|
10443
10530
|
href: "",
|
|
10531
|
+
// INFO: stays last — it opens the new tab form rather than a view
|
|
10532
|
+
fixed: true,
|
|
10444
10533
|
});
|
|
10445
10534
|
return tabs;
|
|
10446
10535
|
};
|
|
@@ -11517,7 +11606,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11517
11606
|
};
|
|
11518
11607
|
// INFO: `hidden` keeps the markers out of space-y spacing
|
|
11519
11608
|
var renderSavedViews = function () {
|
|
11520
|
-
var _a, _b, _c, _d, _e, _f
|
|
11609
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11521
11610
|
if (!isSavedViewsEnabled)
|
|
11522
11611
|
return null;
|
|
11523
11612
|
var views = handleGetTabSavedViews();
|
|
@@ -11533,10 +11622,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11533
11622
|
!activeView &&
|
|
11534
11623
|
isViewDraftsEnabled &&
|
|
11535
11624
|
!handleIsOnViewState(currentState, (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) !== null && _b !== void 0 ? _b : null);
|
|
11536
|
-
var defaultViewId = (
|
|
11537
|
-
var canStarViews = !!((
|
|
11538
|
-
var canSaveViews = !isAppViews || !!((
|
|
11539
|
-
var darkMode = (
|
|
11625
|
+
var defaultViewId = handleGetStarredViewId(views);
|
|
11626
|
+
var canStarViews = !!((_c = props.organise) === null || _c === void 0 ? void 0 : _c.onChangeDefaultSavedViewIds);
|
|
11627
|
+
var canSaveViews = !isAppViews || !!((_d = props.organise) === null || _d === void 0 ? void 0 : _d.onChangeSharedViews);
|
|
11628
|
+
var darkMode = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.darkMode;
|
|
11540
11629
|
var renderChipClass = function (active) {
|
|
11541
11630
|
return "inline-flex items-center gap-1 rounded-full border px-3 py-1 text-xs font-medium ".concat(active
|
|
11542
11631
|
? "border-primary-500 bg-primary-50 text-primary-700"
|
|
@@ -11590,7 +11679,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11590
11679
|
eachView.name,
|
|
11591
11680
|
"\u201D?",
|
|
11592
11681
|
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"),
|
|
11593
|
-
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))
|
|
11682
|
+
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, "data-testid": "dtw-saved-view-chip-".concat(eachView.id), className: "".concat(renderChipClass(eachView.id === (activeView === null || activeView === void 0 ? void 0 : activeView.id)), " ").concat(draggingSavedViewId === eachView.id ? "opacity-50" : "", " ").concat(canSaveViews && !eachView.locked ? "cursor-grab" : ""), draggable: canSaveViews && !eachView.locked, onDragStart: function (event) {
|
|
11683
|
+
event.dataTransfer.effectAllowed = "move";
|
|
11684
|
+
event.dataTransfer.setData("text/plain", eachView.id);
|
|
11685
|
+
setDraggingSavedViewId(eachView.id);
|
|
11686
|
+
}, onDragOver: function (event) {
|
|
11687
|
+
if (draggingSavedViewId && !eachView.locked)
|
|
11688
|
+
event.preventDefault();
|
|
11689
|
+
}, onDrop: function (event) {
|
|
11690
|
+
event.preventDefault();
|
|
11691
|
+
handleMoveSavedView(draggingSavedViewId, eachView.id);
|
|
11692
|
+
setDraggingSavedViewId(null);
|
|
11693
|
+
}, onDragEnd: function () { return setDraggingSavedViewId(null); } },
|
|
11594
11694
|
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
|
|
11595
11695
|
? "Changed since saved"
|
|
11596
11696
|
: undefined, onClick: function () { return handleApplySavedView(eachView); } },
|
|
@@ -11601,10 +11701,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11601
11701
|
? "Stop opening on ".concat(eachView.name)
|
|
11602
11702
|
: "Open on ".concat(eachView.name, " for everyone"), "data-testid": "dtw-saved-view-star-".concat(eachView.id), className: eachView.id === defaultViewId
|
|
11603
11703
|
? "text-yellow-500"
|
|
11604
|
-
: "text-gray-400 hover:text-yellow-500", onClick: function () {
|
|
11605
|
-
var _a, _b;
|
|
11606
|
-
return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeDefaultSavedViewId) === null || _b === void 0 ? void 0 : _b.call(_a, eachView.id === defaultViewId ? null : eachView.id);
|
|
11607
|
-
} }, eachView.id === defaultViewId ? "★" : "☆")),
|
|
11704
|
+
: "text-gray-400 hover:text-yellow-500", onClick: function () { return handleStarSavedView(eachView.id); } }, eachView.id === defaultViewId ? "★" : "☆")),
|
|
11608
11705
|
!eachView.locked && (react_1.default.createElement("button", { type: "button", "aria-label": "Rename ".concat(eachView.name), "data-testid": "dtw-saved-view-rename-".concat(eachView.id), className: "text-gray-400 hover:text-gray-600", onClick: function () {
|
|
11609
11706
|
return setRenamingSavedView({
|
|
11610
11707
|
id: eachView.id,
|
|
@@ -11624,7 +11721,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11624
11721
|
"Update \u201C",
|
|
11625
11722
|
activeView.name,
|
|
11626
11723
|
"\u201D")),
|
|
11627
|
-
isAllModified && ((
|
|
11724
|
+
isAllModified && ((_f = props.organise) === null || _f === void 0 ? void 0 : _f.onChangeAllView) && (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-update-all", className: actionClass, onClick: handleUpdateAllView }, "Update All")),
|
|
11628
11725
|
((activeView && isModified && isViewDraftsEnabled) ||
|
|
11629
11726
|
isAllModified) && (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-reset", className: "text-xs font-medium ".concat(darkMode ? "text-gray-300" : "text-gray-500", " hover:underline"), onClick: handleResetView }, "Reset")),
|
|
11630
11727
|
!canSaveViews ? null : savedViewName === null ? (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-new", className: actionClass, onClick: function () { return setSavedViewName(""); } }, "+ Save view")) : (
|
|
@@ -13092,14 +13189,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13092
13189
|
};
|
|
13093
13190
|
return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
|
|
13094
13191
|
renderNotification("root"),
|
|
13095
|
-
((
|
|
13192
|
+
((_109 = (_108 = props.renderSettings) === null || _108 === void 0 ? void 0 : _108.renderLoadingUI) === null || _109 === void 0 ? void 0 : _109.call(_108)) && loading ? ((_110 = props.renderSettings) === null || _110 === void 0 ? void 0 : _110.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_111 = props.organise) === null || _111 === void 0 ? void 0 : _111.darkMode, darkModeBg: (_112 = props.organise) === null || _112 === void 0 ? void 0 : _112.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
|
|
13096
13193
|
var _a, _b;
|
|
13097
13194
|
if (loading)
|
|
13098
13195
|
return;
|
|
13099
13196
|
handlePopUpModal(false);
|
|
13100
13197
|
setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
|
|
13101
13198
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
|
|
13102
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13199
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_113 = props.organise) === null || _113 === void 0 ? void 0 : _113.darkMode, darkModeBg: (_114 = props.organise) === null || _114 === void 0 ? void 0 : _114.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
|
|
13103
13200
|
return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
|
|
13104
13201
|
if (dataId) {
|
|
13105
13202
|
var currentValue = selectedData[referenceCreationModal.id];
|
|
@@ -13115,19 +13212,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13115
13212
|
}, onClose: function () {
|
|
13116
13213
|
setReferenceCreationModal({ id: "", name: "", type: "string" });
|
|
13117
13214
|
} }),
|
|
13118
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13215
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_115 = props.organise) === null || _115 === void 0 ? void 0 : _115.darkMode, darkModeBg: (_116 = props.organise) === null || _116 === void 0 ? void 0 : _116.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
|
|
13119
13216
|
setReferenceDeleteTableData({});
|
|
13120
13217
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13121
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13218
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_117 = props.organise) === null || _117 === void 0 ? void 0 : _117.darkMode, darkModeBg: (_118 = props.organise) === null || _118 === void 0 ? void 0 : _118.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
|
|
13122
13219
|
setDeletePasscodeInput("");
|
|
13123
13220
|
setDeleteModal(!deleteModal);
|
|
13124
13221
|
setDeleteFeedId("");
|
|
13125
13222
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13126
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13223
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_119 = props.organise) === null || _119 === void 0 ? void 0 : _119.darkMode, darkModeBg: (_120 = props.organise) === null || _120 === void 0 ? void 0 : _120.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
|
|
13127
13224
|
setBatchUpdateData({ columnId: "", columnData: {} });
|
|
13128
13225
|
setBatchUpdateModal(false);
|
|
13129
13226
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13130
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
13227
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_121 = props.organise) === null || _121 === void 0 ? void 0 : _121.darkMode, darkModeBg: (_122 = props.organise) === null || _122 === void 0 ? void 0 : _122.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
|
|
13131
13228
|
var _a, _b;
|
|
13132
13229
|
if (props.space)
|
|
13133
13230
|
return (react_1.default.createElement(authModal_1.AuthModal, { space: props.space, userId: (_a = props.id) !== null && _a !== void 0 ? _a : "", client: (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, type: selectedAuthMethod, authMethods: authMethods, onComplete: handleAuthComplete }));
|
|
@@ -13144,11 +13241,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13144
13241
|
(0, react_dom_1.createPortal)(
|
|
13145
13242
|
// INFO: z-50 lifts it over a Modal the table may sit in (z-40)
|
|
13146
13243
|
react_1.default.createElement("div", { className: "relative z-50" },
|
|
13147
|
-
react_1.default.createElement(drawer_1.Drawer, { darkMode: (
|
|
13244
|
+
react_1.default.createElement(drawer_1.Drawer, { darkMode: (_123 = props.organise) === null || _123 === void 0 ? void 0 : _123.darkMode, darkModeBg: (_124 = props.organise) === null || _124 === void 0 ? void 0 : _124.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
|
|
13148
13245
|
// INFO: the record stays set while the drawer slides out — clearing it
|
|
13149
13246
|
// would remount the hidden panel collection-wide and fetch again. The
|
|
13150
13247
|
// toolbar's collection-wide button clears it when it opens.
|
|
13151
|
-
onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75", title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((
|
|
13248
|
+
onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75", title: "Activity Log", content: renderActivityPanel(resolvedType === "read" ? ((_125 = props.id) !== null && _125 !== void 0 ? _125 : "") : activityId) })), document.body),
|
|
13152
13249
|
renderScrollSentinel()));
|
|
13153
13250
|
});
|
|
13154
13251
|
//# sourceMappingURL=index.js.map
|