blixify-ui-web 0.2.40 → 0.2.42
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/README.md +3 -3
- package/lib/components/data/dataGraph/index.d.ts.map +1 -1
- package/lib/components/data/dataGraph/index.js +12 -5
- package/lib/components/data/dataGraph/index.js.map +1 -1
- package/lib/components/data/dataReference/index.d.ts +0 -1
- package/lib/components/data/dataReference/index.d.ts.map +1 -1
- package/lib/components/data/dataReference/index.js +15 -10
- package/lib/components/data/dataReference/index.js.map +1 -1
- package/lib/components/data/dataTemplate/index.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/index.js +103 -129
- package/lib/components/data/dataTemplate/index.js.map +1 -1
- package/lib/components/data/dataTemplate/model.d.ts +3 -1
- package/lib/components/data/dataTemplate/model.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.d.ts +2 -2
- package/lib/components/data/dataTemplate/settingsModal.d.ts.map +1 -1
- package/lib/components/data/dataTemplate/settingsModal.js +3 -4
- package/lib/components/data/dataTemplate/settingsModal.js.map +1 -1
- package/lib/components/data/dataTemplate/workspaceModel.d.ts +2 -1
- package/lib/components/data/dataTemplate/workspaceModel.d.ts.map +1 -1
- package/lib/components/data/dataWrapper/index.d.ts.map +1 -1
- package/lib/components/data/dataWrapper/index.js +7 -14
- package/lib/components/data/dataWrapper/index.js.map +1 -1
- package/lib/components/data/listModule.d.ts +2 -2
- package/lib/components/data/listModule.d.ts.map +1 -1
- package/lib/components/data/listModule.js +176 -17
- package/lib/components/data/listModule.js.map +1 -1
- package/lib/components/data/queryForm/index.d.ts +1 -1
- package/lib/components/data/queryForm/index.d.ts.map +1 -1
- package/lib/components/data/queryForm/index.js +3 -2
- package/lib/components/data/queryForm/index.js.map +1 -1
- package/lib/components/data/readModule.d.ts +2 -1
- package/lib/components/data/readModule.d.ts.map +1 -1
- package/lib/components/data/readModule.js +37 -13
- package/lib/components/data/readModule.js.map +1 -1
- package/lib/components/data/readQuery/index.d.ts +2 -1
- package/lib/components/data/readQuery/index.d.ts.map +1 -1
- package/lib/components/data/readQuery/index.js +5 -6
- package/lib/components/data/readQuery/index.js.map +1 -1
- package/lib/components/data/readQueryHoc/index.d.ts.map +1 -1
- package/lib/components/data/readQueryHoc/index.js +5 -6
- package/lib/components/data/readQueryHoc/index.js.map +1 -1
- package/lib/components/data/stories.d.ts +4 -13
- package/lib/components/data/stories.d.ts.map +1 -1
- package/lib/components/data/stories.js +6 -114
- package/lib/components/data/stories.js.map +1 -1
- package/lib/components/data/updateModule.d.ts +6 -9
- package/lib/components/data/updateModule.d.ts.map +1 -1
- package/lib/components/data/updateModule.js +59 -56
- package/lib/components/data/updateModule.js.map +1 -1
- package/lib/components/data/utils.d.ts +11 -3
- package/lib/components/data/utils.d.ts.map +1 -1
- package/lib/components/data/utils.js +121 -207
- package/lib/components/data/utils.js.map +1 -1
- package/lib/components/data/writeQuery/index.d.ts.map +1 -1
- package/lib/components/data/writeQuery/index.js +5 -6
- package/lib/components/data/writeQuery/index.js.map +1 -1
- package/lib/components/display/detailList/index.d.ts.map +1 -1
- package/lib/components/display/detailList/index.js +2 -3
- package/lib/components/display/detailList/index.js.map +1 -1
- package/lib/components/display/table/index.d.ts.map +1 -1
- package/lib/components/display/table/index.js +12 -18
- package/lib/components/display/table/index.js.map +1 -1
- package/lib/components/index.d.ts +3 -4
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +8 -11
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/address/index.js +1 -1
- package/lib/components/input/address/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -39,12 +39,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
40
|
};
|
|
41
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.storyRenderReferenceSpaceOptions = exports.storyRenderReferenceLabelOptions = exports.
|
|
42
|
+
exports.storyRenderReferenceSpaceOptions = exports.storyRenderReferenceLabelOptions = exports.getWorkspaceData = exports.getAllSpacesList = exports.getSpaceData = exports.defaultUploadEndpoint = exports.defaultImageEndpoint = exports.defaultDBEndpoint = exports.storageUrl = exports.schemaUrl = exports.baseAPI = void 0;
|
|
43
43
|
var axios_1 = __importDefault(require("axios"));
|
|
44
44
|
var readQuery_1 = require("./readQuery");
|
|
45
45
|
exports.baseAPI = "http://localhost:3000";
|
|
46
46
|
exports.schemaUrl = "".concat(exports.baseAPI, "/api/data");
|
|
47
47
|
exports.storageUrl = "https://firebasestorage.googleapis.com/v0/b/";
|
|
48
|
+
exports.defaultDBEndpoint = "".concat(exports.baseAPI, "/api/spaceD");
|
|
49
|
+
exports.defaultImageEndpoint = "".concat(exports.storageUrl, "blixify-space-dev.appspot.com/o/");
|
|
50
|
+
exports.defaultUploadEndpoint = "".concat(exports.baseAPI, "/api/asset");
|
|
48
51
|
var getSpaceData = function (spaceId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
49
52
|
var spaceReadQuery, res, err_1;
|
|
50
53
|
return __generator(this, function (_a) {
|
|
@@ -76,7 +79,7 @@ var getSpaceData = function (spaceId) { return __awaiter(void 0, void 0, void 0,
|
|
|
76
79
|
});
|
|
77
80
|
}); };
|
|
78
81
|
exports.getSpaceData = getSpaceData;
|
|
79
|
-
var getAllSpacesList = function (workspaceId
|
|
82
|
+
var getAllSpacesList = function (workspaceId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
80
83
|
var spaceReadQuery, res, err_2;
|
|
81
84
|
return __generator(this, function (_a) {
|
|
82
85
|
switch (_a.label) {
|
|
@@ -86,7 +89,7 @@ var getAllSpacesList = function (workspaceId, schemaEndpoint) { return __awaiter
|
|
|
86
89
|
dbModule: axios_1.default,
|
|
87
90
|
dbType: "mongoServer",
|
|
88
91
|
dbCollection: "spaces",
|
|
89
|
-
dbEndpoint:
|
|
92
|
+
dbEndpoint: "".concat(exports.baseAPI, "/api/data"),
|
|
90
93
|
});
|
|
91
94
|
return [4 /*yield*/, spaceReadQuery.call({
|
|
92
95
|
query: [
|
|
@@ -144,117 +147,6 @@ var getWorkspaceData = function (workspaceId) { return __awaiter(void 0, void 0,
|
|
|
144
147
|
});
|
|
145
148
|
}); };
|
|
146
149
|
exports.getWorkspaceData = getWorkspaceData;
|
|
147
|
-
var parseWorkspaceSettings = function (workspaceData) {
|
|
148
|
-
var defaultAPIUrl = "".concat(exports.baseAPI, "/api/spaceD");
|
|
149
|
-
var defaultServer = "mongoServer";
|
|
150
|
-
var defaultAssetAPI = "".concat(exports.storageUrl, "blixify-space-dev.appspot.com/o/");
|
|
151
|
-
var defaultDBAPIToken = "";
|
|
152
|
-
var defaultDBUserToken = "";
|
|
153
|
-
var defaultBucketName = "";
|
|
154
|
-
var defaultAssetUploadEndpoint = "".concat(exports.baseAPI, "/api/asset");
|
|
155
|
-
if (workspaceData) {
|
|
156
|
-
if (workspaceData.apiEndpoint)
|
|
157
|
-
defaultAPIUrl = workspaceData.apiEndpoint;
|
|
158
|
-
if (workspaceData.apiEndpointType === "firebase")
|
|
159
|
-
defaultServer = "fbServer";
|
|
160
|
-
if (workspaceData.apiEndpointToken)
|
|
161
|
-
defaultDBAPIToken = workspaceData.apiEndpointToken;
|
|
162
|
-
if (workspaceData.apiUserToken)
|
|
163
|
-
defaultDBUserToken = workspaceData.apiUserToken;
|
|
164
|
-
if (workspaceData.assetEndpoint)
|
|
165
|
-
defaultAssetAPI = workspaceData.assetEndpoint;
|
|
166
|
-
if (workspaceData.assetBucket) {
|
|
167
|
-
if (workspaceData.assetType === "aws")
|
|
168
|
-
defaultBucketName = workspaceData.assetBucket;
|
|
169
|
-
}
|
|
170
|
-
if (workspaceData.assetUploadEndpoint)
|
|
171
|
-
defaultAssetUploadEndpoint = workspaceData.assetUploadEndpoint;
|
|
172
|
-
}
|
|
173
|
-
return {
|
|
174
|
-
defaultAPIUrl: defaultAPIUrl,
|
|
175
|
-
defaultDBAPIToken: defaultDBAPIToken,
|
|
176
|
-
defaultDBUserToken: defaultDBUserToken,
|
|
177
|
-
defaultServer: defaultServer,
|
|
178
|
-
defaultAssetAPI: defaultAssetAPI,
|
|
179
|
-
defaultAssetUploadEndpoint: defaultAssetUploadEndpoint,
|
|
180
|
-
defaultBucketName: defaultBucketName,
|
|
181
|
-
};
|
|
182
|
-
};
|
|
183
|
-
exports.parseWorkspaceSettings = parseWorkspaceSettings;
|
|
184
|
-
var renderDataStructureList = function (selectedSpace) {
|
|
185
|
-
var _a, _b, _c;
|
|
186
|
-
var schema = [
|
|
187
|
-
{
|
|
188
|
-
id: "id",
|
|
189
|
-
name: "Id",
|
|
190
|
-
type: "string",
|
|
191
|
-
unique: (_a = selectedSpace === null || selectedSpace === void 0 ? void 0 : selectedSpace.showId) !== null && _a !== void 0 ? _a : false,
|
|
192
|
-
disabled: (_b = selectedSpace === null || selectedSpace === void 0 ? void 0 : selectedSpace.showId) !== null && _b !== void 0 ? _b : false,
|
|
193
|
-
},
|
|
194
|
-
];
|
|
195
|
-
if (selectedSpace) {
|
|
196
|
-
(_c = selectedSpace.structure) === null || _c === void 0 ? void 0 : _c.map(function (eachStructure) {
|
|
197
|
-
var dataSchema = {
|
|
198
|
-
id: eachStructure.id,
|
|
199
|
-
name: eachStructure.name,
|
|
200
|
-
type: eachStructure.type,
|
|
201
|
-
unique: eachStructure.unique,
|
|
202
|
-
hide: eachStructure.hide,
|
|
203
|
-
optional: eachStructure.optional,
|
|
204
|
-
disabled: eachStructure.disabled,
|
|
205
|
-
hideRead: eachStructure.hideRead,
|
|
206
|
-
hideForm: eachStructure.hideForm,
|
|
207
|
-
placeholder: eachStructure.placeholder,
|
|
208
|
-
groupId: eachStructure.groupId,
|
|
209
|
-
};
|
|
210
|
-
switch (eachStructure.type) {
|
|
211
|
-
case "date":
|
|
212
|
-
dataSchema["hideShowTime"] = eachStructure.hideShowTime;
|
|
213
|
-
break;
|
|
214
|
-
case "image":
|
|
215
|
-
case "file":
|
|
216
|
-
case "multipleImage":
|
|
217
|
-
case "multipleFile":
|
|
218
|
-
dataSchema["imageFileName"] = eachStructure.imageFileName;
|
|
219
|
-
dataSchema["imageCollectionName"] = eachStructure.imageCollectionName;
|
|
220
|
-
dataSchema["uploadEndpoint"] = eachStructure.uploadEndpoint;
|
|
221
|
-
dataSchema["fileExtension"] = eachStructure.fileExtension;
|
|
222
|
-
dataSchema["fileDescription"] = eachStructure.fileDescription;
|
|
223
|
-
dataSchema["imageInputCapture"] = eachStructure.imageInputCapture;
|
|
224
|
-
break;
|
|
225
|
-
case "list":
|
|
226
|
-
case "multipleList":
|
|
227
|
-
dataSchema["listSelection"] = eachStructure.listSelection;
|
|
228
|
-
dataSchema["listSelectionLabel"] = eachStructure.listSelectionLabel;
|
|
229
|
-
dataSchema["listNewValue"] = eachStructure.listNewValue;
|
|
230
|
-
dataSchema["disabledAutoSelect"] = eachStructure.disabledAutoSelect;
|
|
231
|
-
dataSchema["disabledKeyboardSearch"] =
|
|
232
|
-
eachStructure.disabledKeyboardSearch;
|
|
233
|
-
break;
|
|
234
|
-
case "listReference":
|
|
235
|
-
case "reference":
|
|
236
|
-
dataSchema["referenceSpaceId"] = eachStructure.referenceSpaceId;
|
|
237
|
-
dataSchema["referenceLabel"] = eachStructure.referenceLabel;
|
|
238
|
-
dataSchema["referenceQuery"] = eachStructure.referenceQuery;
|
|
239
|
-
dataSchema["disabledKeyboardSearch"] =
|
|
240
|
-
eachStructure.disabledKeyboardSearch;
|
|
241
|
-
break;
|
|
242
|
-
case "boolean":
|
|
243
|
-
dataSchema["disabledKeyboardSearch"] =
|
|
244
|
-
eachStructure.disabledKeyboardSearch;
|
|
245
|
-
break;
|
|
246
|
-
case "listObject":
|
|
247
|
-
case "object":
|
|
248
|
-
dataSchema["objectData"] = eachStructure.objectData;
|
|
249
|
-
break;
|
|
250
|
-
}
|
|
251
|
-
schema.push(dataSchema);
|
|
252
|
-
return null;
|
|
253
|
-
});
|
|
254
|
-
}
|
|
255
|
-
return schema;
|
|
256
|
-
};
|
|
257
|
-
exports.renderDataStructureList = renderDataStructureList;
|
|
258
150
|
var storyRenderReferenceLabelOptions = function (allWorkspaceSpace, selectedSpace) {
|
|
259
151
|
var renderReferenceLabelOptions = function (spaceId, includeReference, type) {
|
|
260
152
|
var _a;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/data/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;
|
|
1
|
+
{"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/data/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAI1B,yCAAwC;AAE3B,QAAA,OAAO,GAAG,uBAAuB,CAAC;AAClC,QAAA,SAAS,GAAG,UAAG,eAAO,cAAW,CAAC;AAClC,QAAA,UAAU,GAAG,8CAA8C,CAAC;AAE5D,QAAA,iBAAiB,GAAG,UAAG,eAAO,gBAAa,CAAC;AAC5C,QAAA,oBAAoB,GAAG,UAAG,kBAAU,qCAAkC,CAAC;AACvE,QAAA,qBAAqB,GAAG,UAAG,eAAO,eAAY,CAAC;AAErD,IAAM,YAAY,GAAG,UAAO,OAAe;;;;;;gBAExC,cAAc,GAAG,IAAI,qBAAS,CAAC;oBACnC,QAAQ,EAAE,eAAK;oBACf,MAAM,EAAE,aAAa;oBACrB,YAAY,EAAE,QAAQ;oBACtB,UAAU,EAAE,UAAG,eAAO,cAAW;iBAClC,CAAC,CAAC;gBACS,qBAAM,cAAc,CAAC,IAAI,CAAC;wBACpC,IAAI,EAAE,KAAK;wBACX,EAAE,EAAE,OAAO;qBACZ,CAAC,EAAA;;gBAHI,GAAG,GAAG,SAGV;gBACF,IAAI,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,IAAI;oBAAE,sBAAO,GAAG,CAAC,IAAI,EAAC;;oBAC1B,sB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ACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IACF,OAAO,2BAA2B,CAAC;AACrC,CAAC,CAAC;AArDW,QAAA,gCAAgC,oCAqD3C;AAEK,IAAM,gCAAgC,GAAG,UAC9C,iBAA0B,EAC1B,SAAiB;IAEjB,IAAM,2BAA2B,GAAG;QAClC,IAAI,OAAO,GAAa,EAAE,CAAC;QAC3B,IAAI,iBAAiB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACjC,iBAAiB,CAAC,GAAG,CAAC,UAAC,SAAS;gBAC9B,IAAI,SAAS,CAAC,GAAG,KAAK,SAAS,IAAI,SAAS,CAAC,IAAI,KAAK,WAAW,EAAE,CAAC;oBAClE,OAAO,CAAC,IAAI,CAAC;wBACX,GAAG,EAAE,SAAS,CAAC,GAAG;wBAClB,KAAK,EAAE,SAAS,CAAC,IAAI;qBACtB,CAAC,CAAC;gBACL,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC,CAAC,CAAC;QACL,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC,CAAC;IACF,OAAO,2BAA2B,CAAC;AACrC,CAAC,CAAC;AApBW,QAAA,gCAAgC,oCAoB3C"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { DataStructure } from "./dataTemplate/model";
|
|
3
|
-
export declare const handleCastDataAttribute: (model: DataStructure, value: any, clonedSelectedData: any, server:
|
|
4
|
-
export declare const handleClonedDataAttribute: (selectedData: any, model: DataStructure[], server:
|
|
5
|
-
export declare const handleRetrieveReferenceOptions: (selectedData: any, model: DataStructure[], dbModule: any,
|
|
6
|
-
export declare const handleRetrieveObjectReferenceOptions: (eachModel: DataStructure, referencesOptions: any, selectedData: any, dbModule: any,
|
|
2
|
+
import { DataStructure, DevSettings, ServerType } from "./dataTemplate/model";
|
|
3
|
+
export declare const handleCastDataAttribute: (model: DataStructure, value: any, clonedSelectedData: any, server: ServerType, force?: boolean) => void;
|
|
4
|
+
export declare const handleClonedDataAttribute: (selectedData: any, model: DataStructure[], server: ServerType, force?: boolean, isRemainId?: boolean) => any;
|
|
5
|
+
export declare const handleRetrieveReferenceOptions: (selectedData: any, model: DataStructure[], dbModule: any, devSettings: DevSettings, setReferencesOptions: (options: any) => void) => Promise<void>;
|
|
6
|
+
export declare const handleRetrieveObjectReferenceOptions: (eachModel: DataStructure, referencesOptions: any, selectedData: any, dbModule: any, devSettings?: DevSettings, prefix?: string, listObject?: boolean, searchText?: string) => Promise<any>;
|
|
7
7
|
export declare const handleParseOfflineWrite: (selectedData: any, model: DataStructure[]) => any;
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
@@ -31,10 +31,7 @@ export declare const renderDataTemplateForm: (data: any, model: DataStructure[],
|
|
|
31
31
|
showId?: boolean;
|
|
32
32
|
}, referenceProps?: {
|
|
33
33
|
dbModule: any;
|
|
34
|
-
|
|
35
|
-
dbEndpoint: string;
|
|
36
|
-
dbApiToken: string;
|
|
37
|
-
dbUserToken: string;
|
|
34
|
+
devSettings?: DevSettings;
|
|
38
35
|
referencesOptions: {};
|
|
39
36
|
referenceLoading: boolean;
|
|
40
37
|
setReferenceLoading: (value: boolean) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"updateModule.d.ts","sourceRoot":"","sources":["../../../src/components/data/updateModule.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"updateModule.d.ts","sourceRoot":"","sources":["../../../src/components/data/updateModule.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAqB9E,eAAO,MAAM,uBAAuB,UAC3B,aAAa,SACb,GAAG,mCAEF,UAAU,UACV,OAAO,SA6FhB,CA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AC,EAAE,MAAM,CAAC;CAC1B,gBACa;IACZ,gBAAgB,EAAE,MAAM,CAAC;IACzB,yBAAyB,EAAE,MAAM,CAAC;IAClC,4BAA4B,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,qBAAqB,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,IAAI,CAAC;IAC1C,gBAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC3C,gBAAgB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACxC,WACQ,OAAO,YACN,OAAO,cACL,OAAO,sBA0jBpB,CAAC"}
|
|
@@ -74,6 +74,7 @@ var uploadInput_1 = require("../input/uploadInput");
|
|
|
74
74
|
var blobModule_1 = require("./blobModule");
|
|
75
75
|
var indexedDb_1 = require("./dataTemplate/indexedDb");
|
|
76
76
|
var readQuery_1 = require("./readQuery");
|
|
77
|
+
var utils_1 = require("./utils");
|
|
77
78
|
var loadingSelect = (react_1.default.createElement("div", { className: "flex flex-row" },
|
|
78
79
|
react_1.default.createElement(loading_1.Loading, { sizeClassName: "h-5 w-5" }),
|
|
79
80
|
react_1.default.createElement("p", { className: "ml-1" }, "Loading...")));
|
|
@@ -211,8 +212,7 @@ var handleClonedDataAttribute = function (selectedData, model, server, force, is
|
|
|
211
212
|
return clonedSelectedData;
|
|
212
213
|
};
|
|
213
214
|
exports.handleClonedDataAttribute = handleClonedDataAttribute;
|
|
214
|
-
|
|
215
|
-
var handleRetrieveReferenceOptions = function (selectedData, model, dbModule, server, dbEndpoint, dbAPIToken, dbUserToken, setReferencesOptions) { return __awaiter(void 0, void 0, void 0, function () {
|
|
215
|
+
var handleRetrieveReferenceOptions = function (selectedData, model, dbModule, devSettings, setReferencesOptions) { return __awaiter(void 0, void 0, void 0, function () {
|
|
216
216
|
var options, err_1;
|
|
217
217
|
return __generator(this, function (_a) {
|
|
218
218
|
switch (_a.label) {
|
|
@@ -227,7 +227,7 @@ var handleRetrieveReferenceOptions = function (selectedData, model, dbModule, se
|
|
|
227
227
|
case 0:
|
|
228
228
|
if (!(eachModel.type === "reference" ||
|
|
229
229
|
eachModel.type === "listReference")) return [3 /*break*/, 2];
|
|
230
|
-
return [4 /*yield*/, (0, exports.handleRetrieveObjectReferenceOptions)(eachModel, options, selectedData, dbModule,
|
|
230
|
+
return [4 /*yield*/, (0, exports.handleRetrieveObjectReferenceOptions)(eachModel, options, selectedData, dbModule, devSettings)];
|
|
231
231
|
case 1:
|
|
232
232
|
_a.sent();
|
|
233
233
|
return [3 /*break*/, 4];
|
|
@@ -240,7 +240,7 @@ var handleRetrieveReferenceOptions = function (selectedData, model, dbModule, se
|
|
|
240
240
|
case 0:
|
|
241
241
|
if (!(eachObjectData.type === "reference" ||
|
|
242
242
|
eachObjectData.type === "listReference")) return [3 /*break*/, 2];
|
|
243
|
-
return [4 /*yield*/, (0, exports.handleRetrieveObjectReferenceOptions)(eachObjectData, options, selectedData, dbModule,
|
|
243
|
+
return [4 /*yield*/, (0, exports.handleRetrieveObjectReferenceOptions)(eachObjectData, options, selectedData, dbModule, devSettings, eachModel.id, eachModel.type === "listObject")];
|
|
244
244
|
case 1:
|
|
245
245
|
_a.sent();
|
|
246
246
|
_a.label = 2;
|
|
@@ -268,15 +268,19 @@ var handleRetrieveReferenceOptions = function (selectedData, model, dbModule, se
|
|
|
268
268
|
});
|
|
269
269
|
}); };
|
|
270
270
|
exports.handleRetrieveReferenceOptions = handleRetrieveReferenceOptions;
|
|
271
|
-
|
|
272
|
-
var
|
|
273
|
-
var serverId_1, optionList_1, referenceRQ_1, selectionRes, selectedDataValue_1, currentRes_1, unknownRes, queryValue, res, modelId, err_2;
|
|
271
|
+
var handleRetrieveObjectReferenceOptions = function (eachModel, referencesOptions, selectedData, dbModule, devSettings, prefix, listObject, searchText) { return __awaiter(void 0, void 0, void 0, function () {
|
|
272
|
+
var server, dbEndpoint, dbAPIToken, dbUserToken, serverId_1, optionList_1, referenceRQ_1, selectionRes, selectedDataValue_1, currentRes_1, unknownRes, queryValue, res, modelId, err_2;
|
|
274
273
|
var _a, _b, _c, _d;
|
|
275
274
|
return __generator(this, function (_e) {
|
|
276
275
|
switch (_e.label) {
|
|
277
276
|
case 0:
|
|
278
|
-
|
|
279
|
-
|
|
277
|
+
if (!devSettings)
|
|
278
|
+
return [2 /*return*/, referencesOptions];
|
|
279
|
+
server = devSettings.server, dbEndpoint = devSettings.dbEndpoint, dbAPIToken = devSettings.dbAPIToken, dbUserToken = devSettings.dbUserToken;
|
|
280
|
+
_e.label = 1;
|
|
281
|
+
case 1:
|
|
282
|
+
_e.trys.push([1, 7, , 8]);
|
|
283
|
+
serverId_1 = (0, utils_1.parseServerId)(server);
|
|
280
284
|
optionList_1 = [];
|
|
281
285
|
referenceRQ_1 = new readQuery_1.ReadQuery({
|
|
282
286
|
dbModule: dbModule,
|
|
@@ -298,7 +302,7 @@ var handleRetrieveObjectReferenceOptions = function (eachModel, referencesOption
|
|
|
298
302
|
}
|
|
299
303
|
], ((_c = eachModel === null || eachModel === void 0 ? void 0 : eachModel.referenceQuery) !== null && _c !== void 0 ? _c : []), true) : (_d = eachModel === null || eachModel === void 0 ? void 0 : eachModel.referenceQuery) !== null && _d !== void 0 ? _d : undefined,
|
|
300
304
|
})];
|
|
301
|
-
case
|
|
305
|
+
case 2:
|
|
302
306
|
selectionRes = _e.sent();
|
|
303
307
|
selectedDataValue_1 = [];
|
|
304
308
|
if (Array.isArray(selectedData)) {
|
|
@@ -334,8 +338,8 @@ var handleRetrieveObjectReferenceOptions = function (eachModel, referencesOption
|
|
|
334
338
|
}
|
|
335
339
|
currentRes_1 = [];
|
|
336
340
|
unknownRes = [];
|
|
337
|
-
if (!(selectedData && selectedDataValue_1)) return [3 /*break*/,
|
|
338
|
-
if (!(listObject && Array.isArray(selectedDataValue_1))) return [3 /*break*/,
|
|
341
|
+
if (!(selectedData && selectedDataValue_1)) return [3 /*break*/, 6];
|
|
342
|
+
if (!(listObject && Array.isArray(selectedDataValue_1))) return [3 /*break*/, 4];
|
|
339
343
|
return [4 /*yield*/, Promise.all(selectedDataValue_1.map(function (eachData) { return __awaiter(void 0, void 0, void 0, function () {
|
|
340
344
|
var queryValue, res;
|
|
341
345
|
return __generator(this, function (_a) {
|
|
@@ -357,10 +361,10 @@ var handleRetrieveObjectReferenceOptions = function (eachModel, referencesOption
|
|
|
357
361
|
}
|
|
358
362
|
});
|
|
359
363
|
}); }))];
|
|
360
|
-
case 2:
|
|
361
|
-
_e.sent();
|
|
362
|
-
return [3 /*break*/, 5];
|
|
363
364
|
case 3:
|
|
365
|
+
_e.sent();
|
|
366
|
+
return [3 /*break*/, 6];
|
|
367
|
+
case 4:
|
|
364
368
|
queryValue = Array.isArray(selectedDataValue_1)
|
|
365
369
|
? selectedDataValue_1
|
|
366
370
|
: [selectedDataValue_1];
|
|
@@ -369,7 +373,7 @@ var handleRetrieveObjectReferenceOptions = function (eachModel, referencesOption
|
|
|
369
373
|
stopLimit: true,
|
|
370
374
|
query: [{ type: "in", value: queryValue, queryId: serverId_1 }],
|
|
371
375
|
})];
|
|
372
|
-
case
|
|
376
|
+
case 5:
|
|
373
377
|
res = _e.sent();
|
|
374
378
|
if ((res === null || res === void 0 ? void 0 : res.data.length) > 0) {
|
|
375
379
|
currentRes_1 = res === null || res === void 0 ? void 0 : res.data;
|
|
@@ -377,8 +381,8 @@ var handleRetrieveObjectReferenceOptions = function (eachModel, referencesOption
|
|
|
377
381
|
else {
|
|
378
382
|
unknownRes.push.apply(unknownRes, queryValue);
|
|
379
383
|
}
|
|
380
|
-
_e.label =
|
|
381
|
-
case
|
|
384
|
+
_e.label = 6;
|
|
385
|
+
case 6:
|
|
382
386
|
if (selectionRes === null || selectionRes === void 0 ? void 0 : selectionRes.data) {
|
|
383
387
|
selectionRes.data.map(function (eachData) {
|
|
384
388
|
var _a, _b;
|
|
@@ -425,11 +429,11 @@ var handleRetrieveObjectReferenceOptions = function (eachModel, referencesOption
|
|
|
425
429
|
});
|
|
426
430
|
modelId = prefix ? "".concat(prefix, ".").concat(eachModel.id) : eachModel.id;
|
|
427
431
|
referencesOptions[modelId] = optionList_1;
|
|
428
|
-
return [3 /*break*/,
|
|
429
|
-
case
|
|
432
|
+
return [3 /*break*/, 8];
|
|
433
|
+
case 7:
|
|
430
434
|
err_2 = _e.sent();
|
|
431
|
-
return [3 /*break*/,
|
|
432
|
-
case
|
|
435
|
+
return [3 /*break*/, 8];
|
|
436
|
+
case 8: return [2 /*return*/, referencesOptions];
|
|
433
437
|
}
|
|
434
438
|
});
|
|
435
439
|
}); };
|
|
@@ -450,7 +454,6 @@ var handleParseOfflineWrite = function (selectedData, model) {
|
|
|
450
454
|
return tempData;
|
|
451
455
|
};
|
|
452
456
|
exports.handleParseOfflineWrite = handleParseOfflineWrite;
|
|
453
|
-
//TODO : Group stuffs into dev settings
|
|
454
457
|
/**
|
|
455
458
|
*
|
|
456
459
|
* @param data
|
|
@@ -481,13 +484,13 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
481
484
|
});
|
|
482
485
|
filteredModel.forEach(function (eachAttribute, index) {
|
|
483
486
|
//INFO - Default Model Contain Id While Object Type Don't have
|
|
484
|
-
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;
|
|
487
|
+
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;
|
|
485
488
|
if (isForm && eachAttribute.hideForm && eachAttribute.optional)
|
|
486
489
|
return;
|
|
487
|
-
var clonedSelectedData = (0, exports.handleClonedDataAttribute)(data, model, (_a = referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.server) !== null &&
|
|
490
|
+
var clonedSelectedData = (0, exports.handleClonedDataAttribute)(data, model, (_b = (_a = referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.devSettings) === null || _a === void 0 ? void 0 : _a.server) !== null && _b !== void 0 ? _b : "mongoServer", false, isRemainId);
|
|
488
491
|
var label = (cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) ? "" : eachAttribute.name;
|
|
489
492
|
var labelExtra = !(cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) && !eachAttribute.optional ? (react_1.default.createElement("span", { className: "text-red-500" }, " (*) ")) : undefined;
|
|
490
|
-
var placeholder = (
|
|
493
|
+
var placeholder = (_c = eachAttribute.placeholder) !== null && _c !== void 0 ? _c : eachAttribute.name;
|
|
491
494
|
var disabled = false;
|
|
492
495
|
if (props) {
|
|
493
496
|
if (props.type === "read")
|
|
@@ -511,7 +514,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
511
514
|
var id = eachAttribute.id;
|
|
512
515
|
if ((cellInput === null || cellInput === void 0 ? void 0 : cellInput.active) && (props === null || props === void 0 ? void 0 : props.id))
|
|
513
516
|
id = props === null || props === void 0 ? void 0 : props.id;
|
|
514
|
-
inputList[groupId].push(react_1.default.createElement(address_1.Address, { id: id, optional: eachAttribute.optional, label: label, labelExtra: labelExtra, placeholder: placeholder, hideMetadata: cellInput === null || cellInput === void 0 ? void 0 : cellInput.active, value: (
|
|
517
|
+
inputList[groupId].push(react_1.default.createElement(address_1.Address, { id: id, optional: eachAttribute.optional, label: label, labelExtra: labelExtra, placeholder: placeholder, hideMetadata: cellInput === null || cellInput === void 0 ? void 0 : cellInput.active, value: (_d = clonedSelectedData[eachAttribute.id]) !== null && _d !== void 0 ? _d : {
|
|
515
518
|
lat: 0,
|
|
516
519
|
lng: 0,
|
|
517
520
|
name: "",
|
|
@@ -523,7 +526,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
523
526
|
} }));
|
|
524
527
|
break;
|
|
525
528
|
case "object":
|
|
526
|
-
var objectValue = Object.values((
|
|
529
|
+
var objectValue = Object.values((_e = clonedSelectedData[eachAttribute.id]) !== null && _e !== void 0 ? _e : {});
|
|
527
530
|
inputList[groupId].push(react_1.default.createElement(react_1.default.Fragment, null,
|
|
528
531
|
react_1.default.createElement("label", { className: "block text-sm font-medium text-gray-700" },
|
|
529
532
|
label,
|
|
@@ -534,12 +537,12 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
534
537
|
objectProps === null || objectProps === void 0 ? void 0 : objectProps.setSelectedObjectStructureId(eachAttribute.id);
|
|
535
538
|
objectProps === null || objectProps === void 0 ? void 0 : objectProps.setSelectedObjectData((_a = clonedSelectedData[eachAttribute.id]) !== null && _a !== void 0 ? _a : {});
|
|
536
539
|
objectProps === null || objectProps === void 0 ? void 0 : objectProps.handlePopUpModal(true);
|
|
537
|
-
} }, objectValue.length > 0 ? (react_1.default.createElement("div", { className: "flex flex-row overflow-hidden" }, (
|
|
540
|
+
} }, objectValue.length > 0 ? (react_1.default.createElement("div", { className: "flex flex-row overflow-hidden" }, (_f = objectProps === null || objectProps === void 0 ? void 0 : objectProps.renderObjectTags(eachAttribute.id)) !== null && _f !== void 0 ? _f : null)) : ("Fill details"))));
|
|
538
541
|
break;
|
|
539
542
|
case "list":
|
|
540
543
|
case "multipleList":
|
|
541
544
|
var optionList_2 = eachAttribute.listSelection
|
|
542
|
-
? (
|
|
545
|
+
? (_g = eachAttribute.listSelection) === null || _g === void 0 ? void 0 : _g.map(function (eachListKey, index) {
|
|
543
546
|
var _a;
|
|
544
547
|
var listLabel = eachListKey;
|
|
545
548
|
var optionListLabel = (_a = eachAttribute.listSelectionLabel) !== null && _a !== void 0 ? _a : [];
|
|
@@ -562,7 +565,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
562
565
|
}
|
|
563
566
|
});
|
|
564
567
|
}
|
|
565
|
-
inputList[groupId].push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, optional: eachAttribute.optional, value: (
|
|
568
|
+
inputList[groupId].push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, optional: eachAttribute.optional, value: (_h = clonedSelectedData[eachAttribute.id]) !== null && _h !== void 0 ? _h : (eachAttribute.type === "list" ? "" : []), placeholder: placeholder !== eachAttribute.name
|
|
566
569
|
? placeholder
|
|
567
570
|
: "Select An Option", label: label, labelExtra: labelExtra, newValue: eachAttribute.listNewValue, disableKeyboard: eachAttribute.disabledKeyboardSearch, options: optionList_2, onChange: function (value) {
|
|
568
571
|
updateMethod.handleOnChangeSelect(eachAttribute.id, value);
|
|
@@ -572,7 +575,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
572
575
|
}, staticDropdown: modalInput }));
|
|
573
576
|
break;
|
|
574
577
|
case "boolean":
|
|
575
|
-
var value = (
|
|
578
|
+
var value = (_j = clonedSelectedData[eachAttribute.id]) === null || _j === void 0 ? void 0 : _j.toString();
|
|
576
579
|
inputList[groupId].push(react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: value, label: label, labelExtra: labelExtra, placeholder: placeholder !== eachAttribute.name
|
|
577
580
|
? placeholder
|
|
578
581
|
: "Select An Option", optional: eachAttribute.optional, disableKeyboard: eachAttribute.disabledKeyboardSearch, options: [
|
|
@@ -605,24 +608,24 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
605
608
|
: (0, blobModule_1.renderImageUrlFromPath)(fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageEndpoint, eachAttribute.imageCollectionName + "%2F" + props.id, objectProps === null || objectProps === void 0 ? void 0 : objectProps.selectedObjectStructureId, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id], fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageBucketName)
|
|
606
609
|
: (0, blobModule_1.renderImageUrlFromPath)(fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageEndpoint, eachAttribute.imageCollectionName, props === null || props === void 0 ? void 0 : props.id, eachAttribute.imageFileName, clonedSelectedData[eachAttribute.id], fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageBucketName);
|
|
607
610
|
}
|
|
608
|
-
var accept = (
|
|
609
|
-
var fileDescription = (
|
|
610
|
-
inputList[groupId].push(react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (
|
|
611
|
+
var accept = (_k = eachAttribute.fileExtension) !== null && _k !== void 0 ? _k : (eachAttribute.type === "image" ? ".png,.jpg,.jpeg,.tiff" : ".pdf");
|
|
612
|
+
var fileDescription = (_l = eachAttribute.fileDescription) !== null && _l !== void 0 ? _l : (eachAttribute.type === "image" ? undefined : "PDF up to 30MB");
|
|
613
|
+
inputList[groupId].push(react_1.default.createElement(uploadInput_1.UploadInput, { lib: { axios: (_m = props === null || props === void 0 ? void 0 : props.lib) === null || _m === void 0 ? void 0 : _m.axios }, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, labelExtra: labelExtra, optional: eachAttribute.optional, hidePreview: eachAttribute.type === "image" ? false : true, file: (_o = url !== null && url !== void 0 ? url : clonedSelectedData[eachAttribute.id]) !== null && _o !== void 0 ? _o : "", accept: accept, capture: eachAttribute.imageInputCapture, fileDescription: fileDescription, maxFileSize: fileProps === null || fileProps === void 0 ? void 0 : fileProps.maxFileSize, onChange: updateMethod.handleOnChangeFile, disabled: disabled }));
|
|
611
614
|
break;
|
|
612
615
|
case "multipleFile":
|
|
613
616
|
case "multipleImage":
|
|
614
617
|
var multipleDataUrl = clonedSelectedData[eachAttribute.id]["data"]
|
|
615
|
-
? (
|
|
618
|
+
? (_p = clonedSelectedData[eachAttribute.id]["data"]) === null || _p === void 0 ? void 0 : _p.map(function (eachImage) {
|
|
616
619
|
return {
|
|
617
620
|
token: eachImage.token,
|
|
618
621
|
fileName: (0, blobModule_1.renderImageUrlFromPath)(fileProps === null || fileProps === void 0 ? void 0 : fileProps.imageEndpoint, eachAttribute.imageCollectionName, props === null || props === void 0 ? void 0 : props.id, eachImage.fileName, eachImage.token),
|
|
619
622
|
};
|
|
620
623
|
})
|
|
621
624
|
: [];
|
|
622
|
-
var multiAccept = (
|
|
625
|
+
var multiAccept = (_q = eachAttribute.fileExtension) !== null && _q !== void 0 ? _q : (eachAttribute.type === "multipleImage"
|
|
623
626
|
? ".png,.jpg,.jpeg,.tiff"
|
|
624
627
|
: ".pdf");
|
|
625
|
-
var multiFileDescription = (
|
|
628
|
+
var multiFileDescription = (_r = eachAttribute.fileDescription) !== null && _r !== void 0 ? _r : (eachAttribute.type === "multipleImage"
|
|
626
629
|
? undefined
|
|
627
630
|
: "PDF up to 30MB");
|
|
628
631
|
inputList[groupId].push(react_1.default.createElement(uploadInput_1.UploadInput, { type: "multi", files: __assign(__assign({}, (!react_1.default.isValidElement(clonedSelectedData[eachAttribute.id])
|
|
@@ -630,10 +633,10 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
630
633
|
: { upload: [], remove: [] })), { data: multipleDataUrl }), optional: eachAttribute.optional, ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, label: label, labelExtra: labelExtra, hidePreview: eachAttribute.type === "multipleImage" ? false : true, accept: multiAccept, capture: eachAttribute.imageInputCapture, fileDescription: multiFileDescription, maxFileSize: fileProps === null || fileProps === void 0 ? void 0 : fileProps.maxFileSize, onChange: function (_a) {
|
|
631
634
|
var value = _a.value, action = _a.action;
|
|
632
635
|
updateMethod.handleOnChangeFiles(eachAttribute.id, value, action);
|
|
633
|
-
}, lib: { axios: (
|
|
636
|
+
}, lib: { axios: (_s = props === null || props === void 0 ? void 0 : props.lib) === null || _s === void 0 ? void 0 : _s.axios }, disabled: disabled }));
|
|
634
637
|
break;
|
|
635
638
|
case "number":
|
|
636
|
-
inputList[groupId].push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: "number", value: (
|
|
639
|
+
inputList[groupId].push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: "number", value: (_t = clonedSelectedData[eachAttribute.id]) !== null && _t !== void 0 ? _t : "", placeholder: placeholder, label: label, labelExtra: labelExtra, optional: eachAttribute.optional, onChange: updateMethod.handleOnChangeText, disabled: disabled, cellInput: {
|
|
637
640
|
active: cellInput === null || cellInput === void 0 ? void 0 : cellInput.active,
|
|
638
641
|
onBlur: cellInput === null || cellInput === void 0 ? void 0 : cellInput.onBlur,
|
|
639
642
|
} }));
|
|
@@ -641,10 +644,10 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
641
644
|
case "reference":
|
|
642
645
|
case "listReference":
|
|
643
646
|
var selectedReferenceOptions = (props === null || props === void 0 ? void 0 : props.isObject)
|
|
644
|
-
? (
|
|
645
|
-
: (
|
|
647
|
+
? (_u = referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.referencesOptions[(objectProps === null || objectProps === void 0 ? void 0 : objectProps.selectedObjectStructureId) + "." + eachAttribute.id]) !== null && _u !== void 0 ? _u : []
|
|
648
|
+
: (_v = referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.referencesOptions[eachAttribute.id]) !== null && _v !== void 0 ? _v : [];
|
|
646
649
|
inputList[groupId].push(react_1.default.createElement(react_1.default.Fragment, null,
|
|
647
|
-
react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: (
|
|
650
|
+
react_1.default.createElement(select_1.Select, { ref: eachAttribute.optional ? null : formInputRef[index], id: eachAttribute.id, value: (_w = clonedSelectedData[eachAttribute.id]) !== null && _w !== void 0 ? _w : (eachAttribute.type === "reference" ? "" : []), label: label, labelExtra: labelExtra, optional: eachAttribute.optional, placeholder: placeholder !== eachAttribute.name
|
|
648
651
|
? placeholder
|
|
649
652
|
: "Select An Option", disableKeyboard: eachAttribute.disabledKeyboardSearch, options: selectedReferenceOptions, onChange: function (value) {
|
|
650
653
|
updateMethod.handleOnChangeSelect(eachAttribute.id, value);
|
|
@@ -652,9 +655,9 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
652
655
|
? loadingSelect
|
|
653
656
|
: additionalSelect, onSearch: function (value) { return __awaiter(void 0, void 0, void 0, function () {
|
|
654
657
|
var clonedReferencesOptions, filterObjectModel, offlineDataResp, offlineData;
|
|
655
|
-
var _a
|
|
656
|
-
return __generator(this, function (
|
|
657
|
-
switch (
|
|
658
|
+
var _a;
|
|
659
|
+
return __generator(this, function (_b) {
|
|
660
|
+
switch (_b.label) {
|
|
658
661
|
case 0:
|
|
659
662
|
referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.setReferenceLoading(true);
|
|
660
663
|
clonedReferencesOptions = JSON.parse(JSON.stringify(referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.referencesOptions));
|
|
@@ -665,15 +668,15 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
665
668
|
if (!eachAttribute.referenceSpaceId) return [3 /*break*/, 2];
|
|
666
669
|
return [4 /*yield*/, indexedDb_1.indexedDb.getValue("local", eachAttribute.referenceSpaceId + "-ref")];
|
|
667
670
|
case 1:
|
|
668
|
-
offlineDataResp =
|
|
671
|
+
offlineDataResp = _b.sent();
|
|
669
672
|
offlineData = (_a = offlineDataResp === null || offlineDataResp === void 0 ? void 0 : offlineDataResp.data) !== null && _a !== void 0 ? _a : [];
|
|
670
673
|
clonedReferencesOptions[eachAttribute.id] = offlineData;
|
|
671
|
-
|
|
674
|
+
_b.label = 2;
|
|
672
675
|
case 2: return [3 /*break*/, 5];
|
|
673
|
-
case 3: return [4 /*yield*/, (0, exports.handleRetrieveObjectReferenceOptions)(eachAttribute, clonedReferencesOptions, clonedSelectedData, referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.dbModule,
|
|
676
|
+
case 3: return [4 /*yield*/, (0, exports.handleRetrieveObjectReferenceOptions)(eachAttribute, clonedReferencesOptions, clonedSelectedData, referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.dbModule, referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.devSettings, objectProps === null || objectProps === void 0 ? void 0 : objectProps.selectedObjectStructureId, (filterObjectModel === null || filterObjectModel === void 0 ? void 0 : filterObjectModel.type) === "listObject", value)];
|
|
674
677
|
case 4:
|
|
675
|
-
|
|
676
|
-
|
|
678
|
+
_b.sent();
|
|
679
|
+
_b.label = 5;
|
|
677
680
|
case 5:
|
|
678
681
|
referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.setReferencesOptions(clonedReferencesOptions);
|
|
679
682
|
referenceProps === null || referenceProps === void 0 ? void 0 : referenceProps.setReferenceLoading(false);
|
|
@@ -695,7 +698,7 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
695
698
|
else if (eachAttribute.type === "email") {
|
|
696
699
|
textType = "email";
|
|
697
700
|
}
|
|
698
|
-
inputList[groupId].push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: textType, value: (
|
|
701
|
+
inputList[groupId].push(react_1.default.createElement(textInput_1.TextInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], type: textType, value: (_x = clonedSelectedData[eachAttribute.id]) !== null && _x !== void 0 ? _x : "", placeholder: placeholder, label: label, labelExtra: labelExtra, optional: eachAttribute.optional, onChange: updateMethod.handleOnChangeText, disabled: disabled, cellInput: {
|
|
699
702
|
active: cellInput === null || cellInput === void 0 ? void 0 : cellInput.active,
|
|
700
703
|
onBlur: cellInput === null || cellInput === void 0 ? void 0 : cellInput.onBlur,
|
|
701
704
|
}, mobilePicker: true }));
|
|
@@ -708,8 +711,8 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
708
711
|
clonedSelectedData[eachAttribute.id] instanceof Date)
|
|
709
712
|
dateValue = clonedSelectedData[eachAttribute.id];
|
|
710
713
|
else if (typeof clonedSelectedData[eachAttribute.id] === "object")
|
|
711
|
-
dateValue = ((
|
|
712
|
-
? (0, moment_1.default)((
|
|
714
|
+
dateValue = ((_y = clonedSelectedData === null || clonedSelectedData === void 0 ? void 0 : clonedSelectedData[eachAttribute.id]) === null || _y === void 0 ? void 0 : _y["_seconds"])
|
|
715
|
+
? (0, moment_1.default)((_z = clonedSelectedData === null || clonedSelectedData === void 0 ? void 0 : clonedSelectedData[eachAttribute.id]) === null || _z === void 0 ? void 0 : _z["_seconds"]).toDate()
|
|
713
716
|
: (0, moment_1.default)().toDate();
|
|
714
717
|
else if (clonedSelectedData[eachAttribute.id] === undefined)
|
|
715
718
|
dateValue = undefined;
|
|
@@ -720,10 +723,10 @@ var renderDataTemplateForm = function (data, model, formInputRef, updateMethod,
|
|
|
720
723
|
}, staticDropdown: modalInput, showTime: showTime }));
|
|
721
724
|
break;
|
|
722
725
|
case "markdown":
|
|
723
|
-
inputList[groupId].push(react_1.default.createElement(markdown_1.MarkdownInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], label: label, labelExtra: labelExtra, value: (
|
|
726
|
+
inputList[groupId].push(react_1.default.createElement(markdown_1.MarkdownInput, { id: eachAttribute.id, ref: eachAttribute.optional ? null : formInputRef[index], label: label, labelExtra: labelExtra, value: (_0 = clonedSelectedData[eachAttribute.id]) !== null && _0 !== void 0 ? _0 : "", placeholder: placeholder, optional: eachAttribute.optional, onChange: updateMethod.handleOnChangeMarkdown, disabled: disabled }));
|
|
724
727
|
break;
|
|
725
728
|
case "textArea":
|
|
726
|
-
inputList[groupId].push(react_1.default.createElement(textArea_1.TextArea, { id: eachAttribute.id, label: label, labelExtra: labelExtra, placeholder: placeholder, value: (
|
|
729
|
+
inputList[groupId].push(react_1.default.createElement(textArea_1.TextArea, { id: eachAttribute.id, label: label, labelExtra: labelExtra, placeholder: placeholder, value: (_1 = clonedSelectedData[eachAttribute.id]) !== null && _1 !== void 0 ? _1 : "", rows: 4, onChange: updateMethod.handleOnChangeText }));
|
|
727
730
|
break;
|
|
728
731
|
}
|
|
729
732
|
});
|