impaktapps-ui-builder 1.0.120 → 1.0.122
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 +144 -166
- 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 +52 -37
|
@@ -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
|
|
@@ -10301,10 +10307,7 @@ var service = (funcParams) => {
|
|
|
10301
10307
|
setPage: async function() {
|
|
10302
10308
|
var _a, _b, _c;
|
|
10303
10309
|
funcParams.store.setAdditionalErrors([]);
|
|
10304
|
-
funcParams.store.setFormdata((
|
|
10305
|
-
...pre,
|
|
10306
|
-
...funcParams == null ? void 0 : funcParams.initFormData()
|
|
10307
|
-
}));
|
|
10310
|
+
funcParams.store.setFormdata((funcParams == null ? void 0 : funcParams.initFormData()) || {});
|
|
10308
10311
|
funcParams.store.setSchema({ type: "object", properties: {} });
|
|
10309
10312
|
funcParams.store.newData = {};
|
|
10310
10313
|
eventGroups = {};
|
|
@@ -10339,7 +10342,7 @@ var service = (funcParams) => {
|
|
|
10339
10342
|
};
|
|
10340
10343
|
}
|
|
10341
10344
|
);
|
|
10342
|
-
|
|
10345
|
+
executeRefreshHandler({
|
|
10343
10346
|
config: {},
|
|
10344
10347
|
componentName: "",
|
|
10345
10348
|
store: funcParams.store,
|
|
@@ -10348,25 +10351,30 @@ var service = (funcParams) => {
|
|
|
10348
10351
|
service: funcParams.service,
|
|
10349
10352
|
serviceHolder: this,
|
|
10350
10353
|
eventGroups,
|
|
10351
|
-
formDataHolder
|
|
10354
|
+
formDataHolder
|
|
10355
|
+
}).then((e) => {
|
|
10356
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
|
|
10357
|
+
uiSchema.elements.push(notifyUiSchema);
|
|
10358
|
+
funcParams.store.setUiSchema(uiSchema);
|
|
10352
10359
|
});
|
|
10353
|
-
uiSchema.elements.push(notifyUiSchema);
|
|
10354
|
-
funcParams.store.setUiSchema(uiSchema);
|
|
10355
10360
|
},
|
|
10356
10361
|
onCellRenderer: (cellParams) => {
|
|
10357
|
-
var _a, _b, _c, _d;
|
|
10358
|
-
|
|
10362
|
+
var _a, _b, _c, _d, _e;
|
|
10363
|
+
const cloneEventGroup = _.cloneDeep(eventGroups);
|
|
10364
|
+
if (cloneEventGroup.onCellRenderer) {
|
|
10359
10365
|
let finalResponse = {};
|
|
10360
10366
|
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
|
-
|
|
10367
|
+
if ((_d = cloneEventGroup == null ? void 0 : cloneEventGroup.onCellRenderer) == null ? void 0 : _d[path]) {
|
|
10368
|
+
for (const eventConfig of (_e = cloneEventGroup == null ? void 0 : cloneEventGroup.onCellRenderer) == null ? void 0 : _e[path]) {
|
|
10369
|
+
executeEventsParameters.store.functionParameters = cellParams;
|
|
10370
|
+
finalResponse = executeEvents({
|
|
10371
|
+
...executeEventsParameters,
|
|
10372
|
+
config: eventConfig,
|
|
10373
|
+
componentName: path
|
|
10374
|
+
});
|
|
10375
|
+
}
|
|
10376
|
+
return finalResponse;
|
|
10368
10377
|
}
|
|
10369
|
-
return finalResponse;
|
|
10370
10378
|
}
|
|
10371
10379
|
return {};
|
|
10372
10380
|
},
|
|
@@ -10434,8 +10442,12 @@ var service = (funcParams) => {
|
|
|
10434
10442
|
await executeEvents({
|
|
10435
10443
|
...executeEventsParameters,
|
|
10436
10444
|
config: eventConfig,
|
|
10437
|
-
componentName
|
|
10445
|
+
componentName,
|
|
10446
|
+
formDataHolder
|
|
10438
10447
|
});
|
|
10448
|
+
if (eventConfig.Handler === "refresh") {
|
|
10449
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
|
|
10450
|
+
}
|
|
10439
10451
|
}
|
|
10440
10452
|
}
|
|
10441
10453
|
}));
|
|
@@ -10469,7 +10481,7 @@ var service = (funcParams) => {
|
|
|
10469
10481
|
onBack: async function(functionParameters) {
|
|
10470
10482
|
var _a, _b;
|
|
10471
10483
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
|
|
10472
|
-
|
|
10484
|
+
this.callHandler("onBack", functionParameters);
|
|
10473
10485
|
if (((_b = eventGroups == null ? void 0 : eventGroups["onBack"]) == null ? void 0 : _b[path]) === void 0) {
|
|
10474
10486
|
functionParameters == null ? void 0 : functionParameters.handleBack();
|
|
10475
10487
|
}
|
|
@@ -10477,7 +10489,7 @@ var service = (funcParams) => {
|
|
|
10477
10489
|
onNext: async function(functionParameters) {
|
|
10478
10490
|
var _a, _b;
|
|
10479
10491
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
|
|
10480
|
-
|
|
10492
|
+
this.callHandler("onNext", functionParameters);
|
|
10481
10493
|
if (((_b = eventGroups == null ? void 0 : eventGroups["onNext"]) == null ? void 0 : _b[path]) === void 0) {
|
|
10482
10494
|
functionParameters == null ? void 0 : functionParameters.handleNext();
|
|
10483
10495
|
}
|
|
@@ -10485,27 +10497,38 @@ var service = (funcParams) => {
|
|
|
10485
10497
|
onReset: async function(functionParameters) {
|
|
10486
10498
|
var _a, _b;
|
|
10487
10499
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
|
|
10488
|
-
|
|
10500
|
+
this.callHandler("onReset", functionParameters);
|
|
10489
10501
|
if (((_b = eventGroups == null ? void 0 : eventGroups["onReset"]) == null ? void 0 : _b[path]) === void 0) {
|
|
10490
10502
|
functionParameters == null ? void 0 : functionParameters.handleReset();
|
|
10491
10503
|
}
|
|
10492
10504
|
},
|
|
10493
|
-
callHandler:
|
|
10505
|
+
callHandler: function(eventType, functionParameters) {
|
|
10494
10506
|
var _a, _b, _c;
|
|
10495
10507
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[funcParams.dynamicData.path.split(".").length - 1];
|
|
10496
10508
|
if (((_b = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _b[path]) !== void 0) {
|
|
10497
|
-
|
|
10509
|
+
(_c = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _c[path].map((eventConfig) => {
|
|
10498
10510
|
executeEventsParameters.store.functionParameters = functionParameters;
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10502
|
-
|
|
10503
|
-
|
|
10504
|
-
|
|
10511
|
+
if (eventConfig.Handler === "refresh") {
|
|
10512
|
+
executeEvents({
|
|
10513
|
+
...executeEventsParameters,
|
|
10514
|
+
config: eventConfig,
|
|
10515
|
+
componentName: path,
|
|
10516
|
+
formDataHolder
|
|
10517
|
+
}).then((res) => {
|
|
10518
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
|
|
10519
|
+
});
|
|
10520
|
+
} else {
|
|
10521
|
+
executeEvents({
|
|
10522
|
+
...executeEventsParameters,
|
|
10523
|
+
config: eventConfig,
|
|
10524
|
+
componentName: path
|
|
10525
|
+
});
|
|
10526
|
+
}
|
|
10527
|
+
});
|
|
10505
10528
|
}
|
|
10506
10529
|
},
|
|
10507
10530
|
downloadFile: downloadFile$1,
|
|
10508
|
-
|
|
10531
|
+
downloadFileFromUrl,
|
|
10509
10532
|
...funcParams.functionsProvider
|
|
10510
10533
|
};
|
|
10511
10534
|
};
|
|
@@ -11118,6 +11141,9 @@ const buildTable = (config2, componentScope2) => {
|
|
|
11118
11141
|
if (config2.lazyLoading) {
|
|
11119
11142
|
table.config.main.lazyLoading = config2.lazyLoading === "YES" ? true : false;
|
|
11120
11143
|
}
|
|
11144
|
+
if (config2.defaultColumnSize) {
|
|
11145
|
+
table.config.main.defaultColumnSize = config2.defaultColumnSize;
|
|
11146
|
+
}
|
|
11121
11147
|
if (config2.enableRowMovement) {
|
|
11122
11148
|
table.config.main.enableRowMovement = config2.enableRowMovement === "YES" ? true : false;
|
|
11123
11149
|
}
|
|
@@ -12314,113 +12340,65 @@ let schema = {
|
|
|
12314
12340
|
properties: {},
|
|
12315
12341
|
required: []
|
|
12316
12342
|
};
|
|
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] = {
|
|
12343
|
+
function buildSchemaFromConfig(config2, parentSchema) {
|
|
12344
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
12345
|
+
if (config2.elements) {
|
|
12346
|
+
if (config2.type === "Array") {
|
|
12347
|
+
(_a = parentSchema.properties) != null ? _a : parentSchema.properties = {};
|
|
12348
|
+
(_d = (_b = parentSchema.properties)[_c = config2.name]) != null ? _d : _b[_c] = {
|
|
12349
|
+
type: "array",
|
|
12349
12350
|
items: {
|
|
12350
|
-
|
|
12351
|
-
|
|
12352
|
-
|
|
12351
|
+
type: "object",
|
|
12352
|
+
properties: {},
|
|
12353
|
+
required: []
|
|
12353
12354
|
}
|
|
12354
12355
|
};
|
|
12356
|
+
const arrayItemSchema = parentSchema.properties[config2.name].items;
|
|
12357
|
+
(_e = config2.elements) == null ? void 0 : _e.forEach(
|
|
12358
|
+
(child) => buildSchemaFromConfig(child, arrayItemSchema)
|
|
12359
|
+
);
|
|
12360
|
+
return;
|
|
12361
|
+
} else {
|
|
12362
|
+
(_f = config2.elements) == null ? void 0 : _f.forEach(
|
|
12363
|
+
(child) => buildSchemaFromConfig(child, parentSchema)
|
|
12364
|
+
);
|
|
12365
|
+
return;
|
|
12355
12366
|
}
|
|
12356
12367
|
}
|
|
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
|
-
});
|
|
12368
|
+
(_g = parentSchema.properties) != null ? _g : parentSchema.properties = {};
|
|
12369
|
+
(_j = (_h = parentSchema.properties)[_i = config2.name]) != null ? _j : _h[_i] = {};
|
|
12370
|
+
const fieldSchema = parentSchema.properties[config2.name];
|
|
12371
|
+
(_k = config2.validation) == null ? void 0 : _k.forEach((v) => {
|
|
12372
|
+
var _a2;
|
|
12373
|
+
if (v.validationType === "required") {
|
|
12374
|
+
(_a2 = parentSchema.required) != null ? _a2 : parentSchema.required = [];
|
|
12375
|
+
parentSchema.required.push(config2.name);
|
|
12376
|
+
} else if (v.validationType === "readOnly") {
|
|
12377
|
+
fieldSchema.type = "string";
|
|
12378
|
+
fieldSchema.disabled = true;
|
|
12418
12379
|
} else {
|
|
12419
|
-
|
|
12420
|
-
|
|
12421
|
-
});
|
|
12380
|
+
fieldSchema.type = "string";
|
|
12381
|
+
fieldSchema[v.validationType] = isNaN(v.validationValue) ? v.validationValue : Number(v.validationValue);
|
|
12422
12382
|
}
|
|
12383
|
+
});
|
|
12384
|
+
if (config2.type === "Select" && ((_l = config2.value) == null ? void 0 : _l.length)) {
|
|
12385
|
+
fieldSchema.oneOf = config2.value.map((v) => ({
|
|
12386
|
+
const: v.value,
|
|
12387
|
+
title: v.label
|
|
12388
|
+
}));
|
|
12423
12389
|
}
|
|
12390
|
+
if (config2.type === "MultipleSelect" && ((_m = config2.value) == null ? void 0 : _m.length)) {
|
|
12391
|
+
fieldSchema.type = "array";
|
|
12392
|
+
fieldSchema.items = {
|
|
12393
|
+
oneOf: config2.value.map((v) => ({
|
|
12394
|
+
const: v.value,
|
|
12395
|
+
title: v.label
|
|
12396
|
+
}))
|
|
12397
|
+
};
|
|
12398
|
+
}
|
|
12399
|
+
}
|
|
12400
|
+
const buildSchema = (config2) => {
|
|
12401
|
+
buildSchemaFromConfig(config2, schema);
|
|
12424
12402
|
return schema;
|
|
12425
12403
|
};
|
|
12426
12404
|
const buildUiSchema = (config2, store2) => {
|
|
@@ -12662,5 +12640,5 @@ const buildUiSchema = (config2, store2) => {
|
|
|
12662
12640
|
}
|
|
12663
12641
|
return elements;
|
|
12664
12642
|
};
|
|
12665
|
-
export { buildConfig, buildSchema, buildUiSchema, clearFromSessionStorage, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
|
|
12643
|
+
export { buildConfig, buildSchema, buildUiSchema, clearFromSessionStorage, downloadFile$1 as downloadFile, downloadFileFromUrl, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
|
|
12666
12644
|
//# sourceMappingURL=impaktapps-ui-builder.es.js.map
|