blixify-ui-web 1.2.199 → 1.2.200
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/columnTypes/context.d.ts +1 -0
- package/lib/components/data/columnTypes/context.d.ts.map +1 -1
- package/lib/components/data/columnTypes/context.js.map +1 -1
- package/lib/components/data/columnTypes/dateRangeCell.d.ts.map +1 -1
- package/lib/components/data/columnTypes/dateRangeCell.js +2 -1
- package/lib/components/data/columnTypes/dateRangeCell.js.map +1 -1
- package/lib/components/data/columnTypes/personAvatar.d.ts +24 -0
- package/lib/components/data/columnTypes/personAvatar.d.ts.map +1 -0
- package/lib/components/data/columnTypes/personAvatar.js +89 -0
- package/lib/components/data/columnTypes/personAvatar.js.map +1 -0
- package/lib/components/data/columnTypes/timeTracking.d.ts +2 -0
- package/lib/components/data/columnTypes/timeTracking.d.ts.map +1 -1
- package/lib/components/data/columnTypes/timeTracking.js +14 -1
- package/lib/components/data/columnTypes/timeTracking.js.map +1 -1
- package/lib/components/data/columnTypes/timeTrackingCell.d.ts +7 -0
- package/lib/components/data/columnTypes/timeTrackingCell.d.ts.map +1 -1
- package/lib/components/data/columnTypes/timeTrackingCell.js +72 -17
- package/lib/components/data/columnTypes/timeTrackingCell.js.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +20 -1
- 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 +369 -206
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +6 -0
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js +35 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
- package/lib/components/data/flexFilter/index.d.ts.map +1 -1
- package/lib/components/data/flexFilter/index.js +1 -1
- package/lib/components/data/flexFilter/index.js.map +1 -1
- package/lib/components/data/listModule.d.ts +1 -0
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +17 -17
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/data/readModule.d.ts.map +1 -1
- package/lib/components/data/readModule.js +7 -14
- package/lib/components/data/readModule.js.map +1 -1
- package/lib/components/data/updateModule.d.ts.map +1 -1
- package/lib/components/data/updateModule.js +25 -21
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/display/newTable/columnWidth.d.ts +8 -0
- package/lib/components/display/newTable/columnWidth.d.ts.map +1 -0
- package/lib/components/display/newTable/columnWidth.js +32 -0
- package/lib/components/display/newTable/columnWidth.js.map +1 -0
- package/lib/components/display/newTable/index.d.ts +1 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +57 -28
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/input/select/index.d.ts +2 -0
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +62 -16
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js +16 -11
- package/lib/components/input/textInput/index.js.map +1 -1
- package/lib/tail.css +12 -2
- package/package.json +1 -1
|
@@ -174,6 +174,7 @@ var relatedRecords_1 = require("./relatedRecords");
|
|
|
174
174
|
var flexFilter_1 = require("../flexFilter");
|
|
175
175
|
var viewStatePersistence_1 = require("./viewStatePersistence");
|
|
176
176
|
var permissions_1 = require("./permissions");
|
|
177
|
+
var columnWidth_1 = require("../../display/newTable/columnWidth");
|
|
177
178
|
// INFO: builds the notification message for a failed write. Callers must gate on
|
|
178
179
|
// `err.response` alone, never on a specific status — a catch that only handles 400 shows
|
|
179
180
|
// the user nothing at all for any other status, so a write silently disappears. A 5xx is
|
|
@@ -230,10 +231,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
230
231
|
// Every read of the view type below uses resolvedType. The distinction matters
|
|
231
232
|
// most in effect dependency arrays — following props.type there would leave
|
|
232
233
|
// the list never refetching while the panel is open, which fails silently.
|
|
233
|
-
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;
|
|
234
|
+
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;
|
|
234
235
|
// INFO: the panel cannot navigate its way out — handleNavigate("read") is
|
|
235
236
|
// routed straight back into it — so expand-to-full-page is local state.
|
|
236
|
-
var
|
|
237
|
+
var _112 = (0, react_1.useState)(false), drawerPageView = _112[0], setDrawerPageView = _112[1];
|
|
237
238
|
// INFO: the panel keeps rendering the record it was opened with rather than
|
|
238
239
|
// live props. Without this, navigating back to the list would re-render the
|
|
239
240
|
// still-mounted panel as a second list behind the overlay.
|
|
@@ -325,14 +326,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
325
326
|
initialFilterReferenceDate: initialFilterReferenceDate,
|
|
326
327
|
};
|
|
327
328
|
};
|
|
328
|
-
var
|
|
329
|
+
var _113 = intialiseDefaultFilterValues(), initialFilterSearch = _113.initialFilterSearch, initialFilterSearchParams = _113.initialFilterSearchParams, initialFilterSelection = _113.initialFilterSelection, initialFilterReference = _113.initialFilterReference, initialFilterReferenceDate = _113.initialFilterReferenceDate;
|
|
329
330
|
// INFO: Persist view state hook — handles storage read/write for filter/sort/column state
|
|
330
|
-
var
|
|
331
|
+
var _114 = (0, viewStatePersistence_1.usePersistedViewState)({
|
|
331
332
|
mode: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.persistViewState,
|
|
332
333
|
collectionId: props.collectionId,
|
|
333
334
|
persistKey: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey,
|
|
334
335
|
type: resolvedType,
|
|
335
|
-
}), rawPersistedState =
|
|
336
|
+
}), rawPersistedState = _114.persistedState, isPersistEnabled = _114.isEnabled, handleSaveView = _114.handleSaveView, handleRegisterViewSnapshot = _114.handleRegisterViewSnapshot;
|
|
336
337
|
// INFO: drop stored filters/sort on removed columns — they would empty the table
|
|
337
338
|
var persistedState = (0, react_1.useMemo)(function () {
|
|
338
339
|
var _a, _b, _c;
|
|
@@ -346,8 +347,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
346
347
|
(_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareFlexFilterReferences,
|
|
347
348
|
(_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareFlexFilterListObjects,
|
|
348
349
|
]);
|
|
349
|
-
var
|
|
350
|
-
var
|
|
350
|
+
var _115 = (0, react_1.useState)(false), loading = _115[0], setLoading = _115[1];
|
|
351
|
+
var _116 = (0, react_1.useState)(), notification = _116[0], setNotification = _116[1];
|
|
351
352
|
// INFO: a success toast is confirmation, not a decision — it clears itself so
|
|
352
353
|
// it never sits on the floating step bar; errors stay until dismissed
|
|
353
354
|
(0, react_1.useEffect)(function () {
|
|
@@ -357,73 +358,73 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
357
358
|
return function () { return clearTimeout(timer); };
|
|
358
359
|
}, [notification]);
|
|
359
360
|
//INFO : Used by List
|
|
360
|
-
var
|
|
361
|
-
var
|
|
362
|
-
var
|
|
363
|
-
var
|
|
364
|
-
var
|
|
365
|
-
var
|
|
366
|
-
var
|
|
361
|
+
var _117 = (0, react_1.useState)((_f = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _f !== void 0 ? _f : initialFilterSearch), filterSearch = _117[0], setFilterSearch = _117[1];
|
|
362
|
+
var _118 = (0, react_1.useState)((_g = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _g !== void 0 ? _g : initialFilterSearchParams), filterSearchParams = _118[0], setFilterSearchParams = _118[1];
|
|
363
|
+
var _119 = (0, react_1.useState)((_h = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _h !== void 0 ? _h : initialFilterSelection), filterSelection = _119[0], setFilterSelection = _119[1];
|
|
364
|
+
var _120 = (0, react_1.useState)((_j = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _j !== void 0 ? _j : initialFilterReference), filterReference = _120[0], setFilterReference = _120[1];
|
|
365
|
+
var _121 = (0, react_1.useState)({}), filterReferenceSearch = _121[0], setFilterReferenceSearch = _121[1];
|
|
366
|
+
var _122 = (0, react_1.useState)({}), filterReferenceList = _122[0], setFilterReferenceList = _122[1];
|
|
367
|
+
var _123 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
|
|
367
368
|
? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
|
|
368
|
-
: initialFilterReferenceDate), filterReferenceDate =
|
|
369
|
-
var
|
|
370
|
-
var
|
|
371
|
-
var
|
|
372
|
-
var
|
|
373
|
-
var
|
|
369
|
+
: initialFilterReferenceDate), filterReferenceDate = _123[0], setFilterReferenceDate = _123[1];
|
|
370
|
+
var _124 = (0, react_1.useState)(true), tableLoading = _124[0], setTableLoading = _124[1];
|
|
371
|
+
var _125 = (0, react_1.useState)(""), cursor = _125[0], setCursor = _125[1];
|
|
372
|
+
var _126 = (0, react_1.useState)(""), lastCursor = _126[0], setLastCursor = _126[1];
|
|
373
|
+
var _127 = (0, react_1.useState)([]), tableData = _127[0], setTableData = _127[1];
|
|
374
|
+
var _128 = (0, react_1.useState)([]), spaceTableData = _128[0], setSpaceTableData = _128[1];
|
|
374
375
|
// INFO: a save resolves after later renders, so it reads the table from here —
|
|
375
376
|
// the state it closed over can predate an earlier save on the same row
|
|
376
377
|
var tableDataRef = (0, react_1.useRef)([]);
|
|
377
378
|
var spaceTableDataRef = (0, react_1.useRef)([]);
|
|
378
379
|
tableDataRef.current = tableData;
|
|
379
380
|
spaceTableDataRef.current = spaceTableData;
|
|
380
|
-
var
|
|
381
|
-
var
|
|
382
|
-
var
|
|
383
|
-
var
|
|
384
|
-
var
|
|
385
|
-
var
|
|
386
|
-
var
|
|
381
|
+
var _129 = (0, react_1.useState)(0), size = _129[0], setSize = _129[1];
|
|
382
|
+
var _130 = (0, react_1.useState)((_m = (_k = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _k !== void 0 ? _k : (_l = props.organise) === null || _l === void 0 ? void 0 : _l.pageIndex) !== null && _m !== void 0 ? _m : 0), pageIndex = _130[0], setPageIndex = _130[1];
|
|
383
|
+
var _131 = (0, react_1.useState)([]), selectedIds = _131[0], setSelectedIds = _131[1];
|
|
384
|
+
var _132 = (0, react_1.useState)(false), selectAll = _132[0], setSelectAll = _132[1];
|
|
385
|
+
var _133 = (0, react_1.useState)(""), deletePasscode = _133[0], setDeletePasscode = _133[1];
|
|
386
|
+
var _134 = (0, react_1.useState)(""), deletePasscodeInput = _134[0], setDeletePasscodeInput = _134[1];
|
|
387
|
+
var _135 = (0, react_1.useState)(""), deleteFeedId = _135[0], setDeleteFeedId = _135[1];
|
|
387
388
|
//INFO : Used by List Organise
|
|
388
389
|
// INFO: Internal sort state that overrides props.organise?.sort when
|
|
389
390
|
// persistViewState is enabled and a persisted sort exists
|
|
390
|
-
var
|
|
391
|
-
var
|
|
392
|
-
var
|
|
393
|
-
var
|
|
391
|
+
var _136 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _o !== void 0 ? _o : undefined), persistedSort = _136[0], setPersistedSort = _136[1];
|
|
392
|
+
var _137 = (0, react_1.useState)(false), filterDraft = _137[0], setFilterDraft = _137[1];
|
|
393
|
+
var _138 = (0, react_1.useState)(false), addTabModal = _138[0], setAddTabModal = _138[1];
|
|
394
|
+
var _139 = (0, react_1.useState)(-1), editTabIndex = _139[0], setEditTabIndex = _139[1];
|
|
394
395
|
//INFO : resolve the initial tab synchronously so the mount cond is already
|
|
395
396
|
// tab-scoped — an empty initial tab caused a second wasted list fetch
|
|
396
|
-
var
|
|
397
|
+
var _140 = (0, react_1.useState)(function () {
|
|
397
398
|
var _a, _b;
|
|
398
399
|
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);
|
|
399
|
-
}), selectedTab =
|
|
400
|
-
var
|
|
400
|
+
}), selectedTab = _140[0], setSelectedTab = _140[1];
|
|
401
|
+
var _141 = (0, react_1.useState)("dayGridMonth"), calendarView = _141[0], setCalendarView = _141[1];
|
|
401
402
|
// INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
|
|
402
403
|
// (calendarView above drives the matching range query)
|
|
403
|
-
var
|
|
404
|
-
var
|
|
404
|
+
var _142 = (0, react_1.useState)("month"), newCalendarViewMode = _142[0], setNewCalendarViewMode = _142[1];
|
|
405
|
+
var _143 = (0, react_1.useState)(new Date()), calendarTabMonth = _143[0], setCalendarTabMonth = _143[1];
|
|
405
406
|
// INFO: defaultViewSwitch picks the opening view only — the tab re-inits
|
|
406
407
|
// whenever its settings change, and that must not undo the user's switch
|
|
407
408
|
var calendarViewInitRef = (0, react_1.useRef)(false);
|
|
408
|
-
var
|
|
409
|
-
var
|
|
410
|
-
var
|
|
411
|
-
var
|
|
409
|
+
var _144 = (0, react_1.useState)(true), kanbanDroppable = _144[0], setKanbanDroppable = _144[1];
|
|
410
|
+
var _145 = (0, react_1.useState)([]), kanbanOptions = _145[0], setKanbanOptions = _145[1];
|
|
411
|
+
var _146 = (0, react_1.useState)(false), batchUpdateModal = _146[0], setBatchUpdateModal = _146[1];
|
|
412
|
+
var _147 = (0, react_1.useState)({
|
|
412
413
|
columnId: "",
|
|
413
414
|
columnData: {},
|
|
414
|
-
}), batchUpdateData =
|
|
415
|
+
}), batchUpdateData = _147[0], setBatchUpdateData = _147[1];
|
|
415
416
|
// INFO: system columns (created / updated at and by, record id, number)
|
|
416
417
|
// join the structure hidden; the ones a user shows are kept per view
|
|
417
418
|
var isSystemColumnsEnabled = !!((_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareSystemColumns);
|
|
418
419
|
var appendedSystemColumnIds = isSystemColumnsEnabled
|
|
419
420
|
? 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; }); })
|
|
420
421
|
: [];
|
|
421
|
-
var
|
|
422
|
+
var _148 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _q !== void 0 ? _q : []), shownSystemColumnIds = _148[0], setShownSystemColumnIds = _148[1];
|
|
422
423
|
var handleWithSystemColumns = function (model, shownIds) {
|
|
423
424
|
if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
|
|
424
425
|
return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
|
|
425
426
|
};
|
|
426
|
-
var
|
|
427
|
+
var _149 = (0, react_1.useState)(function () {
|
|
427
428
|
var _a;
|
|
428
429
|
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 : []);
|
|
429
430
|
if (!persistedState)
|
|
@@ -450,8 +451,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
450
451
|
});
|
|
451
452
|
}
|
|
452
453
|
return model;
|
|
453
|
-
}), structure =
|
|
454
|
-
var
|
|
454
|
+
}), structure = _149[0], setStructure = _149[1];
|
|
455
|
+
var _150 = (0, react_1.useState)(((_r = props === null || props === void 0 ? void 0 : props.organise) === null || _r === void 0 ? void 0 : _r.additionalQuery) || []), additionalQuery = _150[0], setAdditionalQuery = _150[1];
|
|
455
456
|
// INFO: State for user-configurable flex filters (Monday.com-style)
|
|
456
457
|
// INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
|
|
457
458
|
var defaultFlexFilterRow = [
|
|
@@ -462,9 +463,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
462
463
|
value: undefined,
|
|
463
464
|
},
|
|
464
465
|
];
|
|
465
|
-
var
|
|
466
|
+
var _151 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
466
467
|
? persistedState.flexFilters
|
|
467
|
-
: defaultFlexFilterRow), flexFilters =
|
|
468
|
+
: defaultFlexFilterRow), flexFilters = _151[0], setFlexFilters = _151[1];
|
|
468
469
|
// INFO: always-current mirror of flexFilters, read by the imperative apply/
|
|
469
470
|
// clear methods so chained calls in one tick aren't stale.
|
|
470
471
|
var flexFiltersRef = (0, react_1.useRef)(flexFilters);
|
|
@@ -477,76 +478,81 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
477
478
|
}, [flexFilters]);
|
|
478
479
|
// INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
|
|
479
480
|
// to prevent API calls on every keystroke when typing in value inputs
|
|
480
|
-
var
|
|
481
|
+
var _152 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
481
482
|
? persistedState.flexFilters
|
|
482
|
-
: defaultFlexFilterRow), flexFiltersDebounced =
|
|
483
|
+
: defaultFlexFilterRow), flexFiltersDebounced = _152[0], setFlexFiltersDebounced = _152[1];
|
|
483
484
|
// INFO: the filter rows of the export being set up — started from the
|
|
484
485
|
// list's own when the export opens, so changing them leaves the list as it is
|
|
485
|
-
var
|
|
486
|
-
var
|
|
487
|
-
var
|
|
488
|
-
var
|
|
489
|
-
var
|
|
486
|
+
var _153 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _153[0], setExportFlexFilters = _153[1];
|
|
487
|
+
var _154 = (0, react_1.useState)({}), flexFilterReferenceOptions = _154[0], setFlexFilterReferenceOptions = _154[1];
|
|
488
|
+
var _155 = (0, react_1.useState)({}), flexFilterReferenceSearch = _155[0], setFlexFilterReferenceSearch = _155[1];
|
|
489
|
+
var _156 = (0, react_1.useState)(false), flexFilterModalOpen = _156[0], setFlexFilterModalOpen = _156[1];
|
|
490
|
+
var _157 = (0, react_1.useState)(false), viewSettingsModalOpen = _157[0], setViewSettingsModalOpen = _157[1];
|
|
490
491
|
// INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
|
|
491
492
|
// Deliberately kept out of `structure`: the props-sync effect below resets
|
|
492
493
|
// structure to props.model whenever props change, which would wipe the
|
|
493
494
|
// choice, and the persist effect derives schema-level hiddenColumnIds from
|
|
494
495
|
// structure — writing user hides there would blur the two concepts.
|
|
495
|
-
var
|
|
496
|
-
var
|
|
497
|
-
var
|
|
498
|
-
var
|
|
496
|
+
var _158 = (0, react_1.useState)((_s = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _s !== void 0 ? _s : []), userHiddenColumnIds = _158[0], setUserHiddenColumnIds = _158[1];
|
|
497
|
+
var _159 = (0, react_1.useState)(""), columnSearch = _159[0], setColumnSearch = _159[1];
|
|
498
|
+
var _160 = (0, react_1.useState)([]), savedViews = _160[0], setSavedViews = _160[1];
|
|
499
|
+
var _161 = (0, react_1.useState)(null), activeSavedViewId = _161[0], setActiveSavedViewId = _161[1];
|
|
500
|
+
// INFO: the widths of the view on screen, by column id ("180px")
|
|
501
|
+
var _162 = (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 = _162[0], setColumnWidths = _162[1];
|
|
502
|
+
// INFO: unsaved changes are kept only once the opening view is on screen,
|
|
503
|
+
// so the defaults drawn before it never overwrite a person's own
|
|
504
|
+
var _163 = (0, react_1.useState)(false), isViewDraftReady = _163[0], setIsViewDraftReady = _163[1];
|
|
499
505
|
// INFO: null while the name box is closed
|
|
500
|
-
var
|
|
501
|
-
var
|
|
502
|
-
var
|
|
506
|
+
var _164 = (0, react_1.useState)(null), savedViewName = _164[0], setSavedViewName = _164[1];
|
|
507
|
+
var _165 = (0, react_1.useState)(null), deletingSavedViewId = _165[0], setDeletingSavedViewId = _165[1];
|
|
508
|
+
var _166 = (0, react_1.useState)(null), draggingColumnId = _166[0], setDraggingColumnId = _166[1];
|
|
503
509
|
var columnRowRefs = (0, react_1.useRef)({});
|
|
504
510
|
//INFO : Used by Auth
|
|
505
|
-
var
|
|
511
|
+
var _167 = (0, react_1.useState)({
|
|
506
512
|
email: "",
|
|
507
513
|
google: "",
|
|
508
514
|
phone: "",
|
|
509
515
|
disabled: false,
|
|
510
516
|
create: false,
|
|
511
|
-
}), authMethods =
|
|
512
|
-
var
|
|
517
|
+
}), authMethods = _167[0], setAuthMethods = _167[1];
|
|
518
|
+
var _168 = (0, react_1.useState)(""), selectedAuthMethod = _168[0], setSelectedAuthMethod = _168[1];
|
|
513
519
|
// INFO: the sign-in check of a users datasheet's record is running; the
|
|
514
520
|
// panel shows a spinner rather than nothing, which read as "no login"
|
|
515
|
-
var
|
|
521
|
+
var _169 = (0, react_1.useState)(false), authLoading = _169[0], setAuthLoading = _169[1];
|
|
516
522
|
// INFO: a delete is running — the ref answers a second tap at once, before
|
|
517
523
|
// the state has rendered, and the state disables the confirm button
|
|
518
524
|
var deletingRef = (0, react_1.useRef)(false);
|
|
519
|
-
var
|
|
525
|
+
var _170 = (0, react_1.useState)(false), deleting = _170[0], setDeleting = _170[1];
|
|
520
526
|
// INFO: Used by Activity Log
|
|
521
|
-
var
|
|
522
|
-
var
|
|
527
|
+
var _171 = (0, react_1.useState)(false), activityModal = _171[0], setActivityModal = _171[1];
|
|
528
|
+
var _172 = (0, react_1.useState)(""), activityId = _172[0], setActivityId = _172[1];
|
|
523
529
|
//INFO : Used by Export
|
|
524
|
-
var
|
|
525
|
-
var
|
|
526
|
-
var
|
|
527
|
-
var
|
|
528
|
-
var
|
|
529
|
-
var
|
|
530
|
-
var
|
|
531
|
-
var
|
|
532
|
-
var
|
|
533
|
-
var
|
|
534
|
-
var
|
|
535
|
-
var
|
|
536
|
-
var
|
|
537
|
-
var
|
|
538
|
-
var
|
|
530
|
+
var _173 = (0, react_1.useState)(null), csvFile = _173[0], setCSVFile = _173[1];
|
|
531
|
+
var _174 = (0, react_1.useState)([]), csvFileData = _174[0], setCSVFileData = _174[1];
|
|
532
|
+
var _175 = (0, react_1.useState)(0), stepCSVIndex = _175[0], setStepCSVIndex = _175[1];
|
|
533
|
+
var _176 = (0, react_1.useState)({}), listCSVMapAttribute = _176[0], setListCSVMapAttribute = _176[1];
|
|
534
|
+
var _177 = (0, react_1.useState)({}), listCSVObjAttribute = _177[0], setListCSVObjAttribute = _177[1];
|
|
535
|
+
var _178 = (0, react_1.useState)([]), csvAPIAttribute = _178[0], setCSVAPIAttribute = _178[1];
|
|
536
|
+
var _179 = (0, react_1.useState)(((_t = props.devSettings.currentUser) === null || _t === void 0 ? void 0 : _t.userEmail) || ""), exportCSVEmail = _179[0], setExportCSVEmail = _179[1];
|
|
537
|
+
var _180 = (0, react_1.useState)(((_v = (_u = props.organise) === null || _u === void 0 ? void 0 : _u.exportSettings) === null || _v === void 0 ? void 0 : _v.defaultExportPDFName) || ""), exportPDFTitle = _180[0], setExportPDFTitle = _180[1];
|
|
538
|
+
var _181 = (0, react_1.useState)(false), exportPDFLoading = _181[0], setExportPDFLoading = _181[1];
|
|
539
|
+
var _182 = (0, react_1.useState)(false), exportReadPDFLoading = _182[0], setExportReadPDFLoading = _182[1];
|
|
540
|
+
var _183 = (0, react_1.useState)((_y = (_x = (_w = props.organise) === null || _w === void 0 ? void 0 : _w.exportSettings) === null || _x === void 0 ? void 0 : _x.sumColumnId) !== null && _y !== void 0 ? _y : []), exportSumAttributeIds = _183[0], setExportSumAttributeIds = _183[1];
|
|
541
|
+
var _184 = (0, react_1.useState)((_1 = (_0 = (_z = props.organise) === null || _z === void 0 ? void 0 : _z.exportSettings) === null || _0 === void 0 ? void 0 : _0.hideSubItems) !== null && _1 !== void 0 ? _1 : false), hideSubItems = _184[0], setHideSubItems = _184[1];
|
|
542
|
+
var _185 = (0, react_1.useState)([]), importTableData = _185[0], setImportTableData = _185[1];
|
|
543
|
+
var _186 = (0, react_1.useState)([]), queryList = _186[0], setQueryList = _186[1];
|
|
544
|
+
var _187 = (0, react_1.useState)(undefined), allQueryList = _187[0], setAllQueryList = _187[1];
|
|
539
545
|
// INFO: a restored state wins over the prop; its "" is a list the user
|
|
540
546
|
// ungrouped, so it opens ungrouped
|
|
541
|
-
var
|
|
547
|
+
var _188 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
|
|
542
548
|
? persistedState.groupBy || undefined
|
|
543
|
-
: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.groupBy), groupId =
|
|
549
|
+
: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.groupBy), groupId = _188[0], setGroupId = _188[1];
|
|
544
550
|
// INFO: Monday-board per-group paging. Keyed by the group key that
|
|
545
551
|
// handleBuildNewTableGroups() produces (an option, Unknown or No Value).
|
|
546
552
|
// Each group tracks its own loaded cursor + total so it can lazily load its
|
|
547
553
|
// next page as the user scrolls inside that band, independent of every other
|
|
548
554
|
// group. Only used when renderCheckGroupPaging() is true.
|
|
549
|
-
var
|
|
555
|
+
var _189 = (0, react_1.useState)({}), groupPageState = _189[0], setGroupPageState = _189[1];
|
|
550
556
|
// INFO: read fresh inside the async per-group fetch so chained scroll fires
|
|
551
557
|
// in one tick do not re-fetch an already in-flight page.
|
|
552
558
|
var groupPageStateRef = (0, react_1.useRef)({});
|
|
@@ -555,59 +561,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
555
561
|
// list was re-read (new search, filter, sort or grouping) is dropped on
|
|
556
562
|
// arrival instead of appending rows that belong to the old list
|
|
557
563
|
var groupPagingGenRef = (0, react_1.useRef)(0);
|
|
558
|
-
var
|
|
559
|
-
var
|
|
564
|
+
var _190 = (0, react_1.useState)(""), readTabSection = _190[0], setReadTabSection = _190[1];
|
|
565
|
+
var _191 = (0, react_1.useState)(false), readFloatingNav = _191[0], setReadFloatingNav = _191[1];
|
|
560
566
|
var readTabSectionRefs = (0, react_1.useRef)({});
|
|
561
567
|
//INFO : Used by Read
|
|
562
568
|
//INFO : Used by Update
|
|
563
|
-
var
|
|
564
|
-
var
|
|
565
|
-
var
|
|
566
|
-
var
|
|
567
|
-
var
|
|
568
|
-
var
|
|
569
|
-
var
|
|
569
|
+
var _192 = (0, react_1.useState)(false), modalVisible = _192[0], setModalVisible = _192[1];
|
|
570
|
+
var _193 = (0, react_1.useState)(false), deleteModal = _193[0], setDeleteModal = _193[1];
|
|
571
|
+
var _194 = (0, react_1.useState)(false), excelModal = _194[0], setExcelModal = _194[1];
|
|
572
|
+
var _195 = (0, react_1.useState)(false), exportExcel = _195[0], setExportExcel = _195[1];
|
|
573
|
+
var _196 = (0, react_1.useState)(""), exportType = _196[0], setExportType = _196[1];
|
|
574
|
+
var _197 = (0, react_1.useState)(false), exportQR = _197[0], setExportQR = _197[1];
|
|
575
|
+
var _198 = (0, react_1.useState)(function () {
|
|
570
576
|
var _a, _b;
|
|
571
577
|
var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
|
|
572
578
|
return firstTabId;
|
|
573
|
-
}), activeTab =
|
|
574
|
-
var
|
|
575
|
-
var
|
|
576
|
-
var
|
|
577
|
-
var
|
|
578
|
-
var
|
|
579
|
-
var
|
|
580
|
-
var
|
|
579
|
+
}), activeTab = _198[0], setActiveTab = _198[1];
|
|
580
|
+
var _199 = (0, react_1.useState)(false), signatureSigning = _199[0], setSignatureSigning = _199[1];
|
|
581
|
+
var _200 = (0, react_1.useState)({}), selectedData = _200[0], setSelectedData = _200[1];
|
|
582
|
+
var _201 = (0, react_1.useState)(""), selectedObjectStructureId = _201[0], setSelectedObjectStructureId = _201[1];
|
|
583
|
+
var _202 = (0, react_1.useState)(""), selectedObjectId = _202[0], setSelectedObjectId = _202[1];
|
|
584
|
+
var _203 = (0, react_1.useState)(""), selectedListAddressId = _203[0], setSelectedListAddressId = _203[1];
|
|
585
|
+
var _204 = (0, react_1.useState)(-1), selectedListAddressIndex = _204[0], setSelectedListAddressIndex = _204[1];
|
|
586
|
+
var _205 = (0, react_1.useState)({
|
|
581
587
|
lat: 0,
|
|
582
588
|
lng: 0,
|
|
583
589
|
name: "",
|
|
584
|
-
}), selectedListAddress =
|
|
585
|
-
var
|
|
586
|
-
var
|
|
587
|
-
var
|
|
588
|
-
var
|
|
589
|
-
var
|
|
590
|
-
var
|
|
591
|
-
var
|
|
592
|
-
var
|
|
593
|
-
var
|
|
594
|
-
var
|
|
590
|
+
}), selectedListAddress = _205[0], setSelectedListAddress = _205[1];
|
|
591
|
+
var _206 = (0, react_1.useState)({}), selectedObjectData = _206[0], setSelectedObjectData = _206[1];
|
|
592
|
+
var _207 = (0, react_1.useState)(null), objectCellEdit = _207[0], setObjectCellEdit = _207[1];
|
|
593
|
+
var _208 = (0, react_1.useState)(false), referenceLoading = _208[0], setReferenceLoading = _208[1];
|
|
594
|
+
var _209 = (0, react_1.useState)({}), referencesOptions = _209[0], setReferencesOptions = _209[1];
|
|
595
|
+
var _210 = (0, react_1.useState)({}), referencesDetails = _210[0], setReferencesDetails = _210[1];
|
|
596
|
+
var _211 = (0, react_1.useState)({}), listReferencesOptions = _211[0], setListReferencesOptions = _211[1];
|
|
597
|
+
var _212 = (0, react_1.useState)({}), referenceDeleteTableData = _212[0], setReferenceDeleteTableData = _212[1];
|
|
598
|
+
var _213 = (0, react_1.useState)([]), relatedSections = _213[0], setRelatedSections = _213[1];
|
|
599
|
+
var _214 = (0, react_1.useState)(0), referenceDeleteIndex = _214[0], setReferenceDeleteIndex = _214[1];
|
|
600
|
+
var _215 = (0, react_1.useState)({
|
|
595
601
|
id: "",
|
|
596
602
|
name: "",
|
|
597
603
|
type: "string",
|
|
598
|
-
}), referenceCreationModal =
|
|
599
|
-
var
|
|
600
|
-
var
|
|
604
|
+
}), referenceCreationModal = _215[0], setReferenceCreationModal = _215[1];
|
|
605
|
+
var _216 = (0, react_1.useState)({}), referenceModelSchema = _216[0], setReferenceSchema = _216[1];
|
|
606
|
+
var _217 = (0, react_1.useState)([]), kanbanChecked = _217[0], setKanbanChecked = _217[1];
|
|
601
607
|
//INFO : Offline
|
|
602
|
-
var
|
|
603
|
-
var
|
|
608
|
+
var _218 = (0, react_1.useState)(0), offlineDataLength = _218[0], setOfflineDataLength = _218[1];
|
|
609
|
+
var _219 = (0, react_1.useState)(false), offlineModal = _219[0], setOfflineModal = _219[1];
|
|
604
610
|
// INFO: live-stream state — driven by socket connection and navigator.onLine
|
|
605
|
-
var
|
|
606
|
-
var
|
|
611
|
+
var _220 = (0, react_1.useState)(false), isLive = _220[0], setIsLive = _220[1];
|
|
612
|
+
var _221 = (0, react_1.useState)(false), isLiveOffline = _221[0], setIsLiveOffline = _221[1];
|
|
607
613
|
// INFO: true when navigator is offline — used to switch ReadQueryHoc between
|
|
608
614
|
// server reads (online, full pagination) and IndexedDB reads (offline, cached data).
|
|
609
615
|
// Independent of SSE status so it works even when bareSocketName is not set.
|
|
610
|
-
var
|
|
616
|
+
var _222 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _222[0], setIsNetworkOffline = _222[1];
|
|
611
617
|
var previousType = (0, react_1.useRef)(null);
|
|
612
618
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
613
619
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
@@ -827,7 +833,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
827
833
|
var isSchemaHideMode = ((_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.onChangeHide) ? true : false;
|
|
828
834
|
// INFO: rows per page is a view setting the user can change, so it starts from
|
|
829
835
|
// the persisted value and falls back to the consumer's limit
|
|
830
|
-
var
|
|
836
|
+
var _223 = (0, react_1.useState)((_16 = (_15 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _15 !== void 0 ? _15 : props.limit) !== null && _16 !== void 0 ? _16 : 10), pageLimit = _223[0], setPageLimit = _223[1];
|
|
831
837
|
var limit = pageLimit;
|
|
832
838
|
var isSavedViewsEnabled = !!((_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.savedViews) && resolvedType === "list";
|
|
833
839
|
// INFO: an app that stores views takes over from this browser's storage, so
|
|
@@ -931,7 +937,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
931
937
|
displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
|
|
932
938
|
};
|
|
933
939
|
};
|
|
934
|
-
var
|
|
940
|
+
var _224 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _224.canUpdateRecord, canInlineUpdate = _224.canInlineUpdate, canBatchUpdate = _224.canBatchUpdate, canDeleteRecord = _224.canDeleteRecord;
|
|
935
941
|
var isEditor = ((_27 = props.edit) === null || _27 === void 0 ? void 0 : _27.allEditable) ? true : false;
|
|
936
942
|
var isOffline = (_28 = props.bareSettings) === null || _28 === void 0 ? void 0 : _28.bareOffline;
|
|
937
943
|
// INFO: when bareOfflineNetworkAware is true, the save path is also gated on
|
|
@@ -1454,7 +1460,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1454
1460
|
// INFO: scroll mode reloads from page 0; the anchor restores the position
|
|
1455
1461
|
pageIndex: renderCheckScrollMode() ? 0 : pageIndex, hiddenColumnIds: structure.filter(function (col) { return col.hide; }).map(function (col) { return col.id; }),
|
|
1456
1462
|
// INFO: raw, so switching bareViewSettings off does not wipe the user's choice
|
|
1457
|
-
userHiddenColumnIds: userHiddenColumnIds, shownSystemColumnIds: shownSystemColumnIds, columnOrder: structure.map(function (col) { return col.id; }), groupBy: groupId !== null && groupId !== void 0 ? groupId : "" }, scrollCaptureRef.current));
|
|
1463
|
+
userHiddenColumnIds: userHiddenColumnIds, shownSystemColumnIds: shownSystemColumnIds, columnOrder: structure.map(function (col) { return col.id; }), columnWidths: columnWidths, groupBy: groupId !== null && groupId !== void 0 ? groupId : "" }, scrollCaptureRef.current));
|
|
1458
1464
|
};
|
|
1459
1465
|
handleRegisterViewSnapshot(handleBuildViewSnapshot);
|
|
1460
1466
|
//=====================================================================================
|
|
@@ -1465,6 +1471,35 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1465
1471
|
if (isSavedViewsEnabled && !isAppViews)
|
|
1466
1472
|
setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
|
|
1467
1473
|
}, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
|
|
1474
|
+
// INFO: the app keeps All's settings, so every change is kept in this
|
|
1475
|
+
// browser until the person updates the view for everyone or resets it
|
|
1476
|
+
var isViewDraftsEnabled = isSavedViewsEnabled && ((_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.allView) !== undefined;
|
|
1477
|
+
var handleGetViewDraftKey = function (viewId) {
|
|
1478
|
+
var _a, _b;
|
|
1479
|
+
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);
|
|
1480
|
+
};
|
|
1481
|
+
var handleGetStoredViewState = function (view) { var _a, _b; return view ? view.state : ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) !== null && _b !== void 0 ? _b : null); };
|
|
1482
|
+
// INFO: compared in a shape both sides share — a stored order is kept to
|
|
1483
|
+
// the columns that still exist, with new ones after in model order, and
|
|
1484
|
+
// hides only count where a view can apply them (schema-hide mode)
|
|
1485
|
+
var handleIsOnViewState = function (current, stored) {
|
|
1486
|
+
var _a;
|
|
1487
|
+
var modelIds = ((_a = props.model) !== null && _a !== void 0 ? _a : []).map(function (eachColumn) { return eachColumn.id; });
|
|
1488
|
+
var handleComparable = function (state) {
|
|
1489
|
+
var _a;
|
|
1490
|
+
var kept = ((_a = state.columnOrder) !== null && _a !== void 0 ? _a : []).filter(function (eachId) {
|
|
1491
|
+
return modelIds.includes(eachId);
|
|
1492
|
+
});
|
|
1493
|
+
return __assign(__assign({}, state), { columnOrder: __spreadArray(__spreadArray([], kept, true), modelIds.filter(function (eachId) { return !kept.includes(eachId); }), true), hiddenColumnIds: isSchemaHideMode ? state.hiddenColumnIds : undefined });
|
|
1494
|
+
};
|
|
1495
|
+
return (0, viewStatePersistence_1.handleIsSameViewState)(handleComparable((0, viewStatePersistence_1.handlePickViewState)(current)), handleComparable((0, viewStatePersistence_1.handlePickViewState)(handleResolveViewState(stored))));
|
|
1496
|
+
};
|
|
1497
|
+
var handleResizeColumn = function (columnId, pixels) {
|
|
1498
|
+
return setColumnWidths(function (previous) {
|
|
1499
|
+
var _a;
|
|
1500
|
+
return (__assign(__assign({}, previous), (_a = {}, _a[columnId] = (0, columnWidth_1.handleFormatColumnWidth)(pixels), _a)));
|
|
1501
|
+
});
|
|
1502
|
+
};
|
|
1468
1503
|
// INFO: views belong to a tab, so another tab starts with none selected
|
|
1469
1504
|
(0, react_1.useEffect)(function () {
|
|
1470
1505
|
setActiveSavedViewId(null);
|
|
@@ -1515,7 +1550,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1515
1550
|
var lastSentSharedViewsRef = (0, react_1.useRef)(null);
|
|
1516
1551
|
(0, react_1.useEffect)(function () {
|
|
1517
1552
|
lastSentSharedViewsRef.current = null;
|
|
1518
|
-
}, [(
|
|
1553
|
+
}, [(_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.sharedViews]);
|
|
1519
1554
|
var handleStoreSharedViews = function (update) {
|
|
1520
1555
|
var _a, _b, _c;
|
|
1521
1556
|
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
|
|
@@ -1536,28 +1571,37 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1536
1571
|
return;
|
|
1537
1572
|
if (activeSavedViewId !== null || (isPersistEnabled && rawPersistedState)) {
|
|
1538
1573
|
openingViewSettledRef.current = true;
|
|
1574
|
+
setIsViewDraftReady(true);
|
|
1539
1575
|
return;
|
|
1540
1576
|
}
|
|
1541
1577
|
var wantedId = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSavedViewId) !== null && _b !== void 0 ? _b : (_c = props.organise) === null || _c === void 0 ? void 0 : _c.defaultSavedViewId;
|
|
1542
|
-
if (!wantedId)
|
|
1578
|
+
if (!wantedId) {
|
|
1579
|
+
// INFO: All opens with its stored settings and this person's changes
|
|
1580
|
+
if (isViewDraftsEnabled) {
|
|
1581
|
+
openingViewSettledRef.current = true;
|
|
1582
|
+
handleApplySavedView(null, true);
|
|
1583
|
+
setIsViewDraftReady(true);
|
|
1584
|
+
}
|
|
1543
1585
|
return;
|
|
1586
|
+
}
|
|
1544
1587
|
// INFO: the app's views may still be loading
|
|
1545
1588
|
if (isAppViews && ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.sharedViews) === undefined)
|
|
1546
1589
|
return;
|
|
1547
1590
|
openingViewSettledRef.current = true;
|
|
1548
1591
|
var view = handleGetTabSavedViews().find(function (eachView) { return eachView.id === wantedId; });
|
|
1549
|
-
if (view)
|
|
1550
|
-
handleApplySavedView(view, true);
|
|
1592
|
+
if (view || isViewDraftsEnabled)
|
|
1593
|
+
handleApplySavedView(view !== null && view !== void 0 ? view : null, true);
|
|
1594
|
+
setIsViewDraftReady(true);
|
|
1551
1595
|
/* eslint-disable */
|
|
1552
1596
|
}, [
|
|
1553
1597
|
isSavedViewsEnabled,
|
|
1554
|
-
(
|
|
1555
|
-
(
|
|
1556
|
-
(
|
|
1598
|
+
(_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.initialSavedViewId,
|
|
1599
|
+
(_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.defaultSavedViewId,
|
|
1600
|
+
(_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.sharedViews,
|
|
1557
1601
|
savedViews,
|
|
1558
1602
|
]);
|
|
1559
1603
|
/* eslint-enable */
|
|
1560
|
-
var defaultSavedViewIds = ((
|
|
1604
|
+
var defaultSavedViewIds = ((_77 = (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.defaultSavedViews) !== null && _77 !== void 0 ? _77 : [])
|
|
1561
1605
|
.map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
|
|
1562
1606
|
.join("|");
|
|
1563
1607
|
// INFO: keyed on the ids, not the array, so an inline literal passed on every
|
|
@@ -1571,11 +1615,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1571
1615
|
// INFO: a view is the defaults overridden by its own fields, so a field it
|
|
1572
1616
|
// leaves out is reset rather than carried over from whatever was on screen
|
|
1573
1617
|
var handleResolveViewState = function (state) {
|
|
1574
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1618
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1575
1619
|
var model = (_a = props.model) !== null && _a !== void 0 ? _a : [];
|
|
1576
|
-
return ((
|
|
1620
|
+
return ((_j = (0, viewStatePersistence_1.handlePruneStaleColumns)(__assign({ filterSearchParams: initialFilterSearchParams, filterSelection: initialFilterSelection, filterReference: initialFilterReference, filterReferenceDate: (0, viewStatePersistence_1.serializeDateFilterState)(initialFilterReferenceDate), sort: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.sort, pageLimit: (_c = props.limit) !== null && _c !== void 0 ? _c : 10, userHiddenColumnIds: [], shownSystemColumnIds: [], hiddenColumnIds: model
|
|
1577
1621
|
.filter(function (eachColumn) { return eachColumn.hide; })
|
|
1578
|
-
.map(function (eachColumn) { return eachColumn.id; }), columnOrder: model.map(function (eachColumn) { return eachColumn.id; }),
|
|
1622
|
+
.map(function (eachColumn) { return eachColumn.id; }), columnOrder: model.map(function (eachColumn) { return eachColumn.id; }),
|
|
1623
|
+
// INFO: a saved view without its own widths follows All's
|
|
1624
|
+
columnWidths: (_f = (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.allView) === null || _e === void 0 ? void 0 : _e.columnWidths) !== null && _f !== void 0 ? _f : {}, groupBy: (_h = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.groupBy) !== null && _h !== void 0 ? _h : "" }, (state !== null && state !== void 0 ? state : {})), model, (0, flexFilter_1.handleBuildFlexFilterStructure)(model, flexFilterExtras))) !== null && _j !== void 0 ? _j : {});
|
|
1579
1625
|
};
|
|
1580
1626
|
var handleApplyViewColumns = function (columns, state) {
|
|
1581
1627
|
var _a, _b;
|
|
@@ -1625,32 +1671,36 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1625
1671
|
// so its sort is not handed back (a host saving sort would write it on
|
|
1626
1672
|
// every open)
|
|
1627
1673
|
var handleApplySavedView = function (view, isOpening) {
|
|
1628
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
1629
|
-
|
|
1674
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
1675
|
+
// INFO: the stored view, or this person's unsaved changes to it
|
|
1676
|
+
var next = handleResolveViewState((_b = (isViewDraftsEnabled
|
|
1677
|
+
? (0, viewStatePersistence_1.handleReadViewDraft)(handleGetViewDraftKey((_a = view === null || view === void 0 ? void 0 : view.id) !== null && _a !== void 0 ? _a : null))
|
|
1678
|
+
: null)) !== null && _b !== void 0 ? _b : handleGetStoredViewState(view));
|
|
1630
1679
|
var isQueryChanged = !(0, viewStatePersistence_1.handleIsSameViewState)((0, viewStatePersistence_1.handlePickQueryState)(handleBuildViewSnapshot()), (0, viewStatePersistence_1.handlePickQueryState)(next));
|
|
1631
1680
|
handleClearFlexFilterTypingTimeout();
|
|
1632
1681
|
if (typingTimeout.current) {
|
|
1633
1682
|
clearTimeout(typingTimeout.current);
|
|
1634
1683
|
typingTimeout.current = null;
|
|
1635
1684
|
}
|
|
1636
|
-
setFilterSearch((
|
|
1637
|
-
setFilterSearchParams((
|
|
1638
|
-
setFilterSelection(((
|
|
1639
|
-
setFilterReference(((
|
|
1685
|
+
setFilterSearch((_c = next.filterSearchParams) !== null && _c !== void 0 ? _c : {});
|
|
1686
|
+
setFilterSearchParams((_d = next.filterSearchParams) !== null && _d !== void 0 ? _d : {});
|
|
1687
|
+
setFilterSelection(((_e = next.filterSelection) !== null && _e !== void 0 ? _e : {}));
|
|
1688
|
+
setFilterReference(((_f = next.filterReference) !== null && _f !== void 0 ? _f : {}));
|
|
1640
1689
|
setFilterReferenceDate(next.filterReferenceDate
|
|
1641
1690
|
? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
|
|
1642
1691
|
: initialFilterReferenceDate);
|
|
1643
|
-
handleCommitFlexFilters(((
|
|
1692
|
+
handleCommitFlexFilters(((_g = next.flexFilters) === null || _g === void 0 ? void 0 : _g.length) ? next.flexFilters : defaultFlexFilterRow);
|
|
1644
1693
|
setPersistedSort(next.sort);
|
|
1645
1694
|
if (!isOpening &&
|
|
1646
1695
|
next.sort &&
|
|
1647
1696
|
!(0, viewStatePersistence_1.handleIsSameViewState)(next.sort, activeSortId !== null && activeSortId !== void 0 ? activeSortId : {}))
|
|
1648
|
-
(
|
|
1697
|
+
(_j = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.onChangeSort) === null || _j === void 0 ? void 0 : _j.call(_h, next.sort);
|
|
1649
1698
|
if (next.pageLimit)
|
|
1650
1699
|
setPageLimit(next.pageLimit);
|
|
1651
|
-
handleChangeGroupBy((
|
|
1652
|
-
setUserHiddenColumnIds((
|
|
1653
|
-
setShownSystemColumnIds((
|
|
1700
|
+
handleChangeGroupBy((_k = next.groupBy) !== null && _k !== void 0 ? _k : "", !isOpening);
|
|
1701
|
+
setUserHiddenColumnIds((_l = next.userHiddenColumnIds) !== null && _l !== void 0 ? _l : []);
|
|
1702
|
+
setShownSystemColumnIds((_m = next.shownSystemColumnIds) !== null && _m !== void 0 ? _m : []);
|
|
1703
|
+
setColumnWidths((_o = next.columnWidths) !== null && _o !== void 0 ? _o : {});
|
|
1654
1704
|
if (view) {
|
|
1655
1705
|
if (!schemaStructureRef.current)
|
|
1656
1706
|
schemaStructureRef.current = structure;
|
|
@@ -1665,12 +1715,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1665
1715
|
pendingViewCondKeyRef.current = JSON.stringify(handleReadQueryHocCond());
|
|
1666
1716
|
handleClearDataByFilter();
|
|
1667
1717
|
if (pageIndex !== 0)
|
|
1668
|
-
(
|
|
1669
|
-
(
|
|
1718
|
+
(_q = (_p = props.organise) === null || _p === void 0 ? void 0 : _p.onChangePagination) === null || _q === void 0 ? void 0 : _q.call(_p, 0);
|
|
1719
|
+
(_s = (_r = props.bareSettings) === null || _r === void 0 ? void 0 : _r.bareListHandleFilter) === null || _s === void 0 ? void 0 : _s.call(_r, (_t = next.filterSearchParams) !== null && _t !== void 0 ? _t : {}, (_u = next.filterSelection) !== null && _u !== void 0 ? _u : {}, next.filterReferenceDate
|
|
1670
1720
|
? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
|
|
1671
|
-
: initialFilterReferenceDate, (
|
|
1721
|
+
: initialFilterReferenceDate, (_v = next.filterReference) !== null && _v !== void 0 ? _v : {});
|
|
1672
1722
|
}
|
|
1673
|
-
setActiveSavedViewId((
|
|
1723
|
+
setActiveSavedViewId((_w = view === null || view === void 0 ? void 0 : view.id) !== null && _w !== void 0 ? _w : null);
|
|
1674
1724
|
setDeletingSavedViewId(null);
|
|
1675
1725
|
};
|
|
1676
1726
|
// INFO: re-read storage before each write so a change made in another browser
|
|
@@ -1723,6 +1773,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1723
1773
|
};
|
|
1724
1774
|
var handleUpdateSavedView = function (id) {
|
|
1725
1775
|
var state = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
|
|
1776
|
+
if (isViewDraftsEnabled)
|
|
1777
|
+
(0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(id), null);
|
|
1726
1778
|
if (isAppViews) {
|
|
1727
1779
|
handleStoreSharedViews(function (views) {
|
|
1728
1780
|
return views.map(function (eachView) {
|
|
@@ -1819,6 +1871,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1819
1871
|
pageLimit,
|
|
1820
1872
|
]);
|
|
1821
1873
|
/* eslint-enable */
|
|
1874
|
+
// INFO: a view's settings that differ from what is stored for it are this
|
|
1875
|
+
// person's own until they update or reset it; back on the stored settings,
|
|
1876
|
+
// nothing is kept
|
|
1877
|
+
(0, react_1.useEffect)(function () {
|
|
1878
|
+
if (!isViewDraftsEnabled || !isViewDraftReady)
|
|
1879
|
+
return;
|
|
1880
|
+
var activeView = activeSavedViewId
|
|
1881
|
+
? handleGetTabSavedViews().find(function (eachView) { return eachView.id === activeSavedViewId; })
|
|
1882
|
+
: null;
|
|
1883
|
+
// INFO: the view was deleted or belongs to another tab
|
|
1884
|
+
if (activeSavedViewId && !activeView)
|
|
1885
|
+
return;
|
|
1886
|
+
var current = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
|
|
1887
|
+
var stored = handleGetStoredViewState(activeView);
|
|
1888
|
+
(0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(activeSavedViewId), handleIsOnViewState(current, stored) ? null : current);
|
|
1889
|
+
/* eslint-disable */
|
|
1890
|
+
}, [
|
|
1891
|
+
isViewDraftsEnabled,
|
|
1892
|
+
isViewDraftReady,
|
|
1893
|
+
activeSavedViewId,
|
|
1894
|
+
filterSearchParams,
|
|
1895
|
+
filterSelection,
|
|
1896
|
+
filterReference,
|
|
1897
|
+
filterReferenceDate,
|
|
1898
|
+
flexFiltersDebounced,
|
|
1899
|
+
structure,
|
|
1900
|
+
persistedSort,
|
|
1901
|
+
userHiddenColumnIds,
|
|
1902
|
+
shownSystemColumnIds,
|
|
1903
|
+
pageLimit,
|
|
1904
|
+
groupId,
|
|
1905
|
+
columnWidths,
|
|
1906
|
+
(_78 = props.organise) === null || _78 === void 0 ? void 0 : _78.allView,
|
|
1907
|
+
(_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.sharedViews,
|
|
1908
|
+
savedViews,
|
|
1909
|
+
]);
|
|
1910
|
+
/* eslint-enable */
|
|
1911
|
+
// INFO: All's settings on screen become All's for everyone
|
|
1912
|
+
var handleUpdateAllView = function () {
|
|
1913
|
+
var _a;
|
|
1914
|
+
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeAllView))
|
|
1915
|
+
return;
|
|
1916
|
+
props.organise.onChangeAllView((0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot()));
|
|
1917
|
+
(0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(null), null);
|
|
1918
|
+
};
|
|
1919
|
+
// INFO: this person's changes are dropped and the stored view shown again
|
|
1920
|
+
var handleResetView = function () {
|
|
1921
|
+
var activeView = activeSavedViewId
|
|
1922
|
+
? handleGetTabSavedViews().find(function (eachView) { return eachView.id === activeSavedViewId; })
|
|
1923
|
+
: null;
|
|
1924
|
+
(0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(activeSavedViewId), null);
|
|
1925
|
+
handleApplySavedView(activeView !== null && activeView !== void 0 ? activeView : null);
|
|
1926
|
+
};
|
|
1822
1927
|
// INFO: re-arm on leaving the list, so each return from a record restores once
|
|
1823
1928
|
(0, react_1.useEffect)(function () {
|
|
1824
1929
|
if (props.type !== "list")
|
|
@@ -1839,7 +1944,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1839
1944
|
var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
|
|
1840
1945
|
scrollRestoredRef.current = isSwitch || isOtherListReturn;
|
|
1841
1946
|
/* eslint-disable */
|
|
1842
|
-
}, [props.collectionId, (
|
|
1947
|
+
}, [props.collectionId, (_80 = props.organise) === null || _80 === void 0 ? void 0 : _80.persistKey]);
|
|
1843
1948
|
/* eslint-enable */
|
|
1844
1949
|
// INFO: wait a frame — rows land in state one tick before layout
|
|
1845
1950
|
(0, react_1.useEffect)(function () {
|
|
@@ -1874,7 +1979,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1874
1979
|
(0, react_1.useEffect)(function () {
|
|
1875
1980
|
handleOfflinePrefetch();
|
|
1876
1981
|
/* eslint-disable */
|
|
1877
|
-
}, [props.collectionId, (
|
|
1982
|
+
}, [props.collectionId, (_81 = props.bareSettings) === null || _81 === void 0 ? void 0 : _81.bareOffline]);
|
|
1878
1983
|
/* eslint-enable */
|
|
1879
1984
|
// INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
|
|
1880
1985
|
// Calls through handleRefreshRef so the interval always dispatches the latest
|
|
@@ -1894,7 +1999,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1894
1999
|
}, interval);
|
|
1895
2000
|
return function () { return clearInterval(timer); };
|
|
1896
2001
|
/* eslint-disable */
|
|
1897
|
-
}, [(
|
|
2002
|
+
}, [(_82 = props.bareSettings) === null || _82 === void 0 ? void 0 : _82.barePollingInterval, isLive, isNetworkOffline]);
|
|
1898
2003
|
/* eslint-enable */
|
|
1899
2004
|
// INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
|
|
1900
2005
|
// EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
|
|
@@ -1936,7 +2041,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1936
2041
|
};
|
|
1937
2042
|
/* eslint-disable */
|
|
1938
2043
|
}, [
|
|
1939
|
-
(
|
|
2044
|
+
(_83 = props.bareSettings) === null || _83 === void 0 ? void 0 : _83.bareSocketName,
|
|
1940
2045
|
props.collectionId,
|
|
1941
2046
|
props.devSettings.sseEndpoint,
|
|
1942
2047
|
props.devSettings.dbAPIToken,
|
|
@@ -2059,7 +2164,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2059
2164
|
previousType.current = resolvedType;
|
|
2060
2165
|
}, [resolvedType, props.id]);
|
|
2061
2166
|
(0, react_1.useEffect)(function () {
|
|
2062
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
2167
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
2063
2168
|
var handleInitTab = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
2064
2169
|
var currentTab, defaultViewSwitch, kanbanSettings, kanbanTitle_1, kanbanRefRQ_1, kanbanRefOption_1, kanbanRefLabel_1, kanbanRefQuery;
|
|
2065
2170
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -2152,25 +2257,39 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2152
2257
|
// restored column visibility/order from localStorage
|
|
2153
2258
|
var isRestoringView = isPersistEnabled && !!persistedState && !persistedViewMountedRef.current;
|
|
2154
2259
|
if (!isRestoringView) {
|
|
2155
|
-
|
|
2260
|
+
// INFO: with a view's changes kept per person, the columns on screen
|
|
2261
|
+
// keep their order and hides when the model is handed in again
|
|
2262
|
+
setStructure(function (previous) {
|
|
2263
|
+
var _a, _b;
|
|
2264
|
+
return isViewDraftsEnabled
|
|
2265
|
+
? handleApplyViewColumns(handleWithSystemColumns((_a = props.model) !== null && _a !== void 0 ? _a : []), {
|
|
2266
|
+
columnOrder: previous.map(function (eachColumn) { return eachColumn.id; }),
|
|
2267
|
+
hiddenColumnIds: previous
|
|
2268
|
+
.filter(function (eachColumn) { return eachColumn.hide; })
|
|
2269
|
+
.map(function (eachColumn) { return eachColumn.id; }),
|
|
2270
|
+
shownSystemColumnIds: shownSystemColumnIds,
|
|
2271
|
+
})
|
|
2272
|
+
: handleWithSystemColumns((_b = props.model) !== null && _b !== void 0 ? _b : []);
|
|
2273
|
+
});
|
|
2156
2274
|
schemaStructureRef.current = null;
|
|
2157
2275
|
}
|
|
2158
2276
|
persistedViewMountedRef.current = true;
|
|
2159
|
-
setAdditionalQuery((
|
|
2277
|
+
setAdditionalQuery((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) !== null && _b !== void 0 ? _b : []);
|
|
2160
2278
|
// INFO: the restored grouping is set at mount; a later change of the
|
|
2161
2279
|
// host's groupBy still applies
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2280
|
+
// INFO: with views kept per person, the view applied sets the grouping
|
|
2281
|
+
if (!isRestoringView && !isViewDraftsEnabled)
|
|
2282
|
+
setGroupId((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.groupBy) !== null && _d !== void 0 ? _d : "");
|
|
2283
|
+
setExportPDFTitle((_g = (_f = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.exportSettings) === null || _f === void 0 ? void 0 : _f.defaultExportPDFName) !== null && _g !== void 0 ? _g : "");
|
|
2165
2284
|
var currentTabProps = {
|
|
2166
2285
|
id: props.id,
|
|
2167
2286
|
collectionId: props.collectionId,
|
|
2168
2287
|
model: props.model,
|
|
2169
2288
|
localURLEndpoint: props.localURLEndpoint,
|
|
2170
|
-
extendedTabs: (
|
|
2171
|
-
viewId: (
|
|
2172
|
-
additionalQuery: (
|
|
2173
|
-
groupBy: (
|
|
2289
|
+
extendedTabs: (_h = props.organise) === null || _h === void 0 ? void 0 : _h.extendedTabs,
|
|
2290
|
+
viewId: (_j = props.organise) === null || _j === void 0 ? void 0 : _j.viewId,
|
|
2291
|
+
additionalQuery: (_k = props.organise) === null || _k === void 0 ? void 0 : _k.additionalQuery,
|
|
2292
|
+
groupBy: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.groupBy,
|
|
2174
2293
|
type: resolvedType,
|
|
2175
2294
|
};
|
|
2176
2295
|
var safeReplacer = function () {
|
|
@@ -2196,10 +2315,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2196
2315
|
props.collectionId,
|
|
2197
2316
|
props.model,
|
|
2198
2317
|
props.localURLEndpoint,
|
|
2199
|
-
(
|
|
2200
|
-
(
|
|
2201
|
-
(
|
|
2202
|
-
(
|
|
2318
|
+
(_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.extendedTabs,
|
|
2319
|
+
(_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.viewId,
|
|
2320
|
+
(_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.additionalQuery,
|
|
2321
|
+
(_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.groupBy,
|
|
2203
2322
|
resolvedType,
|
|
2204
2323
|
]);
|
|
2205
2324
|
/**
|
|
@@ -2351,7 +2470,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2351
2470
|
};
|
|
2352
2471
|
}, 100);
|
|
2353
2472
|
return function () { return clearTimeout(timeoutId); };
|
|
2354
|
-
}, [(
|
|
2473
|
+
}, [(_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.showReadFloatingNav, resolvedType, props.id, loading]);
|
|
2355
2474
|
(0, react_1.useEffect)(function () {
|
|
2356
2475
|
if (resolvedType !== "read")
|
|
2357
2476
|
return;
|
|
@@ -5464,7 +5583,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5464
5583
|
// update an inline cell edit makes, gated on the same update right
|
|
5465
5584
|
var columnTypeActions = {
|
|
5466
5585
|
canUpdate: canUpdateRecord,
|
|
5467
|
-
onButtonClick: (
|
|
5586
|
+
onButtonClick: (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.onButtonClick,
|
|
5468
5587
|
onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5469
5588
|
var _a;
|
|
5470
5589
|
return __generator(this, function (_b) {
|
|
@@ -5481,7 +5600,34 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5481
5600
|
}
|
|
5482
5601
|
});
|
|
5483
5602
|
}); },
|
|
5603
|
+
onTimeTrackingAction: ((_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.onTimeTrackingAction) && canUpdateRecord
|
|
5604
|
+
? function (rowId, columnId, action) {
|
|
5605
|
+
return handleTimeTrackingAction(rowId, columnId, action);
|
|
5606
|
+
}
|
|
5607
|
+
: undefined,
|
|
5484
5608
|
};
|
|
5609
|
+
// INFO: the host sends the action and answers with the stored value, which
|
|
5610
|
+
// replaces the row's copy so every view of the list shows it
|
|
5611
|
+
var handleTimeTrackingAction = function (rowId, columnId, action) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5612
|
+
var currentRow, stored;
|
|
5613
|
+
var _a, _b;
|
|
5614
|
+
var _c, _d;
|
|
5615
|
+
return __generator(this, function (_e) {
|
|
5616
|
+
switch (_e.label) {
|
|
5617
|
+
case 0:
|
|
5618
|
+
currentRow = tableDataRef.current.find(function (eachData) { return eachData.id === rowId || eachData._id === rowId; });
|
|
5619
|
+
return [4 /*yield*/, ((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onTimeTrackingAction) === null || _d === void 0 ? void 0 : _d.call(_c, columnId, currentRow !== null && currentRow !== void 0 ? currentRow : (_a = {}, _a[serverId] = rowId, _a), action))];
|
|
5620
|
+
case 1:
|
|
5621
|
+
stored = _e.sent();
|
|
5622
|
+
if (!currentRow) return [3 /*break*/, 3];
|
|
5623
|
+
return [4 /*yield*/, handleGetListData({ data: [__assign(__assign({}, currentRow), (_b = {}, _b[columnId] = stored, _b))] }, "update", rowId)];
|
|
5624
|
+
case 2:
|
|
5625
|
+
_e.sent();
|
|
5626
|
+
_e.label = 3;
|
|
5627
|
+
case 3: return [2 /*return*/, stored];
|
|
5628
|
+
}
|
|
5629
|
+
});
|
|
5630
|
+
}); };
|
|
5485
5631
|
var handleSubmitData = function (type, rowId, columnId, data, offlineId, isOfflineUpdate, isDraft) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5486
5632
|
var selectedId, id, createSelectedData_1, uniqueDataStructure, uniqueColumnId, res, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_3, err_20, isUniqueIdFieldCreate, isExistingDoc, newRecordData_1, changedAttributeIds, baseDraftValue, hasBaseDraftChange, offlineDataResp, clonedForOffline, tempData, selectedIndex_4, offlineData, err_21, dataToSubmit_2, changedAttributeIds, baseDraftValue, hasBaseDraftChange, operationType, currentRow, wentToServer, dataId, err_22, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_5, _a;
|
|
5487
5633
|
var _b, _c, _d, _e;
|
|
@@ -7651,12 +7797,31 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7651
7797
|
? "border-primary-500 text-primary-600"
|
|
7652
7798
|
: "".concat(dividerColor, " ").concat(labelColor)), onClick: function () { return handleChangePageLimit(eachOption); } }, eachOption)); })))));
|
|
7653
7799
|
};
|
|
7654
|
-
|
|
7800
|
+
// INFO: the new table's rows carry only the host's own row actions in the
|
|
7801
|
+
// actions column — see renderTableHeader. The display rows are what its
|
|
7802
|
+
// cells show; the plain rows are mapped too for a list without them.
|
|
7803
|
+
var handleKeepCustomRowActions = function (rows) {
|
|
7655
7804
|
var _a;
|
|
7805
|
+
return ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)
|
|
7806
|
+
? (rows !== null && rows !== void 0 ? rows : []).map(function (eachRow) {
|
|
7807
|
+
return eachRow && typeof eachRow === "object" && "update" in eachRow
|
|
7808
|
+
? __assign(__assign({}, eachRow), { update: eachRow[listModule_1.ROW_CUSTOM_ACTIONS] }) : eachRow;
|
|
7809
|
+
})
|
|
7810
|
+
: rows;
|
|
7811
|
+
};
|
|
7812
|
+
/* eslint-disable */
|
|
7813
|
+
var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_91 = props.bareSettings) === null || _91 === void 0 ? void 0 : _91.bareNewDTW]);
|
|
7814
|
+
var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_92 = props.bareSettings) === null || _92 === void 0 ? void 0 : _92.bareNewDTW]);
|
|
7815
|
+
/* eslint-enable */
|
|
7816
|
+
// INFO: isNewTable — the new table opens a record from its title, edits in
|
|
7817
|
+
// the cell and carries the comment bubble beside the title, so its rows
|
|
7818
|
+
// drop the pencil and bubble column and keep only the host's own actions
|
|
7819
|
+
var renderTableHeader = function (isNewTable) {
|
|
7820
|
+
var _a, _b;
|
|
7656
7821
|
var tableHeader = [];
|
|
7657
7822
|
var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
|
|
7658
7823
|
structure.map(function (eachAttribute) {
|
|
7659
|
-
var _a;
|
|
7824
|
+
var _a, _b;
|
|
7660
7825
|
if (eachAttribute.id === "baseDraft" ||
|
|
7661
7826
|
utils_1.NON_TABLE_COLUMN_DATA_TYPES.includes(eachAttribute.type) ||
|
|
7662
7827
|
eachAttribute.hide ||
|
|
@@ -7668,11 +7833,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7668
7833
|
eachAttribute.id === "baseUpdatedAt") {
|
|
7669
7834
|
return null;
|
|
7670
7835
|
}
|
|
7671
|
-
tableHeader.push(__assign(__assign({}, eachAttribute), { key: eachAttribute.id, title: eachAttribute.name, width: eachAttribute.tableColWidth }));
|
|
7836
|
+
tableHeader.push(__assign(__assign({}, eachAttribute), { key: eachAttribute.id, title: eachAttribute.name, width: (_b = columnWidths[eachAttribute.id]) !== null && _b !== void 0 ? _b : eachAttribute.tableColWidth }));
|
|
7672
7837
|
return null;
|
|
7673
7838
|
});
|
|
7674
|
-
if (
|
|
7675
|
-
((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.
|
|
7839
|
+
if (isNewTable) {
|
|
7840
|
+
if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListActionBtns)
|
|
7841
|
+
tableHeader.push({ key: "update", title: "Actions" });
|
|
7842
|
+
}
|
|
7843
|
+
else if (canUpdateRecord ||
|
|
7844
|
+
((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListMultipleSelectAddtionalActions))
|
|
7676
7845
|
tableHeader.push({
|
|
7677
7846
|
key: "update",
|
|
7678
7847
|
title: "Update",
|
|
@@ -9867,7 +10036,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9867
10036
|
else {
|
|
9868
10037
|
// INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
|
|
9869
10038
|
if ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareNewDTW) {
|
|
9870
|
-
return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data:
|
|
10039
|
+
return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: newTableRows, spaceData: newTableSpaceRows !== null && newTableSpaceRows !== void 0 ? newTableSpaceRows : [], referencesOptions: listReferencesOptions, groups: handleBuildNewTableGroups(),
|
|
9871
10040
|
// INFO: the bubble beside each record's title opens its comments and
|
|
9872
10041
|
// logs, for anyone who can see the row — not only those who can edit
|
|
9873
10042
|
onRowActivity: isActivityLog
|
|
@@ -9928,7 +10097,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9928
10097
|
return (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
|
|
9929
10098
|
},
|
|
9930
10099
|
}); })
|
|
9931
|
-
: []), true), multiActionFloatingOffset: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
|
|
10100
|
+
: []), true), multiActionFloatingOffset: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(true), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
|
|
9932
10101
|
var _a, _b;
|
|
9933
10102
|
handleCaptureListScroll(id);
|
|
9934
10103
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
@@ -9975,6 +10144,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9975
10144
|
// INFO: header drag and the panel handle run the same reorder, so the
|
|
9976
10145
|
// order persists identically whichever one the user grabs
|
|
9977
10146
|
onDragColumn: handleReorderColumn,
|
|
10147
|
+
onResizeColumn: handleResizeColumn,
|
|
9978
10148
|
onHideColumn: isViewSettingsEnabled
|
|
9979
10149
|
? handleToggleUserHiddenColumn
|
|
9980
10150
|
: undefined,
|
|
@@ -10121,31 +10291,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10121
10291
|
};
|
|
10122
10292
|
// INFO: `hidden` keeps the markers out of space-y spacing
|
|
10123
10293
|
var renderSavedViews = function () {
|
|
10124
|
-
var _a, _b, _c, _d, _e, _f;
|
|
10294
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
10125
10295
|
if (!isSavedViewsEnabled)
|
|
10126
10296
|
return null;
|
|
10127
10297
|
var views = handleGetTabSavedViews();
|
|
10128
10298
|
var activeView = views.find(function (eachView) { return eachView.id === activeSavedViewId; });
|
|
10129
10299
|
var currentState = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
|
|
10130
|
-
|
|
10131
|
-
//
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
return __assign(__assign({}, state), { columnOrder: __spreadArray(__spreadArray([], kept, true), modelIds.filter(function (eachId) { return !kept.includes(eachId); }), true), hiddenColumnIds: isSchemaHideMode ? state.hiddenColumnIds : undefined });
|
|
10140
|
-
};
|
|
10141
|
-
var handleIsOnState = function (state) {
|
|
10142
|
-
return (0, viewStatePersistence_1.handleIsSameViewState)(handleComparable(currentState), handleComparable((0, viewStatePersistence_1.handlePickViewState)(handleResolveViewState(state))));
|
|
10143
|
-
};
|
|
10144
|
-
var isModified = !!activeView && !handleIsOnState(activeView.state);
|
|
10145
|
-
var defaultViewId = (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.defaultSavedViewId) !== null && _c !== void 0 ? _c : null;
|
|
10146
|
-
var canStarViews = !!((_d = props.organise) === null || _d === void 0 ? void 0 : _d.onChangeDefaultSavedViewId);
|
|
10147
|
-
var canSaveViews = !isAppViews || !!((_e = props.organise) === null || _e === void 0 ? void 0 : _e.onChangeSharedViews);
|
|
10148
|
-
var darkMode = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.darkMode;
|
|
10300
|
+
var isModified = !!activeView && !handleIsOnViewState(currentState, activeView.state);
|
|
10301
|
+
// INFO: All differs from its stored settings only where the app keeps them
|
|
10302
|
+
var isAllModified = !activeView &&
|
|
10303
|
+
isViewDraftsEnabled &&
|
|
10304
|
+
!handleIsOnViewState(currentState, (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) !== null && _b !== void 0 ? _b : null);
|
|
10305
|
+
var defaultViewId = (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.defaultSavedViewId) !== null && _d !== void 0 ? _d : null;
|
|
10306
|
+
var canStarViews = !!((_e = props.organise) === null || _e === void 0 ? void 0 : _e.onChangeDefaultSavedViewId);
|
|
10307
|
+
var canSaveViews = !isAppViews || !!((_f = props.organise) === null || _f === void 0 ? void 0 : _f.onChangeSharedViews);
|
|
10308
|
+
var darkMode = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.darkMode;
|
|
10149
10309
|
var renderChipClass = function (active) {
|
|
10150
10310
|
return "inline-flex items-center gap-1 rounded-full border px-3 py-1 text-xs font-medium ".concat(active
|
|
10151
10311
|
? "border-primary-500 bg-primary-50 text-primary-700"
|
|
@@ -10185,6 +10345,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10185
10345
|
"Update \u201C",
|
|
10186
10346
|
activeView.name,
|
|
10187
10347
|
"\u201D")),
|
|
10348
|
+
isAllModified && ((_h = props.organise) === null || _h === void 0 ? void 0 : _h.onChangeAllView) && (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-update-all", className: actionClass, onClick: handleUpdateAllView }, "Update All")),
|
|
10349
|
+
((activeView && isModified && isViewDraftsEnabled) ||
|
|
10350
|
+
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")),
|
|
10188
10351
|
!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")) : (
|
|
10189
10352
|
// INFO: a form, so a mobile keyboard's Done saves the view; stopPropagation
|
|
10190
10353
|
// keeps the submit from reaching any form around the template
|
|
@@ -11603,14 +11766,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
11603
11766
|
};
|
|
11604
11767
|
return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
|
|
11605
11768
|
renderNotification("root"),
|
|
11606
|
-
((
|
|
11769
|
+
((_94 = (_93 = props.renderSettings) === null || _93 === void 0 ? void 0 : _93.renderLoadingUI) === null || _94 === void 0 ? void 0 : _94.call(_93)) && loading ? ((_95 = props.renderSettings) === null || _95 === void 0 ? void 0 : _95.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_96 = props.organise) === null || _96 === void 0 ? void 0 : _96.darkMode, darkModeBg: (_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
|
|
11607
11770
|
var _a, _b;
|
|
11608
11771
|
if (loading)
|
|
11609
11772
|
return;
|
|
11610
11773
|
handlePopUpModal(false);
|
|
11611
11774
|
setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
|
|
11612
11775
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
|
|
11613
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11776
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.darkMode, darkModeBg: (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
|
|
11614
11777
|
return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
|
|
11615
11778
|
if (dataId) {
|
|
11616
11779
|
var currentValue = selectedData[referenceCreationModal.id];
|
|
@@ -11626,19 +11789,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
11626
11789
|
}, onClose: function () {
|
|
11627
11790
|
setReferenceCreationModal({ id: "", name: "", type: "string" });
|
|
11628
11791
|
} }),
|
|
11629
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11792
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.darkMode, darkModeBg: (_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
|
|
11630
11793
|
setReferenceDeleteTableData({});
|
|
11631
11794
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
11632
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11795
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.darkMode, darkModeBg: (_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
|
|
11633
11796
|
setDeletePasscodeInput("");
|
|
11634
11797
|
setDeleteModal(!deleteModal);
|
|
11635
11798
|
setDeleteFeedId("");
|
|
11636
11799
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
11637
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11800
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.darkMode, darkModeBg: (_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
|
|
11638
11801
|
setBatchUpdateData({ columnId: "", columnData: {} });
|
|
11639
11802
|
setBatchUpdateModal(false);
|
|
11640
11803
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
11641
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11804
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_106 = props.organise) === null || _106 === void 0 ? void 0 : _106.darkMode, darkModeBg: (_107 = props.organise) === null || _107 === void 0 ? void 0 : _107.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
|
|
11642
11805
|
var _a, _b;
|
|
11643
11806
|
if (props.space)
|
|
11644
11807
|
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 }));
|
|
@@ -11653,13 +11816,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
11653
11816
|
(0, react_dom_1.createPortal)(
|
|
11654
11817
|
// INFO: z-50 lifts it over a Modal the table may sit in (z-40)
|
|
11655
11818
|
react_1.default.createElement("div", { className: "relative z-50" },
|
|
11656
|
-
react_1.default.createElement(drawer_1.Drawer, { darkMode: (
|
|
11819
|
+
react_1.default.createElement(drawer_1.Drawer, { darkMode: (_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.darkMode, darkModeBg: (_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
|
|
11657
11820
|
// INFO: the record stays set while the drawer slides out — clearing it
|
|
11658
11821
|
// would remount the hidden panel collection-wide and fetch again. The
|
|
11659
11822
|
// toolbar's collection-wide button clears it when it opens.
|
|
11660
11823
|
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"
|
|
11661
11824
|
? props.title
|
|
11662
|
-
: "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((
|
|
11825
|
+
: "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((_110 = props.id) !== null && _110 !== void 0 ? _110 : "") : activityId, activityLog: (_111 = props.edit) === null || _111 === void 0 ? void 0 : _111.activityLog, model: structure }) })), document.body),
|
|
11663
11826
|
renderScrollSentinel()));
|
|
11664
11827
|
});
|
|
11665
11828
|
//# sourceMappingURL=index.js.map
|