blixify-ui-web 1.2.211 → 1.2.212
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +290 -234
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataWrapper/index.d.ts +1 -1
- package/lib/components/data/dataWrapper/index.d.ts.map +1 -1
- package/lib/components/display/drawer/index.d.ts +6 -3
- package/lib/components/display/drawer/index.d.ts.map +1 -1
- package/lib/components/display/drawer/index.js +29 -4
- package/lib/components/display/drawer/index.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +4 -1
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/tail.css +1 -1
- package/package.json +1 -1
|
@@ -248,10 +248,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
248
248
|
// Every read of the view type below uses resolvedType. The distinction matters
|
|
249
249
|
// most in effect dependency arrays — following props.type there would leave
|
|
250
250
|
// the list never refetching while the panel is open, which fails silently.
|
|
251
|
-
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;
|
|
251
|
+
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;
|
|
252
252
|
// INFO: the panel cannot navigate its way out — handleNavigate("read") is
|
|
253
253
|
// routed straight back into it — so expand-to-full-page is local state.
|
|
254
|
-
var
|
|
254
|
+
var _117 = (0, react_1.useState)(false), drawerPageView = _117[0], setDrawerPageView = _117[1];
|
|
255
255
|
// INFO: the panel keeps rendering the record it was opened with rather than
|
|
256
256
|
// live props. Without this, navigating back to the list would re-render the
|
|
257
257
|
// still-mounted panel as a second list behind the overlay.
|
|
@@ -264,12 +264,35 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
264
264
|
props.type === "update" &&
|
|
265
265
|
!!props.id;
|
|
266
266
|
var isDrawerRecord = isDrawerRead || isDrawerForm;
|
|
267
|
+
// INFO: the panel stays on the page while closed so it has a closed position
|
|
268
|
+
// to slide from and back to; its record is only mounted while it is showing
|
|
269
|
+
var canHostDrawer = !!((_c = props.viewSettings) === null || _c === void 0 ? void 0 : _c.readDrawer) || !!((_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareFormDrawer);
|
|
267
270
|
// INFO: while the escape is active the record takes the page normally and the
|
|
268
271
|
// panel stays closed behind it.
|
|
269
272
|
var isDrawerHost = isDrawerRecord && !drawerPageView;
|
|
270
273
|
var resolvedType = isDrawerHost ? "list" : props.type;
|
|
271
274
|
if (isDrawerRecord)
|
|
272
275
|
drawerReadIdRef.current = props.id;
|
|
276
|
+
// INFO: the route has already gone back to the list while the panel slides out,
|
|
277
|
+
// so it keeps drawing what it was opened as until it is gone
|
|
278
|
+
var drawerFormRef = (0, react_1.useRef)(false);
|
|
279
|
+
var drawerFormEditedRef = (0, react_1.useRef)(false);
|
|
280
|
+
if (isDrawerRecord) {
|
|
281
|
+
// INFO: moving from the record to its form starts with nothing edited
|
|
282
|
+
if (isDrawerForm && !drawerFormRef.current)
|
|
283
|
+
drawerFormEditedRef.current = false;
|
|
284
|
+
drawerFormRef.current = isDrawerForm;
|
|
285
|
+
}
|
|
286
|
+
// INFO: each opening gets its own record instance, so reopening inside the
|
|
287
|
+
// slide-out does not carry over what the last one held
|
|
288
|
+
var drawerOpenRef = (0, react_1.useRef)(false);
|
|
289
|
+
var drawerSessionRef = (0, react_1.useRef)(0);
|
|
290
|
+
if (isDrawerHost && !drawerOpenRef.current) {
|
|
291
|
+
drawerSessionRef.current += 1;
|
|
292
|
+
drawerFormEditedRef.current = false;
|
|
293
|
+
}
|
|
294
|
+
drawerOpenRef.current = isDrawerHost;
|
|
295
|
+
var _118 = (0, react_1.useState)(false), drawerDiscardModal = _118[0], setDrawerDiscardModal = _118[1];
|
|
273
296
|
// INFO: leaving the record ends the escape, so the next row opened from the
|
|
274
297
|
// list peeks in the panel again rather than inheriting a full page the user
|
|
275
298
|
// asked for once. Saving a form on the full page lands on its read view, which
|
|
@@ -348,14 +371,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
348
371
|
initialFilterReferenceDate: initialFilterReferenceDate,
|
|
349
372
|
};
|
|
350
373
|
};
|
|
351
|
-
var
|
|
374
|
+
var _119 = intialiseDefaultFilterValues(), initialFilterSearch = _119.initialFilterSearch, initialFilterSearchParams = _119.initialFilterSearchParams, initialFilterSelection = _119.initialFilterSelection, initialFilterReference = _119.initialFilterReference, initialFilterReferenceDate = _119.initialFilterReferenceDate;
|
|
352
375
|
// INFO: Persist view state hook — handles storage read/write for filter/sort/column state
|
|
353
|
-
var
|
|
354
|
-
mode: (
|
|
376
|
+
var _120 = (0, viewStatePersistence_1.usePersistedViewState)({
|
|
377
|
+
mode: (_e = props.organise) === null || _e === void 0 ? void 0 : _e.persistViewState,
|
|
355
378
|
collectionId: props.collectionId,
|
|
356
|
-
persistKey: (
|
|
379
|
+
persistKey: (_f = props.organise) === null || _f === void 0 ? void 0 : _f.persistKey,
|
|
357
380
|
type: resolvedType,
|
|
358
|
-
}), rawPersistedState =
|
|
381
|
+
}), rawPersistedState = _120.persistedState, isPersistEnabled = _120.isEnabled, handleSaveView = _120.handleSaveView, handleRegisterViewSnapshot = _120.handleRegisterViewSnapshot;
|
|
359
382
|
// INFO: drop stored filters/sort on removed columns — they would empty the table
|
|
360
383
|
var persistedState = (0, react_1.useMemo)(function () {
|
|
361
384
|
var _a, _b, _c;
|
|
@@ -366,11 +389,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
366
389
|
}, [
|
|
367
390
|
rawPersistedState,
|
|
368
391
|
props.model,
|
|
369
|
-
(
|
|
370
|
-
(
|
|
392
|
+
(_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareFlexFilterReferences,
|
|
393
|
+
(_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareFlexFilterListObjects,
|
|
371
394
|
]);
|
|
372
|
-
var
|
|
373
|
-
var
|
|
395
|
+
var _121 = (0, react_1.useState)(false), loading = _121[0], setLoading = _121[1];
|
|
396
|
+
var _122 = (0, react_1.useState)(), notification = _122[0], setNotification = _122[1];
|
|
374
397
|
// INFO: a success toast is confirmation, not a decision — it clears itself so
|
|
375
398
|
// it never sits on the floating step bar; errors stay until dismissed
|
|
376
399
|
(0, react_1.useEffect)(function () {
|
|
@@ -380,80 +403,80 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
380
403
|
return function () { return clearTimeout(timer); };
|
|
381
404
|
}, [notification]);
|
|
382
405
|
//INFO : Used by List
|
|
383
|
-
var
|
|
384
|
-
var
|
|
385
|
-
var
|
|
386
|
-
var
|
|
387
|
-
var
|
|
388
|
-
var
|
|
389
|
-
var
|
|
406
|
+
var _123 = (0, react_1.useState)((_j = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _j !== void 0 ? _j : initialFilterSearch), filterSearch = _123[0], setFilterSearch = _123[1];
|
|
407
|
+
var _124 = (0, react_1.useState)((_k = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _k !== void 0 ? _k : initialFilterSearchParams), filterSearchParams = _124[0], setFilterSearchParams = _124[1];
|
|
408
|
+
var _125 = (0, react_1.useState)((_l = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _l !== void 0 ? _l : initialFilterSelection), filterSelection = _125[0], setFilterSelection = _125[1];
|
|
409
|
+
var _126 = (0, react_1.useState)((_m = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _m !== void 0 ? _m : initialFilterReference), filterReference = _126[0], setFilterReference = _126[1];
|
|
410
|
+
var _127 = (0, react_1.useState)({}), filterReferenceSearch = _127[0], setFilterReferenceSearch = _127[1];
|
|
411
|
+
var _128 = (0, react_1.useState)({}), filterReferenceList = _128[0], setFilterReferenceList = _128[1];
|
|
412
|
+
var _129 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
|
|
390
413
|
? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
|
|
391
|
-
: initialFilterReferenceDate), filterReferenceDate =
|
|
392
|
-
var
|
|
393
|
-
var
|
|
394
|
-
var
|
|
395
|
-
var
|
|
396
|
-
var
|
|
414
|
+
: initialFilterReferenceDate), filterReferenceDate = _129[0], setFilterReferenceDate = _129[1];
|
|
415
|
+
var _130 = (0, react_1.useState)(true), tableLoading = _130[0], setTableLoading = _130[1];
|
|
416
|
+
var _131 = (0, react_1.useState)(""), cursor = _131[0], setCursor = _131[1];
|
|
417
|
+
var _132 = (0, react_1.useState)(""), lastCursor = _132[0], setLastCursor = _132[1];
|
|
418
|
+
var _133 = (0, react_1.useState)([]), tableData = _133[0], setTableData = _133[1];
|
|
419
|
+
var _134 = (0, react_1.useState)([]), spaceTableData = _134[0], setSpaceTableData = _134[1];
|
|
397
420
|
// INFO: a save resolves after later renders, so it reads the table from here —
|
|
398
421
|
// the state it closed over can predate an earlier save on the same row
|
|
399
422
|
var tableDataRef = (0, react_1.useRef)([]);
|
|
400
423
|
var spaceTableDataRef = (0, react_1.useRef)([]);
|
|
401
424
|
tableDataRef.current = tableData;
|
|
402
425
|
spaceTableDataRef.current = spaceTableData;
|
|
403
|
-
var
|
|
404
|
-
var
|
|
426
|
+
var _135 = (0, react_1.useState)(0), size = _135[0], setSize = _135[1];
|
|
427
|
+
var _136 = (0, react_1.useState)((_q = (_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _o !== void 0 ? _o : (_p = props.organise) === null || _p === void 0 ? void 0 : _p.pageIndex) !== null && _q !== void 0 ? _q : 0), pageIndex = _136[0], setPageIndex = _136[1];
|
|
405
428
|
// INFO: every change of page, including the return to the first page when a
|
|
406
429
|
// filter or search changes, which onChangePagination does not always report
|
|
407
430
|
(0, react_1.useEffect)(function () {
|
|
408
431
|
var _a, _b;
|
|
409
432
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangePageIndex) === null || _b === void 0 ? void 0 : _b.call(_a, pageIndex);
|
|
410
433
|
}, [pageIndex]);
|
|
411
|
-
var
|
|
412
|
-
var
|
|
413
|
-
var
|
|
414
|
-
var
|
|
415
|
-
var
|
|
434
|
+
var _137 = (0, react_1.useState)([]), selectedIds = _137[0], setSelectedIds = _137[1];
|
|
435
|
+
var _138 = (0, react_1.useState)(false), selectAll = _138[0], setSelectAll = _138[1];
|
|
436
|
+
var _139 = (0, react_1.useState)(""), deletePasscode = _139[0], setDeletePasscode = _139[1];
|
|
437
|
+
var _140 = (0, react_1.useState)(""), deletePasscodeInput = _140[0], setDeletePasscodeInput = _140[1];
|
|
438
|
+
var _141 = (0, react_1.useState)(""), deleteFeedId = _141[0], setDeleteFeedId = _141[1];
|
|
416
439
|
//INFO : Used by List Organise
|
|
417
440
|
// INFO: Internal sort state that overrides props.organise?.sort when
|
|
418
441
|
// persistViewState is enabled and a persisted sort exists
|
|
419
|
-
var
|
|
420
|
-
var
|
|
421
|
-
var
|
|
422
|
-
var
|
|
442
|
+
var _142 = (0, react_1.useState)((_r = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _r !== void 0 ? _r : undefined), persistedSort = _142[0], setPersistedSort = _142[1];
|
|
443
|
+
var _143 = (0, react_1.useState)(false), filterDraft = _143[0], setFilterDraft = _143[1];
|
|
444
|
+
var _144 = (0, react_1.useState)(false), addTabModal = _144[0], setAddTabModal = _144[1];
|
|
445
|
+
var _145 = (0, react_1.useState)(-1), editTabIndex = _145[0], setEditTabIndex = _145[1];
|
|
423
446
|
//INFO : resolve the initial tab synchronously so the mount cond is already
|
|
424
447
|
// tab-scoped — an empty initial tab caused a second wasted list fetch
|
|
425
|
-
var
|
|
448
|
+
var _146 = (0, react_1.useState)(function () {
|
|
426
449
|
var _a, _b;
|
|
427
450
|
return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.viewId);
|
|
428
|
-
}), selectedTab =
|
|
429
|
-
var
|
|
451
|
+
}), selectedTab = _146[0], setSelectedTab = _146[1];
|
|
452
|
+
var _147 = (0, react_1.useState)("dayGridMonth"), calendarView = _147[0], setCalendarView = _147[1];
|
|
430
453
|
// INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
|
|
431
454
|
// (calendarView above drives the matching range query)
|
|
432
|
-
var
|
|
433
|
-
var
|
|
455
|
+
var _148 = (0, react_1.useState)("month"), newCalendarViewMode = _148[0], setNewCalendarViewMode = _148[1];
|
|
456
|
+
var _149 = (0, react_1.useState)(new Date()), calendarTabMonth = _149[0], setCalendarTabMonth = _149[1];
|
|
434
457
|
// INFO: defaultViewSwitch picks the opening view only — the tab re-inits
|
|
435
458
|
// whenever its settings change, and that must not undo the user's switch
|
|
436
459
|
var calendarViewInitRef = (0, react_1.useRef)(false);
|
|
437
|
-
var
|
|
438
|
-
var
|
|
439
|
-
var
|
|
440
|
-
var
|
|
460
|
+
var _150 = (0, react_1.useState)(true), kanbanDroppable = _150[0], setKanbanDroppable = _150[1];
|
|
461
|
+
var _151 = (0, react_1.useState)([]), kanbanOptions = _151[0], setKanbanOptions = _151[1];
|
|
462
|
+
var _152 = (0, react_1.useState)(false), batchUpdateModal = _152[0], setBatchUpdateModal = _152[1];
|
|
463
|
+
var _153 = (0, react_1.useState)({
|
|
441
464
|
columnId: "",
|
|
442
465
|
columnData: {},
|
|
443
|
-
}), batchUpdateData =
|
|
466
|
+
}), batchUpdateData = _153[0], setBatchUpdateData = _153[1];
|
|
444
467
|
// INFO: system columns (created / updated at and by, record id, number)
|
|
445
468
|
// join the structure hidden; the ones a user shows are kept per view
|
|
446
|
-
var isSystemColumnsEnabled = !!((
|
|
447
|
-
var isSystemColumnsLocked = !!((
|
|
469
|
+
var isSystemColumnsEnabled = !!((_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareSystemColumns);
|
|
470
|
+
var isSystemColumnsLocked = !!((_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareSystemColumnsLocked);
|
|
448
471
|
var appendedSystemColumnIds = isSystemColumnsEnabled
|
|
449
472
|
? 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; }); })
|
|
450
473
|
: [];
|
|
451
|
-
var
|
|
474
|
+
var _154 = (0, react_1.useState)((_u = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _u !== void 0 ? _u : []), shownSystemColumnIds = _154[0], setShownSystemColumnIds = _154[1];
|
|
452
475
|
var handleWithSystemColumns = function (model, shownIds) {
|
|
453
476
|
if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
|
|
454
477
|
return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
|
|
455
478
|
};
|
|
456
|
-
var
|
|
479
|
+
var _155 = (0, react_1.useState)(function () {
|
|
457
480
|
var _a;
|
|
458
481
|
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 : []);
|
|
459
482
|
if (!persistedState)
|
|
@@ -480,8 +503,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
480
503
|
});
|
|
481
504
|
}
|
|
482
505
|
return model;
|
|
483
|
-
}), structure =
|
|
484
|
-
var
|
|
506
|
+
}), structure = _155[0], setStructure = _155[1];
|
|
507
|
+
var _156 = (0, react_1.useState)(((_v = props === null || props === void 0 ? void 0 : props.organise) === null || _v === void 0 ? void 0 : _v.additionalQuery) || []), additionalQuery = _156[0], setAdditionalQuery = _156[1];
|
|
485
508
|
// INFO: State for user-configurable flex filters (Monday.com-style)
|
|
486
509
|
// INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
|
|
487
510
|
var defaultFlexFilterRow = [
|
|
@@ -492,9 +515,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
492
515
|
value: undefined,
|
|
493
516
|
},
|
|
494
517
|
];
|
|
495
|
-
var
|
|
518
|
+
var _157 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
496
519
|
? persistedState.flexFilters
|
|
497
|
-
: defaultFlexFilterRow), flexFilters =
|
|
520
|
+
: defaultFlexFilterRow), flexFilters = _157[0], setFlexFilters = _157[1];
|
|
498
521
|
// INFO: always-current mirror of flexFilters, read by the imperative apply/
|
|
499
522
|
// clear methods so chained calls in one tick aren't stale.
|
|
500
523
|
var flexFiltersRef = (0, react_1.useRef)(flexFilters);
|
|
@@ -507,81 +530,81 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
507
530
|
}, [flexFilters]);
|
|
508
531
|
// INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
|
|
509
532
|
// to prevent API calls on every keystroke when typing in value inputs
|
|
510
|
-
var
|
|
533
|
+
var _158 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
511
534
|
? persistedState.flexFilters
|
|
512
|
-
: defaultFlexFilterRow), flexFiltersDebounced =
|
|
535
|
+
: defaultFlexFilterRow), flexFiltersDebounced = _158[0], setFlexFiltersDebounced = _158[1];
|
|
513
536
|
// INFO: the filter rows of the export being set up — started from the
|
|
514
537
|
// list's own when the export opens, so changing them leaves the list as it is
|
|
515
|
-
var
|
|
516
|
-
var
|
|
517
|
-
var
|
|
518
|
-
var
|
|
519
|
-
var
|
|
538
|
+
var _159 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _159[0], setExportFlexFilters = _159[1];
|
|
539
|
+
var _160 = (0, react_1.useState)({}), flexFilterReferenceOptions = _160[0], setFlexFilterReferenceOptions = _160[1];
|
|
540
|
+
var _161 = (0, react_1.useState)({}), flexFilterReferenceSearch = _161[0], setFlexFilterReferenceSearch = _161[1];
|
|
541
|
+
var _162 = (0, react_1.useState)(false), flexFilterModalOpen = _162[0], setFlexFilterModalOpen = _162[1];
|
|
542
|
+
var _163 = (0, react_1.useState)(false), viewSettingsModalOpen = _163[0], setViewSettingsModalOpen = _163[1];
|
|
520
543
|
// INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
|
|
521
544
|
// Deliberately kept out of `structure`: the props-sync effect below resets
|
|
522
545
|
// structure to props.model whenever props change, which would wipe the
|
|
523
546
|
// choice, and the persist effect derives schema-level hiddenColumnIds from
|
|
524
547
|
// structure — writing user hides there would blur the two concepts.
|
|
525
|
-
var
|
|
526
|
-
var
|
|
527
|
-
var
|
|
528
|
-
var
|
|
548
|
+
var _164 = (0, react_1.useState)((_w = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _w !== void 0 ? _w : []), userHiddenColumnIds = _164[0], setUserHiddenColumnIds = _164[1];
|
|
549
|
+
var _165 = (0, react_1.useState)(""), columnSearch = _165[0], setColumnSearch = _165[1];
|
|
550
|
+
var _166 = (0, react_1.useState)([]), savedViews = _166[0], setSavedViews = _166[1];
|
|
551
|
+
var _167 = (0, react_1.useState)(null), activeSavedViewId = _167[0], setActiveSavedViewId = _167[1];
|
|
529
552
|
// INFO: the widths of the view on screen, by column id ("180px")
|
|
530
|
-
var
|
|
553
|
+
var _168 = (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 = _168[0], setColumnWidths = _168[1];
|
|
531
554
|
// INFO: unsaved changes are kept only once the opening view is on screen,
|
|
532
555
|
// so the defaults drawn before it never overwrite a person's own
|
|
533
|
-
var
|
|
556
|
+
var _169 = (0, react_1.useState)(false), isViewDraftReady = _169[0], setIsViewDraftReady = _169[1];
|
|
534
557
|
// INFO: null while the name box is closed
|
|
535
|
-
var
|
|
536
|
-
var
|
|
537
|
-
var
|
|
558
|
+
var _170 = (0, react_1.useState)(null), savedViewName = _170[0], setSavedViewName = _170[1];
|
|
559
|
+
var _171 = (0, react_1.useState)(null), deletingSavedViewId = _171[0], setDeletingSavedViewId = _171[1];
|
|
560
|
+
var _172 = (0, react_1.useState)(null), draggingColumnId = _172[0], setDraggingColumnId = _172[1];
|
|
538
561
|
var columnRowRefs = (0, react_1.useRef)({});
|
|
539
562
|
//INFO : Used by Auth
|
|
540
|
-
var
|
|
563
|
+
var _173 = (0, react_1.useState)({
|
|
541
564
|
email: "",
|
|
542
565
|
google: "",
|
|
543
566
|
phone: "",
|
|
544
567
|
disabled: false,
|
|
545
568
|
create: false,
|
|
546
|
-
}), authMethods =
|
|
547
|
-
var
|
|
569
|
+
}), authMethods = _173[0], setAuthMethods = _173[1];
|
|
570
|
+
var _174 = (0, react_1.useState)(""), selectedAuthMethod = _174[0], setSelectedAuthMethod = _174[1];
|
|
548
571
|
// INFO: the sign-in check of a users datasheet's record is running; the
|
|
549
572
|
// panel shows a spinner rather than nothing, which read as "no login"
|
|
550
|
-
var
|
|
573
|
+
var _175 = (0, react_1.useState)(false), authLoading = _175[0], setAuthLoading = _175[1];
|
|
551
574
|
// INFO: a delete is running — the ref answers a second tap at once, before
|
|
552
575
|
// the state has rendered, and the state disables the confirm button
|
|
553
576
|
var deletingRef = (0, react_1.useRef)(false);
|
|
554
|
-
var
|
|
577
|
+
var _176 = (0, react_1.useState)(false), deleting = _176[0], setDeleting = _176[1];
|
|
555
578
|
// INFO: Used by Activity Log
|
|
556
|
-
var
|
|
557
|
-
var
|
|
579
|
+
var _177 = (0, react_1.useState)(false), activityModal = _177[0], setActivityModal = _177[1];
|
|
580
|
+
var _178 = (0, react_1.useState)(""), activityId = _178[0], setActivityId = _178[1];
|
|
558
581
|
//INFO : Used by Export
|
|
559
|
-
var
|
|
560
|
-
var
|
|
561
|
-
var
|
|
562
|
-
var
|
|
563
|
-
var
|
|
564
|
-
var
|
|
565
|
-
var
|
|
566
|
-
var
|
|
567
|
-
var
|
|
568
|
-
var
|
|
569
|
-
var
|
|
570
|
-
var
|
|
571
|
-
var
|
|
572
|
-
var
|
|
573
|
-
var
|
|
582
|
+
var _179 = (0, react_1.useState)(null), csvFile = _179[0], setCSVFile = _179[1];
|
|
583
|
+
var _180 = (0, react_1.useState)([]), csvFileData = _180[0], setCSVFileData = _180[1];
|
|
584
|
+
var _181 = (0, react_1.useState)(0), stepCSVIndex = _181[0], setStepCSVIndex = _181[1];
|
|
585
|
+
var _182 = (0, react_1.useState)({}), listCSVMapAttribute = _182[0], setListCSVMapAttribute = _182[1];
|
|
586
|
+
var _183 = (0, react_1.useState)({}), listCSVObjAttribute = _183[0], setListCSVObjAttribute = _183[1];
|
|
587
|
+
var _184 = (0, react_1.useState)([]), csvAPIAttribute = _184[0], setCSVAPIAttribute = _184[1];
|
|
588
|
+
var _185 = (0, react_1.useState)(((_x = props.devSettings.currentUser) === null || _x === void 0 ? void 0 : _x.userEmail) || ""), exportCSVEmail = _185[0], setExportCSVEmail = _185[1];
|
|
589
|
+
var _186 = (0, react_1.useState)(((_z = (_y = props.organise) === null || _y === void 0 ? void 0 : _y.exportSettings) === null || _z === void 0 ? void 0 : _z.defaultExportPDFName) || ""), exportPDFTitle = _186[0], setExportPDFTitle = _186[1];
|
|
590
|
+
var _187 = (0, react_1.useState)(false), exportPDFLoading = _187[0], setExportPDFLoading = _187[1];
|
|
591
|
+
var _188 = (0, react_1.useState)(false), exportReadPDFLoading = _188[0], setExportReadPDFLoading = _188[1];
|
|
592
|
+
var _189 = (0, react_1.useState)((_2 = (_1 = (_0 = props.organise) === null || _0 === void 0 ? void 0 : _0.exportSettings) === null || _1 === void 0 ? void 0 : _1.sumColumnId) !== null && _2 !== void 0 ? _2 : []), exportSumAttributeIds = _189[0], setExportSumAttributeIds = _189[1];
|
|
593
|
+
var _190 = (0, react_1.useState)((_5 = (_4 = (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.exportSettings) === null || _4 === void 0 ? void 0 : _4.hideSubItems) !== null && _5 !== void 0 ? _5 : false), hideSubItems = _190[0], setHideSubItems = _190[1];
|
|
594
|
+
var _191 = (0, react_1.useState)([]), importTableData = _191[0], setImportTableData = _191[1];
|
|
595
|
+
var _192 = (0, react_1.useState)([]), queryList = _192[0], setQueryList = _192[1];
|
|
596
|
+
var _193 = (0, react_1.useState)(undefined), allQueryList = _193[0], setAllQueryList = _193[1];
|
|
574
597
|
// INFO: a restored state wins over the prop; its "" is a list the user
|
|
575
598
|
// ungrouped, so it opens ungrouped
|
|
576
|
-
var
|
|
599
|
+
var _194 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
|
|
577
600
|
? persistedState.groupBy || undefined
|
|
578
|
-
: (
|
|
601
|
+
: (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.groupBy), groupId = _194[0], setGroupId = _194[1];
|
|
579
602
|
// INFO: Monday-board per-group paging. Keyed by the group key that
|
|
580
603
|
// handleBuildNewTableGroups() produces (an option, Unknown or No Value).
|
|
581
604
|
// Each group tracks its own loaded cursor + total so it can lazily load its
|
|
582
605
|
// next page as the user scrolls inside that band, independent of every other
|
|
583
606
|
// group. Only used when renderCheckGroupPaging() is true.
|
|
584
|
-
var
|
|
607
|
+
var _195 = (0, react_1.useState)({}), groupPageState = _195[0], setGroupPageState = _195[1];
|
|
585
608
|
// INFO: read fresh inside the async per-group fetch so chained scroll fires
|
|
586
609
|
// in one tick do not re-fetch an already in-flight page.
|
|
587
610
|
var groupPageStateRef = (0, react_1.useRef)({});
|
|
@@ -590,59 +613,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
590
613
|
// list was re-read (new search, filter, sort or grouping) is dropped on
|
|
591
614
|
// arrival instead of appending rows that belong to the old list
|
|
592
615
|
var groupPagingGenRef = (0, react_1.useRef)(0);
|
|
593
|
-
var
|
|
594
|
-
var
|
|
616
|
+
var _196 = (0, react_1.useState)(""), readTabSection = _196[0], setReadTabSection = _196[1];
|
|
617
|
+
var _197 = (0, react_1.useState)(false), readFloatingNav = _197[0], setReadFloatingNav = _197[1];
|
|
595
618
|
var readTabSectionRefs = (0, react_1.useRef)({});
|
|
596
619
|
//INFO : Used by Read
|
|
597
620
|
//INFO : Used by Update
|
|
598
|
-
var
|
|
599
|
-
var
|
|
600
|
-
var
|
|
601
|
-
var
|
|
602
|
-
var
|
|
603
|
-
var
|
|
604
|
-
var
|
|
621
|
+
var _198 = (0, react_1.useState)(false), modalVisible = _198[0], setModalVisible = _198[1];
|
|
622
|
+
var _199 = (0, react_1.useState)(false), deleteModal = _199[0], setDeleteModal = _199[1];
|
|
623
|
+
var _200 = (0, react_1.useState)(false), excelModal = _200[0], setExcelModal = _200[1];
|
|
624
|
+
var _201 = (0, react_1.useState)(false), exportExcel = _201[0], setExportExcel = _201[1];
|
|
625
|
+
var _202 = (0, react_1.useState)(""), exportType = _202[0], setExportType = _202[1];
|
|
626
|
+
var _203 = (0, react_1.useState)(false), exportQR = _203[0], setExportQR = _203[1];
|
|
627
|
+
var _204 = (0, react_1.useState)(function () {
|
|
605
628
|
var _a, _b;
|
|
606
629
|
var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
|
|
607
630
|
return firstTabId;
|
|
608
|
-
}), activeTab =
|
|
609
|
-
var
|
|
610
|
-
var
|
|
611
|
-
var
|
|
612
|
-
var
|
|
613
|
-
var
|
|
614
|
-
var
|
|
615
|
-
var
|
|
631
|
+
}), activeTab = _204[0], setActiveTab = _204[1];
|
|
632
|
+
var _205 = (0, react_1.useState)(false), signatureSigning = _205[0], setSignatureSigning = _205[1];
|
|
633
|
+
var _206 = (0, react_1.useState)({}), selectedData = _206[0], setSelectedData = _206[1];
|
|
634
|
+
var _207 = (0, react_1.useState)(""), selectedObjectStructureId = _207[0], setSelectedObjectStructureId = _207[1];
|
|
635
|
+
var _208 = (0, react_1.useState)(""), selectedObjectId = _208[0], setSelectedObjectId = _208[1];
|
|
636
|
+
var _209 = (0, react_1.useState)(""), selectedListAddressId = _209[0], setSelectedListAddressId = _209[1];
|
|
637
|
+
var _210 = (0, react_1.useState)(-1), selectedListAddressIndex = _210[0], setSelectedListAddressIndex = _210[1];
|
|
638
|
+
var _211 = (0, react_1.useState)({
|
|
616
639
|
lat: 0,
|
|
617
640
|
lng: 0,
|
|
618
641
|
name: "",
|
|
619
|
-
}), selectedListAddress =
|
|
620
|
-
var
|
|
621
|
-
var
|
|
622
|
-
var
|
|
623
|
-
var
|
|
624
|
-
var
|
|
625
|
-
var
|
|
626
|
-
var
|
|
627
|
-
var
|
|
628
|
-
var
|
|
629
|
-
var
|
|
642
|
+
}), selectedListAddress = _211[0], setSelectedListAddress = _211[1];
|
|
643
|
+
var _212 = (0, react_1.useState)({}), selectedObjectData = _212[0], setSelectedObjectData = _212[1];
|
|
644
|
+
var _213 = (0, react_1.useState)(null), objectCellEdit = _213[0], setObjectCellEdit = _213[1];
|
|
645
|
+
var _214 = (0, react_1.useState)(false), referenceLoading = _214[0], setReferenceLoading = _214[1];
|
|
646
|
+
var _215 = (0, react_1.useState)({}), referencesOptions = _215[0], setReferencesOptions = _215[1];
|
|
647
|
+
var _216 = (0, react_1.useState)({}), referencesDetails = _216[0], setReferencesDetails = _216[1];
|
|
648
|
+
var _217 = (0, react_1.useState)({}), listReferencesOptions = _217[0], setListReferencesOptions = _217[1];
|
|
649
|
+
var _218 = (0, react_1.useState)({}), referenceDeleteTableData = _218[0], setReferenceDeleteTableData = _218[1];
|
|
650
|
+
var _219 = (0, react_1.useState)([]), relatedSections = _219[0], setRelatedSections = _219[1];
|
|
651
|
+
var _220 = (0, react_1.useState)(0), referenceDeleteIndex = _220[0], setReferenceDeleteIndex = _220[1];
|
|
652
|
+
var _221 = (0, react_1.useState)({
|
|
630
653
|
id: "",
|
|
631
654
|
name: "",
|
|
632
655
|
type: "string",
|
|
633
|
-
}), referenceCreationModal =
|
|
634
|
-
var
|
|
635
|
-
var
|
|
656
|
+
}), referenceCreationModal = _221[0], setReferenceCreationModal = _221[1];
|
|
657
|
+
var _222 = (0, react_1.useState)({}), referenceModelSchema = _222[0], setReferenceSchema = _222[1];
|
|
658
|
+
var _223 = (0, react_1.useState)([]), kanbanChecked = _223[0], setKanbanChecked = _223[1];
|
|
636
659
|
//INFO : Offline
|
|
637
|
-
var
|
|
638
|
-
var
|
|
660
|
+
var _224 = (0, react_1.useState)(0), offlineDataLength = _224[0], setOfflineDataLength = _224[1];
|
|
661
|
+
var _225 = (0, react_1.useState)(false), offlineModal = _225[0], setOfflineModal = _225[1];
|
|
639
662
|
// INFO: live-stream state — driven by socket connection and navigator.onLine
|
|
640
|
-
var
|
|
641
|
-
var
|
|
663
|
+
var _226 = (0, react_1.useState)(false), isLive = _226[0], setIsLive = _226[1];
|
|
664
|
+
var _227 = (0, react_1.useState)(false), isLiveOffline = _227[0], setIsLiveOffline = _227[1];
|
|
642
665
|
// INFO: true when navigator is offline — used to switch ReadQueryHoc between
|
|
643
666
|
// server reads (online, full pagination) and IndexedDB reads (offline, cached data).
|
|
644
667
|
// Independent of SSE status so it works even when bareSocketName is not set.
|
|
645
|
-
var
|
|
668
|
+
var _228 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _228[0], setIsNetworkOffline = _228[1];
|
|
646
669
|
var previousType = (0, react_1.useRef)(null);
|
|
647
670
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
648
671
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
@@ -759,16 +782,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
759
782
|
* viewId still wins when present: it is a deliberate destination, from a
|
|
760
783
|
* shared link or a back button.
|
|
761
784
|
*/
|
|
762
|
-
var defaultTabName = (
|
|
785
|
+
var defaultTabName = (_9 = (_8 = (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.extendedTabs) === null || _8 === void 0 ? void 0 : _8.find(function (eachTab) { return eachTab.defaultTab; })) === null || _9 === void 0 ? void 0 : _9.name;
|
|
763
786
|
// INFO: the pinned tab is a LIST destination. Falling back to it while a
|
|
764
787
|
// record is open resolved the read view to a list tab, which renderTabContent
|
|
765
788
|
// refuses — so General Details rendered nothing. Only a list falls back.
|
|
766
|
-
var viewType = (
|
|
789
|
+
var viewType = (_11 = (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.viewId) !== null && _11 !== void 0 ? _11 : (resolvedType === "list" && defaultTabName
|
|
767
790
|
? (0, utils_1.lowercaseTextToId)(defaultTabName)
|
|
768
791
|
: "general");
|
|
769
792
|
var isFirebaseClient = devSettings.server === "firebase";
|
|
770
793
|
var isFirebase = isFirebaseClient || devSettings.server === "fbServer";
|
|
771
|
-
var dbModule = isFirebaseClient ? (
|
|
794
|
+
var dbModule = isFirebaseClient ? (_12 = props.lib) === null || _12 === void 0 ? void 0 : _12.firebase : (_13 = props.lib) === null || _13 === void 0 ? void 0 : _13.axios;
|
|
772
795
|
var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
|
|
773
796
|
var selectedRelated = resolvedType === "read"
|
|
774
797
|
? relatedSections.find(function (eachSection) { return eachSection.id === viewType; })
|
|
@@ -850,32 +873,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
850
873
|
}, [
|
|
851
874
|
resolvedType,
|
|
852
875
|
props.id,
|
|
853
|
-
(
|
|
876
|
+
(_14 = props.space) === null || _14 === void 0 ? void 0 : _14._id,
|
|
854
877
|
props.devSettings.schemaEndpoint,
|
|
855
|
-
(
|
|
878
|
+
(_15 = props.organise) === null || _15 === void 0 ? void 0 : _15.showRelatedTab,
|
|
856
879
|
]);
|
|
857
880
|
/* eslint-enable */
|
|
858
881
|
// INFO: the view settings panel (columns, sort, rows per page) is standard on
|
|
859
882
|
// the new DTW; bareViewSettings stays the opt-in for legacy and bare DTWs
|
|
860
|
-
var isViewSettingsEnabled = ((
|
|
883
|
+
var isViewSettingsEnabled = ((_16 = props.bareSettings) === null || _16 === void 0 ? void 0 : _16.bareViewSettings) || ((_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareNewDTW)
|
|
861
884
|
? true
|
|
862
885
|
: false;
|
|
863
886
|
// INFO: a consumer that wires onChangeHide owns the hide at schema level
|
|
864
887
|
// (shared by every user) — toggling writes to the model and calls back. Without it
|
|
865
888
|
// the hide is this user's own and lives in userHiddenColumnIds.
|
|
866
|
-
var isSchemaHideMode = ((
|
|
889
|
+
var isSchemaHideMode = ((_18 = props.organise) === null || _18 === void 0 ? void 0 : _18.onChangeHide) ? true : false;
|
|
867
890
|
// INFO: rows per page is a view setting the user can change, so it starts from
|
|
868
891
|
// the persisted value and falls back to the consumer's limit
|
|
869
|
-
var
|
|
892
|
+
var _229 = (0, react_1.useState)((_20 = (_19 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _19 !== void 0 ? _19 : props.limit) !== null && _20 !== void 0 ? _20 : 10), pageLimit = _229[0], setPageLimit = _229[1];
|
|
870
893
|
var limit = pageLimit;
|
|
871
|
-
var isSavedViewsEnabled = !!((
|
|
894
|
+
var isSavedViewsEnabled = !!((_21 = props.organise) === null || _21 === void 0 ? void 0 : _21.savedViews) && resolvedType === "list";
|
|
872
895
|
// INFO: an app that stores views takes over from this browser's storage, so
|
|
873
896
|
// every view is the team's and nothing is kept locally
|
|
874
|
-
var isAppViews = ((
|
|
875
|
-
!!((
|
|
897
|
+
var isAppViews = ((_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.sharedViews) !== undefined ||
|
|
898
|
+
!!((_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.onChangeSharedViews);
|
|
876
899
|
// INFO: a saved view carries its sort, so the sort is held here as with persistViewState
|
|
877
900
|
var isInternalSort = isPersistEnabled || isSavedViewsEnabled;
|
|
878
|
-
var activeSortId = (isInternalSort && persistedSort) || ((
|
|
901
|
+
var activeSortId = (isInternalSort && persistedSort) || ((_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.sort);
|
|
879
902
|
var handleSortColumn = function (value) {
|
|
880
903
|
var _a, _b, _c, _d;
|
|
881
904
|
if (isInternalSort)
|
|
@@ -905,7 +928,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
905
928
|
// INFO: Firebase pages by document cursor and a union by skip, so neither
|
|
906
929
|
// can hand over the whole set — there formula columns are not offered for
|
|
907
930
|
// sorting or filtering, rather than ordering one page
|
|
908
|
-
var isFormulaViewSupported = !isFirebase && !((
|
|
931
|
+
var isFormulaViewSupported = !isFirebase && !((_26 = (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.unionCollections) === null || _26 === void 0 ? void 0 : _26.length);
|
|
909
932
|
var formulaSort = isFormulaViewSupported &&
|
|
910
933
|
(activeSortId === null || activeSortId === void 0 ? void 0 : activeSortId.sortId) &&
|
|
911
934
|
formulaColumnIds.includes(activeSortId.sortId)
|
|
@@ -914,10 +937,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
914
937
|
// INFO: a referenced record is joined by MongoWrapper's lookup and a list
|
|
915
938
|
// row is matched by its Mongo path — neither Firebase nor a union read runs
|
|
916
939
|
// them
|
|
917
|
-
var flexFilterExtras = !isFirebase && !((
|
|
940
|
+
var flexFilterExtras = !isFirebase && !((_28 = (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.unionCollections) === null || _28 === void 0 ? void 0 : _28.length)
|
|
918
941
|
? {
|
|
919
|
-
references: (
|
|
920
|
-
listObjects: (
|
|
942
|
+
references: (_29 = props.bareSettings) === null || _29 === void 0 ? void 0 : _29.bareFlexFilterReferences,
|
|
943
|
+
listObjects: (_30 = props.bareSettings) === null || _30 === void 0 ? void 0 : _30.bareFlexFilterListObjects,
|
|
921
944
|
}
|
|
922
945
|
: undefined;
|
|
923
946
|
var formulaFlexQueries = isFormulaViewSupported && formulaColumnIds.length > 0
|
|
@@ -978,18 +1001,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
978
1001
|
displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
|
|
979
1002
|
};
|
|
980
1003
|
};
|
|
981
|
-
var
|
|
982
|
-
var isEditor = ((
|
|
983
|
-
var isOffline = (
|
|
1004
|
+
var _230 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _230.canUpdateRecord, canInlineUpdate = _230.canInlineUpdate, canBatchUpdate = _230.canBatchUpdate, canDeleteRecord = _230.canDeleteRecord;
|
|
1005
|
+
var isEditor = ((_31 = props.edit) === null || _31 === void 0 ? void 0 : _31.allEditable) ? true : false;
|
|
1006
|
+
var isOffline = (_32 = props.bareSettings) === null || _32 === void 0 ? void 0 : _32.bareOffline;
|
|
984
1007
|
// INFO: when bareOfflineNetworkAware is true, the save path is also gated on
|
|
985
1008
|
// the live network state — online saves go to the server even if bareOffline
|
|
986
1009
|
// is true, offline saves go to IDB as normal.
|
|
987
|
-
var isOfflineNetworkListener = isOffline && ((
|
|
988
|
-
var showId = (
|
|
1010
|
+
var isOfflineNetworkListener = isOffline && ((_33 = props.bareSettings) === null || _33 === void 0 ? void 0 : _33.bareOfflineNetworkListener);
|
|
1011
|
+
var showId = (_34 = props.space) === null || _34 === void 0 ? void 0 : _34.showId;
|
|
989
1012
|
var remainId = showId || selectedObjectStructureId ? true : false;
|
|
990
|
-
var idField = ((
|
|
991
|
-
var pipeline = (
|
|
992
|
-
if ((
|
|
1013
|
+
var idField = ((_35 = props.space) === null || _35 === void 0 ? void 0 : _35.idField) || ((_36 = props.organise) === null || _36 === void 0 ? void 0 : _36.idField);
|
|
1014
|
+
var pipeline = (_37 = props === null || props === void 0 ? void 0 : props.space) === null || _37 === void 0 ? void 0 : _37.pipeline;
|
|
1015
|
+
if ((_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareListPipeline) {
|
|
993
1016
|
pipeline = pipeline
|
|
994
1017
|
? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
|
|
995
1018
|
}
|
|
@@ -1002,24 +1025,24 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1002
1025
|
* three records came back instead of five files, and each tile received the
|
|
1003
1026
|
* whole array rather than one file, so every one of them read "Attachment".
|
|
1004
1027
|
*/
|
|
1005
|
-
var fileViewColumnId = (
|
|
1028
|
+
var fileViewColumnId = (_42 = (_41 = ((_40 = (_39 = props.organise) === null || _39 === void 0 ? void 0 : _39.extendedTabs) !== null && _40 !== void 0 ? _40 : []).find(function (eachTab) {
|
|
1006
1029
|
return eachTab.viewType === "file" &&
|
|
1007
1030
|
(0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
|
|
1008
|
-
})) === null ||
|
|
1009
|
-
var hasNavigation = ((
|
|
1031
|
+
})) === null || _41 === void 0 ? void 0 : _41.fileSettings) === null || _42 === void 0 ? void 0 : _42.columnId;
|
|
1032
|
+
var hasNavigation = ((_43 = props.organise) === null || _43 === void 0 ? void 0 : _43.handleNavigate) ? true : false;
|
|
1010
1033
|
var formColumn = "grid-cols-12";
|
|
1011
|
-
var useMobileView = (
|
|
1034
|
+
var useMobileView = (_45 = (_44 = props.bareSettings) === null || _44 === void 0 ? void 0 : _44.bareUpdateMobileView) !== null && _45 !== void 0 ? _45 : false;
|
|
1012
1035
|
var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
|
|
1013
|
-
var isActivityLog = (((
|
|
1014
|
-
((
|
|
1015
|
-
(((
|
|
1016
|
-
((
|
|
1017
|
-
var customPaginationSize = ((
|
|
1036
|
+
var isActivityLog = (((_47 = (_46 = props.edit) === null || _46 === void 0 ? void 0 : _46.activityLog) === null || _47 === void 0 ? void 0 : _47.enableComments) &&
|
|
1037
|
+
((_48 = props.edit) === null || _48 === void 0 ? void 0 : _48.activityLog.commentCollectionId)) ||
|
|
1038
|
+
(((_50 = (_49 = props.edit) === null || _49 === void 0 ? void 0 : _49.activityLog) === null || _50 === void 0 ? void 0 : _50.enableLogs) &&
|
|
1039
|
+
((_51 = props.edit) === null || _51 === void 0 ? void 0 : _51.activityLog.logsCollectionId));
|
|
1040
|
+
var customPaginationSize = ((_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.customPaginationCount)
|
|
1018
1041
|
? props.organise.customPaginationCount(size)
|
|
1019
1042
|
: undefined;
|
|
1020
1043
|
//TODO : Code - Pass ...devSettings, search dbEndpoint:
|
|
1021
1044
|
var writeServerQuery = new writeQuery_1.WriteQuery({
|
|
1022
|
-
dbModule: (
|
|
1045
|
+
dbModule: (_53 = props.lib) === null || _53 === void 0 ? void 0 : _53.axios,
|
|
1023
1046
|
dbType: devSettings.server,
|
|
1024
1047
|
dbCollection: props.collectionId,
|
|
1025
1048
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -1027,7 +1050,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1027
1050
|
dbUserToken: devSettings.dbUserToken,
|
|
1028
1051
|
});
|
|
1029
1052
|
var readServerQuery = new readQuery_1.ReadQuery({
|
|
1030
|
-
dbModule: (
|
|
1053
|
+
dbModule: (_54 = props.lib) === null || _54 === void 0 ? void 0 : _54.axios,
|
|
1031
1054
|
dbType: devSettings.server,
|
|
1032
1055
|
dbCollection: props.collectionId,
|
|
1033
1056
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -1035,12 +1058,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1035
1058
|
dbUserToken: devSettings.dbUserToken,
|
|
1036
1059
|
});
|
|
1037
1060
|
var moreButtonPopUp = [
|
|
1038
|
-
((
|
|
1061
|
+
((_55 = props.edit) === null || _55 === void 0 ? void 0 : _55.allEditable) &&
|
|
1039
1062
|
// INFO: the import runs on the server (importEndpoint), so a Firestore
|
|
1040
1063
|
// datasheet served through one can import; only the browser-direct
|
|
1041
1064
|
// Firebase client has no server to import through
|
|
1042
1065
|
!isFirebaseClient &&
|
|
1043
|
-
!((
|
|
1066
|
+
!((_57 = (_56 = props.organise) === null || _56 === void 0 ? void 0 : _56.exportSettings) === null || _57 === void 0 ? void 0 : _57.hideImportCSV)
|
|
1044
1067
|
? {
|
|
1045
1068
|
text: "Import Excel",
|
|
1046
1069
|
onClick: function () {
|
|
@@ -1049,7 +1072,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1049
1072
|
},
|
|
1050
1073
|
}
|
|
1051
1074
|
: null,
|
|
1052
|
-
!((
|
|
1075
|
+
!((_59 = (_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.exportSettings) === null || _59 === void 0 ? void 0 : _59.hideExportCSV)
|
|
1053
1076
|
? {
|
|
1054
1077
|
text: "Export CSV",
|
|
1055
1078
|
onClick: function () {
|
|
@@ -1059,7 +1082,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1059
1082
|
},
|
|
1060
1083
|
}
|
|
1061
1084
|
: null,
|
|
1062
|
-
!((
|
|
1085
|
+
!((_61 = (_60 = props.organise) === null || _60 === void 0 ? void 0 : _60.exportSettings) === null || _61 === void 0 ? void 0 : _61.hideExportExcel)
|
|
1063
1086
|
? {
|
|
1064
1087
|
text: "Export Excel",
|
|
1065
1088
|
onClick: function () {
|
|
@@ -1069,7 +1092,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1069
1092
|
},
|
|
1070
1093
|
}
|
|
1071
1094
|
: null,
|
|
1072
|
-
!((
|
|
1095
|
+
!((_63 = (_62 = props.organise) === null || _62 === void 0 ? void 0 : _62.exportSettings) === null || _63 === void 0 ? void 0 : _63.hideExportPDF)
|
|
1073
1096
|
? {
|
|
1074
1097
|
text: "Export PDF",
|
|
1075
1098
|
onClick: function () {
|
|
@@ -1079,7 +1102,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1079
1102
|
},
|
|
1080
1103
|
}
|
|
1081
1104
|
: null,
|
|
1082
|
-
!((
|
|
1105
|
+
!((_65 = (_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.exportSettings) === null || _65 === void 0 ? void 0 : _65.hideExportQR)
|
|
1083
1106
|
? {
|
|
1084
1107
|
text: "Export QR",
|
|
1085
1108
|
onClick: function () {
|
|
@@ -1089,7 +1112,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1089
1112
|
},
|
|
1090
1113
|
}
|
|
1091
1114
|
: null,
|
|
1092
|
-
!((
|
|
1115
|
+
!((_67 = (_66 = props.organise) === null || _66 === void 0 ? void 0 : _66.exportSettings) === null || _67 === void 0 ? void 0 : _67.hideExportQR)
|
|
1093
1116
|
? {
|
|
1094
1117
|
text: "Export QR(Data)",
|
|
1095
1118
|
onClick: function () {
|
|
@@ -1099,7 +1122,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1099
1122
|
},
|
|
1100
1123
|
}
|
|
1101
1124
|
: null,
|
|
1102
|
-
!((
|
|
1125
|
+
!((_69 = (_68 = props.organise) === null || _68 === void 0 ? void 0 : _68.exportSettings) === null || _69 === void 0 ? void 0 : _69.hideExportPrint)
|
|
1103
1126
|
? {
|
|
1104
1127
|
text: "Print",
|
|
1105
1128
|
onClick: function () {
|
|
@@ -1111,8 +1134,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1111
1134
|
: null,
|
|
1112
1135
|
// INFO: drafts only exist where the form can save one, so the filter has
|
|
1113
1136
|
// nothing to find on any other page
|
|
1114
|
-
((
|
|
1115
|
-
!((
|
|
1137
|
+
((_70 = props.edit) === null || _70 === void 0 ? void 0 : _70.enableUpdateDraft) &&
|
|
1138
|
+
!((_72 = (_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.exportSettings) === null || _72 === void 0 ? void 0 : _72.hideExportDraft)
|
|
1116
1139
|
? {
|
|
1117
1140
|
text: filterDraft ? "Show All Items" : "Filter Draft",
|
|
1118
1141
|
onClick: function () {
|
|
@@ -1121,7 +1144,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1121
1144
|
}
|
|
1122
1145
|
: null,
|
|
1123
1146
|
].filter(Boolean);
|
|
1124
|
-
if ((
|
|
1147
|
+
if ((_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.moreSettings)
|
|
1125
1148
|
moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
|
|
1126
1149
|
//=====================================================================================
|
|
1127
1150
|
//SECTION: User Column Visibility Handlers
|
|
@@ -1515,14 +1538,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1515
1538
|
//=====================================================================================
|
|
1516
1539
|
//SECTION: Saved Views
|
|
1517
1540
|
//=====================================================================================
|
|
1518
|
-
var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (
|
|
1541
|
+
var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.persistKey, (_75 = devSettings.currentUser) === null || _75 === void 0 ? void 0 : _75.userEmail);
|
|
1519
1542
|
(0, react_1.useEffect)(function () {
|
|
1520
1543
|
if (isSavedViewsEnabled && !isAppViews)
|
|
1521
1544
|
setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
|
|
1522
1545
|
}, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
|
|
1523
1546
|
// INFO: the app keeps All's settings, so every change is kept in this
|
|
1524
1547
|
// browser until the person updates the view for everyone or resets it
|
|
1525
|
-
var isViewDraftsEnabled = isSavedViewsEnabled && ((
|
|
1548
|
+
var isViewDraftsEnabled = isSavedViewsEnabled && ((_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.allView) !== undefined;
|
|
1526
1549
|
var handleGetViewDraftKey = function (viewId) {
|
|
1527
1550
|
var _a, _b;
|
|
1528
1551
|
return (0, viewStatePersistence_1.buildViewDraftKey)(props.collectionId, viewId !== null && viewId !== void 0 ? viewId : "all", (_a = props.organise) === null || _a === void 0 ? void 0 : _a.persistKey, (_b = devSettings.currentUser) === null || _b === void 0 ? void 0 : _b.userEmail);
|
|
@@ -1599,7 +1622,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1599
1622
|
var lastSentSharedViewsRef = (0, react_1.useRef)(null);
|
|
1600
1623
|
(0, react_1.useEffect)(function () {
|
|
1601
1624
|
lastSentSharedViewsRef.current = null;
|
|
1602
|
-
}, [(
|
|
1625
|
+
}, [(_77 = props.organise) === null || _77 === void 0 ? void 0 : _77.sharedViews]);
|
|
1603
1626
|
var handleStoreSharedViews = function (update) {
|
|
1604
1627
|
var _a, _b, _c;
|
|
1605
1628
|
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
|
|
@@ -1644,13 +1667,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1644
1667
|
/* eslint-disable */
|
|
1645
1668
|
}, [
|
|
1646
1669
|
isSavedViewsEnabled,
|
|
1647
|
-
(
|
|
1648
|
-
(
|
|
1649
|
-
(
|
|
1670
|
+
(_78 = props.organise) === null || _78 === void 0 ? void 0 : _78.initialSavedViewId,
|
|
1671
|
+
(_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.defaultSavedViewId,
|
|
1672
|
+
(_80 = props.organise) === null || _80 === void 0 ? void 0 : _80.sharedViews,
|
|
1650
1673
|
savedViews,
|
|
1651
1674
|
]);
|
|
1652
1675
|
/* eslint-enable */
|
|
1653
|
-
var defaultSavedViewIds = ((
|
|
1676
|
+
var defaultSavedViewIds = ((_82 = (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.defaultSavedViews) !== null && _82 !== void 0 ? _82 : [])
|
|
1654
1677
|
.map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
|
|
1655
1678
|
.join("|");
|
|
1656
1679
|
// INFO: keyed on the ids, not the array, so an inline literal passed on every
|
|
@@ -1952,8 +1975,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1952
1975
|
pageLimit,
|
|
1953
1976
|
groupId,
|
|
1954
1977
|
columnWidths,
|
|
1955
|
-
(
|
|
1956
|
-
(
|
|
1978
|
+
(_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.allView,
|
|
1979
|
+
(_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.sharedViews,
|
|
1957
1980
|
savedViews,
|
|
1958
1981
|
]);
|
|
1959
1982
|
/* eslint-enable */
|
|
@@ -1993,7 +2016,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1993
2016
|
var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
|
|
1994
2017
|
scrollRestoredRef.current = isSwitch || isOtherListReturn;
|
|
1995
2018
|
/* eslint-disable */
|
|
1996
|
-
}, [props.collectionId, (
|
|
2019
|
+
}, [props.collectionId, (_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.persistKey]);
|
|
1997
2020
|
/* eslint-enable */
|
|
1998
2021
|
// INFO: wait a frame — rows land in state one tick before layout
|
|
1999
2022
|
(0, react_1.useEffect)(function () {
|
|
@@ -2028,7 +2051,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2028
2051
|
(0, react_1.useEffect)(function () {
|
|
2029
2052
|
handleOfflinePrefetch();
|
|
2030
2053
|
/* eslint-disable */
|
|
2031
|
-
}, [props.collectionId, (
|
|
2054
|
+
}, [props.collectionId, (_86 = props.bareSettings) === null || _86 === void 0 ? void 0 : _86.bareOffline]);
|
|
2032
2055
|
/* eslint-enable */
|
|
2033
2056
|
// INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
|
|
2034
2057
|
// Calls through handleRefreshRef so the interval always dispatches the latest
|
|
@@ -2048,7 +2071,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2048
2071
|
}, interval);
|
|
2049
2072
|
return function () { return clearInterval(timer); };
|
|
2050
2073
|
/* eslint-disable */
|
|
2051
|
-
}, [(
|
|
2074
|
+
}, [(_87 = props.bareSettings) === null || _87 === void 0 ? void 0 : _87.barePollingInterval, isLive, isNetworkOffline]);
|
|
2052
2075
|
/* eslint-enable */
|
|
2053
2076
|
// INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
|
|
2054
2077
|
// EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
|
|
@@ -2090,7 +2113,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2090
2113
|
};
|
|
2091
2114
|
/* eslint-disable */
|
|
2092
2115
|
}, [
|
|
2093
|
-
(
|
|
2116
|
+
(_88 = props.bareSettings) === null || _88 === void 0 ? void 0 : _88.bareSocketName,
|
|
2094
2117
|
props.collectionId,
|
|
2095
2118
|
props.devSettings.sseEndpoint,
|
|
2096
2119
|
props.devSettings.dbAPIToken,
|
|
@@ -2364,10 +2387,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2364
2387
|
props.collectionId,
|
|
2365
2388
|
props.model,
|
|
2366
2389
|
props.localURLEndpoint,
|
|
2367
|
-
(
|
|
2368
|
-
(
|
|
2369
|
-
(
|
|
2370
|
-
(
|
|
2390
|
+
(_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.extendedTabs,
|
|
2391
|
+
(_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.viewId,
|
|
2392
|
+
(_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.additionalQuery,
|
|
2393
|
+
(_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.groupBy,
|
|
2371
2394
|
resolvedType,
|
|
2372
2395
|
]);
|
|
2373
2396
|
/**
|
|
@@ -2519,7 +2542,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2519
2542
|
};
|
|
2520
2543
|
}, 100);
|
|
2521
2544
|
return function () { return clearTimeout(timeoutId); };
|
|
2522
|
-
}, [(
|
|
2545
|
+
}, [(_93 = props.organise) === null || _93 === void 0 ? void 0 : _93.showReadFloatingNav, resolvedType, props.id, loading]);
|
|
2523
2546
|
(0, react_1.useEffect)(function () {
|
|
2524
2547
|
if (resolvedType !== "read")
|
|
2525
2548
|
return;
|
|
@@ -5595,7 +5618,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5595
5618
|
// update an inline cell edit makes, gated on the same update right
|
|
5596
5619
|
var columnTypeActions = {
|
|
5597
5620
|
canUpdate: canUpdateRecord,
|
|
5598
|
-
onButtonClick: (
|
|
5621
|
+
onButtonClick: (_94 = props.organise) === null || _94 === void 0 ? void 0 : _94.onButtonClick,
|
|
5599
5622
|
onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5600
5623
|
var _a;
|
|
5601
5624
|
return __generator(this, function (_b) {
|
|
@@ -5612,7 +5635,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5612
5635
|
}
|
|
5613
5636
|
});
|
|
5614
5637
|
}); },
|
|
5615
|
-
onTimeTrackingAction: ((
|
|
5638
|
+
onTimeTrackingAction: ((_95 = props.organise) === null || _95 === void 0 ? void 0 : _95.onTimeTrackingAction) && canUpdateRecord
|
|
5616
5639
|
? function (rowId, columnId, action) {
|
|
5617
5640
|
return handleTimeTrackingAction(rowId, columnId, action);
|
|
5618
5641
|
}
|
|
@@ -7826,8 +7849,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7826
7849
|
: rows;
|
|
7827
7850
|
};
|
|
7828
7851
|
/* eslint-disable */
|
|
7829
|
-
var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (
|
|
7830
|
-
var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (
|
|
7852
|
+
var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_96 = props.bareSettings) === null || _96 === void 0 ? void 0 : _96.bareNewDTW]);
|
|
7853
|
+
var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_97 = props.bareSettings) === null || _97 === void 0 ? void 0 : _97.bareNewDTW]);
|
|
7831
7854
|
/* eslint-enable */
|
|
7832
7855
|
// INFO: the pencil beside a record's title opens the same form the Update
|
|
7833
7856
|
// column's pencil did, for whoever may update; the bubble beside it opens
|
|
@@ -8542,39 +8565,71 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8542
8565
|
// recursion terminates at one level. Everything else about it — the schema,
|
|
8543
8566
|
// the endpoints, the roles — is this instance's own props, so a consumer
|
|
8544
8567
|
// configures the table once and the panel inherits it.
|
|
8568
|
+
var handleMarkDrawerFormEdited = function () {
|
|
8569
|
+
if (drawerFormRef.current)
|
|
8570
|
+
drawerFormEditedRef.current = true;
|
|
8571
|
+
};
|
|
8572
|
+
// INFO: a picker changes a value with a click and no input event; clicking into
|
|
8573
|
+
// a text field or an empty part of the form changes nothing
|
|
8574
|
+
var handleMarkDrawerFormChoice = function (event) {
|
|
8575
|
+
var _a;
|
|
8576
|
+
var target = event.target;
|
|
8577
|
+
if ((_a = target.closest) === null || _a === void 0 ? void 0 : _a.call(target, 'button, [role="option"], [role="menuitem"], li'))
|
|
8578
|
+
handleMarkDrawerFormEdited();
|
|
8579
|
+
};
|
|
8545
8580
|
var renderReadDrawer = function () {
|
|
8546
8581
|
var _a, _b, _c, _d;
|
|
8547
|
-
if (!
|
|
8582
|
+
if (!canHostDrawer)
|
|
8548
8583
|
return null;
|
|
8584
|
+
var isForm = drawerFormRef.current;
|
|
8585
|
+
var handleCloseDrawer = function () {
|
|
8586
|
+
var _a, _b;
|
|
8587
|
+
setDrawerDiscardModal(false);
|
|
8588
|
+
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "list", "");
|
|
8589
|
+
};
|
|
8549
8590
|
var _e = (_b = (_a = props.viewSettings) === null || _a === void 0 ? void 0 : _a.readDrawer) !== null && _b !== void 0 ? _b : {}, anchor = _e.anchor, maxWidth = _e.maxWidth, maxHeight = _e.maxHeight, desc = _e.desc, disableExpand = _e.disableExpand, title = _e.title;
|
|
8550
|
-
return (react_1.default.createElement(drawer_1.Drawer, { darkMode: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode, darkModeBg: (_d = props.organise) === null || _d === void 0 ? void 0 : _d.darkModeBg, testId:
|
|
8591
|
+
return (react_1.default.createElement(drawer_1.Drawer, { darkMode: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkMode, darkModeBg: (_d = props.organise) === null || _d === void 0 ? void 0 : _d.darkModeBg, testId: isForm ? "dt-form-drawer" : "dt-read-drawer", open: isDrawerHost, onClose: handleCloseDrawer, unmountOnClose: true, anchor: anchor !== null && anchor !== void 0 ? anchor : "responsive", maxWidth: maxWidth !== null && maxWidth !== void 0 ? maxWidth : "3xl",
|
|
8551
8592
|
// INFO: a phone keyboard takes half the screen, which leaves a form in a
|
|
8552
|
-
// three-quarter sheet almost no room for the field being typed in
|
|
8553
|
-
|
|
8554
|
-
|
|
8555
|
-
//
|
|
8556
|
-
|
|
8593
|
+
// three-quarter sheet almost no room for the field being typed in. It
|
|
8594
|
+
// stops short of the top so there is still something to tap to close it.
|
|
8595
|
+
maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : (isForm ? "90" : "75"),
|
|
8596
|
+
// INFO: nothing typed into a form has been saved yet, so a tap outside or
|
|
8597
|
+
// Escape asks first once it has been edited
|
|
8598
|
+
onDismiss: function () {
|
|
8599
|
+
if (isForm && drawerFormEditedRef.current)
|
|
8600
|
+
setDrawerDiscardModal(true);
|
|
8601
|
+
else
|
|
8602
|
+
handleCloseDrawer();
|
|
8603
|
+
}, title: title !== null && title !== void 0 ? title : (typeof props.title === "string" && props.title
|
|
8557
8604
|
? props.title
|
|
8558
|
-
: "Details"), desc: desc, expandable: !disableExpand, onExpand: function () { return setDrawerPageView(true); }, content: react_1.default.createElement(
|
|
8559
|
-
|
|
8560
|
-
|
|
8561
|
-
|
|
8562
|
-
|
|
8563
|
-
|
|
8564
|
-
|
|
8565
|
-
|
|
8566
|
-
|
|
8567
|
-
|
|
8568
|
-
|
|
8569
|
-
|
|
8570
|
-
|
|
8571
|
-
|
|
8572
|
-
|
|
8573
|
-
|
|
8574
|
-
|
|
8575
|
-
|
|
8576
|
-
|
|
8577
|
-
|
|
8605
|
+
: "Details"), desc: desc, expandable: !disableExpand, onExpand: function () { return setDrawerPageView(true); }, content: react_1.default.createElement("div", { onInputCapture: handleMarkDrawerFormEdited, onChangeCapture: handleMarkDrawerFormEdited, onClickCapture: handleMarkDrawerFormChoice },
|
|
8606
|
+
react_1.default.createElement(exports.DataTemplate, __assign({ key: drawerSessionRef.current }, props, { id: drawerReadIdRef.current, type: isForm ? "update" : "read",
|
|
8607
|
+
// INFO: strips the flag so the nested instance renders the record
|
|
8608
|
+
// rather than hosting another drawer
|
|
8609
|
+
viewSettings: undefined,
|
|
8610
|
+
// INFO: the panel header already names the record, and a
|
|
8611
|
+
// list/detail breadcrumb is meaningless while the list is still on
|
|
8612
|
+
// screen behind it
|
|
8613
|
+
title: "", description: "", organise: __assign(__assign({}, props.organise), { breadcrumbType: "hidden" }), bareSettings: __assign(__assign(__assign({
|
|
8614
|
+
// INFO: DetailList's stacked rows waste a panel this narrow —
|
|
8615
|
+
// compact puts label and value on one row. Overridable.
|
|
8616
|
+
bareCompactMode: !isForm }, props.bareSettings), {
|
|
8617
|
+
// INFO: the nested instance draws the form rather than hosting
|
|
8618
|
+
// another panel
|
|
8619
|
+
bareFormDrawer: false }), (isDrawerHost
|
|
8620
|
+
? {}
|
|
8621
|
+
: {
|
|
8622
|
+
barePollingInterval: undefined,
|
|
8623
|
+
bareSocketName: undefined,
|
|
8624
|
+
})) }))) }));
|
|
8625
|
+
};
|
|
8626
|
+
var renderDrawerDiscardModal = function () { return (react_1.default.createElement(modal_1.Modal, { open: drawerDiscardModal, onClose: function () { return setDrawerDiscardModal(false); }, title: "Discard changes?", renderContent: function () { return (react_1.default.createElement("div", { className: "flex flex-row justify-end pt-5 space-x-2" },
|
|
8627
|
+
react_1.default.createElement(button_1.Button, { id: "dtw-form-keep", text: "Keep Editing", size: "small", type: "light", onClick: function () { return setDrawerDiscardModal(false); } }),
|
|
8628
|
+
react_1.default.createElement(button_1.Button, { id: "dtw-form-discard", text: "Discard", size: "small", type: "danger", onClick: function () {
|
|
8629
|
+
var _a, _b;
|
|
8630
|
+
setDrawerDiscardModal(false);
|
|
8631
|
+
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "list", "");
|
|
8632
|
+
} }))); } })); };
|
|
8578
8633
|
var renderContent = function () {
|
|
8579
8634
|
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;
|
|
8580
8635
|
var isBottom = ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom) ? true : false;
|
|
@@ -9160,7 +9215,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9160
9215
|
((_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareSocketName) && isLiveOffline && (react_1.default.createElement("span", { className: "inline-flex items-center gap-1 rounded-full bg-orange-100 px-2 py-0.5 text-xs font-medium text-orange-700" },
|
|
9161
9216
|
react_1.default.createElement("span", { className: "h-1.5 w-1.5 rounded-full bg-orange-400" }),
|
|
9162
9217
|
"OFFLINE")))),
|
|
9163
|
-
props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500 ".concat(isMobileToolbar_1 ? "
|
|
9218
|
+
props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500 ".concat(isMobileToolbar_1 ? "truncate md:whitespace-normal" : "") }, props.description)))),
|
|
9164
9219
|
react_1.default.createElement("div", { className: ((_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareCompactMode)
|
|
9165
9220
|
? "hidden sm:block grow"
|
|
9166
9221
|
: "grow" }),
|
|
@@ -11832,14 +11887,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
11832
11887
|
};
|
|
11833
11888
|
return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
|
|
11834
11889
|
renderNotification("root"),
|
|
11835
|
-
((
|
|
11890
|
+
((_99 = (_98 = props.renderSettings) === null || _98 === void 0 ? void 0 : _98.renderLoadingUI) === null || _99 === void 0 ? void 0 : _99.call(_98)) && loading ? ((_100 = props.renderSettings) === null || _100 === void 0 ? void 0 : _100.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.darkMode, darkModeBg: (_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
|
|
11836
11891
|
var _a, _b;
|
|
11837
11892
|
if (loading)
|
|
11838
11893
|
return;
|
|
11839
11894
|
handlePopUpModal(false);
|
|
11840
11895
|
setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
|
|
11841
11896
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
|
|
11842
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11897
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.darkMode, darkModeBg: (_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
|
|
11843
11898
|
return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
|
|
11844
11899
|
if (dataId) {
|
|
11845
11900
|
var currentValue = selectedData[referenceCreationModal.id];
|
|
@@ -11855,19 +11910,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
11855
11910
|
}, onClose: function () {
|
|
11856
11911
|
setReferenceCreationModal({ id: "", name: "", type: "string" });
|
|
11857
11912
|
} }),
|
|
11858
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11913
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.darkMode, darkModeBg: (_106 = props.organise) === null || _106 === void 0 ? void 0 : _106.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
|
|
11859
11914
|
setReferenceDeleteTableData({});
|
|
11860
11915
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
11861
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11916
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_107 = props.organise) === null || _107 === void 0 ? void 0 : _107.darkMode, darkModeBg: (_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
|
|
11862
11917
|
setDeletePasscodeInput("");
|
|
11863
11918
|
setDeleteModal(!deleteModal);
|
|
11864
11919
|
setDeleteFeedId("");
|
|
11865
11920
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
11866
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11921
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.darkMode, darkModeBg: (_110 = props.organise) === null || _110 === void 0 ? void 0 : _110.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
|
|
11867
11922
|
setBatchUpdateData({ columnId: "", columnData: {} });
|
|
11868
11923
|
setBatchUpdateModal(false);
|
|
11869
11924
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
11870
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11925
|
+
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, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
|
|
11871
11926
|
var _a, _b;
|
|
11872
11927
|
if (props.space)
|
|
11873
11928
|
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 }));
|
|
@@ -11877,18 +11932,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
11877
11932
|
} }),
|
|
11878
11933
|
renderContent(),
|
|
11879
11934
|
renderReadDrawer(),
|
|
11935
|
+
canHostDrawer && renderDrawerDiscardModal(),
|
|
11880
11936
|
isActivityLog &&
|
|
11881
11937
|
typeof document !== "undefined" &&
|
|
11882
11938
|
(0, react_dom_1.createPortal)(
|
|
11883
11939
|
// INFO: z-50 lifts it over a Modal the table may sit in (z-40)
|
|
11884
11940
|
react_1.default.createElement("div", { className: "relative z-50" },
|
|
11885
|
-
react_1.default.createElement(drawer_1.Drawer, { darkMode: (
|
|
11941
|
+
react_1.default.createElement(drawer_1.Drawer, { darkMode: (_113 = props.organise) === null || _113 === void 0 ? void 0 : _113.darkMode, darkModeBg: (_114 = props.organise) === null || _114 === void 0 ? void 0 : _114.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
|
|
11886
11942
|
// INFO: the record stays set while the drawer slides out — clearing it
|
|
11887
11943
|
// would remount the hidden panel collection-wide and fetch again. The
|
|
11888
11944
|
// toolbar's collection-wide button clears it when it opens.
|
|
11889
11945
|
onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75", title: "Activity Log", content: react_1.default.createElement(activityModal_1.ActivityModal, { title: props.title && typeof props.title === "string"
|
|
11890
11946
|
? props.title
|
|
11891
|
-
: "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((
|
|
11947
|
+
: "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((_115 = props.id) !== null && _115 !== void 0 ? _115 : "") : activityId, activityLog: (_116 = props.edit) === null || _116 === void 0 ? void 0 : _116.activityLog, model: structure }) })), document.body),
|
|
11892
11948
|
renderScrollSentinel()));
|
|
11893
11949
|
});
|
|
11894
11950
|
//# sourceMappingURL=index.js.map
|