blixify-ui-web 0.4.34 → 0.4.36
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 +2 -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 +242 -375
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/spaceModel.d.ts +2 -0
- package/lib/components/data/dataTemplate/spaceModel.d.ts.map +1 -1
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +28 -21
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/input/address/index.d.ts.map +1 -1
- package/lib/components/input/address/index.js +5 -4
- package/lib/components/input/address/index.js.map +1 -1
- package/lib/components/input/uploadInput/index.js +1 -1
- package/lib/components/input/uploadInput/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -140,7 +140,7 @@ var pagination_1 = require("./pagination");
|
|
|
140
140
|
var referenceModal_1 = require("./referenceModal");
|
|
141
141
|
var settingsModal_1 = require("./settingsModal");
|
|
142
142
|
exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
143
|
-
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;
|
|
143
|
+
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;
|
|
144
144
|
var formRef = (0, react_1.createRef)();
|
|
145
145
|
var objectFormRef = (0, react_1.createRef)();
|
|
146
146
|
var listAddressFromRef = (0, react_1.createRef)();
|
|
@@ -155,133 +155,135 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
155
155
|
var typingTimeout = (0, react_1.useRef)();
|
|
156
156
|
// const oldCollectionId: any = useRef();
|
|
157
157
|
var mapViewRef = (0, react_1.useRef)();
|
|
158
|
-
var
|
|
159
|
-
var
|
|
158
|
+
var _22 = (0, react_1.useState)(false), loading = _22[0], setLoading = _22[1];
|
|
159
|
+
var _23 = (0, react_1.useState)(), notification = _23[0], setNotification = _23[1];
|
|
160
160
|
//INFO : Used by List
|
|
161
|
-
var
|
|
162
|
-
var
|
|
163
|
-
var
|
|
164
|
-
var
|
|
165
|
-
var
|
|
166
|
-
var
|
|
167
|
-
var
|
|
161
|
+
var _24 = (0, react_1.useState)({}), filterSearch = _24[0], setFilterSearch = _24[1];
|
|
162
|
+
var _25 = (0, react_1.useState)({}), filterSearchParams = _25[0], setFilterSearchParams = _25[1];
|
|
163
|
+
var _26 = (0, react_1.useState)({}), filterSelection = _26[0], setFilterSelection = _26[1];
|
|
164
|
+
var _27 = (0, react_1.useState)({}), filterReference = _27[0], setFilterReference = _27[1];
|
|
165
|
+
var _28 = (0, react_1.useState)({}), filterReferenceSearch = _28[0], setFilterReferenceSearch = _28[1];
|
|
166
|
+
var _29 = (0, react_1.useState)({}), filterReferenceList = _29[0], setFilterReferenceList = _29[1];
|
|
167
|
+
var _30 = (0, react_1.useState)({
|
|
168
168
|
startDate: undefined,
|
|
169
169
|
endDate: undefined,
|
|
170
|
-
}), filterReferenceDate =
|
|
171
|
-
var
|
|
172
|
-
var
|
|
173
|
-
var
|
|
174
|
-
var
|
|
175
|
-
var
|
|
176
|
-
var
|
|
177
|
-
var
|
|
178
|
-
var
|
|
179
|
-
var
|
|
180
|
-
var
|
|
181
|
-
var
|
|
182
|
-
var
|
|
170
|
+
}), filterReferenceDate = _30[0], setFilterReferenceDate = _30[1];
|
|
171
|
+
var _31 = (0, react_1.useState)(true), tableLoading = _31[0], setTableLoading = _31[1];
|
|
172
|
+
var _32 = (0, react_1.useState)(""), cursor = _32[0], setCursor = _32[1];
|
|
173
|
+
var _33 = (0, react_1.useState)(""), lastCursor = _33[0], setLastCursor = _33[1];
|
|
174
|
+
var _34 = (0, react_1.useState)([]), tableData = _34[0], setTableData = _34[1];
|
|
175
|
+
var _35 = (0, react_1.useState)([]), spaceTableData = _35[0], setSpaceTableData = _35[1];
|
|
176
|
+
var _36 = (0, react_1.useState)(0), size = _36[0], setSize = _36[1];
|
|
177
|
+
var _37 = (0, react_1.useState)((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.pageIndex) !== null && _b !== void 0 ? _b : 0), pageIndex = _37[0], setPageIndex = _37[1];
|
|
178
|
+
var _38 = (0, react_1.useState)([]), selectedIds = _38[0], setSelectedIds = _38[1];
|
|
179
|
+
var _39 = (0, react_1.useState)(false), selectAll = _39[0], setSelectAll = _39[1];
|
|
180
|
+
var _40 = (0, react_1.useState)(""), deletePasscode = _40[0], setDeletePasscode = _40[1];
|
|
181
|
+
var _41 = (0, react_1.useState)(""), deletePasscodeInput = _41[0], setDeletePasscodeInput = _41[1];
|
|
182
|
+
var _42 = (0, react_1.useState)(""), deleteFeedId = _42[0], setDeleteFeedId = _42[1];
|
|
183
183
|
var previousType = (0, react_1.useRef)();
|
|
184
184
|
var previousSelectedData = (0, react_1.useRef)();
|
|
185
185
|
//INFO : Used by List Organise
|
|
186
|
-
var
|
|
187
|
-
var
|
|
188
|
-
var
|
|
189
|
-
var
|
|
190
|
-
var
|
|
191
|
-
var
|
|
192
|
-
var
|
|
193
|
-
var
|
|
194
|
-
var
|
|
195
|
-
var
|
|
196
|
-
var
|
|
197
|
-
var
|
|
186
|
+
var _43 = (0, react_1.useState)(false), sortModal = _43[0], setSortModal = _43[1];
|
|
187
|
+
var _44 = (0, react_1.useState)(false), filterModal = _44[0], setFilterModal = _44[1];
|
|
188
|
+
var _45 = (0, react_1.useState)(false), addTabModal = _45[0], setAddTabModal = _45[1];
|
|
189
|
+
var _46 = (0, react_1.useState)(false), overviewModal = _46[0], setOverviewModal = _46[1];
|
|
190
|
+
var _47 = (0, react_1.useState)((_c = props.defaultTab) !== null && _c !== void 0 ? _c : ""), selectedTab = _47[0], setSelectedTab = _47[1];
|
|
191
|
+
var _48 = (0, react_1.useState)("dayGridMonth"), calendarView = _48[0], setCalendarView = _48[1];
|
|
192
|
+
var _49 = (0, react_1.useState)(new Date()), calendarTabMonth = _49[0], setCalendarTabMonth = _49[1];
|
|
193
|
+
var _50 = (0, react_1.useState)(true), kanbanDroppable = _50[0], setKanbanDroppable = _50[1];
|
|
194
|
+
var _51 = (0, react_1.useState)([]), kanbanOptions = _51[0], setKanbanOptions = _51[1];
|
|
195
|
+
var _52 = (0, react_1.useState)(false), queryForm = _52[0], setQueryForm = _52[1];
|
|
196
|
+
var _53 = (0, react_1.useState)(false), batchUpdateModal = _53[0], setBatchUpdateModal = _53[1];
|
|
197
|
+
var _54 = (0, react_1.useState)({
|
|
198
198
|
columnId: "",
|
|
199
199
|
columnData: {},
|
|
200
|
-
}), batchUpdateData =
|
|
200
|
+
}), batchUpdateData = _54[0], setBatchUpdateData = _54[1];
|
|
201
|
+
var _55 = (0, react_1.useState)((props === null || props === void 0 ? void 0 : props.model) || []), structure = _55[0], setStructure = _55[1];
|
|
202
|
+
var _56 = (0, react_1.useState)(((_d = props === null || props === void 0 ? void 0 : props.organise) === null || _d === void 0 ? void 0 : _d.additionalQuery) || []), additionalQuery = _56[0], setAdditionalQuery = _56[1];
|
|
201
203
|
//INFO : Used by Auth
|
|
202
|
-
var
|
|
204
|
+
var _57 = (0, react_1.useState)({
|
|
203
205
|
email: "",
|
|
204
206
|
google: "",
|
|
205
207
|
phone: "",
|
|
206
208
|
disabled: false,
|
|
207
|
-
}), authMethods =
|
|
208
|
-
var
|
|
209
|
+
}), authMethods = _57[0], setAuthMethods = _57[1];
|
|
210
|
+
var _58 = (0, react_1.useState)(""), selectedAuthMethod = _58[0], setSelectedAuthMethod = _58[1];
|
|
209
211
|
// INFO: Used by Activity Log
|
|
210
|
-
var
|
|
211
|
-
var
|
|
212
|
+
var _59 = (0, react_1.useState)(false), activityModal = _59[0], setActivityModal = _59[1];
|
|
213
|
+
var _60 = (0, react_1.useState)(""), activityId = _60[0], setActivityId = _60[1];
|
|
212
214
|
//INFO : Used by Export
|
|
213
|
-
var
|
|
214
|
-
var
|
|
215
|
-
var
|
|
216
|
-
var
|
|
217
|
-
var
|
|
218
|
-
var
|
|
219
|
-
var
|
|
220
|
-
var
|
|
221
|
-
var
|
|
222
|
-
var
|
|
223
|
-
var
|
|
224
|
-
var
|
|
225
|
-
var
|
|
215
|
+
var _61 = (0, react_1.useState)(null), csvFile = _61[0], setCSVFile = _61[1];
|
|
216
|
+
var _62 = (0, react_1.useState)([]), csvFileData = _62[0], setCSVFileData = _62[1];
|
|
217
|
+
var _63 = (0, react_1.useState)(0), stepCSVIndex = _63[0], setStepCSVIndex = _63[1];
|
|
218
|
+
var _64 = (0, react_1.useState)({}), listCSVMapAttribute = _64[0], setListCSVMapAttribute = _64[1];
|
|
219
|
+
var _65 = (0, react_1.useState)({}), listCSVObjAttribute = _65[0], setListCSVObjAttribute = _65[1];
|
|
220
|
+
var _66 = (0, react_1.useState)([]), csvAPIAttribute = _66[0], setCSVAPIAttribute = _66[1];
|
|
221
|
+
var _67 = (0, react_1.useState)(((_e = props.devSettings.currentUser) === null || _e === void 0 ? void 0 : _e.userEmail) || ""), exportCSVEmail = _67[0], setExportCSVEmail = _67[1];
|
|
222
|
+
var _68 = (0, react_1.useState)(((_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.exportSettings) === null || _g === void 0 ? void 0 : _g.defaultExportPDFName) || ""), exportPDFTitle = _68[0], setExportPDFTitle = _68[1];
|
|
223
|
+
var _69 = (0, react_1.useState)([]), exportSumAttributeIds = _69[0], setExportSumAttributeIds = _69[1];
|
|
224
|
+
var _70 = (0, react_1.useState)([]), importTableData = _70[0], setImportTableData = _70[1];
|
|
225
|
+
var _71 = (0, react_1.useState)([]), queryList = _71[0], setQueryList = _71[1];
|
|
226
|
+
var _72 = (0, react_1.useState)(-1), queryIndex = _72[0], setQueryIndex = _72[1];
|
|
227
|
+
var _73 = (0, react_1.useState)((_h = props.organise) === null || _h === void 0 ? void 0 : _h.groupBy), groupId = _73[0], setGroupId = _73[1];
|
|
226
228
|
//INFO : Used by Read
|
|
227
229
|
//INFO : Used by Update
|
|
228
|
-
var
|
|
229
|
-
var
|
|
230
|
-
var
|
|
231
|
-
var
|
|
232
|
-
var
|
|
233
|
-
var
|
|
234
|
-
var
|
|
235
|
-
var
|
|
236
|
-
var
|
|
237
|
-
var
|
|
238
|
-
var
|
|
239
|
-
var
|
|
230
|
+
var _74 = (0, react_1.useState)(false), modalVisible = _74[0], setModalVisible = _74[1];
|
|
231
|
+
var _75 = (0, react_1.useState)(false), deleteModal = _75[0], setDeleteModal = _75[1];
|
|
232
|
+
var _76 = (0, react_1.useState)(false), excelModal = _76[0], setExcelModal = _76[1];
|
|
233
|
+
var _77 = (0, react_1.useState)(false), exportExcel = _77[0], setExportExcel = _77[1];
|
|
234
|
+
var _78 = (0, react_1.useState)(""), exportType = _78[0], setExportType = _78[1];
|
|
235
|
+
var _79 = (0, react_1.useState)(false), exportQR = _79[0], setExportQR = _79[1];
|
|
236
|
+
var _80 = (0, react_1.useState)(false), signatureSigning = _80[0], setSignatureSigning = _80[1];
|
|
237
|
+
var _81 = (0, react_1.useState)({}), selectedData = _81[0], setSelectedData = _81[1];
|
|
238
|
+
var _82 = (0, react_1.useState)(""), selectedObjectStructureId = _82[0], setSelectedObjectStructureId = _82[1];
|
|
239
|
+
var _83 = (0, react_1.useState)(""), selectedObjectId = _83[0], setSelectedObjectId = _83[1];
|
|
240
|
+
var _84 = (0, react_1.useState)(""), selectedListAddressId = _84[0], setSelectedListAddressId = _84[1];
|
|
241
|
+
var _85 = (0, react_1.useState)({
|
|
240
242
|
lat: 0,
|
|
241
243
|
lng: 0,
|
|
242
244
|
name: "",
|
|
243
|
-
}), selectedListAddress =
|
|
244
|
-
var
|
|
245
|
-
var
|
|
246
|
-
var
|
|
247
|
-
var
|
|
248
|
-
var
|
|
249
|
-
var
|
|
250
|
-
var
|
|
245
|
+
}), selectedListAddress = _85[0], setSelectedListAddress = _85[1];
|
|
246
|
+
var _86 = (0, react_1.useState)({}), selectedObjectData = _86[0], setSelectedObjectData = _86[1];
|
|
247
|
+
var _87 = (0, react_1.useState)(false), referenceLoading = _87[0], setReferenceLoading = _87[1];
|
|
248
|
+
var _88 = (0, react_1.useState)({}), referencesOptions = _88[0], setReferencesOptions = _88[1];
|
|
249
|
+
var _89 = (0, react_1.useState)({}), referencesDetails = _89[0], setReferencesDetails = _89[1];
|
|
250
|
+
var _90 = (0, react_1.useState)({}), referenceDeleteTableData = _90[0], setReferenceDeleteTableData = _90[1];
|
|
251
|
+
var _91 = (0, react_1.useState)(0), referenceDeleteIndex = _91[0], setReferenceDeleteIndex = _91[1];
|
|
252
|
+
var _92 = (0, react_1.useState)({
|
|
251
253
|
id: "",
|
|
252
254
|
name: "",
|
|
253
255
|
type: "string",
|
|
254
|
-
}), referenceCreationModal =
|
|
255
|
-
var
|
|
256
|
+
}), referenceCreationModal = _92[0], setReferenceCreationModal = _92[1];
|
|
257
|
+
var _93 = (0, react_1.useState)({}), referenceModelSchema = _93[0], setReferenceSchema = _93[1];
|
|
256
258
|
// INFO ; Use to Trigger Update Prefill UI
|
|
257
|
-
var
|
|
259
|
+
var _94 = (0, react_1.useState)(false), prefillTrigger = _94[0], setPrefillTrigger = _94[1];
|
|
258
260
|
//INFO : Offline
|
|
259
|
-
var
|
|
260
|
-
var
|
|
261
|
+
var _95 = (0, react_1.useState)(0), offlineDataLength = _95[0], setOfflineDataLength = _95[1];
|
|
262
|
+
var _96 = (0, react_1.useState)(false), offlineModal = _96[0], setOfflineModal = _96[1];
|
|
261
263
|
var devSettings = props.devSettings;
|
|
262
264
|
var serverId = (0, utils_1.parseServerId)(devSettings.server);
|
|
263
|
-
var viewType = (
|
|
265
|
+
var viewType = (_k = (_j = props.organise) === null || _j === void 0 ? void 0 : _j.viewId) !== null && _k !== void 0 ? _k : "general";
|
|
264
266
|
var isFirebaseClient = devSettings.server === "firebase";
|
|
265
267
|
var isFirebase = isFirebaseClient || devSettings.server === "fbServer";
|
|
266
|
-
var dbModule = isFirebaseClient ? (
|
|
268
|
+
var dbModule = isFirebaseClient ? (_l = props.lib) === null || _l === void 0 ? void 0 : _l.firebase : (_m = props.lib) === null || _m === void 0 ? void 0 : _m.axios;
|
|
267
269
|
var schemaPresent = props.devSettings.schemaEndpoint ? true : false;
|
|
268
270
|
var limit = props.limit ? props.limit : 10;
|
|
269
|
-
var isEditor = ((
|
|
270
|
-
var isOffline = (
|
|
271
|
-
var showId = (
|
|
272
|
-
var idField = (
|
|
273
|
-
var pipeline = (
|
|
274
|
-
var hasNavigation = ((
|
|
275
|
-
var formColumn = ((
|
|
271
|
+
var isEditor = ((_o = props.edit) === null || _o === void 0 ? void 0 : _o.allEditable) ? true : false;
|
|
272
|
+
var isOffline = (_p = props.bareSettings) === null || _p === void 0 ? void 0 : _p.bareOffline;
|
|
273
|
+
var showId = (_q = props.space) === null || _q === void 0 ? void 0 : _q.showId;
|
|
274
|
+
var idField = (_r = props.space) === null || _r === void 0 ? void 0 : _r.idField;
|
|
275
|
+
var pipeline = (_s = props === null || props === void 0 ? void 0 : props.space) === null || _s === void 0 ? void 0 : _s.pipeline;
|
|
276
|
+
var hasNavigation = ((_t = props.organise) === null || _t === void 0 ? void 0 : _t.handleNavigate) ? true : false;
|
|
277
|
+
var formColumn = ((_u = props.bareSettings) === null || _u === void 0 ? void 0 : _u.bareUpdateOneColumn)
|
|
276
278
|
? "grid-cols-2"
|
|
277
279
|
: "grid-cols-4";
|
|
278
|
-
var isActivityLog = (((
|
|
279
|
-
((
|
|
280
|
-
(((
|
|
281
|
-
((
|
|
280
|
+
var isActivityLog = (((_w = (_v = props.edit) === null || _v === void 0 ? void 0 : _v.activityLog) === null || _w === void 0 ? void 0 : _w.enableComments) &&
|
|
281
|
+
((_x = props.edit) === null || _x === void 0 ? void 0 : _x.activityLog.commentCollectionId)) ||
|
|
282
|
+
(((_z = (_y = props.edit) === null || _y === void 0 ? void 0 : _y.activityLog) === null || _z === void 0 ? void 0 : _z.enableLogs) &&
|
|
283
|
+
((_0 = props.edit) === null || _0 === void 0 ? void 0 : _0.activityLog.logsCollectionId));
|
|
282
284
|
//TODO : Code - Pass ...devSettings, search dbEndpoint:
|
|
283
285
|
var writeServerQuery = new writeQuery_1.WriteQuery({
|
|
284
|
-
dbModule: (
|
|
286
|
+
dbModule: (_1 = props.lib) === null || _1 === void 0 ? void 0 : _1.axios,
|
|
285
287
|
dbType: devSettings.server,
|
|
286
288
|
dbCollection: props.collectionId,
|
|
287
289
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -289,7 +291,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
289
291
|
dbUserToken: devSettings.dbUserToken,
|
|
290
292
|
});
|
|
291
293
|
var readServerQuery = new readQuery_1.ReadQuery({
|
|
292
|
-
dbModule: (
|
|
294
|
+
dbModule: (_2 = props.lib) === null || _2 === void 0 ? void 0 : _2.axios,
|
|
293
295
|
dbType: devSettings.server,
|
|
294
296
|
dbCollection: props.collectionId,
|
|
295
297
|
dbEndpoint: devSettings.dbEndpoint,
|
|
@@ -297,7 +299,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
297
299
|
dbUserToken: devSettings.dbUserToken,
|
|
298
300
|
});
|
|
299
301
|
var moreButtonPopUp = [
|
|
300
|
-
((
|
|
302
|
+
((_3 = props.edit) === null || _3 === void 0 ? void 0 : _3.allEditable) && !isFirebase
|
|
301
303
|
? {
|
|
302
304
|
text: "Import Excel",
|
|
303
305
|
onClick: function () {
|
|
@@ -306,7 +308,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
306
308
|
},
|
|
307
309
|
}
|
|
308
310
|
: null,
|
|
309
|
-
!((
|
|
311
|
+
!((_5 = (_4 = props.organise) === null || _4 === void 0 ? void 0 : _4.exportSettings) === null || _5 === void 0 ? void 0 : _5.hideExportCSV)
|
|
310
312
|
? {
|
|
311
313
|
text: "Export CSV",
|
|
312
314
|
onClick: function () {
|
|
@@ -316,7 +318,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
316
318
|
},
|
|
317
319
|
}
|
|
318
320
|
: null,
|
|
319
|
-
!((
|
|
321
|
+
!((_7 = (_6 = props.organise) === null || _6 === void 0 ? void 0 : _6.exportSettings) === null || _7 === void 0 ? void 0 : _7.hideExportExcel)
|
|
320
322
|
? {
|
|
321
323
|
text: "Export Excel",
|
|
322
324
|
onClick: function () {
|
|
@@ -326,7 +328,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
326
328
|
},
|
|
327
329
|
}
|
|
328
330
|
: null,
|
|
329
|
-
!((
|
|
331
|
+
!((_9 = (_8 = props.organise) === null || _8 === void 0 ? void 0 : _8.exportSettings) === null || _9 === void 0 ? void 0 : _9.hideExportPDF)
|
|
330
332
|
? {
|
|
331
333
|
text: "Export PDF",
|
|
332
334
|
onClick: function () {
|
|
@@ -336,7 +338,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
336
338
|
},
|
|
337
339
|
}
|
|
338
340
|
: null,
|
|
339
|
-
!((
|
|
341
|
+
!((_11 = (_10 = props.organise) === null || _10 === void 0 ? void 0 : _10.exportSettings) === null || _11 === void 0 ? void 0 : _11.hideExportQR)
|
|
340
342
|
? {
|
|
341
343
|
text: "Export QR",
|
|
342
344
|
onClick: function () {
|
|
@@ -346,7 +348,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
346
348
|
},
|
|
347
349
|
}
|
|
348
350
|
: null,
|
|
349
|
-
!((
|
|
351
|
+
!((_13 = (_12 = props.organise) === null || _12 === void 0 ? void 0 : _12.exportSettings) === null || _13 === void 0 ? void 0 : _13.hideExportPrint)
|
|
350
352
|
? {
|
|
351
353
|
text: "Print",
|
|
352
354
|
onClick: function () {
|
|
@@ -358,11 +360,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
358
360
|
}
|
|
359
361
|
: null,
|
|
360
362
|
].filter(Boolean);
|
|
361
|
-
if ((
|
|
363
|
+
if ((_14 = props.organise) === null || _14 === void 0 ? void 0 : _14.moreSettings)
|
|
362
364
|
moreButtonPopUp = moreButtonPopUp.concat(props.organise.moreSettings);
|
|
363
365
|
var renderImpSearchFilterConditions = function () {
|
|
364
366
|
var _a;
|
|
365
|
-
return (0, listModule_1.renderSearchFilterConditions)(
|
|
367
|
+
return (0, listModule_1.renderSearchFilterConditions)(structure, devSettings, {
|
|
366
368
|
filterSearchParams: filterSearchParams,
|
|
367
369
|
filterSelection: filterSelection,
|
|
368
370
|
filterReferenceDate: filterReferenceDate,
|
|
@@ -414,8 +416,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
414
416
|
setSelectedIds([]);
|
|
415
417
|
// INFO - To Get Reference/ListReference/ObjReference Default Value
|
|
416
418
|
if (props.type === "update" && props.id === "new") {
|
|
417
|
-
var clonedData = (0, updateModule_1.handleClonedDataAttribute)({},
|
|
418
|
-
(0, updateModule_1.handleRetrieveReferenceOptions)(clonedData,
|
|
419
|
+
var clonedData = (0, updateModule_1.handleClonedDataAttribute)({}, structure, props.devSettings.server);
|
|
420
|
+
(0, updateModule_1.handleRetrieveReferenceOptions)(clonedData, structure, dbModule, devSettings, setReferencesOptions, setReferencesDetails);
|
|
419
421
|
}
|
|
420
422
|
if (props.id !== "new" && props.id !== "") {
|
|
421
423
|
setModalVisible(true);
|
|
@@ -446,26 +448,29 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
446
448
|
(0, react_1.useEffect)(function () {
|
|
447
449
|
var handleInitTab = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
448
450
|
var currentTab, kanbanSettings, kanbanTitle_1, kanbanRefRQ_1, kanbanRefOption_1, kanbanRefLabel_1, kanbanRefQuery;
|
|
449
|
-
var _a, _b, _c, _d, _e;
|
|
450
|
-
return __generator(this, function (
|
|
451
|
-
switch (
|
|
451
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
452
|
+
return __generator(this, function (_k) {
|
|
453
|
+
switch (_k.label) {
|
|
452
454
|
case 0:
|
|
453
|
-
if (!(props.type === "list")) return [3 /*break*/,
|
|
455
|
+
if (!(props.type === "list")) return [3 /*break*/, 5];
|
|
454
456
|
currentTab = (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);
|
|
457
|
+
setStructure(props.model || []);
|
|
458
|
+
setAdditionalQuery(((_c = props.organise) === null || _c === void 0 ? void 0 : _c.additionalQuery) || []);
|
|
459
|
+
setGroupId(((_d = props.organise) === null || _d === void 0 ? void 0 : _d.groupBy) || "");
|
|
455
460
|
setSelectedTab(currentTab);
|
|
456
461
|
if (!((currentTab === null || currentTab === void 0 ? void 0 : currentTab.viewType) === "calendar")) return [3 /*break*/, 1];
|
|
457
462
|
setFilterSearch({});
|
|
458
463
|
setFilterSearchParams({});
|
|
459
|
-
(
|
|
460
|
-
return [3 /*break*/,
|
|
464
|
+
(_e = listRQueryHocRef.current) === null || _e === void 0 ? void 0 : _e.handleRefresh();
|
|
465
|
+
return [3 /*break*/, 5];
|
|
461
466
|
case 1:
|
|
462
467
|
if (!((currentTab === null || currentTab === void 0 ? void 0 : currentTab.viewType) === "kanban")) return [3 /*break*/, 4];
|
|
463
468
|
kanbanSettings = currentTab === null || currentTab === void 0 ? void 0 : currentTab.kanbanSettings;
|
|
464
|
-
kanbanTitle_1 = (
|
|
469
|
+
kanbanTitle_1 = (_f = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _f !== void 0 ? _f : "";
|
|
465
470
|
kanbanRefRQ_1 = null;
|
|
466
471
|
kanbanRefOption_1 = [];
|
|
467
472
|
kanbanRefLabel_1 = "";
|
|
468
|
-
|
|
473
|
+
structure.map(function (eachModel) {
|
|
469
474
|
var _a, _b;
|
|
470
475
|
if (kanbanTitle_1 === eachModel.id) {
|
|
471
476
|
if (eachModel.type === "reference") {
|
|
@@ -486,10 +491,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
486
491
|
return [4 /*yield*/, kanbanRefRQ_1.call({
|
|
487
492
|
type: "list",
|
|
488
493
|
limit: limit,
|
|
489
|
-
query: ((
|
|
494
|
+
query: ((_g = currentTab === null || currentTab === void 0 ? void 0 : currentTab.kanbanSettings) === null || _g === void 0 ? void 0 : _g.query) || undefined,
|
|
490
495
|
})];
|
|
491
496
|
case 2:
|
|
492
|
-
kanbanRefQuery =
|
|
497
|
+
kanbanRefQuery = _k.sent();
|
|
493
498
|
if (kanbanRefQuery.data) {
|
|
494
499
|
kanbanRefQuery.data.map(function (eachData) {
|
|
495
500
|
kanbanRefOption_1.push({
|
|
@@ -499,21 +504,32 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
499
504
|
return null;
|
|
500
505
|
});
|
|
501
506
|
}
|
|
502
|
-
|
|
507
|
+
_k.label = 3;
|
|
503
508
|
case 3:
|
|
504
509
|
setKanbanOptions(kanbanRefOption_1);
|
|
505
|
-
|
|
506
|
-
case 4:
|
|
510
|
+
return [3 /*break*/, 5];
|
|
511
|
+
case 4:
|
|
512
|
+
if ((currentTab === null || currentTab === void 0 ? void 0 : currentTab.viewType) === "report") {
|
|
513
|
+
if (currentTab.structure)
|
|
514
|
+
setStructure((_h = currentTab.structure) !== null && _h !== void 0 ? _h : []);
|
|
515
|
+
if (currentTab.additionalQuery)
|
|
516
|
+
setAdditionalQuery((_j = currentTab.additionalQuery) !== null && _j !== void 0 ? _j : []);
|
|
517
|
+
if (currentTab.groupBy)
|
|
518
|
+
setGroupId(currentTab.groupBy);
|
|
519
|
+
}
|
|
520
|
+
_k.label = 5;
|
|
521
|
+
case 5: return [2 /*return*/];
|
|
507
522
|
}
|
|
508
523
|
});
|
|
509
524
|
}); };
|
|
510
525
|
handleInitTab();
|
|
511
526
|
}, [
|
|
527
|
+
props.model,
|
|
512
528
|
props.collectionId,
|
|
513
529
|
props.id,
|
|
514
530
|
props.localURLEndpoint,
|
|
515
|
-
(
|
|
516
|
-
(
|
|
531
|
+
(_15 = props.organise) === null || _15 === void 0 ? void 0 : _15.extendedTabs,
|
|
532
|
+
(_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.viewId,
|
|
517
533
|
props.type,
|
|
518
534
|
]);
|
|
519
535
|
(0, react_1.useEffect)(function () {
|
|
@@ -521,7 +537,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
521
537
|
if ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.exportSettings) === null || _b === void 0 ? void 0 : _b.sumColumnId) {
|
|
522
538
|
setExportSumAttributeIds((_e = (_d = (_c = props.organise) === null || _c === void 0 ? void 0 : _c.exportSettings) === null || _d === void 0 ? void 0 : _d.sumColumnId) !== null && _e !== void 0 ? _e : []);
|
|
523
539
|
}
|
|
524
|
-
}, (
|
|
540
|
+
}, (_18 = (_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.exportSettings) === null || _18 === void 0 ? void 0 : _18.sumColumnId);
|
|
525
541
|
(0, react_1.useEffect)(function () {
|
|
526
542
|
if (props.devSettings.schemaReference)
|
|
527
543
|
setReferenceSchema(props.devSettings.schemaReference);
|
|
@@ -781,7 +797,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
781
797
|
});
|
|
782
798
|
prettierDataList = dummyPrettierDataList_1;
|
|
783
799
|
return [3 /*break*/, 4];
|
|
784
|
-
case 2: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_c = props.lib) === null || _c === void 0 ? void 0 : _c.axios,
|
|
800
|
+
case 2: return [4 /*yield*/, (0, listModule_1.handleListDataBasedOnModel)(responseData === null || responseData === void 0 ? void 0 : responseData.data, props.devSettings, (_c = props.lib) === null || _c === void 0 ? void 0 : _c.axios, structure, (_d = props.organise) === null || _d === void 0 ? void 0 : _d.handleNavigate, ((_e = props.organise) === null || _e === void 0 ? void 0 : _e.viewId) === "general", setActivityModal, setActivityId, isActivityLog ? (_f = props.edit) === null || _f === void 0 ? void 0 : _f.activityLog : undefined, (_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareListActionBtns)];
|
|
785
801
|
case 3:
|
|
786
802
|
prettierDataList = _m.sent();
|
|
787
803
|
_m.label = 4;
|
|
@@ -1051,7 +1067,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1051
1067
|
//SECTION: Handle Object
|
|
1052
1068
|
//=====================================================================================
|
|
1053
1069
|
var handleRemoveObjectListData = function () {
|
|
1054
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
1070
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server);
|
|
1055
1071
|
if (selectedObjectId) {
|
|
1056
1072
|
var index = clonedSelectedData[selectedObjectStructureId].findIndex(function (eachData) { return eachData.id === selectedObjectId; });
|
|
1057
1073
|
if (index !== -1) {
|
|
@@ -1064,8 +1080,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1064
1080
|
};
|
|
1065
1081
|
var handleSubmitObjectDataType = function () {
|
|
1066
1082
|
var _a, _b;
|
|
1067
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
1068
|
-
var filterObjectModel =
|
|
1083
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, showId);
|
|
1084
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
1069
1085
|
return eachModel.id === selectedObjectStructureId;
|
|
1070
1086
|
});
|
|
1071
1087
|
var clonedSelectedObjectData = (0, updateModule_1.handleClonedDataAttribute)(selectedObjectData, (_a = filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.objectData) !== null && _a !== void 0 ? _a : [], props.devSettings.server, true, true);
|
|
@@ -1108,7 +1124,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1108
1124
|
//TODO: Bug - try to solve clicking List Object too fast
|
|
1109
1125
|
var handleSelectListObjectData = function (id, structureId, objectIndex) {
|
|
1110
1126
|
var _a;
|
|
1111
|
-
var filterObjectModel =
|
|
1127
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
1112
1128
|
return eachModel.id === structureId;
|
|
1113
1129
|
});
|
|
1114
1130
|
if ((filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.type) === "listObject") {
|
|
@@ -1195,12 +1211,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1195
1211
|
return __generator(this, function (_a) {
|
|
1196
1212
|
switch (_a.label) {
|
|
1197
1213
|
case 0:
|
|
1198
|
-
clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(data !== null && data !== void 0 ? data : selectedData,
|
|
1199
|
-
return [4 /*yield*/, handleParseImageField(id, clonedSelectedData,
|
|
1214
|
+
clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(data !== null && data !== void 0 ? data : selectedData, structure, props.devSettings.server, true, showId);
|
|
1215
|
+
return [4 /*yield*/, handleParseImageField(id, clonedSelectedData, structure)];
|
|
1200
1216
|
case 1:
|
|
1201
1217
|
//INFO: Parse & Upload Data "Image & File attributes"
|
|
1202
1218
|
clonedSelectedData = _a.sent();
|
|
1203
|
-
objectAttribute =
|
|
1219
|
+
objectAttribute = structure.filter(function (eachAttribute) {
|
|
1204
1220
|
return eachAttribute.type === "object";
|
|
1205
1221
|
});
|
|
1206
1222
|
return [4 /*yield*/, Promise.all(objectAttribute.map(function (eachObject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1216,7 +1232,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1216
1232
|
}); }))];
|
|
1217
1233
|
case 2:
|
|
1218
1234
|
_a.sent();
|
|
1219
|
-
listObjectAttribute =
|
|
1235
|
+
listObjectAttribute = structure.filter(function (eachAttribute) {
|
|
1220
1236
|
return eachAttribute.type === "listObject";
|
|
1221
1237
|
});
|
|
1222
1238
|
return [4 /*yield*/, Promise.all(listObjectAttribute.map(function (eachObject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -2024,7 +2040,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2024
2040
|
_a.trys.push([0, 7, , 8]);
|
|
2025
2041
|
setLoading(true);
|
|
2026
2042
|
setModalVisible(true);
|
|
2027
|
-
model_1 =
|
|
2043
|
+
model_1 = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
|
|
2028
2044
|
columnId_1 = batchUpdateData.columnId;
|
|
2029
2045
|
dataToSubmit_1 = batchUpdateData.columnData;
|
|
2030
2046
|
isFile = (model_1 === null || model_1 === void 0 ? void 0 : model_1.type) === "image" || (model_1 === null || model_1 === void 0 ? void 0 : model_1.type) === "file";
|
|
@@ -2245,7 +2261,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2245
2261
|
createSelectedData_1 = _j.sent();
|
|
2246
2262
|
_j.label = 3;
|
|
2247
2263
|
case 3:
|
|
2248
|
-
uniqueDataStructure =
|
|
2264
|
+
uniqueDataStructure = structure.filter(function (eachStructure) {
|
|
2249
2265
|
return eachStructure.unique;
|
|
2250
2266
|
});
|
|
2251
2267
|
uniqueColumnId = uniqueDataStructure.length > 0 ? uniqueDataStructure[0].id : undefined;
|
|
@@ -2268,7 +2284,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2268
2284
|
case 5:
|
|
2269
2285
|
offlineDataResp = _j.sent();
|
|
2270
2286
|
offlineData = (_e = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _e !== void 0 ? _e : [];
|
|
2271
|
-
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData,
|
|
2287
|
+
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData, structure);
|
|
2272
2288
|
offlineData.push(tempData);
|
|
2273
2289
|
return [4 /*yield*/, indexedDb_1.indexedDb.putValue("local", {
|
|
2274
2290
|
data: offlineData,
|
|
@@ -2300,7 +2316,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2300
2316
|
return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
|
|
2301
2317
|
case 14:
|
|
2302
2318
|
offlineDataResp = _j.sent();
|
|
2303
|
-
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData,
|
|
2319
|
+
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData, structure);
|
|
2304
2320
|
tempData[serverId] = selectedId_2;
|
|
2305
2321
|
selectedIndex_3 = -1;
|
|
2306
2322
|
offlineData = (_f = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _f !== void 0 ? _f : [];
|
|
@@ -2509,9 +2525,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2509
2525
|
}); };
|
|
2510
2526
|
var handleRetrieveSelectedData = function (responseData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2511
2527
|
var clonedReferencesOptions_1, dummyRespData, dummyReferenceModelSchema, newRespData, _a;
|
|
2512
|
-
var _b, _c, _d, _e, _f, _g
|
|
2513
|
-
return __generator(this, function (
|
|
2514
|
-
switch (
|
|
2528
|
+
var _b, _c, _d, _e, _f, _g;
|
|
2529
|
+
return __generator(this, function (_h) {
|
|
2530
|
+
switch (_h.label) {
|
|
2515
2531
|
case 0:
|
|
2516
2532
|
if (!responseData.data) return [3 /*break*/, 6];
|
|
2517
2533
|
if (!((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareOffline)) return [3 /*break*/, 2];
|
|
@@ -2519,7 +2535,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2519
2535
|
if ((_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareReadHandleData)
|
|
2520
2536
|
props.bareSettings.bareReadHandleData(responseData.data);
|
|
2521
2537
|
clonedReferencesOptions_1 = JSON.parse(JSON.stringify(referencesOptions));
|
|
2522
|
-
return [4 /*yield*/, Promise.all(
|
|
2538
|
+
return [4 /*yield*/, Promise.all(structure.map(function (eachModel) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2523
2539
|
var isObject, offlineDataResp, offlineData, prefix_1;
|
|
2524
2540
|
var _a, _b;
|
|
2525
2541
|
return __generator(this, function (_c) {
|
|
@@ -2564,30 +2580,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2564
2580
|
});
|
|
2565
2581
|
}); }))];
|
|
2566
2582
|
case 1:
|
|
2567
|
-
|
|
2583
|
+
_h.sent();
|
|
2568
2584
|
setReferencesOptions(clonedReferencesOptions_1);
|
|
2569
2585
|
return [3 /*break*/, 6];
|
|
2570
2586
|
case 2:
|
|
2571
2587
|
dummyRespData = JSON.parse(JSON.stringify(responseData.data), utils_1.jsonReviver);
|
|
2572
2588
|
dummyReferenceModelSchema = JSON.parse(JSON.stringify(referenceModelSchema));
|
|
2573
2589
|
if (!(props.type === "read")) return [3 /*break*/, 4];
|
|
2574
|
-
return [4 /*yield*/, (0, readModule_1.handleRetrieveDeepModel)(dummyRespData,
|
|
2575
|
-
assetParentId: (
|
|
2576
|
-
bucketName: (
|
|
2577
|
-
}, dummyReferenceModelSchema, setReferenceSchema, (
|
|
2590
|
+
return [4 /*yield*/, (0, readModule_1.handleRetrieveDeepModel)(dummyRespData, structure !== null && structure !== void 0 ? structure : [], dbModule, devSettings, {
|
|
2591
|
+
assetParentId: (_d = props.id) !== null && _d !== void 0 ? _d : "",
|
|
2592
|
+
bucketName: (_e = devSettings.bucketName) !== null && _e !== void 0 ? _e : "",
|
|
2593
|
+
}, dummyReferenceModelSchema, setReferenceSchema, (_f = props.organise) === null || _f === void 0 ? void 0 : _f.handleCustomDownloadFile)];
|
|
2578
2594
|
case 3:
|
|
2579
|
-
_a =
|
|
2595
|
+
_a = _h.sent();
|
|
2580
2596
|
return [3 /*break*/, 5];
|
|
2581
2597
|
case 4:
|
|
2582
2598
|
_a = dummyRespData;
|
|
2583
|
-
|
|
2599
|
+
_h.label = 5;
|
|
2584
2600
|
case 5:
|
|
2585
2601
|
newRespData = _a;
|
|
2586
2602
|
setSelectedData(newRespData);
|
|
2587
|
-
if ((
|
|
2603
|
+
if ((_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareReadHandleData)
|
|
2588
2604
|
props.bareSettings.bareReadHandleData(newRespData);
|
|
2589
|
-
(0, updateModule_1.handleRetrieveReferenceOptions)(newRespData,
|
|
2590
|
-
|
|
2605
|
+
(0, updateModule_1.handleRetrieveReferenceOptions)(newRespData, structure, dbModule, devSettings, setReferencesOptions, setReferencesDetails);
|
|
2606
|
+
_h.label = 6;
|
|
2591
2607
|
case 6:
|
|
2592
2608
|
setModalVisible(false);
|
|
2593
2609
|
setLoading(false);
|
|
@@ -2598,7 +2614,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2598
2614
|
var handleOnChangeData = function () {
|
|
2599
2615
|
var _a;
|
|
2600
2616
|
if (modalVisible && selectedObjectStructureId) {
|
|
2601
|
-
var filterObjectModel =
|
|
2617
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
2602
2618
|
return eachModel.id === selectedObjectStructureId;
|
|
2603
2619
|
});
|
|
2604
2620
|
return {
|
|
@@ -2609,13 +2625,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2609
2625
|
else if (batchUpdateModal && batchUpdateData.columnId) {
|
|
2610
2626
|
return {
|
|
2611
2627
|
data: batchUpdateData.columnData,
|
|
2612
|
-
model:
|
|
2628
|
+
model: structure,
|
|
2613
2629
|
};
|
|
2614
2630
|
}
|
|
2615
2631
|
else {
|
|
2616
2632
|
return {
|
|
2617
2633
|
data: selectedData,
|
|
2618
|
-
model:
|
|
2634
|
+
model: structure,
|
|
2619
2635
|
};
|
|
2620
2636
|
}
|
|
2621
2637
|
};
|
|
@@ -2625,7 +2641,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2625
2641
|
setSelectedObjectData(data);
|
|
2626
2642
|
}
|
|
2627
2643
|
else if (batchUpdateModal && batchUpdateData.columnId) {
|
|
2628
|
-
var selectedModel =
|
|
2644
|
+
var selectedModel = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
|
|
2629
2645
|
if (selectedModel) {
|
|
2630
2646
|
//INFO: [UPDATE] Update data via batch modal
|
|
2631
2647
|
var clonedData = JSON.parse(JSON.stringify(data));
|
|
@@ -2721,7 +2737,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2721
2737
|
var clonedData = (0, updateModule_1.handleClonedDataAttribute)(data, model, props.devSettings.server, false, showId ? true : false);
|
|
2722
2738
|
if ((Array.isArray(value) && value.includes("creation")) ||
|
|
2723
2739
|
value === "creation") {
|
|
2724
|
-
var currentSchema =
|
|
2740
|
+
var currentSchema = structure.filter(function (dsValue) {
|
|
2725
2741
|
return dsValue.id === id;
|
|
2726
2742
|
});
|
|
2727
2743
|
if (currentSchema.length > 0)
|
|
@@ -2764,7 +2780,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2764
2780
|
var eachKey = eachRow[0];
|
|
2765
2781
|
if (!eachKey)
|
|
2766
2782
|
return null;
|
|
2767
|
-
|
|
2783
|
+
structure.map(function (eachModel) {
|
|
2768
2784
|
if (eachKey.toLowerCase().includes(eachModel.id.toLowerCase()) &&
|
|
2769
2785
|
eachModel.id !== "_id" &&
|
|
2770
2786
|
eachModel.id !== "id" &&
|
|
@@ -2814,7 +2830,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2814
2830
|
csvList_1 = [];
|
|
2815
2831
|
_loop_2 = function (eachKey, eachValue) {
|
|
2816
2832
|
if (eachKey && eachValue && typeof eachValue === "string") {
|
|
2817
|
-
var selectedModel =
|
|
2833
|
+
var selectedModel = structure.find(function (eachModel) {
|
|
2818
2834
|
return eachModel.id === eachValue;
|
|
2819
2835
|
});
|
|
2820
2836
|
if ((selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "object" ||
|
|
@@ -2875,7 +2891,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2875
2891
|
}
|
|
2876
2892
|
valid_1 = true;
|
|
2877
2893
|
errorValue_1 = "";
|
|
2878
|
-
return [4 /*yield*/, Promise.all(
|
|
2894
|
+
return [4 /*yield*/, Promise.all(structure.map(function (eachEachModel) {
|
|
2879
2895
|
if (eachEachModel.id === "_id" || eachEachModel.id === "id") {
|
|
2880
2896
|
return "";
|
|
2881
2897
|
}
|
|
@@ -2959,11 +2975,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2959
2975
|
}); };
|
|
2960
2976
|
var handleExportCSVData = function (downloadLinkOnly, printOnly) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2961
2977
|
var exportQueryList, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg, err_20;
|
|
2962
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
2963
|
-
return __generator(this, function (
|
|
2964
|
-
switch (
|
|
2978
|
+
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;
|
|
2979
|
+
return __generator(this, function (_1) {
|
|
2980
|
+
switch (_1.label) {
|
|
2965
2981
|
case 0:
|
|
2966
|
-
|
|
2982
|
+
_1.trys.push([0, 5, , 6]);
|
|
2967
2983
|
setLoading(true);
|
|
2968
2984
|
exportQueryList = JSON.parse(JSON.stringify(queryList));
|
|
2969
2985
|
if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareCSVExportSettings) {
|
|
@@ -2996,21 +3012,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2996
3012
|
excludeReferenceId: (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.exportSettings) === null || _e === void 0 ? void 0 : _e.excludeReferenceId,
|
|
2997
3013
|
excludeSecondaryLabel: (_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.exportSettings) === null || _g === void 0 ? void 0 : _g.excludeSecondaryLabel,
|
|
2998
3014
|
csvHeaderUseName: (_j = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.exportSettings) === null || _j === void 0 ? void 0 : _j.csvHeaderUseName,
|
|
2999
|
-
|
|
3000
|
-
|
|
3001
|
-
|
|
3015
|
+
dateFormatString: (_l = (_k = props.organise) === null || _k === void 0 ? void 0 : _k.exportSettings) === null || _l === void 0 ? void 0 : _l.dateFormatString,
|
|
3016
|
+
excludeDataId: (_o = (_m = props.organise) === null || _m === void 0 ? void 0 : _m.exportSettings) === null || _o === void 0 ? void 0 : _o.excludeDataId,
|
|
3017
|
+
columnIds: (_q = (_p = props.organise) === null || _p === void 0 ? void 0 : _p.exportSettings) === null || _q === void 0 ? void 0 : _q.columnIds,
|
|
3018
|
+
sort: (_s = (_r = props.organise) === null || _r === void 0 ? void 0 : _r.exportSettings) === null || _s === void 0 ? void 0 : _s.sort,
|
|
3002
3019
|
groupBy: groupId,
|
|
3003
3020
|
sumAttributeId: exportSumAttributeIds,
|
|
3004
3021
|
};
|
|
3005
|
-
return [4 /*yield*/, ((
|
|
3022
|
+
return [4 /*yield*/, ((_t = props.lib) === null || _t === void 0 ? void 0 : _t.axios({
|
|
3006
3023
|
url: apiEndpoint,
|
|
3007
3024
|
method: "post",
|
|
3008
3025
|
data: { data: reqData },
|
|
3009
3026
|
}))];
|
|
3010
3027
|
case 1:
|
|
3011
|
-
res =
|
|
3012
|
-
if (!(downloadLinkOnly && ((
|
|
3013
|
-
dataList = (
|
|
3028
|
+
res = _1.sent();
|
|
3029
|
+
if (!(downloadLinkOnly && ((_u = res === null || res === void 0 ? void 0 : res.data) === null || _u === void 0 ? void 0 : _u.dataList))) return [3 /*break*/, 4];
|
|
3030
|
+
dataList = (_v = res === null || res === void 0 ? void 0 : res.data) === null || _v === void 0 ? void 0 : _v.dataList;
|
|
3014
3031
|
if (!(dataList && typeof dataList === "object")) return [3 /*break*/, 4];
|
|
3015
3032
|
csvDownloadLink = Object.values(dataList)[0];
|
|
3016
3033
|
if (!(exportType === "csv" ||
|
|
@@ -3022,10 +3039,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3022
3039
|
if (!(exportType === "pdf" ||
|
|
3023
3040
|
printOnly ||
|
|
3024
3041
|
exportType === "print")) return [3 /*break*/, 4];
|
|
3025
|
-
return [4 /*yield*/, (0, listModule_1.handleExportPDF)(csvDownloadLink, exportPDFTitle, printOnly, (
|
|
3042
|
+
return [4 /*yield*/, (0, listModule_1.handleExportPDF)(csvDownloadLink, exportPDFTitle, printOnly, (_y = (_x = (_w = props.organise) === null || _w === void 0 ? void 0 : _w.exportSettings) === null || _x === void 0 ? void 0 : _x.generateBy) !== null && _y !== void 0 ? _y : "Admin")];
|
|
3026
3043
|
case 3:
|
|
3027
|
-
|
|
3028
|
-
|
|
3044
|
+
_1.sent();
|
|
3045
|
+
_1.label = 4;
|
|
3029
3046
|
case 4:
|
|
3030
3047
|
notificaitonMsg = "A download link will be sent to your email. This may take a while if the data is huge, contact our team if you do not receive any email after 10 minutes (Check your Junk Email too).";
|
|
3031
3048
|
if (downloadLinkOnly)
|
|
@@ -3039,10 +3056,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3039
3056
|
}
|
|
3040
3057
|
setLoading(false);
|
|
3041
3058
|
handlePopUpModal(false);
|
|
3042
|
-
setExportCSVEmail((
|
|
3059
|
+
setExportCSVEmail((_0 = (_z = props.devSettings.currentUser) === null || _z === void 0 ? void 0 : _z.userEmail) !== null && _0 !== void 0 ? _0 : "");
|
|
3043
3060
|
return [3 /*break*/, 6];
|
|
3044
3061
|
case 5:
|
|
3045
|
-
err_20 =
|
|
3062
|
+
err_20 = _1.sent();
|
|
3046
3063
|
setNotification({
|
|
3047
3064
|
type: true,
|
|
3048
3065
|
title: "Export Failed",
|
|
@@ -3179,7 +3196,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3179
3196
|
return (react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (_a = props.lib) === null || _a === void 0 ? void 0 : _a.axios }, label: "Please insert a csv file", fileDescription: "CSV file thats doesn't exceeds 30MB and row not more than 100 data", accept: ".csv", hidePreview: true, onChange: handleOnChangeCSV }));
|
|
3180
3197
|
case 1:
|
|
3181
3198
|
var filterOptions_1 = [];
|
|
3182
|
-
|
|
3199
|
+
structure.map(function (eachData) {
|
|
3183
3200
|
var eachDataJSON = JSON.parse(JSON.stringify(eachData));
|
|
3184
3201
|
if (eachData.id !== "_id" && eachData.id !== "id") {
|
|
3185
3202
|
filterOptions_1.push({
|
|
@@ -3194,7 +3211,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3194
3211
|
if (!eachKey)
|
|
3195
3212
|
return null;
|
|
3196
3213
|
var clonedListValue = JSON.parse(JSON.stringify(listCSVMapAttribute));
|
|
3197
|
-
var selectedObjectModel =
|
|
3214
|
+
var selectedObjectModel = structure.find(function (eachModel) {
|
|
3198
3215
|
return ((eachModel.id === clonedListValue[index] &&
|
|
3199
3216
|
eachModel.type === "listObject") ||
|
|
3200
3217
|
(eachModel.id === clonedListValue[index] &&
|
|
@@ -3272,7 +3289,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3272
3289
|
var renderTableHeader = function () {
|
|
3273
3290
|
var _a;
|
|
3274
3291
|
var tableHeader = [];
|
|
3275
|
-
|
|
3292
|
+
structure.map(function (eachAttribute) {
|
|
3276
3293
|
if (eachAttribute.id === "baseUpdatedAt" ||
|
|
3277
3294
|
eachAttribute.id === "baseDraft" ||
|
|
3278
3295
|
eachAttribute.type === "listObject" ||
|
|
@@ -3299,7 +3316,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3299
3316
|
return pageIndex === 0 ? undefined : pageIndex * limit;
|
|
3300
3317
|
}
|
|
3301
3318
|
else {
|
|
3302
|
-
var selectedModel =
|
|
3319
|
+
var selectedModel = structure.find(function (eachModel) { var _a, _b; return eachModel.id === ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.sort) === null || _b === void 0 ? void 0 : _b.sortId); });
|
|
3303
3320
|
var cursor_1 = lastCursor;
|
|
3304
3321
|
switch (selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) {
|
|
3305
3322
|
case "date":
|
|
@@ -3361,7 +3378,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3361
3378
|
var _a;
|
|
3362
3379
|
event.preventDefault();
|
|
3363
3380
|
event.stopPropagation();
|
|
3364
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
3381
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server);
|
|
3365
3382
|
(_a = clonedSelectedData[fieldsId]) === null || _a === void 0 ? void 0 : _a.splice(index, 1);
|
|
3366
3383
|
setSelectedData(clonedSelectedData);
|
|
3367
3384
|
} })) }));
|
|
@@ -3371,8 +3388,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3371
3388
|
};
|
|
3372
3389
|
var renderListAddress = function (type) {
|
|
3373
3390
|
var listElement = [];
|
|
3374
|
-
var isListAddress =
|
|
3375
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
3391
|
+
var isListAddress = structure.filter(function (eachAttribute) { return eachAttribute.type === "listAddress"; });
|
|
3392
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, showId ? true : false);
|
|
3376
3393
|
isListAddress.map(function (eachListAdressFields) {
|
|
3377
3394
|
var header = [
|
|
3378
3395
|
{
|
|
@@ -3427,10 +3444,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3427
3444
|
};
|
|
3428
3445
|
var renderListObject = function (type) {
|
|
3429
3446
|
var listElement = [];
|
|
3430
|
-
var isListObject =
|
|
3447
|
+
var isListObject = structure.filter(function (eachAttribute) { return eachAttribute.type === "listObject"; });
|
|
3431
3448
|
var list = {};
|
|
3432
3449
|
var listObjTableData = {};
|
|
3433
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
3450
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, showId ? true : false);
|
|
3434
3451
|
isListObject.map(function (eachListObject) {
|
|
3435
3452
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3436
3453
|
if (props.onComplete &&
|
|
@@ -3687,8 +3704,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3687
3704
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
3688
3705
|
};
|
|
3689
3706
|
var renderSearchContent = function (addQuery) {
|
|
3690
|
-
var _a, _b
|
|
3691
|
-
var filterComponent = (0, listModule_1.renderSearchFilterComponents)(
|
|
3707
|
+
var _a, _b;
|
|
3708
|
+
var filterComponent = (0, listModule_1.renderSearchFilterComponents)(structure, devSettings, limit, dbModule, {
|
|
3692
3709
|
filterSearch: filterSearch,
|
|
3693
3710
|
filterSelection: filterSelection,
|
|
3694
3711
|
filterReferenceDate: filterReferenceDate,
|
|
@@ -3704,7 +3721,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3704
3721
|
handleClearDataByFilter: handleClearDataByFilter,
|
|
3705
3722
|
handleRangeFilterOnChange: handleRangeFilterOnChange,
|
|
3706
3723
|
handleFilterDataSelected: handleFilterDataSelected,
|
|
3707
|
-
}, __assign(__assign({}, props.organise), { additionalQuery: addQuery !== null && addQuery !== void 0 ? addQuery :
|
|
3724
|
+
}, __assign(__assign({}, props.organise), { additionalQuery: addQuery !== null && addQuery !== void 0 ? addQuery : additionalQuery, hideSearch: addQuery ? true : (_a = props.organise) === null || _a === void 0 ? void 0 : _a.hideSearch }), selectedTab, (_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareListFilterAddComponent);
|
|
3708
3725
|
return filterComponent;
|
|
3709
3726
|
};
|
|
3710
3727
|
var renderAuthContent = function () {
|
|
@@ -3837,7 +3854,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3837
3854
|
});
|
|
3838
3855
|
var filterModel_1 = [];
|
|
3839
3856
|
var disabledOnEnter_1 = (_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.disabledOnEnter) !== null && _r !== void 0 ? _r : false;
|
|
3840
|
-
|
|
3857
|
+
structure.map(function (eachModel) {
|
|
3841
3858
|
var _a;
|
|
3842
3859
|
var present = false;
|
|
3843
3860
|
if (eachModel.type === "markdown" ||
|
|
@@ -3860,7 +3877,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3860
3877
|
return null;
|
|
3861
3878
|
});
|
|
3862
3879
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
3863
|
-
props.id && props.id !== "new" &&
|
|
3880
|
+
props.id && props.id !== "new" && structure.length > 1 && (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: readQueryHocRef, database: {
|
|
3864
3881
|
dbModule: dbModule,
|
|
3865
3882
|
dbType: devSettings.server,
|
|
3866
3883
|
dbCollection: (_t = (_s = props === null || props === void 0 ? void 0 : props.space) === null || _s === void 0 ? void 0 : _s.pipelineDefaultSpaceId) !== null && _t !== void 0 ? _t : props.collectionId,
|
|
@@ -3949,8 +3966,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3949
3966
|
((_11 = props.organise) === null || _11 === void 0 ? void 0 : _11.filterComponentNewRow) && (react_1.default.createElement("div", { className: "flex flex-wrap items-center justify-center my-6 gap-3" },
|
|
3950
3967
|
((_12 = props === null || props === void 0 ? void 0 : props.organise) === null || _12 === void 0 ? void 0 : _12.showGroupByFeature) && (react_1.default.createElement(select_1.Select, { label: "Group", options: (_18 = (_15 = (_14 = (_13 = props === null || props === void 0 ? void 0 : props.organise) === null || _13 === void 0 ? void 0 : _13.renderGroupByOptions) === null || _14 === void 0 ? void 0 : _14.call(_13)) !== null && _15 !== void 0 ? _15 : (_17 = (_16 = props === null || props === void 0 ? void 0 : props.organise) === null || _16 === void 0 ? void 0 : _16.renderReferenceLabelOptions) === null || _17 === void 0 ? void 0 : _17.call(_16, props.collectionId, true)) !== null && _18 !== void 0 ? _18 : [], value: groupId !== null && groupId !== void 0 ? groupId : "", onChange: function (value) { return setGroupId(value); } })),
|
|
3951
3968
|
filterComponent.map(function (item, index) {
|
|
3952
|
-
var
|
|
3953
|
-
var filter = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) === null || _b === void 0 ? void 0 : _b[index];
|
|
3969
|
+
var filter = additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery[index];
|
|
3954
3970
|
return (react_1.default.createElement("div", { key: index, className: (filter === null || filter === void 0 ? void 0 : filter.type) === "range"
|
|
3955
3971
|
? "flex-grow sm:basis-full md:basis-1/2 lg:basis-1/3"
|
|
3956
3972
|
: "flex-grow sm:flex-shrink-0 sm:basis-1/2 md:basis-1/4 lg:basis-1/6" }, item));
|
|
@@ -4014,7 +4030,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4014
4030
|
var renderGridAndListData = function (imageTag, type, kanbanGroupId) {
|
|
4015
4031
|
var gridData = [];
|
|
4016
4032
|
var titleKey = "";
|
|
4017
|
-
var titleModel =
|
|
4033
|
+
var titleModel = structure.find(function (eachModel) {
|
|
4018
4034
|
return !eachModel.hide && eachModel.id !== "_id" && eachModel.id !== "id";
|
|
4019
4035
|
});
|
|
4020
4036
|
if (titleModel)
|
|
@@ -4032,7 +4048,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4032
4048
|
var listDescArray = [];
|
|
4033
4049
|
Object.entries(eachData).forEach(function (value) {
|
|
4034
4050
|
var eachKey = value[0], eachValue = value[1];
|
|
4035
|
-
var selectedModel =
|
|
4051
|
+
var selectedModel = structure.find(function (eachModel) { return eachModel.id === eachKey; });
|
|
4036
4052
|
var modelInStructure;
|
|
4037
4053
|
var structurePresent = false;
|
|
4038
4054
|
if (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.structure) {
|
|
@@ -4150,7 +4166,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4150
4166
|
if (((_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) &&
|
|
4151
4167
|
((_b = props.organise.extendedTabs) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
4152
4168
|
(_c = props.organise) === null || _c === void 0 ? void 0 : _c.extendedTabs.map(function (eachTab) {
|
|
4153
|
-
var _a, _b, _c, _d;
|
|
4169
|
+
var _a, _b, _c, _d, _e;
|
|
4154
4170
|
var hrefPoint = "".concat(props.localURLEndpoint, "?type=").concat(props.type, "&collection=").concat(props.collectionId);
|
|
4155
4171
|
if (props.id)
|
|
4156
4172
|
hrefPoint += "&data=".concat(props.id);
|
|
@@ -4172,11 +4188,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4172
4188
|
else
|
|
4173
4189
|
tabData["viewImage"] = eachTab.viewImage;
|
|
4174
4190
|
if (eachTab.type === props.type) {
|
|
4175
|
-
tabs.push(__assign(__assign({}, tabData),
|
|
4191
|
+
tabs.push(__assign(__assign({}, tabData), (!((_e = props.edit) === null || _e === void 0 ? void 0 : _e.disabledTabsDeleteBtn) && {
|
|
4192
|
+
del: (react_1.default.createElement(outline_1.XMarkIcon, { className: "h-4 w-4 ml-2 text-red-600 hover:text-red-400", onClick: function (e) {
|
|
4176
4193
|
e.stopPropagation();
|
|
4177
4194
|
e.preventDefault();
|
|
4178
4195
|
handleDeleteTab(tabData.id);
|
|
4179
|
-
} }))
|
|
4196
|
+
} })),
|
|
4197
|
+
})));
|
|
4180
4198
|
}
|
|
4181
4199
|
return null;
|
|
4182
4200
|
});
|
|
@@ -4192,10 +4210,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4192
4210
|
};
|
|
4193
4211
|
var renderAddMathColumn = function (id, onClose) {
|
|
4194
4212
|
var _a, _b, _c;
|
|
4195
|
-
return (react_1.default.createElement(settingsModal_1.ExpressionModal, { selectedId: id, model:
|
|
4213
|
+
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 }));
|
|
4196
4214
|
};
|
|
4197
4215
|
var renderGroupTable = function (multipleSelect) {
|
|
4198
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
4216
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
4199
4217
|
if (groupId) {
|
|
4200
4218
|
var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
|
|
4201
4219
|
var key = (eachData === null || eachData === void 0 ? void 0 : eachData[groupId]) && (eachData === null || eachData === void 0 ? void 0 : eachData[groupId]) !== " - "
|
|
@@ -4210,7 +4228,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4210
4228
|
}
|
|
4211
4229
|
else {
|
|
4212
4230
|
return Object.entries(groupedSpaceTableData).map(function (_a) {
|
|
4213
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y
|
|
4231
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
4214
4232
|
var eachKey = _a[0], eachValue = _a[1];
|
|
4215
4233
|
var dataList = eachValue;
|
|
4216
4234
|
var ids = (dataList === null || dataList === void 0 ? void 0 : dataList.map(function (eachData) { return eachData._id; })) || [];
|
|
@@ -4257,7 +4275,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4257
4275
|
sortOptions: (_t = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.renderReferenceLabelOptions) === null || _t === void 0 ? void 0 : _t.call(_s),
|
|
4258
4276
|
onSortColumn: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.onChangeSort,
|
|
4259
4277
|
onDragColumn: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.onChangeDrag,
|
|
4260
|
-
filterOptions:
|
|
4278
|
+
filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
|
|
4261
4279
|
var _a;
|
|
4262
4280
|
return {
|
|
4263
4281
|
key: eachQuery.value,
|
|
@@ -4265,16 +4283,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4265
4283
|
};
|
|
4266
4284
|
}),
|
|
4267
4285
|
renderFilterElements: function (id) {
|
|
4268
|
-
var
|
|
4269
|
-
var selectedQuery = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) === null || _b === void 0 ? void 0 : _b.filter(function (eachQuery) {
|
|
4286
|
+
var selectedQuery = additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.filter(function (eachQuery) {
|
|
4270
4287
|
return eachQuery.value === id;
|
|
4271
4288
|
});
|
|
4272
|
-
var selectedModelList =
|
|
4289
|
+
var selectedModelList = structure.filter(function (eachModel) { return eachModel.id === id; });
|
|
4273
4290
|
var newQuery = (0, listModule_1.renderSearchAdditionalQueries)(selectedModelList, selectedQuery);
|
|
4274
4291
|
return renderSearchContent(newQuery);
|
|
4275
4292
|
},
|
|
4276
4293
|
}, editable: {
|
|
4277
|
-
active: ((
|
|
4294
|
+
active: ((_w = props.edit) === null || _w === void 0 ? void 0 : _w.listEditable) && !props.edit.disabledUpdate
|
|
4278
4295
|
? true
|
|
4279
4296
|
: false,
|
|
4280
4297
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -4288,7 +4305,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4288
4305
|
});
|
|
4289
4306
|
}); },
|
|
4290
4307
|
}, addable: {
|
|
4291
|
-
active: ((
|
|
4308
|
+
active: ((_x = props.edit) === null || _x === void 0 ? void 0 : _x.listAddable) ? true : false,
|
|
4292
4309
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4293
4310
|
return __generator(this, function (_a) {
|
|
4294
4311
|
switch (_a.label) {
|
|
@@ -4299,7 +4316,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4299
4316
|
}
|
|
4300
4317
|
});
|
|
4301
4318
|
}); },
|
|
4302
|
-
}, darkMode: (
|
|
4319
|
+
}, darkMode: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.darkMode, hidePagination: true })));
|
|
4303
4320
|
});
|
|
4304
4321
|
}
|
|
4305
4322
|
}
|
|
@@ -4342,7 +4359,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4342
4359
|
sortOptions: (_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.renderReferenceLabelOptions) === null || _r === void 0 ? void 0 : _r.call(_q),
|
|
4343
4360
|
onSortColumn: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.onChangeSort,
|
|
4344
4361
|
onDragColumn: (_t = props.organise) === null || _t === void 0 ? void 0 : _t.onChangeDrag,
|
|
4345
|
-
filterOptions:
|
|
4362
|
+
filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
|
|
4346
4363
|
var _a;
|
|
4347
4364
|
return {
|
|
4348
4365
|
key: eachQuery.value,
|
|
@@ -4350,16 +4367,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4350
4367
|
};
|
|
4351
4368
|
}),
|
|
4352
4369
|
renderFilterElements: function (id) {
|
|
4353
|
-
var
|
|
4354
|
-
var selectedQuery = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) === null || _b === void 0 ? void 0 : _b.filter(function (eachQuery) {
|
|
4370
|
+
var selectedQuery = additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.filter(function (eachQuery) {
|
|
4355
4371
|
return eachQuery.value === id;
|
|
4356
4372
|
});
|
|
4357
|
-
var selectedModelList =
|
|
4373
|
+
var selectedModelList = structure.filter(function (eachModel) { return eachModel.id === id; });
|
|
4358
4374
|
var newQuery = (0, listModule_1.renderSearchAdditionalQueries)(selectedModelList, selectedQuery);
|
|
4359
4375
|
return renderSearchContent(newQuery);
|
|
4360
4376
|
},
|
|
4361
4377
|
}, editable: {
|
|
4362
|
-
active: ((
|
|
4378
|
+
active: ((_u = props.edit) === null || _u === void 0 ? void 0 : _u.listEditable) && !props.edit.disabledUpdate
|
|
4363
4379
|
? true
|
|
4364
4380
|
: false,
|
|
4365
4381
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -4373,7 +4389,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4373
4389
|
});
|
|
4374
4390
|
}); },
|
|
4375
4391
|
}, addable: {
|
|
4376
|
-
active: ((
|
|
4392
|
+
active: ((_v = props.edit) === null || _v === void 0 ? void 0 : _v.listAddable) ? true : false,
|
|
4377
4393
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4378
4394
|
return __generator(this, function (_a) {
|
|
4379
4395
|
switch (_a.label) {
|
|
@@ -4384,7 +4400,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4384
4400
|
}
|
|
4385
4401
|
});
|
|
4386
4402
|
}); },
|
|
4387
|
-
}, darkMode: (
|
|
4403
|
+
}, darkMode: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.darkMode, hidePagination: (_x = props.organise) === null || _x === void 0 ? void 0 : _x.hidePagination }));
|
|
4388
4404
|
}
|
|
4389
4405
|
};
|
|
4390
4406
|
var renderTabContent = function (tabs, dataType, viewType) {
|
|
@@ -4398,13 +4414,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4398
4414
|
}
|
|
4399
4415
|
});
|
|
4400
4416
|
var multipleSelect = isEditor && !((_a = props.organise) === null || _a === void 0 ? void 0 : _a.disableMulti) ? true : false;
|
|
4401
|
-
if (viewType === "general") {
|
|
4417
|
+
if (viewType === "general" || (selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.viewType) === "report") {
|
|
4402
4418
|
if (dataType === "list") {
|
|
4403
4419
|
return react_1.default.createElement(react_1.default.Fragment, null, renderGroupTable(multipleSelect));
|
|
4404
4420
|
}
|
|
4405
4421
|
else if (dataType === "read") {
|
|
4406
4422
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
4407
|
-
react_1.default.createElement(detailList_1.DetailList, { model:
|
|
4423
|
+
react_1.default.createElement(detailList_1.DetailList, { model: structure, referenceModel: referenceModelSchema, className: "mt-5 bg-white rounded-md", title: "General Details", list: renderDetailListData(structure), handleReferenceLink: !schemaPresent && ((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareReadReferenceView)
|
|
4408
4424
|
? props.bareSettings.bareReadReferenceView
|
|
4409
4425
|
: undefined, splitView: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.splitView }),
|
|
4410
4426
|
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(dataType)),
|
|
@@ -4711,7 +4727,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4711
4727
|
var nullColumn_1 = false;
|
|
4712
4728
|
var groupBy_1 = [];
|
|
4713
4729
|
var groupLabel_1 = [];
|
|
4714
|
-
|
|
4730
|
+
structure.map(function (eachModel) {
|
|
4715
4731
|
var _a, _b, _c;
|
|
4716
4732
|
if (kanbanTitle_2 === eachModel.id) {
|
|
4717
4733
|
if (eachModel.type === "list") {
|
|
@@ -4749,155 +4765,6 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4749
4765
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
4750
4766
|
} }));
|
|
4751
4767
|
}
|
|
4752
|
-
// else if (selectedTabData.viewType === "report") {
|
|
4753
|
-
// return (
|
|
4754
|
-
// <Table
|
|
4755
|
-
// showId={showId}
|
|
4756
|
-
// paginationType={isFirebase ? "cursor" : "page"}
|
|
4757
|
-
// data={tableData}
|
|
4758
|
-
// spaceData={spaceTableData}
|
|
4759
|
-
// size={size}
|
|
4760
|
-
// limit={limit}
|
|
4761
|
-
// cursor={cursor}
|
|
4762
|
-
// loading={tableLoading}
|
|
4763
|
-
// checkbox={multipleSelect}
|
|
4764
|
-
// selectAll={selectAll}
|
|
4765
|
-
// selectedIds={selectedIds}
|
|
4766
|
-
// selectAllText={selectAll ? "from filter" : ""}
|
|
4767
|
-
// multiActionButton={
|
|
4768
|
-
// <div className="flex flex-row space-x-3">
|
|
4769
|
-
// {selectedIds.length > 0 &&
|
|
4770
|
-
// !props.edit?.disabledUpdate &&
|
|
4771
|
-
// !props.bareSettings?.bareHideTableExtraMultipleAction && (
|
|
4772
|
-
// <>
|
|
4773
|
-
// <TextButton
|
|
4774
|
-
// className="text-sm"
|
|
4775
|
-
// text="Change to Draft"
|
|
4776
|
-
// disable={loading}
|
|
4777
|
-
// onClick={() => {
|
|
4778
|
-
// handleBatchDraftData();
|
|
4779
|
-
// }}
|
|
4780
|
-
// />
|
|
4781
|
-
// <TextButton
|
|
4782
|
-
// className="text-sm"
|
|
4783
|
-
// text="Clone Items"
|
|
4784
|
-
// disable={loading}
|
|
4785
|
-
// onClick={() => {
|
|
4786
|
-
// handleCloneSelectedData();
|
|
4787
|
-
// }}
|
|
4788
|
-
// />
|
|
4789
|
-
// </>
|
|
4790
|
-
// )}
|
|
4791
|
-
// {props.edit?.deleteBtn && (
|
|
4792
|
-
// <TextButton
|
|
4793
|
-
// className="text-sm text-red-500 hover:text-red-600"
|
|
4794
|
-
// text="Delete"
|
|
4795
|
-
// onClick={() => {
|
|
4796
|
-
// handleGenerateDeletePasscode();
|
|
4797
|
-
// setDeleteModal(true);
|
|
4798
|
-
// }}
|
|
4799
|
-
// />
|
|
4800
|
-
// )}
|
|
4801
|
-
// {!isFirebase && !props.edit?.disableBatchUpdate && (
|
|
4802
|
-
// <TextButton
|
|
4803
|
-
// className="text-sm"
|
|
4804
|
-
// text="Update"
|
|
4805
|
-
// onClick={() => {
|
|
4806
|
-
// setBatchUpdateModal(true);
|
|
4807
|
-
// }}
|
|
4808
|
-
// />
|
|
4809
|
-
// )}
|
|
4810
|
-
// {props.bareSettings?.bareListMultipleSelectAddtionalActions &&
|
|
4811
|
-
// props.bareSettings?.bareListMultipleSelectAddtionalActions?.map(
|
|
4812
|
-
// (eachButton) => {
|
|
4813
|
-
// return (
|
|
4814
|
-
// <TextButton
|
|
4815
|
-
// className={`text-sm ${eachButton.className}`}
|
|
4816
|
-
// text={eachButton.text}
|
|
4817
|
-
// onClick={() => {
|
|
4818
|
-
// eachButton.onClick?.(
|
|
4819
|
-
// selectedIds,
|
|
4820
|
-
// selectAll,
|
|
4821
|
-
// renderImpSearchFilterConditions() ?? []
|
|
4822
|
-
// );
|
|
4823
|
-
// }}
|
|
4824
|
-
// />
|
|
4825
|
-
// );
|
|
4826
|
-
// }
|
|
4827
|
-
// )}
|
|
4828
|
-
// </div>
|
|
4829
|
-
// }
|
|
4830
|
-
// handleSelectAll={handleSelectAllPages}
|
|
4831
|
-
// handleSelectedIds={handleSelectIds}
|
|
4832
|
-
// header={renderTableHeader()}
|
|
4833
|
-
// pageIndex={pageIndex}
|
|
4834
|
-
// onClickRow={(id: string) => {
|
|
4835
|
-
// props.organise?.handleNavigate?.("read", id, "general");
|
|
4836
|
-
// }}
|
|
4837
|
-
// linkType={props.linkType}
|
|
4838
|
-
// custom={props.custom}
|
|
4839
|
-
// newTabUrl={`${props.localURLEndpoint}?data=`}
|
|
4840
|
-
// addNewTabUrl={`&type=read&collection=${props.collectionId}&view=general`}
|
|
4841
|
-
// handleUpdatePageIndex={handlePagination}
|
|
4842
|
-
// className="mt-5"
|
|
4843
|
-
// lib={{ axios: props.lib?.axios }}
|
|
4844
|
-
// devSettings={props.devSettings}
|
|
4845
|
-
// bareSettings={props.bareSettings}
|
|
4846
|
-
// fixedPagination={props.organise?.fixedPagination}
|
|
4847
|
-
// advSettings={{
|
|
4848
|
-
// addColumnEnabled: true,
|
|
4849
|
-
// renderAddColumnElements: renderAddMathColumn,
|
|
4850
|
-
// dragEnabled: props.organise?.advDragEnabled,
|
|
4851
|
-
// sortEnabled: props.organise?.advSortEnabled,
|
|
4852
|
-
// filterEnabled: props.organise?.advFilterEnabled,
|
|
4853
|
-
// sortId: props.organise?.sort,
|
|
4854
|
-
// sortOptions: props.organise?.renderReferenceLabelOptions?.(),
|
|
4855
|
-
// onSortColumn: props.organise?.onChangeSort,
|
|
4856
|
-
// onDragColumn: props.organise?.onChangeDrag,
|
|
4857
|
-
// filterOptions: props.organise?.additionalQuery?.map(
|
|
4858
|
-
// (eachQuery) => {
|
|
4859
|
-
// return {
|
|
4860
|
-
// key: eachQuery.value,
|
|
4861
|
-
// label: eachQuery.label ?? "",
|
|
4862
|
-
// };
|
|
4863
|
-
// }
|
|
4864
|
-
// ),
|
|
4865
|
-
// renderFilterElements: (id: string) => {
|
|
4866
|
-
// const selectedQuery = props.organise?.additionalQuery?.filter(
|
|
4867
|
-
// (eachQuery) => {
|
|
4868
|
-
// return eachQuery.value === id;
|
|
4869
|
-
// }
|
|
4870
|
-
// );
|
|
4871
|
-
// const selectedModelList = props.model.filter(
|
|
4872
|
-
// (eachModel) => eachModel.id === id
|
|
4873
|
-
// );
|
|
4874
|
-
// const newQuery = renderSearchAdditionalQueries(
|
|
4875
|
-
// selectedModelList,
|
|
4876
|
-
// selectedQuery
|
|
4877
|
-
// );
|
|
4878
|
-
// return renderSearchContent(newQuery);
|
|
4879
|
-
// },
|
|
4880
|
-
// }}
|
|
4881
|
-
// editable={{
|
|
4882
|
-
// active:
|
|
4883
|
-
// props.edit?.listEditable && !props.edit.disabledUpdate
|
|
4884
|
-
// ? true
|
|
4885
|
-
// : false,
|
|
4886
|
-
// onUpdateData: async (rowId, columnId, data) => {
|
|
4887
|
-
// await handleSubmitData("update", rowId, columnId, data);
|
|
4888
|
-
// },
|
|
4889
|
-
// }}
|
|
4890
|
-
// addable={{
|
|
4891
|
-
// active: props.edit?.listAddable ? true : false,
|
|
4892
|
-
// onAddData: async (data) => {
|
|
4893
|
-
// await handleSubmitData("create", "", "", data);
|
|
4894
|
-
// },
|
|
4895
|
-
// }}
|
|
4896
|
-
// darkMode={props.organise?.darkMode}
|
|
4897
|
-
// hidePagination={props.organise?.hidePagination}
|
|
4898
|
-
// />
|
|
4899
|
-
// );
|
|
4900
|
-
// }
|
|
4901
4768
|
else if (selectedTabData.renderComp) {
|
|
4902
4769
|
return react_1.default.createElement(react_1.default.Fragment, null, selectedTabData.renderComp());
|
|
4903
4770
|
}
|
|
@@ -4927,7 +4794,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4927
4794
|
return null;
|
|
4928
4795
|
};
|
|
4929
4796
|
var renderModalContent = function () {
|
|
4930
|
-
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
|
|
4797
|
+
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;
|
|
4931
4798
|
if (loading) {
|
|
4932
4799
|
return (react_1.default.createElement("div", { className: "mt-5" },
|
|
4933
4800
|
react_1.default.createElement(loading_1.Loading, null),
|
|
@@ -4961,7 +4828,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4961
4828
|
}
|
|
4962
4829
|
else if (exportExcel || exportQR) {
|
|
4963
4830
|
var showEmail = exportType !== "pdf" && !((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.exportSettings) === null || _b === void 0 ? void 0 : _b.disableEmail);
|
|
4964
|
-
return (react_1.default.createElement(react_1.default.Fragment, null, queryForm ? (react_1.default.createElement(queryForm_1.QueryForm, { dbModule: (_c = props.lib) === null || _c === void 0 ? void 0 : _c.axios, model:
|
|
4831
|
+
return (react_1.default.createElement(react_1.default.Fragment, null, queryForm ? (react_1.default.createElement(queryForm_1.QueryForm, { dbModule: (_c = props.lib) === null || _c === void 0 ? void 0 : _c.axios, model: structure, updateQuery: queryIndex >= 0 ? queryList[queryIndex] : undefined, devSettings: props.devSettings, handleCloseForm: function () {
|
|
4965
4832
|
handleViewQuery(-1);
|
|
4966
4833
|
}, handleQueryOnComplete: function (queryData) {
|
|
4967
4834
|
handlePushQueryList(queryData, queryIndex);
|
|
@@ -5011,17 +4878,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5011
4878
|
} }));
|
|
5012
4879
|
}
|
|
5013
4880
|
else if (overviewModal) {
|
|
5014
|
-
return (react_1.default.createElement(settingsModal_1.OverviewModal, { model:
|
|
4881
|
+
return (react_1.default.createElement(settingsModal_1.OverviewModal, { model: structure, referenceSchema: referenceModelSchema, setReferenceSchema: setReferenceSchema, onChangeHide: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.onChangeHide, onClose: function () {
|
|
5015
4882
|
handlePopUpModal(false);
|
|
5016
4883
|
} }));
|
|
5017
4884
|
}
|
|
5018
4885
|
else if (filterModal) {
|
|
5019
|
-
return (react_1.default.createElement(settingsModal_1.FilterModal, { server: props.devSettings.server, filter:
|
|
4886
|
+
return (react_1.default.createElement(settingsModal_1.FilterModal, { server: props.devSettings.server, filter: additionalQuery, onChangeFilter: (_t = props.organise) === null || _t === void 0 ? void 0 : _t.onChangeFilter, renderReferenceLabelOptions: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.renderReferenceLabelOptions, renderReferenceSpaceOptions: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.renderReferenceSpaceOptions, setNotification: setNotification, onClose: function () {
|
|
5020
4887
|
handlePopUpModal(false);
|
|
5021
4888
|
} }));
|
|
5022
4889
|
}
|
|
5023
4890
|
else if (addTabModal) {
|
|
5024
|
-
return (react_1.default.createElement(settingsModal_1.TabModal, { type: props.type, tabs: (
|
|
4891
|
+
return (react_1.default.createElement(settingsModal_1.TabModal, { type: props.type, tabs: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.extendedTabs, onChangeTabs: (_x = props.organise) === null || _x === void 0 ? void 0 : _x.onChangeTabs, model: structure, renderReferenceLabelOptions: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.renderReferenceLabelOptions, onClose: function () {
|
|
5025
4892
|
handlePopUpModal(false);
|
|
5026
4893
|
} }));
|
|
5027
4894
|
}
|
|
@@ -5041,7 +4908,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5041
4908
|
else if (selectedListAddressId) {
|
|
5042
4909
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5043
4910
|
react_1.default.createElement(form_1.Form, { className: "grid grid-cols-1 gap-6 pb-20 mt-6", ref: listAddressFromRef, refList: [listAddressInputRef], handleComplete: function () {
|
|
5044
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
4911
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server);
|
|
5045
4912
|
var listAddressValue = clonedSelectedData[selectedListAddressId];
|
|
5046
4913
|
if (listAddressValue)
|
|
5047
4914
|
clonedSelectedData[selectedListAddressId] = __spreadArray(__spreadArray([], listAddressValue, true), [
|
|
@@ -5078,7 +4945,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5078
4945
|
}); } }))));
|
|
5079
4946
|
}
|
|
5080
4947
|
else {
|
|
5081
|
-
var filterObjectModel =
|
|
4948
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
5082
4949
|
return eachModel.id === selectedObjectStructureId;
|
|
5083
4950
|
});
|
|
5084
4951
|
if (filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.objectData) {
|
|
@@ -5091,16 +4958,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5091
4958
|
disabledOnEnter_2 = true;
|
|
5092
4959
|
return null;
|
|
5093
4960
|
});
|
|
5094
|
-
if ((
|
|
4961
|
+
if ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareListObjectHandleData) {
|
|
5095
4962
|
var listObjectViewType = props.type === "read"
|
|
5096
4963
|
? "read"
|
|
5097
4964
|
: selectedObjectId
|
|
5098
4965
|
? "update"
|
|
5099
4966
|
: "new";
|
|
5100
|
-
(
|
|
4967
|
+
(_1 = (_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareListObjectHandleData) === null || _1 === void 0 ? void 0 : _1.call(_0, listObjectViewType, selectedObjectData);
|
|
5101
4968
|
}
|
|
5102
4969
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5103
|
-
react_1.default.createElement(form_1.Form, { className: "grid ".concat(formColumn, " gap-6 pb-32 mt-6 sm:pb-36"), ref: objectFormRef, refList: objectFormInputRefs, handleComplete: handleSubmitObjectDataType, disabledOnEnter: disabledOnEnter_2 }, renderDataTemplateFormContent(selectedObjectData, (
|
|
4970
|
+
react_1.default.createElement(form_1.Form, { className: "grid ".concat(formColumn, " gap-6 pb-32 mt-6 sm:pb-36"), ref: objectFormRef, refList: objectFormInputRefs, handleComplete: handleSubmitObjectDataType, disabledOnEnter: disabledOnEnter_2 }, renderDataTemplateFormContent(selectedObjectData, (_2 = filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.objectData) !== null && _2 !== void 0 ? _2 : [], objectFormInputRefs, true, filterObjectModel.type === "listObject", undefined, filterObjectModel.type === "listObject"
|
|
5104
4971
|
? selectedData
|
|
5105
4972
|
: undefined)),
|
|
5106
4973
|
react_1.default.createElement("div", { className: "flex justify-end pt-8" },
|
|
@@ -5206,7 +5073,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5206
5073
|
var renderBatchUpdateModalContent = function () {
|
|
5207
5074
|
var _a;
|
|
5208
5075
|
if (batchUpdateModal) {
|
|
5209
|
-
var columnIdOptions =
|
|
5076
|
+
var columnIdOptions = structure
|
|
5210
5077
|
.filter(function (eachModel) {
|
|
5211
5078
|
return eachModel.id !== "id" &&
|
|
5212
5079
|
!eachModel.unique &&
|
|
@@ -5220,7 +5087,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5220
5087
|
disabled: true,
|
|
5221
5088
|
type: "string",
|
|
5222
5089
|
};
|
|
5223
|
-
var modelFound =
|
|
5090
|
+
var modelFound = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
|
|
5224
5091
|
var model = modelFound !== null && modelFound !== void 0 ? modelFound : defaultModel;
|
|
5225
5092
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5226
5093
|
react_1.default.createElement(form_1.Form, { ref: batchUpdateFormRef, refList: [batchUpdateColumnIdRef, batchUpdateInputRef], handleComplete: handleBatchUpdateData },
|
|
@@ -5228,7 +5095,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5228
5095
|
var _a;
|
|
5229
5096
|
var _b;
|
|
5230
5097
|
var columnDataValue = undefined;
|
|
5231
|
-
var selectedModel =
|
|
5098
|
+
var selectedModel = structure.find(function (eachAttribute) { return eachAttribute.id === value; });
|
|
5232
5099
|
if (selectedModel) {
|
|
5233
5100
|
if (selectedModel.type === "list") {
|
|
5234
5101
|
var isOptional = (_b = selectedModel.optional) !== null && _b !== void 0 ? _b : false;
|
|
@@ -5314,7 +5181,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5314
5181
|
};
|
|
5315
5182
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5316
5183
|
renderNotification("root"),
|
|
5317
|
-
((
|
|
5184
|
+
((_20 = (_19 = props.renderSettings) === null || _19 === void 0 ? void 0 : _19.renderLoadingUI) === null || _20 === void 0 ? void 0 : _20.call(_19)) && loading ? ((_21 = props.renderSettings) === null || _21 === void 0 ? void 0 : _21.renderLoadingUI()) : (react_1.default.createElement(modal_1.Modal, { maxWidth: selectedObjectStructureId || excelModal ? "2xl" : undefined, open: modalVisible, title: renderModalTitle(), renderContent: renderModalContent, onClose: function () {
|
|
5318
5185
|
var _a, _b;
|
|
5319
5186
|
if (loading)
|
|
5320
5187
|
return;
|