blixify-ui-web 1.2.155 → 1.2.158
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/dataGraph/index.d.ts.map +1 -1
- package/lib/components/data/dataGraph/index.js +47 -14
- package/lib/components/data/dataGraph/index.js.map +1 -1
- package/lib/components/data/dataTemplate/chartEmoji.d.ts +11 -0
- package/lib/components/data/dataTemplate/chartEmoji.d.ts.map +1 -0
- package/lib/components/data/dataTemplate/chartEmoji.js +53 -0
- package/lib/components/data/dataTemplate/chartEmoji.js.map +1 -0
- package/lib/components/data/dataTemplate/chartEmojiPicker.d.ts +15 -0
- package/lib/components/data/dataTemplate/chartEmojiPicker.d.ts.map +1 -0
- package/lib/components/data/dataTemplate/chartEmojiPicker.js +153 -0
- package/lib/components/data/dataTemplate/chartEmojiPicker.js.map +1 -0
- package/lib/components/data/dataTemplate/chartView.d.ts +19 -0
- package/lib/components/data/dataTemplate/chartView.d.ts.map +1 -0
- package/lib/components/data/dataTemplate/chartView.js +391 -0
- package/lib/components/data/dataTemplate/chartView.js.map +1 -0
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +7 -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 +533 -402
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/referenceScan.d.ts +42 -0
- package/lib/components/data/dataTemplate/referenceScan.d.ts.map +1 -0
- package/lib/components/data/dataTemplate/referenceScan.js +148 -0
- package/lib/components/data/dataTemplate/referenceScan.js.map +1 -0
- package/lib/components/data/dataTemplate/relatedRecords.d.ts +18 -0
- package/lib/components/data/dataTemplate/relatedRecords.d.ts.map +1 -0
- package/lib/components/data/dataTemplate/relatedRecords.js +47 -0
- package/lib/components/data/dataTemplate/relatedRecords.js.map +1 -0
- package/lib/components/data/dataTemplate/settingsModal.d.ts +2 -1
- package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.js +10 -1
- package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
- package/lib/components/data/dataTemplate/spaceModel.d.ts +7 -2
- package/lib/components/data/dataTemplate/spaceModel.d.ts.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.map +1 -1
- package/lib/components/navigation/leftNav/index.d.ts +1 -0
- package/lib/components/navigation/leftNav/index.d.ts.map +1 -1
- package/lib/components/navigation/leftNav/index.js +8 -2
- package/lib/components/navigation/leftNav/index.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +3 -1
|
@@ -69,13 +69,6 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
69
69
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
70
70
|
}
|
|
71
71
|
};
|
|
72
|
-
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
73
|
-
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
74
|
-
var m = o[Symbol.asyncIterator], i;
|
|
75
|
-
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
76
|
-
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
77
|
-
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
78
|
-
};
|
|
79
72
|
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
80
73
|
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
81
74
|
if (ar || !(i in from)) {
|
|
@@ -160,6 +153,9 @@ var newPagination_1 = require("../../display/newPagination");
|
|
|
160
153
|
var pagination_1 = require("./pagination");
|
|
161
154
|
var referenceModal_1 = require("./referenceModal");
|
|
162
155
|
var settingsModal_1 = require("./settingsModal");
|
|
156
|
+
var chartView_1 = require("./chartView");
|
|
157
|
+
var referenceScan_1 = require("./referenceScan");
|
|
158
|
+
var relatedRecords_1 = require("./relatedRecords");
|
|
163
159
|
var flexFilter_1 = require("../flexFilter");
|
|
164
160
|
var viewStatePersistence_1 = require("./viewStatePersistence");
|
|
165
161
|
var permissions_1 = require("./permissions");
|
|
@@ -216,10 +212,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
216
212
|
// Every read of the view type below uses resolvedType. The distinction matters
|
|
217
213
|
// most in effect dependency arrays — following props.type there would leave
|
|
218
214
|
// the list never refetching while the panel is open, which fails silently.
|
|
219
|
-
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;
|
|
215
|
+
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;
|
|
220
216
|
// INFO: the panel cannot navigate its way out — handleNavigate("read") is
|
|
221
217
|
// routed straight back into it — so expand-to-full-page is local state.
|
|
222
|
-
var
|
|
218
|
+
var _93 = (0, react_1.useState)(false), drawerPageView = _93[0], setDrawerPageView = _93[1];
|
|
223
219
|
// INFO: the panel keeps rendering the record it was opened with rather than
|
|
224
220
|
// live props. Without this, navigating back to the list would re-render the
|
|
225
221
|
// still-mounted panel as a second list behind the overlay.
|
|
@@ -301,18 +297,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
301
297
|
initialFilterReferenceDate: initialFilterReferenceDate,
|
|
302
298
|
};
|
|
303
299
|
};
|
|
304
|
-
var
|
|
300
|
+
var _94 = intialiseDefaultFilterValues(), initialFilterSearch = _94.initialFilterSearch, initialFilterSearchParams = _94.initialFilterSearchParams, initialFilterSelection = _94.initialFilterSelection, initialFilterReference = _94.initialFilterReference, initialFilterReferenceDate = _94.initialFilterReferenceDate;
|
|
305
301
|
// INFO: Persist view state hook — handles storage read/write for filter/sort/column state
|
|
306
|
-
var
|
|
302
|
+
var _95 = (0, viewStatePersistence_1.usePersistedViewState)({
|
|
307
303
|
mode: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.persistViewState,
|
|
308
304
|
collectionId: props.collectionId,
|
|
309
305
|
persistKey: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey,
|
|
310
306
|
type: resolvedType,
|
|
311
|
-
}), rawPersistedState =
|
|
307
|
+
}), rawPersistedState = _95.persistedState, isPersistEnabled = _95.isEnabled, handleSaveView = _95.handleSaveView, handleRegisterViewSnapshot = _95.handleRegisterViewSnapshot;
|
|
312
308
|
// INFO: drop stored filters/sort on removed columns — they would empty the table
|
|
313
309
|
var persistedState = (0, react_1.useMemo)(function () { return (0, viewStatePersistence_1.handlePruneStaleColumns)(rawPersistedState, props.model); }, [rawPersistedState, props.model]);
|
|
314
|
-
var
|
|
315
|
-
var
|
|
310
|
+
var _96 = (0, react_1.useState)(false), loading = _96[0], setLoading = _96[1];
|
|
311
|
+
var _97 = (0, react_1.useState)(), notification = _97[0], setNotification = _97[1];
|
|
316
312
|
// INFO: a success toast is confirmation, not a decision — it clears itself so
|
|
317
313
|
// it never sits on the floating step bar; errors stay until dismissed
|
|
318
314
|
(0, react_1.useEffect)(function () {
|
|
@@ -322,62 +318,62 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
322
318
|
return function () { return clearTimeout(timer); };
|
|
323
319
|
}, [notification]);
|
|
324
320
|
//INFO : Used by List
|
|
325
|
-
var
|
|
326
|
-
var
|
|
327
|
-
var
|
|
328
|
-
var
|
|
329
|
-
var
|
|
330
|
-
var
|
|
331
|
-
var
|
|
321
|
+
var _98 = (0, react_1.useState)((_d = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _d !== void 0 ? _d : initialFilterSearch), filterSearch = _98[0], setFilterSearch = _98[1];
|
|
322
|
+
var _99 = (0, react_1.useState)((_e = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _e !== void 0 ? _e : initialFilterSearchParams), filterSearchParams = _99[0], setFilterSearchParams = _99[1];
|
|
323
|
+
var _100 = (0, react_1.useState)((_f = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _f !== void 0 ? _f : initialFilterSelection), filterSelection = _100[0], setFilterSelection = _100[1];
|
|
324
|
+
var _101 = (0, react_1.useState)((_g = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _g !== void 0 ? _g : initialFilterReference), filterReference = _101[0], setFilterReference = _101[1];
|
|
325
|
+
var _102 = (0, react_1.useState)({}), filterReferenceSearch = _102[0], setFilterReferenceSearch = _102[1];
|
|
326
|
+
var _103 = (0, react_1.useState)({}), filterReferenceList = _103[0], setFilterReferenceList = _103[1];
|
|
327
|
+
var _104 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
|
|
332
328
|
? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
|
|
333
|
-
: initialFilterReferenceDate), filterReferenceDate =
|
|
334
|
-
var
|
|
335
|
-
var
|
|
336
|
-
var
|
|
337
|
-
var
|
|
338
|
-
var
|
|
329
|
+
: initialFilterReferenceDate), filterReferenceDate = _104[0], setFilterReferenceDate = _104[1];
|
|
330
|
+
var _105 = (0, react_1.useState)(true), tableLoading = _105[0], setTableLoading = _105[1];
|
|
331
|
+
var _106 = (0, react_1.useState)(""), cursor = _106[0], setCursor = _106[1];
|
|
332
|
+
var _107 = (0, react_1.useState)(""), lastCursor = _107[0], setLastCursor = _107[1];
|
|
333
|
+
var _108 = (0, react_1.useState)([]), tableData = _108[0], setTableData = _108[1];
|
|
334
|
+
var _109 = (0, react_1.useState)([]), spaceTableData = _109[0], setSpaceTableData = _109[1];
|
|
339
335
|
// INFO: a save resolves after later renders, so it reads the table from here —
|
|
340
336
|
// the state it closed over can predate an earlier save on the same row
|
|
341
337
|
var tableDataRef = (0, react_1.useRef)([]);
|
|
342
338
|
var spaceTableDataRef = (0, react_1.useRef)([]);
|
|
343
339
|
tableDataRef.current = tableData;
|
|
344
340
|
spaceTableDataRef.current = spaceTableData;
|
|
345
|
-
var
|
|
346
|
-
var
|
|
347
|
-
var
|
|
348
|
-
var
|
|
349
|
-
var
|
|
350
|
-
var
|
|
351
|
-
var
|
|
341
|
+
var _110 = (0, react_1.useState)(0), size = _110[0], setSize = _110[1];
|
|
342
|
+
var _111 = (0, react_1.useState)((_k = (_h = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _h !== void 0 ? _h : (_j = props.organise) === null || _j === void 0 ? void 0 : _j.pageIndex) !== null && _k !== void 0 ? _k : 0), pageIndex = _111[0], setPageIndex = _111[1];
|
|
343
|
+
var _112 = (0, react_1.useState)([]), selectedIds = _112[0], setSelectedIds = _112[1];
|
|
344
|
+
var _113 = (0, react_1.useState)(false), selectAll = _113[0], setSelectAll = _113[1];
|
|
345
|
+
var _114 = (0, react_1.useState)(""), deletePasscode = _114[0], setDeletePasscode = _114[1];
|
|
346
|
+
var _115 = (0, react_1.useState)(""), deletePasscodeInput = _115[0], setDeletePasscodeInput = _115[1];
|
|
347
|
+
var _116 = (0, react_1.useState)(""), deleteFeedId = _116[0], setDeleteFeedId = _116[1];
|
|
352
348
|
//INFO : Used by List Organise
|
|
353
349
|
// INFO: Internal sort state that overrides props.organise?.sort when
|
|
354
350
|
// persistViewState is enabled and a persisted sort exists
|
|
355
|
-
var
|
|
356
|
-
var
|
|
357
|
-
var
|
|
351
|
+
var _117 = (0, react_1.useState)((_l = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _l !== void 0 ? _l : undefined), persistedSort = _117[0], setPersistedSort = _117[1];
|
|
352
|
+
var _118 = (0, react_1.useState)(false), filterDraft = _118[0], setFilterDraft = _118[1];
|
|
353
|
+
var _119 = (0, react_1.useState)(false), addTabModal = _119[0], setAddTabModal = _119[1];
|
|
358
354
|
//INFO : resolve the initial tab synchronously so the mount cond is already
|
|
359
355
|
// tab-scoped — an empty initial tab caused a second wasted list fetch
|
|
360
|
-
var
|
|
356
|
+
var _120 = (0, react_1.useState)(function () {
|
|
361
357
|
var _a, _b;
|
|
362
358
|
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);
|
|
363
|
-
}), selectedTab =
|
|
364
|
-
var
|
|
359
|
+
}), selectedTab = _120[0], setSelectedTab = _120[1];
|
|
360
|
+
var _121 = (0, react_1.useState)("dayGridMonth"), calendarView = _121[0], setCalendarView = _121[1];
|
|
365
361
|
// INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
|
|
366
362
|
// (calendarView above drives the matching range query)
|
|
367
|
-
var
|
|
368
|
-
var
|
|
363
|
+
var _122 = (0, react_1.useState)("month"), newCalendarViewMode = _122[0], setNewCalendarViewMode = _122[1];
|
|
364
|
+
var _123 = (0, react_1.useState)(new Date()), calendarTabMonth = _123[0], setCalendarTabMonth = _123[1];
|
|
369
365
|
// INFO: defaultViewSwitch picks the opening view only — the tab re-inits
|
|
370
366
|
// whenever its settings change, and that must not undo the user's switch
|
|
371
367
|
var calendarViewInitRef = (0, react_1.useRef)(false);
|
|
372
|
-
var
|
|
373
|
-
var
|
|
374
|
-
var
|
|
375
|
-
var
|
|
376
|
-
var
|
|
368
|
+
var _124 = (0, react_1.useState)(true), kanbanDroppable = _124[0], setKanbanDroppable = _124[1];
|
|
369
|
+
var _125 = (0, react_1.useState)([]), kanbanOptions = _125[0], setKanbanOptions = _125[1];
|
|
370
|
+
var _126 = (0, react_1.useState)(false), queryForm = _126[0], setQueryForm = _126[1];
|
|
371
|
+
var _127 = (0, react_1.useState)(false), batchUpdateModal = _127[0], setBatchUpdateModal = _127[1];
|
|
372
|
+
var _128 = (0, react_1.useState)({
|
|
377
373
|
columnId: "",
|
|
378
374
|
columnData: {},
|
|
379
|
-
}), batchUpdateData =
|
|
380
|
-
var
|
|
375
|
+
}), batchUpdateData = _128[0], setBatchUpdateData = _128[1];
|
|
376
|
+
var _129 = (0, react_1.useState)(function () {
|
|
381
377
|
var baseModel = (props === null || props === void 0 ? void 0 : props.model) || [];
|
|
382
378
|
if (!persistedState)
|
|
383
379
|
return baseModel;
|
|
@@ -403,8 +399,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
403
399
|
});
|
|
404
400
|
}
|
|
405
401
|
return model;
|
|
406
|
-
}), structure =
|
|
407
|
-
var
|
|
402
|
+
}), structure = _129[0], setStructure = _129[1];
|
|
403
|
+
var _130 = (0, react_1.useState)(((_m = props === null || props === void 0 ? void 0 : props.organise) === null || _m === void 0 ? void 0 : _m.additionalQuery) || []), additionalQuery = _130[0], setAdditionalQuery = _130[1];
|
|
408
404
|
// INFO: State for user-configurable flex filters (Monday.com-style)
|
|
409
405
|
// INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
|
|
410
406
|
var defaultFlexFilterRow = [
|
|
@@ -415,9 +411,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
415
411
|
value: undefined,
|
|
416
412
|
},
|
|
417
413
|
];
|
|
418
|
-
var
|
|
414
|
+
var _131 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
419
415
|
? persistedState.flexFilters
|
|
420
|
-
: defaultFlexFilterRow), flexFilters =
|
|
416
|
+
: defaultFlexFilterRow), flexFilters = _131[0], setFlexFilters = _131[1];
|
|
421
417
|
// INFO: always-current mirror of flexFilters, read by the imperative apply/
|
|
422
418
|
// clear methods so chained calls in one tick aren't stale.
|
|
423
419
|
var flexFiltersRef = (0, react_1.useRef)(flexFilters);
|
|
@@ -430,109 +426,110 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
430
426
|
}, [flexFilters]);
|
|
431
427
|
// INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
|
|
432
428
|
// to prevent API calls on every keystroke when typing in value inputs
|
|
433
|
-
var
|
|
429
|
+
var _132 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
434
430
|
? persistedState.flexFilters
|
|
435
|
-
: defaultFlexFilterRow), flexFiltersDebounced =
|
|
436
|
-
var
|
|
437
|
-
var
|
|
438
|
-
var
|
|
439
|
-
var
|
|
431
|
+
: defaultFlexFilterRow), flexFiltersDebounced = _132[0], setFlexFiltersDebounced = _132[1];
|
|
432
|
+
var _133 = (0, react_1.useState)({}), flexFilterReferenceOptions = _133[0], setFlexFilterReferenceOptions = _133[1];
|
|
433
|
+
var _134 = (0, react_1.useState)({}), flexFilterReferenceSearch = _134[0], setFlexFilterReferenceSearch = _134[1];
|
|
434
|
+
var _135 = (0, react_1.useState)(false), flexFilterModalOpen = _135[0], setFlexFilterModalOpen = _135[1];
|
|
435
|
+
var _136 = (0, react_1.useState)(false), viewSettingsModalOpen = _136[0], setViewSettingsModalOpen = _136[1];
|
|
440
436
|
// INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
|
|
441
437
|
// Deliberately kept out of `structure`: the props-sync effect below resets
|
|
442
438
|
// structure to props.model whenever props change, which would wipe the
|
|
443
439
|
// choice, and the persist effect derives schema-level hiddenColumnIds from
|
|
444
440
|
// structure — writing user hides there would blur the two concepts.
|
|
445
|
-
var
|
|
446
|
-
var
|
|
447
|
-
var
|
|
448
|
-
var
|
|
441
|
+
var _137 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _o !== void 0 ? _o : []), userHiddenColumnIds = _137[0], setUserHiddenColumnIds = _137[1];
|
|
442
|
+
var _138 = (0, react_1.useState)(""), columnSearch = _138[0], setColumnSearch = _138[1];
|
|
443
|
+
var _139 = (0, react_1.useState)([]), savedViews = _139[0], setSavedViews = _139[1];
|
|
444
|
+
var _140 = (0, react_1.useState)(null), activeSavedViewId = _140[0], setActiveSavedViewId = _140[1];
|
|
449
445
|
// INFO: null while the name box is closed
|
|
450
|
-
var
|
|
451
|
-
var
|
|
452
|
-
var
|
|
446
|
+
var _141 = (0, react_1.useState)(null), savedViewName = _141[0], setSavedViewName = _141[1];
|
|
447
|
+
var _142 = (0, react_1.useState)(null), deletingSavedViewId = _142[0], setDeletingSavedViewId = _142[1];
|
|
448
|
+
var _143 = (0, react_1.useState)(null), draggingColumnId = _143[0], setDraggingColumnId = _143[1];
|
|
453
449
|
var columnRowRefs = (0, react_1.useRef)({});
|
|
454
450
|
//INFO : Used by Auth
|
|
455
|
-
var
|
|
451
|
+
var _144 = (0, react_1.useState)({
|
|
456
452
|
email: "",
|
|
457
453
|
google: "",
|
|
458
454
|
phone: "",
|
|
459
455
|
disabled: false,
|
|
460
456
|
create: false,
|
|
461
|
-
}), authMethods =
|
|
462
|
-
var
|
|
457
|
+
}), authMethods = _144[0], setAuthMethods = _144[1];
|
|
458
|
+
var _145 = (0, react_1.useState)(""), selectedAuthMethod = _145[0], setSelectedAuthMethod = _145[1];
|
|
463
459
|
// INFO: Used by Activity Log
|
|
464
|
-
var
|
|
465
|
-
var
|
|
460
|
+
var _146 = (0, react_1.useState)(false), activityModal = _146[0], setActivityModal = _146[1];
|
|
461
|
+
var _147 = (0, react_1.useState)(""), activityId = _147[0], setActivityId = _147[1];
|
|
466
462
|
//INFO : Used by Export
|
|
467
|
-
var
|
|
468
|
-
var
|
|
469
|
-
var
|
|
470
|
-
var
|
|
471
|
-
var
|
|
472
|
-
var
|
|
473
|
-
var
|
|
474
|
-
var
|
|
475
|
-
var
|
|
476
|
-
var
|
|
477
|
-
var
|
|
478
|
-
var
|
|
479
|
-
var
|
|
480
|
-
var
|
|
481
|
-
var
|
|
482
|
-
var
|
|
483
|
-
var
|
|
484
|
-
var
|
|
485
|
-
var
|
|
463
|
+
var _148 = (0, react_1.useState)(null), csvFile = _148[0], setCSVFile = _148[1];
|
|
464
|
+
var _149 = (0, react_1.useState)([]), csvFileData = _149[0], setCSVFileData = _149[1];
|
|
465
|
+
var _150 = (0, react_1.useState)(0), stepCSVIndex = _150[0], setStepCSVIndex = _150[1];
|
|
466
|
+
var _151 = (0, react_1.useState)({}), listCSVMapAttribute = _151[0], setListCSVMapAttribute = _151[1];
|
|
467
|
+
var _152 = (0, react_1.useState)({}), listCSVObjAttribute = _152[0], setListCSVObjAttribute = _152[1];
|
|
468
|
+
var _153 = (0, react_1.useState)([]), csvAPIAttribute = _153[0], setCSVAPIAttribute = _153[1];
|
|
469
|
+
var _154 = (0, react_1.useState)(((_p = props.devSettings.currentUser) === null || _p === void 0 ? void 0 : _p.userEmail) || ""), exportCSVEmail = _154[0], setExportCSVEmail = _154[1];
|
|
470
|
+
var _155 = (0, react_1.useState)(((_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.exportSettings) === null || _r === void 0 ? void 0 : _r.defaultExportPDFName) || ""), exportPDFTitle = _155[0], setExportPDFTitle = _155[1];
|
|
471
|
+
var _156 = (0, react_1.useState)(false), exportPDFLoading = _156[0], setExportPDFLoading = _156[1];
|
|
472
|
+
var _157 = (0, react_1.useState)(false), exportReadPDFLoading = _157[0], setExportReadPDFLoading = _157[1];
|
|
473
|
+
var _158 = (0, react_1.useState)((_u = (_t = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.exportSettings) === null || _t === void 0 ? void 0 : _t.sumColumnId) !== null && _u !== void 0 ? _u : []), exportSumAttributeIds = _158[0], setExportSumAttributeIds = _158[1];
|
|
474
|
+
var _159 = (0, react_1.useState)((_x = (_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.exportSettings) === null || _w === void 0 ? void 0 : _w.hideSubItems) !== null && _x !== void 0 ? _x : false), hideSubItems = _159[0], setHideSubItems = _159[1];
|
|
475
|
+
var _160 = (0, react_1.useState)([]), importTableData = _160[0], setImportTableData = _160[1];
|
|
476
|
+
var _161 = (0, react_1.useState)([]), queryList = _161[0], setQueryList = _161[1];
|
|
477
|
+
var _162 = (0, react_1.useState)(undefined), allQueryList = _162[0], setAllQueryList = _162[1];
|
|
478
|
+
var _163 = (0, react_1.useState)(-1), queryIndex = _163[0], setQueryIndex = _163[1];
|
|
479
|
+
var _164 = (0, react_1.useState)((_y = props.organise) === null || _y === void 0 ? void 0 : _y.groupBy), groupId = _164[0], setGroupId = _164[1];
|
|
480
|
+
var _165 = (0, react_1.useState)(""), readTabSection = _165[0], setReadTabSection = _165[1];
|
|
481
|
+
var _166 = (0, react_1.useState)(false), readFloatingNav = _166[0], setReadFloatingNav = _166[1];
|
|
486
482
|
var readTabSectionRefs = (0, react_1.useRef)({});
|
|
487
483
|
//INFO : Used by Read
|
|
488
484
|
//INFO : Used by Update
|
|
489
|
-
var
|
|
490
|
-
var
|
|
491
|
-
var
|
|
492
|
-
var
|
|
493
|
-
var
|
|
494
|
-
var
|
|
495
|
-
var
|
|
485
|
+
var _167 = (0, react_1.useState)(false), modalVisible = _167[0], setModalVisible = _167[1];
|
|
486
|
+
var _168 = (0, react_1.useState)(false), deleteModal = _168[0], setDeleteModal = _168[1];
|
|
487
|
+
var _169 = (0, react_1.useState)(false), excelModal = _169[0], setExcelModal = _169[1];
|
|
488
|
+
var _170 = (0, react_1.useState)(false), exportExcel = _170[0], setExportExcel = _170[1];
|
|
489
|
+
var _171 = (0, react_1.useState)(""), exportType = _171[0], setExportType = _171[1];
|
|
490
|
+
var _172 = (0, react_1.useState)(false), exportQR = _172[0], setExportQR = _172[1];
|
|
491
|
+
var _173 = (0, react_1.useState)(function () {
|
|
496
492
|
var _a, _b;
|
|
497
493
|
var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
|
|
498
494
|
return firstTabId;
|
|
499
|
-
}), activeTab =
|
|
500
|
-
var
|
|
501
|
-
var
|
|
502
|
-
var
|
|
503
|
-
var
|
|
504
|
-
var
|
|
505
|
-
var
|
|
506
|
-
var
|
|
495
|
+
}), activeTab = _173[0], setActiveTab = _173[1];
|
|
496
|
+
var _174 = (0, react_1.useState)(false), signatureSigning = _174[0], setSignatureSigning = _174[1];
|
|
497
|
+
var _175 = (0, react_1.useState)({}), selectedData = _175[0], setSelectedData = _175[1];
|
|
498
|
+
var _176 = (0, react_1.useState)(""), selectedObjectStructureId = _176[0], setSelectedObjectStructureId = _176[1];
|
|
499
|
+
var _177 = (0, react_1.useState)(""), selectedObjectId = _177[0], setSelectedObjectId = _177[1];
|
|
500
|
+
var _178 = (0, react_1.useState)(""), selectedListAddressId = _178[0], setSelectedListAddressId = _178[1];
|
|
501
|
+
var _179 = (0, react_1.useState)(-1), selectedListAddressIndex = _179[0], setSelectedListAddressIndex = _179[1];
|
|
502
|
+
var _180 = (0, react_1.useState)({
|
|
507
503
|
lat: 0,
|
|
508
504
|
lng: 0,
|
|
509
505
|
name: "",
|
|
510
|
-
}), selectedListAddress =
|
|
511
|
-
var
|
|
512
|
-
var
|
|
513
|
-
var
|
|
514
|
-
var
|
|
515
|
-
var
|
|
516
|
-
var
|
|
517
|
-
var
|
|
518
|
-
var
|
|
519
|
-
var
|
|
506
|
+
}), selectedListAddress = _180[0], setSelectedListAddress = _180[1];
|
|
507
|
+
var _181 = (0, react_1.useState)({}), selectedObjectData = _181[0], setSelectedObjectData = _181[1];
|
|
508
|
+
var _182 = (0, react_1.useState)(null), objectCellEdit = _182[0], setObjectCellEdit = _182[1];
|
|
509
|
+
var _183 = (0, react_1.useState)(false), referenceLoading = _183[0], setReferenceLoading = _183[1];
|
|
510
|
+
var _184 = (0, react_1.useState)({}), referencesOptions = _184[0], setReferencesOptions = _184[1];
|
|
511
|
+
var _185 = (0, react_1.useState)({}), referencesDetails = _185[0], setReferencesDetails = _185[1];
|
|
512
|
+
var _186 = (0, react_1.useState)({}), listReferencesOptions = _186[0], setListReferencesOptions = _186[1];
|
|
513
|
+
var _187 = (0, react_1.useState)({}), referenceDeleteTableData = _187[0], setReferenceDeleteTableData = _187[1];
|
|
514
|
+
var _188 = (0, react_1.useState)([]), relatedSections = _188[0], setRelatedSections = _188[1];
|
|
515
|
+
var _189 = (0, react_1.useState)(0), referenceDeleteIndex = _189[0], setReferenceDeleteIndex = _189[1];
|
|
516
|
+
var _190 = (0, react_1.useState)({
|
|
520
517
|
id: "",
|
|
521
518
|
name: "",
|
|
522
519
|
type: "string",
|
|
523
|
-
}), referenceCreationModal =
|
|
524
|
-
var
|
|
525
|
-
var
|
|
520
|
+
}), referenceCreationModal = _190[0], setReferenceCreationModal = _190[1];
|
|
521
|
+
var _191 = (0, react_1.useState)({}), referenceModelSchema = _191[0], setReferenceSchema = _191[1];
|
|
522
|
+
var _192 = (0, react_1.useState)([]), kanbanChecked = _192[0], setKanbanChecked = _192[1];
|
|
526
523
|
//INFO : Offline
|
|
527
|
-
var
|
|
528
|
-
var
|
|
524
|
+
var _193 = (0, react_1.useState)(0), offlineDataLength = _193[0], setOfflineDataLength = _193[1];
|
|
525
|
+
var _194 = (0, react_1.useState)(false), offlineModal = _194[0], setOfflineModal = _194[1];
|
|
529
526
|
// INFO: live-stream state — driven by socket connection and navigator.onLine
|
|
530
|
-
var
|
|
531
|
-
var
|
|
527
|
+
var _195 = (0, react_1.useState)(false), isLive = _195[0], setIsLive = _195[1];
|
|
528
|
+
var _196 = (0, react_1.useState)(false), isLiveOffline = _196[0], setIsLiveOffline = _196[1];
|
|
532
529
|
// INFO: true when navigator is offline — used to switch ReadQueryHoc between
|
|
533
530
|
// server reads (online, full pagination) and IndexedDB reads (offline, cached data).
|
|
534
531
|
// Independent of SSE status so it works even when bareSocketName is not set.
|
|
535
|
-
var
|
|
532
|
+
var _197 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _197[0], setIsNetworkOffline = _197[1];
|
|
536
533
|
var previousType = (0, react_1.useRef)(null);
|
|
537
534
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
538
535
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
@@ -653,23 +650,108 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
653
650
|
var isFirebase = isFirebaseClient || devSettings.server === "fbServer";
|
|
654
651
|
var dbModule = isFirebaseClient ? (_4 = props.lib) === null || _4 === void 0 ? void 0 : _4.firebase : (_5 = props.lib) === null || _5 === void 0 ? void 0 : _5.axios;
|
|
655
652
|
var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
|
|
653
|
+
var selectedRelated = resolvedType === "read"
|
|
654
|
+
? relatedSections.find(function (eachSection) { return eachSection.id === viewType; })
|
|
655
|
+
: undefined;
|
|
656
|
+
// INFO: each other space whose rows point at this record becomes a tab of
|
|
657
|
+
// the read view, so the counts are taken with the record — one schema query
|
|
658
|
+
// plus one single-row query per referencing column. The rows themselves load
|
|
659
|
+
// when their tab opens.
|
|
660
|
+
(0, react_1.useEffect)(function () {
|
|
661
|
+
var _a;
|
|
662
|
+
var mounted = true;
|
|
663
|
+
if (resolvedType !== "read" ||
|
|
664
|
+
!props.id ||
|
|
665
|
+
!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showRelatedTab)) {
|
|
666
|
+
setRelatedSections([]);
|
|
667
|
+
return;
|
|
668
|
+
}
|
|
669
|
+
var handleLoadRelated = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
670
|
+
var sources, referenceSources, counts, handleIsShared;
|
|
671
|
+
var _a;
|
|
672
|
+
return __generator(this, function (_b) {
|
|
673
|
+
switch (_b.label) {
|
|
674
|
+
case 0: return [4 /*yield*/, (0, referenceScan_1.handleListReferenceSources)({
|
|
675
|
+
dbModule: dbModule,
|
|
676
|
+
devSettings: props.devSettings,
|
|
677
|
+
space: props.space,
|
|
678
|
+
bareReferenceDel: (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareReferenceDel,
|
|
679
|
+
})];
|
|
680
|
+
case 1:
|
|
681
|
+
sources = _b.sent();
|
|
682
|
+
referenceSources = sources.filter(function (eachSource) {
|
|
683
|
+
return eachSource.column.type === "reference" ||
|
|
684
|
+
eachSource.column.type === "listReference";
|
|
685
|
+
});
|
|
686
|
+
return [4 /*yield*/, Promise.all(referenceSources.map(function (eachSource) {
|
|
687
|
+
var _a;
|
|
688
|
+
return (0, referenceScan_1.handleCountReferences)({
|
|
689
|
+
dbModule: dbModule,
|
|
690
|
+
devSettings: props.devSettings,
|
|
691
|
+
source: eachSource,
|
|
692
|
+
recordId: (_a = props.id) !== null && _a !== void 0 ? _a : "",
|
|
693
|
+
});
|
|
694
|
+
}))];
|
|
695
|
+
case 2:
|
|
696
|
+
counts = _b.sent();
|
|
697
|
+
handleIsShared = function (collectionId) {
|
|
698
|
+
return referenceSources.filter(function (eachSource) { return eachSource.collectionId === collectionId; }).length > 1;
|
|
699
|
+
};
|
|
700
|
+
return [2 /*return*/, referenceSources
|
|
701
|
+
.map(function (eachSource, index) { return ({
|
|
702
|
+
id: "blixify_related_".concat(eachSource.collectionId, "_").concat(eachSource.column.id),
|
|
703
|
+
label: handleIsShared(eachSource.collectionId)
|
|
704
|
+
? "".concat(eachSource.collectionName, " \u00B7 ").concat(eachSource.column.name)
|
|
705
|
+
: eachSource.collectionName,
|
|
706
|
+
source: eachSource,
|
|
707
|
+
count: counts[index],
|
|
708
|
+
}); })
|
|
709
|
+
.filter(function (eachSection) { return eachSection.count > 0; })];
|
|
710
|
+
}
|
|
711
|
+
});
|
|
712
|
+
}); };
|
|
713
|
+
handleLoadRelated()
|
|
714
|
+
.then(function (sections) {
|
|
715
|
+
if (mounted)
|
|
716
|
+
setRelatedSections(sections);
|
|
717
|
+
})
|
|
718
|
+
.catch(function () {
|
|
719
|
+
if (mounted)
|
|
720
|
+
setRelatedSections([]);
|
|
721
|
+
});
|
|
722
|
+
return function () {
|
|
723
|
+
mounted = false;
|
|
724
|
+
};
|
|
725
|
+
/* eslint-disable */
|
|
726
|
+
}, [
|
|
727
|
+
resolvedType,
|
|
728
|
+
props.id,
|
|
729
|
+
(_6 = props.space) === null || _6 === void 0 ? void 0 : _6._id,
|
|
730
|
+
props.devSettings.schemaEndpoint,
|
|
731
|
+
(_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.showRelatedTab,
|
|
732
|
+
]);
|
|
733
|
+
/* eslint-enable */
|
|
656
734
|
// INFO: the view settings panel (columns, sort, rows per page) is standard on
|
|
657
735
|
// the new DTW; bareViewSettings stays the opt-in for legacy and bare DTWs
|
|
658
|
-
var isViewSettingsEnabled = ((
|
|
736
|
+
var isViewSettingsEnabled = ((_8 = props.bareSettings) === null || _8 === void 0 ? void 0 : _8.bareViewSettings) || ((_9 = props.bareSettings) === null || _9 === void 0 ? void 0 : _9.bareNewDTW)
|
|
659
737
|
? true
|
|
660
738
|
: false;
|
|
661
739
|
// INFO: a consumer that wires onChangeHide owns the hide at schema level
|
|
662
740
|
// (shared by every user) — toggling writes to the model and calls back. Without it
|
|
663
741
|
// the hide is this user's own and lives in userHiddenColumnIds.
|
|
664
|
-
var isSchemaHideMode = ((
|
|
742
|
+
var isSchemaHideMode = ((_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.onChangeHide) ? true : false;
|
|
665
743
|
// INFO: rows per page is a view setting the user can change, so it starts from
|
|
666
744
|
// the persisted value and falls back to the consumer's limit
|
|
667
|
-
var
|
|
745
|
+
var _198 = (0, react_1.useState)((_12 = (_11 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _11 !== void 0 ? _11 : props.limit) !== null && _12 !== void 0 ? _12 : 10), pageLimit = _198[0], setPageLimit = _198[1];
|
|
668
746
|
var limit = pageLimit;
|
|
669
|
-
var isSavedViewsEnabled = !!((
|
|
747
|
+
var isSavedViewsEnabled = !!((_13 = props.organise) === null || _13 === void 0 ? void 0 : _13.savedViews) && resolvedType === "list";
|
|
748
|
+
// INFO: an app that stores views takes over from this browser's storage, so
|
|
749
|
+
// every view is the team's and nothing is kept locally
|
|
750
|
+
var isAppViews = ((_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.sharedViews) !== undefined ||
|
|
751
|
+
!!((_15 = props.organise) === null || _15 === void 0 ? void 0 : _15.onChangeSharedViews);
|
|
670
752
|
// INFO: a saved view carries its sort, so the sort is held here as with persistViewState
|
|
671
753
|
var isInternalSort = isPersistEnabled || isSavedViewsEnabled;
|
|
672
|
-
var activeSortId = (isInternalSort && persistedSort) || ((
|
|
754
|
+
var activeSortId = (isInternalSort && persistedSort) || ((_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.sort);
|
|
673
755
|
var handleSortColumn = function (value) {
|
|
674
756
|
var _a, _b, _c, _d;
|
|
675
757
|
if (isInternalSort)
|
|
@@ -685,18 +767,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
685
767
|
setCursor("");
|
|
686
768
|
setLastCursor("");
|
|
687
769
|
};
|
|
688
|
-
var
|
|
689
|
-
var isEditor = ((
|
|
690
|
-
var isOffline = (
|
|
770
|
+
var _199 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _199.canUpdateRecord, canInlineUpdate = _199.canInlineUpdate, canBatchUpdate = _199.canBatchUpdate, canDeleteRecord = _199.canDeleteRecord;
|
|
771
|
+
var isEditor = ((_17 = props.edit) === null || _17 === void 0 ? void 0 : _17.allEditable) ? true : false;
|
|
772
|
+
var isOffline = (_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareOffline;
|
|
691
773
|
// INFO: when bareOfflineNetworkAware is true, the save path is also gated on
|
|
692
774
|
// the live network state — online saves go to the server even if bareOffline
|
|
693
775
|
// is true, offline saves go to IDB as normal.
|
|
694
|
-
var isOfflineNetworkListener = isOffline && ((
|
|
695
|
-
var showId = (
|
|
776
|
+
var isOfflineNetworkListener = isOffline && ((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareOfflineNetworkListener);
|
|
777
|
+
var showId = (_20 = props.space) === null || _20 === void 0 ? void 0 : _20.showId;
|
|
696
778
|
var remainId = showId || selectedObjectStructureId ? true : false;
|
|
697
|
-
var idField = ((
|
|
698
|
-
var pipeline = (
|
|
699
|
-
if ((
|
|
779
|
+
var idField = ((_21 = props.space) === null || _21 === void 0 ? void 0 : _21.idField) || ((_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.idField);
|
|
780
|
+
var pipeline = (_23 = props === null || props === void 0 ? void 0 : props.space) === null || _23 === void 0 ? void 0 : _23.pipeline;
|
|
781
|
+
if ((_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareListPipeline) {
|
|
700
782
|
pipeline = pipeline
|
|
701
783
|
? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
|
|
702
784
|
}
|
|
@@ -709,24 +791,24 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
709
791
|
* three records came back instead of five files, and each tile received the
|
|
710
792
|
* whole array rather than one file, so every one of them read "Attachment".
|
|
711
793
|
*/
|
|
712
|
-
var fileViewColumnId = (
|
|
794
|
+
var fileViewColumnId = (_28 = (_27 = ((_26 = (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.extendedTabs) !== null && _26 !== void 0 ? _26 : []).find(function (eachTab) {
|
|
713
795
|
return eachTab.viewType === "file" &&
|
|
714
796
|
(0, utils_1.lowercaseTextToId)(eachTab.name) === viewType;
|
|
715
|
-
})) === null ||
|
|
716
|
-
var hasNavigation = ((
|
|
797
|
+
})) === null || _27 === void 0 ? void 0 : _27.fileSettings) === null || _28 === void 0 ? void 0 : _28.columnId;
|
|
798
|
+
var hasNavigation = ((_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.handleNavigate) ? true : false;
|
|
717
799
|
var formColumn = "grid-cols-12";
|
|
718
|
-
var useMobileView = (
|
|
800
|
+
var useMobileView = (_31 = (_30 = props.bareSettings) === null || _30 === void 0 ? void 0 : _30.bareUpdateMobileView) !== null && _31 !== void 0 ? _31 : false;
|
|
719
801
|
var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
|
|
720
|
-
var isActivityLog = (((
|
|
721
|
-
((
|
|
722
|
-
(((
|
|
723
|
-
((
|
|
724
|
-
var customPaginationSize = ((
|
|
802
|
+
var isActivityLog = (((_33 = (_32 = props.edit) === null || _32 === void 0 ? void 0 : _32.activityLog) === null || _33 === void 0 ? void 0 : _33.enableComments) &&
|
|
803
|
+
((_34 = props.edit) === null || _34 === void 0 ? void 0 : _34.activityLog.commentCollectionId)) ||
|
|
804
|
+
(((_36 = (_35 = props.edit) === null || _35 === void 0 ? void 0 : _35.activityLog) === null || _36 === void 0 ? void 0 : _36.enableLogs) &&
|
|
805
|
+
((_37 = props.edit) === null || _37 === void 0 ? void 0 : _37.activityLog.logsCollectionId));
|
|
806
|
+
var customPaginationSize = ((_38 = props.organise) === null || _38 === void 0 ? void 0 : _38.customPaginationCount)
|
|
725
807
|
? props.organise.customPaginationCount(size)
|
|
726
808
|
: undefined;
|
|
727
809
|
//TODO : Code - Pass ...devSettings, search dbEndpoint:
|
|
728
810
|
var writeServerQuery = new writeQuery_1.WriteQuery({
|
|
729
|
-
dbModule: (
|
|
811
|
+
dbModule: (_39 = props.lib) === null || _39 === void 0 ? void 0 : _39.axios,
|
|
730
812
|
dbType: devSettings.server,
|
|
731
813
|
dbCollection: props.collectionId,
|
|
732
814
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -734,7 +816,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
734
816
|
dbUserToken: devSettings.dbUserToken,
|
|
735
817
|
});
|
|
736
818
|
var readServerQuery = new readQuery_1.ReadQuery({
|
|
737
|
-
dbModule: (
|
|
819
|
+
dbModule: (_40 = props.lib) === null || _40 === void 0 ? void 0 : _40.axios,
|
|
738
820
|
dbType: devSettings.server,
|
|
739
821
|
dbCollection: props.collectionId,
|
|
740
822
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -742,9 +824,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
742
824
|
dbUserToken: devSettings.dbUserToken,
|
|
743
825
|
});
|
|
744
826
|
var moreButtonPopUp = [
|
|
745
|
-
((
|
|
827
|
+
((_41 = props.edit) === null || _41 === void 0 ? void 0 : _41.allEditable) &&
|
|
746
828
|
!isFirebase &&
|
|
747
|
-
!((
|
|
829
|
+
!((_43 = (_42 = props.organise) === null || _42 === void 0 ? void 0 : _42.exportSettings) === null || _43 === void 0 ? void 0 : _43.hideImportCSV)
|
|
748
830
|
? {
|
|
749
831
|
text: "Import Excel",
|
|
750
832
|
onClick: function () {
|
|
@@ -753,7 +835,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
753
835
|
},
|
|
754
836
|
}
|
|
755
837
|
: null,
|
|
756
|
-
!((
|
|
838
|
+
!((_45 = (_44 = props.organise) === null || _44 === void 0 ? void 0 : _44.exportSettings) === null || _45 === void 0 ? void 0 : _45.hideExportCSV)
|
|
757
839
|
? {
|
|
758
840
|
text: "Export CSV",
|
|
759
841
|
onClick: function () {
|
|
@@ -763,7 +845,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
763
845
|
},
|
|
764
846
|
}
|
|
765
847
|
: null,
|
|
766
|
-
!((
|
|
848
|
+
!((_47 = (_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.exportSettings) === null || _47 === void 0 ? void 0 : _47.hideExportExcel)
|
|
767
849
|
? {
|
|
768
850
|
text: "Export Excel",
|
|
769
851
|
onClick: function () {
|
|
@@ -773,7 +855,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
773
855
|
},
|
|
774
856
|
}
|
|
775
857
|
: null,
|
|
776
|
-
!((
|
|
858
|
+
!((_49 = (_48 = props.organise) === null || _48 === void 0 ? void 0 : _48.exportSettings) === null || _49 === void 0 ? void 0 : _49.hideExportPDF)
|
|
777
859
|
? {
|
|
778
860
|
text: "Export PDF",
|
|
779
861
|
onClick: function () {
|
|
@@ -783,7 +865,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
783
865
|
},
|
|
784
866
|
}
|
|
785
867
|
: null,
|
|
786
|
-
!((
|
|
868
|
+
!((_51 = (_50 = props.organise) === null || _50 === void 0 ? void 0 : _50.exportSettings) === null || _51 === void 0 ? void 0 : _51.hideExportQR)
|
|
787
869
|
? {
|
|
788
870
|
text: "Export QR",
|
|
789
871
|
onClick: function () {
|
|
@@ -793,7 +875,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
793
875
|
},
|
|
794
876
|
}
|
|
795
877
|
: null,
|
|
796
|
-
!((
|
|
878
|
+
!((_53 = (_52 = props.organise) === null || _52 === void 0 ? void 0 : _52.exportSettings) === null || _53 === void 0 ? void 0 : _53.hideExportQR)
|
|
797
879
|
? {
|
|
798
880
|
text: "Export QR(Data)",
|
|
799
881
|
onClick: function () {
|
|
@@ -803,7 +885,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
803
885
|
},
|
|
804
886
|
}
|
|
805
887
|
: null,
|
|
806
|
-
!((
|
|
888
|
+
!((_55 = (_54 = props.organise) === null || _54 === void 0 ? void 0 : _54.exportSettings) === null || _55 === void 0 ? void 0 : _55.hideExportPrint)
|
|
807
889
|
? {
|
|
808
890
|
text: "Print",
|
|
809
891
|
onClick: function () {
|
|
@@ -813,7 +895,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
813
895
|
},
|
|
814
896
|
}
|
|
815
897
|
: null,
|
|
816
|
-
!((
|
|
898
|
+
!((_57 = (_56 = props.organise) === null || _56 === void 0 ? void 0 : _56.exportSettings) === null || _57 === void 0 ? void 0 : _57.hideExportDraft)
|
|
817
899
|
? {
|
|
818
900
|
text: filterDraft ? "Show All Items" : "Filter Draft",
|
|
819
901
|
onClick: function () {
|
|
@@ -822,7 +904,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
822
904
|
}
|
|
823
905
|
: null,
|
|
824
906
|
].filter(Boolean);
|
|
825
|
-
if ((
|
|
907
|
+
if ((_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.moreSettings)
|
|
826
908
|
moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
|
|
827
909
|
//=====================================================================================
|
|
828
910
|
//SECTION: User Column Visibility Handlers
|
|
@@ -1133,11 +1215,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1133
1215
|
//=====================================================================================
|
|
1134
1216
|
//SECTION: Saved Views
|
|
1135
1217
|
//=====================================================================================
|
|
1136
|
-
var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (
|
|
1218
|
+
var savedViewsKey = (0, viewStatePersistence_1.buildSavedViewsKey)(props.collectionId, (_59 = props.organise) === null || _59 === void 0 ? void 0 : _59.persistKey, (_60 = devSettings.currentUser) === null || _60 === void 0 ? void 0 : _60.userEmail);
|
|
1137
1219
|
(0, react_1.useEffect)(function () {
|
|
1138
|
-
if (isSavedViewsEnabled)
|
|
1220
|
+
if (isSavedViewsEnabled && !isAppViews)
|
|
1139
1221
|
setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
|
|
1140
|
-
}, [isSavedViewsEnabled, savedViewsKey]);
|
|
1222
|
+
}, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
|
|
1141
1223
|
// INFO: views belong to a tab, so another tab starts with none selected
|
|
1142
1224
|
(0, react_1.useEffect)(function () {
|
|
1143
1225
|
setActiveSavedViewId(null);
|
|
@@ -1161,7 +1243,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1161
1243
|
// INFO: fallback ids are numbered over the full list, before the tab filter,
|
|
1162
1244
|
// so one default view keeps the same id on every tab it shows on
|
|
1163
1245
|
var handleGetTabSavedViews = function () {
|
|
1164
|
-
var _a, _b;
|
|
1246
|
+
var _a, _b, _c, _d;
|
|
1165
1247
|
return __spreadArray(__spreadArray([], ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.defaultSavedViews) !== null && _b !== void 0 ? _b : [])
|
|
1166
1248
|
.map(function (eachView, index) {
|
|
1167
1249
|
var _a, _b;
|
|
@@ -1173,9 +1255,64 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1173
1255
|
locked: true,
|
|
1174
1256
|
});
|
|
1175
1257
|
})
|
|
1176
|
-
.filter(function (eachView) { return eachView.tabId === viewType; }), true),
|
|
1258
|
+
.filter(function (eachView) { return eachView.tabId === viewType; }), true), (isAppViews
|
|
1259
|
+
? ((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.sharedViews) !== null && _d !== void 0 ? _d : [])
|
|
1260
|
+
.filter(function (eachView) { return eachView.tabId === viewType; })
|
|
1261
|
+
.map(function (eachView) {
|
|
1262
|
+
var _a;
|
|
1263
|
+
return (__assign(__assign({}, eachView), { locked: !((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews) }));
|
|
1264
|
+
})
|
|
1265
|
+
: savedViews.filter(function (eachView) { return eachView.tabId === viewType; })), true);
|
|
1177
1266
|
};
|
|
1178
|
-
|
|
1267
|
+
// INFO: the app owns the list, so each change hands it the whole list to
|
|
1268
|
+
// store; nothing is written to this browser. A second change before the app
|
|
1269
|
+
// passes the list back builds on the one just sent, not the stale prop.
|
|
1270
|
+
var lastSentSharedViewsRef = (0, react_1.useRef)(null);
|
|
1271
|
+
(0, react_1.useEffect)(function () {
|
|
1272
|
+
lastSentSharedViewsRef.current = null;
|
|
1273
|
+
}, [(_61 = props.organise) === null || _61 === void 0 ? void 0 : _61.sharedViews]);
|
|
1274
|
+
var handleStoreSharedViews = function (update) {
|
|
1275
|
+
var _a, _b, _c;
|
|
1276
|
+
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
|
|
1277
|
+
return;
|
|
1278
|
+
var views = update((_c = (_b = lastSentSharedViewsRef.current) !== null && _b !== void 0 ? _b : props.organise.sharedViews) !== null && _c !== void 0 ? _c : []);
|
|
1279
|
+
lastSentSharedViewsRef.current = views;
|
|
1280
|
+
props.organise.onChangeSharedViews(views);
|
|
1281
|
+
};
|
|
1282
|
+
// INFO: the list opens on initialSavedViewId, or else on the ★ default
|
|
1283
|
+
// view. It settles once — when the view it names has arrived, so a default
|
|
1284
|
+
// the app loads after mount still applies — and is never applied over a
|
|
1285
|
+
// view already picked or a state persistViewState restored. A view that no
|
|
1286
|
+
// longer exists, or is on another tab, leaves the list on All.
|
|
1287
|
+
var openingViewSettledRef = (0, react_1.useRef)(false);
|
|
1288
|
+
(0, react_1.useEffect)(function () {
|
|
1289
|
+
var _a, _b, _c, _d;
|
|
1290
|
+
if (!isSavedViewsEnabled || openingViewSettledRef.current)
|
|
1291
|
+
return;
|
|
1292
|
+
if (activeSavedViewId !== null || (isPersistEnabled && rawPersistedState)) {
|
|
1293
|
+
openingViewSettledRef.current = true;
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
1296
|
+
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;
|
|
1297
|
+
if (!wantedId)
|
|
1298
|
+
return;
|
|
1299
|
+
// INFO: the app's views may still be loading
|
|
1300
|
+
if (isAppViews && ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.sharedViews) === undefined)
|
|
1301
|
+
return;
|
|
1302
|
+
openingViewSettledRef.current = true;
|
|
1303
|
+
var view = handleGetTabSavedViews().find(function (eachView) { return eachView.id === wantedId; });
|
|
1304
|
+
if (view)
|
|
1305
|
+
handleApplySavedView(view, true);
|
|
1306
|
+
/* eslint-disable */
|
|
1307
|
+
}, [
|
|
1308
|
+
isSavedViewsEnabled,
|
|
1309
|
+
(_62 = props.organise) === null || _62 === void 0 ? void 0 : _62.initialSavedViewId,
|
|
1310
|
+
(_63 = props.organise) === null || _63 === void 0 ? void 0 : _63.defaultSavedViewId,
|
|
1311
|
+
(_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.sharedViews,
|
|
1312
|
+
savedViews,
|
|
1313
|
+
]);
|
|
1314
|
+
/* eslint-enable */
|
|
1315
|
+
var defaultSavedViewIds = ((_66 = (_65 = props.organise) === null || _65 === void 0 ? void 0 : _65.defaultSavedViews) !== null && _66 !== void 0 ? _66 : [])
|
|
1179
1316
|
.map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
|
|
1180
1317
|
.join("|");
|
|
1181
1318
|
// INFO: keyed on the ids, not the array, so an inline literal passed on every
|
|
@@ -1208,7 +1345,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1208
1345
|
return (__assign(__assign({}, eachColumn), { hide: (_b = (_a = state.hiddenColumnIds) === null || _a === void 0 ? void 0 : _a.includes(eachColumn.id)) !== null && _b !== void 0 ? _b : false }));
|
|
1209
1346
|
});
|
|
1210
1347
|
};
|
|
1211
|
-
|
|
1348
|
+
// INFO: isOpening — the list opening on a view tells the host nothing new,
|
|
1349
|
+
// so its sort is not handed back (a host saving sort would write it on
|
|
1350
|
+
// every open)
|
|
1351
|
+
var handleApplySavedView = function (view, isOpening) {
|
|
1212
1352
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
1213
1353
|
var next = handleResolveViewState((_a = view === null || view === void 0 ? void 0 : view.state) !== null && _a !== void 0 ? _a : null);
|
|
1214
1354
|
var isQueryChanged = !(0, viewStatePersistence_1.handleIsSameViewState)((0, viewStatePersistence_1.handlePickQueryState)(handleBuildViewSnapshot()), (0, viewStatePersistence_1.handlePickQueryState)(next));
|
|
@@ -1226,7 +1366,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1226
1366
|
: initialFilterReferenceDate);
|
|
1227
1367
|
handleCommitFlexFilters(((_f = next.flexFilters) === null || _f === void 0 ? void 0 : _f.length) ? next.flexFilters : defaultFlexFilterRow);
|
|
1228
1368
|
setPersistedSort(next.sort);
|
|
1229
|
-
if (
|
|
1369
|
+
if (!isOpening &&
|
|
1370
|
+
next.sort &&
|
|
1371
|
+
!(0, viewStatePersistence_1.handleIsSameViewState)(next.sort, activeSortId !== null && activeSortId !== void 0 ? activeSortId : {}))
|
|
1230
1372
|
(_h = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.onChangeSort) === null || _h === void 0 ? void 0 : _h.call(_g, next.sort);
|
|
1231
1373
|
if (next.pageLimit)
|
|
1232
1374
|
setPageLimit(next.pageLimit);
|
|
@@ -1261,13 +1403,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1261
1403
|
setSavedViews(views);
|
|
1262
1404
|
(0, viewStatePersistence_1.handleWriteSavedViews)(savedViewsKey, views);
|
|
1263
1405
|
};
|
|
1264
|
-
// INFO: a name already used on this tab is overwritten
|
|
1406
|
+
// INFO: a name already used on this tab is overwritten, in the list the
|
|
1407
|
+
// view is saved to
|
|
1265
1408
|
var handleSaveSavedView = function (name) {
|
|
1266
1409
|
var trimmed = name.trim();
|
|
1267
1410
|
if (!trimmed)
|
|
1268
1411
|
return;
|
|
1269
1412
|
var state = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
|
|
1270
1413
|
var savedId = "";
|
|
1414
|
+
if (isAppViews) {
|
|
1415
|
+
handleStoreSharedViews(function (views) {
|
|
1416
|
+
var existing = views.find(function (eachView) {
|
|
1417
|
+
return eachView.tabId === viewType && eachView.name === trimmed;
|
|
1418
|
+
});
|
|
1419
|
+
var saved = existing
|
|
1420
|
+
? __assign(__assign({}, existing), { state: state }) : { id: (0, uuid_1.v4)(), name: trimmed, tabId: viewType, state: state };
|
|
1421
|
+
savedId = saved.id;
|
|
1422
|
+
return existing
|
|
1423
|
+
? views.map(function (eachView) {
|
|
1424
|
+
return eachView.id === existing.id ? saved : eachView;
|
|
1425
|
+
})
|
|
1426
|
+
: __spreadArray(__spreadArray([], views, true), [saved], false);
|
|
1427
|
+
});
|
|
1428
|
+
setActiveSavedViewId(savedId);
|
|
1429
|
+
setSavedViewName(null);
|
|
1430
|
+
return;
|
|
1431
|
+
}
|
|
1271
1432
|
handleStoreSavedViews(function (views) {
|
|
1272
1433
|
var existing = views.find(function (eachView) { return eachView.tabId === viewType && eachView.name === trimmed; });
|
|
1273
1434
|
var saved = existing
|
|
@@ -1284,6 +1445,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1284
1445
|
};
|
|
1285
1446
|
var handleUpdateSavedView = function (id) {
|
|
1286
1447
|
var state = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
|
|
1448
|
+
if (isAppViews) {
|
|
1449
|
+
handleStoreSharedViews(function (views) {
|
|
1450
|
+
return views.map(function (eachView) {
|
|
1451
|
+
return eachView.id === id ? __assign(__assign({}, eachView), { state: state }) : eachView;
|
|
1452
|
+
});
|
|
1453
|
+
});
|
|
1454
|
+
return;
|
|
1455
|
+
}
|
|
1287
1456
|
handleStoreSavedViews(function (views) {
|
|
1288
1457
|
return views.map(function (eachView) {
|
|
1289
1458
|
return eachView.id === id ? __assign(__assign({}, eachView), { state: state }) : eachView;
|
|
@@ -1291,9 +1460,18 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1291
1460
|
});
|
|
1292
1461
|
};
|
|
1293
1462
|
var handleDeleteSavedView = function (id) {
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1463
|
+
var _a, _b, _c;
|
|
1464
|
+
// INFO: a deleted default leaves the list opening on All
|
|
1465
|
+
if (id === ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.defaultSavedViewId))
|
|
1466
|
+
(_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.onChangeDefaultSavedViewId) === null || _c === void 0 ? void 0 : _c.call(_b, null);
|
|
1467
|
+
if (isAppViews)
|
|
1468
|
+
handleStoreSharedViews(function (views) {
|
|
1469
|
+
return views.filter(function (eachView) { return eachView.id !== id; });
|
|
1470
|
+
});
|
|
1471
|
+
else
|
|
1472
|
+
handleStoreSavedViews(function (views) {
|
|
1473
|
+
return views.filter(function (eachView) { return eachView.id !== id; });
|
|
1474
|
+
});
|
|
1297
1475
|
if (activeSavedViewId === id)
|
|
1298
1476
|
setActiveSavedViewId(null);
|
|
1299
1477
|
setDeletingSavedViewId(null);
|
|
@@ -1382,7 +1560,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1382
1560
|
var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
|
|
1383
1561
|
scrollRestoredRef.current = isSwitch || isOtherListReturn;
|
|
1384
1562
|
/* eslint-disable */
|
|
1385
|
-
}, [props.collectionId, (
|
|
1563
|
+
}, [props.collectionId, (_67 = props.organise) === null || _67 === void 0 ? void 0 : _67.persistKey]);
|
|
1386
1564
|
/* eslint-enable */
|
|
1387
1565
|
// INFO: wait a frame — rows land in state one tick before layout
|
|
1388
1566
|
(0, react_1.useEffect)(function () {
|
|
@@ -1417,7 +1595,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1417
1595
|
(0, react_1.useEffect)(function () {
|
|
1418
1596
|
handleOfflinePrefetch();
|
|
1419
1597
|
/* eslint-disable */
|
|
1420
|
-
}, [props.collectionId, (
|
|
1598
|
+
}, [props.collectionId, (_68 = props.bareSettings) === null || _68 === void 0 ? void 0 : _68.bareOffline]);
|
|
1421
1599
|
/* eslint-enable */
|
|
1422
1600
|
// INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
|
|
1423
1601
|
// Calls through handleRefreshRef so the interval always dispatches the latest
|
|
@@ -1437,7 +1615,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1437
1615
|
}, interval);
|
|
1438
1616
|
return function () { return clearInterval(timer); };
|
|
1439
1617
|
/* eslint-disable */
|
|
1440
|
-
}, [(
|
|
1618
|
+
}, [(_69 = props.bareSettings) === null || _69 === void 0 ? void 0 : _69.barePollingInterval, isLive, isNetworkOffline]);
|
|
1441
1619
|
/* eslint-enable */
|
|
1442
1620
|
// INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
|
|
1443
1621
|
// EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
|
|
@@ -1479,7 +1657,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1479
1657
|
};
|
|
1480
1658
|
/* eslint-disable */
|
|
1481
1659
|
}, [
|
|
1482
|
-
(
|
|
1660
|
+
(_70 = props.bareSettings) === null || _70 === void 0 ? void 0 : _70.bareSocketName,
|
|
1483
1661
|
props.collectionId,
|
|
1484
1662
|
props.devSettings.sseEndpoint,
|
|
1485
1663
|
props.devSettings.dbAPIToken,
|
|
@@ -1731,10 +1909,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1731
1909
|
props.collectionId,
|
|
1732
1910
|
props.model,
|
|
1733
1911
|
props.localURLEndpoint,
|
|
1734
|
-
(
|
|
1735
|
-
(
|
|
1736
|
-
(
|
|
1737
|
-
(
|
|
1912
|
+
(_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.extendedTabs,
|
|
1913
|
+
(_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.viewId,
|
|
1914
|
+
(_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.additionalQuery,
|
|
1915
|
+
(_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.groupBy,
|
|
1738
1916
|
resolvedType,
|
|
1739
1917
|
]);
|
|
1740
1918
|
/**
|
|
@@ -1875,7 +2053,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1875
2053
|
};
|
|
1876
2054
|
}, 100);
|
|
1877
2055
|
return function () { return clearTimeout(timeoutId); };
|
|
1878
|
-
}, [(
|
|
2056
|
+
}, [(_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.showReadFloatingNav, resolvedType, props.id, loading]);
|
|
1879
2057
|
(0, react_1.useEffect)(function () {
|
|
1880
2058
|
if (resolvedType !== "read")
|
|
1881
2059
|
return;
|
|
@@ -4180,16 +4358,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4180
4358
|
});
|
|
4181
4359
|
}); };
|
|
4182
4360
|
var handleCheckDeleteReference = function (selectedData, multipleDelete) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4183
|
-
var existDataIds, existsData, handleFindReference_1,
|
|
4184
|
-
var _a, _b;
|
|
4185
|
-
return __generator(this, function (
|
|
4186
|
-
switch (
|
|
4361
|
+
var existDataIds, existsData, handleFindReference_1, referenceSources_1, err_14;
|
|
4362
|
+
var _a, _b, _c;
|
|
4363
|
+
return __generator(this, function (_d) {
|
|
4364
|
+
switch (_d.label) {
|
|
4187
4365
|
case 0:
|
|
4188
4366
|
existDataIds = [];
|
|
4189
4367
|
existsData = {};
|
|
4190
|
-
|
|
4368
|
+
_d.label = 1;
|
|
4191
4369
|
case 1:
|
|
4192
|
-
|
|
4370
|
+
_d.trys.push([1, 4, , 5]);
|
|
4193
4371
|
handleFindReference_1 = function (data, referenceStructure, space, spaceId, spaceName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4194
4372
|
var referenceRQ, currentReferenceSelectedList;
|
|
4195
4373
|
var _a, _b, _c, _d, _e, _f;
|
|
@@ -4207,13 +4385,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4207
4385
|
return [4 /*yield*/, referenceRQ.call({
|
|
4208
4386
|
type: "list",
|
|
4209
4387
|
query: [
|
|
4210
|
-
|
|
4211
|
-
type: (referenceStructure === null || referenceStructure === void 0 ? void 0 : referenceStructure.type) === "listReference" ? "in" : "=",
|
|
4212
|
-
value: (referenceStructure === null || referenceStructure === void 0 ? void 0 : referenceStructure.type) === "listReference"
|
|
4213
|
-
? [data[serverId]]
|
|
4214
|
-
: data[serverId],
|
|
4215
|
-
queryId: referenceStructure === null || referenceStructure === void 0 ? void 0 : referenceStructure.id,
|
|
4216
|
-
},
|
|
4388
|
+
(0, referenceScan_1.handleBuildReferenceQuery)(referenceStructure, data[serverId]),
|
|
4217
4389
|
],
|
|
4218
4390
|
})];
|
|
4219
4391
|
case 1:
|
|
@@ -4235,159 +4407,44 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4235
4407
|
}
|
|
4236
4408
|
});
|
|
4237
4409
|
}); };
|
|
4238
|
-
if (
|
|
4239
|
-
|
|
4240
|
-
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
4244
|
-
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
|
|
4248
|
-
|
|
4249
|
-
|
|
4250
|
-
|
|
4251
|
-
|
|
4252
|
-
|
|
4410
|
+
if (!schemaPresent && !((_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareReferenceDel) === null || _b === void 0 ? void 0 : _b.length)) {
|
|
4411
|
+
if (multipleDelete) {
|
|
4412
|
+
return [2 /*return*/, selectedData
|
|
4413
|
+
.filter(function (eachData) {
|
|
4414
|
+
return !existDataIds.includes(eachData[serverId]);
|
|
4415
|
+
})
|
|
4416
|
+
.map(function (eachData) { return eachData[serverId]; })];
|
|
4417
|
+
}
|
|
4418
|
+
else
|
|
4419
|
+
return [2 /*return*/, selectedData];
|
|
4420
|
+
}
|
|
4421
|
+
return [4 /*yield*/, (0, referenceScan_1.handleListReferenceSources)({
|
|
4422
|
+
dbModule: dbModule,
|
|
4423
|
+
devSettings: props.devSettings,
|
|
4424
|
+
space: props.space,
|
|
4425
|
+
bareReferenceDel: (_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareReferenceDel,
|
|
4426
|
+
})];
|
|
4427
|
+
case 2:
|
|
4428
|
+
referenceSources_1 = _d.sent();
|
|
4253
4429
|
return [4 /*yield*/, Promise.all(selectedData.map(function (eachData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4254
4430
|
return __generator(this, function (_a) {
|
|
4255
4431
|
switch (_a.label) {
|
|
4256
|
-
case 0: return [4 /*yield*/, Promise.all(
|
|
4257
|
-
|
|
4258
|
-
|
|
4259
|
-
switch (_a.label) {
|
|
4260
|
-
case 0:
|
|
4261
|
-
selectedRefStructure = refStructureList_1[index];
|
|
4262
|
-
if (!(selectedRefStructure &&
|
|
4263
|
-
selectedRefStructure.length > 0)) return [3 /*break*/, 2];
|
|
4264
|
-
selectedColumn = selectedRefStructure.find(function (eachField) { return eachField.id === columnIdList_1[index]; });
|
|
4265
|
-
if (!selectedColumn) return [3 /*break*/, 2];
|
|
4266
|
-
return [4 /*yield*/, handleFindReference_1(eachData, selectedColumn, undefined, eachCollectionId, collectionNameList_1[index])];
|
|
4267
|
-
case 1:
|
|
4268
|
-
_a.sent();
|
|
4269
|
-
_a.label = 2;
|
|
4270
|
-
case 2: return [2 /*return*/];
|
|
4271
|
-
}
|
|
4272
|
-
});
|
|
4273
|
-
}); }))];
|
|
4432
|
+
case 0: return [4 /*yield*/, Promise.all(referenceSources_1.map(function (eachSource) {
|
|
4433
|
+
return handleFindReference_1(eachData, eachSource.column, undefined, eachSource.collectionId, eachSource.collectionName);
|
|
4434
|
+
}))];
|
|
4274
4435
|
case 1:
|
|
4275
4436
|
_a.sent();
|
|
4276
4437
|
return [2 /*return*/];
|
|
4277
4438
|
}
|
|
4278
4439
|
});
|
|
4279
4440
|
}); }))];
|
|
4280
|
-
case
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
case 3: return [3 /*break*/, 5];
|
|
4441
|
+
case 3:
|
|
4442
|
+
_d.sent();
|
|
4443
|
+
return [3 /*break*/, 5];
|
|
4284
4444
|
case 4:
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
return !existDataIds.includes(eachData[serverId]);
|
|
4289
|
-
})
|
|
4290
|
-
.map(function (eachData) { return eachData[serverId]; })];
|
|
4291
|
-
}
|
|
4292
|
-
else
|
|
4293
|
-
return [2 /*return*/, selectedData];
|
|
4294
|
-
_c.label = 5;
|
|
4295
|
-
case 5: return [3 /*break*/, 9];
|
|
4296
|
-
case 6:
|
|
4297
|
-
schemaQuery = new readQuery_1.ReadQuery({
|
|
4298
|
-
dbModule: dbModule,
|
|
4299
|
-
dbType: props.devSettings.server,
|
|
4300
|
-
dbCollection: "spaces",
|
|
4301
|
-
dbEndpoint: props.devSettings.schemaEndpoint,
|
|
4302
|
-
dbAPIToken: props.devSettings.schemaEndpointToken,
|
|
4303
|
-
});
|
|
4304
|
-
return [4 /*yield*/, schemaQuery.call({
|
|
4305
|
-
query: [
|
|
4306
|
-
{
|
|
4307
|
-
type: "=",
|
|
4308
|
-
queryId: "workspaceId",
|
|
4309
|
-
value: (_b = props.space) === null || _b === void 0 ? void 0 : _b.workspaceId,
|
|
4310
|
-
},
|
|
4311
|
-
{
|
|
4312
|
-
type: "=",
|
|
4313
|
-
queryId: "type",
|
|
4314
|
-
value: "datasheet",
|
|
4315
|
-
},
|
|
4316
|
-
],
|
|
4317
|
-
type: "list",
|
|
4318
|
-
})];
|
|
4319
|
-
case 7:
|
|
4320
|
-
schemaRes = _c.sent();
|
|
4321
|
-
spaceList = schemaRes === null || schemaRes === void 0 ? void 0 : schemaRes.data;
|
|
4322
|
-
return [4 /*yield*/, Promise.all(spaceList.map(function (eachSpace) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4323
|
-
var reference;
|
|
4324
|
-
var _a;
|
|
4325
|
-
return __generator(this, function (_b) {
|
|
4326
|
-
switch (_b.label) {
|
|
4327
|
-
case 0:
|
|
4328
|
-
reference = (_a = eachSpace.structure) === null || _a === void 0 ? void 0 : _a.filter(function (eacStructure) {
|
|
4329
|
-
var _a;
|
|
4330
|
-
return eacStructure.referenceSpaceId === ((_a = props.space) === null || _a === void 0 ? void 0 : _a._id);
|
|
4331
|
-
});
|
|
4332
|
-
if (!(reference && reference.length > 0)) return [3 /*break*/, 2];
|
|
4333
|
-
return [4 /*yield*/, Promise.all(selectedData.map(function (eachData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4334
|
-
var _a, reference_1, reference_1_1, eachReferenceStructure, e_1_1;
|
|
4335
|
-
var _b, e_1, _c, _d;
|
|
4336
|
-
return __generator(this, function (_e) {
|
|
4337
|
-
switch (_e.label) {
|
|
4338
|
-
case 0:
|
|
4339
|
-
_e.trys.push([0, 6, 7, 12]);
|
|
4340
|
-
_a = true, reference_1 = __asyncValues(reference);
|
|
4341
|
-
_e.label = 1;
|
|
4342
|
-
case 1: return [4 /*yield*/, reference_1.next()];
|
|
4343
|
-
case 2:
|
|
4344
|
-
if (!(reference_1_1 = _e.sent(), _b = reference_1_1.done, !_b)) return [3 /*break*/, 5];
|
|
4345
|
-
_d = reference_1_1.value;
|
|
4346
|
-
_a = false;
|
|
4347
|
-
eachReferenceStructure = _d;
|
|
4348
|
-
return [4 /*yield*/, handleFindReference_1(eachData, eachReferenceStructure, eachSpace)];
|
|
4349
|
-
case 3:
|
|
4350
|
-
_e.sent();
|
|
4351
|
-
_e.label = 4;
|
|
4352
|
-
case 4:
|
|
4353
|
-
_a = true;
|
|
4354
|
-
return [3 /*break*/, 1];
|
|
4355
|
-
case 5: return [3 /*break*/, 12];
|
|
4356
|
-
case 6:
|
|
4357
|
-
e_1_1 = _e.sent();
|
|
4358
|
-
e_1 = { error: e_1_1 };
|
|
4359
|
-
return [3 /*break*/, 12];
|
|
4360
|
-
case 7:
|
|
4361
|
-
_e.trys.push([7, , 10, 11]);
|
|
4362
|
-
if (!(!_a && !_b && (_c = reference_1.return))) return [3 /*break*/, 9];
|
|
4363
|
-
return [4 /*yield*/, _c.call(reference_1)];
|
|
4364
|
-
case 8:
|
|
4365
|
-
_e.sent();
|
|
4366
|
-
_e.label = 9;
|
|
4367
|
-
case 9: return [3 /*break*/, 11];
|
|
4368
|
-
case 10:
|
|
4369
|
-
if (e_1) throw e_1.error;
|
|
4370
|
-
return [7 /*endfinally*/];
|
|
4371
|
-
case 11: return [7 /*endfinally*/];
|
|
4372
|
-
case 12: return [2 /*return*/];
|
|
4373
|
-
}
|
|
4374
|
-
});
|
|
4375
|
-
}); }))];
|
|
4376
|
-
case 1:
|
|
4377
|
-
_b.sent();
|
|
4378
|
-
_b.label = 2;
|
|
4379
|
-
case 2: return [2 /*return*/];
|
|
4380
|
-
}
|
|
4381
|
-
});
|
|
4382
|
-
}); }))];
|
|
4383
|
-
case 8:
|
|
4384
|
-
_c.sent();
|
|
4385
|
-
_c.label = 9;
|
|
4386
|
-
case 9: return [3 /*break*/, 11];
|
|
4387
|
-
case 10:
|
|
4388
|
-
err_14 = _c.sent();
|
|
4389
|
-
return [3 /*break*/, 11];
|
|
4390
|
-
case 11:
|
|
4445
|
+
err_14 = _d.sent();
|
|
4446
|
+
return [3 /*break*/, 5];
|
|
4447
|
+
case 5:
|
|
4391
4448
|
setReferenceDeleteTableData(existsData);
|
|
4392
4449
|
return [2 /*return*/, selectedData
|
|
4393
4450
|
.filter(function (eachData) {
|
|
@@ -7606,7 +7663,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7606
7663
|
})) })) }));
|
|
7607
7664
|
};
|
|
7608
7665
|
var renderContent = function () {
|
|
7609
|
-
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;
|
|
7666
|
+
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;
|
|
7610
7667
|
var isBottom = ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom) ? true : false;
|
|
7611
7668
|
var tabs = renderTabs();
|
|
7612
7669
|
var pages = [
|
|
@@ -7646,16 +7703,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7646
7703
|
props.title && (react_1.default.createElement("p", { className: "text-xl font-medium ".concat(((_h = props.organise) === null || _h === void 0 ? void 0 : _h.darkMode) ? "text-white" : "") }, props.title)),
|
|
7647
7704
|
props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
|
|
7648
7705
|
renderActionButtons(resolvedType))),
|
|
7649
|
-
(schemaPresent ||
|
|
7706
|
+
(schemaPresent ||
|
|
7707
|
+
((_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareReadListTabs) ||
|
|
7708
|
+
relatedSections.length > 0) && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (_k = props.organise) === null || _k === void 0 ? void 0 : _k.darkMode })),
|
|
7650
7709
|
((_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareReadComponentPos) === "top" &&
|
|
7651
7710
|
renderBareReadComp(),
|
|
7652
|
-
((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareUpdateActionTop) &&
|
|
7711
|
+
((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareUpdateActionTop) &&
|
|
7712
|
+
!selectedRelated &&
|
|
7713
|
+
renderReadBar(),
|
|
7653
7714
|
anyAuthMethod && (react_1.default.createElement("div", { className: "bg-primary-100 text-gray-700 mt-3 px-5 py-3 rounded" }, renderAuthContent())),
|
|
7654
7715
|
react_1.default.createElement("div", { ref: exportReadPDFRef },
|
|
7655
|
-
|
|
7656
|
-
((
|
|
7716
|
+
selectedRelated ? (react_1.default.createElement(relatedRecords_1.RelatedRecords, { key: "".concat(props.id, "-").concat(selectedRelated.id), source: selectedRelated.source, recordId: (_o = props.id) !== null && _o !== void 0 ? _o : "", renderList: renderRelatedList })) : (!((_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareReadComponentHide) && (react_1.default.createElement("div", null, renderTabContent(tabs, resolvedType, viewType)))),
|
|
7717
|
+
((_q = props.bareSettings) === null || _q === void 0 ? void 0 : _q.bareReadComponentPos) !== "top" &&
|
|
7657
7718
|
renderBareReadComp()),
|
|
7658
|
-
!((
|
|
7719
|
+
!((_r = props.bareSettings) === null || _r === void 0 ? void 0 : _r.bareUpdateActionTop) &&
|
|
7720
|
+
!selectedRelated &&
|
|
7721
|
+
renderReadBar()))));
|
|
7659
7722
|
case "update":
|
|
7660
7723
|
if (props.id !== "new") {
|
|
7661
7724
|
pages.push({
|
|
@@ -7665,12 +7728,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7665
7728
|
});
|
|
7666
7729
|
}
|
|
7667
7730
|
pages.push({
|
|
7668
|
-
name: (
|
|
7731
|
+
name: (_u = selectedData === null || selectedData === void 0 ? void 0 : selectedData[(_t = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.breadcrumbAttributeId) !== null && _t !== void 0 ? _t : serverId]) !== null && _u !== void 0 ? _u : (props.id ? props.id : "new"),
|
|
7669
7732
|
href: "#",
|
|
7670
7733
|
current: true,
|
|
7671
7734
|
});
|
|
7672
7735
|
var filterModel_1 = [];
|
|
7673
|
-
var disabledOnEnter_1 = (
|
|
7736
|
+
var disabledOnEnter_1 = (_w = (_v = props.organise) === null || _v === void 0 ? void 0 : _v.disabledOnEnter) !== null && _w !== void 0 ? _w : false;
|
|
7674
7737
|
structure.map(function (eachModel) {
|
|
7675
7738
|
var _a;
|
|
7676
7739
|
var present = false;
|
|
@@ -7783,12 +7846,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7783
7846
|
}
|
|
7784
7847
|
}
|
|
7785
7848
|
};
|
|
7786
|
-
var hasTabAlign_1 = ((
|
|
7787
|
-
var leftTabAlign = ((
|
|
7788
|
-
((
|
|
7789
|
-
var topTabAlign = ((
|
|
7790
|
-
var stepperTabAlign = ((
|
|
7791
|
-
((
|
|
7849
|
+
var hasTabAlign_1 = ((_x = props.organise) === null || _x === void 0 ? void 0 : _x.tabAlign) || ((_y = props.space) === null || _y === void 0 ? void 0 : _y.tabAlign);
|
|
7850
|
+
var leftTabAlign = ((_z = props.organise) === null || _z === void 0 ? void 0 : _z.tabAlign) === "left" ||
|
|
7851
|
+
((_0 = props.space) === null || _0 === void 0 ? void 0 : _0.tabAlign) === "left";
|
|
7852
|
+
var topTabAlign = ((_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.tabAlign) === "top" || ((_2 = props.space) === null || _2 === void 0 ? void 0 : _2.tabAlign) === "top";
|
|
7853
|
+
var stepperTabAlign = ((_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.tabAlign) === "stepper" ||
|
|
7854
|
+
((_4 = props.space) === null || _4 === void 0 ? void 0 : _4.tabAlign) === "stepper";
|
|
7792
7855
|
var uniqueTabIds_2 = Array.from(new Set(filterModel_1
|
|
7793
7856
|
.map(function (item) { return item.tabId; })
|
|
7794
7857
|
.filter(function (id) { return id !== undefined; })));
|
|
@@ -7797,7 +7860,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7797
7860
|
if (shouldIncludeOthers) {
|
|
7798
7861
|
uniqueTabIds_2.push("");
|
|
7799
7862
|
}
|
|
7800
|
-
var customTabComponent_1 = (
|
|
7863
|
+
var customTabComponent_1 = (_7 = (_6 = (_5 = props.bareSettings) === null || _5 === void 0 ? void 0 : _5.bareUpdateTabComponent) === null || _6 === void 0 ? void 0 : _6.call(_5, uniqueTabIds_2)) !== null && _7 !== void 0 ? _7 : [];
|
|
7801
7864
|
var stepperSteps = uniqueTabIds_2.map(function (eachTabId) {
|
|
7802
7865
|
var _a, _b;
|
|
7803
7866
|
var customTabMatch = customTabComponent_1.find(function (eachTab) { return eachTab.tabId === eachTabId; });
|
|
@@ -7832,7 +7895,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7832
7895
|
props.id && props.id !== "new" && structure.length >= 1 && (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: readQueryHocRef, database: {
|
|
7833
7896
|
dbModule: dbModule,
|
|
7834
7897
|
dbType: devSettings.server,
|
|
7835
|
-
dbCollection: (
|
|
7898
|
+
dbCollection: (_9 = (_8 = props === null || props === void 0 ? void 0 : props.space) === null || _8 === void 0 ? void 0 : _8.pipelineDefaultSpaceId) !== null && _9 !== void 0 ? _9 : props.collectionId,
|
|
7836
7899
|
dbEndpoint: devSettings.dbEndpoint,
|
|
7837
7900
|
dbAPIToken: devSettings.dbAPIToken,
|
|
7838
7901
|
dbUserToken: devSettings.dbUserToken,
|
|
@@ -7840,11 +7903,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7840
7903
|
type: "get",
|
|
7841
7904
|
id: props.id,
|
|
7842
7905
|
pipeline: pipeline,
|
|
7843
|
-
}, offline: ((
|
|
7906
|
+
}, offline: ((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareOffline) && isNetworkOffline, onChangeData: handleRetrieveSelectedData, onError: handleGetItemError })),
|
|
7844
7907
|
renderBreadcrumb(pages),
|
|
7845
7908
|
react_1.default.createElement("div", { className: "flex flex-col py-2 sm:items-center sm:flex-row" },
|
|
7846
7909
|
(props.title || props.description) && (react_1.default.createElement("div", { className: "flex flex-col w-full" },
|
|
7847
|
-
props.title && (react_1.default.createElement("p", { className: "text-xl font-medium ".concat(((
|
|
7910
|
+
props.title && (react_1.default.createElement("p", { className: "text-xl font-medium ".concat(((_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.darkMode) ? "text-white" : "") }, props.title)),
|
|
7848
7911
|
props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
|
|
7849
7912
|
(!isBottom || hasTabAlign_1 || resolvedType === "update") &&
|
|
7850
7913
|
renderActionButtons(resolvedType, hasTabAlign_1, uniqueTabIds_2)),
|
|
@@ -7863,10 +7926,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7863
7926
|
var tabId = uniqueTabIds_2[stepIndex];
|
|
7864
7927
|
handleUpdateTabId(tabId);
|
|
7865
7928
|
} })),
|
|
7866
|
-
((
|
|
7867
|
-
((
|
|
7868
|
-
((
|
|
7869
|
-
((
|
|
7929
|
+
((_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareUpdateComponentAbove) &&
|
|
7930
|
+
((_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareUpdateComponent) &&
|
|
7931
|
+
((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareUpdateComponent(selectedData, handleResolveRawData())),
|
|
7932
|
+
((_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareUpdateActionTop) &&
|
|
7870
7933
|
renderStepBar(uniqueTabIds_2),
|
|
7871
7934
|
react_1.default.createElement(form_1.Form, { className: "mt-6", ref: formRef, refList: __spreadArray(__spreadArray([], modalFormInputRefs, true), flexTableRefs, true), handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: handleOnFailValidation },
|
|
7872
7935
|
uniqueTabIds_2.map(function (tabId) {
|
|
@@ -7888,8 +7951,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7888
7951
|
((_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.tabDescriptions) === null || _c === void 0 ? void 0 : _c[tabId]) && (react_1.default.createElement("p", { className: "text-sm mt-0.5 ".concat(((_d = props.organise) === null || _d === void 0 ? void 0 : _d.darkMode) ? "text-gray-400" : "text-gray-500") }, props.organise.tabDescriptions[tabId])))),
|
|
7889
7952
|
renderDataTemplateFormContent(selectedData, filterByTab, modalFormInputRefs, false, false, undefined, undefined)));
|
|
7890
7953
|
}),
|
|
7891
|
-
!((
|
|
7892
|
-
((
|
|
7954
|
+
!((_16 = props.bareSettings) === null || _16 === void 0 ? void 0 : _16.bareUpdateComponentAbove) &&
|
|
7955
|
+
((_17 = props.bareSettings) === null || _17 === void 0 ? void 0 : _17.bareUpdateComponent) && (
|
|
7893
7956
|
// INFO: the form is a grid-cols-12. A child with no column span is one
|
|
7894
7957
|
// column, and a grid item cannot shrink below its longest word, so on a
|
|
7895
7958
|
// phone it wraps one word per line. `contents` takes this wrapper out of
|
|
@@ -7899,20 +7962,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7899
7962
|
react_1.default.createElement("div", { className: "contents [&>*:not([class*=col-span])]:col-span-12" }, props.bareSettings.bareUpdateComponent(selectedData, handleResolveRawData())))),
|
|
7900
7963
|
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(resolvedType)),
|
|
7901
7964
|
react_1.default.createElement("div", { className: "mt-8" }, renderListObject(resolvedType)),
|
|
7902
|
-
!((
|
|
7965
|
+
!((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareUpdateActionTop) &&
|
|
7903
7966
|
renderStepBar(uniqueTabIds_2),
|
|
7904
7967
|
isBottom &&
|
|
7905
7968
|
resolvedType !== "update" &&
|
|
7906
7969
|
renderActionButtons(resolvedType, hasTabAlign_1, uniqueTabIds_2)))) : (react_1.default.createElement("div", null,
|
|
7907
|
-
((
|
|
7908
|
-
((
|
|
7909
|
-
((
|
|
7910
|
-
((
|
|
7970
|
+
((_19 = props.bareSettings) === null || _19 === void 0 ? void 0 : _19.bareUpdateComponentAbove) &&
|
|
7971
|
+
((_20 = props.bareSettings) === null || _20 === void 0 ? void 0 : _20.bareUpdateComponent) &&
|
|
7972
|
+
((_21 = props.bareSettings) === null || _21 === void 0 ? void 0 : _21.bareUpdateComponent(selectedData, handleResolveRawData())),
|
|
7973
|
+
((_22 = props.bareSettings) === null || _22 === void 0 ? void 0 : _22.bareUpdateActionTop) &&
|
|
7911
7974
|
renderStepBar(uniqueTabIds_2),
|
|
7912
7975
|
react_1.default.createElement(form_1.Form, { className: "grid ".concat(formColumn, " ").concat(gridGap, " mt-6"), ref: formRef, refList: __spreadArray(__spreadArray([], modalFormInputRefs, true), flexTableRefs, true), handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: handleOnFailValidation },
|
|
7913
7976
|
renderDataTemplateFormContent(selectedData, filterModel_1, modalFormInputRefs, false, false),
|
|
7914
|
-
!((
|
|
7915
|
-
((
|
|
7977
|
+
!((_23 = props.bareSettings) === null || _23 === void 0 ? void 0 : _23.bareUpdateComponentAbove) &&
|
|
7978
|
+
((_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareUpdateComponent) && (
|
|
7916
7979
|
// INFO: the form is a grid-cols-12. A child with no column span is one
|
|
7917
7980
|
// column, and a grid item cannot shrink below its longest word, so on a
|
|
7918
7981
|
// phone it wraps one word per line. `contents` takes this wrapper out of
|
|
@@ -7922,7 +7985,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7922
7985
|
react_1.default.createElement("div", { className: "contents [&>*:not([class*=col-span])]:col-span-12" }, props.bareSettings.bareUpdateComponent(selectedData, handleResolveRawData())))),
|
|
7923
7986
|
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(resolvedType)),
|
|
7924
7987
|
react_1.default.createElement("div", { className: "mt-8" }, renderListObject(resolvedType)),
|
|
7925
|
-
!((
|
|
7988
|
+
!((_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareUpdateActionTop) &&
|
|
7926
7989
|
renderStepBar(uniqueTabIds_2)))));
|
|
7927
7990
|
case "list":
|
|
7928
7991
|
case "union":
|
|
@@ -7931,20 +7994,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7931
7994
|
var actionComponent = renderActionButtons(resolvedType);
|
|
7932
7995
|
// INFO: active flex filter count for the icon badge + floating search.
|
|
7933
7996
|
// Counts query output so the badge matches what's actually filtered.
|
|
7934
|
-
var activeFlexFilterCount_1 = ((
|
|
7997
|
+
var activeFlexFilterCount_1 = ((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareFlexFilters)
|
|
7935
7998
|
? (0, listModule_1.renderFlexFilterConditions)(flexFilters, structure).length
|
|
7936
7999
|
: 0;
|
|
7937
8000
|
var listReadQueryHOC = (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: listRQueryHocRef, database: {
|
|
7938
8001
|
dbModule: dbModule,
|
|
7939
8002
|
dbType: devSettings.server,
|
|
7940
|
-
dbCollection: (
|
|
8003
|
+
dbCollection: (_28 = (_27 = props === null || props === void 0 ? void 0 : props.space) === null || _27 === void 0 ? void 0 : _27.pipelineDefaultSpaceId) !== null && _28 !== void 0 ? _28 : props.collectionId,
|
|
7941
8004
|
dbEndpoint: devSettings.dbEndpoint,
|
|
7942
8005
|
dbAPIToken: devSettings.dbAPIToken,
|
|
7943
8006
|
dbUserToken: devSettings.dbUserToken,
|
|
7944
|
-
}, cond: handleReadQueryHocCond(), offline: ((
|
|
8007
|
+
}, cond: handleReadQueryHocCond(), offline: ((_29 = props.bareSettings) === null || _29 === void 0 ? void 0 : _29.bareOffline) && isNetworkOffline, onChangeData: function (data, cond) {
|
|
7945
8008
|
handleGetListData(data, "", "", cond);
|
|
7946
8009
|
}, onError: handleGetItemError }));
|
|
7947
|
-
if ((
|
|
8010
|
+
if ((_30 = props.renderSettings) === null || _30 === void 0 ? void 0 : _30.renderListUI) {
|
|
7948
8011
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
7949
8012
|
listReadQueryHOC,
|
|
7950
8013
|
props.renderSettings.renderListUI(actionComponent, filterComponent_1, dataComponent)));
|
|
@@ -8156,47 +8219,47 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8156
8219
|
};
|
|
8157
8220
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
8158
8221
|
listReadQueryHOC,
|
|
8159
|
-
react_1.default.createElement("div", { className: "flex py-2 ".concat(((
|
|
8222
|
+
react_1.default.createElement("div", { className: "flex py-2 ".concat(((_31 = props.bareSettings) === null || _31 === void 0 ? void 0 : _31.bareCompactMode)
|
|
8160
8223
|
? // INFO: the grow spacer is hidden on phones (search lives in
|
|
8161
8224
|
// the floating bar), so the row itself pushes the actions right
|
|
8162
8225
|
"w-full flex-row flex-wrap sm:flex-nowrap items-end justify-between sm:justify-start"
|
|
8163
8226
|
: "flex-col md:items-end md:flex-row") },
|
|
8164
8227
|
(props.title || props.description) && (react_1.default.createElement("div", { className: "flex flex-col" },
|
|
8165
8228
|
props.title && (react_1.default.createElement("div", { className: "flex items-center gap-2" },
|
|
8166
|
-
react_1.default.createElement("p", { className: "text-xl font-medium ".concat(((
|
|
8167
|
-
((
|
|
8229
|
+
react_1.default.createElement("p", { className: "text-xl font-medium ".concat(((_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.darkMode) ? "text-white" : "") }, props.title),
|
|
8230
|
+
((_33 = props.bareSettings) === null || _33 === void 0 ? void 0 : _33.bareSocketName) &&
|
|
8168
8231
|
isLive &&
|
|
8169
8232
|
!isLiveOffline && (react_1.default.createElement("span", { className: "inline-flex items-center gap-1 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-700" },
|
|
8170
8233
|
react_1.default.createElement("span", { className: "h-1.5 w-1.5 rounded-full bg-green-500" }),
|
|
8171
8234
|
"LIVE")),
|
|
8172
|
-
((
|
|
8235
|
+
((_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.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" },
|
|
8173
8236
|
react_1.default.createElement("span", { className: "h-1.5 w-1.5 rounded-full bg-orange-400" }),
|
|
8174
8237
|
"OFFLINE")))),
|
|
8175
8238
|
props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
|
|
8176
|
-
react_1.default.createElement("div", { className: ((
|
|
8239
|
+
react_1.default.createElement("div", { className: ((_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareCompactMode)
|
|
8177
8240
|
? "hidden sm:block grow"
|
|
8178
8241
|
: "grow" }),
|
|
8179
8242
|
react_1.default.createElement("div", { className: "ml-auto flex flex-row items-end" },
|
|
8180
8243
|
renderListFilterElements(),
|
|
8181
8244
|
renderListActionElements())),
|
|
8182
8245
|
renderListNewRowFilterElements(),
|
|
8183
|
-
(schemaPresent || ((
|
|
8246
|
+
(schemaPresent || ((_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareReadListTabs)) && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (_37 = props.organise) === null || _37 === void 0 ? void 0 : _37.darkMode })),
|
|
8184
8247
|
renderScopedTabContent(tabs, resolvedType, viewType),
|
|
8185
|
-
((
|
|
8186
|
-
((
|
|
8248
|
+
((_38 = props.bareSettings) === null || _38 === void 0 ? void 0 : _38.bareListMobileFloatingSearch) && (react_1.default.createElement("div", { className: "h-28 md:hidden", "aria-hidden": "true" })),
|
|
8249
|
+
((_39 = props.bareSettings) === null || _39 === void 0 ? void 0 : _39.bareListMobileFloatingSearch) &&
|
|
8187
8250
|
(0, listModule_1.renderFloatingMobileSearch)({
|
|
8188
8251
|
filterSearch: filterSearch,
|
|
8189
8252
|
handleNameSearch: handleNameSearch,
|
|
8190
8253
|
onFilterClick: function () { return setFlexFilterModalOpen(true); },
|
|
8191
|
-
hideSearch: (
|
|
8192
|
-
darkMode: (
|
|
8193
|
-
floatingOffset: (
|
|
8194
|
-
hideFilter: !((
|
|
8195
|
-
activeFilterCount: ((
|
|
8254
|
+
hideSearch: (_40 = props.organise) === null || _40 === void 0 ? void 0 : _40.hideSearch,
|
|
8255
|
+
darkMode: (_41 = props.organise) === null || _41 === void 0 ? void 0 : _41.darkMode,
|
|
8256
|
+
floatingOffset: (_42 = props.bareSettings) === null || _42 === void 0 ? void 0 : _42.bareListFloatingActionOffset,
|
|
8257
|
+
hideFilter: !((_43 = props.bareSettings) === null || _43 === void 0 ? void 0 : _43.bareFlexFilters),
|
|
8258
|
+
activeFilterCount: ((_44 = props.bareSettings) === null || _44 === void 0 ? void 0 : _44.bareFlexFilters)
|
|
8196
8259
|
? activeFlexFilterCount_1
|
|
8197
8260
|
: undefined,
|
|
8198
8261
|
// INFO: Hides when items are selected so NewTable's multi-action bar takes over.
|
|
8199
|
-
hidden: selectAll || ((
|
|
8262
|
+
hidden: selectAll || ((_45 = selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.length) !== null && _45 !== void 0 ? _45 : 0) > 0,
|
|
8200
8263
|
})));
|
|
8201
8264
|
default:
|
|
8202
8265
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
@@ -8508,7 +8571,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8508
8571
|
if (((_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) &&
|
|
8509
8572
|
((_b = props.organise.extendedTabs) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
8510
8573
|
(_c = props.organise) === null || _c === void 0 ? void 0 : _c.extendedTabs.map(function (eachTab) {
|
|
8511
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
8574
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
8512
8575
|
var hrefPoint = "".concat(props.localURLEndpoint, "?type=").concat(resolvedType, "&collection=").concat(props.collectionId);
|
|
8513
8576
|
if (props.id)
|
|
8514
8577
|
hrefPoint += "&data=".concat(props.id);
|
|
@@ -8533,6 +8596,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8533
8596
|
// still unwound the column (it reads the raw extendedTabs) while
|
|
8534
8597
|
// the tile had no column to read and every file said "Attachment".
|
|
8535
8598
|
fileSettings: (_f = eachTab.fileSettings) !== null && _f !== void 0 ? _f : undefined,
|
|
8599
|
+
chartSettings: (_g = eachTab.chartSettings) !== null && _g !== void 0 ? _g : undefined,
|
|
8536
8600
|
};
|
|
8537
8601
|
if (eachTab.viewType === "iframe") {
|
|
8538
8602
|
if (typeof eachTab.src === "string") {
|
|
@@ -8547,7 +8611,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8547
8611
|
}
|
|
8548
8612
|
if (eachTab.type === resolvedType) {
|
|
8549
8613
|
tabs.push(__assign(__assign(__assign({}, tabData), (isEditor &&
|
|
8550
|
-
((
|
|
8614
|
+
((_h = props.organise) === null || _h === void 0 ? void 0 : _h.onChangeTabs) && {
|
|
8551
8615
|
action: (react_1.default.createElement("span", { role: "button", "data-testid": "tab-default-".concat(tabData.id), "aria-label": eachTab.defaultTab
|
|
8552
8616
|
? "Opens by default"
|
|
8553
8617
|
: "Open this tab by default", className: "ml-2 self-center ".concat(eachTab.defaultTab
|
|
@@ -8557,8 +8621,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8557
8621
|
e.preventDefault();
|
|
8558
8622
|
handleToggleDefaultTab(eachTab.name);
|
|
8559
8623
|
} }, eachTab.defaultTab ? (react_1.default.createElement(HeroIcons.BookmarkIcon, { className: "h-4 w-4" })) : (react_1.default.createElement(BookmarkIcon_1.default, { className: "h-4 w-4" })))),
|
|
8560
|
-
})), (!((
|
|
8561
|
-
((
|
|
8624
|
+
})), (!((_j = props.edit) === null || _j === void 0 ? void 0 : _j.disabledTabsDeleteBtn) &&
|
|
8625
|
+
((_k = props.organise) === null || _k === void 0 ? void 0 : _k.onChangeTabs) && {
|
|
8562
8626
|
del: (react_1.default.createElement(outline_1.XMarkIcon, { className: "h-4 w-4 ml-2 self-center text-red-600 hover:text-red-400 ", onClick: function (e) {
|
|
8563
8627
|
e.stopPropagation();
|
|
8564
8628
|
e.preventDefault();
|
|
@@ -8569,6 +8633,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8569
8633
|
return null;
|
|
8570
8634
|
});
|
|
8571
8635
|
}
|
|
8636
|
+
if (resolvedType === "read")
|
|
8637
|
+
relatedSections.forEach(function (eachSection) {
|
|
8638
|
+
return tabs.push({
|
|
8639
|
+
id: eachSection.id,
|
|
8640
|
+
name: "".concat(eachSection.label, " (").concat(eachSection.count, ")"),
|
|
8641
|
+
href: "".concat(props.localURLEndpoint, "?data=").concat(props.id, "&type=read&collection=").concat(props.collectionId, "&view=").concat(eachSection.id),
|
|
8642
|
+
});
|
|
8643
|
+
});
|
|
8572
8644
|
if (isEditor)
|
|
8573
8645
|
if (!((_d = props.organise) === null || _d === void 0 ? void 0 : _d.hideNewTabs) && !((_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareReadListTabs))
|
|
8574
8646
|
tabs.push({
|
|
@@ -8613,6 +8685,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8613
8685
|
var nextTabs = ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) !== null && _b !== void 0 ? _b : []).map(function (eachTab) { return (__assign(__assign({}, eachTab), { defaultTab: eachTab.name === name ? !eachTab.defaultTab : false })); });
|
|
8614
8686
|
(_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onChangeTabs) === null || _d === void 0 ? void 0 : _d.call(_c, nextTabs);
|
|
8615
8687
|
};
|
|
8688
|
+
var handleChangeTabCharts = function (tabName, charts) {
|
|
8689
|
+
var _a, _b, _c, _d;
|
|
8690
|
+
var nextTabs = ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) !== null && _b !== void 0 ? _b : []).map(function (eachTab) {
|
|
8691
|
+
return eachTab.name === tabName
|
|
8692
|
+
? __assign(__assign({}, eachTab), { chartSettings: charts }) : eachTab;
|
|
8693
|
+
});
|
|
8694
|
+
(_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onChangeTabs) === null || _d === void 0 ? void 0 : _d.call(_c, nextTabs);
|
|
8695
|
+
};
|
|
8696
|
+
// INFO: the other space's own Data Template, narrowed to the rows that point
|
|
8697
|
+
// at this record and read-only. Without a schema endpoint it carries no tabs
|
|
8698
|
+
// of its own, and a picked row opens in place instead of navigating away, so
|
|
8699
|
+
// this record's tabs stay put.
|
|
8700
|
+
var renderRelatedList = function (source, query, openId, onOpen) {
|
|
8701
|
+
var _a, _b, _c;
|
|
8702
|
+
return (react_1.default.createElement(exports.DataTemplate, { title: "", description: "", type: openId ? "read" : "list", id: openId, collectionId: source.collectionId, model: source.schema, localURLEndpoint: props.localURLEndpoint, devSettings: __assign(__assign({}, props.devSettings), { schemaEndpoint: "" }), lib: props.lib, organise: {
|
|
8703
|
+
darkMode: (_a = props.organise) === null || _a === void 0 ? void 0 : _a.darkMode,
|
|
8704
|
+
darkModeBg: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.darkModeBg,
|
|
8705
|
+
breadcrumbType: "hidden",
|
|
8706
|
+
handleNavigate: function (type, selectedId) {
|
|
8707
|
+
return onOpen(type === "read" && selectedId ? selectedId : "");
|
|
8708
|
+
},
|
|
8709
|
+
}, bareSettings: {
|
|
8710
|
+
bareListFilterQuery: query,
|
|
8711
|
+
bareNewDTW: (_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareNewDTW,
|
|
8712
|
+
} }));
|
|
8713
|
+
};
|
|
8616
8714
|
var renderAddMathColumn = function (id, onClose) {
|
|
8617
8715
|
var _a, _b, _c;
|
|
8618
8716
|
return (react_1.default.createElement(settingsModal_1.ExpressionModal, { selectedId: id, model: structure, renderReferenceLabelOptions: (_a = props.organise) === null || _a === void 0 ? void 0 : _a.renderReferenceLabelOptions, renderReferenceSpaceOptions: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.renderReferenceSpaceOptions, onAddModelSchema: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onAddColumns, onClose: onClose }));
|
|
@@ -9033,14 +9131,31 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9033
9131
|
};
|
|
9034
9132
|
// INFO: `hidden` keeps the markers out of space-y spacing
|
|
9035
9133
|
var renderSavedViews = function () {
|
|
9036
|
-
var _a;
|
|
9134
|
+
var _a, _b, _c, _d, _e, _f;
|
|
9037
9135
|
if (!isSavedViewsEnabled)
|
|
9038
9136
|
return null;
|
|
9039
9137
|
var views = handleGetTabSavedViews();
|
|
9040
9138
|
var activeView = views.find(function (eachView) { return eachView.id === activeSavedViewId; });
|
|
9041
|
-
var
|
|
9042
|
-
|
|
9043
|
-
|
|
9139
|
+
var currentState = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
|
|
9140
|
+
// INFO: compared in a shape both sides share — a stored order is kept to
|
|
9141
|
+
// the columns that still exist, with new ones after in model order, and
|
|
9142
|
+
// hides only count where a view can apply them (schema-hide mode)
|
|
9143
|
+
var modelIds = ((_a = props.model) !== null && _a !== void 0 ? _a : []).map(function (eachColumn) { return eachColumn.id; });
|
|
9144
|
+
var handleComparable = function (state) {
|
|
9145
|
+
var _a;
|
|
9146
|
+
var kept = ((_a = state.columnOrder) !== null && _a !== void 0 ? _a : []).filter(function (eachId) {
|
|
9147
|
+
return modelIds.includes(eachId);
|
|
9148
|
+
});
|
|
9149
|
+
return __assign(__assign({}, state), { columnOrder: __spreadArray(__spreadArray([], kept, true), modelIds.filter(function (eachId) { return !kept.includes(eachId); }), true), hiddenColumnIds: isSchemaHideMode ? state.hiddenColumnIds : undefined });
|
|
9150
|
+
};
|
|
9151
|
+
var handleIsOnState = function (state) {
|
|
9152
|
+
return (0, viewStatePersistence_1.handleIsSameViewState)(handleComparable(currentState), handleComparable((0, viewStatePersistence_1.handlePickViewState)(handleResolveViewState(state))));
|
|
9153
|
+
};
|
|
9154
|
+
var isModified = !!activeView && !handleIsOnState(activeView.state);
|
|
9155
|
+
var defaultViewId = (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.defaultSavedViewId) !== null && _c !== void 0 ? _c : null;
|
|
9156
|
+
var canStarViews = !!((_d = props.organise) === null || _d === void 0 ? void 0 : _d.onChangeDefaultSavedViewId);
|
|
9157
|
+
var canSaveViews = !isAppViews || !!((_e = props.organise) === null || _e === void 0 ? void 0 : _e.onChangeSharedViews);
|
|
9158
|
+
var darkMode = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.darkMode;
|
|
9044
9159
|
var renderChipClass = function (active) {
|
|
9045
9160
|
return "inline-flex items-center gap-1 rounded-full border px-3 py-1 text-xs font-medium ".concat(active
|
|
9046
9161
|
? "border-primary-500 bg-primary-50 text-primary-700"
|
|
@@ -9062,8 +9177,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9062
9177
|
react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-".concat(eachView.id), title: eachView.id === (activeView === null || activeView === void 0 ? void 0 : activeView.id) && isModified
|
|
9063
9178
|
? "Changed since saved"
|
|
9064
9179
|
: undefined, onClick: function () { return handleApplySavedView(eachView); } },
|
|
9180
|
+
eachView.id === defaultViewId && !canStarViews ? "★ " : "",
|
|
9065
9181
|
eachView.name,
|
|
9066
9182
|
eachView.id === (activeView === null || activeView === void 0 ? void 0 : activeView.id) && isModified ? " •" : ""),
|
|
9183
|
+
canStarViews && (react_1.default.createElement("button", { type: "button", "aria-label": eachView.id === defaultViewId
|
|
9184
|
+
? "Stop opening on ".concat(eachView.name)
|
|
9185
|
+
: "Open on ".concat(eachView.name, " for everyone"), "data-testid": "dtw-saved-view-star-".concat(eachView.id), className: eachView.id === defaultViewId
|
|
9186
|
+
? "text-yellow-500"
|
|
9187
|
+
: "text-gray-400 hover:text-yellow-500", onClick: function () {
|
|
9188
|
+
var _a, _b;
|
|
9189
|
+
return (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeDefaultSavedViewId) === null || _b === void 0 ? void 0 : _b.call(_a, eachView.id === defaultViewId ? null : eachView.id);
|
|
9190
|
+
} }, eachView.id === defaultViewId ? "★" : "☆")),
|
|
9067
9191
|
!eachView.locked && (react_1.default.createElement("button", { type: "button", "aria-label": "Delete ".concat(eachView.name), "data-testid": "dtw-saved-view-delete-".concat(eachView.id), onClick: function () { return setDeletingSavedViewId(eachView.id); } },
|
|
9068
9192
|
react_1.default.createElement(outline_1.XMarkIcon, { className: "h-3.5 w-3.5" })))));
|
|
9069
9193
|
}),
|
|
@@ -9071,7 +9195,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9071
9195
|
"Update \u201C",
|
|
9072
9196
|
activeView.name,
|
|
9073
9197
|
"\u201D")),
|
|
9074
|
-
savedViewName === null ? (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-new", className: actionClass, onClick: function () { return setSavedViewName(""); } }, "+ Save view")) : (
|
|
9198
|
+
!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")) : (
|
|
9075
9199
|
// INFO: a form, so a mobile keyboard's Done saves the view; stopPropagation
|
|
9076
9200
|
// keeps the submit from reaching any form around the template
|
|
9077
9201
|
react_1.default.createElement("form", { "data-testid": "dtw-saved-view-form", className: "flex items-center gap-1", onSubmit: function (event) {
|
|
@@ -9098,7 +9222,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9098
9222
|
renderTabContent(tabs, dataType, requestedViewType),
|
|
9099
9223
|
react_1.default.createElement("span", { ref: scrollScopeEndRef, hidden: true, "aria-hidden": "true" }))); };
|
|
9100
9224
|
var renderTabContent = function (tabs, dataType, requestedViewType) {
|
|
9101
|
-
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;
|
|
9225
|
+
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;
|
|
9102
9226
|
var matchedTab = tabs.find(function (eachTab) { return eachTab.id === requestedViewType; });
|
|
9103
9227
|
/**
|
|
9104
9228
|
* INFO: a list tab must not supply the content of a read view. The selected
|
|
@@ -10017,6 +10141,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10017
10141
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
10018
10142
|
} }));
|
|
10019
10143
|
}
|
|
10144
|
+
else if (selectedTabData.viewType === "chart") {
|
|
10145
|
+
return (react_1.default.createElement(chartView_1.ChartView, { charts: (_60 = selectedTabData.chartSettings) !== null && _60 !== void 0 ? _60 : [], structure: structure, collectionId: props.collectionId, devSettings: props.devSettings, filterQuery: (_61 = renderImpSearchFilterConditions()) !== null && _61 !== void 0 ? _61 : [], editable: isEditor, darkMode: (_62 = props.organise) === null || _62 === void 0 ? void 0 : _62.darkMode, darkModeBg: (_63 = props.organise) === null || _63 === void 0 ? void 0 : _63.darkModeBg, onChangeCharts: ((_64 = props.organise) === null || _64 === void 0 ? void 0 : _64.onChangeTabs)
|
|
10146
|
+
? function (charts) {
|
|
10147
|
+
return handleChangeTabCharts(selectedTabData.name, charts);
|
|
10148
|
+
}
|
|
10149
|
+
: undefined }));
|
|
10150
|
+
}
|
|
10020
10151
|
else if (selectedTabData.renderComp) {
|
|
10021
10152
|
return react_1.default.createElement(react_1.default.Fragment, null, selectedTabData.renderComp());
|
|
10022
10153
|
}
|
|
@@ -10142,7 +10273,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10142
10273
|
} }))))));
|
|
10143
10274
|
}
|
|
10144
10275
|
else if (addTabModal) {
|
|
10145
|
-
return (react_1.default.createElement(settingsModal_1.TabModal, { type: resolvedType, tabs: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.extendedTabs, onChangeTabs: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.onChangeTabs, model: structure, renderReferenceLabelOptions: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.renderReferenceLabelOptions, onClose: function () {
|
|
10276
|
+
return (react_1.default.createElement(settingsModal_1.TabModal, { type: resolvedType, tabs: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.extendedTabs, onChangeTabs: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.onChangeTabs, model: structure, collectionId: props.collectionId, renderReferenceLabelOptions: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.renderReferenceLabelOptions, onClose: function () {
|
|
10146
10277
|
handlePopUpModal(false);
|
|
10147
10278
|
} }));
|
|
10148
10279
|
}
|
|
@@ -10497,7 +10628,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10497
10628
|
};
|
|
10498
10629
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
10499
10630
|
renderNotification("root"),
|
|
10500
|
-
((
|
|
10631
|
+
((_77 = (_76 = props.renderSettings) === null || _76 === void 0 ? void 0 : _76.renderLoadingUI) === null || _77 === void 0 ? void 0 : _77.call(_76)) && loading ? ((_78 = props.renderSettings) === null || _78 === void 0 ? void 0 : _78.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.darkMode, darkModeBg: (_80 = props.organise) === null || _80 === void 0 ? void 0 : _80.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
|
|
10501
10632
|
var _a, _b;
|
|
10502
10633
|
if (loading)
|
|
10503
10634
|
return;
|
|
@@ -10508,7 +10639,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10508
10639
|
setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
|
|
10509
10640
|
}
|
|
10510
10641
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
|
|
10511
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
10642
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_81 = props.organise) === null || _81 === void 0 ? void 0 : _81.darkMode, darkModeBg: (_82 = props.organise) === null || _82 === void 0 ? void 0 : _82.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
|
|
10512
10643
|
return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
|
|
10513
10644
|
if (dataId) {
|
|
10514
10645
|
var currentValue = selectedData[referenceCreationModal.id];
|
|
@@ -10524,19 +10655,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10524
10655
|
}, onClose: function () {
|
|
10525
10656
|
setReferenceCreationModal({ id: "", name: "", type: "string" });
|
|
10526
10657
|
} }),
|
|
10527
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
10658
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_83 = props.organise) === null || _83 === void 0 ? void 0 : _83.darkMode, darkModeBg: (_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
|
|
10528
10659
|
setReferenceDeleteTableData({});
|
|
10529
10660
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
10530
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
10661
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.darkMode, darkModeBg: (_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
|
|
10531
10662
|
setDeletePasscodeInput("");
|
|
10532
10663
|
setDeleteModal(!deleteModal);
|
|
10533
10664
|
setDeleteFeedId("");
|
|
10534
10665
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
10535
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
10666
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.darkMode, darkModeBg: (_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
|
|
10536
10667
|
setBatchUpdateData({ columnId: "", columnData: {} });
|
|
10537
10668
|
setBatchUpdateModal(false);
|
|
10538
10669
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
10539
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
10670
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.darkMode, darkModeBg: (_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
|
|
10540
10671
|
var _a, _b;
|
|
10541
10672
|
if (props.space)
|
|
10542
10673
|
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 }));
|
|
@@ -10544,7 +10675,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10544
10675
|
}, onClose: function () {
|
|
10545
10676
|
setSelectedAuthMethod("");
|
|
10546
10677
|
} }),
|
|
10547
|
-
isActivityLog && (react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
10678
|
+
isActivityLog && (react_1.default.createElement(modal_1.Modal, { darkMode: (_91 = props.organise) === null || _91 === void 0 ? void 0 : _91.darkMode, darkModeBg: (_92 = props.organise) === null || _92 === void 0 ? void 0 : _92.darkModeBg, open: activityModal, title: "Activity Log", renderContent: function () {
|
|
10548
10679
|
var _a, _b;
|
|
10549
10680
|
return (react_1.default.createElement(activityModal_1.ActivityModal, { title: props.title && typeof props.title === "string"
|
|
10550
10681
|
? props.title
|