blixify-ui-web 1.2.58 → 1.2.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +1 -0
- package/lib/components/data/dataTemplate/dataStateModel.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +368 -226
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts +1 -0
- package/lib/components/data/dataTemplate/viewStatePersistence.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/viewStatePersistence.js.map +1 -1
- package/lib/components/data/dataWrapper/dataWrapper.fixtures.d.ts +9 -0
- package/lib/components/data/dataWrapper/dataWrapper.fixtures.d.ts.map +1 -0
- package/lib/components/data/dataWrapper/dataWrapper.fixtures.js +33 -0
- package/lib/components/data/dataWrapper/dataWrapper.fixtures.js.map +1 -0
- package/lib/components/data/dataWrapper/index.d.ts +36 -1
- package/lib/components/data/dataWrapper/index.d.ts.map +1 -1
- package/lib/components/data/dataWrapper/index.js +206 -61
- package/lib/components/data/dataWrapper/index.js.map +1 -1
- package/lib/components/data/flexFilter/index.d.ts.map +1 -1
- package/lib/components/data/flexFilter/index.js +1 -2
- package/lib/components/data/flexFilter/index.js.map +1 -1
- package/lib/components/data/listModule.d.ts +3 -1
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +6 -4
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/data/updateModule.d.ts.map +1 -1
- package/lib/components/data/updateModule.js +18 -11
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/data/utils.d.ts +9 -1
- package/lib/components/data/utils.d.ts.map +1 -1
- package/lib/components/data/utils.js +74 -1
- package/lib/components/data/utils.js.map +1 -1
- package/lib/components/display/drawer/index.d.ts +22 -6
- package/lib/components/display/drawer/index.d.ts.map +1 -1
- package/lib/components/display/drawer/index.js +138 -17
- package/lib/components/display/drawer/index.js.map +1 -1
- package/lib/components/display/flexTable/newMobileItemCard.d.ts.map +1 -1
- package/lib/components/display/flexTable/newMobileItemCard.js +1 -2
- package/lib/components/display/flexTable/newMobileItemCard.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts +4 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +207 -29
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/display/table/index.d.ts +22 -4
- package/lib/components/display/table/index.d.ts.map +1 -1
- package/lib/components/display/table/index.js +221 -40
- package/lib/components/display/table/index.js.map +1 -1
- package/lib/components/input/textArea/index.d.ts +5 -0
- package/lib/components/input/textArea/index.d.ts.map +1 -1
- package/lib/components/input/textArea/index.js +10 -3
- package/lib/components/input/textArea/index.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +1 -1
|
@@ -167,7 +167,7 @@ var handleGetWriteErrorMessage = function (response) {
|
|
|
167
167
|
return "Please contact our administrator for assistance or try your request again later. We apologize for any inconvenience";
|
|
168
168
|
};
|
|
169
169
|
exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
170
|
-
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;
|
|
170
|
+
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;
|
|
171
171
|
var intialiseDefaultFilterValues = function () {
|
|
172
172
|
var _a;
|
|
173
173
|
var initialFilterSearch = {};
|
|
@@ -228,67 +228,67 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
228
228
|
initialFilterReferenceDate: initialFilterReferenceDate,
|
|
229
229
|
};
|
|
230
230
|
};
|
|
231
|
-
var
|
|
231
|
+
var _51 = intialiseDefaultFilterValues(), initialFilterSearch = _51.initialFilterSearch, initialFilterSearchParams = _51.initialFilterSearchParams, initialFilterSelection = _51.initialFilterSelection, initialFilterReference = _51.initialFilterReference, initialFilterReferenceDate = _51.initialFilterReferenceDate;
|
|
232
232
|
// INFO: Persist view state hook — handles storage read/write for filter/sort/column state
|
|
233
|
-
var
|
|
233
|
+
var _52 = (0, viewStatePersistence_1.usePersistedViewState)({
|
|
234
234
|
mode: (_a = props.organise) === null || _a === void 0 ? void 0 : _a.persistViewState,
|
|
235
235
|
collectionId: props.collectionId,
|
|
236
236
|
uniqueLabel: props.uniqueLabel,
|
|
237
237
|
type: props.type,
|
|
238
|
-
}), persistedState =
|
|
239
|
-
var
|
|
240
|
-
var
|
|
238
|
+
}), persistedState = _52.persistedState, isPersistEnabled = _52.isEnabled, handleSaveView = _52.handleSaveView;
|
|
239
|
+
var _53 = (0, react_1.useState)(false), loading = _53[0], setLoading = _53[1];
|
|
240
|
+
var _54 = (0, react_1.useState)(), notification = _54[0], setNotification = _54[1];
|
|
241
241
|
//INFO : Used by List
|
|
242
|
-
var
|
|
243
|
-
var
|
|
244
|
-
var
|
|
245
|
-
var
|
|
246
|
-
var
|
|
247
|
-
var
|
|
248
|
-
var
|
|
242
|
+
var _55 = (0, react_1.useState)((_b = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _b !== void 0 ? _b : initialFilterSearch), filterSearch = _55[0], setFilterSearch = _55[1];
|
|
243
|
+
var _56 = (0, react_1.useState)((_c = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSearchParams) !== null && _c !== void 0 ? _c : initialFilterSearchParams), filterSearchParams = _56[0], setFilterSearchParams = _56[1];
|
|
244
|
+
var _57 = (0, react_1.useState)((_d = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterSelection) !== null && _d !== void 0 ? _d : initialFilterSelection), filterSelection = _57[0], setFilterSelection = _57[1];
|
|
245
|
+
var _58 = (0, react_1.useState)((_e = persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReference) !== null && _e !== void 0 ? _e : initialFilterReference), filterReference = _58[0], setFilterReference = _58[1];
|
|
246
|
+
var _59 = (0, react_1.useState)({}), filterReferenceSearch = _59[0], setFilterReferenceSearch = _59[1];
|
|
247
|
+
var _60 = (0, react_1.useState)({}), filterReferenceList = _60[0], setFilterReferenceList = _60[1];
|
|
248
|
+
var _61 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.filterReferenceDate)
|
|
249
249
|
? (0, viewStatePersistence_1.parseDateFilterState)(persistedState.filterReferenceDate)
|
|
250
|
-
: initialFilterReferenceDate), filterReferenceDate =
|
|
251
|
-
var
|
|
252
|
-
var
|
|
253
|
-
var
|
|
254
|
-
var
|
|
255
|
-
var
|
|
256
|
-
var
|
|
257
|
-
var
|
|
258
|
-
var
|
|
259
|
-
var
|
|
260
|
-
var
|
|
261
|
-
var
|
|
262
|
-
var
|
|
250
|
+
: initialFilterReferenceDate), filterReferenceDate = _61[0], setFilterReferenceDate = _61[1];
|
|
251
|
+
var _62 = (0, react_1.useState)(true), tableLoading = _62[0], setTableLoading = _62[1];
|
|
252
|
+
var _63 = (0, react_1.useState)(""), cursor = _63[0], setCursor = _63[1];
|
|
253
|
+
var _64 = (0, react_1.useState)(""), lastCursor = _64[0], setLastCursor = _64[1];
|
|
254
|
+
var _65 = (0, react_1.useState)([]), tableData = _65[0], setTableData = _65[1];
|
|
255
|
+
var _66 = (0, react_1.useState)([]), spaceTableData = _66[0], setSpaceTableData = _66[1];
|
|
256
|
+
var _67 = (0, react_1.useState)(0), size = _67[0], setSize = _67[1];
|
|
257
|
+
var _68 = (0, react_1.useState)((_h = (_f = persistedState === null || persistedState === void 0 ? void 0 : persistedState.pageIndex) !== null && _f !== void 0 ? _f : (_g = props.organise) === null || _g === void 0 ? void 0 : _g.pageIndex) !== null && _h !== void 0 ? _h : 0), pageIndex = _68[0], setPageIndex = _68[1];
|
|
258
|
+
var _69 = (0, react_1.useState)([]), selectedIds = _69[0], setSelectedIds = _69[1];
|
|
259
|
+
var _70 = (0, react_1.useState)(false), selectAll = _70[0], setSelectAll = _70[1];
|
|
260
|
+
var _71 = (0, react_1.useState)(""), deletePasscode = _71[0], setDeletePasscode = _71[1];
|
|
261
|
+
var _72 = (0, react_1.useState)(""), deletePasscodeInput = _72[0], setDeletePasscodeInput = _72[1];
|
|
262
|
+
var _73 = (0, react_1.useState)(""), deleteFeedId = _73[0], setDeleteFeedId = _73[1];
|
|
263
263
|
//INFO : Used by List Organise
|
|
264
|
-
var
|
|
265
|
-
var
|
|
264
|
+
var _74 = (0, react_1.useState)(false), sortModal = _74[0], setSortModal = _74[1];
|
|
265
|
+
var _75 = (0, react_1.useState)(false), filterModal = _75[0], setFilterModal = _75[1];
|
|
266
266
|
// INFO: Internal sort state that overrides props.organise?.sort when
|
|
267
267
|
// persistViewState is enabled and a persisted sort exists
|
|
268
|
-
var
|
|
269
|
-
var
|
|
270
|
-
var
|
|
271
|
-
var
|
|
268
|
+
var _76 = (0, react_1.useState)((_j = persistedState === null || persistedState === void 0 ? void 0 : persistedState.sort) !== null && _j !== void 0 ? _j : undefined), persistedSort = _76[0], setPersistedSort = _76[1];
|
|
269
|
+
var _77 = (0, react_1.useState)(false), filterDraft = _77[0], setFilterDraft = _77[1];
|
|
270
|
+
var _78 = (0, react_1.useState)(false), addTabModal = _78[0], setAddTabModal = _78[1];
|
|
271
|
+
var _79 = (0, react_1.useState)(false), overviewModal = _79[0], setOverviewModal = _79[1];
|
|
272
272
|
//INFO : resolve the initial tab synchronously so the mount cond is already
|
|
273
273
|
// tab-scoped — an empty initial tab caused a second wasted list fetch
|
|
274
|
-
var
|
|
274
|
+
var _80 = (0, react_1.useState)(function () {
|
|
275
275
|
var _a, _b;
|
|
276
276
|
return (0, listModule_1.renderSelectedRefreshTab)(props.localURLEndpoint, props.type, 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);
|
|
277
|
-
}), selectedTab =
|
|
278
|
-
var
|
|
277
|
+
}), selectedTab = _80[0], setSelectedTab = _80[1];
|
|
278
|
+
var _81 = (0, react_1.useState)("dayGridMonth"), calendarView = _81[0], setCalendarView = _81[1];
|
|
279
279
|
// INFO: bareNewDTW calendar viewSwitch mode — drives the NewCalendar variant
|
|
280
280
|
// (calendarView above drives the matching range query)
|
|
281
|
-
var
|
|
282
|
-
var
|
|
283
|
-
var
|
|
284
|
-
var
|
|
285
|
-
var
|
|
286
|
-
var
|
|
287
|
-
var
|
|
281
|
+
var _82 = (0, react_1.useState)("month"), newCalendarViewMode = _82[0], setNewCalendarViewMode = _82[1];
|
|
282
|
+
var _83 = (0, react_1.useState)(new Date()), calendarTabMonth = _83[0], setCalendarTabMonth = _83[1];
|
|
283
|
+
var _84 = (0, react_1.useState)(true), kanbanDroppable = _84[0], setKanbanDroppable = _84[1];
|
|
284
|
+
var _85 = (0, react_1.useState)([]), kanbanOptions = _85[0], setKanbanOptions = _85[1];
|
|
285
|
+
var _86 = (0, react_1.useState)(false), queryForm = _86[0], setQueryForm = _86[1];
|
|
286
|
+
var _87 = (0, react_1.useState)(false), batchUpdateModal = _87[0], setBatchUpdateModal = _87[1];
|
|
287
|
+
var _88 = (0, react_1.useState)({
|
|
288
288
|
columnId: "",
|
|
289
289
|
columnData: {},
|
|
290
|
-
}), batchUpdateData =
|
|
291
|
-
var
|
|
290
|
+
}), batchUpdateData = _88[0], setBatchUpdateData = _88[1];
|
|
291
|
+
var _89 = (0, react_1.useState)(function () {
|
|
292
292
|
var baseModel = (props === null || props === void 0 ? void 0 : props.model) || [];
|
|
293
293
|
if (!persistedState)
|
|
294
294
|
return baseModel;
|
|
@@ -314,8 +314,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
314
314
|
});
|
|
315
315
|
}
|
|
316
316
|
return model;
|
|
317
|
-
}), structure =
|
|
318
|
-
var
|
|
317
|
+
}), structure = _89[0], setStructure = _89[1];
|
|
318
|
+
var _90 = (0, react_1.useState)(((_k = props === null || props === void 0 ? void 0 : props.organise) === null || _k === void 0 ? void 0 : _k.additionalQuery) || []), additionalQuery = _90[0], setAdditionalQuery = _90[1];
|
|
319
319
|
// INFO: State for user-configurable flex filters (Monday.com-style)
|
|
320
320
|
// INFO: Initialize with one empty row so users see inputs immediately without clicking "Add Filter"
|
|
321
321
|
var defaultFlexFilterRow = [
|
|
@@ -326,97 +326,105 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
326
326
|
value: undefined,
|
|
327
327
|
},
|
|
328
328
|
];
|
|
329
|
-
var
|
|
329
|
+
var _91 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
330
330
|
? persistedState.flexFilters
|
|
331
|
-
: defaultFlexFilterRow), flexFilters =
|
|
331
|
+
: defaultFlexFilterRow), flexFilters = _91[0], setFlexFilters = _91[1];
|
|
332
332
|
// INFO: Debounced version of flexFilters used by renderImpSearchFilterConditions
|
|
333
333
|
// to prevent API calls on every keystroke when typing in value inputs
|
|
334
|
-
var
|
|
334
|
+
var _92 = (0, react_1.useState)((persistedState === null || persistedState === void 0 ? void 0 : persistedState.flexFilters) && persistedState.flexFilters.length > 0
|
|
335
335
|
? persistedState.flexFilters
|
|
336
|
-
: defaultFlexFilterRow), flexFiltersDebounced =
|
|
337
|
-
var
|
|
338
|
-
var
|
|
339
|
-
var
|
|
336
|
+
: defaultFlexFilterRow), flexFiltersDebounced = _92[0], setFlexFiltersDebounced = _92[1];
|
|
337
|
+
var _93 = (0, react_1.useState)({}), flexFilterReferenceOptions = _93[0], setFlexFilterReferenceOptions = _93[1];
|
|
338
|
+
var _94 = (0, react_1.useState)({}), flexFilterReferenceSearch = _94[0], setFlexFilterReferenceSearch = _94[1];
|
|
339
|
+
var _95 = (0, react_1.useState)(false), flexFilterModalOpen = _95[0], setFlexFilterModalOpen = _95[1];
|
|
340
|
+
// INFO: Columns the end user chose to hide (organise.hideColumnEnabled).
|
|
341
|
+
// Deliberately kept out of `structure`: the props-sync effect below resets
|
|
342
|
+
// structure to props.model whenever props change, which would wipe the
|
|
343
|
+
// choice, and the persist effect derives schema-level hiddenColumnIds from
|
|
344
|
+
// structure — writing user hides there would blur the two concepts.
|
|
345
|
+
var _96 = (0, react_1.useState)((_l = persistedState === null || persistedState === void 0 ? void 0 : persistedState.userHiddenColumnIds) !== null && _l !== void 0 ? _l : []), userHiddenColumnIds = _96[0], setUserHiddenColumnIds = _96[1];
|
|
340
346
|
//INFO : Used by Auth
|
|
341
|
-
var
|
|
347
|
+
var _97 = (0, react_1.useState)({
|
|
342
348
|
email: "",
|
|
343
349
|
google: "",
|
|
344
350
|
phone: "",
|
|
345
351
|
disabled: false,
|
|
346
352
|
create: false,
|
|
347
|
-
}), authMethods =
|
|
348
|
-
var
|
|
353
|
+
}), authMethods = _97[0], setAuthMethods = _97[1];
|
|
354
|
+
var _98 = (0, react_1.useState)(""), selectedAuthMethod = _98[0], setSelectedAuthMethod = _98[1];
|
|
349
355
|
// INFO: Used by Activity Log
|
|
350
|
-
var
|
|
351
|
-
var
|
|
356
|
+
var _99 = (0, react_1.useState)(false), activityModal = _99[0], setActivityModal = _99[1];
|
|
357
|
+
var _100 = (0, react_1.useState)(""), activityId = _100[0], setActivityId = _100[1];
|
|
352
358
|
//INFO : Used by Export
|
|
353
|
-
var
|
|
354
|
-
var
|
|
355
|
-
var
|
|
356
|
-
var
|
|
357
|
-
var
|
|
358
|
-
var
|
|
359
|
-
var
|
|
360
|
-
var
|
|
361
|
-
var
|
|
362
|
-
var
|
|
363
|
-
var
|
|
364
|
-
var
|
|
365
|
-
var
|
|
366
|
-
var
|
|
367
|
-
var
|
|
368
|
-
var
|
|
369
|
-
var
|
|
370
|
-
var
|
|
371
|
-
var
|
|
359
|
+
var _101 = (0, react_1.useState)(null), csvFile = _101[0], setCSVFile = _101[1];
|
|
360
|
+
var _102 = (0, react_1.useState)([]), csvFileData = _102[0], setCSVFileData = _102[1];
|
|
361
|
+
var _103 = (0, react_1.useState)(0), stepCSVIndex = _103[0], setStepCSVIndex = _103[1];
|
|
362
|
+
var _104 = (0, react_1.useState)({}), listCSVMapAttribute = _104[0], setListCSVMapAttribute = _104[1];
|
|
363
|
+
var _105 = (0, react_1.useState)({}), listCSVObjAttribute = _105[0], setListCSVObjAttribute = _105[1];
|
|
364
|
+
var _106 = (0, react_1.useState)([]), csvAPIAttribute = _106[0], setCSVAPIAttribute = _106[1];
|
|
365
|
+
var _107 = (0, react_1.useState)(((_m = props.devSettings.currentUser) === null || _m === void 0 ? void 0 : _m.userEmail) || ""), exportCSVEmail = _107[0], setExportCSVEmail = _107[1];
|
|
366
|
+
var _108 = (0, react_1.useState)(((_p = (_o = props.organise) === null || _o === void 0 ? void 0 : _o.exportSettings) === null || _p === void 0 ? void 0 : _p.defaultExportPDFName) || ""), exportPDFTitle = _108[0], setExportPDFTitle = _108[1];
|
|
367
|
+
var _109 = (0, react_1.useState)(false), exportPDFLoading = _109[0], setExportPDFLoading = _109[1];
|
|
368
|
+
var _110 = (0, react_1.useState)(false), exportReadPDFLoading = _110[0], setExportReadPDFLoading = _110[1];
|
|
369
|
+
var _111 = (0, react_1.useState)((_s = (_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.exportSettings) === null || _r === void 0 ? void 0 : _r.sumColumnId) !== null && _s !== void 0 ? _s : []), exportSumAttributeIds = _111[0], setExportSumAttributeIds = _111[1];
|
|
370
|
+
var _112 = (0, react_1.useState)((_v = (_u = (_t = props.organise) === null || _t === void 0 ? void 0 : _t.exportSettings) === null || _u === void 0 ? void 0 : _u.hideSubItems) !== null && _v !== void 0 ? _v : false), hideSubItems = _112[0], setHideSubItems = _112[1];
|
|
371
|
+
var _113 = (0, react_1.useState)([]), importTableData = _113[0], setImportTableData = _113[1];
|
|
372
|
+
var _114 = (0, react_1.useState)([]), queryList = _114[0], setQueryList = _114[1];
|
|
373
|
+
var _115 = (0, react_1.useState)(undefined), allQueryList = _115[0], setAllQueryList = _115[1];
|
|
374
|
+
var _116 = (0, react_1.useState)(-1), queryIndex = _116[0], setQueryIndex = _116[1];
|
|
375
|
+
var _117 = (0, react_1.useState)((_w = props.organise) === null || _w === void 0 ? void 0 : _w.groupBy), groupId = _117[0], setGroupId = _117[1];
|
|
376
|
+
var _118 = (0, react_1.useState)(""), readTabSection = _118[0], setReadTabSection = _118[1];
|
|
377
|
+
var _119 = (0, react_1.useState)(false), readFloatingNav = _119[0], setReadFloatingNav = _119[1];
|
|
372
378
|
var readTabSectionRefs = (0, react_1.useRef)({});
|
|
373
379
|
//INFO : Used by Read
|
|
374
380
|
//INFO : Used by Update
|
|
375
|
-
var
|
|
376
|
-
var
|
|
377
|
-
var
|
|
378
|
-
var
|
|
379
|
-
var
|
|
380
|
-
var
|
|
381
|
-
var
|
|
381
|
+
var _120 = (0, react_1.useState)(false), modalVisible = _120[0], setModalVisible = _120[1];
|
|
382
|
+
var _121 = (0, react_1.useState)(false), deleteModal = _121[0], setDeleteModal = _121[1];
|
|
383
|
+
var _122 = (0, react_1.useState)(false), excelModal = _122[0], setExcelModal = _122[1];
|
|
384
|
+
var _123 = (0, react_1.useState)(false), exportExcel = _123[0], setExportExcel = _123[1];
|
|
385
|
+
var _124 = (0, react_1.useState)(""), exportType = _124[0], setExportType = _124[1];
|
|
386
|
+
var _125 = (0, react_1.useState)(false), exportQR = _125[0], setExportQR = _125[1];
|
|
387
|
+
var _126 = (0, react_1.useState)(function () {
|
|
382
388
|
var _a, _b;
|
|
383
389
|
var firstTabId = (_b = (_a = structure.find(function (item) { return item.tabId; })) === null || _a === void 0 ? void 0 : _a.tabId) !== null && _b !== void 0 ? _b : "";
|
|
384
390
|
return firstTabId;
|
|
385
|
-
}), activeTab =
|
|
386
|
-
var
|
|
387
|
-
var
|
|
388
|
-
var
|
|
389
|
-
var
|
|
390
|
-
var
|
|
391
|
-
var
|
|
392
|
-
var
|
|
391
|
+
}), activeTab = _126[0], setActiveTab = _126[1];
|
|
392
|
+
var _127 = (0, react_1.useState)(false), signatureSigning = _127[0], setSignatureSigning = _127[1];
|
|
393
|
+
var _128 = (0, react_1.useState)({}), selectedData = _128[0], setSelectedData = _128[1];
|
|
394
|
+
var _129 = (0, react_1.useState)(""), selectedObjectStructureId = _129[0], setSelectedObjectStructureId = _129[1];
|
|
395
|
+
var _130 = (0, react_1.useState)(""), selectedObjectId = _130[0], setSelectedObjectId = _130[1];
|
|
396
|
+
var _131 = (0, react_1.useState)(""), selectedListAddressId = _131[0], setSelectedListAddressId = _131[1];
|
|
397
|
+
var _132 = (0, react_1.useState)(-1), selectedListAddressIndex = _132[0], setSelectedListAddressIndex = _132[1];
|
|
398
|
+
var _133 = (0, react_1.useState)({
|
|
393
399
|
lat: 0,
|
|
394
400
|
lng: 0,
|
|
395
401
|
name: "",
|
|
396
|
-
}), selectedListAddress =
|
|
397
|
-
var
|
|
398
|
-
var
|
|
399
|
-
var
|
|
400
|
-
var
|
|
401
|
-
var
|
|
402
|
-
var
|
|
403
|
-
var
|
|
402
|
+
}), selectedListAddress = _133[0], setSelectedListAddress = _133[1];
|
|
403
|
+
var _134 = (0, react_1.useState)({}), selectedObjectData = _134[0], setSelectedObjectData = _134[1];
|
|
404
|
+
var _135 = (0, react_1.useState)(null), objectCellEdit = _135[0], setObjectCellEdit = _135[1];
|
|
405
|
+
var _136 = (0, react_1.useState)(false), referenceLoading = _136[0], setReferenceLoading = _136[1];
|
|
406
|
+
var _137 = (0, react_1.useState)({}), referencesOptions = _137[0], setReferencesOptions = _137[1];
|
|
407
|
+
var _138 = (0, react_1.useState)({}), referencesDetails = _138[0], setReferencesDetails = _138[1];
|
|
408
|
+
var _139 = (0, react_1.useState)({}), listReferencesOptions = _139[0], setListReferencesOptions = _139[1];
|
|
409
|
+
var _140 = (0, react_1.useState)({}), referenceDeleteTableData = _140[0], setReferenceDeleteTableData = _140[1];
|
|
410
|
+
var _141 = (0, react_1.useState)(0), referenceDeleteIndex = _141[0], setReferenceDeleteIndex = _141[1];
|
|
411
|
+
var _142 = (0, react_1.useState)({
|
|
404
412
|
id: "",
|
|
405
413
|
name: "",
|
|
406
414
|
type: "string",
|
|
407
|
-
}), referenceCreationModal =
|
|
408
|
-
var
|
|
409
|
-
var
|
|
415
|
+
}), referenceCreationModal = _142[0], setReferenceCreationModal = _142[1];
|
|
416
|
+
var _143 = (0, react_1.useState)({}), referenceModelSchema = _143[0], setReferenceSchema = _143[1];
|
|
417
|
+
var _144 = (0, react_1.useState)([]), kanbanChecked = _144[0], setKanbanChecked = _144[1];
|
|
410
418
|
//INFO : Offline
|
|
411
|
-
var
|
|
412
|
-
var
|
|
419
|
+
var _145 = (0, react_1.useState)(0), offlineDataLength = _145[0], setOfflineDataLength = _145[1];
|
|
420
|
+
var _146 = (0, react_1.useState)(false), offlineModal = _146[0], setOfflineModal = _146[1];
|
|
413
421
|
// INFO: live-stream state — driven by socket connection and navigator.onLine
|
|
414
|
-
var
|
|
415
|
-
var
|
|
422
|
+
var _147 = (0, react_1.useState)(false), isLive = _147[0], setIsLive = _147[1];
|
|
423
|
+
var _148 = (0, react_1.useState)(false), isLiveOffline = _148[0], setIsLiveOffline = _148[1];
|
|
416
424
|
// INFO: true when navigator is offline — used to switch ReadQueryHoc between
|
|
417
425
|
// server reads (online, full pagination) and IndexedDB reads (offline, cached data).
|
|
418
426
|
// Independent of SSE status so it works even when bareSocketName is not set.
|
|
419
|
-
var
|
|
427
|
+
var _149 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _149[0], setIsNetworkOffline = _149[1];
|
|
420
428
|
var previousType = (0, react_1.useRef)(null);
|
|
421
429
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
422
430
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
@@ -492,47 +500,47 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
492
500
|
var isSubmittingRef = (0, react_1.useRef)(false);
|
|
493
501
|
var devSettings = props.devSettings;
|
|
494
502
|
var serverId = (0, utils_1.parseServerId)(devSettings.server);
|
|
495
|
-
var viewType = (
|
|
503
|
+
var viewType = (_y = (_x = props.organise) === null || _x === void 0 ? void 0 : _x.viewId) !== null && _y !== void 0 ? _y : "general";
|
|
496
504
|
var isFirebaseClient = devSettings.server === "firebase";
|
|
497
505
|
var isFirebase = isFirebaseClient || devSettings.server === "fbServer";
|
|
498
|
-
var dbModule = isFirebaseClient ? (
|
|
506
|
+
var dbModule = isFirebaseClient ? (_z = props.lib) === null || _z === void 0 ? void 0 : _z.firebase : (_0 = props.lib) === null || _0 === void 0 ? void 0 : _0.axios;
|
|
499
507
|
var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
|
|
500
508
|
var limit = props.limit ? props.limit : 10;
|
|
501
|
-
var activeSortId = (isPersistEnabled && persistedSort) || ((
|
|
509
|
+
var activeSortId = (isPersistEnabled && persistedSort) || ((_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.sort);
|
|
502
510
|
var handleSortColumn = function (value) {
|
|
503
511
|
var _a, _b;
|
|
504
512
|
if (isPersistEnabled)
|
|
505
513
|
setPersistedSort(value);
|
|
506
514
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.onChangeSort) === null || _b === void 0 ? void 0 : _b.call(_a, value);
|
|
507
515
|
};
|
|
508
|
-
var isEditor = ((
|
|
509
|
-
var isOffline = (
|
|
516
|
+
var isEditor = ((_2 = props.edit) === null || _2 === void 0 ? void 0 : _2.allEditable) ? true : false;
|
|
517
|
+
var isOffline = (_3 = props.bareSettings) === null || _3 === void 0 ? void 0 : _3.bareOffline;
|
|
510
518
|
// INFO: when bareOfflineNetworkAware is true, the save path is also gated on
|
|
511
519
|
// the live network state — online saves go to the server even if bareOffline
|
|
512
520
|
// is true, offline saves go to IDB as normal.
|
|
513
|
-
var isOfflineNetworkListener = isOffline && ((
|
|
514
|
-
var showId = (
|
|
521
|
+
var isOfflineNetworkListener = isOffline && ((_4 = props.bareSettings) === null || _4 === void 0 ? void 0 : _4.bareOfflineNetworkListener);
|
|
522
|
+
var showId = (_5 = props.space) === null || _5 === void 0 ? void 0 : _5.showId;
|
|
515
523
|
var remainId = showId || selectedObjectStructureId ? true : false;
|
|
516
|
-
var idField = ((
|
|
517
|
-
var pipeline = (
|
|
518
|
-
if ((
|
|
524
|
+
var idField = ((_6 = props.space) === null || _6 === void 0 ? void 0 : _6.idField) || ((_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.idField);
|
|
525
|
+
var pipeline = (_8 = props === null || props === void 0 ? void 0 : props.space) === null || _8 === void 0 ? void 0 : _8.pipeline;
|
|
526
|
+
if ((_9 = props.bareSettings) === null || _9 === void 0 ? void 0 : _9.bareListPipeline) {
|
|
519
527
|
pipeline = pipeline
|
|
520
528
|
? __spreadArray(__spreadArray([], pipeline, true), props.bareSettings.bareListPipeline, true) : props.bareSettings.bareListPipeline;
|
|
521
529
|
}
|
|
522
|
-
var hasNavigation = ((
|
|
530
|
+
var hasNavigation = ((_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.handleNavigate) ? true : false;
|
|
523
531
|
var formColumn = "grid-cols-12";
|
|
524
|
-
var useMobileView = (
|
|
532
|
+
var useMobileView = (_12 = (_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareUpdateMobileView) !== null && _12 !== void 0 ? _12 : false;
|
|
525
533
|
var gridGap = useMobileView ? "gap-x-6 gap-y-2 md:gap-y-6" : "gap-6";
|
|
526
|
-
var isActivityLog = (((
|
|
527
|
-
((
|
|
528
|
-
(((
|
|
529
|
-
((
|
|
530
|
-
var customPaginationSize = ((
|
|
534
|
+
var isActivityLog = (((_14 = (_13 = props.edit) === null || _13 === void 0 ? void 0 : _13.activityLog) === null || _14 === void 0 ? void 0 : _14.enableComments) &&
|
|
535
|
+
((_15 = props.edit) === null || _15 === void 0 ? void 0 : _15.activityLog.commentCollectionId)) ||
|
|
536
|
+
(((_17 = (_16 = props.edit) === null || _16 === void 0 ? void 0 : _16.activityLog) === null || _17 === void 0 ? void 0 : _17.enableLogs) &&
|
|
537
|
+
((_18 = props.edit) === null || _18 === void 0 ? void 0 : _18.activityLog.logsCollectionId));
|
|
538
|
+
var customPaginationSize = ((_19 = props.organise) === null || _19 === void 0 ? void 0 : _19.customPaginationCount)
|
|
531
539
|
? props.organise.customPaginationCount(size)
|
|
532
540
|
: undefined;
|
|
533
541
|
//TODO : Code - Pass ...devSettings, search dbEndpoint:
|
|
534
542
|
var writeServerQuery = new writeQuery_1.WriteQuery({
|
|
535
|
-
dbModule: (
|
|
543
|
+
dbModule: (_20 = props.lib) === null || _20 === void 0 ? void 0 : _20.axios,
|
|
536
544
|
dbType: devSettings.server,
|
|
537
545
|
dbCollection: props.collectionId,
|
|
538
546
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -540,7 +548,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
540
548
|
dbUserToken: devSettings.dbUserToken,
|
|
541
549
|
});
|
|
542
550
|
var readServerQuery = new readQuery_1.ReadQuery({
|
|
543
|
-
dbModule: (
|
|
551
|
+
dbModule: (_21 = props.lib) === null || _21 === void 0 ? void 0 : _21.axios,
|
|
544
552
|
dbType: devSettings.server,
|
|
545
553
|
dbCollection: props.collectionId,
|
|
546
554
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -548,9 +556,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
548
556
|
dbUserToken: devSettings.dbUserToken,
|
|
549
557
|
});
|
|
550
558
|
var moreButtonPopUp = [
|
|
551
|
-
((
|
|
559
|
+
((_22 = props.edit) === null || _22 === void 0 ? void 0 : _22.allEditable) &&
|
|
552
560
|
!isFirebase &&
|
|
553
|
-
!((
|
|
561
|
+
!((_24 = (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.exportSettings) === null || _24 === void 0 ? void 0 : _24.hideImportCSV)
|
|
554
562
|
? {
|
|
555
563
|
text: "Import Excel",
|
|
556
564
|
onClick: function () {
|
|
@@ -559,7 +567,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
559
567
|
},
|
|
560
568
|
}
|
|
561
569
|
: null,
|
|
562
|
-
!((
|
|
570
|
+
!((_26 = (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.exportSettings) === null || _26 === void 0 ? void 0 : _26.hideExportCSV)
|
|
563
571
|
? {
|
|
564
572
|
text: "Export CSV",
|
|
565
573
|
onClick: function () {
|
|
@@ -569,7 +577,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
569
577
|
},
|
|
570
578
|
}
|
|
571
579
|
: null,
|
|
572
|
-
!((
|
|
580
|
+
!((_28 = (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.exportSettings) === null || _28 === void 0 ? void 0 : _28.hideExportExcel)
|
|
573
581
|
? {
|
|
574
582
|
text: "Export Excel",
|
|
575
583
|
onClick: function () {
|
|
@@ -579,7 +587,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
579
587
|
},
|
|
580
588
|
}
|
|
581
589
|
: null,
|
|
582
|
-
!((
|
|
590
|
+
!((_30 = (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.exportSettings) === null || _30 === void 0 ? void 0 : _30.hideExportPDF)
|
|
583
591
|
? {
|
|
584
592
|
text: "Export PDF",
|
|
585
593
|
onClick: function () {
|
|
@@ -589,7 +597,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
589
597
|
},
|
|
590
598
|
}
|
|
591
599
|
: null,
|
|
592
|
-
!((
|
|
600
|
+
!((_32 = (_31 = props.organise) === null || _31 === void 0 ? void 0 : _31.exportSettings) === null || _32 === void 0 ? void 0 : _32.hideExportQR)
|
|
593
601
|
? {
|
|
594
602
|
text: "Export QR",
|
|
595
603
|
onClick: function () {
|
|
@@ -599,7 +607,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
599
607
|
},
|
|
600
608
|
}
|
|
601
609
|
: null,
|
|
602
|
-
!((
|
|
610
|
+
!((_34 = (_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.exportSettings) === null || _34 === void 0 ? void 0 : _34.hideExportQR)
|
|
603
611
|
? {
|
|
604
612
|
text: "Export QR(Data)",
|
|
605
613
|
onClick: function () {
|
|
@@ -609,7 +617,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
609
617
|
},
|
|
610
618
|
}
|
|
611
619
|
: null,
|
|
612
|
-
!((
|
|
620
|
+
!((_36 = (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.exportSettings) === null || _36 === void 0 ? void 0 : _36.hideExportPrint)
|
|
613
621
|
? {
|
|
614
622
|
text: "Print",
|
|
615
623
|
onClick: function () {
|
|
@@ -619,7 +627,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
619
627
|
},
|
|
620
628
|
}
|
|
621
629
|
: null,
|
|
622
|
-
!((
|
|
630
|
+
!((_38 = (_37 = props.organise) === null || _37 === void 0 ? void 0 : _37.exportSettings) === null || _38 === void 0 ? void 0 : _38.hideExportDraft)
|
|
623
631
|
? {
|
|
624
632
|
text: filterDraft ? "Show All Items" : "Filter Draft",
|
|
625
633
|
onClick: function () {
|
|
@@ -628,9 +636,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
628
636
|
}
|
|
629
637
|
: null,
|
|
630
638
|
].filter(Boolean);
|
|
631
|
-
if ((
|
|
639
|
+
if ((_39 = props.organise) === null || _39 === void 0 ? void 0 : _39.moreSettings)
|
|
632
640
|
moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
|
|
633
641
|
//=====================================================================================
|
|
642
|
+
//SECTION: User Column Visibility Handlers
|
|
643
|
+
//=====================================================================================
|
|
644
|
+
var handleToggleUserHiddenColumn = function (columnId) {
|
|
645
|
+
setUserHiddenColumnIds(function (prevIds) {
|
|
646
|
+
return prevIds.includes(columnId)
|
|
647
|
+
? prevIds.filter(function (eachId) { return eachId !== columnId; })
|
|
648
|
+
: __spreadArray(__spreadArray([], prevIds, true), [columnId], false);
|
|
649
|
+
});
|
|
650
|
+
};
|
|
651
|
+
var handleShowAllUserHiddenColumns = function () {
|
|
652
|
+
setUserHiddenColumnIds([]);
|
|
653
|
+
};
|
|
654
|
+
//=====================================================================================
|
|
634
655
|
//SECTION: Flex Filter Handlers
|
|
635
656
|
//=====================================================================================
|
|
636
657
|
// INFO: cancel any pending value-typing timer before setting flexFiltersDebounced
|
|
@@ -755,6 +776,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
755
776
|
};
|
|
756
777
|
(0, react_1.useImperativeHandle)(ref, function () { return ({
|
|
757
778
|
handleRefresh: handleRefresh,
|
|
779
|
+
// INFO: refetches whatever is currently mounted without touching pageIndex, cursor or
|
|
780
|
+
// filters. handleRefresh clears those (handleClearDataByFilter resets pageIndex to 0),
|
|
781
|
+
// which is right when the caller wants a clean slate but wrong when it only needs the
|
|
782
|
+
// data reloaded in place — e.g. reflecting a write made in an overlay without bouncing
|
|
783
|
+
// the user back to page 1.
|
|
784
|
+
handleRefreshCurrentPage: function () {
|
|
785
|
+
var _a, _b;
|
|
786
|
+
(_a = listRQueryHocRef.current) === null || _a === void 0 ? void 0 : _a.handleRefresh();
|
|
787
|
+
(_b = readQueryHocRef.current) === null || _b === void 0 ? void 0 : _b.handleRefresh();
|
|
788
|
+
},
|
|
758
789
|
handleFormSubmit: handleFormSubmit,
|
|
759
790
|
handleFormCheck: handleFormCheck,
|
|
760
791
|
handlePopUpModal: handlePopUpModal,
|
|
@@ -806,6 +837,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
806
837
|
// a mid-scroll pageIndex would skip rows on next hydration.
|
|
807
838
|
pageIndex: renderCheckScrollMode() ? 0 : pageIndex,
|
|
808
839
|
hiddenColumnIds: structure.filter(function (col) { return col.hide; }).map(function (col) { return col.id; }),
|
|
840
|
+
// INFO: stored raw rather than through getActiveUserHiddenColumnIds so a
|
|
841
|
+
// consumer temporarily switching hideColumnEnabled off does not wipe the
|
|
842
|
+
// user's saved choice.
|
|
843
|
+
userHiddenColumnIds: userHiddenColumnIds,
|
|
809
844
|
columnOrder: structure.map(function (col) { return col.id; }),
|
|
810
845
|
});
|
|
811
846
|
}, [
|
|
@@ -817,6 +852,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
817
852
|
pageIndex,
|
|
818
853
|
structure,
|
|
819
854
|
persistedSort,
|
|
855
|
+
userHiddenColumnIds,
|
|
820
856
|
]);
|
|
821
857
|
(0, react_1.useEffect)(function () {
|
|
822
858
|
handleCheckOfflineDataLength();
|
|
@@ -829,7 +865,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
829
865
|
(0, react_1.useEffect)(function () {
|
|
830
866
|
handleOfflinePrefetch();
|
|
831
867
|
/* eslint-disable */
|
|
832
|
-
}, [props.collectionId, (
|
|
868
|
+
}, [props.collectionId, (_40 = props.bareSettings) === null || _40 === void 0 ? void 0 : _40.bareOffline]);
|
|
833
869
|
/* eslint-enable */
|
|
834
870
|
// INFO: MRQ polling — calls handleRefresh every N ms (e.g. 1500) as a fallback.
|
|
835
871
|
// Calls through handleRefreshRef so the interval always dispatches the latest
|
|
@@ -849,7 +885,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
849
885
|
}, interval);
|
|
850
886
|
return function () { return clearInterval(timer); };
|
|
851
887
|
/* eslint-disable */
|
|
852
|
-
}, [(
|
|
888
|
+
}, [(_41 = props.bareSettings) === null || _41 === void 0 ? void 0 : _41.barePollingInterval, isLive, isNetworkOffline]);
|
|
853
889
|
/* eslint-enable */
|
|
854
890
|
// INFO: Pub/Sub → SSE live-stream — driven by bareSettings.bareSocketName
|
|
855
891
|
// EventSource URL: {sseEndpoint}/{room}?bm_apiToken={token}
|
|
@@ -891,7 +927,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
891
927
|
};
|
|
892
928
|
/* eslint-disable */
|
|
893
929
|
}, [
|
|
894
|
-
(
|
|
930
|
+
(_42 = props.bareSettings) === null || _42 === void 0 ? void 0 : _42.bareSocketName,
|
|
895
931
|
props.collectionId,
|
|
896
932
|
props.devSettings.sseEndpoint,
|
|
897
933
|
props.devSettings.dbAPIToken,
|
|
@@ -1130,10 +1166,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1130
1166
|
props.collectionId,
|
|
1131
1167
|
props.model,
|
|
1132
1168
|
props.localURLEndpoint,
|
|
1133
|
-
(
|
|
1134
|
-
(
|
|
1135
|
-
(
|
|
1136
|
-
(
|
|
1169
|
+
(_43 = props.organise) === null || _43 === void 0 ? void 0 : _43.extendedTabs,
|
|
1170
|
+
(_44 = props.organise) === null || _44 === void 0 ? void 0 : _44.viewId,
|
|
1171
|
+
(_45 = props.organise) === null || _45 === void 0 ? void 0 : _45.additionalQuery,
|
|
1172
|
+
(_46 = props.organise) === null || _46 === void 0 ? void 0 : _46.groupBy,
|
|
1137
1173
|
props.type,
|
|
1138
1174
|
]);
|
|
1139
1175
|
(0, react_1.useEffect)(function () {
|
|
@@ -1223,7 +1259,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1223
1259
|
};
|
|
1224
1260
|
}, 100);
|
|
1225
1261
|
return function () { return clearTimeout(timeoutId); };
|
|
1226
|
-
}, [(
|
|
1262
|
+
}, [(_47 = props.organise) === null || _47 === void 0 ? void 0 : _47.showReadFloatingNav, props.type, props.id, loading]);
|
|
1227
1263
|
(0, react_1.useEffect)(function () {
|
|
1228
1264
|
if (props.type !== "read")
|
|
1229
1265
|
return;
|
|
@@ -1432,7 +1468,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1432
1468
|
switch (_a.label) {
|
|
1433
1469
|
case 0:
|
|
1434
1470
|
refFields = structure.filter(function (s) {
|
|
1435
|
-
return (
|
|
1471
|
+
return (utils_1.REFERENCE_DATA_TYPES.includes(s.type)) &&
|
|
1436
1472
|
s.referenceSpaceId &&
|
|
1437
1473
|
s.referenceLabel;
|
|
1438
1474
|
});
|
|
@@ -1519,7 +1555,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1519
1555
|
(0, listModule_1.handleDataEditButton)(tempData, (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListActionBtns);
|
|
1520
1556
|
return tempData;
|
|
1521
1557
|
})];
|
|
1522
|
-
case 2: return [2 /*return*/, (0, listModule_1.handleListDataBasedOnModel)(records, props.devSettings, (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios, structure, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.handleNavigate, ((_c = props.organise) === null || _c === void 0 ? void 0 : _c.viewId) === "general", setActivityModal, setActivityId, isActivityLog ? (_d = props.edit) === null || _d === void 0 ? void 0 : _d.activityLog : undefined, (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListActionBtns, (_f = props.edit) === null || _f === void 0 ? void 0 : _f.disabledUpdate)];
|
|
1558
|
+
case 2: return [2 /*return*/, (0, listModule_1.handleListDataBasedOnModel)(records, props.devSettings, (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios, structure, (_b = props.organise) === null || _b === void 0 ? void 0 : _b.handleNavigate, ((_c = props.organise) === null || _c === void 0 ? void 0 : _c.viewId) === "general", setActivityModal, setActivityId, isActivityLog ? (_d = props.edit) === null || _d === void 0 ? void 0 : _d.activityLog : undefined, (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListActionBtns, (_f = props.edit) === null || _f === void 0 ? void 0 : _f.disabledUpdate, undefined, handleSeedListReferenceOptions)];
|
|
1523
1559
|
}
|
|
1524
1560
|
});
|
|
1525
1561
|
}); };
|
|
@@ -1904,6 +1940,31 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1904
1940
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, props.type, props.id, id);
|
|
1905
1941
|
}
|
|
1906
1942
|
};
|
|
1943
|
+
// INFO: the list already fetches every referenced document once per page to
|
|
1944
|
+
// print labels. Re-shaping those docs into Select options and handing them
|
|
1945
|
+
// to the table renderers lets an inline-editable reference cell show its
|
|
1946
|
+
// current label immediately — otherwise the cell's Select has no options
|
|
1947
|
+
// until the user types into it, and renders blank.
|
|
1948
|
+
var handleSeedListReferenceOptions = function (details) {
|
|
1949
|
+
var seeded = {};
|
|
1950
|
+
Object.entries(details !== null && details !== void 0 ? details : {}).forEach(function (_a) {
|
|
1951
|
+
var eachKey = _a[0], eachDocs = _a[1];
|
|
1952
|
+
var model = structure.find(function (eachModel) { return eachModel.id === eachKey; });
|
|
1953
|
+
if (!model || !Array.isArray(eachDocs))
|
|
1954
|
+
return;
|
|
1955
|
+
seeded[eachKey] = eachDocs.map(function (eachDoc) {
|
|
1956
|
+
var _a, _b, _c;
|
|
1957
|
+
var option = {
|
|
1958
|
+
key: eachDoc[serverId],
|
|
1959
|
+
label: (_b = eachDoc[(_a = model.referenceLabel) !== null && _a !== void 0 ? _a : ""]) !== null && _b !== void 0 ? _b : (0, moduleUtils_1.renderReferenceStringAttribute)(eachDoc),
|
|
1960
|
+
};
|
|
1961
|
+
if (model.referenceSecondaryLabel)
|
|
1962
|
+
option.secondaryLabel = (_c = eachDoc[model.referenceSecondaryLabel]) !== null && _c !== void 0 ? _c : "-";
|
|
1963
|
+
return option;
|
|
1964
|
+
});
|
|
1965
|
+
});
|
|
1966
|
+
setListReferencesOptions(function (prev) { return (__assign(__assign({}, prev), seeded)); });
|
|
1967
|
+
};
|
|
1907
1968
|
var handleSetListData = function (newTableData, newSpaceTableData) {
|
|
1908
1969
|
var _a, _b, _c, _d, _e;
|
|
1909
1970
|
setTableData(newTableData);
|
|
@@ -1960,7 +2021,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1960
2021
|
});
|
|
1961
2022
|
prettierDataList = dummyPrettierDataList_1;
|
|
1962
2023
|
return [3 /*break*/, 5];
|
|
1963
|
-
case 3: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, structure, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.handleNavigate, ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.viewId) === "general", setActivityModal, setActivityId, isActivityLog ? (_e = props.edit) === null || _e === void 0 ? void 0 : _e.activityLog : undefined, (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListActionBtns, (_g = props.edit) === null || _g === void 0 ? void 0 : _g.disabledUpdate)];
|
|
2024
|
+
case 3: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_b = props.lib) === null || _b === void 0 ? void 0 : _b.axios, structure, (_c = props.organise) === null || _c === void 0 ? void 0 : _c.handleNavigate, ((_d = props.organise) === null || _d === void 0 ? void 0 : _d.viewId) === "general", setActivityModal, setActivityId, isActivityLog ? (_e = props.edit) === null || _e === void 0 ? void 0 : _e.activityLog : undefined, (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListActionBtns, (_g = props.edit) === null || _g === void 0 ? void 0 : _g.disabledUpdate, undefined, handleSeedListReferenceOptions)];
|
|
1964
2025
|
case 4:
|
|
1965
2026
|
prettierDataList = _o.sent();
|
|
1966
2027
|
if (props.groupId) {
|
|
@@ -2099,22 +2160,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2099
2160
|
return __generator(this, function (_a) {
|
|
2100
2161
|
switch (_a.label) {
|
|
2101
2162
|
case 0:
|
|
2102
|
-
if (!((eachModel.type
|
|
2103
|
-
eachModel.type === "listReference") &&
|
|
2163
|
+
if (!((utils_1.REFERENCE_DATA_TYPES.includes(eachModel.type)) &&
|
|
2104
2164
|
eachModel.referenceMapColumnId)) return [3 /*break*/, 2];
|
|
2105
2165
|
return [4 /*yield*/, (0, updateModule_1.handleRetrieveObjectReferenceOptions)(eachModel, clonedOptions_1, clonedDetails_1, selectedData, dbModule, devSettings, undefined, undefined, undefined, undefined, props.type === "read")];
|
|
2106
2166
|
case 1:
|
|
2107
2167
|
_a.sent();
|
|
2108
2168
|
_a.label = 2;
|
|
2109
2169
|
case 2:
|
|
2110
|
-
if (!((
|
|
2170
|
+
if (!((utils_1.OBJECT_DATA_TYPES.includes(eachModel.type)) &&
|
|
2111
2171
|
eachModel.objectData)) return [3 /*break*/, 4];
|
|
2112
2172
|
return [4 /*yield*/, Promise.all(eachModel.objectData.map(function (eachObjectData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2113
2173
|
return __generator(this, function (_a) {
|
|
2114
2174
|
switch (_a.label) {
|
|
2115
2175
|
case 0:
|
|
2116
|
-
if (!((eachObjectData.type
|
|
2117
|
-
eachObjectData.type === "listReference") &&
|
|
2176
|
+
if (!((utils_1.REFERENCE_DATA_TYPES.includes(eachObjectData.type)) &&
|
|
2118
2177
|
eachObjectData.referenceMapColumnId)) return [3 /*break*/, 2];
|
|
2119
2178
|
return [4 /*yield*/, (0, updateModule_1.handleRetrieveObjectReferenceOptions)(eachObjectData, clonedOptions_1, clonedDetails_1, selectedData, dbModule, devSettings, eachModel.id, eachModel.type === "listObject", selectedData, undefined, props.type === "read")];
|
|
2120
2179
|
case 1:
|
|
@@ -2337,16 +2396,25 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2337
2396
|
handlePopUpModal(false);
|
|
2338
2397
|
}
|
|
2339
2398
|
};
|
|
2399
|
+
var handleObjectCellEdit = function (rowId, columnId, data) {
|
|
2400
|
+
var _a;
|
|
2401
|
+
setObjectCellEdit({ rowId: rowId, columnId: columnId });
|
|
2402
|
+
setSelectedObjectStructureId(columnId);
|
|
2403
|
+
setSelectedObjectData((_a = data === null || data === void 0 ? void 0 : data[columnId]) !== null && _a !== void 0 ? _a : {});
|
|
2404
|
+
setSelectedObjectId("");
|
|
2405
|
+
handlePopUpModal(true);
|
|
2406
|
+
};
|
|
2340
2407
|
var handleSubmitObjectDataType = function () {
|
|
2341
|
-
var _a
|
|
2408
|
+
var _a;
|
|
2409
|
+
var _b, _c, _d;
|
|
2342
2410
|
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, showId);
|
|
2343
2411
|
var filterObjectModel = structure.find(function (eachModel) {
|
|
2344
2412
|
return eachModel.id === selectedObjectStructureId;
|
|
2345
2413
|
});
|
|
2346
|
-
var clonedSelectedObjectData = (0, updateModule_1.handleClonedDataAttribute)(selectedObjectData, (
|
|
2414
|
+
var clonedSelectedObjectData = (0, updateModule_1.handleClonedDataAttribute)(selectedObjectData, (_b = filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.objectData) !== null && _b !== void 0 ? _b : [], props.devSettings.server, true, true);
|
|
2347
2415
|
// Clean up canvas background images that were unselected or cleared
|
|
2348
2416
|
// If a canvas has backgroundImage with _cleared flag, clear it when modal closes
|
|
2349
|
-
(
|
|
2417
|
+
(_c = filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.objectData) === null || _c === void 0 ? void 0 : _c.forEach(function (eachAttribute) {
|
|
2350
2418
|
if (eachAttribute.type === "canvas" &&
|
|
2351
2419
|
eachAttribute.enableImageUpload &&
|
|
2352
2420
|
clonedSelectedObjectData[eachAttribute.id] &&
|
|
@@ -2398,7 +2466,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2398
2466
|
}
|
|
2399
2467
|
else {
|
|
2400
2468
|
//INFO: [UPDATE] Updating an object field
|
|
2401
|
-
var clonedSelectedObjectData_1 = (0, updateModule_1.handleClonedDataAttribute)(selectedObjectData, (
|
|
2469
|
+
var clonedSelectedObjectData_1 = (0, updateModule_1.handleClonedDataAttribute)(selectedObjectData, (_d = filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.objectData) !== null && _d !== void 0 ? _d : [], props.devSettings.server, true);
|
|
2470
|
+
if (objectCellEdit) {
|
|
2471
|
+
handleSubmitData("update", objectCellEdit.rowId, objectCellEdit.columnId, (_a = {},
|
|
2472
|
+
_a[objectCellEdit.columnId] = clonedSelectedObjectData_1,
|
|
2473
|
+
_a));
|
|
2474
|
+
setObjectCellEdit(null);
|
|
2475
|
+
setSelectedObjectStructureId("");
|
|
2476
|
+
setSelectedObjectData({});
|
|
2477
|
+
handlePopUpModal(false);
|
|
2478
|
+
return;
|
|
2479
|
+
}
|
|
2402
2480
|
clonedSelectedData[selectedObjectStructureId] = clonedSelectedObjectData_1;
|
|
2403
2481
|
setSelectedData(clonedSelectedData);
|
|
2404
2482
|
}
|
|
@@ -2946,8 +3024,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2946
3024
|
case 1:
|
|
2947
3025
|
_a.sent();
|
|
2948
3026
|
multiImageAttribute = model.filter(function (eachAttribute) {
|
|
2949
|
-
return (eachAttribute.type
|
|
2950
|
-
eachAttribute.type === "multipleFile");
|
|
3027
|
+
return (utils_1.MULTIPLE_ASSET_DATA_TYPES.includes(eachAttribute.type));
|
|
2951
3028
|
});
|
|
2952
3029
|
return [4 /*yield*/, Promise.all(multiImageAttribute.map(function (eachImage) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2953
3030
|
var _a, _b, _c, _d;
|
|
@@ -4679,7 +4756,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4679
4756
|
return __generator(this, function (_c) {
|
|
4680
4757
|
switch (_c.label) {
|
|
4681
4758
|
case 0:
|
|
4682
|
-
isObject =
|
|
4759
|
+
isObject = utils_1.OBJECT_DATA_TYPES.includes(eachModel.type);
|
|
4683
4760
|
return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", eachModel.referenceSpaceId + "-ref")];
|
|
4684
4761
|
case 1:
|
|
4685
4762
|
offlineDataResp = _c.sent();
|
|
@@ -4690,8 +4767,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4690
4767
|
// INFO: convert raw docs to Option[] format so reference Select
|
|
4691
4768
|
// components receive { key, label, secondaryLabel } as expected
|
|
4692
4769
|
// (mirrors the shape handleRetrieveObjectReferenceOptions builds online)
|
|
4693
|
-
if ((eachModel.type
|
|
4694
|
-
eachModel.type === "listReference") &&
|
|
4770
|
+
if ((utils_1.REFERENCE_DATA_TYPES.includes(eachModel.type)) &&
|
|
4695
4771
|
eachModel.referenceLabel) {
|
|
4696
4772
|
clonedReferencesOptions_1[eachModel.id] = offlineData.map(function (r) {
|
|
4697
4773
|
var _a, _b, _c, _d;
|
|
@@ -5149,15 +5225,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5149
5225
|
var selectedModel = structure.find(function (eachModel) {
|
|
5150
5226
|
return eachModel.id === eachValue;
|
|
5151
5227
|
});
|
|
5152
|
-
if ((selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "object" ||
|
|
5153
|
-
(selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "listObject") {
|
|
5228
|
+
if ((selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "object" || (selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "listObject") {
|
|
5154
5229
|
var selectedObjectModel = (_c = selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.objectData) === null || _c === void 0 ? void 0 : _c.find(function (eachModel) {
|
|
5155
5230
|
return eachModel.id === listCSVObjAttribute[eachKey];
|
|
5156
5231
|
});
|
|
5157
5232
|
if ((selectedObjectModel === null || selectedObjectModel === void 0 ? void 0 : selectedObjectModel.type) === "image" ||
|
|
5158
5233
|
(selectedObjectModel === null || selectedObjectModel === void 0 ? void 0 : selectedObjectModel.type) === "file" ||
|
|
5159
|
-
(selectedObjectModel === null || selectedObjectModel === void 0 ? void 0 : selectedObjectModel.type) === "multipleFile"
|
|
5160
|
-
(selectedObjectModel === null || selectedObjectModel === void 0 ? void 0 : selectedObjectModel.type) === "multipleImage") {
|
|
5234
|
+
(selectedObjectModel === null || selectedObjectModel === void 0 ? void 0 : selectedObjectModel.type) === "multipleImage" || (selectedObjectModel === null || selectedObjectModel === void 0 ? void 0 : selectedObjectModel.type) === "multipleFile") {
|
|
5161
5235
|
csvList_1.push({
|
|
5162
5236
|
id: (_d = listCSVObjAttribute[eachKey]) !== null && _d !== void 0 ? _d : "",
|
|
5163
5237
|
ori: Number(eachKey),
|
|
@@ -5181,8 +5255,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5181
5255
|
}
|
|
5182
5256
|
else if ((selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "image" ||
|
|
5183
5257
|
(selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "file" ||
|
|
5184
|
-
(selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "multipleFile"
|
|
5185
|
-
(selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "multipleImage") {
|
|
5258
|
+
(selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "multipleImage" || (selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "multipleFile") {
|
|
5186
5259
|
csvList_1.push({
|
|
5187
5260
|
id: eachValue !== null && eachValue !== void 0 ? eachValue : "",
|
|
5188
5261
|
ori: Number(eachKey),
|
|
@@ -5214,8 +5287,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5214
5287
|
if (!eachEachModel.optional) {
|
|
5215
5288
|
// INFO : Validate and compare the modal with csv list and return true if > 1 consist within
|
|
5216
5289
|
var innearValidation = csvList_1.some(function (eachCsvList) {
|
|
5217
|
-
if (eachCsvList.type
|
|
5218
|
-
eachCsvList.type === "listObject") {
|
|
5290
|
+
if (utils_1.OBJECT_DATA_TYPES.includes(eachCsvList.type)) {
|
|
5219
5291
|
return eachEachModel.id === eachCsvList.objectId;
|
|
5220
5292
|
}
|
|
5221
5293
|
else {
|
|
@@ -5817,6 +5889,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5817
5889
|
setExportQR(false);
|
|
5818
5890
|
setSelectedObjectId("");
|
|
5819
5891
|
setSelectedObjectStructureId("");
|
|
5892
|
+
setObjectCellEdit(null);
|
|
5820
5893
|
setSelectedListAddress({ lat: 0, lng: 0, name: "" });
|
|
5821
5894
|
setSelectedListAddressId("");
|
|
5822
5895
|
setSelectedListAddressIndex(-1);
|
|
@@ -5966,21 +6039,76 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5966
6039
|
//=====================================================================================
|
|
5967
6040
|
//SECTION: Render CRUD
|
|
5968
6041
|
//=====================================================================================
|
|
6042
|
+
// INFO: columns the end user is allowed to toggle via organise.hideColumnEnabled.
|
|
6043
|
+
// Developer-hidden columns (DataStructure.hide) are excluded on purpose —
|
|
6044
|
+
// a developer hiding a column is not a preference the user may override — as
|
|
6045
|
+
// are the id fields and anything that never becomes a column anyway.
|
|
6046
|
+
var getTogglableColumns = function () {
|
|
6047
|
+
return structure.filter(function (eachAttribute) {
|
|
6048
|
+
var _a;
|
|
6049
|
+
if (eachAttribute.id === "_id" ||
|
|
6050
|
+
eachAttribute.id === "id" ||
|
|
6051
|
+
eachAttribute.id === "baseDraft" ||
|
|
6052
|
+
eachAttribute.hide ||
|
|
6053
|
+
utils_1.NON_TABLE_COLUMN_DATA_TYPES.includes(eachAttribute.type)) {
|
|
6054
|
+
return false;
|
|
6055
|
+
}
|
|
6056
|
+
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showBaseUpdatedAt) &&
|
|
6057
|
+
eachAttribute.id === "baseUpdatedAt") {
|
|
6058
|
+
return false;
|
|
6059
|
+
}
|
|
6060
|
+
return true;
|
|
6061
|
+
});
|
|
6062
|
+
};
|
|
6063
|
+
// INFO: user hides are only honoured while the feature is switched on, so
|
|
6064
|
+
// turning the prop off restores every column without clearing stored state.
|
|
6065
|
+
var getActiveUserHiddenColumnIds = function () {
|
|
6066
|
+
var _a;
|
|
6067
|
+
if (schemaPresent || !((_a = props.organise) === null || _a === void 0 ? void 0 : _a.hideColumnEnabled))
|
|
6068
|
+
return [];
|
|
6069
|
+
return userHiddenColumnIds;
|
|
6070
|
+
};
|
|
6071
|
+
// INFO: counted off the togglable list rather than the raw array so ids left
|
|
6072
|
+
// over from an older schema can never inflate the badge.
|
|
6073
|
+
var getUserHiddenColumnCount = function () {
|
|
6074
|
+
var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
|
|
6075
|
+
return getTogglableColumns().filter(function (eachColumn) {
|
|
6076
|
+
return activeUserHiddenColumnIds.includes(eachColumn.id);
|
|
6077
|
+
}).length;
|
|
6078
|
+
};
|
|
6079
|
+
var renderHideColumnPopupContent = function () {
|
|
6080
|
+
var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
|
|
6081
|
+
var togglableColumns = getTogglableColumns();
|
|
6082
|
+
var visibleCount = togglableColumns.filter(function (eachColumn) { return !activeUserHiddenColumnIds.includes(eachColumn.id); }).length;
|
|
6083
|
+
return (react_1.default.createElement("div", { className: "shadow-lg bg-white rounded-md p-4 flex flex-col w-[calc(100vw-2rem)] max-w-[280px]" },
|
|
6084
|
+
react_1.default.createElement("div", { className: "flex flex-row items-center" },
|
|
6085
|
+
react_1.default.createElement("p", { className: "text-sm font-medium text-gray-700" }, "Columns"),
|
|
6086
|
+
react_1.default.createElement("div", { className: "grow" }),
|
|
6087
|
+
activeUserHiddenColumnIds.length > 0 && (react_1.default.createElement(textButton_1.TextButton, { text: "Show all", onClick: handleShowAllUserHiddenColumns }))),
|
|
6088
|
+
react_1.default.createElement("div", { className: "flex flex-col mt-2 overflow-y-auto max-h-72" }, togglableColumns.map(function (eachColumn) {
|
|
6089
|
+
var isHidden = activeUserHiddenColumnIds.includes(eachColumn.id);
|
|
6090
|
+
// INFO: an empty table header breaks both table renderers, so the
|
|
6091
|
+
// last visible column stays locked until another one is shown.
|
|
6092
|
+
var isLocked = !isHidden && visibleCount <= 1;
|
|
6093
|
+
return (react_1.default.createElement("button", { key: eachColumn.id, type: "button", disabled: isLocked, "aria-pressed": !isHidden, "data-testid": "dtw-hide-column-".concat(eachColumn.id), className: "flex flex-row items-center py-2 text-sm text-left ".concat(isLocked
|
|
6094
|
+
? "opacity-50 cursor-not-allowed"
|
|
6095
|
+
: "cursor-pointer hover:text-primary-600"), onClick: function () {
|
|
6096
|
+
handleToggleUserHiddenColumn(eachColumn.id);
|
|
6097
|
+
} },
|
|
6098
|
+
react_1.default.createElement("span", { className: "pr-3 truncate grow" }, eachColumn.name),
|
|
6099
|
+
isHidden ? (react_1.default.createElement(outline_1.EyeSlashIcon, { className: "w-4 h-4 text-gray-400 shrink-0" })) : (react_1.default.createElement(outline_1.EyeIcon, { className: "w-4 h-4 text-primary-600 shrink-0" }))));
|
|
6100
|
+
}))));
|
|
6101
|
+
};
|
|
5969
6102
|
var renderTableHeader = function () {
|
|
5970
6103
|
var _a, _b;
|
|
5971
6104
|
var tableHeader = [];
|
|
6105
|
+
var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
|
|
5972
6106
|
structure.map(function (eachAttribute) {
|
|
5973
6107
|
var _a;
|
|
5974
6108
|
if (eachAttribute.id === "baseDraft" ||
|
|
5975
|
-
eachAttribute.type
|
|
5976
|
-
eachAttribute.
|
|
5977
|
-
eachAttribute.
|
|
5978
|
-
eachAttribute.type === "multipleFile" ||
|
|
5979
|
-
eachAttribute.type === "markdown" ||
|
|
5980
|
-
eachAttribute.type === "signature" ||
|
|
5981
|
-
eachAttribute.type === "ganttchart" ||
|
|
5982
|
-
eachAttribute.type === "canvas" ||
|
|
5983
|
-
eachAttribute.hide) {
|
|
6109
|
+
utils_1.NON_TABLE_COLUMN_DATA_TYPES.includes(eachAttribute.type) ||
|
|
6110
|
+
eachAttribute.hide ||
|
|
6111
|
+
activeUserHiddenColumnIds.includes(eachAttribute.id)) {
|
|
5984
6112
|
return null;
|
|
5985
6113
|
}
|
|
5986
6114
|
if (!((_a = props.organise) === null || _a === void 0 ? void 0 : _a.showBaseUpdatedAt) &&
|
|
@@ -6034,14 +6162,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6034
6162
|
};
|
|
6035
6163
|
var renderDetailListData = function (model) {
|
|
6036
6164
|
var detailList = [];
|
|
6037
|
-
var exludedDataTypes = [
|
|
6038
|
-
"listObject",
|
|
6039
|
-
"listAddress",
|
|
6040
|
-
"ganttchart",
|
|
6041
|
-
"canvas",
|
|
6042
|
-
];
|
|
6043
6165
|
model
|
|
6044
|
-
.filter(function (eachAttribute) { return !
|
|
6166
|
+
.filter(function (eachAttribute) { return !utils_1.NON_DETAIL_LIST_DATA_TYPES.includes(eachAttribute.type); })
|
|
6045
6167
|
.map(function (eachAttribute) {
|
|
6046
6168
|
var _a, _b, _c, _d, _e, _f;
|
|
6047
6169
|
var selectedDataKey = Object.keys(selectedData).find(function (eachKey) { return eachKey === eachAttribute.id; });
|
|
@@ -6306,7 +6428,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6306
6428
|
});
|
|
6307
6429
|
return canvasElement;
|
|
6308
6430
|
};
|
|
6309
|
-
|
|
6431
|
+
// INFO: placement is decided by the caller (see isBottom in renderContent), so this only
|
|
6432
|
+
// builds the buttons. It previously took an isBottom argument purely to add a top margin
|
|
6433
|
+
// to the list's create button when that button was pushed below the table.
|
|
6434
|
+
var renderActionButtons = function (type, hasTabAlign, uniqueTabIds) {
|
|
6310
6435
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
6311
6436
|
var bareActionComponent = (_c = (_b = (_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionComponent) === null || _b === void 0 ? void 0 : _b.call(_a, selectedData, formRef)) !== null && _c !== void 0 ? _c : undefined;
|
|
6312
6437
|
if (type === "read") {
|
|
@@ -6404,11 +6529,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6404
6529
|
hasNavigation ? (react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-create", icon: react_1.default.createElement(outline_1.PlusIcon, { className: "h-7 w-7 text-white" }), background: "bg-primary-500 hover:bg-primary-600", onClick: function () {
|
|
6405
6530
|
var _a, _b;
|
|
6406
6531
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "update", "new");
|
|
6407
|
-
}
|
|
6408
|
-
react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-create", icon: react_1.default.createElement(outline_1.PlusIcon, { className: "h-7 w-7 text-white" }), background: "bg-primary-500 hover:bg-primary-600"
|
|
6532
|
+
} })) : (react_1.default.createElement(link_1.Link, { href: "".concat(props.localURLEndpoint, "?data=new&type=update&collection=").concat(props.collectionId), linkType: props.linkType, custom: props.custom },
|
|
6533
|
+
react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-create", icon: react_1.default.createElement(outline_1.PlusIcon, { className: "h-7 w-7 text-white" }), background: "bg-primary-500 hover:bg-primary-600" }))),
|
|
6409
6534
|
offlineDataLength > 0 && (react_1.default.createElement(iconButton_1.IconButton, { icon: react_1.default.createElement(solid_1.CloudArrowUpIcon, { className: "h-7 w-7 text-white" }), background: "bg-primary-500 hover:bg-primary-600", onClick: function () {
|
|
6410
6535
|
handlePopUpModal(true, "offline");
|
|
6411
|
-
}
|
|
6536
|
+
} }))));
|
|
6412
6537
|
}
|
|
6413
6538
|
if (listActionBtns.length > 0) {
|
|
6414
6539
|
return react_1.default.createElement(react_1.default.Fragment, null, listActionBtns);
|
|
@@ -6544,6 +6669,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6544
6669
|
switch (props.type) {
|
|
6545
6670
|
case "read":
|
|
6546
6671
|
var anyAuthMethod = Object.values(authMethods).some(function (value) { return value; });
|
|
6672
|
+
var hasReadHeading = !!(props.title || props.description);
|
|
6547
6673
|
pages.push({
|
|
6548
6674
|
name: (_d = selectedData === null || selectedData === void 0 ? void 0 : selectedData[(_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.breadcrumbAttributeId) !== null && _c !== void 0 ? _c : serverId]) !== null && _d !== void 0 ? _d : (props.id ? props.id : "new"),
|
|
6549
6675
|
href: "#",
|
|
@@ -6565,8 +6691,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6565
6691
|
!loading && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
6566
6692
|
renderBreadcrumb(pages),
|
|
6567
6693
|
react_1.default.createElement("div", null,
|
|
6568
|
-
react_1.default.createElement("div", { className: "flex flex-col
|
|
6569
|
-
|
|
6694
|
+
react_1.default.createElement("div", { className: "flex flex-col sm:py-2 sm:items-center sm:flex-row ".concat(hasReadHeading ? "justify-between" : "sm:justify-end") },
|
|
6695
|
+
hasReadHeading && (react_1.default.createElement("div", { className: "flex flex-col" },
|
|
6570
6696
|
props.title && (react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title)),
|
|
6571
6697
|
props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
|
|
6572
6698
|
!isBottom && renderActionButtons(props.type))),
|
|
@@ -6578,7 +6704,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6578
6704
|
!((_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareReadComponentHide) && (react_1.default.createElement("div", null, renderTabContent(tabs, props.type, viewType))),
|
|
6579
6705
|
((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareReadComponentPos) !== "top" &&
|
|
6580
6706
|
renderBareReadComp()),
|
|
6581
|
-
isBottom &&
|
|
6707
|
+
isBottom && (
|
|
6708
|
+
// INFO: matches the update view's bottom bar, which is already sm:justify-end
|
|
6709
|
+
react_1.default.createElement("div", { className: "flex sm:justify-end" }, renderActionButtons(props.type)))))));
|
|
6582
6710
|
case "update":
|
|
6583
6711
|
if (props.id !== "new") {
|
|
6584
6712
|
pages.push({
|
|
@@ -6598,8 +6726,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6598
6726
|
var _a;
|
|
6599
6727
|
var present = false;
|
|
6600
6728
|
if (eachModel.type === "markdown" ||
|
|
6601
|
-
eachModel.type
|
|
6602
|
-
eachModel.type === "listObject" ||
|
|
6729
|
+
utils_1.OBJECT_DATA_TYPES.includes(eachModel.type) ||
|
|
6603
6730
|
eachModel.type === "textArea") {
|
|
6604
6731
|
disabledOnEnter_1 = true;
|
|
6605
6732
|
}
|
|
@@ -6760,7 +6887,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6760
6887
|
props.title && (react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title)),
|
|
6761
6888
|
props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
|
|
6762
6889
|
!isBottom &&
|
|
6763
|
-
renderActionButtons(props.type,
|
|
6890
|
+
renderActionButtons(props.type, hasTabAlign_1, uniqueTabIds_2)),
|
|
6764
6891
|
hasTabAlign_1 ? (react_1.default.createElement("div", { className: "w-full ".concat(leftTabAlign
|
|
6765
6892
|
? "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-5"
|
|
6766
6893
|
: "") },
|
|
@@ -6800,7 +6927,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6800
6927
|
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(props.type)),
|
|
6801
6928
|
react_1.default.createElement("div", { className: "mt-8" }, renderListObject(props.type)),
|
|
6802
6929
|
isBottom &&
|
|
6803
|
-
renderActionButtons(props.type,
|
|
6930
|
+
renderActionButtons(props.type, hasTabAlign_1, uniqueTabIds_2)))) : (react_1.default.createElement("div", null,
|
|
6804
6931
|
((_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareUpdateComponentAbove) &&
|
|
6805
6932
|
((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareUpdateComponent) &&
|
|
6806
6933
|
((_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareUpdateComponent(selectedData)),
|
|
@@ -6812,7 +6939,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6812
6939
|
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(props.type)),
|
|
6813
6940
|
react_1.default.createElement("div", { className: "mt-8" }, renderListObject(props.type)),
|
|
6814
6941
|
isBottom &&
|
|
6815
|
-
renderActionButtons(props.type,
|
|
6942
|
+
renderActionButtons(props.type, hasTabAlign_1, uniqueTabIds_2)))));
|
|
6816
6943
|
case "list":
|
|
6817
6944
|
case "union":
|
|
6818
6945
|
var filterComponent_1 = renderSearchContent();
|
|
@@ -6881,7 +7008,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6881
7008
|
return null;
|
|
6882
7009
|
};
|
|
6883
7010
|
var renderListActionElements = function () {
|
|
6884
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u;
|
|
7011
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
6885
7012
|
var actionElementList = [];
|
|
6886
7013
|
if (schemaPresent) {
|
|
6887
7014
|
actionElementList.push(react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -6915,8 +7042,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6915
7042
|
actionElementList.push(react_1.default.createElement(popUp_1.PopUp, { ctaComp: react_1.default.createElement(iconButton_1.IconButton, { icon: react_1.default.createElement(outline_1.FunnelIcon, { className: "h-7 w-7 text-primary-500" }), bgColor: "bg-white" }), renderComp: react_1.default.createElement("div", { className: "shadow-lg p-4 flex flex-col space-y-3 w-[calc(100vw-2rem)] max-w-[320px]" }, popupFilters.map(function (filterEl, index) { return (react_1.default.createElement("div", { key: index }, filterEl)); })), anchor: "right", excludePortalIds: ["datepicker-portal"], lib: { Transition: (_f = props === null || props === void 0 ? void 0 : props.lib) === null || _f === void 0 ? void 0 : _f.Transition } }));
|
|
6916
7043
|
}
|
|
6917
7044
|
}
|
|
7045
|
+
// INFO: User column hiding — the schemaPresent path already exposes
|
|
7046
|
+
// OverviewModal, which writes hide back to the schema in the database.
|
|
7047
|
+
// This one is the client-only counterpart for bare DTWs.
|
|
7048
|
+
if (!schemaPresent && ((_g = props.organise) === null || _g === void 0 ? void 0 : _g.hideColumnEnabled)) {
|
|
7049
|
+
var hiddenColumnCount = getUserHiddenColumnCount();
|
|
7050
|
+
actionElementList.push(react_1.default.createElement(popUp_1.PopUp, { ctaComp: react_1.default.createElement("div", { className: "relative w-fit h-fit" },
|
|
7051
|
+
hiddenColumnCount > 0 && (react_1.default.createElement("div", { "data-testid": "dtw-hide-columns-count", className: "absolute top-0 right-0 translate-x-1/4 -translate-y-1/4 z-[1] rounded-full bg-primary-500 text-white flex items-center justify-center w-5 h-5 text-[10px]" }, hiddenColumnCount)),
|
|
7052
|
+
react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-hide-columns-btn", icon: react_1.default.createElement(outline_1.EyeSlashIcon, { className: "h-7 w-7 ".concat(hiddenColumnCount > 0
|
|
7053
|
+
? "text-white"
|
|
7054
|
+
: "text-primary-500") }), bgColor: hiddenColumnCount > 0 ? "bg-primary-500" : "bg-white" })), renderComp: renderHideColumnPopupContent(), anchor: "right", lib: { Transition: (_h = props === null || props === void 0 ? void 0 : props.lib) === null || _h === void 0 ? void 0 : _h.Transition } }));
|
|
7055
|
+
}
|
|
6918
7056
|
// INFO: Flex filter — desktop uses PopUp, mobile uses Modal
|
|
6919
|
-
if ((
|
|
7057
|
+
if ((_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareFlexFilters) {
|
|
6920
7058
|
var flexActions = {
|
|
6921
7059
|
handleAddFilter: handleFlexFilterAdd,
|
|
6922
7060
|
handleRemoveFilter: handleFlexFilterRemove,
|
|
@@ -6929,16 +7067,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6929
7067
|
};
|
|
6930
7068
|
// INFO: Search input will only render above flex filters if bareListFilterAsPopup is true
|
|
6931
7069
|
var searchInput = !isFirebase &&
|
|
6932
|
-
((
|
|
6933
|
-
!((
|
|
7070
|
+
((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareListFilterAsPopup) &&
|
|
7071
|
+
!((_l = props.organise) === null || _l === void 0 ? void 0 : _l.hideSearch) &&
|
|
6934
7072
|
filterComponent_1 &&
|
|
6935
7073
|
Array.isArray(filterComponent_1) &&
|
|
6936
7074
|
filterComponent_1.length > 0
|
|
6937
7075
|
? filterComponent_1[filterComponent_1.length - 1]
|
|
6938
7076
|
: undefined;
|
|
6939
7077
|
var flexFilterLength_1 = activeFlexFilterCount_1;
|
|
6940
|
-
if (!((
|
|
6941
|
-
((
|
|
7078
|
+
if (!((_m = props.organise) === null || _m === void 0 ? void 0 : _m.hideSearch) &&
|
|
7079
|
+
((_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareListFilterAsPopup) &&
|
|
6942
7080
|
(filterSearchParams === null || filterSearchParams === void 0 ? void 0 : filterSearchParams["search"]))
|
|
6943
7081
|
flexFilterLength_1 += 1;
|
|
6944
7082
|
var flexFilterIconBtn = function (mobile) {
|
|
@@ -6948,26 +7086,27 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6948
7086
|
};
|
|
6949
7087
|
// INFO: Desktop — PopUp (hidden on mobile)
|
|
6950
7088
|
actionElementList.push(react_1.default.createElement("div", { className: "hidden md:block" },
|
|
6951
|
-
react_1.default.createElement(popUp_1.PopUp, { ctaComp: flexFilterIconBtn(), renderComp: (0, flexFilter_1.renderFlexFilterPopupContent)(flexFilters, structure, devSettings, dbModule, flexFilterReferenceOptions, flexFilterReferenceSearch, flexActions, (
|
|
7089
|
+
react_1.default.createElement(popUp_1.PopUp, { ctaComp: flexFilterIconBtn(), renderComp: (0, flexFilter_1.renderFlexFilterPopupContent)(flexFilters, structure, devSettings, dbModule, flexFilterReferenceOptions, flexFilterReferenceSearch, flexActions, (_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareListFilterQuery, searchInput, (_q = props.bareSettings) === null || _q === void 0 ? void 0 : _q.bareListFilterAddComponent), anchor: "right", excludePortalIds: ["datepicker-portal", "select-portal"], lib: { Transition: (_r = props === null || props === void 0 ? void 0 : props.lib) === null || _r === void 0 ? void 0 : _r.Transition } })));
|
|
6952
7090
|
// INFO: Mobile — IconButton that opens a Modal (hidden on desktop)
|
|
6953
7091
|
actionElementList.push(react_1.default.createElement("div", { className: "block md:hidden" },
|
|
6954
|
-
!((
|
|
7092
|
+
!((_s = props.bareSettings) === null || _s === void 0 ? void 0 : _s.bareListMobileFloatingSearch) &&
|
|
6955
7093
|
flexFilterIconBtn(true),
|
|
6956
|
-
(0, flexFilter_1.renderFlexFilterModal)(flexFilterModalOpen, flexFilters, structure, devSettings, dbModule, flexFilterReferenceOptions, flexFilterReferenceSearch, flexActions, function () { return setFlexFilterModalOpen(false); }, (
|
|
6957
|
-
}
|
|
6958
|
-
if (!isBottom) {
|
|
6959
|
-
var actionBtns = renderActionButtons(props.type);
|
|
6960
|
-
if (actionBtns)
|
|
6961
|
-
actionElementList.push(actionBtns);
|
|
7094
|
+
(0, flexFilter_1.renderFlexFilterModal)(flexFilterModalOpen, flexFilters, structure, devSettings, dbModule, flexFilterReferenceOptions, flexFilterReferenceSearch, flexActions, function () { return setFlexFilterModalOpen(false); }, (_t = props.bareSettings) === null || _t === void 0 ? void 0 : _t.bareListFilterQuery, searchInput, (_u = props.bareSettings) === null || _u === void 0 ? void 0 : _u.bareListFilterAddComponent)));
|
|
6962
7095
|
}
|
|
6963
|
-
|
|
7096
|
+
// INFO: bareUpdateActionBottom positions the read/update action bar. The list's own
|
|
7097
|
+
// create and offline-upload buttons stay in the filter row either way — they belong
|
|
7098
|
+
// with the controls they sit beside, not stranded below the table and pagination.
|
|
7099
|
+
var actionBtns = renderActionButtons(props.type);
|
|
7100
|
+
if (actionBtns)
|
|
7101
|
+
actionElementList.push(actionBtns);
|
|
7102
|
+
if (schemaPresent || ((_v = props.organise) === null || _v === void 0 ? void 0 : _v.showExport)) {
|
|
6964
7103
|
actionElementList.push(react_1.default.createElement(popUp_1.PopUp, { ctaComp: react_1.default.createElement(iconButton_1.IconButton, { className: "bg-primary-100", icon: react_1.default.createElement(solid_1.EllipsisVerticalIcon, { className: "h-7 w-7 text-primary-500" }), bgColor: "bg-white" }), renderComp: react_1.default.createElement("div", { className: "shadow-lg" }, moreButtonPopUp.map(function (eachPopup) { return (
|
|
6965
7104
|
//TODO: Bug - Crash on Next Js
|
|
6966
7105
|
// <Menu.Item>
|
|
6967
7106
|
react_1.default.createElement("span", { className: "block w-40 py-3 text-sm text-center text-gray-700 cursor-pointer hover:bg-gray-100", onClick: eachPopup === null || eachPopup === void 0 ? void 0 : eachPopup.onClick }, eachPopup === null || eachPopup === void 0 ? void 0 : eachPopup.text)
|
|
6968
7107
|
// </Menu.Item>
|
|
6969
7108
|
); })), lib: {
|
|
6970
|
-
Transition: (
|
|
7109
|
+
Transition: (_w = props === null || props === void 0 ? void 0 : props.lib) === null || _w === void 0 ? void 0 : _w.Transition,
|
|
6971
7110
|
} }));
|
|
6972
7111
|
}
|
|
6973
7112
|
if (actionElementList.length > 0) {
|
|
@@ -7033,7 +7172,6 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7033
7172
|
renderListNewRowFilterElements(),
|
|
7034
7173
|
(schemaPresent || ((_28 = props.bareSettings) === null || _28 === void 0 ? void 0 : _28.bareReadListTabs)) && (react_1.default.createElement(tabs_1.Tabs, { tabs: tabs, selectedId: viewType, linkType: props.linkType, custom: props.custom, onClick: function (id) { return handleSelectTab(id); }, darkMode: (_29 = props.organise) === null || _29 === void 0 ? void 0 : _29.darkMode })),
|
|
7035
7174
|
renderTabContent(tabs, props.type, viewType),
|
|
7036
|
-
isBottom && renderActionButtons(props.type, true),
|
|
7037
7175
|
((_30 = props.bareSettings) === null || _30 === void 0 ? void 0 : _30.bareListMobileFloatingSearch) &&
|
|
7038
7176
|
(0, listModule_1.renderFloatingMobileSearch)({
|
|
7039
7177
|
filterSearch: filterSearch,
|
|
@@ -7123,7 +7261,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7123
7261
|
var isKanban = (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.viewType) === "kanban";
|
|
7124
7262
|
var isListEditable = (_a = props.edit) === null || _a === void 0 ? void 0 : _a.listEditable;
|
|
7125
7263
|
var disableUpdate = (_b = props.edit) === null || _b === void 0 ? void 0 : _b.disabledUpdate;
|
|
7264
|
+
var activeUserHiddenColumnIds = getActiveUserHiddenColumnIds();
|
|
7126
7265
|
var titleKey = "";
|
|
7266
|
+
// INFO: titleModel ignores user hides so the card title stays stable
|
|
7267
|
+
// regardless of which columns the user chose to hide — shifting the title
|
|
7268
|
+
// when hiding the first column would be confusing in grid/kanban views.
|
|
7127
7269
|
var titleModel = structure.find(function (eachModel) {
|
|
7128
7270
|
return !eachModel.hide && eachModel.id !== "_id" && eachModel.id !== "id";
|
|
7129
7271
|
});
|
|
@@ -7161,13 +7303,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7161
7303
|
eachKey === "baseDraft" ||
|
|
7162
7304
|
eachKey === "update" ||
|
|
7163
7305
|
!selectedModel ||
|
|
7164
|
-
selectedModel.type
|
|
7165
|
-
selectedModel.type === "listObject" ||
|
|
7306
|
+
utils_1.OBJECT_DATA_TYPES.includes(selectedModel.type) ||
|
|
7166
7307
|
selectedModel.type === "file" ||
|
|
7167
7308
|
selectedModel.type === "multipleFile" ||
|
|
7168
7309
|
selectedModel.type === "ganttchart" ||
|
|
7169
7310
|
selectedModel.type === "canvas" ||
|
|
7170
7311
|
selectedModel.hide ||
|
|
7312
|
+
activeUserHiddenColumnIds.includes(eachKey) ||
|
|
7171
7313
|
eachKey === imageTag ||
|
|
7172
7314
|
eachValue === title ||
|
|
7173
7315
|
(structurePresent && (!modelInStructure || modelInStructure.hide))) {
|
|
@@ -7453,7 +7595,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7453
7595
|
react_1.default.createElement("div", { className: "font-semibold text-md mt-5" },
|
|
7454
7596
|
"Group By ",
|
|
7455
7597
|
eachKey),
|
|
7456
|
-
react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
7598
|
+
react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: filterTableData, spaceData: dataList !== null && dataList !== void 0 ? dataList : [], referencesOptions: listReferencesOptions, size: (_b = dataList.length) !== null && _b !== void 0 ? _b : 0, limit: 5, cursor: "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
7457
7599
|
selectedIds.length > 0 &&
|
|
7458
7600
|
!((_e = props.edit) === null || _e === void 0 ? void 0 : _e.disabledUpdate) &&
|
|
7459
7601
|
!((_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -7520,7 +7662,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7520
7662
|
}
|
|
7521
7663
|
});
|
|
7522
7664
|
}); },
|
|
7523
|
-
}, addable: {
|
|
7665
|
+
}, onObjectEdit: handleObjectCellEdit, addable: {
|
|
7524
7666
|
active: ((_2 = props.edit) === null || _2 === void 0 ? void 0 : _2.listAddable) ? true : false,
|
|
7525
7667
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7526
7668
|
return __generator(this, function (_a) {
|
|
@@ -7539,7 +7681,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7539
7681
|
else {
|
|
7540
7682
|
// INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
|
|
7541
7683
|
if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW) {
|
|
7542
|
-
return (react_1.default.createElement(newTable_1.NewTable, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.disableSelectFullData) === null || _c === void 0 ? void 0 : _c.table, maxSelectedCount: (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListMaxSelectedCount, mobileView: (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListMobileView, mobileTooltip: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (!((_g = props.edit) === null || _g === void 0 ? void 0 : _g.disabledUpdate) &&
|
|
7684
|
+
return (react_1.default.createElement(newTable_1.NewTable, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_c = (_b = props.organise) === null || _b === void 0 ? void 0 : _b.disableSelectFullData) === null || _c === void 0 ? void 0 : _c.table, maxSelectedCount: (_d = props.bareSettings) === null || _d === void 0 ? void 0 : _d.bareListMaxSelectedCount, mobileView: (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListMobileView, mobileTooltip: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (!((_g = props.edit) === null || _g === void 0 ? void 0 : _g.disabledUpdate) &&
|
|
7543
7685
|
!((_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareHideTableExtraMultipleAction)
|
|
7544
7686
|
? [
|
|
7545
7687
|
{
|
|
@@ -7629,7 +7771,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7629
7771
|
}
|
|
7630
7772
|
});
|
|
7631
7773
|
}); },
|
|
7632
|
-
}, addable: {
|
|
7774
|
+
}, onObjectEdit: handleObjectCellEdit, addable: {
|
|
7633
7775
|
active: ((_2 = props.edit) === null || _2 === void 0 ? void 0 : _2.listAddable) ? true : false,
|
|
7634
7776
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7635
7777
|
return __generator(this, function (_a) {
|
|
@@ -7643,7 +7785,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7643
7785
|
}); },
|
|
7644
7786
|
}, darkMode: (_3 = props.organise) === null || _3 === void 0 ? void 0 : _3.darkMode, hidePagination: (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.disableEllipsisOnLongWord, pinColumns: (_6 = props.bareSettings) === null || _6 === void 0 ? void 0 : _6.bareListTablePinColumns }));
|
|
7645
7787
|
}
|
|
7646
|
-
return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_8 = (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.disableSelectFullData) === null || _8 === void 0 ? void 0 : _8.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
7788
|
+
return (react_1.default.createElement(table_1.Table, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, size: size !== null && size !== void 0 ? size : 0, limit: limit, cursor: cursor !== null && cursor !== void 0 ? cursor : "", loading: tableLoading !== null && tableLoading !== void 0 ? tableLoading : true, checkbox: multipleSelect, selectAll: selectAll, selectedIds: selectedIds, selectAllText: selectAll ? "from filter" : "", disableSelectFullData: (_8 = (_7 = props.organise) === null || _7 === void 0 ? void 0 : _7.disableSelectFullData) === null || _8 === void 0 ? void 0 : _8.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
7647
7789
|
selectedIds.length > 0 &&
|
|
7648
7790
|
!((_9 = props.edit) === null || _9 === void 0 ? void 0 : _9.disabledUpdate) &&
|
|
7649
7791
|
!((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -7712,7 +7854,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7712
7854
|
}
|
|
7713
7855
|
});
|
|
7714
7856
|
}); },
|
|
7715
|
-
}, addable: {
|
|
7857
|
+
}, onObjectEdit: handleObjectCellEdit, addable: {
|
|
7716
7858
|
active: ((_31 = props.edit) === null || _31 === void 0 ? void 0 : _31.listAddable) ? true : false,
|
|
7717
7859
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7718
7860
|
return __generator(this, function (_a) {
|
|
@@ -8529,7 +8671,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8529
8671
|
}, delayInit: true })),
|
|
8530
8672
|
react_1.default.createElement("div", { className: "flex justify-end pt-8" },
|
|
8531
8673
|
selectedObjectId && props.type !== "read" && (react_1.default.createElement(button_1.Button, { className: "mr-5", text: "Delete", type: "danger", onClick: function () { } })),
|
|
8532
|
-
react_1.default.createElement(button_1.Button, { text: "".concat(props.type === "read" ? "Close" : "Submit"), type: "normal", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
8674
|
+
react_1.default.createElement(button_1.Button, { text: "".concat(props.type === "read" && !objectCellEdit ? "Close" : "Submit"), type: "normal", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
8533
8675
|
var _a;
|
|
8534
8676
|
return __generator(this, function (_b) {
|
|
8535
8677
|
switch (_b.label) {
|
|
@@ -8644,7 +8786,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8644
8786
|
return __generator(this, function (_b) {
|
|
8645
8787
|
switch (_b.label) {
|
|
8646
8788
|
case 0:
|
|
8647
|
-
if (!(props.type === "update")) return [3 /*break*/, 2];
|
|
8789
|
+
if (!(props.type === "update" || objectCellEdit)) return [3 /*break*/, 2];
|
|
8648
8790
|
return [4 /*yield*/, ((_a = objectFormRef.current) === null || _a === void 0 ? void 0 : _a.handleSubmit())];
|
|
8649
8791
|
case 1:
|
|
8650
8792
|
_b.sent();
|
|
@@ -8846,7 +8988,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8846
8988
|
};
|
|
8847
8989
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
8848
8990
|
renderNotification("root"),
|
|
8849
|
-
((
|
|
8991
|
+
((_49 = (_48 = props.renderSettings) === null || _48 === void 0 ? void 0 : _48.renderLoadingUI) === null || _49 === void 0 ? void 0 : _49.call(_48)) && loading ? ((_50 = props.renderSettings) === null || _50 === void 0 ? void 0 : _50.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
|
|
8850
8992
|
var _a, _b;
|
|
8851
8993
|
if (loading)
|
|
8852
8994
|
return;
|