blixify-ui-web 1.3.10 → 1.3.12
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 +430 -228
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.d.ts +16 -0
- package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.js +129 -23
- package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
- package/lib/components/data/dataTemplate/spaceModel.d.ts +2 -0
- package/lib/components/data/dataTemplate/spaceModel.d.ts.map +1 -1
- package/lib/components/display/mapView/index.d.ts +20 -3
- package/lib/components/display/mapView/index.d.ts.map +1 -1
- package/lib/components/display/mapView/index.js +253 -21
- package/lib/components/display/mapView/index.js.map +1 -1
- package/lib/components/display/mapView/routes.d.ts +38 -8
- package/lib/components/display/mapView/routes.d.ts.map +1 -1
- package/lib/components/display/mapView/routes.js +216 -15
- package/lib/components/display/mapView/routes.js.map +1 -1
- package/lib/components/display/newKanban/index.d.ts +27 -0
- package/lib/components/display/newKanban/index.d.ts.map +1 -1
- package/lib/components/display/newKanban/index.js +295 -21
- package/lib/components/display/newKanban/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/lib/tail.css +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; });
|
|
@@ -2299,7 +2361,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2299
2361
|
var rowIndex = recordId
|
|
2300
2362
|
? tableData.findIndex(function (row) { return (row === null || row === void 0 ? void 0 : row.id) === recordId || (row === null || row === void 0 ? void 0 : row.recordId) === recordId; })
|
|
2301
2363
|
: -1;
|
|
2302
|
-
return rowIndex >= 0 && limit > 0
|
|
2364
|
+
return rowIndex >= 0 && limit > 0
|
|
2365
|
+
? Math.floor(rowIndex / limit)
|
|
2366
|
+
: pageIndex;
|
|
2303
2367
|
};
|
|
2304
2368
|
// INFO: called in the row click, while the list is still mounted and scrolled
|
|
2305
2369
|
var handleCaptureListScroll = function (recordId) {
|
|
@@ -2412,8 +2476,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2412
2476
|
groupId,
|
|
2413
2477
|
columnWidths,
|
|
2414
2478
|
pinnedColumnIds,
|
|
2415
|
-
(
|
|
2416
|
-
(
|
|
2479
|
+
(_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.allView,
|
|
2480
|
+
(_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.sharedViews,
|
|
2417
2481
|
savedViews,
|
|
2418
2482
|
]);
|
|
2419
2483
|
/* eslint-enable */
|
|
@@ -2457,7 +2521,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2457
2521
|
if (scrollRestoredRef.current)
|
|
2458
2522
|
scrollCatchUpRef.current = null;
|
|
2459
2523
|
/* eslint-disable */
|
|
2460
|
-
}, [props.collectionId, (
|
|
2524
|
+
}, [props.collectionId, (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.persistKey]);
|
|
2461
2525
|
/* eslint-enable */
|
|
2462
2526
|
// INFO: wait a frame — rows land in state one tick before layout
|
|
2463
2527
|
(0, react_1.useEffect)(function () {
|
|
@@ -2492,7 +2556,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2492
2556
|
(0, react_1.useEffect)(function () {
|
|
2493
2557
|
handleOfflinePrefetch();
|
|
2494
2558
|
/* eslint-disable */
|
|
2495
|
-
}, [props.collectionId, (
|
|
2559
|
+
}, [props.collectionId, (_95 = props.bareSettings) === null || _95 === void 0 ? void 0 : _95.bareOffline]);
|
|
2496
2560
|
/* eslint-enable */
|
|
2497
2561
|
// INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
|
|
2498
2562
|
// Calls through handleRefreshRef so the interval always dispatches the latest
|
|
@@ -2512,7 +2576,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2512
2576
|
}, interval);
|
|
2513
2577
|
return function () { return clearInterval(timer); };
|
|
2514
2578
|
/* eslint-disable */
|
|
2515
|
-
}, [(
|
|
2579
|
+
}, [(_96 = props.bareSettings) === null || _96 === void 0 ? void 0 : _96.barePollingInterval, isLive, isNetworkOffline]);
|
|
2516
2580
|
/* eslint-enable */
|
|
2517
2581
|
// INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
|
|
2518
2582
|
// EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
|
|
@@ -2554,7 +2618,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2554
2618
|
};
|
|
2555
2619
|
/* eslint-disable */
|
|
2556
2620
|
}, [
|
|
2557
|
-
(
|
|
2621
|
+
(_97 = props.bareSettings) === null || _97 === void 0 ? void 0 : _97.bareSocketName,
|
|
2558
2622
|
props.collectionId,
|
|
2559
2623
|
props.devSettings.sseEndpoint,
|
|
2560
2624
|
props.devSettings.dbAPIToken,
|
|
@@ -2828,10 +2892,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2828
2892
|
props.collectionId,
|
|
2829
2893
|
props.model,
|
|
2830
2894
|
props.localURLEndpoint,
|
|
2831
|
-
(
|
|
2895
|
+
(_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.extendedTabs,
|
|
2832
2896
|
listViewId,
|
|
2833
|
-
(
|
|
2834
|
-
(
|
|
2897
|
+
(_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.additionalQuery,
|
|
2898
|
+
(_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.groupBy,
|
|
2835
2899
|
resolvedType,
|
|
2836
2900
|
]);
|
|
2837
2901
|
/**
|
|
@@ -2983,7 +3047,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
2983
3047
|
};
|
|
2984
3048
|
}, 100);
|
|
2985
3049
|
return function () { return clearTimeout(timeoutId); };
|
|
2986
|
-
}, [(
|
|
3050
|
+
}, [(_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.showReadFloatingNav, resolvedType, props.id, loading]);
|
|
2987
3051
|
(0, react_1.useEffect)(function () {
|
|
2988
3052
|
if (resolvedType !== "read")
|
|
2989
3053
|
return;
|
|
@@ -3982,6 +4046,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
3982
4046
|
setActiveTab(tabId);
|
|
3983
4047
|
(_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateTabId) === null || _b === void 0 ? void 0 : _b.call(_a, tabId);
|
|
3984
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
|
+
};
|
|
3985
4073
|
var handleSelectTab = function (id) {
|
|
3986
4074
|
var _a, _b;
|
|
3987
4075
|
if (id === "blixify_new_tab") {
|
|
@@ -4462,12 +4550,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4462
4550
|
// INFO: the list as it opens without a link — the state persistViewState
|
|
4463
4551
|
// kept, else the ★ view or All, with this person's draft
|
|
4464
4552
|
var handleOpenListNormally = function () {
|
|
4465
|
-
var _a, _b
|
|
4553
|
+
var _a, _b;
|
|
4466
4554
|
if (isPersistEnabled && persistedState) {
|
|
4467
4555
|
handleApplySavedView(null, true, undefined, persistedState);
|
|
4468
4556
|
return;
|
|
4469
4557
|
}
|
|
4470
|
-
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();
|
|
4471
4559
|
var view = isSavedViewsEnabled && wantedId
|
|
4472
4560
|
? handleGetTabSavedViews().find(function (eachView) { return eachView.id === wantedId; })
|
|
4473
4561
|
: undefined;
|
|
@@ -4478,7 +4566,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4478
4566
|
// the link view ends and the list opens as it normally would. A change
|
|
4479
4567
|
// while a record is open (opening one drops the link from the URL) waits
|
|
4480
4568
|
// until the list shows again
|
|
4481
|
-
var lastInitialSearchRef = (0, react_1.useRef)((
|
|
4569
|
+
var lastInitialSearchRef = (0, react_1.useRef)((_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.initialSearch);
|
|
4482
4570
|
// INFO: persistViewState reads its stored state only once the link view
|
|
4483
4571
|
// has ended, a render later
|
|
4484
4572
|
var isNormalOpenPendingRef = (0, react_1.useRef)(false);
|
|
@@ -4505,7 +4593,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
4505
4593
|
setIsLinkOpen(true);
|
|
4506
4594
|
handleApplySavedView(null, true, value);
|
|
4507
4595
|
/* eslint-disable */
|
|
4508
|
-
}, [(
|
|
4596
|
+
}, [(_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.initialSearch, resolvedType]);
|
|
4509
4597
|
(0, react_1.useEffect)(function () {
|
|
4510
4598
|
if (!isNormalOpenPendingRef.current || isLinkOpen)
|
|
4511
4599
|
return;
|
|
@@ -6242,7 +6330,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6242
6330
|
var columnTypeActions = {
|
|
6243
6331
|
canUpdate: canUpdateRecord,
|
|
6244
6332
|
dateWarnings: isDateWarnings,
|
|
6245
|
-
onButtonClick: (
|
|
6333
|
+
onButtonClick: (_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.onButtonClick,
|
|
6246
6334
|
onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6247
6335
|
var _a;
|
|
6248
6336
|
return __generator(this, function (_b) {
|
|
@@ -6259,7 +6347,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
6259
6347
|
}
|
|
6260
6348
|
});
|
|
6261
6349
|
}); },
|
|
6262
|
-
onTimeTrackingAction: ((
|
|
6350
|
+
onTimeTrackingAction: ((_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.onTimeTrackingAction) && canUpdateRecord
|
|
6263
6351
|
? function (rowId, columnId, action) {
|
|
6264
6352
|
return handleTimeTrackingAction(rowId, columnId, action);
|
|
6265
6353
|
}
|
|
@@ -8503,8 +8591,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
8503
8591
|
: rows;
|
|
8504
8592
|
};
|
|
8505
8593
|
/* eslint-disable */
|
|
8506
|
-
var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (
|
|
8507
|
-
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]);
|
|
8508
8596
|
/* eslint-enable */
|
|
8509
8597
|
// INFO: beside a record's title, the pencil opens its edit form for whoever
|
|
8510
8598
|
// may update, and the bubble opens comments and logs for anyone who can see
|
|
@@ -9330,7 +9418,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
9330
9418
|
handleNavigateFromDrawer("list", "");
|
|
9331
9419
|
} }))); } })); };
|
|
9332
9420
|
var renderContent = function () {
|
|
9333
|
-
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;
|
|
9334
9422
|
var isBottom = ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom) ? true : false;
|
|
9335
9423
|
var tabs = renderTabs();
|
|
9336
9424
|
var pages = [
|
|
@@ -9926,23 +10014,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
9926
10014
|
renderListFilterElements(),
|
|
9927
10015
|
renderListActionElements())),
|
|
9928
10016
|
renderListNewRowFilterElements(),
|
|
9929
|
-
(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 })),
|
|
9930
10018
|
renderScopedTabContent(tabs, resolvedType, viewType),
|
|
9931
|
-
((
|
|
9932
|
-
((
|
|
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) &&
|
|
9933
10021
|
(0, listModule_1.renderFloatingMobileSearch)({
|
|
9934
10022
|
filterSearch: filterSearch,
|
|
9935
10023
|
handleNameSearch: handleNameSearch,
|
|
9936
10024
|
onFilterClick: function () { return setFlexFilterModalOpen(true); },
|
|
9937
|
-
hideSearch: (
|
|
9938
|
-
darkMode: (
|
|
9939
|
-
floatingOffset: (
|
|
9940
|
-
hideFilter: !((
|
|
9941
|
-
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)
|
|
9942
10030
|
? activeFlexFilterCount_1
|
|
9943
10031
|
: undefined,
|
|
9944
10032
|
// INFO: Hides when items are selected so NewTable's multi-action bar takes over.
|
|
9945
|
-
hidden: selectAll || ((
|
|
10033
|
+
hidden: selectAll || ((_51 = selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.length) !== null && _51 !== void 0 ? _51 : 0) > 0,
|
|
9946
10034
|
onRefreshClick: isMobileToolbar_1 && schemaPresent
|
|
9947
10035
|
? function () { return handleRefresh(); }
|
|
9948
10036
|
: undefined,
|
|
@@ -10344,6 +10432,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10344
10432
|
{
|
|
10345
10433
|
id: "general",
|
|
10346
10434
|
name: resolvedType === "list" ? "Table View" : "Card View",
|
|
10435
|
+
fixed: true,
|
|
10347
10436
|
href: "".concat(props.localURLEndpoint, "?data=").concat(props.id, "&type=").concat(resolvedType, "&collection=").concat(props.collectionId, "&view=general"),
|
|
10348
10437
|
},
|
|
10349
10438
|
];
|
|
@@ -10439,6 +10528,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10439
10528
|
id: "blixify_new_tab",
|
|
10440
10529
|
name: "+ New Tab",
|
|
10441
10530
|
href: "",
|
|
10531
|
+
// INFO: stays last — it opens the new tab form rather than a view
|
|
10532
|
+
fixed: true,
|
|
10442
10533
|
});
|
|
10443
10534
|
return tabs;
|
|
10444
10535
|
};
|
|
@@ -10498,6 +10589,76 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10498
10589
|
var nextTabs = ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) !== null && _b !== void 0 ? _b : []).map(function (eachTab) { return (__assign(__assign({}, eachTab), { defaultTab: eachTab.name === name ? !eachTab.defaultTab : false })); });
|
|
10499
10590
|
(_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onChangeTabs) === null || _d === void 0 ? void 0 : _d.call(_c, nextTabs);
|
|
10500
10591
|
};
|
|
10592
|
+
// INFO: a Kanban drop or a route planned on the map can change a few
|
|
10593
|
+
// records at once — a stop's lane or trip, and the sequence of the stops
|
|
10594
|
+
// around it. Each is saved with only its changed fields, then patched into
|
|
10595
|
+
// the list in place
|
|
10596
|
+
var handleSaveRecordChanges = function (changes) { return __awaiter(void 0, void 0, void 0, function () {
|
|
10597
|
+
var _loop_3, _i, changes_1, eachChange, err_29;
|
|
10598
|
+
var _a;
|
|
10599
|
+
return __generator(this, function (_b) {
|
|
10600
|
+
switch (_b.label) {
|
|
10601
|
+
case 0:
|
|
10602
|
+
setKanbanDroppable(false);
|
|
10603
|
+
_b.label = 1;
|
|
10604
|
+
case 1:
|
|
10605
|
+
_b.trys.push([1, 6, 7, 8]);
|
|
10606
|
+
_loop_3 = function (eachChange) {
|
|
10607
|
+
var currentRow;
|
|
10608
|
+
return __generator(this, function (_c) {
|
|
10609
|
+
switch (_c.label) {
|
|
10610
|
+
case 0: return [4 /*yield*/, writeServerQuery.call("update", {
|
|
10611
|
+
id: eachChange.id,
|
|
10612
|
+
data: eachChange.values,
|
|
10613
|
+
})];
|
|
10614
|
+
case 1:
|
|
10615
|
+
_c.sent();
|
|
10616
|
+
currentRow = tableDataRef.current.find(function (eachData) {
|
|
10617
|
+
return eachData.id === eachChange.id || eachData._id === eachChange.id;
|
|
10618
|
+
});
|
|
10619
|
+
if (!currentRow) return [3 /*break*/, 3];
|
|
10620
|
+
return [4 /*yield*/, handleGetListData({
|
|
10621
|
+
data: [
|
|
10622
|
+
__assign(__assign(__assign({}, currentRow), { _id: (_a = currentRow._id) !== null && _a !== void 0 ? _a : currentRow.id }), eachChange.values),
|
|
10623
|
+
],
|
|
10624
|
+
}, "update", eachChange.id)];
|
|
10625
|
+
case 2:
|
|
10626
|
+
_c.sent();
|
|
10627
|
+
_c.label = 3;
|
|
10628
|
+
case 3: return [2 /*return*/];
|
|
10629
|
+
}
|
|
10630
|
+
});
|
|
10631
|
+
};
|
|
10632
|
+
_i = 0, changes_1 = changes;
|
|
10633
|
+
_b.label = 2;
|
|
10634
|
+
case 2:
|
|
10635
|
+
if (!(_i < changes_1.length)) return [3 /*break*/, 5];
|
|
10636
|
+
eachChange = changes_1[_i];
|
|
10637
|
+
return [5 /*yield**/, _loop_3(eachChange)];
|
|
10638
|
+
case 3:
|
|
10639
|
+
_b.sent();
|
|
10640
|
+
_b.label = 4;
|
|
10641
|
+
case 4:
|
|
10642
|
+
_i++;
|
|
10643
|
+
return [3 /*break*/, 2];
|
|
10644
|
+
case 5: return [3 /*break*/, 8];
|
|
10645
|
+
case 6:
|
|
10646
|
+
err_29 = _b.sent();
|
|
10647
|
+
setNotification({
|
|
10648
|
+
type: false,
|
|
10649
|
+
title: "Error",
|
|
10650
|
+
msg: (err_29 === null || err_29 === void 0 ? void 0 : err_29.response)
|
|
10651
|
+
? handleGetWriteErrorMessage(err_29.response)
|
|
10652
|
+
: "The changes could not be saved",
|
|
10653
|
+
});
|
|
10654
|
+
return [3 /*break*/, 8];
|
|
10655
|
+
case 7:
|
|
10656
|
+
setKanbanDroppable(true);
|
|
10657
|
+
return [7 /*endfinally*/];
|
|
10658
|
+
case 8: return [2 /*return*/];
|
|
10659
|
+
}
|
|
10660
|
+
});
|
|
10661
|
+
}); };
|
|
10501
10662
|
// INFO: opens the add tab modal on an existing tab, which it saves in place
|
|
10502
10663
|
var handleEditTab = function (name) {
|
|
10503
10664
|
var _a, _b;
|
|
@@ -10891,7 +11052,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10891
11052
|
// tableData / spaceTableData, so handleBuildNewTableGroups() keeps building
|
|
10892
11053
|
// bands from one source; each group advances its own cursor
|
|
10893
11054
|
var handleFetchGroupNextPage = function (groupKey) { return __awaiter(void 0, void 0, void 0, function () {
|
|
10894
|
-
var current, groupSize, cursor, generation, page_1, existingIds_1, appendRaw_1, appendPretty_1, nextCursor,
|
|
11055
|
+
var current, groupSize, cursor, generation, page_1, existingIds_1, appendRaw_1, appendPretty_1, nextCursor, err_30, nextKey;
|
|
10895
11056
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
10896
11057
|
return __generator(this, function (_h) {
|
|
10897
11058
|
switch (_h.label) {
|
|
@@ -10955,7 +11116,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10955
11116
|
});
|
|
10956
11117
|
return [3 /*break*/, 5];
|
|
10957
11118
|
case 3:
|
|
10958
|
-
|
|
11119
|
+
err_30 = _h.sent();
|
|
10959
11120
|
if (generation !== groupPagingGenRef.current)
|
|
10960
11121
|
return [2 /*return*/];
|
|
10961
11122
|
// INFO: clear the in-flight flag so a failed page can be retried on the
|
|
@@ -10980,7 +11141,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
10980
11141
|
// INFO: page mode — swaps ONE group's rows for its page `page`; every other
|
|
10981
11142
|
// group keeps the page it is on
|
|
10982
11143
|
var handleFetchGroupPage = function (groupKey, page) { return __awaiter(void 0, void 0, void 0, function () {
|
|
10983
|
-
var generation, result, keptRaw_1, keptPretty_1, loaded,
|
|
11144
|
+
var generation, result, keptRaw_1, keptPretty_1, loaded, err_31;
|
|
10984
11145
|
return __generator(this, function (_a) {
|
|
10985
11146
|
switch (_a.label) {
|
|
10986
11147
|
case 0:
|
|
@@ -11016,7 +11177,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11016
11177
|
});
|
|
11017
11178
|
return [3 /*break*/, 4];
|
|
11018
11179
|
case 3:
|
|
11019
|
-
|
|
11180
|
+
err_31 = _a.sent();
|
|
11020
11181
|
if (generation !== groupPagingGenRef.current)
|
|
11021
11182
|
return [2 /*return*/];
|
|
11022
11183
|
handleSetGroupPageState(groupKey, { loadingMore: false });
|
|
@@ -11445,7 +11606,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11445
11606
|
};
|
|
11446
11607
|
// INFO: `hidden` keeps the markers out of space-y spacing
|
|
11447
11608
|
var renderSavedViews = function () {
|
|
11448
|
-
var _a, _b, _c, _d, _e, _f
|
|
11609
|
+
var _a, _b, _c, _d, _e, _f;
|
|
11449
11610
|
if (!isSavedViewsEnabled)
|
|
11450
11611
|
return null;
|
|
11451
11612
|
var views = handleGetTabSavedViews();
|
|
@@ -11461,10 +11622,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11461
11622
|
!activeView &&
|
|
11462
11623
|
isViewDraftsEnabled &&
|
|
11463
11624
|
!handleIsOnViewState(currentState, (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) !== null && _b !== void 0 ? _b : null);
|
|
11464
|
-
var defaultViewId = (
|
|
11465
|
-
var canStarViews = !!((
|
|
11466
|
-
var canSaveViews = !isAppViews || !!((
|
|
11467
|
-
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;
|
|
11468
11629
|
var renderChipClass = function (active) {
|
|
11469
11630
|
return "inline-flex items-center gap-1 rounded-full border px-3 py-1 text-xs font-medium ".concat(active
|
|
11470
11631
|
? "border-primary-500 bg-primary-50 text-primary-700"
|
|
@@ -11518,7 +11679,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11518
11679
|
eachView.name,
|
|
11519
11680
|
"\u201D?",
|
|
11520
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"),
|
|
11521
|
-
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); } },
|
|
11522
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
|
|
11523
11695
|
? "Changed since saved"
|
|
11524
11696
|
: undefined, onClick: function () { return handleApplySavedView(eachView); } },
|
|
@@ -11529,10 +11701,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11529
11701
|
? "Stop opening on ".concat(eachView.name)
|
|
11530
11702
|
: "Open on ".concat(eachView.name, " for everyone"), "data-testid": "dtw-saved-view-star-".concat(eachView.id), className: eachView.id === defaultViewId
|
|
11531
11703
|
? "text-yellow-500"
|
|
11532
|
-
: "text-gray-400 hover:text-yellow-500", onClick: function () {
|
|
11533
|
-
var _a, _b;
|
|
11534
|
-
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);
|
|
11535
|
-
} }, eachView.id === defaultViewId ? "★" : "☆")),
|
|
11704
|
+
: "text-gray-400 hover:text-yellow-500", onClick: function () { return handleStarSavedView(eachView.id); } }, eachView.id === defaultViewId ? "★" : "☆")),
|
|
11536
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 () {
|
|
11537
11706
|
return setRenamingSavedView({
|
|
11538
11707
|
id: eachView.id,
|
|
@@ -11552,7 +11721,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
11552
11721
|
"Update \u201C",
|
|
11553
11722
|
activeView.name,
|
|
11554
11723
|
"\u201D")),
|
|
11555
|
-
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")),
|
|
11556
11725
|
((activeView && isModified && isViewDraftsEnabled) ||
|
|
11557
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")),
|
|
11558
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")) : (
|
|
@@ -12325,6 +12494,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12325
12494
|
else if (selectedTabData.viewType === "map") {
|
|
12326
12495
|
var mapSettings_1 = selectedTabData.mapSettings;
|
|
12327
12496
|
if (mapSettings_1) {
|
|
12497
|
+
// INFO: pins take the route column's colour unless another column is
|
|
12498
|
+
// picked, so a trip's pins match its line with one setting
|
|
12499
|
+
var pinGroup_1 = mapSettings_1.group || mapSettings_1.routeBy || "";
|
|
12328
12500
|
var mapMarkerList_1 = [];
|
|
12329
12501
|
var uniqueGroupList_1 = [];
|
|
12330
12502
|
var markerColorMap_1 = {};
|
|
@@ -12335,11 +12507,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12335
12507
|
"orange",
|
|
12336
12508
|
"purple",
|
|
12337
12509
|
];
|
|
12338
|
-
if (
|
|
12510
|
+
if (pinGroup_1) {
|
|
12339
12511
|
spaceTableData.map(function (eachData) {
|
|
12340
|
-
if (eachData[
|
|
12341
|
-
!uniqueGroupList_1.includes(eachData[
|
|
12342
|
-
uniqueGroupList_1.push(eachData[
|
|
12512
|
+
if (eachData[pinGroup_1] &&
|
|
12513
|
+
!uniqueGroupList_1.includes(eachData[pinGroup_1])) {
|
|
12514
|
+
uniqueGroupList_1.push(eachData[pinGroup_1]);
|
|
12343
12515
|
}
|
|
12344
12516
|
return null;
|
|
12345
12517
|
});
|
|
@@ -12348,21 +12520,47 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12348
12520
|
markerColorMap_1[group] = markerColorList_1[colorIndex];
|
|
12349
12521
|
});
|
|
12350
12522
|
}
|
|
12523
|
+
// INFO: a value the popup can show — a linked record or an
|
|
12524
|
+
// address by its name, other objects left out
|
|
12525
|
+
var handleGetPopupValue_1 = function (value) {
|
|
12526
|
+
var _a;
|
|
12527
|
+
if (value === undefined || value === null || value === "")
|
|
12528
|
+
return null;
|
|
12529
|
+
if (react_1.default.isValidElement(value))
|
|
12530
|
+
return value;
|
|
12531
|
+
if (typeof value === "object")
|
|
12532
|
+
return Array.isArray(value)
|
|
12533
|
+
? value
|
|
12534
|
+
.map(function (each) { var _a; return typeof each === "object" ? ((_a = each === null || each === void 0 ? void 0 : each.name) !== null && _a !== void 0 ? _a : "") : each; })
|
|
12535
|
+
.join(", ") || null
|
|
12536
|
+
: ((_a = value.name) !== null && _a !== void 0 ? _a : null);
|
|
12537
|
+
return String(value);
|
|
12538
|
+
};
|
|
12539
|
+
// INFO: the stop's columns by name in the table's order, and the
|
|
12540
|
+
// same Edit as a Kanban card's pencil for those who can update
|
|
12351
12541
|
var infoWindowContent = function (id, data) {
|
|
12352
|
-
|
|
12353
|
-
|
|
12542
|
+
var rows = structure
|
|
12543
|
+
.filter(function (eachModel) {
|
|
12544
|
+
return eachModel.id !== mapSettings_1.title &&
|
|
12545
|
+
eachModel.id !== mapSettings_1.address &&
|
|
12546
|
+
eachModel.id !== pinGroup_1;
|
|
12547
|
+
})
|
|
12548
|
+
.map(function (eachModel) { return ({
|
|
12549
|
+
id: eachModel.id,
|
|
12550
|
+
name: eachModel.name,
|
|
12551
|
+
value: handleGetPopupValue_1(data[eachModel.id]),
|
|
12552
|
+
}); })
|
|
12553
|
+
.filter(function (eachRow) { return eachRow.value !== null; });
|
|
12554
|
+
return (react_1.default.createElement("div", { key: id, "data-testid": "map-info-window", className: "w-72 break-words font-normal" },
|
|
12555
|
+
data.group && (react_1.default.createElement("p", { className: "text-primary-500 font-semibold text-sm" }, handleGetPopupValue_1(data.group))),
|
|
12354
12556
|
react_1.default.createElement("p", { className: "text-sm" }, data.address),
|
|
12355
|
-
react_1.default.createElement("hr", { className: "my-
|
|
12356
|
-
|
|
12357
|
-
.
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
})
|
|
12362
|
-
.map(function (eachKey) { return (react_1.default.createElement("p", { key: eachKey, className: "text-sm" },
|
|
12363
|
-
eachKey,
|
|
12364
|
-
": ",
|
|
12365
|
-
data[eachKey])); })));
|
|
12557
|
+
rows.length > 0 && react_1.default.createElement("hr", { className: "my-3" }),
|
|
12558
|
+
rows.map(function (eachRow) { return (react_1.default.createElement("p", { key: eachRow.id, className: "text-sm" },
|
|
12559
|
+
react_1.default.createElement("span", { className: "text-gray-500" },
|
|
12560
|
+
eachRow.name,
|
|
12561
|
+
": "),
|
|
12562
|
+
eachRow.value)); }),
|
|
12563
|
+
recordEditAction && (react_1.default.createElement("button", { type: "button", "data-testid": "map-info-edit", className: "mt-3 w-full rounded-md bg-primary-500 px-3 py-1.5 text-sm font-medium text-white hover:bg-primary-600", onClick: function () { return recordEditAction(id); } }, "Edit"))));
|
|
12366
12564
|
};
|
|
12367
12565
|
var infoWindowHeaderComponent = function (_, data) {
|
|
12368
12566
|
return (react_1.default.createElement("p", { className: "text-primary-500 font-semibold text-base" }, data.title));
|
|
@@ -12370,9 +12568,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12370
12568
|
spaceTableData.map(function (eachData) {
|
|
12371
12569
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
12372
12570
|
var eachMarkerColor = "white";
|
|
12373
|
-
if (
|
|
12374
|
-
if (eachData[
|
|
12375
|
-
eachMarkerColor = markerColorMap_1[eachData[
|
|
12571
|
+
if (pinGroup_1) {
|
|
12572
|
+
if (eachData[pinGroup_1]) {
|
|
12573
|
+
eachMarkerColor = markerColorMap_1[eachData[pinGroup_1]];
|
|
12376
12574
|
}
|
|
12377
12575
|
}
|
|
12378
12576
|
if (eachData[mapSettings_1.address]) {
|
|
@@ -12388,8 +12586,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12388
12586
|
? ((_e = eachData[mapSettings_1.title]) !== null && _e !== void 0 ? _e : "")
|
|
12389
12587
|
: "",
|
|
12390
12588
|
address: (_g = (_f = eachData[mapSettings_1.address]) === null || _f === void 0 ? void 0 : _f.name) !== null && _g !== void 0 ? _g : "",
|
|
12391
|
-
group:
|
|
12392
|
-
? ((_h = eachData[
|
|
12589
|
+
group: pinGroup_1
|
|
12590
|
+
? ((_h = eachData[pinGroup_1]) !== null && _h !== void 0 ? _h : "")
|
|
12393
12591
|
: "",
|
|
12394
12592
|
},
|
|
12395
12593
|
};
|
|
@@ -12400,7 +12598,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12400
12598
|
eachKey !== "update" &&
|
|
12401
12599
|
eachKey !== mapSettings_1.title &&
|
|
12402
12600
|
eachKey !== mapSettings_1.address &&
|
|
12403
|
-
eachKey !==
|
|
12601
|
+
eachKey !== pinGroup_1) {
|
|
12404
12602
|
markerData_1["data"][eachKey] = eachData[eachKey];
|
|
12405
12603
|
}
|
|
12406
12604
|
});
|
|
@@ -12409,7 +12607,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12409
12607
|
return null;
|
|
12410
12608
|
});
|
|
12411
12609
|
return (react_1.default.createElement("div", { className: "w-full h-[700px]" },
|
|
12412
|
-
react_1.default.createElement(mapView_1.MapView, { ref: mapViewRef, markerList: mapMarkerList_1, routeList: (0, routes_1.handleBuildRoutesFromRows)(spaceTableData, mapMarkerList_1, mapSettings_1.routeBy, mapSettings_1.routeOrder
|
|
12610
|
+
react_1.default.createElement(mapView_1.MapView, { ref: mapViewRef, markerList: mapMarkerList_1, routeList: (0, routes_1.handleBuildRoutesFromRows)(spaceTableData, mapMarkerList_1, mapSettings_1.routeBy, mapSettings_1.routeOrder, mapSettings_1.routeStart, mapSettings_1.routeEnd), onChangeRoute: canUpdateRecord && mapSettings_1.routeBy
|
|
12611
|
+
? function (change) {
|
|
12612
|
+
return handleSaveRecordChanges((0, routes_1.handleBuildRouteChanges)(spaceTableData, mapSettings_1.routeBy, mapSettings_1.routeOrder, change, [mapSettings_1.routeStart, mapSettings_1.routeEnd]));
|
|
12613
|
+
}
|
|
12614
|
+
: undefined, enableMapControl: true, enablePolygonSelect: canBatchUpdate || canDeleteRecord, infoWindowComponent: infoWindowContent, infoWindowHeaderComponent: infoWindowHeaderComponent, handleSelectPolygon: canBatchUpdate || canDeleteRecord
|
|
12413
12615
|
? function (ids) { return setSelectedIds(ids); }
|
|
12414
12616
|
: undefined, handleUpdateOnClick: canBatchUpdate ? function () { return setBatchUpdateModal(true); } : undefined, handleDeleteOnClick: canDeleteRecord
|
|
12415
12617
|
? function () {
|
|
@@ -12455,7 +12657,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12455
12657
|
id: kanbanSettings.sortBy,
|
|
12456
12658
|
type: kanbanSettings.sortType,
|
|
12457
12659
|
}
|
|
12458
|
-
: undefined, subGroupBy: (kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.subGroupBy) || undefined, renderSubGroupLabel: function (value, cards) { var _a, _b; return (_b = (_a = cards[0]) === null || _a === void 0 ? void 0 : _a.subGroupLabel) !== null && _b !== void 0 ? _b : value; }, draggable: canUpdateRecord, droppable: canUpdateRecord && kanbanDroppable, mobileView: (_58 = props.bareSettings) === null || _58 === void 0 ? void 0 : _58.bareListMobileView, onUpdateData: canUpdateRecord
|
|
12660
|
+
: undefined, subGroupBy: (kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.subGroupBy) || undefined, renderSubGroupLabel: function (value, cards) { var _a, _b; return (_b = (_a = cards[0]) === null || _a === void 0 ? void 0 : _a.subGroupLabel) !== null && _b !== void 0 ? _b : value; }, draggable: canUpdateRecord, droppable: canUpdateRecord && kanbanDroppable, onArrangeData: canUpdateRecord ? handleSaveRecordChanges : undefined, mobileView: (_58 = props.bareSettings) === null || _58 === void 0 ? void 0 : _58.bareListMobileView, onUpdateData: canUpdateRecord
|
|
12459
12661
|
? function (cardId, _fromCol, toCol) { return __awaiter(void 0, void 0, void 0, function () {
|
|
12460
12662
|
var _a;
|
|
12461
12663
|
return __generator(this, function (_b) {
|
|
@@ -12987,14 +13189,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
12987
13189
|
};
|
|
12988
13190
|
return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
|
|
12989
13191
|
renderNotification("root"),
|
|
12990
|
-
((
|
|
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 () {
|
|
12991
13193
|
var _a, _b;
|
|
12992
13194
|
if (loading)
|
|
12993
13195
|
return;
|
|
12994
13196
|
handlePopUpModal(false);
|
|
12995
13197
|
setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
|
|
12996
13198
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
|
|
12997
|
-
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 () {
|
|
12998
13200
|
return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
|
|
12999
13201
|
if (dataId) {
|
|
13000
13202
|
var currentValue = selectedData[referenceCreationModal.id];
|
|
@@ -13010,19 +13212,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13010
13212
|
}, onClose: function () {
|
|
13011
13213
|
setReferenceCreationModal({ id: "", name: "", type: "string" });
|
|
13012
13214
|
} }),
|
|
13013
|
-
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 () {
|
|
13014
13216
|
setReferenceDeleteTableData({});
|
|
13015
13217
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13016
|
-
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 () {
|
|
13017
13219
|
setDeletePasscodeInput("");
|
|
13018
13220
|
setDeleteModal(!deleteModal);
|
|
13019
13221
|
setDeleteFeedId("");
|
|
13020
13222
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13021
|
-
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 () {
|
|
13022
13224
|
setBatchUpdateData({ columnId: "", columnData: {} });
|
|
13023
13225
|
setBatchUpdateModal(false);
|
|
13024
13226
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
13025
|
-
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 () {
|
|
13026
13228
|
var _a, _b;
|
|
13027
13229
|
if (props.space)
|
|
13028
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 }));
|
|
@@ -13039,11 +13241,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (rawProps, ref) {
|
|
|
13039
13241
|
(0, react_dom_1.createPortal)(
|
|
13040
13242
|
// INFO: z-50 lifts it over a Modal the table may sit in (z-40)
|
|
13041
13243
|
react_1.default.createElement("div", { className: "relative z-50" },
|
|
13042
|
-
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,
|
|
13043
13245
|
// INFO: the record stays set while the drawer slides out — clearing it
|
|
13044
13246
|
// would remount the hidden panel collection-wide and fetch again. The
|
|
13045
13247
|
// toolbar's collection-wide button clears it when it opens.
|
|
13046
|
-
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),
|
|
13047
13249
|
renderScrollSentinel()));
|
|
13048
13250
|
});
|
|
13049
13251
|
//# sourceMappingURL=index.js.map
|