blixify-ui-web 1.2.59 → 1.2.63
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/action/radioList/index.d.ts +2 -0
- package/lib/components/action/radioList/index.d.ts.map +1 -1
- package/lib/components/action/radioList/index.js +13 -7
- package/lib/components/action/radioList/index.js.map +1 -1
- package/lib/components/data/dataTemplate/dataStateModel.d.ts +9 -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 +443 -197
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts +4 -0
- package/lib/components/data/dataTemplate/model.d.ts.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 +11 -2
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/data/moduleUtils.d.ts +1 -0
- package/lib/components/data/moduleUtils.d.ts.map +1 -1
- package/lib/components/data/moduleUtils.js +144 -114
- package/lib/components/data/moduleUtils.js.map +1 -1
- package/lib/components/data/readModule.d.ts.map +1 -1
- package/lib/components/data/readModule.js +24 -6
- package/lib/components/data/readModule.js.map +1 -1
- package/lib/components/data/testSchema.js +1 -1
- package/lib/components/data/testSchema.js.map +1 -1
- package/lib/components/data/updateModule.d.ts +3 -0
- package/lib/components/data/updateModule.d.ts.map +1 -1
- package/lib/components/data/updateModule.js +44 -17
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/data/utils.d.ts +2 -0
- package/lib/components/data/utils.d.ts.map +1 -1
- package/lib/components/data/utils.js +42 -1
- package/lib/components/data/utils.js.map +1 -1
- package/lib/components/display/flexTable/index.d.ts +14 -0
- package/lib/components/display/flexTable/index.d.ts.map +1 -1
- package/lib/components/display/flexTable/index.js +97 -17
- package/lib/components/display/flexTable/index.js.map +1 -1
- package/lib/components/display/newTable/index.d.ts +11 -0
- package/lib/components/display/newTable/index.d.ts.map +1 -1
- package/lib/components/display/newTable/index.js +448 -124
- package/lib/components/display/newTable/index.js.map +1 -1
- package/lib/components/display/notification/index.d.ts +2 -0
- package/lib/components/display/notification/index.d.ts.map +1 -1
- package/lib/components/display/notification/index.js +2 -1
- package/lib/components/display/notification/index.js.map +1 -1
- package/lib/components/display/scrollShadow/index.d.ts +9 -0
- package/lib/components/display/scrollShadow/index.d.ts.map +1 -0
- package/lib/components/display/scrollShadow/index.js +66 -0
- package/lib/components/display/scrollShadow/index.js.map +1 -0
- package/lib/components/display/stepper/index.d.ts +3 -0
- package/lib/components/display/stepper/index.d.ts.map +1 -1
- package/lib/components/display/stepper/index.js +28 -11
- package/lib/components/display/stepper/index.js.map +1 -1
- package/lib/components/display/table/index.d.ts +3 -0
- package/lib/components/display/table/index.d.ts.map +1 -1
- package/lib/components/display/table/index.js +12 -11
- package/lib/components/display/table/index.js.map +1 -1
- package/lib/components/input/datePicker/index.d.ts.map +1 -1
- package/lib/components/input/datePicker/index.js +5 -5
- package/lib/components/input/datePicker/index.js.map +1 -1
- package/lib/components/input/select/index.d.ts.map +1 -1
- package/lib/components/input/select/index.js +10 -9
- package/lib/components/input/select/index.js.map +1 -1
- package/lib/components/input/textArea/index.d.ts.map +1 -1
- package/lib/components/input/textArea/index.js +19 -3
- package/lib/components/input/textArea/index.js.map +1 -1
- package/lib/components/input/textInput/index.d.ts.map +1 -1
- package/lib/components/input/textInput/index.js +23 -10
- package/lib/components/input/textInput/index.js.map +1 -1
- package/lib/tail.css +2 -2
- package/package.json +1 -1
|
@@ -166,6 +166,18 @@ var handleGetWriteErrorMessage = function (response) {
|
|
|
166
166
|
return response.data.err;
|
|
167
167
|
return "Please contact our administrator for assistance or try your request again later. We apologize for any inconvenience";
|
|
168
168
|
};
|
|
169
|
+
// INFO: apps hide the library's action buttons by returning an empty fragment
|
|
170
|
+
// from bareUpdateActionComponent — an empty fragment must not leave an empty
|
|
171
|
+
// floating bar behind
|
|
172
|
+
var handleIsEmptyElement = function (element) {
|
|
173
|
+
var _a;
|
|
174
|
+
return element === undefined ||
|
|
175
|
+
element === null ||
|
|
176
|
+
element === false ||
|
|
177
|
+
(react_1.default.isValidElement(element) &&
|
|
178
|
+
element.type === react_1.default.Fragment &&
|
|
179
|
+
!((_a = element.props) === null || _a === void 0 ? void 0 : _a.children));
|
|
180
|
+
};
|
|
169
181
|
exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
170
182
|
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
183
|
var intialiseDefaultFilterValues = function () {
|
|
@@ -238,6 +250,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
238
250
|
}), persistedState = _52.persistedState, isPersistEnabled = _52.isEnabled, handleSaveView = _52.handleSaveView;
|
|
239
251
|
var _53 = (0, react_1.useState)(false), loading = _53[0], setLoading = _53[1];
|
|
240
252
|
var _54 = (0, react_1.useState)(), notification = _54[0], setNotification = _54[1];
|
|
253
|
+
// INFO: a success toast is confirmation, not a decision — it clears itself so
|
|
254
|
+
// it never sits on the floating step bar; errors stay until dismissed
|
|
255
|
+
(0, react_1.useEffect)(function () {
|
|
256
|
+
if (!(notification === null || notification === void 0 ? void 0 : notification.type))
|
|
257
|
+
return;
|
|
258
|
+
var timer = setTimeout(function () { return setNotification(null); }, 4000);
|
|
259
|
+
return function () { return clearTimeout(timer); };
|
|
260
|
+
}, [notification]);
|
|
241
261
|
//INFO : Used by List
|
|
242
262
|
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
263
|
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];
|
|
@@ -405,25 +425,26 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
405
425
|
var _136 = (0, react_1.useState)(false), referenceLoading = _136[0], setReferenceLoading = _136[1];
|
|
406
426
|
var _137 = (0, react_1.useState)({}), referencesOptions = _137[0], setReferencesOptions = _137[1];
|
|
407
427
|
var _138 = (0, react_1.useState)({}), referencesDetails = _138[0], setReferencesDetails = _138[1];
|
|
408
|
-
var _139 = (0, react_1.useState)({}),
|
|
409
|
-
var _140 = (0, react_1.useState)(
|
|
410
|
-
var _141 = (0, react_1.useState)(
|
|
428
|
+
var _139 = (0, react_1.useState)({}), listReferencesOptions = _139[0], setListReferencesOptions = _139[1];
|
|
429
|
+
var _140 = (0, react_1.useState)({}), referenceDeleteTableData = _140[0], setReferenceDeleteTableData = _140[1];
|
|
430
|
+
var _141 = (0, react_1.useState)(0), referenceDeleteIndex = _141[0], setReferenceDeleteIndex = _141[1];
|
|
431
|
+
var _142 = (0, react_1.useState)({
|
|
411
432
|
id: "",
|
|
412
433
|
name: "",
|
|
413
434
|
type: "string",
|
|
414
|
-
}), referenceCreationModal =
|
|
415
|
-
var
|
|
416
|
-
var
|
|
435
|
+
}), referenceCreationModal = _142[0], setReferenceCreationModal = _142[1];
|
|
436
|
+
var _143 = (0, react_1.useState)({}), referenceModelSchema = _143[0], setReferenceSchema = _143[1];
|
|
437
|
+
var _144 = (0, react_1.useState)([]), kanbanChecked = _144[0], setKanbanChecked = _144[1];
|
|
417
438
|
//INFO : Offline
|
|
418
|
-
var
|
|
419
|
-
var
|
|
439
|
+
var _145 = (0, react_1.useState)(0), offlineDataLength = _145[0], setOfflineDataLength = _145[1];
|
|
440
|
+
var _146 = (0, react_1.useState)(false), offlineModal = _146[0], setOfflineModal = _146[1];
|
|
420
441
|
// INFO: live-stream state — driven by socket connection and navigator.onLine
|
|
421
|
-
var
|
|
422
|
-
var
|
|
442
|
+
var _147 = (0, react_1.useState)(false), isLive = _147[0], setIsLive = _147[1];
|
|
443
|
+
var _148 = (0, react_1.useState)(false), isLiveOffline = _148[0], setIsLiveOffline = _148[1];
|
|
423
444
|
// INFO: true when navigator is offline — used to switch ReadQueryHoc between
|
|
424
445
|
// server reads (online, full pagination) and IndexedDB reads (offline, cached data).
|
|
425
446
|
// Independent of SSE status so it works even when bareSocketName is not set.
|
|
426
|
-
var
|
|
447
|
+
var _149 = (0, react_1.useState)(typeof navigator !== "undefined" ? !navigator.onLine : false), isNetworkOffline = _149[0], setIsNetworkOffline = _149[1];
|
|
427
448
|
var previousType = (0, react_1.useRef)(null);
|
|
428
449
|
var previousSelectedData = (0, react_1.useRef)(null);
|
|
429
450
|
var scrollSentinelRef = (0, react_1.useRef)(null);
|
|
@@ -461,6 +482,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
461
482
|
// overwriting persisted structure with props.model on the first render
|
|
462
483
|
var persistedViewMountedRef = (0, react_1.useRef)(false);
|
|
463
484
|
var formRef = (0, react_1.createRef)();
|
|
485
|
+
// INFO: a draft written because the user moved to another step is routine —
|
|
486
|
+
// the toast is reserved for an explicit Save; the ref is read by the draft
|
|
487
|
+
// notification and reset straight after
|
|
488
|
+
var silentDraftRef = (0, react_1.useRef)(false);
|
|
464
489
|
var objectFormRef = (0, react_1.createRef)();
|
|
465
490
|
var listAddressFromRef = (0, react_1.createRef)();
|
|
466
491
|
var listAddressInputRef = (0, react_1.createRef)();
|
|
@@ -1467,7 +1492,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1467
1492
|
switch (_a.label) {
|
|
1468
1493
|
case 0:
|
|
1469
1494
|
refFields = structure.filter(function (s) {
|
|
1470
|
-
return
|
|
1495
|
+
return utils_1.REFERENCE_DATA_TYPES.includes(s.type) &&
|
|
1471
1496
|
s.referenceSpaceId &&
|
|
1472
1497
|
s.referenceLabel;
|
|
1473
1498
|
});
|
|
@@ -1554,7 +1579,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1554
1579
|
(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);
|
|
1555
1580
|
return tempData;
|
|
1556
1581
|
})];
|
|
1557
|
-
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)];
|
|
1582
|
+
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)];
|
|
1558
1583
|
}
|
|
1559
1584
|
});
|
|
1560
1585
|
}); };
|
|
@@ -1939,6 +1964,38 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1939
1964
|
(_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);
|
|
1940
1965
|
}
|
|
1941
1966
|
};
|
|
1967
|
+
// INFO: the list already fetches every referenced document once per page to
|
|
1968
|
+
// print labels. Re-shaping those docs into Select options and handing them
|
|
1969
|
+
// to the table renderers lets an inline-editable reference cell show its
|
|
1970
|
+
// current label immediately — otherwise the cell's Select has no options
|
|
1971
|
+
// until the user types into it, and renders blank.
|
|
1972
|
+
var handleSeedListReferenceOptions = function (details) {
|
|
1973
|
+
var seeded = {};
|
|
1974
|
+
Object.entries(details !== null && details !== void 0 ? details : {}).forEach(function (_a) {
|
|
1975
|
+
var _b, _c;
|
|
1976
|
+
var eachKey = _a[0], eachDocs = _a[1];
|
|
1977
|
+
// INFO: "careExpert.organisationId" points at a reference nested in an
|
|
1978
|
+
// object — resolve its label settings from the object's own structure
|
|
1979
|
+
var _d = eachKey.split("."), objectId = _d[0], subId = _d[1];
|
|
1980
|
+
var model = subId
|
|
1981
|
+
? (_c = (_b = structure
|
|
1982
|
+
.find(function (eachModel) { return eachModel.id === objectId; })) === null || _b === void 0 ? void 0 : _b.objectData) === null || _c === void 0 ? void 0 : _c.find(function (eachSub) { return eachSub.id === subId; })
|
|
1983
|
+
: structure.find(function (eachModel) { return eachModel.id === eachKey; });
|
|
1984
|
+
if (!model || !Array.isArray(eachDocs))
|
|
1985
|
+
return;
|
|
1986
|
+
seeded[eachKey] = eachDocs.map(function (eachDoc) {
|
|
1987
|
+
var _a, _b, _c;
|
|
1988
|
+
var option = {
|
|
1989
|
+
key: eachDoc[serverId],
|
|
1990
|
+
label: (_b = eachDoc[(_a = model.referenceLabel) !== null && _a !== void 0 ? _a : ""]) !== null && _b !== void 0 ? _b : (0, moduleUtils_1.renderReferenceStringAttribute)(eachDoc),
|
|
1991
|
+
};
|
|
1992
|
+
if (model.referenceSecondaryLabel)
|
|
1993
|
+
option.secondaryLabel = (_c = eachDoc[model.referenceSecondaryLabel]) !== null && _c !== void 0 ? _c : "-";
|
|
1994
|
+
return option;
|
|
1995
|
+
});
|
|
1996
|
+
});
|
|
1997
|
+
setListReferencesOptions(function (prev) { return (__assign(__assign({}, prev), seeded)); });
|
|
1998
|
+
};
|
|
1942
1999
|
var handleSetListData = function (newTableData, newSpaceTableData) {
|
|
1943
2000
|
var _a, _b, _c, _d, _e;
|
|
1944
2001
|
setTableData(newTableData);
|
|
@@ -1995,7 +2052,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1995
2052
|
});
|
|
1996
2053
|
prettierDataList = dummyPrettierDataList_1;
|
|
1997
2054
|
return [3 /*break*/, 5];
|
|
1998
|
-
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)];
|
|
2055
|
+
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)];
|
|
1999
2056
|
case 4:
|
|
2000
2057
|
prettierDataList = _o.sent();
|
|
2001
2058
|
if (props.groupId) {
|
|
@@ -2134,20 +2191,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2134
2191
|
return __generator(this, function (_a) {
|
|
2135
2192
|
switch (_a.label) {
|
|
2136
2193
|
case 0:
|
|
2137
|
-
if (!(
|
|
2194
|
+
if (!(utils_1.REFERENCE_DATA_TYPES.includes(eachModel.type) &&
|
|
2138
2195
|
eachModel.referenceMapColumnId)) return [3 /*break*/, 2];
|
|
2139
2196
|
return [4 /*yield*/, (0, updateModule_1.handleRetrieveObjectReferenceOptions)(eachModel, clonedOptions_1, clonedDetails_1, selectedData, dbModule, devSettings, undefined, undefined, undefined, undefined, props.type === "read")];
|
|
2140
2197
|
case 1:
|
|
2141
2198
|
_a.sent();
|
|
2142
2199
|
_a.label = 2;
|
|
2143
2200
|
case 2:
|
|
2144
|
-
if (!(
|
|
2201
|
+
if (!(utils_1.OBJECT_DATA_TYPES.includes(eachModel.type) &&
|
|
2145
2202
|
eachModel.objectData)) return [3 /*break*/, 4];
|
|
2146
2203
|
return [4 /*yield*/, Promise.all(eachModel.objectData.map(function (eachObjectData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2147
2204
|
return __generator(this, function (_a) {
|
|
2148
2205
|
switch (_a.label) {
|
|
2149
2206
|
case 0:
|
|
2150
|
-
if (!(
|
|
2207
|
+
if (!(utils_1.REFERENCE_DATA_TYPES.includes(eachObjectData.type) &&
|
|
2151
2208
|
eachObjectData.referenceMapColumnId)) return [3 /*break*/, 2];
|
|
2152
2209
|
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")];
|
|
2153
2210
|
case 1:
|
|
@@ -2998,7 +3055,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2998
3055
|
case 1:
|
|
2999
3056
|
_a.sent();
|
|
3000
3057
|
multiImageAttribute = model.filter(function (eachAttribute) {
|
|
3001
|
-
return
|
|
3058
|
+
return utils_1.MULTIPLE_ASSET_DATA_TYPES.includes(eachAttribute.type);
|
|
3002
3059
|
});
|
|
3003
3060
|
return [4 /*yield*/, Promise.all(multiImageAttribute.map(function (eachImage) { return __awaiter(void 0, void 0, void 0, function () {
|
|
3004
3061
|
var _a, _b, _c, _d;
|
|
@@ -4405,15 +4462,19 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4405
4462
|
_x.sent();
|
|
4406
4463
|
_x.label = 37;
|
|
4407
4464
|
case 37:
|
|
4408
|
-
|
|
4409
|
-
|
|
4410
|
-
|
|
4411
|
-
|
|
4412
|
-
:
|
|
4413
|
-
|
|
4414
|
-
|
|
4415
|
-
|
|
4416
|
-
|
|
4465
|
+
// INFO: a draft save announces itself (or stays silent on a step
|
|
4466
|
+
// change) further up — this toast is for a real update only
|
|
4467
|
+
if (!isDraft) {
|
|
4468
|
+
setNotification({
|
|
4469
|
+
type: true,
|
|
4470
|
+
title: props.id === "new"
|
|
4471
|
+
? "Created Successfully"
|
|
4472
|
+
: "Updated Successfully",
|
|
4473
|
+
msg: props.id === "new"
|
|
4474
|
+
? "Data sucessfully created"
|
|
4475
|
+
: "Data sucessfully updated",
|
|
4476
|
+
});
|
|
4477
|
+
}
|
|
4417
4478
|
_x.label = 38;
|
|
4418
4479
|
case 38:
|
|
4419
4480
|
dataId = res ? id : "";
|
|
@@ -4639,11 +4700,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4639
4700
|
if (props.id === "new" || !props.id) {
|
|
4640
4701
|
(_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.handleNavigate) === null || _g === void 0 ? void 0 : _g.call(_f, "update", res, (_h = selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.id) !== null && _h !== void 0 ? _h : "general");
|
|
4641
4702
|
}
|
|
4642
|
-
|
|
4643
|
-
|
|
4644
|
-
|
|
4645
|
-
|
|
4646
|
-
|
|
4703
|
+
if (silentDraftRef.current) {
|
|
4704
|
+
silentDraftRef.current = false;
|
|
4705
|
+
}
|
|
4706
|
+
else {
|
|
4707
|
+
setNotification({
|
|
4708
|
+
type: true,
|
|
4709
|
+
title: "Draft Saved",
|
|
4710
|
+
msg: "Your changes have been saved",
|
|
4711
|
+
});
|
|
4712
|
+
}
|
|
4647
4713
|
}
|
|
4648
4714
|
else {
|
|
4649
4715
|
// INFO: Non-draft (final submit) — reset dirty tracking and rebase baseline.
|
|
@@ -4741,7 +4807,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4741
4807
|
// INFO: convert raw docs to Option[] format so reference Select
|
|
4742
4808
|
// components receive { key, label, secondaryLabel } as expected
|
|
4743
4809
|
// (mirrors the shape handleRetrieveObjectReferenceOptions builds online)
|
|
4744
|
-
if (
|
|
4810
|
+
if (utils_1.REFERENCE_DATA_TYPES.includes(eachModel.type) &&
|
|
4745
4811
|
eachModel.referenceLabel) {
|
|
4746
4812
|
clonedReferencesOptions_1[eachModel.id] = offlineData.map(function (r) {
|
|
4747
4813
|
var _a, _b, _c, _d;
|
|
@@ -5199,13 +5265,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5199
5265
|
var selectedModel = structure.find(function (eachModel) {
|
|
5200
5266
|
return eachModel.id === eachValue;
|
|
5201
5267
|
});
|
|
5202
|
-
if ((selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "object" ||
|
|
5268
|
+
if ((selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "object" ||
|
|
5269
|
+
(selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "listObject") {
|
|
5203
5270
|
var selectedObjectModel = (_c = selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.objectData) === null || _c === void 0 ? void 0 : _c.find(function (eachModel) {
|
|
5204
5271
|
return eachModel.id === listCSVObjAttribute[eachKey];
|
|
5205
5272
|
});
|
|
5206
5273
|
if ((selectedObjectModel === null || selectedObjectModel === void 0 ? void 0 : selectedObjectModel.type) === "image" ||
|
|
5207
5274
|
(selectedObjectModel === null || selectedObjectModel === void 0 ? void 0 : selectedObjectModel.type) === "file" ||
|
|
5208
|
-
(selectedObjectModel === null || selectedObjectModel === void 0 ? void 0 : selectedObjectModel.type) === "multipleImage" ||
|
|
5275
|
+
(selectedObjectModel === null || selectedObjectModel === void 0 ? void 0 : selectedObjectModel.type) === "multipleImage" ||
|
|
5276
|
+
(selectedObjectModel === null || selectedObjectModel === void 0 ? void 0 : selectedObjectModel.type) === "multipleFile") {
|
|
5209
5277
|
csvList_1.push({
|
|
5210
5278
|
id: (_d = listCSVObjAttribute[eachKey]) !== null && _d !== void 0 ? _d : "",
|
|
5211
5279
|
ori: Number(eachKey),
|
|
@@ -5229,7 +5297,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5229
5297
|
}
|
|
5230
5298
|
else if ((selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "image" ||
|
|
5231
5299
|
(selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "file" ||
|
|
5232
|
-
(selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "multipleImage" ||
|
|
5300
|
+
(selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "multipleImage" ||
|
|
5301
|
+
(selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "multipleFile") {
|
|
5233
5302
|
csvList_1.push({
|
|
5234
5303
|
id: eachValue !== null && eachValue !== void 0 ? eachValue : "",
|
|
5235
5304
|
ori: Number(eachKey),
|
|
@@ -6137,7 +6206,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6137
6206
|
var renderDetailListData = function (model) {
|
|
6138
6207
|
var detailList = [];
|
|
6139
6208
|
model
|
|
6140
|
-
.filter(function (eachAttribute) {
|
|
6209
|
+
.filter(function (eachAttribute) {
|
|
6210
|
+
return !utils_1.NON_DETAIL_LIST_DATA_TYPES.includes(eachAttribute.type);
|
|
6211
|
+
})
|
|
6141
6212
|
.map(function (eachAttribute) {
|
|
6142
6213
|
var _a, _b, _c, _d, _e, _f;
|
|
6143
6214
|
var selectedDataKey = Object.keys(selectedData).find(function (eachKey) { return eachKey === eachAttribute.id; });
|
|
@@ -6405,90 +6476,186 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6405
6476
|
// INFO: placement is decided by the caller (see isBottom in renderContent), so this only
|
|
6406
6477
|
// builds the buttons. It previously took an isBottom argument purely to add a top margin
|
|
6407
6478
|
// to the list's create button when that button was pushed below the table.
|
|
6408
|
-
|
|
6409
|
-
|
|
6479
|
+
// INFO: the labelled footer of a multi-tab update form — Previous, a step
|
|
6480
|
+
// counter, then the same Save / Submit the header offers and a Continue
|
|
6481
|
+
// button that reuses the bareSaveOnTabChange draft-save. Replaces the bare
|
|
6482
|
+
// chevron icons, which gave no sense of position in a long form.
|
|
6483
|
+
var renderStepBar = function (uniqueTabIds) {
|
|
6484
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6485
|
+
var hasTabAlign = ((_a = props.organise) === null || _a === void 0 ? void 0 : _a.tabAlign) || ((_b = props.space) === null || _b === void 0 ? void 0 : _b.tabAlign);
|
|
6486
|
+
if (props.type !== "update")
|
|
6487
|
+
return null;
|
|
6488
|
+
// INFO: navigation only makes sense with more than one tab; the actions
|
|
6489
|
+
// are the same floating bar on every update form
|
|
6490
|
+
var isTabbed = !!hasTabAlign && uniqueTabIds.length > 1;
|
|
6491
|
+
var currentTabIndex = uniqueTabIds.findIndex(function (tabId) { return tabId === (activeTab || ""); });
|
|
6492
|
+
var isFirst = currentTabIndex <= 0;
|
|
6493
|
+
var isLast = currentTabIndex >= uniqueTabIds.length - 1;
|
|
6494
|
+
var handleMoveTab = function (direction) { return __awaiter(void 0, void 0, void 0, function () {
|
|
6495
|
+
var _a;
|
|
6496
|
+
return __generator(this, function (_b) {
|
|
6497
|
+
switch (_b.label) {
|
|
6498
|
+
case 0:
|
|
6499
|
+
if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareSaveOnTabChange)) return [3 /*break*/, 2];
|
|
6500
|
+
// INFO: the form's save resolves before the request does, so the flag
|
|
6501
|
+
// is consumed by the notification itself; the timer only covers a save
|
|
6502
|
+
// that never reaches it (validation stop, network error)
|
|
6503
|
+
silentDraftRef.current = true;
|
|
6504
|
+
setTimeout(function () {
|
|
6505
|
+
silentDraftRef.current = false;
|
|
6506
|
+
}, 5000);
|
|
6507
|
+
return [4 /*yield*/, handleFormSaveDraft()];
|
|
6508
|
+
case 1:
|
|
6509
|
+
_b.sent();
|
|
6510
|
+
_b.label = 2;
|
|
6511
|
+
case 2:
|
|
6512
|
+
handleUpdateTabId(uniqueTabIds[currentTabIndex + direction]);
|
|
6513
|
+
return [2 /*return*/];
|
|
6514
|
+
}
|
|
6515
|
+
});
|
|
6516
|
+
}); };
|
|
6517
|
+
var bareActionComponent = (_e = (_d = (_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareUpdateActionComponent) === null || _d === void 0 ? void 0 : _d.call(_c, selectedData, formRef)) !== null && _e !== void 0 ? _e : undefined;
|
|
6518
|
+
var hasCustomActions = !!bareActionComponent && !handleIsEmptyElement(bareActionComponent);
|
|
6519
|
+
var hasActions = bareActionComponent ? hasCustomActions : true;
|
|
6520
|
+
var showDelete = !!((_f = props.edit) === null || _f === void 0 ? void 0 : _f.deleteBtn) && isEditor && props.id !== "new";
|
|
6521
|
+
if (!isTabbed && !hasActions && !showDelete)
|
|
6522
|
+
return null;
|
|
6523
|
+
return (
|
|
6524
|
+
// INFO: sticky, not fixed — it stays visible on a long tab yet never
|
|
6525
|
+
// covers content that is not the form's own
|
|
6526
|
+
// INFO: one row at every width — a phone keeps the whole bar under
|
|
6527
|
+
// 60px, so it never hides the field being edited. Left cluster is
|
|
6528
|
+
// navigation (Previous · counter · Next), right cluster is actions
|
|
6529
|
+
// (Save · Submit or the caller's own component)
|
|
6530
|
+
react_1.default.createElement("div", { "data-testid": "dtw-step-bar", className: "sticky bottom-3 z-20 -mx-2 mt-6 flex flex-row items-center gap-2 whitespace-nowrap rounded-2xl border border-gray-200 bg-white/95 px-3 py-2 shadow-lg backdrop-blur sm:mx-0 sm:px-4" },
|
|
6531
|
+
isTabbed && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
6532
|
+
react_1.default.createElement("div", { className: "sm:hidden" },
|
|
6533
|
+
react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-previous-icon", size: "small", background: "bg-white border border-gray-300 hover:bg-gray-50", icon: react_1.default.createElement(HeroIcons.ChevronLeftIcon, { className: "w-5 h-5 text-gray-700" }), disabled: isFirst, onClick: function () { return handleMoveTab(-1); } })),
|
|
6534
|
+
react_1.default.createElement("div", { className: "hidden sm:block" },
|
|
6535
|
+
react_1.default.createElement(button_1.Button, { id: "dtw-previous", text: "Previous", type: "light", size: "small", icon: react_1.default.createElement(HeroIcons.ChevronLeftIcon, { className: "w-4 h-4" }), disable: isFirst, onClick: function () { return handleMoveTab(-1); } })),
|
|
6536
|
+
react_1.default.createElement("span", { "data-testid": "dtw-step-counter", className: "text-xs text-gray-500 sm:text-sm" },
|
|
6537
|
+
react_1.default.createElement("span", { className: "sm:hidden" },
|
|
6538
|
+
currentTabIndex + 1,
|
|
6539
|
+
"/",
|
|
6540
|
+
uniqueTabIds.length),
|
|
6541
|
+
react_1.default.createElement("span", { className: "hidden sm:inline" },
|
|
6542
|
+
"Step ",
|
|
6543
|
+
currentTabIndex + 1,
|
|
6544
|
+
" of ",
|
|
6545
|
+
uniqueTabIds.length)),
|
|
6546
|
+
react_1.default.createElement("div", { className: "sm:hidden" },
|
|
6547
|
+
react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-next-icon", size: "small", background: isLast
|
|
6548
|
+
? "bg-gray-100 border border-gray-200"
|
|
6549
|
+
: "bg-white border border-gray-300 hover:bg-gray-50", icon: react_1.default.createElement(HeroIcons.ChevronRightIcon, { className: "w-5 h-5 ".concat(isLast ? "text-gray-400" : "text-gray-700") }), disabled: isLast, onClick: function () { return handleMoveTab(1); } })),
|
|
6550
|
+
react_1.default.createElement("div", { className: "hidden sm:block" },
|
|
6551
|
+
react_1.default.createElement(button_1.Button, { id: "dtw-continue", text: "Next", type: "light", size: "small", disable: isLast, onClick: function () { return handleMoveTab(1); } })))),
|
|
6552
|
+
react_1.default.createElement("div", { className: "flex-1" }),
|
|
6553
|
+
react_1.default.createElement("div", { className: "flex flex-row items-center gap-2" },
|
|
6554
|
+
((_g = props.edit) === null || _g === void 0 ? void 0 : _g.deleteBtn) && isEditor && props.id !== "new" && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
6555
|
+
react_1.default.createElement("div", { className: "sm:hidden" },
|
|
6556
|
+
react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-delete-icon", size: "small", background: "bg-white border border-red-200 hover:bg-red-50", icon: react_1.default.createElement(HeroIcons.TrashIcon, { className: "w-5 h-5 text-red-600" }), onClick: function () {
|
|
6557
|
+
setDeleteModal(true);
|
|
6558
|
+
} })),
|
|
6559
|
+
react_1.default.createElement("div", { className: "hidden sm:block" },
|
|
6560
|
+
react_1.default.createElement(button_1.Button, { id: "dtw-delete", text: "Delete", type: "light", size: "small", className: "!text-red-600", onClick: function () {
|
|
6561
|
+
setDeleteModal(true);
|
|
6562
|
+
} })))),
|
|
6563
|
+
hasCustomActions && bareActionComponent,
|
|
6564
|
+
!bareActionComponent && ((_h = props.edit) === null || _h === void 0 ? void 0 : _h.enableUpdateDraft) && (react_1.default.createElement(button_1.Button, { id: "dtw-step-save", text: "Save", type: "light", size: "small", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6565
|
+
return __generator(this, function (_a) {
|
|
6566
|
+
switch (_a.label) {
|
|
6567
|
+
case 0: return [4 /*yield*/, handleFormSaveDraft()];
|
|
6568
|
+
case 1:
|
|
6569
|
+
_a.sent();
|
|
6570
|
+
return [2 /*return*/];
|
|
6571
|
+
}
|
|
6572
|
+
});
|
|
6573
|
+
}); } })),
|
|
6574
|
+
!bareActionComponent && (react_1.default.createElement(button_1.Button, { id: "dtw-step-submit", text: "Submit", type: "normal", size: "small", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6575
|
+
return __generator(this, function (_a) {
|
|
6576
|
+
switch (_a.label) {
|
|
6577
|
+
case 0: return [4 /*yield*/, handleFormSubmit()];
|
|
6578
|
+
case 1:
|
|
6579
|
+
_a.sent();
|
|
6580
|
+
return [2 /*return*/];
|
|
6581
|
+
}
|
|
6582
|
+
});
|
|
6583
|
+
}); } })))));
|
|
6584
|
+
};
|
|
6585
|
+
// INFO: the read view's floating bar — the same pill as the update form,
|
|
6586
|
+
// carrying Update (or the caller's own component), Export PDF and Log
|
|
6587
|
+
var renderReadBar = function () {
|
|
6588
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
6589
|
+
if (props.type !== "read")
|
|
6590
|
+
return null;
|
|
6410
6591
|
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;
|
|
6411
|
-
|
|
6412
|
-
|
|
6413
|
-
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6592
|
+
var hasCustomActions = !!bareActionComponent && !handleIsEmptyElement(bareActionComponent);
|
|
6593
|
+
var showUpdate = !bareActionComponent && !((_d = props.edit) === null || _d === void 0 ? void 0 : _d.disabledUpdate);
|
|
6594
|
+
var showExport = !!((_f = (_e = props.organise) === null || _e === void 0 ? void 0 : _e.exportSettings) === null || _f === void 0 ? void 0 : _f.enableExportReadPDF);
|
|
6595
|
+
var showDelete = !!((_g = props.edit) === null || _g === void 0 ? void 0 : _g.deleteBtn) && isEditor && props.id !== "new";
|
|
6596
|
+
if (!hasCustomActions &&
|
|
6597
|
+
!showUpdate &&
|
|
6598
|
+
!showExport &&
|
|
6599
|
+
!isActivityLog &&
|
|
6600
|
+
!showDelete)
|
|
6601
|
+
return null;
|
|
6602
|
+
return (react_1.default.createElement("div", { "data-testid": "dtw-read-bar", className: "sticky bottom-3 z-20 -mx-2 mt-6 flex flex-row items-center justify-end gap-2 whitespace-nowrap rounded-2xl border border-gray-200 bg-white/95 px-3 py-2 shadow-lg backdrop-blur sm:mx-0 sm:px-4" },
|
|
6603
|
+
((_h = props.edit) === null || _h === void 0 ? void 0 : _h.deleteBtn) && isEditor && props.id !== "new" && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
6604
|
+
react_1.default.createElement("div", { className: "sm:hidden" },
|
|
6605
|
+
react_1.default.createElement(iconButton_1.IconButton, { testId: "dtw-delete-icon", size: "small", background: "bg-white border border-red-200 hover:bg-red-50", icon: react_1.default.createElement(HeroIcons.TrashIcon, { className: "w-5 h-5 text-red-600" }), onClick: function () {
|
|
6606
|
+
setDeleteModal(true);
|
|
6607
|
+
} })),
|
|
6608
|
+
react_1.default.createElement("div", { className: "hidden sm:block" },
|
|
6609
|
+
react_1.default.createElement(button_1.Button, { id: "dtw-delete", text: "Delete", type: "light", size: "small", className: "!text-red-600", onClick: function () {
|
|
6610
|
+
setDeleteModal(true);
|
|
6611
|
+
} })))),
|
|
6612
|
+
showExport && (react_1.default.createElement(button_1.Button, { type: "light", text: "Export PDF", size: "small", onClick: handleExportReadPDF })),
|
|
6613
|
+
isActivityLog && (react_1.default.createElement(button_1.Button, { type: "light", text: "Log", size: "small", onClick: function () { return setActivityModal(true); } })),
|
|
6614
|
+
hasCustomActions && bareActionComponent,
|
|
6615
|
+
showUpdate &&
|
|
6616
|
+
(hasNavigation ? (react_1.default.createElement(button_1.Button, { id: "dtw-update", text: "Update", type: "normal", size: "small", onClick: function () {
|
|
6417
6617
|
var _a, _b;
|
|
6418
6618
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "update", props.id);
|
|
6419
|
-
} })) : (react_1.default.createElement(link_1.Link, {
|
|
6420
|
-
react_1.default.createElement(button_1.Button, { id: "dtw-update", text: "Update",
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6619
|
+
} })) : (react_1.default.createElement(link_1.Link, { href: "".concat(props.localURLEndpoint, "?data=").concat(props.id, "&type=update&collection=").concat(props.collectionId, "&view=general"), linkType: props.linkType, custom: props.custom },
|
|
6620
|
+
react_1.default.createElement(button_1.Button, { id: "dtw-update", text: "Update", type: "normal", size: "small" }))))));
|
|
6621
|
+
};
|
|
6622
|
+
// INFO: tab navigation moved to renderStepBar — the alignment and tab ids
|
|
6623
|
+
// are still accepted so existing call sites stay unchanged
|
|
6624
|
+
// INFO: a tabbed update form has exactly one action bar — the sticky step bar
|
|
6625
|
+
// under the form. Its header row keeps only Delete, a destructive action that
|
|
6626
|
+
// should not sit at the end of a "continue, continue" flow.
|
|
6627
|
+
var renderActionButtons = function (type, _hasTabAlign, _uniqueTabIds) {
|
|
6628
|
+
var _a, _b, _c, _d, _e, _f;
|
|
6629
|
+
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;
|
|
6630
|
+
// INFO: every update form carries Save / Submit in the floating bar, so
|
|
6631
|
+
// the header keeps only Delete
|
|
6632
|
+
var isTabbedUpdate = type === "update";
|
|
6633
|
+
if (type === "read") {
|
|
6634
|
+
// INFO: every read-view action, Delete included, lives in the floating bar
|
|
6635
|
+
return null;
|
|
6424
6636
|
}
|
|
6425
6637
|
else if (type === "update") {
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
});
|
|
6448
|
-
}); }, disabled: currentTabIndex_1 <= 0, className: "mr-3", background: "bg-gray-100 hover:bg-gray-200 text-gray-600 hover:text-gray-800" })),
|
|
6449
|
-
((_h = props.edit) === null || _h === void 0 ? void 0 : _h.enableUpdateDraft) && (react_1.default.createElement(button_1.Button, { id: "dtw-save", text: "Save", type: "light", className: "w-xs mr-3", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6450
|
-
return __generator(this, function (_a) {
|
|
6451
|
-
switch (_a.label) {
|
|
6452
|
-
case 0: return [4 /*yield*/, handleFormSaveDraft()];
|
|
6453
|
-
case 1:
|
|
6454
|
-
_a.sent();
|
|
6455
|
-
return [2 /*return*/];
|
|
6456
|
-
}
|
|
6457
|
-
});
|
|
6458
|
-
}); } })),
|
|
6459
|
-
react_1.default.createElement(button_1.Button, { id: "dtw-submit", text: "Submit", type: "normal", className: "w-xs", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6460
|
-
return __generator(this, function (_a) {
|
|
6461
|
-
switch (_a.label) {
|
|
6462
|
-
case 0: return [4 /*yield*/, handleFormSubmit()];
|
|
6463
|
-
case 1:
|
|
6464
|
-
_a.sent();
|
|
6465
|
-
return [2 /*return*/];
|
|
6466
|
-
}
|
|
6467
|
-
});
|
|
6468
|
-
}); } }),
|
|
6469
|
-
hasTabAlign && (uniqueTabIds || []).length > 1 && (react_1.default.createElement(iconButton_1.IconButton, { icon: react_1.default.createElement(HeroIcons.ChevronRightIcon, { className: "w-5 h-5 text-primary-500" }), onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6470
|
-
var nextTabId;
|
|
6471
|
-
var _a;
|
|
6472
|
-
return __generator(this, function (_b) {
|
|
6473
|
-
switch (_b.label) {
|
|
6474
|
-
case 0:
|
|
6475
|
-
if (!(currentTabIndex_1 < (uniqueTabIds || []).length - 1)) return [3 /*break*/, 3];
|
|
6476
|
-
if (!((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareSaveOnTabChange)) return [3 /*break*/, 2];
|
|
6477
|
-
return [4 /*yield*/, handleFormSaveDraft()];
|
|
6478
|
-
case 1:
|
|
6479
|
-
_b.sent();
|
|
6480
|
-
_b.label = 2;
|
|
6481
|
-
case 2:
|
|
6482
|
-
nextTabId = (uniqueTabIds || [])[currentTabIndex_1 + 1];
|
|
6483
|
-
handleUpdateTabId(nextTabId);
|
|
6484
|
-
_b.label = 3;
|
|
6485
|
-
case 3: return [2 /*return*/];
|
|
6486
|
-
}
|
|
6487
|
-
});
|
|
6488
|
-
}); }, disabled: currentTabIndex_1 >= (uniqueTabIds || []).length - 1, className: "ml-2", background: "bg-gray-100 hover:bg-gray-200 text-gray-600 hover:text-gray-800" })))),
|
|
6489
|
-
((_j = props.edit) === null || _j === void 0 ? void 0 : _j.deleteBtn) && isEditor && props.id !== "new" && (react_1.default.createElement(button_1.Button, { id: "dtw-delete", text: "Delete", type: "danger", className: "w-xs ml-3", onClick: function () {
|
|
6490
|
-
setDeleteModal(true);
|
|
6491
|
-
} }))));
|
|
6638
|
+
return (react_1.default.createElement("div", { className: "flex flex-row h-fit w-full mt-5 sm:justify-end sm:mt-0" }, isTabbedUpdate ? null : bareActionComponent ? (bareActionComponent) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
6639
|
+
((_d = props.edit) === null || _d === void 0 ? void 0 : _d.enableUpdateDraft) && (react_1.default.createElement(button_1.Button, { id: "dtw-save", text: "Save", type: "light", className: "w-xs mr-3", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6640
|
+
return __generator(this, function (_a) {
|
|
6641
|
+
switch (_a.label) {
|
|
6642
|
+
case 0: return [4 /*yield*/, handleFormSaveDraft()];
|
|
6643
|
+
case 1:
|
|
6644
|
+
_a.sent();
|
|
6645
|
+
return [2 /*return*/];
|
|
6646
|
+
}
|
|
6647
|
+
});
|
|
6648
|
+
}); } })),
|
|
6649
|
+
react_1.default.createElement(button_1.Button, { id: "dtw-submit", text: "Submit", type: "normal", className: "w-xs", onClick: function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
6650
|
+
return __generator(this, function (_a) {
|
|
6651
|
+
switch (_a.label) {
|
|
6652
|
+
case 0: return [4 /*yield*/, handleFormSubmit()];
|
|
6653
|
+
case 1:
|
|
6654
|
+
_a.sent();
|
|
6655
|
+
return [2 /*return*/];
|
|
6656
|
+
}
|
|
6657
|
+
});
|
|
6658
|
+
}); } })))));
|
|
6492
6659
|
}
|
|
6493
6660
|
else if (type === "list") {
|
|
6494
6661
|
var listActionBtns = [];
|
|
@@ -6498,7 +6665,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6498
6665
|
if (bareActionComponent) {
|
|
6499
6666
|
listActionBtns.push(bareActionComponent);
|
|
6500
6667
|
}
|
|
6501
|
-
else if (((
|
|
6668
|
+
else if (((_e = props.edit) === null || _e === void 0 ? void 0 : _e.allEditable) || ((_f = props.edit) === null || _f === void 0 ? void 0 : _f.createBtn)) {
|
|
6502
6669
|
listActionBtns.push(react_1.default.createElement(react_1.default.Fragment, null,
|
|
6503
6670
|
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 () {
|
|
6504
6671
|
var _a, _b;
|
|
@@ -6630,7 +6797,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6630
6797
|
authList));
|
|
6631
6798
|
};
|
|
6632
6799
|
var renderContent = function () {
|
|
6633
|
-
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;
|
|
6800
|
+
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;
|
|
6634
6801
|
var isBottom = ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareUpdateActionBottom) ? true : false;
|
|
6635
6802
|
var tabs = renderTabs();
|
|
6636
6803
|
var pages = [
|
|
@@ -6669,7 +6836,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6669
6836
|
hasReadHeading && (react_1.default.createElement("div", { className: "flex flex-col" },
|
|
6670
6837
|
props.title && (react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title)),
|
|
6671
6838
|
props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
|
|
6672
|
-
|
|
6839
|
+
renderActionButtons(props.type))),
|
|
6673
6840
|
(schemaPresent || ((_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.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: (_j = props.organise) === null || _j === void 0 ? void 0 : _j.darkMode })),
|
|
6674
6841
|
((_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareReadComponentPos) === "top" &&
|
|
6675
6842
|
renderBareReadComp(),
|
|
@@ -6678,9 +6845,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6678
6845
|
!((_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareReadComponentHide) && (react_1.default.createElement("div", null, renderTabContent(tabs, props.type, viewType))),
|
|
6679
6846
|
((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareReadComponentPos) !== "top" &&
|
|
6680
6847
|
renderBareReadComp()),
|
|
6681
|
-
|
|
6682
|
-
// INFO: matches the update view's bottom bar, which is already sm:justify-end
|
|
6683
|
-
react_1.default.createElement("div", { className: "flex sm:justify-end" }, renderActionButtons(props.type)))))));
|
|
6848
|
+
renderReadBar()))));
|
|
6684
6849
|
case "update":
|
|
6685
6850
|
if (props.id !== "new") {
|
|
6686
6851
|
pages.push({
|
|
@@ -6824,9 +6989,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6824
6989
|
}
|
|
6825
6990
|
var customTabComponent_1 = (_3 = (_2 = (_1 = props.bareSettings) === null || _1 === void 0 ? void 0 : _1.bareUpdateTabComponent) === null || _2 === void 0 ? void 0 : _2.call(_1, uniqueTabIds_2)) !== null && _3 !== void 0 ? _3 : [];
|
|
6826
6991
|
var stepperSteps = uniqueTabIds_2.map(function (eachTabId) {
|
|
6992
|
+
var _a, _b;
|
|
6827
6993
|
var customTabMatch = customTabComponent_1.find(function (eachTab) { return eachTab.tabId === eachTabId; });
|
|
6828
6994
|
return {
|
|
6829
6995
|
title: eachTabId ? eachTabId : "Others",
|
|
6996
|
+
shortTitle: (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.tabShortLabels) === null || _b === void 0 ? void 0 : _b[eachTabId],
|
|
6830
6997
|
description: "",
|
|
6831
6998
|
icon: customTabMatch === null || customTabMatch === void 0 ? void 0 : customTabMatch.icon,
|
|
6832
6999
|
skip: (customTabMatch === null || customTabMatch === void 0 ? void 0 : customTabMatch.skip) ? true : false,
|
|
@@ -6842,6 +7009,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6842
7009
|
icon: function () { return react_1.default.createElement("div", null); },
|
|
6843
7010
|
};
|
|
6844
7011
|
});
|
|
7012
|
+
var railSteps = uniqueTabIds_2.map(function (eachTabId) {
|
|
7013
|
+
var customTabMatch = customTabComponent_1.find(function (eachTab) { return eachTab.tabId === eachTabId; });
|
|
7014
|
+
return {
|
|
7015
|
+
id: eachTabId || "Others",
|
|
7016
|
+
title: eachTabId ? eachTabId : "Others",
|
|
7017
|
+
completed: (0, utils_1.handleIsTabComplete)(filterModel_1, selectedData, eachTabId),
|
|
7018
|
+
icon: customTabMatch === null || customTabMatch === void 0 ? void 0 : customTabMatch.icon,
|
|
7019
|
+
};
|
|
7020
|
+
});
|
|
6845
7021
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
6846
7022
|
props.id && props.id !== "new" && structure.length >= 1 && (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: readQueryHocRef, database: {
|
|
6847
7023
|
dbModule: dbModule,
|
|
@@ -6860,15 +7036,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6860
7036
|
(props.title || props.description) && (react_1.default.createElement("div", { className: "flex flex-col w-full" },
|
|
6861
7037
|
props.title && (react_1.default.createElement("p", { className: "text-xl font-medium" }, props.title)),
|
|
6862
7038
|
props.description && (react_1.default.createElement("span", { className: "text-sm text-gray-500" }, props.description)))),
|
|
6863
|
-
!isBottom &&
|
|
7039
|
+
(!isBottom || hasTabAlign_1 || props.type === "update") &&
|
|
6864
7040
|
renderActionButtons(props.type, hasTabAlign_1, uniqueTabIds_2)),
|
|
6865
7041
|
hasTabAlign_1 ? (react_1.default.createElement("div", { className: "w-full ".concat(leftTabAlign
|
|
6866
7042
|
? "grid sm:grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-5"
|
|
6867
7043
|
: "") },
|
|
6868
7044
|
leftTabAlign && uniqueTabIds_2.length >= 1 && (react_1.default.createElement("div", { className: "w-full" },
|
|
6869
|
-
react_1.default.createElement(
|
|
6870
|
-
handleUpdateTabId(
|
|
6871
|
-
}
|
|
7045
|
+
react_1.default.createElement(stepper_1.Stepper, { variant: "checklist", steps: railSteps, stepIndex: uniqueTabIds_2.findIndex(function (tabId) { return tabId === (activeTab || ""); }), onChange: function (stepIndex) {
|
|
7046
|
+
handleUpdateTabId(uniqueTabIds_2[stepIndex] || "");
|
|
7047
|
+
} }))),
|
|
6872
7048
|
react_1.default.createElement("div", { className: "w-full ".concat(leftTabAlign ? " md:col-span-2 lg:col-span-3" : "") },
|
|
6873
7049
|
topTabAlign && uniqueTabIds_2.length >= 1 && (react_1.default.createElement(bars_1.Bars, { bars: tabBars, selectedId: activeTab || "Others", onClick: function (tabId) {
|
|
6874
7050
|
handleUpdateTabId(tabId);
|
|
@@ -6882,6 +7058,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6882
7058
|
((_9 = props.bareSettings) === null || _9 === void 0 ? void 0 : _9.bareUpdateComponent(selectedData)),
|
|
6883
7059
|
react_1.default.createElement(form_1.Form, { className: "mt-6", ref: formRef, refList: __spreadArray(__spreadArray([], modalFormInputRefs, true), flexTableRefs, true), handleComplete: handleSubmit, disabledOnEnter: disabledOnEnter_1, handleOnFailValidation: handleOnFailValidation },
|
|
6884
7060
|
uniqueTabIds_2.map(function (tabId) {
|
|
7061
|
+
var _a, _b;
|
|
6885
7062
|
var filterByTab = filterModel_1
|
|
6886
7063
|
.map(function (model, index) { return (__assign(__assign({}, model), { refIndex: index })); })
|
|
6887
7064
|
.filter(function (model) {
|
|
@@ -6893,14 +7070,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6893
7070
|
? activeTab === tabId
|
|
6894
7071
|
? ""
|
|
6895
7072
|
: "hidden"
|
|
6896
|
-
: "") },
|
|
7073
|
+
: "") },
|
|
7074
|
+
hasTabAlign_1 && (react_1.default.createElement("div", { className: "col-span-12" },
|
|
7075
|
+
react_1.default.createElement("p", { className: "text-lg font-semibold text-gray-900" }, tabId || "Others"),
|
|
7076
|
+
((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.tabDescriptions) === null || _b === void 0 ? void 0 : _b[tabId]) && (react_1.default.createElement("p", { className: "text-sm text-gray-500 mt-0.5" }, props.organise.tabDescriptions[tabId])))),
|
|
7077
|
+
renderDataTemplateFormContent(selectedData, filterByTab, modalFormInputRefs, false, false, undefined, undefined)));
|
|
6897
7078
|
}),
|
|
6898
7079
|
!((_10 = props.bareSettings) === null || _10 === void 0 ? void 0 : _10.bareUpdateComponentAbove) &&
|
|
6899
7080
|
((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareUpdateComponent) &&
|
|
6900
7081
|
((_12 = props.bareSettings) === null || _12 === void 0 ? void 0 : _12.bareUpdateComponent(selectedData))),
|
|
6901
7082
|
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(props.type)),
|
|
6902
7083
|
react_1.default.createElement("div", { className: "mt-8" }, renderListObject(props.type)),
|
|
7084
|
+
renderStepBar(uniqueTabIds_2),
|
|
6903
7085
|
isBottom &&
|
|
7086
|
+
props.type !== "update" &&
|
|
6904
7087
|
renderActionButtons(props.type, hasTabAlign_1, uniqueTabIds_2)))) : (react_1.default.createElement("div", null,
|
|
6905
7088
|
((_13 = props.bareSettings) === null || _13 === void 0 ? void 0 : _13.bareUpdateComponentAbove) &&
|
|
6906
7089
|
((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareUpdateComponent) &&
|
|
@@ -6912,8 +7095,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
6912
7095
|
((_18 = props.bareSettings) === null || _18 === void 0 ? void 0 : _18.bareUpdateComponent(selectedData))),
|
|
6913
7096
|
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(props.type)),
|
|
6914
7097
|
react_1.default.createElement("div", { className: "mt-8" }, renderListObject(props.type)),
|
|
6915
|
-
|
|
6916
|
-
renderActionButtons(props.type, hasTabAlign_1, uniqueTabIds_2)))));
|
|
7098
|
+
renderStepBar(uniqueTabIds_2)))));
|
|
6917
7099
|
case "list":
|
|
6918
7100
|
case "union":
|
|
6919
7101
|
var filterComponent_1 = renderSearchContent();
|
|
@@ -7124,7 +7306,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7124
7306
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
7125
7307
|
listReadQueryHOC,
|
|
7126
7308
|
react_1.default.createElement("div", { className: "flex py-2 ".concat(((_24 = props.bareSettings) === null || _24 === void 0 ? void 0 : _24.bareCompactMode)
|
|
7127
|
-
?
|
|
7309
|
+
? // INFO: the grow spacer is hidden on phones (search lives in
|
|
7310
|
+
// the floating bar), so the row itself pushes the actions right
|
|
7311
|
+
"w-full flex-row flex-wrap sm:flex-nowrap items-end justify-between sm:justify-start"
|
|
7128
7312
|
: "flex-col md:items-end md:flex-row") },
|
|
7129
7313
|
(props.title || props.description) && (react_1.default.createElement("div", { className: "flex flex-col" },
|
|
7130
7314
|
props.title && (react_1.default.createElement("div", { className: "flex items-center gap-2" },
|
|
@@ -7141,12 +7325,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7141
7325
|
react_1.default.createElement("div", { className: ((_27 = props.bareSettings) === null || _27 === void 0 ? void 0 : _27.bareCompactMode)
|
|
7142
7326
|
? "hidden sm:block grow"
|
|
7143
7327
|
: "grow" }),
|
|
7144
|
-
|
|
7145
|
-
|
|
7328
|
+
react_1.default.createElement("div", { className: "ml-auto flex flex-row items-end" },
|
|
7329
|
+
renderListFilterElements(),
|
|
7330
|
+
renderListActionElements())),
|
|
7146
7331
|
renderListNewRowFilterElements(),
|
|
7147
7332
|
(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 })),
|
|
7148
7333
|
renderTabContent(tabs, props.type, viewType),
|
|
7149
|
-
((_30 = props.bareSettings) === null || _30 === void 0 ? void 0 : _30.bareListMobileFloatingSearch) &&
|
|
7334
|
+
((_30 = props.bareSettings) === null || _30 === void 0 ? void 0 : _30.bareListMobileFloatingSearch) && (react_1.default.createElement("div", { className: "h-28 md:hidden", "aria-hidden": "true" })),
|
|
7335
|
+
((_31 = props.bareSettings) === null || _31 === void 0 ? void 0 : _31.bareListMobileFloatingSearch) &&
|
|
7150
7336
|
(0, listModule_1.renderFloatingMobileSearch)({
|
|
7151
7337
|
filterSearch: filterSearch,
|
|
7152
7338
|
handleNameSearch: handleNameSearch,
|
|
@@ -7159,15 +7345,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7159
7345
|
handlePopUpModal(true, "filter");
|
|
7160
7346
|
}
|
|
7161
7347
|
},
|
|
7162
|
-
hideSearch: (
|
|
7163
|
-
darkMode: (
|
|
7164
|
-
floatingOffset: (
|
|
7165
|
-
hideFilter: !((
|
|
7166
|
-
activeFilterCount: ((
|
|
7348
|
+
hideSearch: (_32 = props.organise) === null || _32 === void 0 ? void 0 : _32.hideSearch,
|
|
7349
|
+
darkMode: (_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.darkMode,
|
|
7350
|
+
floatingOffset: (_34 = props.bareSettings) === null || _34 === void 0 ? void 0 : _34.bareListFloatingActionOffset,
|
|
7351
|
+
hideFilter: !((_35 = props.bareSettings) === null || _35 === void 0 ? void 0 : _35.bareFlexFilters),
|
|
7352
|
+
activeFilterCount: ((_36 = props.bareSettings) === null || _36 === void 0 ? void 0 : _36.bareFlexFilters)
|
|
7167
7353
|
? activeFlexFilterCount_1
|
|
7168
7354
|
: undefined,
|
|
7169
7355
|
// INFO: Hides when items are selected so NewTable's multi-action bar takes over.
|
|
7170
|
-
hidden: selectAll || ((
|
|
7356
|
+
hidden: selectAll || ((_37 = selectedIds === null || selectedIds === void 0 ? void 0 : selectedIds.length) !== null && _37 !== void 0 ? _37 : 0) > 0,
|
|
7171
7357
|
})));
|
|
7172
7358
|
default:
|
|
7173
7359
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
@@ -7177,7 +7363,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7177
7363
|
//SECTION: Render Utils
|
|
7178
7364
|
//=====================================================================================
|
|
7179
7365
|
var renderDataTemplateFormContent = function (state, model, ref, isObject, isObjectList, modalInput, parentData) {
|
|
7180
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
7366
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
7181
7367
|
return (0, updateModule_1.renderDataTemplateForm)(state, model, ref, {
|
|
7182
7368
|
handleOnChangeAddress: handleOnChangeAddress,
|
|
7183
7369
|
handleOnChangeText: handleOnChangeText,
|
|
@@ -7199,10 +7385,14 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7199
7385
|
showId: showId,
|
|
7200
7386
|
remainId: remainId,
|
|
7201
7387
|
groupIdCollapsible: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.groupIdCollapsible,
|
|
7388
|
+
groupDescriptions: (_d = props.organise) === null || _d === void 0 ? void 0 : _d.groupDescriptions,
|
|
7202
7389
|
}, {
|
|
7203
7390
|
dbModule: dbModule,
|
|
7204
7391
|
devSettings: devSettings,
|
|
7205
|
-
|
|
7392
|
+
// INFO: the object editor opened from a list cell has no read/update
|
|
7393
|
+
// fetch behind it — the list-load seed is what gives its nested
|
|
7394
|
+
// reference Select a label before the user searches
|
|
7395
|
+
referencesOptions: __assign(__assign({}, listReferencesOptions), referencesOptions),
|
|
7206
7396
|
referencesDetails: referencesDetails,
|
|
7207
7397
|
referenceLoading: referenceLoading,
|
|
7208
7398
|
setReferenceLoading: setReferenceLoading,
|
|
@@ -7212,12 +7402,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7212
7402
|
imageEndpoint: devSettings.imageEndpoint,
|
|
7213
7403
|
maxFileSize: devSettings.maxFileSize,
|
|
7214
7404
|
imageBucketName: devSettings.bucketName,
|
|
7215
|
-
handleCustomDownloadFile: (
|
|
7405
|
+
handleCustomDownloadFile: (_e = props.organise) === null || _e === void 0 ? void 0 : _e.handleCustomDownloadFile,
|
|
7216
7406
|
}, {
|
|
7217
7407
|
selectedObjectId: selectedObjectId,
|
|
7218
7408
|
selectedObjectStructureId: selectedObjectStructureId,
|
|
7219
7409
|
parentData: parentData,
|
|
7220
|
-
organiseListObjTableView: ((
|
|
7410
|
+
organiseListObjTableView: ((_f = props.organise) === null || _f === void 0 ? void 0 : _f.listObjectTableView)
|
|
7221
7411
|
? true
|
|
7222
7412
|
: false,
|
|
7223
7413
|
setSelectedObjectStructureId: setSelectedObjectStructureId,
|
|
@@ -7227,7 +7417,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7227
7417
|
renderObjectTags: renderObjectTags,
|
|
7228
7418
|
setSelectedData: setSelectedData,
|
|
7229
7419
|
flexTableRefs: flexTableRefs,
|
|
7230
|
-
}, { signing: signatureSigning, setSigning: setSignatureSigning }, props.onComplete ? true : false, (
|
|
7420
|
+
}, { signing: signatureSigning, setSigning: setSignatureSigning }, props.onComplete ? true : false, (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareOffline, (_j = (_h = props.bareSettings) === null || _h === void 0 ? void 0 : _h.bareUpdateColumnType) !== null && _j !== void 0 ? _j : "two", (_k = props.bareSettings) === null || _k === void 0 ? void 0 : _k.bareUpdateIndividualComponent, (_l = props.bareSettings) === null || _l === void 0 ? void 0 : _l.bareUpdateMobileView);
|
|
7231
7421
|
};
|
|
7232
7422
|
var renderGridAndListData = function (imageTag, type, kanbanGroupId, useColumnName) {
|
|
7233
7423
|
var _a, _b;
|
|
@@ -7529,9 +7719,54 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7529
7719
|
var _a, _b, _c;
|
|
7530
7720
|
return (react_1.default.createElement(settingsModal_1.ExpressionModal, { selectedId: id, model: structure, renderReferenceLabelOptions: (_a = props.organise) === null || _a === void 0 ? void 0 : _a.renderReferenceLabelOptions, renderReferenceSpaceOptions: (_b = props.organise) === null || _b === void 0 ? void 0 : _b.renderReferenceSpaceOptions, onAddModelSchema: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.onAddColumns, onClose: onClose }));
|
|
7531
7721
|
};
|
|
7722
|
+
// INFO: for NewTable, groupBy stays inside one table — rows are handed over
|
|
7723
|
+
// as coloured, collapsible bands keyed the same way the legacy split is
|
|
7724
|
+
var handleBuildNewTableGroups = function () {
|
|
7725
|
+
var _a;
|
|
7726
|
+
if (!groupId || !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW))
|
|
7727
|
+
return undefined;
|
|
7728
|
+
var groupAttributeDS = structure.find(function (eachDS) { return eachDS.id === groupId; });
|
|
7729
|
+
var groups = [];
|
|
7730
|
+
(spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : []).forEach(function (eachData, index) {
|
|
7731
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
7732
|
+
// INFO: key off the raw row — the display row holds a Tag element for a
|
|
7733
|
+
// coloured list value, which would put every row under "Unknown"
|
|
7734
|
+
var rawValue = (_b = (_a = tableData === null || tableData === void 0 ? void 0 : tableData[index]) === null || _a === void 0 ? void 0 : _a[groupId]) !== null && _b !== void 0 ? _b : eachData === null || eachData === void 0 ? void 0 : eachData[groupId];
|
|
7735
|
+
var key;
|
|
7736
|
+
if ((groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.type) === "date" && rawValue && rawValue !== " - ") {
|
|
7737
|
+
key = (0, dayjs_1.default)(isFirebase ? (rawValue === null || rawValue === void 0 ? void 0 : rawValue._seconds) * 1000 : rawValue)
|
|
7738
|
+
.startOf("day")
|
|
7739
|
+
.format("YYYY-MM-DD");
|
|
7740
|
+
}
|
|
7741
|
+
else {
|
|
7742
|
+
key =
|
|
7743
|
+
rawValue && rawValue !== " - " && typeof rawValue !== "object"
|
|
7744
|
+
? String(rawValue)
|
|
7745
|
+
: "Unknown/No Value";
|
|
7746
|
+
}
|
|
7747
|
+
var rowId = (_d = (_c = tableData === null || tableData === void 0 ? void 0 : tableData[index]) === null || _c === void 0 ? void 0 : _c.id) !== null && _d !== void 0 ? _d : (_e = tableData === null || tableData === void 0 ? void 0 : tableData[index]) === null || _e === void 0 ? void 0 : _e._id;
|
|
7748
|
+
if (!rowId)
|
|
7749
|
+
return;
|
|
7750
|
+
var group = groups.find(function (eachGroup) { return eachGroup.id === key; });
|
|
7751
|
+
if (!group) {
|
|
7752
|
+
var optionIndex = (_g = (_f = groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.listSelection) === null || _f === void 0 ? void 0 : _f.indexOf(key)) !== null && _g !== void 0 ? _g : -1;
|
|
7753
|
+
group = {
|
|
7754
|
+
id: key,
|
|
7755
|
+
title: key,
|
|
7756
|
+
colour: optionIndex >= 0
|
|
7757
|
+
? (_h = groupAttributeDS === null || groupAttributeDS === void 0 ? void 0 : groupAttributeDS.listSelectionColour) === null || _h === void 0 ? void 0 : _h[optionIndex]
|
|
7758
|
+
: undefined,
|
|
7759
|
+
rowIds: [],
|
|
7760
|
+
};
|
|
7761
|
+
groups.push(group);
|
|
7762
|
+
}
|
|
7763
|
+
group.rowIds.push(rowId);
|
|
7764
|
+
});
|
|
7765
|
+
return groups;
|
|
7766
|
+
};
|
|
7532
7767
|
var renderGroupTable = function (multipleSelect) {
|
|
7533
|
-
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;
|
|
7534
|
-
if (groupId) {
|
|
7768
|
+
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;
|
|
7769
|
+
if (groupId && !((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareNewDTW)) {
|
|
7535
7770
|
var groupAttributeDS_1 = structure.find(function (eachDS) { return eachDS.id === groupId; });
|
|
7536
7771
|
var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
|
|
7537
7772
|
var _a;
|
|
@@ -7569,7 +7804,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7569
7804
|
react_1.default.createElement("div", { className: "font-semibold text-md mt-5" },
|
|
7570
7805
|
"Group By ",
|
|
7571
7806
|
eachKey),
|
|
7572
|
-
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" },
|
|
7807
|
+
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" },
|
|
7573
7808
|
selectedIds.length > 0 &&
|
|
7574
7809
|
!((_e = props.edit) === null || _e === void 0 ? void 0 : _e.disabledUpdate) &&
|
|
7575
7810
|
!((_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
@@ -7654,9 +7889,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7654
7889
|
}
|
|
7655
7890
|
else {
|
|
7656
7891
|
// INFO: when bareNewDTW is enabled, render NewTable instead of legacy Table
|
|
7657
|
-
if ((
|
|
7658
|
-
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: (
|
|
7659
|
-
!((
|
|
7892
|
+
if ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareNewDTW) {
|
|
7893
|
+
return (react_1.default.createElement(newTable_1.NewTable, { showId: showId, paginationType: renderResolvedPaginationType(), data: tableData, spaceData: spaceTableData !== null && spaceTableData !== void 0 ? spaceTableData : [], referencesOptions: listReferencesOptions, groups: handleBuildNewTableGroups(), 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: (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.disableSelectFullData) === null || _d === void 0 ? void 0 : _d.table, maxSelectedCount: (_e = props.bareSettings) === null || _e === void 0 ? void 0 : _e.bareListMaxSelectedCount, mobileView: (_f = props.bareSettings) === null || _f === void 0 ? void 0 : _f.bareListMobileView, mobileTooltip: (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareMobileTooltip, multiActionFloatingBtns: __spreadArray(__spreadArray(__spreadArray(__spreadArray([], (!((_h = props.edit) === null || _h === void 0 ? void 0 : _h.disabledUpdate) &&
|
|
7894
|
+
!((_j = props.bareSettings) === null || _j === void 0 ? void 0 : _j.bareHideTableExtraMultipleAction)
|
|
7660
7895
|
? [
|
|
7661
7896
|
{
|
|
7662
7897
|
id: "draft",
|
|
@@ -7671,7 +7906,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7671
7906
|
hide: selectedIds.length === 0,
|
|
7672
7907
|
},
|
|
7673
7908
|
]
|
|
7674
|
-
: []), true), (((
|
|
7909
|
+
: []), true), (((_k = props.edit) === null || _k === void 0 ? void 0 : _k.deleteBtn)
|
|
7675
7910
|
? [
|
|
7676
7911
|
{
|
|
7677
7912
|
id: "delete",
|
|
@@ -7682,7 +7917,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7682
7917
|
},
|
|
7683
7918
|
},
|
|
7684
7919
|
]
|
|
7685
|
-
: []), true), (!isFirebase && !((
|
|
7920
|
+
: []), true), (!isFirebase && !((_l = props.edit) === null || _l === void 0 ? void 0 : _l.disableBatchUpdate)
|
|
7686
7921
|
? [
|
|
7687
7922
|
{
|
|
7688
7923
|
id: "update",
|
|
@@ -7690,7 +7925,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7690
7925
|
onClick: function () { return setBatchUpdateModal(true); },
|
|
7691
7926
|
},
|
|
7692
7927
|
]
|
|
7693
|
-
: []), true), (((
|
|
7928
|
+
: []), true), (((_m = props.bareSettings) === null || _m === void 0 ? void 0 : _m.bareListMultipleSelectAddtionalActions)
|
|
7694
7929
|
? props.bareSettings.bareListMultipleSelectAddtionalActions.map(function (eachButton) { return ({
|
|
7695
7930
|
id: "dt-list-multi-action-btn-" + eachButton.text,
|
|
7696
7931
|
btnText: eachButton.text,
|
|
@@ -7699,23 +7934,23 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7699
7934
|
return (_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
|
|
7700
7935
|
},
|
|
7701
7936
|
}); })
|
|
7702
|
-
: []), true), multiActionFloatingOffset: (
|
|
7937
|
+
: []), true), multiActionFloatingOffset: (_o = props.bareSettings) === null || _o === void 0 ? void 0 : _o.bareListFloatingActionOffset, handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
|
|
7703
7938
|
var _a, _b;
|
|
7704
7939
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
7705
|
-
}, linkType: props.linkType, custom: props.custom, newTabUrl: (
|
|
7940
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_q = (_p = props.newTabUrl) === null || _p === void 0 ? void 0 : _p.default) !== null && _q !== void 0 ? _q : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_s = (_r = props.newTabUrl) === null || _r === void 0 ? void 0 : _r.addons) !== null && _s !== void 0 ? _s : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
7706
7941
|
handlePagination(value);
|
|
7707
|
-
}, className: "mt-5", devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (
|
|
7708
|
-
addColumnEnabled: (
|
|
7942
|
+
}, className: "mt-5", devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_t = props.organise) === null || _t === void 0 ? void 0 : _t.fixedPagination, advSettings: {
|
|
7943
|
+
addColumnEnabled: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.addColumnEnabled,
|
|
7709
7944
|
renderAddColumnElements: renderAddMathColumn,
|
|
7710
|
-
dragEnabled: (
|
|
7711
|
-
sortEnabled: (
|
|
7712
|
-
filterEnabled: ((
|
|
7945
|
+
dragEnabled: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.advDragEnabled,
|
|
7946
|
+
sortEnabled: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.advSortEnabled,
|
|
7947
|
+
filterEnabled: ((_x = props.bareSettings) === null || _x === void 0 ? void 0 : _x.bareFlexFilters)
|
|
7713
7948
|
? false
|
|
7714
|
-
: (
|
|
7949
|
+
: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.advFilterEnabled,
|
|
7715
7950
|
sortId: activeSortId,
|
|
7716
|
-
sortOptions: (
|
|
7951
|
+
sortOptions: (_0 = (_z = props.organise) === null || _z === void 0 ? void 0 : _z.renderReferenceLabelOptions) === null || _0 === void 0 ? void 0 : _0.call(_z),
|
|
7717
7952
|
onSortColumn: handleSortColumn,
|
|
7718
|
-
onDragColumn: (
|
|
7953
|
+
onDragColumn: (_1 = props.organise) === null || _1 === void 0 ? void 0 : _1.onChangeDrag,
|
|
7719
7954
|
filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
|
|
7720
7955
|
var _a;
|
|
7721
7956
|
return {
|
|
@@ -7732,7 +7967,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7732
7967
|
return renderSearchContent(newQuery);
|
|
7733
7968
|
},
|
|
7734
7969
|
}, editable: {
|
|
7735
|
-
active: ((
|
|
7970
|
+
active: ((_2 = props.edit) === null || _2 === void 0 ? void 0 : _2.listEditable) && !props.edit.disabledUpdate
|
|
7736
7971
|
? true
|
|
7737
7972
|
: false,
|
|
7738
7973
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -7746,7 +7981,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7746
7981
|
});
|
|
7747
7982
|
}); },
|
|
7748
7983
|
}, onObjectEdit: handleObjectCellEdit, addable: {
|
|
7749
|
-
active: ((
|
|
7984
|
+
active: ((_3 = props.edit) === null || _3 === void 0 ? void 0 : _3.listAddable) ? true : false,
|
|
7750
7985
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7751
7986
|
return __generator(this, function (_a) {
|
|
7752
7987
|
switch (_a.label) {
|
|
@@ -7757,27 +7992,27 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7757
7992
|
}
|
|
7758
7993
|
});
|
|
7759
7994
|
}); },
|
|
7760
|
-
}, darkMode: (
|
|
7995
|
+
}, darkMode: (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.darkMode, hidePagination: (_5 = props.organise) === null || _5 === void 0 ? void 0 : _5.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.disableEllipsisOnLongWord, pinColumns: (_7 = props.bareSettings) === null || _7 === void 0 ? void 0 : _7.bareListTablePinColumns }));
|
|
7761
7996
|
}
|
|
7762
|
-
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: (
|
|
7997
|
+
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: (_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.disableSelectFullData) === null || _9 === void 0 ? void 0 : _9.table, multiActionButton: react_1.default.createElement("div", { className: "flex flex-row space-x-3" },
|
|
7763
7998
|
selectedIds.length > 0 &&
|
|
7764
|
-
!((
|
|
7765
|
-
!((
|
|
7999
|
+
!((_10 = props.edit) === null || _10 === void 0 ? void 0 : _10.disabledUpdate) &&
|
|
8000
|
+
!((_11 = props.bareSettings) === null || _11 === void 0 ? void 0 : _11.bareHideTableExtraMultipleAction) && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
7766
8001
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Change to Draft", disable: loading, onClick: function () {
|
|
7767
8002
|
handleBatchDraftData();
|
|
7768
8003
|
} }),
|
|
7769
8004
|
react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Clone Items", disable: loading, onClick: function () {
|
|
7770
8005
|
handleCloneSelectedData();
|
|
7771
8006
|
} }))),
|
|
7772
|
-
((
|
|
8007
|
+
((_12 = props.edit) === null || _12 === void 0 ? void 0 : _12.deleteBtn) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm text-red-500 hover:text-red-600", text: "Delete", onClick: function () {
|
|
7773
8008
|
handleGenerateDeletePasscode();
|
|
7774
8009
|
setDeleteModal(true);
|
|
7775
8010
|
} })),
|
|
7776
|
-
!isFirebase && !((
|
|
8011
|
+
!isFirebase && !((_13 = props.edit) === null || _13 === void 0 ? void 0 : _13.disableBatchUpdate) && (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm", text: "Update", onClick: function () {
|
|
7777
8012
|
setBatchUpdateModal(true);
|
|
7778
8013
|
} })),
|
|
7779
|
-
((
|
|
7780
|
-
((
|
|
8014
|
+
((_14 = props.bareSettings) === null || _14 === void 0 ? void 0 : _14.bareListMultipleSelectAddtionalActions) &&
|
|
8015
|
+
((_16 = (_15 = props.bareSettings) === null || _15 === void 0 ? void 0 : _15.bareListMultipleSelectAddtionalActions) === null || _16 === void 0 ? void 0 : _16.map(function (eachButton) {
|
|
7781
8016
|
return (react_1.default.createElement(textButton_1.TextButton, { className: "text-sm ".concat(eachButton.className), text: eachButton.text, onClick: function () {
|
|
7782
8017
|
var _a, _b;
|
|
7783
8018
|
(_a = eachButton.onClick) === null || _a === void 0 ? void 0 : _a.call(eachButton, selectedIds, selectAll, (_b = renderImpSearchFilterConditions()) !== null && _b !== void 0 ? _b : []);
|
|
@@ -7785,20 +8020,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7785
8020
|
}))), handleSelectAll: handleSelectAllPages, handleSelectedIds: handleSelectIds, header: renderTableHeader(), pageIndex: pageIndex !== null && pageIndex !== void 0 ? pageIndex : 0, onClickRow: function (id) {
|
|
7786
8021
|
var _a, _b;
|
|
7787
8022
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
7788
|
-
}, linkType: props.linkType, custom: props.custom, newTabUrl: (
|
|
8023
|
+
}, linkType: props.linkType, custom: props.custom, newTabUrl: (_18 = (_17 = props.newTabUrl) === null || _17 === void 0 ? void 0 : _17.default) !== null && _18 !== void 0 ? _18 : "".concat(props.localURLEndpoint, "?data="), addNewTabUrl: (_20 = (_19 = props.newTabUrl) === null || _19 === void 0 ? void 0 : _19.addons) !== null && _20 !== void 0 ? _20 : "&type=read&collection=".concat(props.collectionId, "&view=general"), handleUpdatePageIndex: function (value) {
|
|
7789
8024
|
handlePagination(value);
|
|
7790
|
-
}, className: "mt-5", lib: { axios: (
|
|
7791
|
-
addColumnEnabled: (
|
|
8025
|
+
}, className: "mt-5", lib: { axios: (_21 = props.lib) === null || _21 === void 0 ? void 0 : _21.axios }, devSettings: props.devSettings, bareSettings: props.bareSettings, fixedPagination: (_22 = props.organise) === null || _22 === void 0 ? void 0 : _22.fixedPagination, advSettings: {
|
|
8026
|
+
addColumnEnabled: (_23 = props.organise) === null || _23 === void 0 ? void 0 : _23.addColumnEnabled,
|
|
7792
8027
|
renderAddColumnElements: renderAddMathColumn,
|
|
7793
|
-
dragEnabled: (
|
|
7794
|
-
sortEnabled: (
|
|
7795
|
-
filterEnabled: ((
|
|
8028
|
+
dragEnabled: (_24 = props.organise) === null || _24 === void 0 ? void 0 : _24.advDragEnabled,
|
|
8029
|
+
sortEnabled: (_25 = props.organise) === null || _25 === void 0 ? void 0 : _25.advSortEnabled,
|
|
8030
|
+
filterEnabled: ((_26 = props.bareSettings) === null || _26 === void 0 ? void 0 : _26.bareFlexFilters)
|
|
7796
8031
|
? false
|
|
7797
|
-
: (
|
|
8032
|
+
: (_27 = props.organise) === null || _27 === void 0 ? void 0 : _27.advFilterEnabled,
|
|
7798
8033
|
sortId: activeSortId,
|
|
7799
|
-
sortOptions: (
|
|
8034
|
+
sortOptions: (_29 = (_28 = props.organise) === null || _28 === void 0 ? void 0 : _28.renderReferenceLabelOptions) === null || _29 === void 0 ? void 0 : _29.call(_28),
|
|
7800
8035
|
onSortColumn: handleSortColumn,
|
|
7801
|
-
onDragColumn: (
|
|
8036
|
+
onDragColumn: (_30 = props.organise) === null || _30 === void 0 ? void 0 : _30.onChangeDrag,
|
|
7802
8037
|
filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
|
|
7803
8038
|
var _a;
|
|
7804
8039
|
return {
|
|
@@ -7815,7 +8050,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7815
8050
|
return renderSearchContent(newQuery);
|
|
7816
8051
|
},
|
|
7817
8052
|
}, editable: {
|
|
7818
|
-
active: ((
|
|
8053
|
+
active: ((_31 = props.edit) === null || _31 === void 0 ? void 0 : _31.listEditable) && !props.edit.disabledUpdate
|
|
7819
8054
|
? true
|
|
7820
8055
|
: false,
|
|
7821
8056
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -7829,7 +8064,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7829
8064
|
});
|
|
7830
8065
|
}); },
|
|
7831
8066
|
}, onObjectEdit: handleObjectCellEdit, addable: {
|
|
7832
|
-
active: ((
|
|
8067
|
+
active: ((_32 = props.edit) === null || _32 === void 0 ? void 0 : _32.listAddable) ? true : false,
|
|
7833
8068
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7834
8069
|
return __generator(this, function (_a) {
|
|
7835
8070
|
switch (_a.label) {
|
|
@@ -7840,7 +8075,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7840
8075
|
}
|
|
7841
8076
|
});
|
|
7842
8077
|
}); },
|
|
7843
|
-
}, darkMode: (
|
|
8078
|
+
}, darkMode: (_33 = props.organise) === null || _33 === void 0 ? void 0 : _33.darkMode, hidePagination: (_34 = props.organise) === null || _34 === void 0 ? void 0 : _34.hidePagination, customPaginationSize: customPaginationSize, disableEllipsisOnLongWord: (_35 = props.organise) === null || _35 === void 0 ? void 0 : _35.disableEllipsisOnLongWord }));
|
|
7844
8079
|
}
|
|
7845
8080
|
};
|
|
7846
8081
|
var renderTabContent = function (tabs, dataType, viewType) {
|
|
@@ -7907,7 +8142,6 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7907
8142
|
}
|
|
7908
8143
|
});
|
|
7909
8144
|
sortedTabs.forEach(function (eachTab) {
|
|
7910
|
-
var _a, _b;
|
|
7911
8145
|
var groups = groupedStructures_1[eachTab];
|
|
7912
8146
|
var sortedGroups = Object.keys(groups).sort(function (a, b) {
|
|
7913
8147
|
if (a === "Others")
|
|
@@ -7926,13 +8160,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7926
8160
|
if ((Array.isArray(listData) && (listData === null || listData === void 0 ? void 0 : listData.length) > 0) ||
|
|
7927
8161
|
listObjModels.length > 0) {
|
|
7928
8162
|
tabElement.push(react_1.default.createElement("div", { key: "section-".concat(eachKey) },
|
|
7929
|
-
Array.isArray(listData) && (listData === null || listData === void 0 ? void 0 : listData.length) > 0 && (react_1.default.createElement(detailList_1.DetailList, { model: groups[eachKey], referenceModel: referenceModelSchema, className: "mt-5 bg-white rounded-md", title: eachKey, list: listData,
|
|
8163
|
+
Array.isArray(listData) && (listData === null || listData === void 0 ? void 0 : listData.length) > 0 && (react_1.default.createElement(detailList_1.DetailList, { model: groups[eachKey], referenceModel: referenceModelSchema, className: "mt-5 bg-white rounded-md", title: eachKey, list: listData,
|
|
8164
|
+
// INFO: a tabbed form is long by definition — its read
|
|
8165
|
+
// view uses the dense label : value rows
|
|
8166
|
+
size: ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareCompactMode) || hasTabs_1
|
|
7930
8167
|
? "compact"
|
|
7931
8168
|
: "default", handleReferenceLink: !schemaPresent &&
|
|
7932
8169
|
((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareReadReferenceView)
|
|
7933
8170
|
? props.bareSettings.bareReadReferenceView
|
|
7934
8171
|
: undefined, splitView: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.splitView })),
|
|
7935
|
-
listObjModels.length > 0 && (
|
|
8172
|
+
listObjModels.length > 0 && (
|
|
8173
|
+
// INFO: same card as the DetailList sections above so a
|
|
8174
|
+
// nested table lines up with them instead of sitting
|
|
8175
|
+
// indented on the page background
|
|
8176
|
+
react_1.default.createElement("div", { className: "mt-5 rounded-md bg-white px-4 pb-4 sm:px-6" }, renderListObject("read", listObjModels.map(function (eachModel) { return eachModel.id; }))))));
|
|
7936
8177
|
}
|
|
7937
8178
|
});
|
|
7938
8179
|
var allGanttCharts = Object.values(groups)
|
|
@@ -7951,15 +8192,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
7951
8192
|
readElement_1.push(react_1.default.createElement("div", { key: "tab-section-".concat(eachTab), ref: function (el) {
|
|
7952
8193
|
readTabSectionRefs.current[eachTab] = el;
|
|
7953
8194
|
} },
|
|
7954
|
-
hasTabs_1 && (react_1.default.createElement("div", { className: "bg-primary-500 rounded-lg mt-5 "
|
|
7955
|
-
|
|
7956
|
-
: "p-4") },
|
|
7957
|
-
react_1.default.createElement("h2", { className: "text-white font-semibold ".concat(((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareCompactMode)
|
|
7958
|
-
? "text-base"
|
|
7959
|
-
: "text-lg") }, eachTab))),
|
|
8195
|
+
hasTabs_1 && (react_1.default.createElement("div", { className: "bg-primary-500 rounded-lg mt-5 px-4 py-2" },
|
|
8196
|
+
react_1.default.createElement("h2", { className: "text-white font-semibold text-base" }, eachTab))),
|
|
7960
8197
|
tabElement,
|
|
7961
|
-
allGanttCharts.length > 0 && (react_1.default.createElement("div", { className: "px-6" }, renderGanttChart("read", allGanttCharts.map(function (eachModel) { return eachModel.id; })))),
|
|
7962
|
-
allCanvas.length > 0 && (react_1.default.createElement("div", { className: "px-6" }, renderCanvas("read", allCanvas.map(function (eachModel) { return eachModel.id; }))))));
|
|
8198
|
+
allGanttCharts.length > 0 && (react_1.default.createElement("div", { className: "mt-5 rounded-md bg-white px-4 pb-4 sm:px-6" }, renderGanttChart("read", allGanttCharts.map(function (eachModel) { return eachModel.id; })))),
|
|
8199
|
+
allCanvas.length > 0 && (react_1.default.createElement("div", { className: "mt-5 rounded-md bg-white px-4 pb-4 sm:px-6" }, renderCanvas("read", allCanvas.map(function (eachModel) { return eachModel.id; }))))));
|
|
7963
8200
|
}
|
|
7964
8201
|
});
|
|
7965
8202
|
var showReadFloatingNav_1 = ((_f = props.organise) === null || _f === void 0 ? void 0 : _f.showReadFloatingNav) && allTabSections_1.length > 1;
|
|
@@ -8482,7 +8719,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
8482
8719
|
return null;
|
|
8483
8720
|
if (location === "root" && modalVisible)
|
|
8484
8721
|
return null;
|
|
8485
|
-
|
|
8722
|
+
// INFO: nothing a silent step-change save reports is worth a toast
|
|
8723
|
+
if ((notification === null || notification === void 0 ? void 0 : notification.type) && silentDraftRef.current)
|
|
8724
|
+
return null;
|
|
8725
|
+
return (react_1.default.createElement(notification_1.Notification
|
|
8726
|
+
// INFO: phones keep the familiar bottom toast, lifted above the
|
|
8727
|
+
// floating action bar / floating search
|
|
8728
|
+
, {
|
|
8729
|
+
// INFO: phones keep the familiar bottom toast, lifted above the
|
|
8730
|
+
// floating action bar / floating search
|
|
8731
|
+
position: "bottom", mobileOffsetClassName: "pb-28", icon: notification.type ? correctIcon : incorrectIcon, notificationAttribute: {
|
|
8486
8732
|
title: notification.title,
|
|
8487
8733
|
desc: notification.msg,
|
|
8488
8734
|
visible: true,
|