blixify-ui-web 0.4.33 → 0.4.35
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 +6 -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 +263 -393
- 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/dataWrapper/index.d.ts +4 -1
- package/lib/components/data/dataWrapper/index.d.ts.map +1 -1
- package/lib/components/data/dataWrapper/index.js +7 -4
- package/lib/components/data/dataWrapper/index.js.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, _k, _l, _m;
|
|
452
|
+
return __generator(this, function (_o) {
|
|
453
|
+
switch (_o.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((_c = props.model) !== null && _c !== void 0 ? _c : []);
|
|
458
|
+
setAdditionalQuery((_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.additionalQuery) !== null && _e !== void 0 ? _e : []);
|
|
459
|
+
setGroupId((_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.groupBy) !== null && _g !== void 0 ? _g : "");
|
|
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
|
+
(_h = listRQueryHocRef.current) === null || _h === void 0 ? void 0 : _h.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 = (_j = kanbanSettings === null || kanbanSettings === void 0 ? void 0 : kanbanSettings.title) !== null && _j !== void 0 ? _j : "";
|
|
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: ((_k = currentTab === null || currentTab === void 0 ? void 0 : currentTab.kanbanSettings) === null || _k === void 0 ? void 0 : _k.query) || undefined,
|
|
490
495
|
})];
|
|
491
496
|
case 2:
|
|
492
|
-
kanbanRefQuery =
|
|
497
|
+
kanbanRefQuery = _o.sent();
|
|
493
498
|
if (kanbanRefQuery.data) {
|
|
494
499
|
kanbanRefQuery.data.map(function (eachData) {
|
|
495
500
|
kanbanRefOption_1.push({
|
|
@@ -499,11 +504,21 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
499
504
|
return null;
|
|
500
505
|
});
|
|
501
506
|
}
|
|
502
|
-
|
|
507
|
+
_o.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((_l = currentTab.structure) !== null && _l !== void 0 ? _l : []);
|
|
515
|
+
if (currentTab.additionalQuery)
|
|
516
|
+
setAdditionalQuery((_m = currentTab.additionalQuery) !== null && _m !== void 0 ? _m : []);
|
|
517
|
+
if (currentTab.groupBy)
|
|
518
|
+
setGroupId(currentTab.groupBy);
|
|
519
|
+
}
|
|
520
|
+
_o.label = 5;
|
|
521
|
+
case 5: return [2 /*return*/];
|
|
507
522
|
}
|
|
508
523
|
});
|
|
509
524
|
}); };
|
|
@@ -512,8 +527,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
512
527
|
props.collectionId,
|
|
513
528
|
props.id,
|
|
514
529
|
props.localURLEndpoint,
|
|
515
|
-
(
|
|
516
|
-
(
|
|
530
|
+
(_15 = props.organise) === null || _15 === void 0 ? void 0 : _15.extendedTabs,
|
|
531
|
+
(_16 = props.organise) === null || _16 === void 0 ? void 0 : _16.viewId,
|
|
517
532
|
props.type,
|
|
518
533
|
]);
|
|
519
534
|
(0, react_1.useEffect)(function () {
|
|
@@ -521,7 +536,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
521
536
|
if ((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.exportSettings) === null || _b === void 0 ? void 0 : _b.sumColumnId) {
|
|
522
537
|
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
538
|
}
|
|
524
|
-
}, (
|
|
539
|
+
}, (_18 = (_17 = props.organise) === null || _17 === void 0 ? void 0 : _17.exportSettings) === null || _18 === void 0 ? void 0 : _18.sumColumnId);
|
|
525
540
|
(0, react_1.useEffect)(function () {
|
|
526
541
|
if (props.devSettings.schemaReference)
|
|
527
542
|
setReferenceSchema(props.devSettings.schemaReference);
|
|
@@ -781,7 +796,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
781
796
|
});
|
|
782
797
|
prettierDataList = dummyPrettierDataList_1;
|
|
783
798
|
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,
|
|
799
|
+
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
800
|
case 3:
|
|
786
801
|
prettierDataList = _m.sent();
|
|
787
802
|
_m.label = 4;
|
|
@@ -1051,7 +1066,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1051
1066
|
//SECTION: Handle Object
|
|
1052
1067
|
//=====================================================================================
|
|
1053
1068
|
var handleRemoveObjectListData = function () {
|
|
1054
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
1069
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server);
|
|
1055
1070
|
if (selectedObjectId) {
|
|
1056
1071
|
var index = clonedSelectedData[selectedObjectStructureId].findIndex(function (eachData) { return eachData.id === selectedObjectId; });
|
|
1057
1072
|
if (index !== -1) {
|
|
@@ -1064,8 +1079,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1064
1079
|
};
|
|
1065
1080
|
var handleSubmitObjectDataType = function () {
|
|
1066
1081
|
var _a, _b;
|
|
1067
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
1068
|
-
var filterObjectModel =
|
|
1082
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, showId);
|
|
1083
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
1069
1084
|
return eachModel.id === selectedObjectStructureId;
|
|
1070
1085
|
});
|
|
1071
1086
|
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 +1123,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1108
1123
|
//TODO: Bug - try to solve clicking List Object too fast
|
|
1109
1124
|
var handleSelectListObjectData = function (id, structureId, objectIndex) {
|
|
1110
1125
|
var _a;
|
|
1111
|
-
var filterObjectModel =
|
|
1126
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
1112
1127
|
return eachModel.id === structureId;
|
|
1113
1128
|
});
|
|
1114
1129
|
if ((filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.type) === "listObject") {
|
|
@@ -1136,26 +1151,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1136
1151
|
//SECTION: Handle Assets
|
|
1137
1152
|
//=====================================================================================
|
|
1138
1153
|
var handleUploadAxios = function (eachImageEndpoint, assetParentId, assetCollectionName, assetFileName, file, bucketName) { return __awaiter(void 0, void 0, void 0, function () {
|
|
1139
|
-
var
|
|
1140
|
-
var _a, _b, _c;
|
|
1141
|
-
return __generator(this, function (
|
|
1142
|
-
switch (
|
|
1154
|
+
var storageRef, uploadTaskUrl, urlParams, imageToken, err_2, dataForm, responseData, err_3;
|
|
1155
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
1156
|
+
return __generator(this, function (_k) {
|
|
1157
|
+
switch (_k.label) {
|
|
1143
1158
|
case 0:
|
|
1144
|
-
if (!((_a = props.lib) === null || _a === void 0 ? void 0 : _a.
|
|
1145
|
-
|
|
1159
|
+
if (!(((_a = props.lib) === null || _a === void 0 ? void 0 : _a.storage) &&
|
|
1160
|
+
((_b = props.lib) === null || _b === void 0 ? void 0 : _b.ref) &&
|
|
1161
|
+
((_c = props.lib) === null || _c === void 0 ? void 0 : _c.uploadBytes) &&
|
|
1162
|
+
((_d = props.lib) === null || _d === void 0 ? void 0 : _d.getDownloadURL))) return [3 /*break*/, 6];
|
|
1163
|
+
_k.label = 1;
|
|
1146
1164
|
case 1:
|
|
1147
|
-
|
|
1148
|
-
|
|
1165
|
+
_k.trys.push([1, 4, , 5]);
|
|
1166
|
+
storageRef = (_e = props.lib) === null || _e === void 0 ? void 0 : _e.ref((_f = props.lib) === null || _f === void 0 ? void 0 : _f.storage, "".concat(assetCollectionName, "/").concat(assetParentId, "/").concat(assetFileName));
|
|
1167
|
+
return [4 /*yield*/, ((_g = props.lib) === null || _g === void 0 ? void 0 : _g.uploadBytes(storageRef, file))];
|
|
1149
1168
|
case 2:
|
|
1150
|
-
|
|
1151
|
-
return [4 /*yield*/,
|
|
1169
|
+
_k.sent();
|
|
1170
|
+
return [4 /*yield*/, ((_h = props.lib) === null || _h === void 0 ? void 0 : _h.getDownloadURL(storageRef))];
|
|
1152
1171
|
case 3:
|
|
1153
|
-
uploadTaskUrl =
|
|
1154
|
-
urlParams = new URLSearchParams(uploadTaskUrl);
|
|
1172
|
+
uploadTaskUrl = _k.sent();
|
|
1173
|
+
urlParams = new URLSearchParams(uploadTaskUrl.split("?")[1]);
|
|
1155
1174
|
imageToken = urlParams.get("token");
|
|
1156
1175
|
return [2 /*return*/, { data: { data: imageToken } }];
|
|
1157
1176
|
case 4:
|
|
1158
|
-
err_2 =
|
|
1177
|
+
err_2 = _k.sent();
|
|
1159
1178
|
console.log("Firebase Upload Error - ", JSON.stringify(err_2));
|
|
1160
1179
|
return [3 /*break*/, 5];
|
|
1161
1180
|
case 5: return [3 /*break*/, 10];
|
|
@@ -1167,20 +1186,20 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1167
1186
|
dataForm.append("data[assetFileName]", assetFileName);
|
|
1168
1187
|
if (bucketName)
|
|
1169
1188
|
dataForm.append("data[bucketName]", bucketName);
|
|
1170
|
-
|
|
1189
|
+
_k.label = 7;
|
|
1171
1190
|
case 7:
|
|
1172
|
-
|
|
1173
|
-
return [4 /*yield*/, ((
|
|
1191
|
+
_k.trys.push([7, 9, , 10]);
|
|
1192
|
+
return [4 /*yield*/, ((_j = props.lib) === null || _j === void 0 ? void 0 : _j.axios({
|
|
1174
1193
|
method: "post",
|
|
1175
1194
|
url: "".concat(eachImageEndpoint, "/upload"),
|
|
1176
1195
|
data: dataForm,
|
|
1177
1196
|
headers: { "Content-Type": "multipart/form-data" },
|
|
1178
1197
|
}))];
|
|
1179
1198
|
case 8:
|
|
1180
|
-
responseData =
|
|
1199
|
+
responseData = _k.sent();
|
|
1181
1200
|
return [2 /*return*/, responseData];
|
|
1182
1201
|
case 9:
|
|
1183
|
-
err_3 =
|
|
1202
|
+
err_3 = _k.sent();
|
|
1184
1203
|
return [3 /*break*/, 10];
|
|
1185
1204
|
case 10: return [2 /*return*/];
|
|
1186
1205
|
}
|
|
@@ -1191,12 +1210,12 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1191
1210
|
return __generator(this, function (_a) {
|
|
1192
1211
|
switch (_a.label) {
|
|
1193
1212
|
case 0:
|
|
1194
|
-
clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(data !== null && data !== void 0 ? data : selectedData,
|
|
1195
|
-
return [4 /*yield*/, handleParseImageField(id, clonedSelectedData,
|
|
1213
|
+
clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(data !== null && data !== void 0 ? data : selectedData, structure, props.devSettings.server, true, showId);
|
|
1214
|
+
return [4 /*yield*/, handleParseImageField(id, clonedSelectedData, structure)];
|
|
1196
1215
|
case 1:
|
|
1197
1216
|
//INFO: Parse & Upload Data "Image & File attributes"
|
|
1198
1217
|
clonedSelectedData = _a.sent();
|
|
1199
|
-
objectAttribute =
|
|
1218
|
+
objectAttribute = structure.filter(function (eachAttribute) {
|
|
1200
1219
|
return eachAttribute.type === "object";
|
|
1201
1220
|
});
|
|
1202
1221
|
return [4 /*yield*/, Promise.all(objectAttribute.map(function (eachObject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -1212,7 +1231,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
1212
1231
|
}); }))];
|
|
1213
1232
|
case 2:
|
|
1214
1233
|
_a.sent();
|
|
1215
|
-
listObjectAttribute =
|
|
1234
|
+
listObjectAttribute = structure.filter(function (eachAttribute) {
|
|
1216
1235
|
return eachAttribute.type === "listObject";
|
|
1217
1236
|
});
|
|
1218
1237
|
return [4 /*yield*/, Promise.all(listObjectAttribute.map(function (eachObject) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -2020,7 +2039,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2020
2039
|
_a.trys.push([0, 7, , 8]);
|
|
2021
2040
|
setLoading(true);
|
|
2022
2041
|
setModalVisible(true);
|
|
2023
|
-
model_1 =
|
|
2042
|
+
model_1 = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
|
|
2024
2043
|
columnId_1 = batchUpdateData.columnId;
|
|
2025
2044
|
dataToSubmit_1 = batchUpdateData.columnData;
|
|
2026
2045
|
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";
|
|
@@ -2241,7 +2260,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2241
2260
|
createSelectedData_1 = _j.sent();
|
|
2242
2261
|
_j.label = 3;
|
|
2243
2262
|
case 3:
|
|
2244
|
-
uniqueDataStructure =
|
|
2263
|
+
uniqueDataStructure = structure.filter(function (eachStructure) {
|
|
2245
2264
|
return eachStructure.unique;
|
|
2246
2265
|
});
|
|
2247
2266
|
uniqueColumnId = uniqueDataStructure.length > 0 ? uniqueDataStructure[0].id : undefined;
|
|
@@ -2264,7 +2283,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2264
2283
|
case 5:
|
|
2265
2284
|
offlineDataResp = _j.sent();
|
|
2266
2285
|
offlineData = (_e = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _e !== void 0 ? _e : [];
|
|
2267
|
-
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData,
|
|
2286
|
+
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData, structure);
|
|
2268
2287
|
offlineData.push(tempData);
|
|
2269
2288
|
return [4 /*yield*/, indexedDb_1.indexedDb.putValue("local", {
|
|
2270
2289
|
data: offlineData,
|
|
@@ -2296,7 +2315,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2296
2315
|
return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", props.collectionId)];
|
|
2297
2316
|
case 14:
|
|
2298
2317
|
offlineDataResp = _j.sent();
|
|
2299
|
-
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData,
|
|
2318
|
+
tempData = (0, updateModule_1.handleParseOfflineWrite)(selectedData, structure);
|
|
2300
2319
|
tempData[serverId] = selectedId_2;
|
|
2301
2320
|
selectedIndex_3 = -1;
|
|
2302
2321
|
offlineData = (_f = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _f !== void 0 ? _f : [];
|
|
@@ -2505,9 +2524,9 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2505
2524
|
}); };
|
|
2506
2525
|
var handleRetrieveSelectedData = function (responseData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2507
2526
|
var clonedReferencesOptions_1, dummyRespData, dummyReferenceModelSchema, newRespData, _a;
|
|
2508
|
-
var _b, _c, _d, _e, _f, _g
|
|
2509
|
-
return __generator(this, function (
|
|
2510
|
-
switch (
|
|
2527
|
+
var _b, _c, _d, _e, _f, _g;
|
|
2528
|
+
return __generator(this, function (_h) {
|
|
2529
|
+
switch (_h.label) {
|
|
2511
2530
|
case 0:
|
|
2512
2531
|
if (!responseData.data) return [3 /*break*/, 6];
|
|
2513
2532
|
if (!((_b = props.bareSettings) === null || _b === void 0 ? void 0 : _b.bareOffline)) return [3 /*break*/, 2];
|
|
@@ -2515,7 +2534,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2515
2534
|
if ((_c = props.bareSettings) === null || _c === void 0 ? void 0 : _c.bareReadHandleData)
|
|
2516
2535
|
props.bareSettings.bareReadHandleData(responseData.data);
|
|
2517
2536
|
clonedReferencesOptions_1 = JSON.parse(JSON.stringify(referencesOptions));
|
|
2518
|
-
return [4 /*yield*/, Promise.all(
|
|
2537
|
+
return [4 /*yield*/, Promise.all(structure.map(function (eachModel) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2519
2538
|
var isObject, offlineDataResp, offlineData, prefix_1;
|
|
2520
2539
|
var _a, _b;
|
|
2521
2540
|
return __generator(this, function (_c) {
|
|
@@ -2560,30 +2579,30 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2560
2579
|
});
|
|
2561
2580
|
}); }))];
|
|
2562
2581
|
case 1:
|
|
2563
|
-
|
|
2582
|
+
_h.sent();
|
|
2564
2583
|
setReferencesOptions(clonedReferencesOptions_1);
|
|
2565
2584
|
return [3 /*break*/, 6];
|
|
2566
2585
|
case 2:
|
|
2567
2586
|
dummyRespData = JSON.parse(JSON.stringify(responseData.data), utils_1.jsonReviver);
|
|
2568
2587
|
dummyReferenceModelSchema = JSON.parse(JSON.stringify(referenceModelSchema));
|
|
2569
2588
|
if (!(props.type === "read")) return [3 /*break*/, 4];
|
|
2570
|
-
return [4 /*yield*/, (0, readModule_1.handleRetrieveDeepModel)(dummyRespData,
|
|
2571
|
-
assetParentId: (
|
|
2572
|
-
bucketName: (
|
|
2573
|
-
}, dummyReferenceModelSchema, setReferenceSchema, (
|
|
2589
|
+
return [4 /*yield*/, (0, readModule_1.handleRetrieveDeepModel)(dummyRespData, structure !== null && structure !== void 0 ? structure : [], dbModule, devSettings, {
|
|
2590
|
+
assetParentId: (_d = props.id) !== null && _d !== void 0 ? _d : "",
|
|
2591
|
+
bucketName: (_e = devSettings.bucketName) !== null && _e !== void 0 ? _e : "",
|
|
2592
|
+
}, dummyReferenceModelSchema, setReferenceSchema, (_f = props.organise) === null || _f === void 0 ? void 0 : _f.handleCustomDownloadFile)];
|
|
2574
2593
|
case 3:
|
|
2575
|
-
_a =
|
|
2594
|
+
_a = _h.sent();
|
|
2576
2595
|
return [3 /*break*/, 5];
|
|
2577
2596
|
case 4:
|
|
2578
2597
|
_a = dummyRespData;
|
|
2579
|
-
|
|
2598
|
+
_h.label = 5;
|
|
2580
2599
|
case 5:
|
|
2581
2600
|
newRespData = _a;
|
|
2582
2601
|
setSelectedData(newRespData);
|
|
2583
|
-
if ((
|
|
2602
|
+
if ((_g = props.bareSettings) === null || _g === void 0 ? void 0 : _g.bareReadHandleData)
|
|
2584
2603
|
props.bareSettings.bareReadHandleData(newRespData);
|
|
2585
|
-
(0, updateModule_1.handleRetrieveReferenceOptions)(newRespData,
|
|
2586
|
-
|
|
2604
|
+
(0, updateModule_1.handleRetrieveReferenceOptions)(newRespData, structure, dbModule, devSettings, setReferencesOptions, setReferencesDetails);
|
|
2605
|
+
_h.label = 6;
|
|
2587
2606
|
case 6:
|
|
2588
2607
|
setModalVisible(false);
|
|
2589
2608
|
setLoading(false);
|
|
@@ -2594,7 +2613,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2594
2613
|
var handleOnChangeData = function () {
|
|
2595
2614
|
var _a;
|
|
2596
2615
|
if (modalVisible && selectedObjectStructureId) {
|
|
2597
|
-
var filterObjectModel =
|
|
2616
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
2598
2617
|
return eachModel.id === selectedObjectStructureId;
|
|
2599
2618
|
});
|
|
2600
2619
|
return {
|
|
@@ -2605,13 +2624,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2605
2624
|
else if (batchUpdateModal && batchUpdateData.columnId) {
|
|
2606
2625
|
return {
|
|
2607
2626
|
data: batchUpdateData.columnData,
|
|
2608
|
-
model:
|
|
2627
|
+
model: structure,
|
|
2609
2628
|
};
|
|
2610
2629
|
}
|
|
2611
2630
|
else {
|
|
2612
2631
|
return {
|
|
2613
2632
|
data: selectedData,
|
|
2614
|
-
model:
|
|
2633
|
+
model: structure,
|
|
2615
2634
|
};
|
|
2616
2635
|
}
|
|
2617
2636
|
};
|
|
@@ -2621,7 +2640,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2621
2640
|
setSelectedObjectData(data);
|
|
2622
2641
|
}
|
|
2623
2642
|
else if (batchUpdateModal && batchUpdateData.columnId) {
|
|
2624
|
-
var selectedModel =
|
|
2643
|
+
var selectedModel = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
|
|
2625
2644
|
if (selectedModel) {
|
|
2626
2645
|
//INFO: [UPDATE] Update data via batch modal
|
|
2627
2646
|
var clonedData = JSON.parse(JSON.stringify(data));
|
|
@@ -2717,7 +2736,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2717
2736
|
var clonedData = (0, updateModule_1.handleClonedDataAttribute)(data, model, props.devSettings.server, false, showId ? true : false);
|
|
2718
2737
|
if ((Array.isArray(value) && value.includes("creation")) ||
|
|
2719
2738
|
value === "creation") {
|
|
2720
|
-
var currentSchema =
|
|
2739
|
+
var currentSchema = structure.filter(function (dsValue) {
|
|
2721
2740
|
return dsValue.id === id;
|
|
2722
2741
|
});
|
|
2723
2742
|
if (currentSchema.length > 0)
|
|
@@ -2760,7 +2779,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2760
2779
|
var eachKey = eachRow[0];
|
|
2761
2780
|
if (!eachKey)
|
|
2762
2781
|
return null;
|
|
2763
|
-
|
|
2782
|
+
structure.map(function (eachModel) {
|
|
2764
2783
|
if (eachKey.toLowerCase().includes(eachModel.id.toLowerCase()) &&
|
|
2765
2784
|
eachModel.id !== "_id" &&
|
|
2766
2785
|
eachModel.id !== "id" &&
|
|
@@ -2810,7 +2829,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2810
2829
|
csvList_1 = [];
|
|
2811
2830
|
_loop_2 = function (eachKey, eachValue) {
|
|
2812
2831
|
if (eachKey && eachValue && typeof eachValue === "string") {
|
|
2813
|
-
var selectedModel =
|
|
2832
|
+
var selectedModel = structure.find(function (eachModel) {
|
|
2814
2833
|
return eachModel.id === eachValue;
|
|
2815
2834
|
});
|
|
2816
2835
|
if ((selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) === "object" ||
|
|
@@ -2871,7 +2890,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2871
2890
|
}
|
|
2872
2891
|
valid_1 = true;
|
|
2873
2892
|
errorValue_1 = "";
|
|
2874
|
-
return [4 /*yield*/, Promise.all(
|
|
2893
|
+
return [4 /*yield*/, Promise.all(structure.map(function (eachEachModel) {
|
|
2875
2894
|
if (eachEachModel.id === "_id" || eachEachModel.id === "id") {
|
|
2876
2895
|
return "";
|
|
2877
2896
|
}
|
|
@@ -2955,11 +2974,11 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2955
2974
|
}); };
|
|
2956
2975
|
var handleExportCSVData = function (downloadLinkOnly, printOnly) { return __awaiter(void 0, void 0, void 0, function () {
|
|
2957
2976
|
var exportQueryList, baseUrl, apiEndpoint, reqData, res, dataList, csvDownloadLink, notificaitonMsg, err_20;
|
|
2958
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
2959
|
-
return __generator(this, function (
|
|
2960
|
-
switch (
|
|
2977
|
+
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;
|
|
2978
|
+
return __generator(this, function (_1) {
|
|
2979
|
+
switch (_1.label) {
|
|
2961
2980
|
case 0:
|
|
2962
|
-
|
|
2981
|
+
_1.trys.push([0, 5, , 6]);
|
|
2963
2982
|
setLoading(true);
|
|
2964
2983
|
exportQueryList = JSON.parse(JSON.stringify(queryList));
|
|
2965
2984
|
if ((_a = props.bareSettings) === null || _a === void 0 ? void 0 : _a.bareCSVExportSettings) {
|
|
@@ -2992,21 +3011,22 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
2992
3011
|
excludeReferenceId: (_e = (_d = props.organise) === null || _d === void 0 ? void 0 : _d.exportSettings) === null || _e === void 0 ? void 0 : _e.excludeReferenceId,
|
|
2993
3012
|
excludeSecondaryLabel: (_g = (_f = props.organise) === null || _f === void 0 ? void 0 : _f.exportSettings) === null || _g === void 0 ? void 0 : _g.excludeSecondaryLabel,
|
|
2994
3013
|
csvHeaderUseName: (_j = (_h = props.organise) === null || _h === void 0 ? void 0 : _h.exportSettings) === null || _j === void 0 ? void 0 : _j.csvHeaderUseName,
|
|
2995
|
-
|
|
2996
|
-
|
|
2997
|
-
|
|
3014
|
+
dateFormatString: (_l = (_k = props.organise) === null || _k === void 0 ? void 0 : _k.exportSettings) === null || _l === void 0 ? void 0 : _l.dateFormatString,
|
|
3015
|
+
excludeDataId: (_o = (_m = props.organise) === null || _m === void 0 ? void 0 : _m.exportSettings) === null || _o === void 0 ? void 0 : _o.excludeDataId,
|
|
3016
|
+
columnIds: (_q = (_p = props.organise) === null || _p === void 0 ? void 0 : _p.exportSettings) === null || _q === void 0 ? void 0 : _q.columnIds,
|
|
3017
|
+
sort: (_s = (_r = props.organise) === null || _r === void 0 ? void 0 : _r.exportSettings) === null || _s === void 0 ? void 0 : _s.sort,
|
|
2998
3018
|
groupBy: groupId,
|
|
2999
3019
|
sumAttributeId: exportSumAttributeIds,
|
|
3000
3020
|
};
|
|
3001
|
-
return [4 /*yield*/, ((
|
|
3021
|
+
return [4 /*yield*/, ((_t = props.lib) === null || _t === void 0 ? void 0 : _t.axios({
|
|
3002
3022
|
url: apiEndpoint,
|
|
3003
3023
|
method: "post",
|
|
3004
3024
|
data: { data: reqData },
|
|
3005
3025
|
}))];
|
|
3006
3026
|
case 1:
|
|
3007
|
-
res =
|
|
3008
|
-
if (!(downloadLinkOnly && ((
|
|
3009
|
-
dataList = (
|
|
3027
|
+
res = _1.sent();
|
|
3028
|
+
if (!(downloadLinkOnly && ((_u = res === null || res === void 0 ? void 0 : res.data) === null || _u === void 0 ? void 0 : _u.dataList))) return [3 /*break*/, 4];
|
|
3029
|
+
dataList = (_v = res === null || res === void 0 ? void 0 : res.data) === null || _v === void 0 ? void 0 : _v.dataList;
|
|
3010
3030
|
if (!(dataList && typeof dataList === "object")) return [3 /*break*/, 4];
|
|
3011
3031
|
csvDownloadLink = Object.values(dataList)[0];
|
|
3012
3032
|
if (!(exportType === "csv" ||
|
|
@@ -3018,10 +3038,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3018
3038
|
if (!(exportType === "pdf" ||
|
|
3019
3039
|
printOnly ||
|
|
3020
3040
|
exportType === "print")) return [3 /*break*/, 4];
|
|
3021
|
-
return [4 /*yield*/, (0, listModule_1.handleExportPDF)(csvDownloadLink, exportPDFTitle, printOnly, (
|
|
3041
|
+
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")];
|
|
3022
3042
|
case 3:
|
|
3023
|
-
|
|
3024
|
-
|
|
3043
|
+
_1.sent();
|
|
3044
|
+
_1.label = 4;
|
|
3025
3045
|
case 4:
|
|
3026
3046
|
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).";
|
|
3027
3047
|
if (downloadLinkOnly)
|
|
@@ -3035,10 +3055,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3035
3055
|
}
|
|
3036
3056
|
setLoading(false);
|
|
3037
3057
|
handlePopUpModal(false);
|
|
3038
|
-
setExportCSVEmail((
|
|
3058
|
+
setExportCSVEmail((_0 = (_z = props.devSettings.currentUser) === null || _z === void 0 ? void 0 : _z.userEmail) !== null && _0 !== void 0 ? _0 : "");
|
|
3039
3059
|
return [3 /*break*/, 6];
|
|
3040
3060
|
case 5:
|
|
3041
|
-
err_20 =
|
|
3061
|
+
err_20 = _1.sent();
|
|
3042
3062
|
setNotification({
|
|
3043
3063
|
type: true,
|
|
3044
3064
|
title: "Export Failed",
|
|
@@ -3175,7 +3195,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3175
3195
|
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 }));
|
|
3176
3196
|
case 1:
|
|
3177
3197
|
var filterOptions_1 = [];
|
|
3178
|
-
|
|
3198
|
+
structure.map(function (eachData) {
|
|
3179
3199
|
var eachDataJSON = JSON.parse(JSON.stringify(eachData));
|
|
3180
3200
|
if (eachData.id !== "_id" && eachData.id !== "id") {
|
|
3181
3201
|
filterOptions_1.push({
|
|
@@ -3190,7 +3210,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3190
3210
|
if (!eachKey)
|
|
3191
3211
|
return null;
|
|
3192
3212
|
var clonedListValue = JSON.parse(JSON.stringify(listCSVMapAttribute));
|
|
3193
|
-
var selectedObjectModel =
|
|
3213
|
+
var selectedObjectModel = structure.find(function (eachModel) {
|
|
3194
3214
|
return ((eachModel.id === clonedListValue[index] &&
|
|
3195
3215
|
eachModel.type === "listObject") ||
|
|
3196
3216
|
(eachModel.id === clonedListValue[index] &&
|
|
@@ -3268,7 +3288,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3268
3288
|
var renderTableHeader = function () {
|
|
3269
3289
|
var _a;
|
|
3270
3290
|
var tableHeader = [];
|
|
3271
|
-
|
|
3291
|
+
structure.map(function (eachAttribute) {
|
|
3272
3292
|
if (eachAttribute.id === "baseUpdatedAt" ||
|
|
3273
3293
|
eachAttribute.id === "baseDraft" ||
|
|
3274
3294
|
eachAttribute.type === "listObject" ||
|
|
@@ -3295,7 +3315,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3295
3315
|
return pageIndex === 0 ? undefined : pageIndex * limit;
|
|
3296
3316
|
}
|
|
3297
3317
|
else {
|
|
3298
|
-
var selectedModel =
|
|
3318
|
+
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); });
|
|
3299
3319
|
var cursor_1 = lastCursor;
|
|
3300
3320
|
switch (selectedModel === null || selectedModel === void 0 ? void 0 : selectedModel.type) {
|
|
3301
3321
|
case "date":
|
|
@@ -3357,7 +3377,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3357
3377
|
var _a;
|
|
3358
3378
|
event.preventDefault();
|
|
3359
3379
|
event.stopPropagation();
|
|
3360
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
3380
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server);
|
|
3361
3381
|
(_a = clonedSelectedData[fieldsId]) === null || _a === void 0 ? void 0 : _a.splice(index, 1);
|
|
3362
3382
|
setSelectedData(clonedSelectedData);
|
|
3363
3383
|
} })) }));
|
|
@@ -3367,8 +3387,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3367
3387
|
};
|
|
3368
3388
|
var renderListAddress = function (type) {
|
|
3369
3389
|
var listElement = [];
|
|
3370
|
-
var isListAddress =
|
|
3371
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
3390
|
+
var isListAddress = structure.filter(function (eachAttribute) { return eachAttribute.type === "listAddress"; });
|
|
3391
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, showId ? true : false);
|
|
3372
3392
|
isListAddress.map(function (eachListAdressFields) {
|
|
3373
3393
|
var header = [
|
|
3374
3394
|
{
|
|
@@ -3423,10 +3443,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3423
3443
|
};
|
|
3424
3444
|
var renderListObject = function (type) {
|
|
3425
3445
|
var listElement = [];
|
|
3426
|
-
var isListObject =
|
|
3446
|
+
var isListObject = structure.filter(function (eachAttribute) { return eachAttribute.type === "listObject"; });
|
|
3427
3447
|
var list = {};
|
|
3428
3448
|
var listObjTableData = {};
|
|
3429
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
3449
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server, false, showId ? true : false);
|
|
3430
3450
|
isListObject.map(function (eachListObject) {
|
|
3431
3451
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
3432
3452
|
if (props.onComplete &&
|
|
@@ -3683,8 +3703,8 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3683
3703
|
return react_1.default.createElement(react_1.default.Fragment, null);
|
|
3684
3704
|
};
|
|
3685
3705
|
var renderSearchContent = function (addQuery) {
|
|
3686
|
-
var _a, _b
|
|
3687
|
-
var filterComponent = (0, listModule_1.renderSearchFilterComponents)(
|
|
3706
|
+
var _a, _b;
|
|
3707
|
+
var filterComponent = (0, listModule_1.renderSearchFilterComponents)(structure, devSettings, limit, dbModule, {
|
|
3688
3708
|
filterSearch: filterSearch,
|
|
3689
3709
|
filterSelection: filterSelection,
|
|
3690
3710
|
filterReferenceDate: filterReferenceDate,
|
|
@@ -3700,7 +3720,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3700
3720
|
handleClearDataByFilter: handleClearDataByFilter,
|
|
3701
3721
|
handleRangeFilterOnChange: handleRangeFilterOnChange,
|
|
3702
3722
|
handleFilterDataSelected: handleFilterDataSelected,
|
|
3703
|
-
}, __assign(__assign({}, props.organise), { additionalQuery: addQuery !== null && addQuery !== void 0 ? addQuery :
|
|
3723
|
+
}, __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);
|
|
3704
3724
|
return filterComponent;
|
|
3705
3725
|
};
|
|
3706
3726
|
var renderAuthContent = function () {
|
|
@@ -3833,7 +3853,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3833
3853
|
});
|
|
3834
3854
|
var filterModel_1 = [];
|
|
3835
3855
|
var disabledOnEnter_1 = (_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.disabledOnEnter) !== null && _r !== void 0 ? _r : false;
|
|
3836
|
-
|
|
3856
|
+
structure.map(function (eachModel) {
|
|
3837
3857
|
var _a;
|
|
3838
3858
|
var present = false;
|
|
3839
3859
|
if (eachModel.type === "markdown" ||
|
|
@@ -3856,7 +3876,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3856
3876
|
return null;
|
|
3857
3877
|
});
|
|
3858
3878
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
3859
|
-
props.id && props.id !== "new" &&
|
|
3879
|
+
props.id && props.id !== "new" && structure.length > 1 && (react_1.default.createElement(readQueryHoc_1.ReadQueryHoc, { ref: readQueryHocRef, database: {
|
|
3860
3880
|
dbModule: dbModule,
|
|
3861
3881
|
dbType: devSettings.server,
|
|
3862
3882
|
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,
|
|
@@ -3945,8 +3965,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
3945
3965
|
((_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" },
|
|
3946
3966
|
((_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); } })),
|
|
3947
3967
|
filterComponent.map(function (item, index) {
|
|
3948
|
-
var
|
|
3949
|
-
var filter = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) === null || _b === void 0 ? void 0 : _b[index];
|
|
3968
|
+
var filter = additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery[index];
|
|
3950
3969
|
return (react_1.default.createElement("div", { key: index, className: (filter === null || filter === void 0 ? void 0 : filter.type) === "range"
|
|
3951
3970
|
? "flex-grow sm:basis-full md:basis-1/2 lg:basis-1/3"
|
|
3952
3971
|
: "flex-grow sm:flex-shrink-0 sm:basis-1/2 md:basis-1/4 lg:basis-1/6" }, item));
|
|
@@ -4010,7 +4029,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4010
4029
|
var renderGridAndListData = function (imageTag, type, kanbanGroupId) {
|
|
4011
4030
|
var gridData = [];
|
|
4012
4031
|
var titleKey = "";
|
|
4013
|
-
var titleModel =
|
|
4032
|
+
var titleModel = structure.find(function (eachModel) {
|
|
4014
4033
|
return !eachModel.hide && eachModel.id !== "_id" && eachModel.id !== "id";
|
|
4015
4034
|
});
|
|
4016
4035
|
if (titleModel)
|
|
@@ -4028,7 +4047,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4028
4047
|
var listDescArray = [];
|
|
4029
4048
|
Object.entries(eachData).forEach(function (value) {
|
|
4030
4049
|
var eachKey = value[0], eachValue = value[1];
|
|
4031
|
-
var selectedModel =
|
|
4050
|
+
var selectedModel = structure.find(function (eachModel) { return eachModel.id === eachKey; });
|
|
4032
4051
|
var modelInStructure;
|
|
4033
4052
|
var structurePresent = false;
|
|
4034
4053
|
if (selectedTab === null || selectedTab === void 0 ? void 0 : selectedTab.structure) {
|
|
@@ -4146,7 +4165,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4146
4165
|
if (((_a = props.organise) === null || _a === void 0 ? void 0 : _a.extendedTabs) &&
|
|
4147
4166
|
((_b = props.organise.extendedTabs) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
4148
4167
|
(_c = props.organise) === null || _c === void 0 ? void 0 : _c.extendedTabs.map(function (eachTab) {
|
|
4149
|
-
var _a, _b, _c, _d;
|
|
4168
|
+
var _a, _b, _c, _d, _e;
|
|
4150
4169
|
var hrefPoint = "".concat(props.localURLEndpoint, "?type=").concat(props.type, "&collection=").concat(props.collectionId);
|
|
4151
4170
|
if (props.id)
|
|
4152
4171
|
hrefPoint += "&data=".concat(props.id);
|
|
@@ -4168,11 +4187,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4168
4187
|
else
|
|
4169
4188
|
tabData["viewImage"] = eachTab.viewImage;
|
|
4170
4189
|
if (eachTab.type === props.type) {
|
|
4171
|
-
tabs.push(__assign(__assign({}, tabData),
|
|
4190
|
+
tabs.push(__assign(__assign({}, tabData), (!((_e = props.edit) === null || _e === void 0 ? void 0 : _e.disabledTabsDeleteBtn) && {
|
|
4191
|
+
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) {
|
|
4172
4192
|
e.stopPropagation();
|
|
4173
4193
|
e.preventDefault();
|
|
4174
4194
|
handleDeleteTab(tabData.id);
|
|
4175
|
-
} }))
|
|
4195
|
+
} })),
|
|
4196
|
+
})));
|
|
4176
4197
|
}
|
|
4177
4198
|
return null;
|
|
4178
4199
|
});
|
|
@@ -4188,10 +4209,10 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4188
4209
|
};
|
|
4189
4210
|
var renderAddMathColumn = function (id, onClose) {
|
|
4190
4211
|
var _a, _b, _c;
|
|
4191
|
-
return (react_1.default.createElement(settingsModal_1.ExpressionModal, { selectedId: id, model:
|
|
4212
|
+
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 }));
|
|
4192
4213
|
};
|
|
4193
4214
|
var renderGroupTable = function (multipleSelect) {
|
|
4194
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x
|
|
4215
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
4195
4216
|
if (groupId) {
|
|
4196
4217
|
var groupedSpaceTableData = spaceTableData.reduce(function (acc, eachData) {
|
|
4197
4218
|
var key = (eachData === null || eachData === void 0 ? void 0 : eachData[groupId]) && (eachData === null || eachData === void 0 ? void 0 : eachData[groupId]) !== " - "
|
|
@@ -4206,7 +4227,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4206
4227
|
}
|
|
4207
4228
|
else {
|
|
4208
4229
|
return Object.entries(groupedSpaceTableData).map(function (_a) {
|
|
4209
|
-
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y
|
|
4230
|
+
var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
4210
4231
|
var eachKey = _a[0], eachValue = _a[1];
|
|
4211
4232
|
var dataList = eachValue;
|
|
4212
4233
|
var ids = (dataList === null || dataList === void 0 ? void 0 : dataList.map(function (eachData) { return eachData._id; })) || [];
|
|
@@ -4253,7 +4274,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4253
4274
|
sortOptions: (_t = (_s = props.organise) === null || _s === void 0 ? void 0 : _s.renderReferenceLabelOptions) === null || _t === void 0 ? void 0 : _t.call(_s),
|
|
4254
4275
|
onSortColumn: (_u = props.organise) === null || _u === void 0 ? void 0 : _u.onChangeSort,
|
|
4255
4276
|
onDragColumn: (_v = props.organise) === null || _v === void 0 ? void 0 : _v.onChangeDrag,
|
|
4256
|
-
filterOptions:
|
|
4277
|
+
filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
|
|
4257
4278
|
var _a;
|
|
4258
4279
|
return {
|
|
4259
4280
|
key: eachQuery.value,
|
|
@@ -4261,16 +4282,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4261
4282
|
};
|
|
4262
4283
|
}),
|
|
4263
4284
|
renderFilterElements: function (id) {
|
|
4264
|
-
var
|
|
4265
|
-
var selectedQuery = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) === null || _b === void 0 ? void 0 : _b.filter(function (eachQuery) {
|
|
4285
|
+
var selectedQuery = additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.filter(function (eachQuery) {
|
|
4266
4286
|
return eachQuery.value === id;
|
|
4267
4287
|
});
|
|
4268
|
-
var selectedModelList =
|
|
4288
|
+
var selectedModelList = structure.filter(function (eachModel) { return eachModel.id === id; });
|
|
4269
4289
|
var newQuery = (0, listModule_1.renderSearchAdditionalQueries)(selectedModelList, selectedQuery);
|
|
4270
4290
|
return renderSearchContent(newQuery);
|
|
4271
4291
|
},
|
|
4272
4292
|
}, editable: {
|
|
4273
|
-
active: ((
|
|
4293
|
+
active: ((_w = props.edit) === null || _w === void 0 ? void 0 : _w.listEditable) && !props.edit.disabledUpdate
|
|
4274
4294
|
? true
|
|
4275
4295
|
: false,
|
|
4276
4296
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -4284,7 +4304,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4284
4304
|
});
|
|
4285
4305
|
}); },
|
|
4286
4306
|
}, addable: {
|
|
4287
|
-
active: ((
|
|
4307
|
+
active: ((_x = props.edit) === null || _x === void 0 ? void 0 : _x.listAddable) ? true : false,
|
|
4288
4308
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4289
4309
|
return __generator(this, function (_a) {
|
|
4290
4310
|
switch (_a.label) {
|
|
@@ -4295,7 +4315,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4295
4315
|
}
|
|
4296
4316
|
});
|
|
4297
4317
|
}); },
|
|
4298
|
-
}, darkMode: (
|
|
4318
|
+
}, darkMode: (_y = props.organise) === null || _y === void 0 ? void 0 : _y.darkMode, hidePagination: true })));
|
|
4299
4319
|
});
|
|
4300
4320
|
}
|
|
4301
4321
|
}
|
|
@@ -4338,7 +4358,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4338
4358
|
sortOptions: (_r = (_q = props.organise) === null || _q === void 0 ? void 0 : _q.renderReferenceLabelOptions) === null || _r === void 0 ? void 0 : _r.call(_q),
|
|
4339
4359
|
onSortColumn: (_s = props.organise) === null || _s === void 0 ? void 0 : _s.onChangeSort,
|
|
4340
4360
|
onDragColumn: (_t = props.organise) === null || _t === void 0 ? void 0 : _t.onChangeDrag,
|
|
4341
|
-
filterOptions:
|
|
4361
|
+
filterOptions: additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.map(function (eachQuery) {
|
|
4342
4362
|
var _a;
|
|
4343
4363
|
return {
|
|
4344
4364
|
key: eachQuery.value,
|
|
@@ -4346,16 +4366,15 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4346
4366
|
};
|
|
4347
4367
|
}),
|
|
4348
4368
|
renderFilterElements: function (id) {
|
|
4349
|
-
var
|
|
4350
|
-
var selectedQuery = (_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.additionalQuery) === null || _b === void 0 ? void 0 : _b.filter(function (eachQuery) {
|
|
4369
|
+
var selectedQuery = additionalQuery === null || additionalQuery === void 0 ? void 0 : additionalQuery.filter(function (eachQuery) {
|
|
4351
4370
|
return eachQuery.value === id;
|
|
4352
4371
|
});
|
|
4353
|
-
var selectedModelList =
|
|
4372
|
+
var selectedModelList = structure.filter(function (eachModel) { return eachModel.id === id; });
|
|
4354
4373
|
var newQuery = (0, listModule_1.renderSearchAdditionalQueries)(selectedModelList, selectedQuery);
|
|
4355
4374
|
return renderSearchContent(newQuery);
|
|
4356
4375
|
},
|
|
4357
4376
|
}, editable: {
|
|
4358
|
-
active: ((
|
|
4377
|
+
active: ((_u = props.edit) === null || _u === void 0 ? void 0 : _u.listEditable) && !props.edit.disabledUpdate
|
|
4359
4378
|
? true
|
|
4360
4379
|
: false,
|
|
4361
4380
|
onUpdateData: function (rowId, columnId, data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
@@ -4369,7 +4388,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4369
4388
|
});
|
|
4370
4389
|
}); },
|
|
4371
4390
|
}, addable: {
|
|
4372
|
-
active: ((
|
|
4391
|
+
active: ((_v = props.edit) === null || _v === void 0 ? void 0 : _v.listAddable) ? true : false,
|
|
4373
4392
|
onAddData: function (data) { return __awaiter(void 0, void 0, void 0, function () {
|
|
4374
4393
|
return __generator(this, function (_a) {
|
|
4375
4394
|
switch (_a.label) {
|
|
@@ -4380,7 +4399,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4380
4399
|
}
|
|
4381
4400
|
});
|
|
4382
4401
|
}); },
|
|
4383
|
-
}, darkMode: (
|
|
4402
|
+
}, darkMode: (_w = props.organise) === null || _w === void 0 ? void 0 : _w.darkMode, hidePagination: (_x = props.organise) === null || _x === void 0 ? void 0 : _x.hidePagination }));
|
|
4384
4403
|
}
|
|
4385
4404
|
};
|
|
4386
4405
|
var renderTabContent = function (tabs, dataType, viewType) {
|
|
@@ -4394,13 +4413,13 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4394
4413
|
}
|
|
4395
4414
|
});
|
|
4396
4415
|
var multipleSelect = isEditor && !((_a = props.organise) === null || _a === void 0 ? void 0 : _a.disableMulti) ? true : false;
|
|
4397
|
-
if (viewType === "general") {
|
|
4416
|
+
if (viewType === "general" || (selectedTabData === null || selectedTabData === void 0 ? void 0 : selectedTabData.viewType) === "report") {
|
|
4398
4417
|
if (dataType === "list") {
|
|
4399
4418
|
return react_1.default.createElement(react_1.default.Fragment, null, renderGroupTable(multipleSelect));
|
|
4400
4419
|
}
|
|
4401
4420
|
else if (dataType === "read") {
|
|
4402
4421
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
4403
|
-
react_1.default.createElement(detailList_1.DetailList, { model:
|
|
4422
|
+
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)
|
|
4404
4423
|
? props.bareSettings.bareReadReferenceView
|
|
4405
4424
|
: undefined, splitView: (_c = props.organise) === null || _c === void 0 ? void 0 : _c.splitView }),
|
|
4406
4425
|
react_1.default.createElement("div", { className: "mt-8" }, renderListAddress(dataType)),
|
|
@@ -4707,7 +4726,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4707
4726
|
var nullColumn_1 = false;
|
|
4708
4727
|
var groupBy_1 = [];
|
|
4709
4728
|
var groupLabel_1 = [];
|
|
4710
|
-
|
|
4729
|
+
structure.map(function (eachModel) {
|
|
4711
4730
|
var _a, _b, _c;
|
|
4712
4731
|
if (kanbanTitle_2 === eachModel.id) {
|
|
4713
4732
|
if (eachModel.type === "list") {
|
|
@@ -4745,155 +4764,6 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4745
4764
|
(_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.handleNavigate) === null || _b === void 0 ? void 0 : _b.call(_a, "read", id, "general");
|
|
4746
4765
|
} }));
|
|
4747
4766
|
}
|
|
4748
|
-
// else if (selectedTabData.viewType === "report") {
|
|
4749
|
-
// return (
|
|
4750
|
-
// <Table
|
|
4751
|
-
// showId={showId}
|
|
4752
|
-
// paginationType={isFirebase ? "cursor" : "page"}
|
|
4753
|
-
// data={tableData}
|
|
4754
|
-
// spaceData={spaceTableData}
|
|
4755
|
-
// size={size}
|
|
4756
|
-
// limit={limit}
|
|
4757
|
-
// cursor={cursor}
|
|
4758
|
-
// loading={tableLoading}
|
|
4759
|
-
// checkbox={multipleSelect}
|
|
4760
|
-
// selectAll={selectAll}
|
|
4761
|
-
// selectedIds={selectedIds}
|
|
4762
|
-
// selectAllText={selectAll ? "from filter" : ""}
|
|
4763
|
-
// multiActionButton={
|
|
4764
|
-
// <div className="flex flex-row space-x-3">
|
|
4765
|
-
// {selectedIds.length > 0 &&
|
|
4766
|
-
// !props.edit?.disabledUpdate &&
|
|
4767
|
-
// !props.bareSettings?.bareHideTableExtraMultipleAction && (
|
|
4768
|
-
// <>
|
|
4769
|
-
// <TextButton
|
|
4770
|
-
// className="text-sm"
|
|
4771
|
-
// text="Change to Draft"
|
|
4772
|
-
// disable={loading}
|
|
4773
|
-
// onClick={() => {
|
|
4774
|
-
// handleBatchDraftData();
|
|
4775
|
-
// }}
|
|
4776
|
-
// />
|
|
4777
|
-
// <TextButton
|
|
4778
|
-
// className="text-sm"
|
|
4779
|
-
// text="Clone Items"
|
|
4780
|
-
// disable={loading}
|
|
4781
|
-
// onClick={() => {
|
|
4782
|
-
// handleCloneSelectedData();
|
|
4783
|
-
// }}
|
|
4784
|
-
// />
|
|
4785
|
-
// </>
|
|
4786
|
-
// )}
|
|
4787
|
-
// {props.edit?.deleteBtn && (
|
|
4788
|
-
// <TextButton
|
|
4789
|
-
// className="text-sm text-red-500 hover:text-red-600"
|
|
4790
|
-
// text="Delete"
|
|
4791
|
-
// onClick={() => {
|
|
4792
|
-
// handleGenerateDeletePasscode();
|
|
4793
|
-
// setDeleteModal(true);
|
|
4794
|
-
// }}
|
|
4795
|
-
// />
|
|
4796
|
-
// )}
|
|
4797
|
-
// {!isFirebase && !props.edit?.disableBatchUpdate && (
|
|
4798
|
-
// <TextButton
|
|
4799
|
-
// className="text-sm"
|
|
4800
|
-
// text="Update"
|
|
4801
|
-
// onClick={() => {
|
|
4802
|
-
// setBatchUpdateModal(true);
|
|
4803
|
-
// }}
|
|
4804
|
-
// />
|
|
4805
|
-
// )}
|
|
4806
|
-
// {props.bareSettings?.bareListMultipleSelectAddtionalActions &&
|
|
4807
|
-
// props.bareSettings?.bareListMultipleSelectAddtionalActions?.map(
|
|
4808
|
-
// (eachButton) => {
|
|
4809
|
-
// return (
|
|
4810
|
-
// <TextButton
|
|
4811
|
-
// className={`text-sm ${eachButton.className}`}
|
|
4812
|
-
// text={eachButton.text}
|
|
4813
|
-
// onClick={() => {
|
|
4814
|
-
// eachButton.onClick?.(
|
|
4815
|
-
// selectedIds,
|
|
4816
|
-
// selectAll,
|
|
4817
|
-
// renderImpSearchFilterConditions() ?? []
|
|
4818
|
-
// );
|
|
4819
|
-
// }}
|
|
4820
|
-
// />
|
|
4821
|
-
// );
|
|
4822
|
-
// }
|
|
4823
|
-
// )}
|
|
4824
|
-
// </div>
|
|
4825
|
-
// }
|
|
4826
|
-
// handleSelectAll={handleSelectAllPages}
|
|
4827
|
-
// handleSelectedIds={handleSelectIds}
|
|
4828
|
-
// header={renderTableHeader()}
|
|
4829
|
-
// pageIndex={pageIndex}
|
|
4830
|
-
// onClickRow={(id: string) => {
|
|
4831
|
-
// props.organise?.handleNavigate?.("read", id, "general");
|
|
4832
|
-
// }}
|
|
4833
|
-
// linkType={props.linkType}
|
|
4834
|
-
// custom={props.custom}
|
|
4835
|
-
// newTabUrl={`${props.localURLEndpoint}?data=`}
|
|
4836
|
-
// addNewTabUrl={`&type=read&collection=${props.collectionId}&view=general`}
|
|
4837
|
-
// handleUpdatePageIndex={handlePagination}
|
|
4838
|
-
// className="mt-5"
|
|
4839
|
-
// lib={{ axios: props.lib?.axios }}
|
|
4840
|
-
// devSettings={props.devSettings}
|
|
4841
|
-
// bareSettings={props.bareSettings}
|
|
4842
|
-
// fixedPagination={props.organise?.fixedPagination}
|
|
4843
|
-
// advSettings={{
|
|
4844
|
-
// addColumnEnabled: true,
|
|
4845
|
-
// renderAddColumnElements: renderAddMathColumn,
|
|
4846
|
-
// dragEnabled: props.organise?.advDragEnabled,
|
|
4847
|
-
// sortEnabled: props.organise?.advSortEnabled,
|
|
4848
|
-
// filterEnabled: props.organise?.advFilterEnabled,
|
|
4849
|
-
// sortId: props.organise?.sort,
|
|
4850
|
-
// sortOptions: props.organise?.renderReferenceLabelOptions?.(),
|
|
4851
|
-
// onSortColumn: props.organise?.onChangeSort,
|
|
4852
|
-
// onDragColumn: props.organise?.onChangeDrag,
|
|
4853
|
-
// filterOptions: props.organise?.additionalQuery?.map(
|
|
4854
|
-
// (eachQuery) => {
|
|
4855
|
-
// return {
|
|
4856
|
-
// key: eachQuery.value,
|
|
4857
|
-
// label: eachQuery.label ?? "",
|
|
4858
|
-
// };
|
|
4859
|
-
// }
|
|
4860
|
-
// ),
|
|
4861
|
-
// renderFilterElements: (id: string) => {
|
|
4862
|
-
// const selectedQuery = props.organise?.additionalQuery?.filter(
|
|
4863
|
-
// (eachQuery) => {
|
|
4864
|
-
// return eachQuery.value === id;
|
|
4865
|
-
// }
|
|
4866
|
-
// );
|
|
4867
|
-
// const selectedModelList = props.model.filter(
|
|
4868
|
-
// (eachModel) => eachModel.id === id
|
|
4869
|
-
// );
|
|
4870
|
-
// const newQuery = renderSearchAdditionalQueries(
|
|
4871
|
-
// selectedModelList,
|
|
4872
|
-
// selectedQuery
|
|
4873
|
-
// );
|
|
4874
|
-
// return renderSearchContent(newQuery);
|
|
4875
|
-
// },
|
|
4876
|
-
// }}
|
|
4877
|
-
// editable={{
|
|
4878
|
-
// active:
|
|
4879
|
-
// props.edit?.listEditable && !props.edit.disabledUpdate
|
|
4880
|
-
// ? true
|
|
4881
|
-
// : false,
|
|
4882
|
-
// onUpdateData: async (rowId, columnId, data) => {
|
|
4883
|
-
// await handleSubmitData("update", rowId, columnId, data);
|
|
4884
|
-
// },
|
|
4885
|
-
// }}
|
|
4886
|
-
// addable={{
|
|
4887
|
-
// active: props.edit?.listAddable ? true : false,
|
|
4888
|
-
// onAddData: async (data) => {
|
|
4889
|
-
// await handleSubmitData("create", "", "", data);
|
|
4890
|
-
// },
|
|
4891
|
-
// }}
|
|
4892
|
-
// darkMode={props.organise?.darkMode}
|
|
4893
|
-
// hidePagination={props.organise?.hidePagination}
|
|
4894
|
-
// />
|
|
4895
|
-
// );
|
|
4896
|
-
// }
|
|
4897
4767
|
else if (selectedTabData.renderComp) {
|
|
4898
4768
|
return react_1.default.createElement(react_1.default.Fragment, null, selectedTabData.renderComp());
|
|
4899
4769
|
}
|
|
@@ -4923,7 +4793,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4923
4793
|
return null;
|
|
4924
4794
|
};
|
|
4925
4795
|
var renderModalContent = function () {
|
|
4926
|
-
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
|
|
4796
|
+
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;
|
|
4927
4797
|
if (loading) {
|
|
4928
4798
|
return (react_1.default.createElement("div", { className: "mt-5" },
|
|
4929
4799
|
react_1.default.createElement(loading_1.Loading, null),
|
|
@@ -4957,7 +4827,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
4957
4827
|
}
|
|
4958
4828
|
else if (exportExcel || exportQR) {
|
|
4959
4829
|
var showEmail = exportType !== "pdf" && !((_b = (_a = props.organise) === null || _a === void 0 ? void 0 : _a.exportSettings) === null || _b === void 0 ? void 0 : _b.disableEmail);
|
|
4960
|
-
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:
|
|
4830
|
+
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 () {
|
|
4961
4831
|
handleViewQuery(-1);
|
|
4962
4832
|
}, handleQueryOnComplete: function (queryData) {
|
|
4963
4833
|
handlePushQueryList(queryData, queryIndex);
|
|
@@ -5007,17 +4877,17 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5007
4877
|
} }));
|
|
5008
4878
|
}
|
|
5009
4879
|
else if (overviewModal) {
|
|
5010
|
-
return (react_1.default.createElement(settingsModal_1.OverviewModal, { model:
|
|
4880
|
+
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 () {
|
|
5011
4881
|
handlePopUpModal(false);
|
|
5012
4882
|
} }));
|
|
5013
4883
|
}
|
|
5014
4884
|
else if (filterModal) {
|
|
5015
|
-
return (react_1.default.createElement(settingsModal_1.FilterModal, { server: props.devSettings.server, filter:
|
|
4885
|
+
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 () {
|
|
5016
4886
|
handlePopUpModal(false);
|
|
5017
4887
|
} }));
|
|
5018
4888
|
}
|
|
5019
4889
|
else if (addTabModal) {
|
|
5020
|
-
return (react_1.default.createElement(settingsModal_1.TabModal, { type: props.type, tabs: (
|
|
4890
|
+
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 () {
|
|
5021
4891
|
handlePopUpModal(false);
|
|
5022
4892
|
} }));
|
|
5023
4893
|
}
|
|
@@ -5037,7 +4907,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5037
4907
|
else if (selectedListAddressId) {
|
|
5038
4908
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5039
4909
|
react_1.default.createElement(form_1.Form, { className: "grid grid-cols-1 gap-6 pb-20 mt-6", ref: listAddressFromRef, refList: [listAddressInputRef], handleComplete: function () {
|
|
5040
|
-
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData,
|
|
4910
|
+
var clonedSelectedData = (0, updateModule_1.handleClonedDataAttribute)(selectedData, structure, props.devSettings.server);
|
|
5041
4911
|
var listAddressValue = clonedSelectedData[selectedListAddressId];
|
|
5042
4912
|
if (listAddressValue)
|
|
5043
4913
|
clonedSelectedData[selectedListAddressId] = __spreadArray(__spreadArray([], listAddressValue, true), [
|
|
@@ -5074,7 +4944,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5074
4944
|
}); } }))));
|
|
5075
4945
|
}
|
|
5076
4946
|
else {
|
|
5077
|
-
var filterObjectModel =
|
|
4947
|
+
var filterObjectModel = structure.find(function (eachModel) {
|
|
5078
4948
|
return eachModel.id === selectedObjectStructureId;
|
|
5079
4949
|
});
|
|
5080
4950
|
if (filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.objectData) {
|
|
@@ -5087,16 +4957,16 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5087
4957
|
disabledOnEnter_2 = true;
|
|
5088
4958
|
return null;
|
|
5089
4959
|
});
|
|
5090
|
-
if ((
|
|
4960
|
+
if ((_z = props.bareSettings) === null || _z === void 0 ? void 0 : _z.bareListObjectHandleData) {
|
|
5091
4961
|
var listObjectViewType = props.type === "read"
|
|
5092
4962
|
? "read"
|
|
5093
4963
|
: selectedObjectId
|
|
5094
4964
|
? "update"
|
|
5095
4965
|
: "new";
|
|
5096
|
-
(
|
|
4966
|
+
(_1 = (_0 = props.bareSettings) === null || _0 === void 0 ? void 0 : _0.bareListObjectHandleData) === null || _1 === void 0 ? void 0 : _1.call(_0, listObjectViewType, selectedObjectData);
|
|
5097
4967
|
}
|
|
5098
4968
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5099
|
-
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, (
|
|
4969
|
+
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"
|
|
5100
4970
|
? selectedData
|
|
5101
4971
|
: undefined)),
|
|
5102
4972
|
react_1.default.createElement("div", { className: "flex justify-end pt-8" },
|
|
@@ -5202,7 +5072,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5202
5072
|
var renderBatchUpdateModalContent = function () {
|
|
5203
5073
|
var _a;
|
|
5204
5074
|
if (batchUpdateModal) {
|
|
5205
|
-
var columnIdOptions =
|
|
5075
|
+
var columnIdOptions = structure
|
|
5206
5076
|
.filter(function (eachModel) {
|
|
5207
5077
|
return eachModel.id !== "id" &&
|
|
5208
5078
|
!eachModel.unique &&
|
|
@@ -5216,7 +5086,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5216
5086
|
disabled: true,
|
|
5217
5087
|
type: "string",
|
|
5218
5088
|
};
|
|
5219
|
-
var modelFound =
|
|
5089
|
+
var modelFound = structure.find(function (eachModel) { return eachModel.id === batchUpdateData.columnId; });
|
|
5220
5090
|
var model = modelFound !== null && modelFound !== void 0 ? modelFound : defaultModel;
|
|
5221
5091
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5222
5092
|
react_1.default.createElement(form_1.Form, { ref: batchUpdateFormRef, refList: [batchUpdateColumnIdRef, batchUpdateInputRef], handleComplete: handleBatchUpdateData },
|
|
@@ -5224,7 +5094,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5224
5094
|
var _a;
|
|
5225
5095
|
var _b;
|
|
5226
5096
|
var columnDataValue = undefined;
|
|
5227
|
-
var selectedModel =
|
|
5097
|
+
var selectedModel = structure.find(function (eachAttribute) { return eachAttribute.id === value; });
|
|
5228
5098
|
if (selectedModel) {
|
|
5229
5099
|
if (selectedModel.type === "list") {
|
|
5230
5100
|
var isOptional = (_b = selectedModel.optional) !== null && _b !== void 0 ? _b : false;
|
|
@@ -5310,7 +5180,7 @@ exports.DataTemplate = (0, react_1.forwardRef)(function (props, ref) {
|
|
|
5310
5180
|
};
|
|
5311
5181
|
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
5312
5182
|
renderNotification("root"),
|
|
5313
|
-
((
|
|
5183
|
+
((_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 () {
|
|
5314
5184
|
var _a, _b;
|
|
5315
5185
|
if (loading)
|
|
5316
5186
|
return;
|