blixify-ui-web 1.2.199 → 1.2.201
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/data/columnTypes/context.d.ts +1 -0
- package/lib/components/data/columnTypes/context.d.ts.map +1 -1
- package/lib/components/data/columnTypes/context.js.map +1 -1
- package/lib/components/data/columnTypes/dateRangeCell.d.ts.map +1 -1
- package/lib/components/data/columnTypes/dateRangeCell.js +2 -1
- package/lib/components/data/columnTypes/dateRangeCell.js.map +1 -1
- package/lib/components/data/columnTypes/personAvatar.d.ts +24 -0
- package/lib/components/data/columnTypes/personAvatar.d.ts.map +1 -0
- package/lib/components/data/columnTypes/personAvatar.js +89 -0
- package/lib/components/data/columnTypes/personAvatar.js.map +1 -0
- package/lib/components/data/columnTypes/timeTracking.d.ts +2 -0
- package/lib/components/data/columnTypes/timeTracking.d.ts.map +1 -1
- package/lib/components/data/columnTypes/timeTracking.js +14 -1
- package/lib/components/data/columnTypes/timeTracking.js.map +1 -1
- package/lib/components/data/columnTypes/timeTrackingCell.d.ts +7 -0
- package/lib/components/data/columnTypes/timeTrackingCell.d.ts.map +1 -1
- package/lib/components/data/columnTypes/timeTrackingCell.js +72 -17
- package/lib/components/data/columnTypes/timeTrackingCell.js.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +20 -1
- package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts +1 -0
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +460 -292
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.js +2 -7
- package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +6 -0
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js +35 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
- package/lib/components/data/flexFilter/index.d.ts.map +1 -1
- package/lib/components/data/flexFilter/index.js +1 -1
- package/lib/components/data/flexFilter/index.js.map +1 -1
- package/lib/components/data/listModule.d.ts +1 -0
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +17 -17
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/data/readModule.d.ts.map +1 -1
- package/lib/components/data/readModule.js +7 -14
- package/lib/components/data/readModule.js.map +1 -1
- package/lib/components/data/updateModule.d.ts.map +1 -1
- package/lib/components/data/updateModule.js +25 -21
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/display/newGrid/index.d.ts +2 -0
- package/lib/components/display/newGrid/index.d.ts.map +1 -1
- package/lib/components/display/newGrid/index.js +4 -1
- package/lib/components/display/newGrid/index.js.map +1 -1
- package/lib/components/display/newKanban/index.d.ts +2 -0
- package/lib/components/display/newKanban/index.d.ts.map +1 -1
- package/lib/components/display/newKanban/index.js +4 -1
- package/lib/components/display/newKanban/index.js.map +1 -1
- package/lib/components/display/newList/index.d.ts +2 -0
- package/lib/components/display/newList/index.d.ts.map +1 -1
- package/lib/components/display/newList/index.js +2 -0
- package/lib/components/display/newList/index.js.map +1 -1
- package/lib/components/display/newTable/columnWidth.d.ts +8 -0
- package/lib/components/display/newTable/columnWidth.d.ts.map +1 -0
- package/lib/components/display/newTable/columnWidth.js +32 -0
- package/lib/components/display/newTable/columnWidth.js.map +1 -0
- package/lib/components/display/newTable/index.d.ts +3 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +78 -41
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/display/recordActions/index.d.ts +10 -0
- package/lib/components/display/recordActions/index.d.ts.map +1 -0
- package/lib/components/display/recordActions/index.js +39 -0
- package/lib/components/display/recordActions/index.js.map +1 -0
- package/lib/components/input/select/index.d.ts +2 -0
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +62 -16
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js +16 -11
- package/lib/components/input/textInput/index.js.map +1 -1
- package/lib/tail.css +12 -2
- package/package.json +1 -1
|
@@ -93,7 +93,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
93
93
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
94
94
|
};
|
|
95
95
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
96
|
-
exports.DataTemplate = exports.FORMULA_VIEW_MAX_ROWS = void 0;
|
|
96
|
+
exports.DataTemplate = exports.handleCheckEmptyCardValue = exports.FORMULA_VIEW_MAX_ROWS = void 0;
|
|
97
97
|
var outline_1 = require("@heroicons/react/24/outline");
|
|
98
98
|
var HeroIcons = __importStar(require("@heroicons/react/24/solid"));
|
|
99
99
|
// INFO: the outline bookmark, for a tab that is not the default one. HeroIcons
|
|
@@ -174,6 +174,7 @@ var relatedRecords_1 = require("./relatedRecords");
|
|
|
174
174
|
var flexFilter_1 = require("../flexFilter");
|
|
175
175
|
var viewStatePersistence_1 = require("./viewStatePersistence");
|
|
176
176
|
var permissions_1 = require("./permissions");
|
|
177
|
+
var columnWidth_1 = require("../../display/newTable/columnWidth");
|
|
177
178
|
// INFO: builds the notification message for a failed write. Callers must gate on
|
|
178
179
|
// `err.response` alone, never on a specific status — a catch that only handles 400 shows
|
|
179
180
|
// the user nothing at all for any other status, so a write silently disappears. A 5xx is
|
|
@@ -220,6 +221,23 @@ var handleGetCalendarSwitchRange = function (date, view) {
|
|
|
220
221
|
end: (0, dayjs_1.default)(date).endOf(unit).toDate(),
|
|
221
222
|
};
|
|
222
223
|
};
|
|
224
|
+
// INFO: " - " is what the list prints for a lookup it could not resolve, an
|
|
225
|
+
// empty reference list included
|
|
226
|
+
var handleCheckEmptyCardValue = function (value) {
|
|
227
|
+
if (value === undefined || value === null)
|
|
228
|
+
return true;
|
|
229
|
+
if (typeof value === "string")
|
|
230
|
+
return !value.trim() || value === " - ";
|
|
231
|
+
if (Array.isArray(value))
|
|
232
|
+
return value.every(function (eachValue) {
|
|
233
|
+
return eachValue === undefined ||
|
|
234
|
+
eachValue === null ||
|
|
235
|
+
eachValue === "" ||
|
|
236
|
+
eachValue === " - ";
|
|
237
|
+
});
|
|
238
|
+
return false;
|
|
239
|
+
};
|
|
240
|
+
exports.handleCheckEmptyCardValue = handleCheckEmptyCardValue;
|
|
223
241
|
exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
224
242
|
// INFO: props.type is what the caller asked for; resolvedType is what THIS
|
|
225
243
|
// instance renders. They differ in exactly one case: readDrawer is on and the
|
|
@@ -230,10 +248,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
230
248
|
// Every read of the view type below uses resolvedType. The distinction matters
|
|
231
249
|
// most in effect dependency arrays — following props.type there would leave
|
|
232
250
|
// the list never refetching while the panel is open, which fails silently.
|
|
233
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105;
|
|
251
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68, _69, _70, _71, _72, _73, _74, _75, _76, _77, _78, _79, _80, _81, _82, _83, _84, _85, _86, _87, _88, _89, _90, _91, _92, _93, _94, _95, _96, _97, _98, _99, _100, _101, _102, _103, _104, _105, _106, _107, _108, _109, _110, _111;
|
|
234
252
|
// INFO: the panel cannot navigate its way out — handleNavigate("read") is
|
|
235
253
|
// routed straight back into it — so expand-to-full-page is local state.
|
|
236
|
-
var
|
|
254
|
+
var _112 = (0, react_1.useState)(false), drawerPageView = _112[0], setDrawerPageView = _112[1];
|
|
237
255
|
// INFO: the panel keeps rendering the record it was opened with rather than
|
|
238
256
|
// live props. Without this, navigating back to the list would re-render the
|
|
239
257
|
// still-mounted panel as a second list behind the overlay.
|
|
@@ -325,14 +343,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
325
343
|
initialFilterReferenceDate: initialFilterReferenceDate,
|
|
326
344
|
};
|
|
327
345
|
};
|
|
328
|
-
var
|
|
346
|
+
var _113 = intialiseDefaultFilterValues(), initialFilterSearch = _113.initialFilterSearch, initialFilterSearchParams = _113.initialFilterSearchParams, initialFilterSelection = _113.initialFilterSelection, initialFilterReference = _113.initialFilterReference, initialFilterReferenceDate = _113.initialFilterReferenceDate;
|
|
329
347
|
// INFO: Persist view state hook — handles storage read/write for filter/sort/column state
|
|
330
|
-
var
|
|
348
|
+
var _114 = (0, viewStatePersistence_1.usePersistedViewState)({
|
|
331
349
|
mode: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.persistViewState,
|
|
332
350
|
collectionId: props.collectionId,
|
|
333
351
|
persistKey: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey,
|
|
334
352
|
type: resolvedType,
|
|
335
|
-
}), rawPersistedState =
|
|
353
|
+
}), rawPersistedState = _114.persistedState, isPersistEnabled = _114.isEnabled, handleSaveView = _114.handleSaveView, handleRegisterViewSnapshot = _114.handleRegisterViewSnapshot;
|
|
336
354
|
// INFO: drop stored filters/sort on removed columns — they would empty the table
|
|
337
355
|
var persistedState = (0, react_1.useMemo)(function () {
|
|
338
356
|
var _a, _b, _c;
|
|
@@ -346,8 +364,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
346
364
|
(_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareFlexFilterReferences,
|
|
347
365
|
(_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareFlexFilterListObjects,
|
|
348
366
|
]);
|
|
349
|
-
var
|
|
350
|
-
var
|
|
367
|
+
var _115 = (0, react_1.useState)(false), loading = _115[0], setLoading = _115[1];
|
|
368
|
+
var _116 = (0, react_1.useState)(), notification = _116[0], setNotification = _116[1];
|
|
351
369
|
// INFO: a success toast is confirmation, not a decision — it clears itself so
|
|
352
370
|
// it never sits on the floating step bar; errors stay until dismissed
|
|
353
371
|
(0, react_1.useEffect)(function () {
|
|
@@ -357,73 +375,73 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
357
375
|
return function () { return clearTimeout(timer); };
|
|
358
376
|
}, [notification]);
|
|
359
377
|
//INFO : Used by List
|
|
360
|
-
var
|
|
361
|
-
var
|
|
362
|
-
var
|
|
363
|
-
var
|
|
364
|
-
var
|
|
365
|
-
var
|
|
366
|
-
var
|
|
378
|
+
var _117 = (0, react_1.useState)((_f = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _f !== void 0 ? _f : initialFilterSearch), filterSearch = _117[0], setFilterSearch = _117[1];
|
|
379
|
+
var _118 = (0, react_1.useState)((_g = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _g !== void 0 ? _g : initialFilterSearchParams), filterSearchParams = _118[0], setFilterSearchParams = _118[1];
|
|
380
|
+
var _119 = (0, react_1.useState)((_h = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _h !== void 0 ? _h : initialFilterSelection), filterSelection = _119[0], setFilterSelection = _119[1];
|
|
381
|
+
var _120 = (0, react_1.useState)((_j = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _j !== void 0 ? _j : initialFilterReference), filterReference = _120[0], setFilterReference = _120[1];
|
|
382
|
+
var _121 = (0, react_1.useState)({}), filterReferenceSearch = _121[0], setFilterReferenceSearch = _121[1];
|
|
383
|
+
var _122 = (0, react_1.useState)({}), filterReferenceList = _122[0], setFilterReferenceList = _122[1];
|
|
384
|
+
var _123 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
|
|
367
385
|
? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
|
|
368
|
-
: initialFilterReferenceDate), filterReferenceDate =
|
|
369
|
-
var
|
|
370
|
-
var
|
|
371
|
-
var
|
|
372
|
-
var
|
|
373
|
-
var
|
|
386
|
+
: initialFilterReferenceDate), filterReferenceDate = _123[0], setFilterReferenceDate = _123[1];
|
|
387
|
+
var _124 = (0, react_1.useState)(true), tableLoading = _124[0], setTableLoading = _124[1];
|
|
388
|
+
var _125 = (0, react_1.useState)(""), cursor = _125[0], setCursor = _125[1];
|
|
389
|
+
var _126 = (0, react_1.useState)(""), lastCursor = _126[0], setLastCursor = _126[1];
|
|
390
|
+
var _127 = (0, react_1.useState)([]), tableData = _127[0], setTableData = _127[1];
|
|
391
|
+
var _128 = (0, react_1.useState)([]), spaceTableData = _128[0], setSpaceTableData = _128[1];
|
|
374
392
|
// INFO: a save resolves after later renders, so it reads the table from here —
|
|
375
393
|
// the state it closed over can predate an earlier save on the same row
|
|
376
394
|
var tableDataRef = (0, react_1.useRef)([]);
|
|
377
395
|
var spaceTableDataRef = (0, react_1.useRef)([]);
|
|
378
396
|
tableDataRef.current = tableData;
|
|
379
397
|
spaceTableDataRef.current = spaceTableData;
|
|
380
|
-
var
|
|
381
|
-
var
|
|
382
|
-
var
|
|
383
|
-
var
|
|
384
|
-
var
|
|
385
|
-
var
|
|
386
|
-
var
|
|
398
|
+
var _129 = (0, react_1.useState)(0), size = _129[0], setSize = _129[1];
|
|
399
|
+
var _130 = (0, react_1.useState)((_m = (_k = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _k !== void 0 ? _k : (_l = props.organise) === null || _l === void 0 ? void 0 : _l.pageIndex) !== null && _m !== void 0 ? _m : 0), pageIndex = _130[0], setPageIndex = _130[1];
|
|
400
|
+
var _131 = (0, react_1.useState)([]), selectedIds = _131[0], setSelectedIds = _131[1];
|
|
401
|
+
var _132 = (0, react_1.useState)(false), selectAll = _132[0], setSelectAll = _132[1];
|
|
402
|
+
var _133 = (0, react_1.useState)(""), deletePasscode = _133[0], setDeletePasscode = _133[1];
|
|
403
|
+
var _134 = (0, react_1.useState)(""), deletePasscodeInput = _134[0], setDeletePasscodeInput = _134[1];
|
|
404
|
+
var _135 = (0, react_1.useState)(""), deleteFeedId = _135[0], setDeleteFeedId = _135[1];
|
|
387
405
|
//INFO : Used by List Organise
|
|
388
406
|
// INFO: Internal sort state that overrides props.organise?.sort when
|
|
389
407
|
// persistViewState is enabled and a persisted sort exists
|
|
390
|
-
var
|
|
391
|
-
var
|
|
392
|
-
var
|
|
393
|
-
var
|
|
408
|
+
var _136 = (0, react_1.useState)((_o = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _o !== void 0 ? _o : undefined), persistedSort = _136[0], setPersistedSort = _136[1];
|
|
409
|
+
var _137 = (0, react_1.useState)(false), filterDraft = _137[0], setFilterDraft = _137[1];
|
|
410
|
+
var _138 = (0, react_1.useState)(false), addTabModal = _138[0], setAddTabModal = _138[1];
|
|
411
|
+
var _139 = (0, react_1.useState)(-1), editTabIndex = _139[0], setEditTabIndex = _139[1];
|
|
394
412
|
//INFO : resolve the initial tab synchronously so the mount cond is already
|
|
395
413
|
// tab-scoped — an empty initial tab caused a second wasted list fetch
|
|
396
|
-
var
|
|
414
|
+
var _140 = (0, react_1.useState)(function () {
|
|
397
415
|
var _a, _b;
|
|
398
416
|
return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, resolvedType, props.collectionId, props.id, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.viewId);
|
|
399
|
-
}), selectedTab =
|
|
400
|
-
var
|
|
417
|
+
}), selectedTab = _140[0], setSelectedTab = _140[1];
|
|
418
|
+
var _141 = (0, react_1.useState)("dayGridMonth"), calendarView = _141[0], setCalendarView = _141[1];
|
|
401
419
|
// INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
|
|
402
420
|
// (calendarView above drives the matching range query)
|
|
403
|
-
var
|
|
404
|
-
var
|
|
421
|
+
var _142 = (0, react_1.useState)("month"), newCalendarViewMode = _142[0], setNewCalendarViewMode = _142[1];
|
|
422
|
+
var _143 = (0, react_1.useState)(new Date()), calendarTabMonth = _143[0], setCalendarTabMonth = _143[1];
|
|
405
423
|
// INFO: defaultViewSwitch picks the opening view only — the tab re-inits
|
|
406
424
|
// whenever its settings change, and that must not undo the user's switch
|
|
407
425
|
var calendarViewInitRef = (0, react_1.useRef)(false);
|
|
408
|
-
var
|
|
409
|
-
var
|
|
410
|
-
var
|
|
411
|
-
var
|
|
426
|
+
var _144 = (0, react_1.useState)(true), kanbanDroppable = _144[0], setKanbanDroppable = _144[1];
|
|
427
|
+
var _145 = (0, react_1.useState)([]), kanbanOptions = _145[0], setKanbanOptions = _145[1];
|
|
428
|
+
var _146 = (0, react_1.useState)(false), batchUpdateModal = _146[0], setBatchUpdateModal = _146[1];
|
|
429
|
+
var _147 = (0, react_1.useState)({
|
|
412
430
|
columnId: "",
|
|
413
431
|
columnData: {},
|
|
414
|
-
}), batchUpdateData =
|
|
432
|
+
}), batchUpdateData = _147[0], setBatchUpdateData = _147[1];
|
|
415
433
|
// INFO: system columns (created / updated at and by, record id, number)
|
|
416
434
|
// join the structure hidden; the ones a user shows are kept per view
|
|
417
435
|
var isSystemColumnsEnabled = !!((_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareSystemColumns);
|
|
418
436
|
var appendedSystemColumnIds = isSystemColumnsEnabled
|
|
419
437
|
? systemColumns_1.SYSTEM_COLUMN_IDS.filter(function (eachId) { var _a; return !((_a = props.model) !== null && _a !== void 0 ? _a : []).some(function (each) { return each.id === eachId; }); })
|
|
420
438
|
: [];
|
|
421
|
-
var
|
|
439
|
+
var _148 = (0, react_1.useState)((_q = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _q !== void 0 ? _q : []), shownSystemColumnIds = _148[0], setShownSystemColumnIds = _148[1];
|
|
422
440
|
var handleWithSystemColumns = function (model, shownIds) {
|
|
423
441
|
if (shownIds === void 0) { shownIds = shownSystemColumnIds; }
|
|
424
442
|
return isSystemColumnsEnabled ? (0, systemColumns_1.handleAppendSystemColumns)(model, shownIds) : model;
|
|
425
443
|
};
|
|
426
|
-
var
|
|
444
|
+
var _149 = (0, react_1.useState)(function () {
|
|
427
445
|
var _a;
|
|
428
446
|
var baseModel = handleWithSystemColumns((props === null || props === void 0 ? void 0 : props.model) || [], (_a = persistedState === null || persistedState === void 0 ? void 0 : persistedState.shownSystemColumnIds) !== null && _a !== void 0 ? _a : []);
|
|
429
447
|
if (!persistedState)
|
|
@@ -450,8 +468,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
450
468
|
});
|
|
451
469
|
}
|
|
452
470
|
return model;
|
|
453
|
-
}), structure =
|
|
454
|
-
var
|
|
471
|
+
}), structure = _149[0], setStructure = _149[1];
|
|
472
|
+
var _150 = (0, react_1.useState)(((_r = props === null || props === void 0 ? void 0 : props.organise) === null || _r === void 0 ? void 0 : _r.additionalQuery) || []), additionalQuery = _150[0], setAdditionalQuery = _150[1];
|
|
455
473
|
// INFO: State for user-configurable flex filters (Monday.com-style)
|
|
456
474
|
// INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
|
|
457
475
|
var defaultFlexFilterRow = [
|
|
@@ -462,9 +480,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
462
480
|
value: undefined,
|
|
463
481
|
},
|
|
464
482
|
];
|
|
465
|
-
var
|
|
483
|
+
var _151 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
466
484
|
? persistedState.flexFilters
|
|
467
|
-
: defaultFlexFilterRow), flexFilters =
|
|
485
|
+
: defaultFlexFilterRow), flexFilters = _151[0], setFlexFilters = _151[1];
|
|
468
486
|
// INFO: always-current mirror of flexFilters, read by the imperative apply/
|
|
469
487
|
// clear methods so chained calls in one tick aren't stale.
|
|
470
488
|
var flexFiltersRef = (0, react_1.useRef)(flexFilters);
|
|
@@ -477,76 +495,81 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
477
495
|
}, [flexFilters]);
|
|
478
496
|
// INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
|
|
479
497
|
// to prevent API calls on every keystroke when typing in value inputs
|
|
480
|
-
var
|
|
498
|
+
var _152 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
481
499
|
? persistedState.flexFilters
|
|
482
|
-
: defaultFlexFilterRow), flexFiltersDebounced =
|
|
500
|
+
: defaultFlexFilterRow), flexFiltersDebounced = _152[0], setFlexFiltersDebounced = _152[1];
|
|
483
501
|
// INFO: the filter rows of the export being set up — started from the
|
|
484
502
|
// list's own when the export opens, so changing them leaves the list as it is
|
|
485
|
-
var
|
|
486
|
-
var
|
|
487
|
-
var
|
|
488
|
-
var
|
|
489
|
-
var
|
|
503
|
+
var _153 = (0, react_1.useState)(defaultFlexFilterRow), exportFlexFilters = _153[0], setExportFlexFilters = _153[1];
|
|
504
|
+
var _154 = (0, react_1.useState)({}), flexFilterReferenceOptions = _154[0], setFlexFilterReferenceOptions = _154[1];
|
|
505
|
+
var _155 = (0, react_1.useState)({}), flexFilterReferenceSearch = _155[0], setFlexFilterReferenceSearch = _155[1];
|
|
506
|
+
var _156 = (0, react_1.useState)(false), flexFilterModalOpen = _156[0], setFlexFilterModalOpen = _156[1];
|
|
507
|
+
var _157 = (0, react_1.useState)(false), viewSettingsModalOpen = _157[0], setViewSettingsModalOpen = _157[1];
|
|
490
508
|
// INFO: Columns the end user chose to hide (bareSettings.bareViewSettings).
|
|
491
509
|
// Deliberately kept out of `structure`: the props-sync effect below resets
|
|
492
510
|
// structure to props.model whenever props change, which would wipe the
|
|
493
511
|
// choice, and the persist effect derives schema-level hiddenColumnIds from
|
|
494
512
|
// structure — writing user hides there would blur the two concepts.
|
|
495
|
-
var
|
|
496
|
-
var
|
|
497
|
-
var
|
|
498
|
-
var
|
|
513
|
+
var _158 = (0, react_1.useState)((_s = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _s !== void 0 ? _s : []), userHiddenColumnIds = _158[0], setUserHiddenColumnIds = _158[1];
|
|
514
|
+
var _159 = (0, react_1.useState)(""), columnSearch = _159[0], setColumnSearch = _159[1];
|
|
515
|
+
var _160 = (0, react_1.useState)([]), savedViews = _160[0], setSavedViews = _160[1];
|
|
516
|
+
var _161 = (0, react_1.useState)(null), activeSavedViewId = _161[0], setActiveSavedViewId = _161[1];
|
|
517
|
+
// INFO: the widths of the view on screen, by column id ("180px")
|
|
518
|
+
var _162 = (0, react_1.useState)(function () { var _a, _b, _c; return (_c = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) === null || _b === void 0 ? void 0 : _b.columnWidths) !== null && _c !== void 0 ? _c : {}; }), columnWidths = _162[0], setColumnWidths = _162[1];
|
|
519
|
+
// INFO: unsaved changes are kept only once the opening view is on screen,
|
|
520
|
+
// so the defaults drawn before it never overwrite a person's own
|
|
521
|
+
var _163 = (0, react_1.useState)(false), isViewDraftReady = _163[0], setIsViewDraftReady = _163[1];
|
|
499
522
|
// INFO: null while the name box is closed
|
|
500
|
-
var
|
|
501
|
-
var
|
|
502
|
-
var
|
|
523
|
+
var _164 = (0, react_1.useState)(null), savedViewName = _164[0], setSavedViewName = _164[1];
|
|
524
|
+
var _165 = (0, react_1.useState)(null), deletingSavedViewId = _165[0], setDeletingSavedViewId = _165[1];
|
|
525
|
+
var _166 = (0, react_1.useState)(null), draggingColumnId = _166[0], setDraggingColumnId = _166[1];
|
|
503
526
|
var columnRowRefs = (0, react_1.useRef)({});
|
|
504
527
|
//INFO : Used by Auth
|
|
505
|
-
var
|
|
528
|
+
var _167 = (0, react_1.useState)({
|
|
506
529
|
email: "",
|
|
507
530
|
google: "",
|
|
508
531
|
phone: "",
|
|
509
532
|
disabled: false,
|
|
510
533
|
create: false,
|
|
511
|
-
}), authMethods =
|
|
512
|
-
var
|
|
534
|
+
}), authMethods = _167[0], setAuthMethods = _167[1];
|
|
535
|
+
var _168 = (0, react_1.useState)(""), selectedAuthMethod = _168[0], setSelectedAuthMethod = _168[1];
|
|
513
536
|
// INFO: the sign-in check of a users datasheet's record is running; the
|
|
514
537
|
// panel shows a spinner rather than nothing, which read as "no login"
|
|
515
|
-
var
|
|
538
|
+
var _169 = (0, react_1.useState)(false), authLoading = _169[0], setAuthLoading = _169[1];
|
|
516
539
|
// INFO: a delete is running — the ref answers a second tap at once, before
|
|
517
540
|
// the state has rendered, and the state disables the confirm button
|
|
518
541
|
var deletingRef = (0, react_1.useRef)(false);
|
|
519
|
-
var
|
|
542
|
+
var _170 = (0, react_1.useState)(false), deleting = _170[0], setDeleting = _170[1];
|
|
520
543
|
// INFO: Used by Activity Log
|
|
521
|
-
var
|
|
522
|
-
var
|
|
544
|
+
var _171 = (0, react_1.useState)(false), activityModal = _171[0], setActivityModal = _171[1];
|
|
545
|
+
var _172 = (0, react_1.useState)(""), activityId = _172[0], setActivityId = _172[1];
|
|
523
546
|
//INFO : Used by Export
|
|
524
|
-
var
|
|
525
|
-
var
|
|
526
|
-
var
|
|
527
|
-
var
|
|
528
|
-
var
|
|
529
|
-
var
|
|
530
|
-
var
|
|
531
|
-
var
|
|
532
|
-
var
|
|
533
|
-
var
|
|
534
|
-
var
|
|
535
|
-
var
|
|
536
|
-
var
|
|
537
|
-
var
|
|
538
|
-
var
|
|
547
|
+
var _173 = (0, react_1.useState)(null), csvFile = _173[0], setCSVFile = _173[1];
|
|
548
|
+
var _174 = (0, react_1.useState)([]), csvFileData = _174[0], setCSVFileData = _174[1];
|
|
549
|
+
var _175 = (0, react_1.useState)(0), stepCSVIndex = _175[0], setStepCSVIndex = _175[1];
|
|
550
|
+
var _176 = (0, react_1.useState)({}), listCSVMapAttribute = _176[0], setListCSVMapAttribute = _176[1];
|
|
551
|
+
var _177 = (0, react_1.useState)({}), listCSVObjAttribute = _177[0], setListCSVObjAttribute = _177[1];
|
|
552
|
+
var _178 = (0, react_1.useState)([]), csvAPIAttribute = _178[0], setCSVAPIAttribute = _178[1];
|
|
553
|
+
var _179 = (0, react_1.useState)(((_t = props.devSettings.currentUser) === null || _t === void 0 ? void 0 : _t.userEmail) || ""), exportCSVEmail = _179[0], setExportCSVEmail = _179[1];
|
|
554
|
+
var _180 = (0, react_1.useState)(((_v = (_u = props.organise) === null || _u === void 0 ? void 0 : _u.exportSettings) === null || _v === void 0 ? void 0 : _v.defaultExportPDFName) || ""), exportPDFTitle = _180[0], setExportPDFTitle = _180[1];
|
|
555
|
+
var _181 = (0, react_1.useState)(false), exportPDFLoading = _181[0], setExportPDFLoading = _181[1];
|
|
556
|
+
var _182 = (0, react_1.useState)(false), exportReadPDFLoading = _182[0], setExportReadPDFLoading = _182[1];
|
|
557
|
+
var _183 = (0, react_1.useState)((_y = (_x = (_w = props.organise) === null || _w === void 0 ? void 0 : _w.exportSettings) === null || _x === void 0 ? void 0 : _x.sumColumnId) !== null && _y !== void 0 ? _y : []), exportSumAttributeIds = _183[0], setExportSumAttributeIds = _183[1];
|
|
558
|
+
var _184 = (0, react_1.useState)((_1 = (_0 = (_z = props.organise) === null || _z === void 0 ? void 0 : _z.exportSettings) === null || _0 === void 0 ? void 0 : _0.hideSubItems) !== null && _1 !== void 0 ? _1 : false), hideSubItems = _184[0], setHideSubItems = _184[1];
|
|
559
|
+
var _185 = (0, react_1.useState)([]), importTableData = _185[0], setImportTableData = _185[1];
|
|
560
|
+
var _186 = (0, react_1.useState)([]), queryList = _186[0], setQueryList = _186[1];
|
|
561
|
+
var _187 = (0, react_1.useState)(undefined), allQueryList = _187[0], setAllQueryList = _187[1];
|
|
539
562
|
// INFO: a restored state wins over the prop; its "" is a list the user
|
|
540
563
|
// ungrouped, so it opens ungrouped
|
|
541
|
-
var
|
|
564
|
+
var _188 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.groupBy) !== undefined
|
|
542
565
|
? persistedState.groupBy || undefined
|
|
543
|
-
: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.groupBy), groupId =
|
|
566
|
+
: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.groupBy), groupId = _188[0], setGroupId = _188[1];
|
|
544
567
|
// INFO: Monday-board per-group paging. Keyed by the group key that
|
|
545
568
|
// handleBuildNewTableGroups() produces (an option, Unknown or No Value).
|
|
546
569
|
// Each group tracks its own loaded cursor + total so it can lazily load its
|
|
547
570
|
// next page as the user scrolls inside that band, independent of every other
|
|
548
571
|
// group. Only used when renderCheckGroupPaging() is true.
|
|
549
|
-
var
|
|
572
|
+
var _189 = (0, react_1.useState)({}), groupPageState = _189[0], setGroupPageState = _189[1];
|
|
550
573
|
// INFO: read fresh inside the async per-group fetch so chained scroll fires
|
|
551
574
|
// in one tick do not re-fetch an already in-flight page.
|
|
552
575
|
var groupPageStateRef = (0, react_1.useRef)({});
|
|
@@ -555,59 +578,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
555
578
|
// list was re-read (new search, filter, sort or grouping) is dropped on
|
|
556
579
|
// arrival instead of appending rows that belong to the old list
|
|
557
580
|
var groupPagingGenRef = (0, react_1.useRef)(0);
|
|
558
|
-
var
|
|
559
|
-
var
|
|
581
|
+
var _190 = (0, react_1.useState)(""), readTabSection = _190[0], setReadTabSection = _190[1];
|
|
582
|
+
var _191 = (0, react_1.useState)(false), readFloatingNav = _191[0], setReadFloatingNav = _191[1];
|
|
560
583
|
var readTabSectionRefs = (0, react_1.useRef)({});
|
|
561
584
|
//INFO : Used by Read
|
|
562
585
|
//INFO : Used by Update
|
|
563
|
-
var
|
|
564
|
-
var
|
|
565
|
-
var
|
|
566
|
-
var
|
|
567
|
-
var
|
|
568
|
-
var
|
|
569
|
-
var
|
|
586
|
+
var _192 = (0, react_1.useState)(false), modalVisible = _192[0], setModalVisible = _192[1];
|
|
587
|
+
var _193 = (0, react_1.useState)(false), deleteModal = _193[0], setDeleteModal = _193[1];
|
|
588
|
+
var _194 = (0, react_1.useState)(false), excelModal = _194[0], setExcelModal = _194[1];
|
|
589
|
+
var _195 = (0, react_1.useState)(false), exportExcel = _195[0], setExportExcel = _195[1];
|
|
590
|
+
var _196 = (0, react_1.useState)(""), exportType = _196[0], setExportType = _196[1];
|
|
591
|
+
var _197 = (0, react_1.useState)(false), exportQR = _197[0], setExportQR = _197[1];
|
|
592
|
+
var _198 = (0, react_1.useState)(function () {
|
|
570
593
|
var _a, _b;
|
|
571
594
|
var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
|
|
572
595
|
return firstTabId;
|
|
573
|
-
}), activeTab =
|
|
574
|
-
var
|
|
575
|
-
var
|
|
576
|
-
var
|
|
577
|
-
var
|
|
578
|
-
var
|
|
579
|
-
var
|
|
580
|
-
var
|
|
596
|
+
}), activeTab = _198[0], setActiveTab = _198[1];
|
|
597
|
+
var _199 = (0, react_1.useState)(false), signatureSigning = _199[0], setSignatureSigning = _199[1];
|
|
598
|
+
var _200 = (0, react_1.useState)({}), selectedData = _200[0], setSelectedData = _200[1];
|
|
599
|
+
var _201 = (0, react_1.useState)(""), selectedObjectStructureId = _201[0], setSelectedObjectStructureId = _201[1];
|
|
600
|
+
var _202 = (0, react_1.useState)(""), selectedObjectId = _202[0], setSelectedObjectId = _202[1];
|
|
601
|
+
var _203 = (0, react_1.useState)(""), selectedListAddressId = _203[0], setSelectedListAddressId = _203[1];
|
|
602
|
+
var _204 = (0, react_1.useState)(-1), selectedListAddressIndex = _204[0], setSelectedListAddressIndex = _204[1];
|
|
603
|
+
var _205 = (0, react_1.useState)({
|
|
581
604
|
lat: 0,
|
|
582
605
|
lng: 0,
|
|
583
606
|
name: "",
|
|
584
|
-
}), selectedListAddress =
|
|
585
|
-
var
|
|
586
|
-
var
|
|
587
|
-
var
|
|
588
|
-
var
|
|
589
|
-
var
|
|
590
|
-
var
|
|
591
|
-
var
|
|
592
|
-
var
|
|
593
|
-
var
|
|
594
|
-
var
|
|
607
|
+
}), selectedListAddress = _205[0], setSelectedListAddress = _205[1];
|
|
608
|
+
var _206 = (0, react_1.useState)({}), selectedObjectData = _206[0], setSelectedObjectData = _206[1];
|
|
609
|
+
var _207 = (0, react_1.useState)(null), objectCellEdit = _207[0], setObjectCellEdit = _207[1];
|
|
610
|
+
var _208 = (0, react_1.useState)(false), referenceLoading = _208[0], setReferenceLoading = _208[1];
|
|
611
|
+
var _209 = (0, react_1.useState)({}), referencesOptions = _209[0], setReferencesOptions = _209[1];
|
|
612
|
+
var _210 = (0, react_1.useState)({}), referencesDetails = _210[0], setReferencesDetails = _210[1];
|
|
613
|
+
var _211 = (0, react_1.useState)({}), listReferencesOptions = _211[0], setListReferencesOptions = _211[1];
|
|
614
|
+
var _212 = (0, react_1.useState)({}), referenceDeleteTableData = _212[0], setReferenceDeleteTableData = _212[1];
|
|
615
|
+
var _213 = (0, react_1.useState)([]), relatedSections = _213[0], setRelatedSections = _213[1];
|
|
616
|
+
var _214 = (0, react_1.useState)(0), referenceDeleteIndex = _214[0], setReferenceDeleteIndex = _214[1];
|
|
617
|
+
var _215 = (0, react_1.useState)({
|
|
595
618
|
id: "",
|
|
596
619
|
name: "",
|
|
597
620
|
type: "string",
|
|
598
|
-
}), referenceCreationModal =
|
|
599
|
-
var
|
|
600
|
-
var
|
|
621
|
+
}), referenceCreationModal = _215[0], setReferenceCreationModal = _215[1];
|
|
622
|
+
var _216 = (0, react_1.useState)({}), referenceModelSchema = _216[0], setReferenceSchema = _216[1];
|
|
623
|
+
var _217 = (0, react_1.useState)([]), kanbanChecked = _217[0], setKanbanChecked = _217[1];
|
|
601
624
|
//INFO : Offline
|
|
602
|
-
var
|
|
603
|
-
var
|
|
625
|
+
var _218 = (0, react_1.useState)(0), offlineDataLength = _218[0], setOfflineDataLength = _218[1];
|
|
626
|
+
var _219 = (0, react_1.useState)(false), offlineModal = _219[0], setOfflineModal = _219[1];
|
|
604
627
|
// INFO: live-stream state — driven by socket connection and navigator.onLine
|
|
605
|
-
var
|
|
606
|
-
var
|
|
628
|
+
var _220 = (0, react_1.useState)(false), isLive = _220[0], setIsLive = _220[1];
|
|
629
|
+
var _221 = (0, react_1.useState)(false), isLiveOffline = _221[0], setIsLiveOffline = _221[1];
|
|
607
630
|
// INFO: true when navigator is offline — used to switch ReadQueryHoc between
|
|
608
631
|
// server reads (online, full pagination) and IndexedDB reads (offline, cached data).
|
|
609
632
|
// Independent of SSE status so it works even when bareSocketName is not set.
|
|
610
|
-
var
|
|
633
|
+
var _222 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _222[0], setIsNetworkOffline = _222[1];
|
|
611
634
|
var previousType = (0, react_1.useRef)(null);
|
|
612
635
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
613
636
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
@@ -827,7 +850,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
827
850
|
var isSchemaHideMode = ((_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.onChangeHide) ? true : false;
|
|
828
851
|
// INFO: rows per page is a view setting the user can change, so it starts from
|
|
829
852
|
// the persisted value and falls back to the consumer's limit
|
|
830
|
-
var
|
|
853
|
+
var _223 = (0, react_1.useState)((_16 = (_15 = (isPersistEnabled ? persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageLimit : undefined)) !== null && _15 !== void 0 ? _15 : props.limit) !== null && _16 !== void 0 ? _16 : 10), pageLimit = _223[0], setPageLimit = _223[1];
|
|
831
854
|
var limit = pageLimit;
|
|
832
855
|
var isSavedViewsEnabled = !!((_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.savedViews) && resolvedType === "list";
|
|
833
856
|
// INFO: an app that stores views takes over from this browser's storage, so
|
|
@@ -931,7 +954,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
931
954
|
displayRows: filtered.map(function (eachEntry) { return eachEntry.displayRow; }),
|
|
932
955
|
};
|
|
933
956
|
};
|
|
934
|
-
var
|
|
957
|
+
var _224 = (0, permissions_1.handleResolveDataTemplateWritePermissions)(props.edit), canUpdateRecord = _224.canUpdateRecord, canInlineUpdate = _224.canInlineUpdate, canBatchUpdate = _224.canBatchUpdate, canDeleteRecord = _224.canDeleteRecord;
|
|
935
958
|
var isEditor = ((_27 = props.edit) === null || _27 === void 0 ? void 0 : _27.allEditable) ? true : false;
|
|
936
959
|
var isOffline = (_28 = props.bareSettings) === null || _28 === void 0 ? void 0 : _28.bareOffline;
|
|
937
960
|
// INFO: when bareOfflineNetworkAware is true, the save path is also gated on
|
|
@@ -1454,7 +1477,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1454
1477
|
// INFO: scroll mode reloads from page 0; the anchor restores the position
|
|
1455
1478
|
pageIndex: renderCheckScrollMode() ? 0 : pageIndex, hiddenColumnIds: structure.filter(function (col) { return col.hide; }).map(function (col) { return col.id; }),
|
|
1456
1479
|
// INFO: raw, so switching bareViewSettings off does not wipe the user's choice
|
|
1457
|
-
userHiddenColumnIds: userHiddenColumnIds, shownSystemColumnIds: shownSystemColumnIds, columnOrder: structure.map(function (col) { return col.id; }), groupBy: groupId !== null && groupId !== void 0 ? groupId : "" }, scrollCaptureRef.current));
|
|
1480
|
+
userHiddenColumnIds: userHiddenColumnIds, shownSystemColumnIds: shownSystemColumnIds, columnOrder: structure.map(function (col) { return col.id; }), columnWidths: columnWidths, groupBy: groupId !== null && groupId !== void 0 ? groupId : "" }, scrollCaptureRef.current));
|
|
1458
1481
|
};
|
|
1459
1482
|
handleRegisterViewSnapshot(handleBuildViewSnapshot);
|
|
1460
1483
|
//=====================================================================================
|
|
@@ -1465,6 +1488,35 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1465
1488
|
if (isSavedViewsEnabled && !isAppViews)
|
|
1466
1489
|
setSavedViews((0, viewStatePersistence_1.handleReadSavedViews)(savedViewsKey));
|
|
1467
1490
|
}, [isSavedViewsEnabled, isAppViews, savedViewsKey]);
|
|
1491
|
+
// INFO: the app keeps All's settings, so every change is kept in this
|
|
1492
|
+
// browser until the person updates the view for everyone or resets it
|
|
1493
|
+
var isViewDraftsEnabled = isSavedViewsEnabled && ((_71 = props.organise) === null || _71 === void 0 ? void 0 : _71.allView) !== undefined;
|
|
1494
|
+
var handleGetViewDraftKey = function (viewId) {
|
|
1495
|
+
var _a, _b;
|
|
1496
|
+
return (0, viewStatePersistence_1.buildViewDraftKey)(props.collectionId, viewId !== null && viewId !== void 0 ? viewId : "all", (_a = props.organise) === null || _a === void 0 ? void 0 : _a.persistKey, (_b = devSettings.currentUser) === null || _b === void 0 ? void 0 : _b.userEmail);
|
|
1497
|
+
};
|
|
1498
|
+
var handleGetStoredViewState = function (view) { var _a, _b; return view ? view.state : ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) !== null && _b !== void 0 ? _b : null); };
|
|
1499
|
+
// INFO: compared in a shape both sides share — a stored order is kept to
|
|
1500
|
+
// the columns that still exist, with new ones after in model order, and
|
|
1501
|
+
// hides only count where a view can apply them (schema-hide mode)
|
|
1502
|
+
var handleIsOnViewState = function (current, stored) {
|
|
1503
|
+
var _a;
|
|
1504
|
+
var modelIds = ((_a = props.model) !== null && _a !== void 0 ? _a : []).map(function (eachColumn) { return eachColumn.id; });
|
|
1505
|
+
var handleComparable = function (state) {
|
|
1506
|
+
var _a;
|
|
1507
|
+
var kept = ((_a = state.columnOrder) !== null && _a !== void 0 ? _a : []).filter(function (eachId) {
|
|
1508
|
+
return modelIds.includes(eachId);
|
|
1509
|
+
});
|
|
1510
|
+
return __assign(__assign({}, state), { columnOrder: __spreadArray(__spreadArray([], kept, true), modelIds.filter(function (eachId) { return !kept.includes(eachId); }), true), hiddenColumnIds: isSchemaHideMode ? state.hiddenColumnIds : undefined });
|
|
1511
|
+
};
|
|
1512
|
+
return (0, viewStatePersistence_1.handleIsSameViewState)(handleComparable((0, viewStatePersistence_1.handlePickViewState)(current)), handleComparable((0, viewStatePersistence_1.handlePickViewState)(handleResolveViewState(stored))));
|
|
1513
|
+
};
|
|
1514
|
+
var handleResizeColumn = function (columnId, pixels) {
|
|
1515
|
+
return setColumnWidths(function (previous) {
|
|
1516
|
+
var _a;
|
|
1517
|
+
return (__assign(__assign({}, previous), (_a = {}, _a[columnId] = (0, columnWidth_1.handleFormatColumnWidth)(pixels), _a)));
|
|
1518
|
+
});
|
|
1519
|
+
};
|
|
1468
1520
|
// INFO: views belong to a tab, so another tab starts with none selected
|
|
1469
1521
|
(0, react_1.useEffect)(function () {
|
|
1470
1522
|
setActiveSavedViewId(null);
|
|
@@ -1515,7 +1567,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1515
1567
|
var lastSentSharedViewsRef = (0, react_1.useRef)(null);
|
|
1516
1568
|
(0, react_1.useEffect)(function () {
|
|
1517
1569
|
lastSentSharedViewsRef.current = null;
|
|
1518
|
-
}, [(
|
|
1570
|
+
}, [(_72 = props.organise) === null || _72 === void 0 ? void 0 : _72.sharedViews]);
|
|
1519
1571
|
var handleStoreSharedViews = function (update) {
|
|
1520
1572
|
var _a, _b, _c;
|
|
1521
1573
|
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSharedViews))
|
|
@@ -1536,28 +1588,37 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1536
1588
|
return;
|
|
1537
1589
|
if (activeSavedViewId !== null || (isPersistEnabled && rawPersistedState)) {
|
|
1538
1590
|
openingViewSettledRef.current = true;
|
|
1591
|
+
setIsViewDraftReady(true);
|
|
1539
1592
|
return;
|
|
1540
1593
|
}
|
|
1541
1594
|
var wantedId = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.initialSavedViewId) !== null && _b !== void 0 ? _b : (_c = props.organise) === null || _c === void 0 ? void 0 : _c.defaultSavedViewId;
|
|
1542
|
-
if (!wantedId)
|
|
1595
|
+
if (!wantedId) {
|
|
1596
|
+
// INFO: All opens with its stored settings and this person's changes
|
|
1597
|
+
if (isViewDraftsEnabled) {
|
|
1598
|
+
openingViewSettledRef.current = true;
|
|
1599
|
+
handleApplySavedView(null, true);
|
|
1600
|
+
setIsViewDraftReady(true);
|
|
1601
|
+
}
|
|
1543
1602
|
return;
|
|
1603
|
+
}
|
|
1544
1604
|
// INFO: the app's views may still be loading
|
|
1545
1605
|
if (isAppViews && ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.sharedViews) === undefined)
|
|
1546
1606
|
return;
|
|
1547
1607
|
openingViewSettledRef.current = true;
|
|
1548
1608
|
var view = handleGetTabSavedViews().find(function (eachView) { return eachView.id === wantedId; });
|
|
1549
|
-
if (view)
|
|
1550
|
-
handleApplySavedView(view, true);
|
|
1609
|
+
if (view || isViewDraftsEnabled)
|
|
1610
|
+
handleApplySavedView(view !== null && view !== void 0 ? view : null, true);
|
|
1611
|
+
setIsViewDraftReady(true);
|
|
1551
1612
|
/* eslint-disable */
|
|
1552
1613
|
}, [
|
|
1553
1614
|
isSavedViewsEnabled,
|
|
1554
|
-
(
|
|
1555
|
-
(
|
|
1556
|
-
(
|
|
1615
|
+
(_73 = props.organise) === null || _73 === void 0 ? void 0 : _73.initialSavedViewId,
|
|
1616
|
+
(_74 = props.organise) === null || _74 === void 0 ? void 0 : _74.defaultSavedViewId,
|
|
1617
|
+
(_75 = props.organise) === null || _75 === void 0 ? void 0 : _75.sharedViews,
|
|
1557
1618
|
savedViews,
|
|
1558
1619
|
]);
|
|
1559
1620
|
/* eslint-enable */
|
|
1560
|
-
var defaultSavedViewIds = ((
|
|
1621
|
+
var defaultSavedViewIds = ((_77 = (_76 = props.organise) === null || _76 === void 0 ? void 0 : _76.defaultSavedViews) !== null && _77 !== void 0 ? _77 : [])
|
|
1561
1622
|
.map(function (eachView) { var _a; return (_a = eachView.id) !== null && _a !== void 0 ? _a : ""; })
|
|
1562
1623
|
.join("|");
|
|
1563
1624
|
// INFO: keyed on the ids, not the array, so an inline literal passed on every
|
|
@@ -1571,11 +1632,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1571
1632
|
// INFO: a view is the defaults overridden by its own fields, so a field it
|
|
1572
1633
|
// leaves out is reset rather than carried over from whatever was on screen
|
|
1573
1634
|
var handleResolveViewState = function (state) {
|
|
1574
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1635
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1575
1636
|
var model = (_a = props.model) !== null && _a !== void 0 ? _a : [];
|
|
1576
|
-
return ((
|
|
1637
|
+
return ((_j = (0, viewStatePersistence_1.handlePruneStaleColumns)(__assign({ filterSearchParams: initialFilterSearchParams, filterSelection: initialFilterSelection, filterReference: initialFilterReference, filterReferenceDate: (0, viewStatePersistence_1.serializeDateFilterState)(initialFilterReferenceDate), sort: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.sort, pageLimit: (_c = props.limit) !== null && _c !== void 0 ? _c : 10, userHiddenColumnIds: [], shownSystemColumnIds: [], hiddenColumnIds: model
|
|
1577
1638
|
.filter(function (eachColumn) { return eachColumn.hide; })
|
|
1578
|
-
.map(function (eachColumn) { return eachColumn.id; }), columnOrder: model.map(function (eachColumn) { return eachColumn.id; }),
|
|
1639
|
+
.map(function (eachColumn) { return eachColumn.id; }), columnOrder: model.map(function (eachColumn) { return eachColumn.id; }),
|
|
1640
|
+
// INFO: a saved view without its own widths follows All's
|
|
1641
|
+
columnWidths: (_f = (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.allView) === null || _e === void 0 ? void 0 : _e.columnWidths) !== null && _f !== void 0 ? _f : {}, groupBy: (_h = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.groupBy) !== null && _h !== void 0 ? _h : "" }, (state !== null && state !== void 0 ? state : {})), model, (0, flexFilter_1.handleBuildFlexFilterStructure)(model, flexFilterExtras))) !== null && _j !== void 0 ? _j : {});
|
|
1579
1642
|
};
|
|
1580
1643
|
var handleApplyViewColumns = function (columns, state) {
|
|
1581
1644
|
var _a, _b;
|
|
@@ -1625,32 +1688,36 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1625
1688
|
// so its sort is not handed back (a host saving sort would write it on
|
|
1626
1689
|
// every open)
|
|
1627
1690
|
var handleApplySavedView = function (view, isOpening) {
|
|
1628
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
1629
|
-
|
|
1691
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
1692
|
+
// INFO: the stored view, or this person's unsaved changes to it
|
|
1693
|
+
var next = handleResolveViewState((_b = (isViewDraftsEnabled
|
|
1694
|
+
? (0, viewStatePersistence_1.handleReadViewDraft)(handleGetViewDraftKey((_a = view === null || view === void 0 ? void 0 : view.id) !== null && _a !== void 0 ? _a : null))
|
|
1695
|
+
: null)) !== null && _b !== void 0 ? _b : handleGetStoredViewState(view));
|
|
1630
1696
|
var isQueryChanged = !(0, viewStatePersistence_1.handleIsSameViewState)((0, viewStatePersistence_1.handlePickQueryState)(handleBuildViewSnapshot()), (0, viewStatePersistence_1.handlePickQueryState)(next));
|
|
1631
1697
|
handleClearFlexFilterTypingTimeout();
|
|
1632
1698
|
if (typingTimeout.current) {
|
|
1633
1699
|
clearTimeout(typingTimeout.current);
|
|
1634
1700
|
typingTimeout.current = null;
|
|
1635
1701
|
}
|
|
1636
|
-
setFilterSearch((
|
|
1637
|
-
setFilterSearchParams((
|
|
1638
|
-
setFilterSelection(((
|
|
1639
|
-
setFilterReference(((
|
|
1702
|
+
setFilterSearch((_c = next.filterSearchParams) !== null && _c !== void 0 ? _c : {});
|
|
1703
|
+
setFilterSearchParams((_d = next.filterSearchParams) !== null && _d !== void 0 ? _d : {});
|
|
1704
|
+
setFilterSelection(((_e = next.filterSelection) !== null && _e !== void 0 ? _e : {}));
|
|
1705
|
+
setFilterReference(((_f = next.filterReference) !== null && _f !== void 0 ? _f : {}));
|
|
1640
1706
|
setFilterReferenceDate(next.filterReferenceDate
|
|
1641
1707
|
? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
|
|
1642
1708
|
: initialFilterReferenceDate);
|
|
1643
|
-
handleCommitFlexFilters(((
|
|
1709
|
+
handleCommitFlexFilters(((_g = next.flexFilters) === null || _g === void 0 ? void 0 : _g.length) ? next.flexFilters : defaultFlexFilterRow);
|
|
1644
1710
|
setPersistedSort(next.sort);
|
|
1645
1711
|
if (!isOpening &&
|
|
1646
1712
|
next.sort &&
|
|
1647
1713
|
!(0, viewStatePersistence_1.handleIsSameViewState)(next.sort, activeSortId !== null && activeSortId !== void 0 ? activeSortId : {}))
|
|
1648
|
-
(
|
|
1714
|
+
(_j = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.onChangeSort) === null || _j === void 0 ? void 0 : _j.call(_h, next.sort);
|
|
1649
1715
|
if (next.pageLimit)
|
|
1650
1716
|
setPageLimit(next.pageLimit);
|
|
1651
|
-
handleChangeGroupBy((
|
|
1652
|
-
setUserHiddenColumnIds((
|
|
1653
|
-
setShownSystemColumnIds((
|
|
1717
|
+
handleChangeGroupBy((_k = next.groupBy) !== null && _k !== void 0 ? _k : "", !isOpening);
|
|
1718
|
+
setUserHiddenColumnIds((_l = next.userHiddenColumnIds) !== null && _l !== void 0 ? _l : []);
|
|
1719
|
+
setShownSystemColumnIds((_m = next.shownSystemColumnIds) !== null && _m !== void 0 ? _m : []);
|
|
1720
|
+
setColumnWidths((_o = next.columnWidths) !== null && _o !== void 0 ? _o : {});
|
|
1654
1721
|
if (view) {
|
|
1655
1722
|
if (!schemaStructureRef.current)
|
|
1656
1723
|
schemaStructureRef.current = structure;
|
|
@@ -1665,12 +1732,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1665
1732
|
pendingViewCondKeyRef.current = JSON.stringify(handleReadQueryHocCond());
|
|
1666
1733
|
handleClearDataByFilter();
|
|
1667
1734
|
if (pageIndex !== 0)
|
|
1668
|
-
(
|
|
1669
|
-
(
|
|
1735
|
+
(_q = (_p = props.organise) === null || _p === void 0 ? void 0 : _p.onChangePagination) === null || _q === void 0 ? void 0 : _q.call(_p, 0);
|
|
1736
|
+
(_s = (_r = props.bareSettings) === null || _r === void 0 ? void 0 : _r.bareListHandleFilter) === null || _s === void 0 ? void 0 : _s.call(_r, (_t = next.filterSearchParams) !== null && _t !== void 0 ? _t : {}, (_u = next.filterSelection) !== null && _u !== void 0 ? _u : {}, next.filterReferenceDate
|
|
1670
1737
|
? (0, viewStatePersistence_1.parseDateFilterState)(next.filterReferenceDate)
|
|
1671
|
-
: initialFilterReferenceDate, (
|
|
1738
|
+
: initialFilterReferenceDate, (_v = next.filterReference) !== null && _v !== void 0 ? _v : {});
|
|
1672
1739
|
}
|
|
1673
|
-
setActiveSavedViewId((
|
|
1740
|
+
setActiveSavedViewId((_w = view === null || view === void 0 ? void 0 : view.id) !== null && _w !== void 0 ? _w : null);
|
|
1674
1741
|
setDeletingSavedViewId(null);
|
|
1675
1742
|
};
|
|
1676
1743
|
// INFO: re-read storage before each write so a change made in another browser
|
|
@@ -1723,6 +1790,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1723
1790
|
};
|
|
1724
1791
|
var handleUpdateSavedView = function (id) {
|
|
1725
1792
|
var state = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
|
|
1793
|
+
if (isViewDraftsEnabled)
|
|
1794
|
+
(0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(id), null);
|
|
1726
1795
|
if (isAppViews) {
|
|
1727
1796
|
handleStoreSharedViews(function (views) {
|
|
1728
1797
|
return views.map(function (eachView) {
|
|
@@ -1819,6 +1888,59 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1819
1888
|
pageLimit,
|
|
1820
1889
|
]);
|
|
1821
1890
|
/* eslint-enable */
|
|
1891
|
+
// INFO: a view's settings that differ from what is stored for it are this
|
|
1892
|
+
// person's own until they update or reset it; back on the stored settings,
|
|
1893
|
+
// nothing is kept
|
|
1894
|
+
(0, react_1.useEffect)(function () {
|
|
1895
|
+
if (!isViewDraftsEnabled || !isViewDraftReady)
|
|
1896
|
+
return;
|
|
1897
|
+
var activeView = activeSavedViewId
|
|
1898
|
+
? handleGetTabSavedViews().find(function (eachView) { return eachView.id === activeSavedViewId; })
|
|
1899
|
+
: null;
|
|
1900
|
+
// INFO: the view was deleted or belongs to another tab
|
|
1901
|
+
if (activeSavedViewId && !activeView)
|
|
1902
|
+
return;
|
|
1903
|
+
var current = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
|
|
1904
|
+
var stored = handleGetStoredViewState(activeView);
|
|
1905
|
+
(0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(activeSavedViewId), handleIsOnViewState(current, stored) ? null : current);
|
|
1906
|
+
/* eslint-disable */
|
|
1907
|
+
}, [
|
|
1908
|
+
isViewDraftsEnabled,
|
|
1909
|
+
isViewDraftReady,
|
|
1910
|
+
activeSavedViewId,
|
|
1911
|
+
filterSearchParams,
|
|
1912
|
+
filterSelection,
|
|
1913
|
+
filterReference,
|
|
1914
|
+
filterReferenceDate,
|
|
1915
|
+
flexFiltersDebounced,
|
|
1916
|
+
structure,
|
|
1917
|
+
persistedSort,
|
|
1918
|
+
userHiddenColumnIds,
|
|
1919
|
+
shownSystemColumnIds,
|
|
1920
|
+
pageLimit,
|
|
1921
|
+
groupId,
|
|
1922
|
+
columnWidths,
|
|
1923
|
+
(_78 = props.organise) === null || _78 === void 0 ? void 0 : _78.allView,
|
|
1924
|
+
(_79 = props.organise) === null || _79 === void 0 ? void 0 : _79.sharedViews,
|
|
1925
|
+
savedViews,
|
|
1926
|
+
]);
|
|
1927
|
+
/* eslint-enable */
|
|
1928
|
+
// INFO: All's settings on screen become All's for everyone
|
|
1929
|
+
var handleUpdateAllView = function () {
|
|
1930
|
+
var _a;
|
|
1931
|
+
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeAllView))
|
|
1932
|
+
return;
|
|
1933
|
+
props.organise.onChangeAllView((0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot()));
|
|
1934
|
+
(0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(null), null);
|
|
1935
|
+
};
|
|
1936
|
+
// INFO: this person's changes are dropped and the stored view shown again
|
|
1937
|
+
var handleResetView = function () {
|
|
1938
|
+
var activeView = activeSavedViewId
|
|
1939
|
+
? handleGetTabSavedViews().find(function (eachView) { return eachView.id === activeSavedViewId; })
|
|
1940
|
+
: null;
|
|
1941
|
+
(0, viewStatePersistence_1.handleWriteViewDraft)(handleGetViewDraftKey(activeSavedViewId), null);
|
|
1942
|
+
handleApplySavedView(activeView !== null && activeView !== void 0 ? activeView : null);
|
|
1943
|
+
};
|
|
1822
1944
|
// INFO: re-arm on leaving the list, so each return from a record restores once
|
|
1823
1945
|
(0, react_1.useEffect)(function () {
|
|
1824
1946
|
if (props.type !== "list")
|
|
@@ -1839,7 +1961,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1839
1961
|
var isOtherListReturn = !(0, viewStatePersistence_1.handleIsLastDrill)(props.collectionId, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.persistKey);
|
|
1840
1962
|
scrollRestoredRef.current = isSwitch || isOtherListReturn;
|
|
1841
1963
|
/* eslint-disable */
|
|
1842
|
-
}, [props.collectionId, (
|
|
1964
|
+
}, [props.collectionId, (_80 = props.organise) === null || _80 === void 0 ? void 0 : _80.persistKey]);
|
|
1843
1965
|
/* eslint-enable */
|
|
1844
1966
|
// INFO: wait a frame — rows land in state one tick before layout
|
|
1845
1967
|
(0, react_1.useEffect)(function () {
|
|
@@ -1874,7 +1996,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1874
1996
|
(0, react_1.useEffect)(function () {
|
|
1875
1997
|
handleOfflinePrefetch();
|
|
1876
1998
|
/* eslint-disable */
|
|
1877
|
-
}, [props.collectionId, (
|
|
1999
|
+
}, [props.collectionId, (_81 = props.bareSettings) === null || _81 === void 0 ? void 0 : _81.bareOffline]);
|
|
1878
2000
|
/* eslint-enable */
|
|
1879
2001
|
// INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
|
|
1880
2002
|
// Calls through handleRefreshRef so the interval always dispatches the latest
|
|
@@ -1894,7 +2016,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1894
2016
|
}, interval);
|
|
1895
2017
|
return function () { return clearInterval(timer); };
|
|
1896
2018
|
/* eslint-disable */
|
|
1897
|
-
}, [(
|
|
2019
|
+
}, [(_82 = props.bareSettings) === null || _82 === void 0 ? void 0 : _82.barePollingInterval, isLive, isNetworkOffline]);
|
|
1898
2020
|
/* eslint-enable */
|
|
1899
2021
|
// INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
|
|
1900
2022
|
// EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
|
|
@@ -1936,7 +2058,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1936
2058
|
};
|
|
1937
2059
|
/* eslint-disable */
|
|
1938
2060
|
}, [
|
|
1939
|
-
(
|
|
2061
|
+
(_83 = props.bareSettings) === null || _83 === void 0 ? void 0 : _83.bareSocketName,
|
|
1940
2062
|
props.collectionId,
|
|
1941
2063
|
props.devSettings.sseEndpoint,
|
|
1942
2064
|
props.devSettings.dbAPIToken,
|
|
@@ -2059,7 +2181,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2059
2181
|
previousType.current = resolvedType;
|
|
2060
2182
|
}, [resolvedType, props.id]);
|
|
2061
2183
|
(0, react_1.useEffect)(function () {
|
|
2062
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
2184
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
2063
2185
|
var handleInitTab = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
2064
2186
|
var currentTab, defaultViewSwitch, kanbanSettings, kanbanTitle_1, kanbanRefRQ_1, kanbanRefOption_1, kanbanRefLabel_1, kanbanRefQuery;
|
|
2065
2187
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
@@ -2152,25 +2274,39 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2152
2274
|
// restored column visibility/order from localStorage
|
|
2153
2275
|
var isRestoringView = isPersistEnabled && !!persistedState && !persistedViewMountedRef.current;
|
|
2154
2276
|
if (!isRestoringView) {
|
|
2155
|
-
|
|
2277
|
+
// INFO: with a view's changes kept per person, the columns on screen
|
|
2278
|
+
// keep their order and hides when the model is handed in again
|
|
2279
|
+
setStructure(function (previous) {
|
|
2280
|
+
var _a, _b;
|
|
2281
|
+
return isViewDraftsEnabled
|
|
2282
|
+
? handleApplyViewColumns(handleWithSystemColumns((_a = props.model) !== null && _a !== void 0 ? _a : []), {
|
|
2283
|
+
columnOrder: previous.map(function (eachColumn) { return eachColumn.id; }),
|
|
2284
|
+
hiddenColumnIds: previous
|
|
2285
|
+
.filter(function (eachColumn) { return eachColumn.hide; })
|
|
2286
|
+
.map(function (eachColumn) { return eachColumn.id; }),
|
|
2287
|
+
shownSystemColumnIds: shownSystemColumnIds,
|
|
2288
|
+
})
|
|
2289
|
+
: handleWithSystemColumns((_b = props.model) !== null && _b !== void 0 ? _b : []);
|
|
2290
|
+
});
|
|
2156
2291
|
schemaStructureRef.current = null;
|
|
2157
2292
|
}
|
|
2158
2293
|
persistedViewMountedRef.current = true;
|
|
2159
|
-
setAdditionalQuery((
|
|
2294
|
+
setAdditionalQuery((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) !== null && _b !== void 0 ? _b : []);
|
|
2160
2295
|
// INFO: the restored grouping is set at mount; a later change of the
|
|
2161
2296
|
// host's groupBy still applies
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2297
|
+
// INFO: with views kept per person, the view applied sets the grouping
|
|
2298
|
+
if (!isRestoringView && !isViewDraftsEnabled)
|
|
2299
|
+
setGroupId((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.groupBy) !== null && _d !== void 0 ? _d : "");
|
|
2300
|
+
setExportPDFTitle((_g = (_f = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.exportSettings) === null || _f === void 0 ? void 0 : _f.defaultExportPDFName) !== null && _g !== void 0 ? _g : "");
|
|
2165
2301
|
var currentTabProps = {
|
|
2166
2302
|
id: props.id,
|
|
2167
2303
|
collectionId: props.collectionId,
|
|
2168
2304
|
model: props.model,
|
|
2169
2305
|
localURLEndpoint: props.localURLEndpoint,
|
|
2170
|
-
extendedTabs: (
|
|
2171
|
-
viewId: (
|
|
2172
|
-
additionalQuery: (
|
|
2173
|
-
groupBy: (
|
|
2306
|
+
extendedTabs: (_h = props.organise) === null || _h === void 0 ? void 0 : _h.extendedTabs,
|
|
2307
|
+
viewId: (_j = props.organise) === null || _j === void 0 ? void 0 : _j.viewId,
|
|
2308
|
+
additionalQuery: (_k = props.organise) === null || _k === void 0 ? void 0 : _k.additionalQuery,
|
|
2309
|
+
groupBy: (_l = props.organise) === null || _l === void 0 ? void 0 : _l.groupBy,
|
|
2174
2310
|
type: resolvedType,
|
|
2175
2311
|
};
|
|
2176
2312
|
var safeReplacer = function () {
|
|
@@ -2196,10 +2332,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2196
2332
|
props.collectionId,
|
|
2197
2333
|
props.model,
|
|
2198
2334
|
props.localURLEndpoint,
|
|
2199
|
-
(
|
|
2200
|
-
(
|
|
2201
|
-
(
|
|
2202
|
-
(
|
|
2335
|
+
(_84 = props.organise) === null || _84 === void 0 ? void 0 : _84.extendedTabs,
|
|
2336
|
+
(_85 = props.organise) === null || _85 === void 0 ? void 0 : _85.viewId,
|
|
2337
|
+
(_86 = props.organise) === null || _86 === void 0 ? void 0 : _86.additionalQuery,
|
|
2338
|
+
(_87 = props.organise) === null || _87 === void 0 ? void 0 : _87.groupBy,
|
|
2203
2339
|
resolvedType,
|
|
2204
2340
|
]);
|
|
2205
2341
|
/**
|
|
@@ -2351,7 +2487,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2351
2487
|
};
|
|
2352
2488
|
}, 100);
|
|
2353
2489
|
return function () { return clearTimeout(timeoutId); };
|
|
2354
|
-
}, [(
|
|
2490
|
+
}, [(_88 = props.organise) === null || _88 === void 0 ? void 0 : _88.showReadFloatingNav, resolvedType, props.id, loading]);
|
|
2355
2491
|
(0, react_1.useEffect)(function () {
|
|
2356
2492
|
if (resolvedType !== "read")
|
|
2357
2493
|
return;
|
|
@@ -5464,7 +5600,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5464
5600
|
// update an inline cell edit makes, gated on the same update right
|
|
5465
5601
|
var columnTypeActions = {
|
|
5466
5602
|
canUpdate: canUpdateRecord,
|
|
5467
|
-
onButtonClick: (
|
|
5603
|
+
onButtonClick: (_89 = props.organise) === null || _89 === void 0 ? void 0 : _89.onButtonClick,
|
|
5468
5604
|
onUpdateCell: function (rowId, columnId, value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5469
5605
|
var _a;
|
|
5470
5606
|
return __generator(this, function (_b) {
|
|
@@ -5481,7 +5617,34 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5481
5617
|
}
|
|
5482
5618
|
});
|
|
5483
5619
|
}); },
|
|
5620
|
+
onTimeTrackingAction: ((_90 = props.organise) === null || _90 === void 0 ? void 0 : _90.onTimeTrackingAction) && canUpdateRecord
|
|
5621
|
+
? function (rowId, columnId, action) {
|
|
5622
|
+
return handleTimeTrackingAction(rowId, columnId, action);
|
|
5623
|
+
}
|
|
5624
|
+
: undefined,
|
|
5484
5625
|
};
|
|
5626
|
+
// INFO: the host sends the action and answers with the stored value, which
|
|
5627
|
+
// replaces the row's copy so every view of the list shows it
|
|
5628
|
+
var handleTimeTrackingAction = function (rowId, columnId, action) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5629
|
+
var currentRow, stored;
|
|
5630
|
+
var _a, _b;
|
|
5631
|
+
var _c, _d;
|
|
5632
|
+
return __generator(this, function (_e) {
|
|
5633
|
+
switch (_e.label) {
|
|
5634
|
+
case 0:
|
|
5635
|
+
currentRow = tableDataRef.current.find(function (eachData) { return eachData.id === rowId || eachData._id === rowId; });
|
|
5636
|
+
return [4 /*yield*/, ((_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onTimeTrackingAction) === null || _d === void 0 ? void 0 : _d.call(_c, columnId, currentRow !== null && currentRow !== void 0 ? currentRow : (_a = {}, _a[serverId] = rowId, _a), action))];
|
|
5637
|
+
case 1:
|
|
5638
|
+
stored = _e.sent();
|
|
5639
|
+
if (!currentRow) return [3 /*break*/, 3];
|
|
5640
|
+
return [4 /*yield*/, handleGetListData({ data: [__assign(__assign({}, currentRow), (_b = {}, _b[columnId] = stored, _b))] }, "update", rowId)];
|
|
5641
|
+
case 2:
|
|
5642
|
+
_e.sent();
|
|
5643
|
+
_e.label = 3;
|
|
5644
|
+
case 3: return [2 /*return*/, stored];
|
|
5645
|
+
}
|
|
5646
|
+
});
|
|
5647
|
+
}); };
|
|
5485
5648
|
var handleSubmitData = function (type, rowId, columnId, data, offlineId, isOfflineUpdate, isDraft) { return __awaiter(void 0, void 0, void 0, function () {
|
|
5486
5649
|
var selectedId, id, createSelectedData_1, uniqueDataStructure, uniqueColumnId, res, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_3, err_20, isUniqueIdFieldCreate, isExistingDoc, newRecordData_1, changedAttributeIds, baseDraftValue, hasBaseDraftChange, offlineDataResp, clonedForOffline, tempData, selectedIndex_4, offlineData, err_21, dataToSubmit_2, changedAttributeIds, baseDraftValue, hasBaseDraftChange, operationType, currentRow, wentToServer, dataId, err_22, offlineDataResp, offlineData, clonedForOffline, tempData, selectedIndex_5, _a;
|
|
5487
5650
|
var _b, _c, _d, _e;
|
|
@@ -7651,12 +7814,47 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7651
7814
|
? "border-primary-500 text-primary-600"
|
|
7652
7815
|
: "".concat(dividerColor, " ").concat(labelColor)), onClick: function () { return handleChangePageLimit(eachOption); } }, eachOption)); })))));
|
|
7653
7816
|
};
|
|
7654
|
-
|
|
7817
|
+
// INFO: the new table's rows carry only the host's own row actions in the
|
|
7818
|
+
// actions column — see renderTableHeader. The display rows are what its
|
|
7819
|
+
// cells show; the plain rows are mapped too for a list without them.
|
|
7820
|
+
var handleKeepCustomRowActions = function (rows) {
|
|
7655
7821
|
var _a;
|
|
7822
|
+
return ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)
|
|
7823
|
+
? (rows !== null && rows !== void 0 ? rows : []).map(function (eachRow) {
|
|
7824
|
+
return eachRow && typeof eachRow === "object" && "update" in eachRow
|
|
7825
|
+
? __assign(__assign({}, eachRow), { update: eachRow[listModule_1.ROW_CUSTOM_ACTIONS] }) : eachRow;
|
|
7826
|
+
})
|
|
7827
|
+
: rows;
|
|
7828
|
+
};
|
|
7829
|
+
/* eslint-disable */
|
|
7830
|
+
var newTableRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(tableData); }, [tableData, (_91 = props.bareSettings) === null || _91 === void 0 ? void 0 : _91.bareNewDTW]);
|
|
7831
|
+
var newTableSpaceRows = (0, react_1.useMemo)(function () { return handleKeepCustomRowActions(spaceTableData); }, [spaceTableData, (_92 = props.bareSettings) === null || _92 === void 0 ? void 0 : _92.bareNewDTW]);
|
|
7832
|
+
/* eslint-enable */
|
|
7833
|
+
// INFO: the pencil beside a record's title opens the same form the Update
|
|
7834
|
+
// column's pencil did, for whoever may update; the bubble beside it opens
|
|
7835
|
+
// comments and logs for anyone who can see the record
|
|
7836
|
+
var handleOpenRecordEdit = function (id) {
|
|
7837
|
+
var _a, _b;
|
|
7838
|
+
handleCaptureListScroll(id);
|
|
7839
|
+
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "update", id, "general");
|
|
7840
|
+
};
|
|
7841
|
+
var handleOpenRecordActivity = function (id) {
|
|
7842
|
+
setActivityId(id);
|
|
7843
|
+
setActivityModal(true);
|
|
7844
|
+
};
|
|
7845
|
+
var recordEditAction = canUpdateRecord ? handleOpenRecordEdit : undefined;
|
|
7846
|
+
var recordActivityAction = isActivityLog
|
|
7847
|
+
? handleOpenRecordActivity
|
|
7848
|
+
: undefined;
|
|
7849
|
+
// INFO: isNewTable — the new table opens a record from its title, edits in
|
|
7850
|
+
// the cell and carries the comment bubble beside the title, so its rows
|
|
7851
|
+
// drop the pencil and bubble column and keep only the host's own actions
|
|
7852
|
+
var renderTableHeader = function (isNewTable) {
|
|
7853
|
+
var _a, _b;
|
|
7656
7854
|
var tableHeader = [];
|
|
7657
7855
|
var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
|
|
7658
7856
|
structure.map(function (eachAttribute) {
|
|
7659
|
-
var _a;
|
|
7857
|
+
var _a, _b;
|
|
7660
7858
|
if (eachAttribute.id === "baseDraft" ||
|
|
7661
7859
|
utils_1.NON_TABLE_COLUMN_DATA_TYPES.includes(eachAttribute.type) ||
|
|
7662
7860
|
eachAttribute.hide ||
|
|
@@ -7668,11 +7866,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7668
7866
|
eachAttribute.id === "baseUpdatedAt") {
|
|
7669
7867
|
return null;
|
|
7670
7868
|
}
|
|
7671
|
-
tableHeader.push(__assign(__assign({}, eachAttribute), { key: eachAttribute.id, title: eachAttribute.name, width: eachAttribute.tableColWidth }));
|
|
7869
|
+
tableHeader.push(__assign(__assign({}, eachAttribute), { key: eachAttribute.id, title: eachAttribute.name, width: (_b = columnWidths[eachAttribute.id]) !== null && _b !== void 0 ? _b : eachAttribute.tableColWidth }));
|
|
7672
7870
|
return null;
|
|
7673
7871
|
});
|
|
7674
|
-
if (
|
|
7675
|
-
((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.
|
|
7872
|
+
if (isNewTable) {
|
|
7873
|
+
if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareListActionBtns)
|
|
7874
|
+
tableHeader.push({ key: "update", title: "Actions" });
|
|
7875
|
+
}
|
|
7876
|
+
else if (canUpdateRecord ||
|
|
7877
|
+
((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListMultipleSelectAddtionalActions))
|
|
7676
7878
|
tableHeader.push({
|
|
7677
7879
|
key: "update",
|
|
7678
7880
|
title: "Update",
|
|
@@ -9063,6 +9265,29 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9063
9265
|
!eachModel.hide &&
|
|
9064
9266
|
!eachModel.disabled;
|
|
9065
9267
|
});
|
|
9268
|
+
// INFO: the columns the table shows for this view, in its column order —
|
|
9269
|
+
// an item's fields follow them, so a hidden column stays hidden and every
|
|
9270
|
+
// type the table draws is drawn here with the same cell renderer
|
|
9271
|
+
var visibleColumns = structure.filter(function (eachModel) {
|
|
9272
|
+
var _a;
|
|
9273
|
+
if (eachModel.id === "_id" ||
|
|
9274
|
+
eachModel.id === "id" ||
|
|
9275
|
+
eachModel.id === "baseDraft" ||
|
|
9276
|
+
eachModel.hide ||
|
|
9277
|
+
utils_1.NON_TABLE_COLUMN_DATA_TYPES.includes(eachModel.type) ||
|
|
9278
|
+
activeUserHiddenColumnIds.includes(eachModel.id))
|
|
9279
|
+
return false;
|
|
9280
|
+
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showBaseUpdatedAt) &&
|
|
9281
|
+
!isSystemColumnsEnabled &&
|
|
9282
|
+
eachModel.id === "baseUpdatedAt")
|
|
9283
|
+
return false;
|
|
9284
|
+
if (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.structure) {
|
|
9285
|
+
var modelInStructure = selectedTab.structure.find(function (model) { return model.id === eachModel.id; });
|
|
9286
|
+
if (!modelInStructure || modelInStructure.hide)
|
|
9287
|
+
return false;
|
|
9288
|
+
}
|
|
9289
|
+
return true;
|
|
9290
|
+
});
|
|
9066
9291
|
spaceTableData.forEach(function (eachData, index) {
|
|
9067
9292
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
9068
9293
|
var clonedEachData = JSON.parse(JSON.stringify(eachData));
|
|
@@ -9074,83 +9299,40 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9074
9299
|
title = renderedTitle;
|
|
9075
9300
|
}
|
|
9076
9301
|
var listDescArray = [];
|
|
9077
|
-
|
|
9078
|
-
var _a
|
|
9079
|
-
var eachKey =
|
|
9080
|
-
var
|
|
9081
|
-
|
|
9082
|
-
|
|
9083
|
-
if (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.structure) {
|
|
9084
|
-
structurePresent = true;
|
|
9085
|
-
modelInStructure = selectedTab.structure.find(function (model) { return model.id === eachKey; });
|
|
9086
|
-
}
|
|
9087
|
-
if (eachKey === "_id" ||
|
|
9088
|
-
eachKey === "id" ||
|
|
9089
|
-
eachKey === "baseDraft" ||
|
|
9090
|
-
eachKey === "update" ||
|
|
9091
|
-
!selectedModel ||
|
|
9092
|
-
utils_1.OBJECT_DATA_TYPES.includes(selectedModel.type) ||
|
|
9093
|
-
selectedModel.type === "file" ||
|
|
9094
|
-
selectedModel.type === "multipleFile" ||
|
|
9095
|
-
selectedModel.type === "ganttchart" ||
|
|
9096
|
-
selectedModel.type === "canvas" ||
|
|
9097
|
-
selectedModel.hide ||
|
|
9098
|
-
activeUserHiddenColumnIds.includes(eachKey) ||
|
|
9099
|
-
eachKey === imageTag ||
|
|
9100
|
-
eachValue === title ||
|
|
9101
|
-
(structurePresent && (!modelInStructure || modelInStructure.hide))) {
|
|
9102
|
-
return null;
|
|
9103
|
-
}
|
|
9302
|
+
visibleColumns.forEach(function (selectedModel) {
|
|
9303
|
+
var _a;
|
|
9304
|
+
var eachKey = selectedModel.id;
|
|
9305
|
+
var eachValue = eachData[eachKey];
|
|
9306
|
+
if (eachKey === titleKey || eachKey === imageTag)
|
|
9307
|
+
return;
|
|
9104
9308
|
if (isKanban &&
|
|
9105
9309
|
isListEditable &&
|
|
9106
9310
|
selectedModel.type === "boolean" &&
|
|
9107
|
-
selectedModel.enableCheckbox)
|
|
9108
|
-
return
|
|
9109
|
-
|
|
9110
|
-
|
|
9111
|
-
|
|
9112
|
-
|
|
9113
|
-
return
|
|
9114
|
-
|
|
9115
|
-
if (
|
|
9116
|
-
|
|
9117
|
-
|
|
9118
|
-
|
|
9119
|
-
|
|
9120
|
-
|
|
9121
|
-
|
|
9122
|
-
|
|
9123
|
-
|
|
9124
|
-
|
|
9125
|
-
|
|
9126
|
-
|
|
9127
|
-
|
|
9128
|
-
|
|
9129
|
-
react_1.default.createElement("
|
|
9130
|
-
|
|
9131
|
-
|
|
9132
|
-
var baseClassName = "my-1.5";
|
|
9133
|
-
if (type === "grid")
|
|
9134
|
-
baseClassName += " grid grid-cols-3 gap-x-1";
|
|
9135
|
-
else
|
|
9136
|
-
baseClassName += " flex flex-wrap items-center gap-x-1";
|
|
9137
|
-
var keyClassName = "flex text-gray-500 font-normal";
|
|
9138
|
-
if (type === "grid")
|
|
9139
|
-
keyClassName += " justify-between items-start";
|
|
9140
|
-
else
|
|
9141
|
-
keyClassName += " items-center";
|
|
9142
|
-
var valueClassName = "";
|
|
9143
|
-
if (type === "grid" || type === "kanban")
|
|
9144
|
-
valueClassName += "col-span-2 break-all";
|
|
9145
|
-
listDescArray.push(react_1.default.createElement("div", { className: baseClassName },
|
|
9146
|
-
react_1.default.createElement("div", { className: keyClassName },
|
|
9147
|
-
react_1.default.createElement("p", null, useColumnName
|
|
9148
|
-
? selectedModel.name
|
|
9149
|
-
: (0, utils_1.camelCaseToText)(eachKey)),
|
|
9150
|
-
react_1.default.createElement("p", null, ":")),
|
|
9151
|
-
react_1.default.createElement("div", { className: valueClassName }, (0, readModule_1.renderEachRowDataBasedOnDataType)(selectedKey, eachValue, props.bareSettings, true, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableEllipsisOnLongWord))));
|
|
9152
|
-
}
|
|
9153
|
-
return null;
|
|
9311
|
+
selectedModel.enableCheckbox)
|
|
9312
|
+
return;
|
|
9313
|
+
// INFO: an item shows what a record holds; a column with nothing in it
|
|
9314
|
+
// is left out rather than printed as an empty label. A button, timer
|
|
9315
|
+
// and rating are never empty — they are drawn to be used.
|
|
9316
|
+
if ((0, exports.handleCheckEmptyCardValue)(eachValue))
|
|
9317
|
+
return;
|
|
9318
|
+
var baseClassName = "my-1.5";
|
|
9319
|
+
if (type === "grid")
|
|
9320
|
+
baseClassName += " grid grid-cols-3 gap-x-1";
|
|
9321
|
+
else
|
|
9322
|
+
baseClassName += " flex flex-wrap items-center gap-x-1";
|
|
9323
|
+
var keyClassName = "flex text-gray-500 font-normal";
|
|
9324
|
+
if (type === "grid")
|
|
9325
|
+
keyClassName += " justify-between items-start";
|
|
9326
|
+
else
|
|
9327
|
+
keyClassName += " items-center";
|
|
9328
|
+
var valueClassName = "";
|
|
9329
|
+
if (type === "grid" || type === "kanban")
|
|
9330
|
+
valueClassName += "col-span-2 break-all";
|
|
9331
|
+
listDescArray.push(react_1.default.createElement("div", { key: eachKey, className: baseClassName, "data-testid": "dtw-card-field-".concat(eachKey) },
|
|
9332
|
+
react_1.default.createElement("div", { className: keyClassName },
|
|
9333
|
+
react_1.default.createElement("p", null, useColumnName ? selectedModel.name : (0, utils_1.camelCaseToText)(eachKey)),
|
|
9334
|
+
react_1.default.createElement("p", null, ":")),
|
|
9335
|
+
react_1.default.createElement("div", { className: valueClassName }, (0, readModule_1.renderEachRowDataBasedOnDataType)(eachKey, eachValue, props.bareSettings, true, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.disableEllipsisOnLongWord))));
|
|
9154
9336
|
});
|
|
9155
9337
|
if (booleanModels.length && isKanban && isListEditable) {
|
|
9156
9338
|
booleanModels.map(function (eachModel) {
|
|
@@ -9867,15 +10049,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9867
10049
|
else {
|
|
9868
10050
|
// INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
|
|
9869
10051
|
if ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareNewDTW) {
|
|
9870
|
-
return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data:
|
|
9871
|
-
// INFO: the bubble beside each record's title opens its comments and
|
|
9872
|
-
// logs, for anyone who can see the row — not only those who can edit
|
|
9873
|
-
onRowActivity: isActivityLog
|
|
9874
|
-
? function (id) {
|
|
9875
|
-
setActivityId(id);
|
|
9876
|
-
setActivityModal(true);
|
|
9877
|
-
}
|
|
9878
|
-
: undefined,
|
|
10052
|
+
return (react_1.default.createElement(newTable_1.NewTable, { darkModeBg: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.darkModeBg, showId: showId, paginationType: renderResolvedPaginationType(), data: newTableRows, spaceData: newTableSpaceRows !== null && newTableSpaceRows !== void 0 ? newTableSpaceRows : [], referencesOptions: listReferencesOptions, groups: handleBuildNewTableGroups(), onRowActivity: recordActivityAction, onRowEdit: recordEditAction,
|
|
9879
10053
|
// INFO: per-group paging — scroll appends inside a band, page
|
|
9880
10054
|
// mode gives each band its own pager; undefined = bands as before
|
|
9881
10055
|
onGroupLoadMore: renderCheckGroupPaging() && renderCheckScrollMode()
|
|
@@ -9928,7 +10102,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9928
10102
|
return (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
|
|
9929
10103
|
},
|
|
9930
10104
|
}); })
|
|
9931
|
-
: []), true), multiActionFloatingOffset: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
|
|
10105
|
+
: []), true), multiActionFloatingOffset: (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(true), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
|
|
9932
10106
|
var _a, _b;
|
|
9933
10107
|
handleCaptureListScroll(id);
|
|
9934
10108
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
@@ -9975,6 +10149,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
9975
10149
|
// INFO: header drag and the panel handle run the same reorder, so the
|
|
9976
10150
|
// order persists identically whichever one the user grabs
|
|
9977
10151
|
onDragColumn: handleReorderColumn,
|
|
10152
|
+
onResizeColumn: handleResizeColumn,
|
|
9978
10153
|
onHideColumn: isViewSettingsEnabled
|
|
9979
10154
|
? handleToggleUserHiddenColumn
|
|
9980
10155
|
: undefined,
|
|
@@ -10121,31 +10296,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10121
10296
|
};
|
|
10122
10297
|
// INFO: `hidden` keeps the markers out of space-y spacing
|
|
10123
10298
|
var renderSavedViews = function () {
|
|
10124
|
-
var _a, _b, _c, _d, _e, _f;
|
|
10299
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
10125
10300
|
if (!isSavedViewsEnabled)
|
|
10126
10301
|
return null;
|
|
10127
10302
|
var views = handleGetTabSavedViews();
|
|
10128
10303
|
var activeView = views.find(function (eachView) { return eachView.id === activeSavedViewId; });
|
|
10129
10304
|
var currentState = (0, viewStatePersistence_1.handlePickViewState)(handleBuildViewSnapshot());
|
|
10130
|
-
|
|
10131
|
-
//
|
|
10132
|
-
|
|
10133
|
-
|
|
10134
|
-
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
return __assign(__assign({}, state), { columnOrder: __spreadArray(__spreadArray([], kept, true), modelIds.filter(function (eachId) { return !kept.includes(eachId); }), true), hiddenColumnIds: isSchemaHideMode ? state.hiddenColumnIds : undefined });
|
|
10140
|
-
};
|
|
10141
|
-
var handleIsOnState = function (state) {
|
|
10142
|
-
return (0, viewStatePersistence_1.handleIsSameViewState)(handleComparable(currentState), handleComparable((0, viewStatePersistence_1.handlePickViewState)(handleResolveViewState(state))));
|
|
10143
|
-
};
|
|
10144
|
-
var isModified = !!activeView && !handleIsOnState(activeView.state);
|
|
10145
|
-
var defaultViewId = (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.defaultSavedViewId) !== null && _c !== void 0 ? _c : null;
|
|
10146
|
-
var canStarViews = !!((_d = props.organise) === null || _d === void 0 ? void 0 : _d.onChangeDefaultSavedViewId);
|
|
10147
|
-
var canSaveViews = !isAppViews || !!((_e = props.organise) === null || _e === void 0 ? void 0 : _e.onChangeSharedViews);
|
|
10148
|
-
var darkMode = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.darkMode;
|
|
10305
|
+
var isModified = !!activeView && !handleIsOnViewState(currentState, activeView.state);
|
|
10306
|
+
// INFO: All differs from its stored settings only where the app keeps them
|
|
10307
|
+
var isAllModified = !activeView &&
|
|
10308
|
+
isViewDraftsEnabled &&
|
|
10309
|
+
!handleIsOnViewState(currentState, (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.allView) !== null && _b !== void 0 ? _b : null);
|
|
10310
|
+
var defaultViewId = (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.defaultSavedViewId) !== null && _d !== void 0 ? _d : null;
|
|
10311
|
+
var canStarViews = !!((_e = props.organise) === null || _e === void 0 ? void 0 : _e.onChangeDefaultSavedViewId);
|
|
10312
|
+
var canSaveViews = !isAppViews || !!((_f = props.organise) === null || _f === void 0 ? void 0 : _f.onChangeSharedViews);
|
|
10313
|
+
var darkMode = (_g = props.organise) === null || _g === void 0 ? void 0 : _g.darkMode;
|
|
10149
10314
|
var renderChipClass = function (active) {
|
|
10150
10315
|
return "inline-flex items-center gap-1 rounded-full border px-3 py-1 text-xs font-medium ".concat(active
|
|
10151
10316
|
? "border-primary-500 bg-primary-50 text-primary-700"
|
|
@@ -10185,6 +10350,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10185
10350
|
"Update \u201C",
|
|
10186
10351
|
activeView.name,
|
|
10187
10352
|
"\u201D")),
|
|
10353
|
+
isAllModified && ((_h = props.organise) === null || _h === void 0 ? void 0 : _h.onChangeAllView) && (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-update-all", className: actionClass, onClick: handleUpdateAllView }, "Update All")),
|
|
10354
|
+
((activeView && isModified && isViewDraftsEnabled) ||
|
|
10355
|
+
isAllModified) && (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-reset", className: "text-xs font-medium ".concat(darkMode ? "text-gray-300" : "text-gray-500", " hover:underline"), onClick: handleResetView }, "Reset")),
|
|
10188
10356
|
!canSaveViews ? null : savedViewName === null ? (react_1.default.createElement("button", { type: "button", "data-testid": "dtw-saved-view-new", className: actionClass, onClick: function () { return setSavedViewName(""); } }, "+ Save view")) : (
|
|
10189
10357
|
// INFO: a form, so a mobile keyboard's Done saves the view; stopPropagation
|
|
10190
10358
|
// keeps the submit from reaching any form around the template
|
|
@@ -10439,7 +10607,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10439
10607
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
10440
10608
|
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_z = (_y = props.newTabUrl) === null || _y === void 0 ? void 0 : _y.default) !== null && _z !== void 0 ? _z : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_1 = (_0 = props.newTabUrl) === null || _0 === void 0 ? void 0 : _0.addons) !== null && _1 !== void 0 ? _1 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
10441
10609
|
handlePagination(value);
|
|
10442
|
-
}, darkMode: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.darkMode, className: "mt-5", hidePagination: (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.hidePagination, customPaginationSize: customPaginationSize, mobileTooltip: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListMobileTooltip }));
|
|
10610
|
+
}, darkMode: (_2 = props.organise) === null || _2 === void 0 ? void 0 : _2.darkMode, className: "mt-5", hidePagination: (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.hidePagination, customPaginationSize: customPaginationSize, mobileTooltip: (_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareListMobileTooltip, onRowEdit: recordEditAction, onRowActivity: recordActivityAction }));
|
|
10443
10611
|
}
|
|
10444
10612
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
10445
10613
|
react_1.default.createElement(list_1.List, { darkModeBg: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.darkModeBg, paginationType: renderResolvedPaginationType(), list: renderGridAndListData(selectedTabData.viewImage, "list", undefined, true), size: size, limit: limit, cursor: cursor, loading: tableLoading, pageIndex: pageIndex, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, disableSelectFullData: ((_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableSelectFullData) === null || _7 === void 0 ? void 0 : _7.list) || isFormulaView, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, selectAllText: selectAll ? "from filter" : "", multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
@@ -10566,7 +10734,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
10566
10734
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
10567
10735
|
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_22 = (_21 = props.newTabUrl) === null || _21 === void 0 ? void 0 : _21.default) !== null && _22 !== void 0 ? _22 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_24 = (_23 = props.newTabUrl) === null || _23 === void 0 ? void 0 : _23.addons) !== null && _24 !== void 0 ? _24 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
10568
10736
|
handlePagination(value);
|
|
10569
|
-
}, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareListGridColClassName, className: "mt-5", hidePagination: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.hidePagination, customPaginationSize: customPaginationSize }));
|
|
10737
|
+
}, imgContain: selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.gridContain, gridColClassName: (_25 = props.bareSettings) === null || _25 === void 0 ? void 0 : _25.bareListGridColClassName, className: "mt-5", hidePagination: (_26 = props.organise) === null || _26 === void 0 ? void 0 : _26.hidePagination, customPaginationSize: customPaginationSize, onCardEdit: recordEditAction, onCardActivity: recordActivityAction }));
|
|
10570
10738
|
}
|
|
10571
10739
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
10572
10740
|
react_1.default.createElement(grid_1.Grid, { darkMode: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.darkMode, darkModeBg: (_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.darkModeBg, paginationType: renderResolvedPaginationType(), data: renderGridAndListData(selectedTabData.viewImage, "grid"), size: size, limit: limit, cursor: cursor, loading: tableLoading, horizontalScroll: isScrollMode, pageIndex: pageIndex, onClickData: function (id) {
|
|
@@ -11098,7 +11266,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
11098
11266
|
var _a, _b;
|
|
11099
11267
|
handleCaptureListScroll(id);
|
|
11100
11268
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
11101
|
-
}, darkMode: (_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.darkMode, darkModeBg: (_59 = props.organise) === null || _59 === void 0 ? void 0 : _59.darkModeBg })));
|
|
11269
|
+
}, onCardEdit: recordEditAction, onCardActivity: recordActivityAction, darkMode: (_58 = props.organise) === null || _58 === void 0 ? void 0 : _58.darkMode, darkModeBg: (_59 = props.organise) === null || _59 === void 0 ? void 0 : _59.darkModeBg })));
|
|
11102
11270
|
}
|
|
11103
11271
|
return (react_1.default.createElement(kanban_1.Kanban, { className: "inline-flex", data: kanbanData, loading: tableLoading, groupBy: groupBy_1, groupId: kanbanTitle_2 !== null && kanbanTitle_2 !== void 0 ? kanbanTitle_2 : "", groupLabel: groupLabel_1.length > 0 ? groupLabel_1 : undefined, nullColumn: nullColumn_1, alertMessage: kanbanData.length === limit
|
|
11104
11272
|
? "Data has exceeded limit, please apply filters"
|
|
@@ -11603,14 +11771,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
11603
11771
|
};
|
|
11604
11772
|
return (react_1.default.createElement(context_1.ColumnTypeContext.Provider, { value: columnTypeActions },
|
|
11605
11773
|
renderNotification("root"),
|
|
11606
|
-
((
|
|
11774
|
+
((_94 = (_93 = props.renderSettings) === null || _93 === void 0 ? void 0 : _93.renderLoadingUI) === null || _94 === void 0 ? void 0 : _94.call(_93)) && loading ? ((_95 = props.renderSettings) === null || _95 === void 0 ? void 0 : _95.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { darkMode: (_96 = props.organise) === null || _96 === void 0 ? void 0 : _96.darkMode, darkModeBg: (_97 = props.organise) === null || _97 === void 0 ? void 0 : _97.darkModeBg, maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
|
|
11607
11775
|
var _a, _b;
|
|
11608
11776
|
if (loading)
|
|
11609
11777
|
return;
|
|
11610
11778
|
handlePopUpModal(false);
|
|
11611
11779
|
setExportCSVEmail((_b = (_a = props.devSettings.currentUser) === null || _a === void 0 ? void 0 : _a.userEmail) !== null && _b !== void 0 ? _b : "");
|
|
11612
11780
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) })),
|
|
11613
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11781
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_98 = props.organise) === null || _98 === void 0 ? void 0 : _98.darkMode, darkModeBg: (_99 = props.organise) === null || _99 === void 0 ? void 0 : _99.darkModeBg, maxWidth: "2xl", open: referenceCreationModal.id ? true : false, renderContent: function () {
|
|
11614
11782
|
return (react_1.default.createElement(referenceModal_1.ReferenceModal, { referenceModelSchema: referenceModelSchema, referenceDataStructure: referenceCreationModal, devSettings: props.devSettings, handleCreateRefId: function (dataId) {
|
|
11615
11783
|
if (dataId) {
|
|
11616
11784
|
var currentValue = selectedData[referenceCreationModal.id];
|
|
@@ -11626,19 +11794,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
11626
11794
|
}, onClose: function () {
|
|
11627
11795
|
setReferenceCreationModal({ id: "", name: "", type: "string" });
|
|
11628
11796
|
} }),
|
|
11629
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11797
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_100 = props.organise) === null || _100 === void 0 ? void 0 : _100.darkMode, darkModeBg: (_101 = props.organise) === null || _101 === void 0 ? void 0 : _101.darkModeBg, maxWidth: "2xl", open: Object.keys(referenceDeleteTableData).length > 0, renderContent: renderReferenceDeleteTable, onClose: function () {
|
|
11630
11798
|
setReferenceDeleteTableData({});
|
|
11631
11799
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
11632
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11800
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_102 = props.organise) === null || _102 === void 0 ? void 0 : _102.darkMode, darkModeBg: (_103 = props.organise) === null || _103 === void 0 ? void 0 : _103.darkModeBg, open: deleteModal, renderContent: renderDeleteModalContent, onClose: function () {
|
|
11633
11801
|
setDeletePasscodeInput("");
|
|
11634
11802
|
setDeleteModal(!deleteModal);
|
|
11635
11803
|
setDeleteFeedId("");
|
|
11636
11804
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
11637
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11805
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_104 = props.organise) === null || _104 === void 0 ? void 0 : _104.darkMode, darkModeBg: (_105 = props.organise) === null || _105 === void 0 ? void 0 : _105.darkModeBg, open: batchUpdateModal, renderContent: renderBatchUpdateModalContent, onClose: function () {
|
|
11638
11806
|
setBatchUpdateData({ columnId: "", columnData: {} });
|
|
11639
11807
|
setBatchUpdateModal(false);
|
|
11640
11808
|
}, notification: react_1.default.createElement(react_1.default.Fragment, null, renderNotification("modal")) }),
|
|
11641
|
-
react_1.default.createElement(modal_1.Modal, { darkMode: (
|
|
11809
|
+
react_1.default.createElement(modal_1.Modal, { darkMode: (_106 = props.organise) === null || _106 === void 0 ? void 0 : _106.darkMode, darkModeBg: (_107 = props.organise) === null || _107 === void 0 ? void 0 : _107.darkModeBg, title: "Edit Auth Method", open: selectedAuthMethod ? true : false, renderContent: function () {
|
|
11642
11810
|
var _a, _b;
|
|
11643
11811
|
if (props.space)
|
|
11644
11812
|
return (react_1.default.createElement(authModal_1.AuthModal, { space: props.space, userId: (_a = props.id) !== null && _a !== void 0 ? _a : "", client: (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, type: selectedAuthMethod, authMethods: authMethods, onComplete: handleAuthComplete }));
|
|
@@ -11653,13 +11821,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
11653
11821
|
(0, react_dom_1.createPortal)(
|
|
11654
11822
|
// INFO: z-50 lifts it over a Modal the table may sit in (z-40)
|
|
11655
11823
|
react_1.default.createElement("div", { className: "relative z-50" },
|
|
11656
|
-
react_1.default.createElement(drawer_1.Drawer, { darkMode: (
|
|
11824
|
+
react_1.default.createElement(drawer_1.Drawer, { darkMode: (_108 = props.organise) === null || _108 === void 0 ? void 0 : _108.darkMode, darkModeBg: (_109 = props.organise) === null || _109 === void 0 ? void 0 : _109.darkModeBg, testId: "dt-activity-drawer", open: activityModal,
|
|
11657
11825
|
// INFO: the record stays set while the drawer slides out — clearing it
|
|
11658
11826
|
// would remount the hidden panel collection-wide and fetch again. The
|
|
11659
11827
|
// toolbar's collection-wide button clears it when it opens.
|
|
11660
11828
|
onClose: function () { return setActivityModal(false); }, anchor: "responsive", maxWidth: "2xl", maxHeight: "75", title: "Activity Log", content: react_1.default.createElement(activityModal_1.ActivityModal, { title: props.title && typeof props.title === "string"
|
|
11661
11829
|
? props.title
|
|
11662
|
-
: "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((
|
|
11830
|
+
: "this collection", devSettings: props.devSettings, collectionId: props.collectionId, dataId: resolvedType === "read" ? ((_110 = props.id) !== null && _110 !== void 0 ? _110 : "") : activityId, activityLog: (_111 = props.edit) === null || _111 === void 0 ? void 0 : _111.activityLog, model: structure }) })), document.body),
|
|
11663
11831
|
renderScrollSentinel()));
|
|
11664
11832
|
});
|
|
11665
11833
|
//# sourceMappingURL=index.js.map
|