impaktapps-ui-builder 1.0.120 → 1.0.121
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/dist/impaktapps-ui-builder.es.js +143 -162
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +11 -11
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +2 -1
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +5 -2
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +4 -3
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildCard.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/buildTable.ts +12 -9
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +63 -115
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +6 -6
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +7 -6
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +3 -1
- package/src/impaktapps-ui-builder/builder/services/component.ts +1 -1
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +14 -14
- package/src/impaktapps-ui-builder/lib/index.ts +10 -9
- package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +33 -18
- package/src/impaktapps-ui-builder/runtime/services/events.ts +8 -10
- package/src/impaktapps-ui-builder/runtime/services/service.ts +51 -33
|
@@ -1488,7 +1488,7 @@ var lodash = { exports: {} };
|
|
|
1488
1488
|
var reIsNative = RegExp2(
|
|
1489
1489
|
"^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1490
1490
|
);
|
|
1491
|
-
var Buffer = moduleExports ? context.Buffer : undefined$1, Symbol = context.Symbol,
|
|
1491
|
+
var Buffer = moduleExports ? context.Buffer : undefined$1, Symbol = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined$1, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined$1, symIterator = Symbol ? Symbol.iterator : undefined$1, symToStringTag = Symbol ? Symbol.toStringTag : undefined$1;
|
|
1492
1492
|
var defineProperty = function() {
|
|
1493
1493
|
try {
|
|
1494
1494
|
var func = getNative(Object2, "defineProperty");
|
|
@@ -2750,7 +2750,7 @@ var lodash = { exports: {} };
|
|
|
2750
2750
|
}
|
|
2751
2751
|
function cloneArrayBuffer(arrayBuffer) {
|
|
2752
2752
|
var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength);
|
|
2753
|
-
new
|
|
2753
|
+
new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer));
|
|
2754
2754
|
return result2;
|
|
2755
2755
|
}
|
|
2756
2756
|
function cloneDataView(dataView, isDeep) {
|
|
@@ -3354,7 +3354,7 @@ var lodash = { exports: {} };
|
|
|
3354
3354
|
object = object.buffer;
|
|
3355
3355
|
other = other.buffer;
|
|
3356
3356
|
case arrayBufferTag:
|
|
3357
|
-
if (object.byteLength != other.byteLength || !equalFunc(new
|
|
3357
|
+
if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) {
|
|
3358
3358
|
return false;
|
|
3359
3359
|
}
|
|
3360
3360
|
return true;
|
|
@@ -6495,7 +6495,8 @@ const ComponentSchema = {
|
|
|
6495
6495
|
{ const: "required", title: "Required" },
|
|
6496
6496
|
{ const: "minLength", title: "Minimum Length" },
|
|
6497
6497
|
{ const: "maxLength", title: "Maximum Length" },
|
|
6498
|
-
{ const: "pattern", title: "Pattern" }
|
|
6498
|
+
{ const: "pattern", title: "Pattern" },
|
|
6499
|
+
{ const: "readOnly", title: "Read Only" }
|
|
6499
6500
|
]
|
|
6500
6501
|
},
|
|
6501
6502
|
validationValue: {
|
|
@@ -7886,7 +7887,8 @@ const buildPropertiesSection = function(type) {
|
|
|
7886
7887
|
getRadioInputField("paginateExpandedRows", "Multi Page Expansion", ["YES", "NO"]),
|
|
7887
7888
|
getRadioInputField("treeStructure", "Flat Tree Structure", ["YES", "NO"]),
|
|
7888
7889
|
getRadioInputField("filterFromLeafRows", "Filter from tree rows", ["YES", "NO"]),
|
|
7889
|
-
|
|
7890
|
+
getInputField("defaultColumnSize", "Default Column Size"),
|
|
7891
|
+
,
|
|
7890
7892
|
emptyBox$1("LazyLoadingTableEmpty3")
|
|
7891
7893
|
]),
|
|
7892
7894
|
getArrayControl("Table_Download_Keys_Name", "KeyName", "Table Key Name"),
|
|
@@ -8440,7 +8442,7 @@ const sectionLabels = {
|
|
|
8440
8442
|
Timer: ["Core", "Events", "Style", "Validation"],
|
|
8441
8443
|
Rank: ["Core", "Events", "Style", "Validation"],
|
|
8442
8444
|
Button: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
8443
|
-
Array: ["Core", "Components", "Properties", "Validation"],
|
|
8445
|
+
Array: ["Core", "Components", "Properties", "Events", "Validation"],
|
|
8444
8446
|
Radio: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
8445
8447
|
Text: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
8446
8448
|
TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
@@ -8832,7 +8834,7 @@ var pageMaster = (funcParams) => {
|
|
|
8832
8834
|
return formData;
|
|
8833
8835
|
}
|
|
8834
8836
|
saveFormdataInSessionStorage(config2);
|
|
8835
|
-
return config2;
|
|
8837
|
+
return { ...config2, type: "page" };
|
|
8836
8838
|
},
|
|
8837
8839
|
getUiSchema: function() {
|
|
8838
8840
|
const UiSchema = _.cloneDeep(PageMasterUiSchema(store2.theme.myTheme));
|
|
@@ -8991,7 +8993,7 @@ const EventSchema = {
|
|
|
8991
8993
|
oneOf: [
|
|
8992
8994
|
{ title: "RankProvider", const: "RankProvider" },
|
|
8993
8995
|
{ title: "Download File", const: "downloadFile" },
|
|
8994
|
-
{ title: "
|
|
8996
|
+
{ title: "downloadFileFromUrl", const: "downloadFileFromUrl" }
|
|
8995
8997
|
]
|
|
8996
8998
|
},
|
|
8997
8999
|
body: {
|
|
@@ -9928,22 +9930,33 @@ var event = (store2, dynamicData2, submitHandler, service2, functionsName) => {
|
|
|
9928
9930
|
}
|
|
9929
9931
|
};
|
|
9930
9932
|
};
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
const
|
|
9934
|
-
const
|
|
9935
|
-
let
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
const
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9933
|
+
function downloadFile$1({ data, name }) {
|
|
9934
|
+
var _a;
|
|
9935
|
+
const binary = window.atob(data);
|
|
9936
|
+
const bytes = new Uint8Array(binary.length);
|
|
9937
|
+
for (let i = 0; i < binary.length; i++) {
|
|
9938
|
+
bytes[i] = binary.charCodeAt(i);
|
|
9939
|
+
}
|
|
9940
|
+
const extension = (_a = name.split(".").pop()) == null ? void 0 : _a.toLowerCase();
|
|
9941
|
+
const mimeMap = {
|
|
9942
|
+
pdf: "application/pdf",
|
|
9943
|
+
png: "image/png",
|
|
9944
|
+
jpg: "image/jpeg",
|
|
9945
|
+
jpeg: "image/jpeg",
|
|
9946
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
9947
|
+
csv: "text/csv"
|
|
9948
|
+
};
|
|
9949
|
+
const blob = new Blob([bytes], {
|
|
9950
|
+
type: mimeMap[extension] || "application/octet-stream"
|
|
9951
|
+
});
|
|
9952
|
+
const url = URL.createObjectURL(blob);
|
|
9953
|
+
const a = document.createElement("a");
|
|
9954
|
+
a.href = url;
|
|
9955
|
+
a.download = name;
|
|
9956
|
+
a.click();
|
|
9943
9957
|
URL.revokeObjectURL(url);
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
const doDownload = (response, service2) => {
|
|
9958
|
+
}
|
|
9959
|
+
const downloadFileFromUrl = (response, service2) => {
|
|
9947
9960
|
let url = `${service2.defaults.baseURL}/${response.path}`;
|
|
9948
9961
|
if (response == null ? void 0 : response.params) {
|
|
9949
9962
|
const keysArray = Object.keys(response == null ? void 0 : response.params);
|
|
@@ -10022,7 +10035,6 @@ function executeEventsHandler(params2) {
|
|
|
10022
10035
|
params2.componentName,
|
|
10023
10036
|
params2.config,
|
|
10024
10037
|
params2.store,
|
|
10025
|
-
params2.service,
|
|
10026
10038
|
params2.formDataHolder
|
|
10027
10039
|
);
|
|
10028
10040
|
} else if (params2.config.Handler === "onBackHandler") {
|
|
@@ -10094,7 +10106,7 @@ function executeCustomHandler(params) {
|
|
|
10094
10106
|
return response;
|
|
10095
10107
|
}
|
|
10096
10108
|
}
|
|
10097
|
-
function mergeFormdata(handlerResponse, componentName, eventConfig, store2,
|
|
10109
|
+
function mergeFormdata(handlerResponse, componentName, eventConfig, store2, formDataHolder) {
|
|
10098
10110
|
var _a, _b, _c;
|
|
10099
10111
|
if (eventConfig.type === "Select" && (handlerResponse == null ? void 0 : handlerResponse.data)) {
|
|
10100
10112
|
if (!_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data)) {
|
|
@@ -10132,29 +10144,23 @@ function mergeFormdata(handlerResponse, componentName, eventConfig, store2, serv
|
|
|
10132
10144
|
});
|
|
10133
10145
|
}
|
|
10134
10146
|
} else if (eventConfig.type === "page") {
|
|
10135
|
-
if (!(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
|
|
10147
|
+
if (!(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data) && lodash.exports.isObject(handlerResponse.data))) {
|
|
10136
10148
|
store2.newData = {
|
|
10137
10149
|
...store2.newData,
|
|
10138
10150
|
...handlerResponse == null ? void 0 : handlerResponse.data
|
|
10139
10151
|
};
|
|
10140
|
-
|
|
10141
|
-
|
|
10152
|
+
Object.keys(handlerResponse.data).forEach((e) => {
|
|
10153
|
+
formDataHolder[e] = handlerResponse.data[e];
|
|
10142
10154
|
});
|
|
10143
10155
|
}
|
|
10144
10156
|
} else if (eventConfig.type === "Table" && eventConfig.lazyLoading) {
|
|
10145
10157
|
if (handlerResponse && (handlerResponse == null ? void 0 : handlerResponse.data)) {
|
|
10146
10158
|
formDataHolder[componentName] = (_a = handlerResponse.data) == null ? void 0 : _a.data;
|
|
10147
10159
|
formDataHolder[`${componentName}_RowCount`] = (_c = (_b = handlerResponse.data) == null ? void 0 : _b.meta) == null ? void 0 : _c.totalRowCount;
|
|
10148
|
-
store2.setFormdata((pre) => {
|
|
10149
|
-
return { ...pre, ...formDataHolder };
|
|
10150
|
-
});
|
|
10151
10160
|
}
|
|
10152
10161
|
} else {
|
|
10153
10162
|
if (handlerResponse) {
|
|
10154
10163
|
formDataHolder[componentName] = handlerResponse.data;
|
|
10155
|
-
store2.setFormdata((pre) => {
|
|
10156
|
-
return { ...pre, ...formDataHolder };
|
|
10157
|
-
});
|
|
10158
10164
|
}
|
|
10159
10165
|
}
|
|
10160
10166
|
}
|
|
@@ -10292,7 +10298,7 @@ var service = (funcParams) => {
|
|
|
10292
10298
|
dynamicData: funcParams.dynamicData,
|
|
10293
10299
|
userValue: funcParams.userValue,
|
|
10294
10300
|
service: funcParams.service,
|
|
10295
|
-
serviceHolder: { downloadFile: downloadFile$1, download:
|
|
10301
|
+
serviceHolder: { downloadFile: downloadFile$1, download: downloadFileFromUrl, ...funcParams.functionsProvider },
|
|
10296
10302
|
eventGroups,
|
|
10297
10303
|
functionsProvider: funcParams.functionsProvider,
|
|
10298
10304
|
formDataHolder
|
|
@@ -10339,7 +10345,7 @@ var service = (funcParams) => {
|
|
|
10339
10345
|
};
|
|
10340
10346
|
}
|
|
10341
10347
|
);
|
|
10342
|
-
|
|
10348
|
+
executeRefreshHandler({
|
|
10343
10349
|
config: {},
|
|
10344
10350
|
componentName: "",
|
|
10345
10351
|
store: funcParams.store,
|
|
@@ -10348,25 +10354,30 @@ var service = (funcParams) => {
|
|
|
10348
10354
|
service: funcParams.service,
|
|
10349
10355
|
serviceHolder: this,
|
|
10350
10356
|
eventGroups,
|
|
10351
|
-
formDataHolder
|
|
10357
|
+
formDataHolder
|
|
10358
|
+
}).then((e) => {
|
|
10359
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
|
|
10360
|
+
uiSchema.elements.push(notifyUiSchema);
|
|
10361
|
+
funcParams.store.setUiSchema(uiSchema);
|
|
10352
10362
|
});
|
|
10353
|
-
uiSchema.elements.push(notifyUiSchema);
|
|
10354
|
-
funcParams.store.setUiSchema(uiSchema);
|
|
10355
10363
|
},
|
|
10356
10364
|
onCellRenderer: (cellParams) => {
|
|
10357
|
-
var _a, _b, _c, _d;
|
|
10358
|
-
|
|
10365
|
+
var _a, _b, _c, _d, _e;
|
|
10366
|
+
const cloneEventGroup = _.cloneDeep(eventGroups);
|
|
10367
|
+
if (cloneEventGroup.onCellRenderer) {
|
|
10359
10368
|
let finalResponse = {};
|
|
10360
10369
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || ((_c = (_b = funcParams == null ? void 0 : funcParams.dynamicData) == null ? void 0 : _b.path) == null ? void 0 : _c.split(".")[0]);
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10365
|
-
|
|
10366
|
-
|
|
10367
|
-
|
|
10370
|
+
if ((_d = cloneEventGroup == null ? void 0 : cloneEventGroup.onCellRenderer) == null ? void 0 : _d[path]) {
|
|
10371
|
+
for (const eventConfig of (_e = cloneEventGroup == null ? void 0 : cloneEventGroup.onCellRenderer) == null ? void 0 : _e[path]) {
|
|
10372
|
+
executeEventsParameters.store.functionParameters = cellParams;
|
|
10373
|
+
finalResponse = executeEvents({
|
|
10374
|
+
...executeEventsParameters,
|
|
10375
|
+
config: eventConfig,
|
|
10376
|
+
componentName: path
|
|
10377
|
+
});
|
|
10378
|
+
}
|
|
10379
|
+
return finalResponse;
|
|
10368
10380
|
}
|
|
10369
|
-
return finalResponse;
|
|
10370
10381
|
}
|
|
10371
10382
|
return {};
|
|
10372
10383
|
},
|
|
@@ -10434,8 +10445,12 @@ var service = (funcParams) => {
|
|
|
10434
10445
|
await executeEvents({
|
|
10435
10446
|
...executeEventsParameters,
|
|
10436
10447
|
config: eventConfig,
|
|
10437
|
-
componentName
|
|
10448
|
+
componentName,
|
|
10449
|
+
formDataHolder
|
|
10438
10450
|
});
|
|
10451
|
+
if (eventConfig.Handler === "refresh") {
|
|
10452
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
|
|
10453
|
+
}
|
|
10439
10454
|
}
|
|
10440
10455
|
}
|
|
10441
10456
|
}));
|
|
@@ -10469,7 +10484,7 @@ var service = (funcParams) => {
|
|
|
10469
10484
|
onBack: async function(functionParameters) {
|
|
10470
10485
|
var _a, _b;
|
|
10471
10486
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
|
|
10472
|
-
|
|
10487
|
+
this.callHandler("onBack", functionParameters);
|
|
10473
10488
|
if (((_b = eventGroups == null ? void 0 : eventGroups["onBack"]) == null ? void 0 : _b[path]) === void 0) {
|
|
10474
10489
|
functionParameters == null ? void 0 : functionParameters.handleBack();
|
|
10475
10490
|
}
|
|
@@ -10477,7 +10492,7 @@ var service = (funcParams) => {
|
|
|
10477
10492
|
onNext: async function(functionParameters) {
|
|
10478
10493
|
var _a, _b;
|
|
10479
10494
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
|
|
10480
|
-
|
|
10495
|
+
this.callHandler("onNext", functionParameters);
|
|
10481
10496
|
if (((_b = eventGroups == null ? void 0 : eventGroups["onNext"]) == null ? void 0 : _b[path]) === void 0) {
|
|
10482
10497
|
functionParameters == null ? void 0 : functionParameters.handleNext();
|
|
10483
10498
|
}
|
|
@@ -10485,27 +10500,38 @@ var service = (funcParams) => {
|
|
|
10485
10500
|
onReset: async function(functionParameters) {
|
|
10486
10501
|
var _a, _b;
|
|
10487
10502
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
|
|
10488
|
-
|
|
10503
|
+
this.callHandler("onReset", functionParameters);
|
|
10489
10504
|
if (((_b = eventGroups == null ? void 0 : eventGroups["onReset"]) == null ? void 0 : _b[path]) === void 0) {
|
|
10490
10505
|
functionParameters == null ? void 0 : functionParameters.handleReset();
|
|
10491
10506
|
}
|
|
10492
10507
|
},
|
|
10493
|
-
callHandler:
|
|
10508
|
+
callHandler: function(eventType, functionParameters) {
|
|
10494
10509
|
var _a, _b, _c;
|
|
10495
10510
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[funcParams.dynamicData.path.split(".").length - 1];
|
|
10496
10511
|
if (((_b = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _b[path]) !== void 0) {
|
|
10497
|
-
|
|
10512
|
+
(_c = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _c[path].map((eventConfig) => {
|
|
10498
10513
|
executeEventsParameters.store.functionParameters = functionParameters;
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10514
|
+
if (eventConfig.Handler === "refresh") {
|
|
10515
|
+
executeEvents({
|
|
10516
|
+
...executeEventsParameters,
|
|
10517
|
+
config: eventConfig,
|
|
10518
|
+
componentName: path,
|
|
10519
|
+
formDataHolder
|
|
10520
|
+
}).then((res) => {
|
|
10521
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
|
|
10522
|
+
});
|
|
10523
|
+
} else {
|
|
10524
|
+
executeEvents({
|
|
10525
|
+
...executeEventsParameters,
|
|
10526
|
+
config: eventConfig,
|
|
10527
|
+
componentName: path
|
|
10528
|
+
});
|
|
10529
|
+
}
|
|
10530
|
+
});
|
|
10505
10531
|
}
|
|
10506
10532
|
},
|
|
10507
10533
|
downloadFile: downloadFile$1,
|
|
10508
|
-
|
|
10534
|
+
downloadFileFromUrl,
|
|
10509
10535
|
...funcParams.functionsProvider
|
|
10510
10536
|
};
|
|
10511
10537
|
};
|
|
@@ -11118,6 +11144,9 @@ const buildTable = (config2, componentScope2) => {
|
|
|
11118
11144
|
if (config2.lazyLoading) {
|
|
11119
11145
|
table.config.main.lazyLoading = config2.lazyLoading === "YES" ? true : false;
|
|
11120
11146
|
}
|
|
11147
|
+
if (config2.defaultColumnSize) {
|
|
11148
|
+
table.config.main.defaultColumnSize = config2.defaultColumnSize;
|
|
11149
|
+
}
|
|
11121
11150
|
if (config2.enableRowMovement) {
|
|
11122
11151
|
table.config.main.enableRowMovement = config2.enableRowMovement === "YES" ? true : false;
|
|
11123
11152
|
}
|
|
@@ -12314,113 +12343,65 @@ let schema = {
|
|
|
12314
12343
|
properties: {},
|
|
12315
12344
|
required: []
|
|
12316
12345
|
};
|
|
12317
|
-
function
|
|
12318
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
12319
|
-
if (
|
|
12320
|
-
if (
|
|
12321
|
-
|
|
12322
|
-
|
|
12323
|
-
|
|
12324
|
-
schema.properties[tableName].items.properties[configObj.name] = {
|
|
12325
|
-
oneOf: configObj.value.map((e) => {
|
|
12326
|
-
return { const: e.value, title: e.label };
|
|
12327
|
-
})
|
|
12328
|
-
};
|
|
12329
|
-
} else if (configObj.type === "MultipleSelect" && ((_i = configObj.value) == null ? void 0 : _i.length) > 0) {
|
|
12330
|
-
schema.properties[tableName].items.properties[configObj.name] = {
|
|
12331
|
-
items: {
|
|
12332
|
-
oneOf: configObj.value.map((e) => {
|
|
12333
|
-
return { const: e.value, title: e.label };
|
|
12334
|
-
})
|
|
12335
|
-
}
|
|
12336
|
-
};
|
|
12337
|
-
}
|
|
12338
|
-
}
|
|
12339
|
-
}
|
|
12340
|
-
} else if ((configObj.type === "Select" || configObj.type === "MultipleSelect") && ((_j = configObj.value) == null ? void 0 : _j.length) > 0) {
|
|
12341
|
-
if (configObj.type === "Select") {
|
|
12342
|
-
schema.properties[configObj.name] = {
|
|
12343
|
-
oneOf: configObj.value.map((e) => {
|
|
12344
|
-
return { const: e.value, title: e.label };
|
|
12345
|
-
})
|
|
12346
|
-
};
|
|
12347
|
-
} else if (configObj.type === "MultipleSelect") {
|
|
12348
|
-
schema.properties[configObj.name] = {
|
|
12346
|
+
function buildSchemaFromConfig(config2, parentSchema) {
|
|
12347
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
12348
|
+
if (config2.elements) {
|
|
12349
|
+
if (config2.type === "Array") {
|
|
12350
|
+
(_a = parentSchema.properties) != null ? _a : parentSchema.properties = {};
|
|
12351
|
+
(_d = (_b = parentSchema.properties)[_c = config2.name]) != null ? _d : _b[_c] = {
|
|
12352
|
+
type: "array",
|
|
12349
12353
|
items: {
|
|
12350
|
-
|
|
12351
|
-
|
|
12352
|
-
|
|
12354
|
+
type: "object",
|
|
12355
|
+
properties: {},
|
|
12356
|
+
required: []
|
|
12353
12357
|
}
|
|
12354
12358
|
};
|
|
12359
|
+
const arrayItemSchema = parentSchema.properties[config2.name].items;
|
|
12360
|
+
(_e = config2.elements) == null ? void 0 : _e.forEach(
|
|
12361
|
+
(child) => buildSchemaFromConfig(child, arrayItemSchema)
|
|
12362
|
+
);
|
|
12363
|
+
return;
|
|
12364
|
+
} else {
|
|
12365
|
+
(_f = config2.elements) == null ? void 0 : _f.forEach(
|
|
12366
|
+
(child) => buildSchemaFromConfig(child, parentSchema)
|
|
12367
|
+
);
|
|
12368
|
+
return;
|
|
12355
12369
|
}
|
|
12356
12370
|
}
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
|
|
12366
|
-
|
|
12367
|
-
|
|
12368
|
-
})
|
|
12369
|
-
};
|
|
12370
|
-
} else if (configObj.type === "MultipleSelect" || ((_i2 = configObj.value) == null ? void 0 : _i2.length) > 0) {
|
|
12371
|
-
schema.properties[tableName].items.properties[configObj.name] = {
|
|
12372
|
-
items: {
|
|
12373
|
-
oneOf: configObj.value.map((e) => {
|
|
12374
|
-
return { const: e.value, title: e.label };
|
|
12375
|
-
})
|
|
12376
|
-
}
|
|
12377
|
-
};
|
|
12378
|
-
}
|
|
12379
|
-
}
|
|
12380
|
-
if (rule.validationType === "required") {
|
|
12381
|
-
(_l = (_k = (_j2 = schema.properties) == null ? void 0 : _j2[tableName]) == null ? void 0 : _k.items) == null ? void 0 : _l.required.push(configObj.name);
|
|
12382
|
-
} else {
|
|
12383
|
-
schema.properties[tableName].items.properties[configObj.name]["type"] = "string";
|
|
12384
|
-
schema.properties[tableName].items.properties[configObj.name][rule.validationType] = isNaN(rule.validationValue) ? rule.validationValue : Number(rule.validationValue);
|
|
12385
|
-
}
|
|
12386
|
-
}
|
|
12387
|
-
} else {
|
|
12388
|
-
if (!schema.properties[configObj.name]) {
|
|
12389
|
-
schema.properties[configObj.name] = {};
|
|
12390
|
-
}
|
|
12391
|
-
if (rule.validationType === "required") {
|
|
12392
|
-
schema.required.push(configObj.name);
|
|
12393
|
-
} else {
|
|
12394
|
-
schema.properties[configObj.name]["type"] = "string";
|
|
12395
|
-
schema.properties[configObj.name][rule.validationType] = isNaN(rule.validationValue) ? rule.validationValue : Number(rule.validationValue);
|
|
12396
|
-
}
|
|
12397
|
-
}
|
|
12398
|
-
});
|
|
12399
|
-
}
|
|
12400
|
-
}
|
|
12401
|
-
const buildSchema = (config2, tableName, isArrayType) => {
|
|
12402
|
-
buildRule(config2, tableName, isArrayType);
|
|
12403
|
-
if (config2 == null ? void 0 : config2.elements) {
|
|
12404
|
-
if (config2.type == "Array") {
|
|
12405
|
-
if (!schema.properties[config2.name]) {
|
|
12406
|
-
schema.properties[config2.name] = {
|
|
12407
|
-
type: "array",
|
|
12408
|
-
items: {
|
|
12409
|
-
type: "object",
|
|
12410
|
-
properties: {},
|
|
12411
|
-
required: []
|
|
12412
|
-
}
|
|
12413
|
-
};
|
|
12414
|
-
}
|
|
12415
|
-
config2.elements.map((e, elemInd) => {
|
|
12416
|
-
buildSchema(e, config2.name, config2.type === "Array" ? true : false);
|
|
12417
|
-
});
|
|
12371
|
+
(_g = parentSchema.properties) != null ? _g : parentSchema.properties = {};
|
|
12372
|
+
(_j = (_h = parentSchema.properties)[_i = config2.name]) != null ? _j : _h[_i] = {};
|
|
12373
|
+
const fieldSchema = parentSchema.properties[config2.name];
|
|
12374
|
+
(_k = config2.validation) == null ? void 0 : _k.forEach((v) => {
|
|
12375
|
+
var _a2;
|
|
12376
|
+
if (v.validationType === "required") {
|
|
12377
|
+
(_a2 = parentSchema.required) != null ? _a2 : parentSchema.required = [];
|
|
12378
|
+
parentSchema.required.push(config2.name);
|
|
12379
|
+
} else if (v.validationType === "readOnly") {
|
|
12380
|
+
fieldSchema.type = "string";
|
|
12381
|
+
fieldSchema.disabled = true;
|
|
12418
12382
|
} else {
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
});
|
|
12383
|
+
fieldSchema.type = "string";
|
|
12384
|
+
fieldSchema[v.validationType] = isNaN(v.validationValue) ? v.validationValue : Number(v.validationValue);
|
|
12422
12385
|
}
|
|
12386
|
+
});
|
|
12387
|
+
if (config2.type === "Select" && ((_l = config2.value) == null ? void 0 : _l.length)) {
|
|
12388
|
+
fieldSchema.oneOf = config2.value.map((v) => ({
|
|
12389
|
+
const: v.value,
|
|
12390
|
+
title: v.label
|
|
12391
|
+
}));
|
|
12423
12392
|
}
|
|
12393
|
+
if (config2.type === "MultipleSelect" && ((_m = config2.value) == null ? void 0 : _m.length)) {
|
|
12394
|
+
fieldSchema.type = "array";
|
|
12395
|
+
fieldSchema.items = {
|
|
12396
|
+
oneOf: config2.value.map((v) => ({
|
|
12397
|
+
const: v.value,
|
|
12398
|
+
title: v.label
|
|
12399
|
+
}))
|
|
12400
|
+
};
|
|
12401
|
+
}
|
|
12402
|
+
}
|
|
12403
|
+
const buildSchema = (config2) => {
|
|
12404
|
+
buildSchemaFromConfig(config2, schema);
|
|
12424
12405
|
return schema;
|
|
12425
12406
|
};
|
|
12426
12407
|
const buildUiSchema = (config2, store2) => {
|
|
@@ -12662,5 +12643,5 @@ const buildUiSchema = (config2, store2) => {
|
|
|
12662
12643
|
}
|
|
12663
12644
|
return elements;
|
|
12664
12645
|
};
|
|
12665
|
-
export { buildConfig, buildSchema, buildUiSchema, clearFromSessionStorage, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
|
|
12646
|
+
export { buildConfig, buildSchema, buildUiSchema, clearFromSessionStorage, downloadFile$1 as downloadFile, downloadFileFromUrl, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
|
|
12666
12647
|
//# sourceMappingURL=impaktapps-ui-builder.es.js.map
|