impaktapps-ui-builder 1.0.113 → 1.0.114
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 +138 -170
- 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 -12
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +63 -115
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +6 -11
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +7 -14
- 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 +10 -10
- package/src/impaktapps-ui-builder/runtime/services/service.ts +44 -28
|
@@ -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;
|
|
@@ -6310,14 +6310,6 @@ const ComponentSchema = {
|
|
|
6310
6310
|
{ title: "500", const: 500 }
|
|
6311
6311
|
]
|
|
6312
6312
|
},
|
|
6313
|
-
initialDensity: {
|
|
6314
|
-
type: "string",
|
|
6315
|
-
oneOf: [
|
|
6316
|
-
{ title: "Compact", const: "compact" },
|
|
6317
|
-
{ title: "Comfortable", const: "comfortable" },
|
|
6318
|
-
{ title: "Spacious", const: "spacious" }
|
|
6319
|
-
]
|
|
6320
|
-
},
|
|
6321
6313
|
layout: {
|
|
6322
6314
|
type: "array",
|
|
6323
6315
|
items: {
|
|
@@ -6495,7 +6487,8 @@ const ComponentSchema = {
|
|
|
6495
6487
|
{ const: "required", title: "Required" },
|
|
6496
6488
|
{ const: "minLength", title: "Minimum Length" },
|
|
6497
6489
|
{ const: "maxLength", title: "Maximum Length" },
|
|
6498
|
-
{ const: "pattern", title: "Pattern" }
|
|
6490
|
+
{ const: "pattern", title: "Pattern" },
|
|
6491
|
+
{ const: "readOnly", title: "Read Only" }
|
|
6499
6492
|
]
|
|
6500
6493
|
},
|
|
6501
6494
|
validationValue: {
|
|
@@ -7879,14 +7872,14 @@ const buildPropertiesSection = function(type) {
|
|
|
7879
7872
|
getInputField("selectKey", "Selection Key"),
|
|
7880
7873
|
getMultiSelectField("filteringOptions", "Filtering Options"),
|
|
7881
7874
|
getSelectField("maxPageSize", "Max Page Size"),
|
|
7882
|
-
getSelectField("initialDensity", "Initial Toggle Density"),
|
|
7883
7875
|
buildWrapper("Tree Table Properties", [
|
|
7884
7876
|
getRadioInputField("enableRowMovement", "Row Rearrangement", ["YES", "NO"]),
|
|
7885
7877
|
getRadioInputField("enableExpanding", "Row Expanding", ["YES", "NO"]),
|
|
7886
7878
|
getRadioInputField("paginateExpandedRows", "Multi Page Expansion", ["YES", "NO"]),
|
|
7887
7879
|
getRadioInputField("treeStructure", "Flat Tree Structure", ["YES", "NO"]),
|
|
7888
7880
|
getRadioInputField("filterFromLeafRows", "Filter from tree rows", ["YES", "NO"]),
|
|
7889
|
-
|
|
7881
|
+
getInputField("defaultColumnSize", "Default Column Size"),
|
|
7882
|
+
,
|
|
7890
7883
|
emptyBox$1("LazyLoadingTableEmpty3")
|
|
7891
7884
|
]),
|
|
7892
7885
|
getArrayControl("Table_Download_Keys_Name", "KeyName", "Table Key Name"),
|
|
@@ -8440,7 +8433,7 @@ const sectionLabels = {
|
|
|
8440
8433
|
Timer: ["Core", "Events", "Style", "Validation"],
|
|
8441
8434
|
Rank: ["Core", "Events", "Style", "Validation"],
|
|
8442
8435
|
Button: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
8443
|
-
Array: ["Core", "Components", "Properties", "Validation"],
|
|
8436
|
+
Array: ["Core", "Components", "Properties", "Events", "Validation"],
|
|
8444
8437
|
Radio: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
8445
8438
|
Text: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
8446
8439
|
TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
@@ -8832,7 +8825,7 @@ var pageMaster = (funcParams) => {
|
|
|
8832
8825
|
return formData;
|
|
8833
8826
|
}
|
|
8834
8827
|
saveFormdataInSessionStorage(config2);
|
|
8835
|
-
return config2;
|
|
8828
|
+
return { ...config2, type: "page" };
|
|
8836
8829
|
},
|
|
8837
8830
|
getUiSchema: function() {
|
|
8838
8831
|
const UiSchema = _.cloneDeep(PageMasterUiSchema(store2.theme.myTheme));
|
|
@@ -8991,7 +8984,7 @@ const EventSchema = {
|
|
|
8991
8984
|
oneOf: [
|
|
8992
8985
|
{ title: "RankProvider", const: "RankProvider" },
|
|
8993
8986
|
{ title: "Download File", const: "downloadFile" },
|
|
8994
|
-
{ title: "
|
|
8987
|
+
{ title: "downloadFileFromUrl", const: "downloadFileFromUrl" }
|
|
8995
8988
|
]
|
|
8996
8989
|
},
|
|
8997
8990
|
body: {
|
|
@@ -9928,22 +9921,33 @@ var event = (store2, dynamicData2, submitHandler, service2, functionsName) => {
|
|
|
9928
9921
|
}
|
|
9929
9922
|
};
|
|
9930
9923
|
};
|
|
9931
|
-
|
|
9932
|
-
|
|
9933
|
-
const
|
|
9934
|
-
const
|
|
9935
|
-
let
|
|
9936
|
-
|
|
9937
|
-
|
|
9938
|
-
const
|
|
9939
|
-
|
|
9940
|
-
|
|
9941
|
-
|
|
9942
|
-
|
|
9924
|
+
function downloadFile$1({ data, name }) {
|
|
9925
|
+
var _a;
|
|
9926
|
+
const binary = window.atob(data);
|
|
9927
|
+
const bytes = new Uint8Array(binary.length);
|
|
9928
|
+
for (let i = 0; i < binary.length; i++) {
|
|
9929
|
+
bytes[i] = binary.charCodeAt(i);
|
|
9930
|
+
}
|
|
9931
|
+
const extension = (_a = name.split(".").pop()) == null ? void 0 : _a.toLowerCase();
|
|
9932
|
+
const mimeMap = {
|
|
9933
|
+
pdf: "application/pdf",
|
|
9934
|
+
png: "image/png",
|
|
9935
|
+
jpg: "image/jpeg",
|
|
9936
|
+
jpeg: "image/jpeg",
|
|
9937
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
9938
|
+
csv: "text/csv"
|
|
9939
|
+
};
|
|
9940
|
+
const blob = new Blob([bytes], {
|
|
9941
|
+
type: mimeMap[extension] || "application/octet-stream"
|
|
9942
|
+
});
|
|
9943
|
+
const url = URL.createObjectURL(blob);
|
|
9944
|
+
const a = document.createElement("a");
|
|
9945
|
+
a.href = url;
|
|
9946
|
+
a.download = name;
|
|
9947
|
+
a.click();
|
|
9943
9948
|
URL.revokeObjectURL(url);
|
|
9944
|
-
|
|
9945
|
-
|
|
9946
|
-
const doDownload = (response, service2) => {
|
|
9949
|
+
}
|
|
9950
|
+
const downloadFileFromUrl = (response, service2) => {
|
|
9947
9951
|
let url = `${service2.defaults.baseURL}/${response.path}`;
|
|
9948
9952
|
if (response == null ? void 0 : response.params) {
|
|
9949
9953
|
const keysArray = Object.keys(response == null ? void 0 : response.params);
|
|
@@ -10022,7 +10026,6 @@ function executeEventsHandler(params2) {
|
|
|
10022
10026
|
params2.componentName,
|
|
10023
10027
|
params2.config,
|
|
10024
10028
|
params2.store,
|
|
10025
|
-
params2.service,
|
|
10026
10029
|
params2.formDataHolder
|
|
10027
10030
|
);
|
|
10028
10031
|
} else if (params2.config.Handler === "onBackHandler") {
|
|
@@ -10094,7 +10097,7 @@ function executeCustomHandler(params) {
|
|
|
10094
10097
|
return response;
|
|
10095
10098
|
}
|
|
10096
10099
|
}
|
|
10097
|
-
function mergeFormdata(handlerResponse, componentName, eventConfig, store2,
|
|
10100
|
+
function mergeFormdata(handlerResponse, componentName, eventConfig, store2, formDataHolder) {
|
|
10098
10101
|
var _a, _b, _c;
|
|
10099
10102
|
if (eventConfig.type === "Select" && (handlerResponse == null ? void 0 : handlerResponse.data)) {
|
|
10100
10103
|
if (!_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data)) {
|
|
@@ -10132,29 +10135,24 @@ function mergeFormdata(handlerResponse, componentName, eventConfig, store2, serv
|
|
|
10132
10135
|
});
|
|
10133
10136
|
}
|
|
10134
10137
|
} else if (eventConfig.type === "page") {
|
|
10135
|
-
if (!(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
|
|
10138
|
+
if (!(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data) && lodash.exports.isObject(handlerResponse.data))) {
|
|
10136
10139
|
store2.newData = {
|
|
10137
10140
|
...store2.newData,
|
|
10138
10141
|
...handlerResponse == null ? void 0 : handlerResponse.data
|
|
10139
10142
|
};
|
|
10140
|
-
|
|
10141
|
-
|
|
10143
|
+
const keys = Object.keys(handlerResponse.data);
|
|
10144
|
+
keys.map((e) => {
|
|
10145
|
+
formDataHolder[e] = { ...formDataHolder, [e]: handlerResponse.data[e] };
|
|
10142
10146
|
});
|
|
10143
10147
|
}
|
|
10144
10148
|
} else if (eventConfig.type === "Table" && eventConfig.lazyLoading) {
|
|
10145
10149
|
if (handlerResponse && (handlerResponse == null ? void 0 : handlerResponse.data)) {
|
|
10146
10150
|
formDataHolder[componentName] = (_a = handlerResponse.data) == null ? void 0 : _a.data;
|
|
10147
10151
|
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
10152
|
}
|
|
10152
10153
|
} else {
|
|
10153
10154
|
if (handlerResponse) {
|
|
10154
10155
|
formDataHolder[componentName] = handlerResponse.data;
|
|
10155
|
-
store2.setFormdata((pre) => {
|
|
10156
|
-
return { ...pre, ...formDataHolder };
|
|
10157
|
-
});
|
|
10158
10156
|
}
|
|
10159
10157
|
}
|
|
10160
10158
|
}
|
|
@@ -10292,7 +10290,7 @@ var service = (funcParams) => {
|
|
|
10292
10290
|
dynamicData: funcParams.dynamicData,
|
|
10293
10291
|
userValue: funcParams.userValue,
|
|
10294
10292
|
service: funcParams.service,
|
|
10295
|
-
serviceHolder: { downloadFile: downloadFile$1, download:
|
|
10293
|
+
serviceHolder: { downloadFile: downloadFile$1, download: downloadFileFromUrl, ...funcParams.functionsProvider },
|
|
10296
10294
|
eventGroups,
|
|
10297
10295
|
functionsProvider: funcParams.functionsProvider,
|
|
10298
10296
|
formDataHolder
|
|
@@ -10345,25 +10343,29 @@ var service = (funcParams) => {
|
|
|
10345
10343
|
service: funcParams.service,
|
|
10346
10344
|
serviceHolder: this,
|
|
10347
10345
|
eventGroups,
|
|
10348
|
-
formDataHolder
|
|
10346
|
+
formDataHolder
|
|
10349
10347
|
});
|
|
10348
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
|
|
10350
10349
|
uiSchema.elements.push(notifyUiSchema);
|
|
10351
10350
|
funcParams.store.setUiSchema(uiSchema);
|
|
10352
10351
|
},
|
|
10353
10352
|
onCellRenderer: (cellParams) => {
|
|
10354
|
-
var _a, _b, _c, _d;
|
|
10355
|
-
|
|
10353
|
+
var _a, _b, _c, _d, _e;
|
|
10354
|
+
const cloneEventGroup = _.cloneDeep(eventGroups);
|
|
10355
|
+
if (cloneEventGroup.onCellRenderer) {
|
|
10356
10356
|
let finalResponse = {};
|
|
10357
10357
|
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]);
|
|
10358
|
-
|
|
10359
|
-
|
|
10360
|
-
|
|
10361
|
-
|
|
10362
|
-
|
|
10363
|
-
|
|
10364
|
-
|
|
10358
|
+
if ((_d = cloneEventGroup == null ? void 0 : cloneEventGroup.onCellRenderer) == null ? void 0 : _d[path]) {
|
|
10359
|
+
for (const eventConfig of (_e = cloneEventGroup == null ? void 0 : cloneEventGroup.onCellRenderer) == null ? void 0 : _e[path]) {
|
|
10360
|
+
executeEventsParameters.store.functionParameters = cellParams;
|
|
10361
|
+
finalResponse = executeEvents({
|
|
10362
|
+
...executeEventsParameters,
|
|
10363
|
+
config: eventConfig,
|
|
10364
|
+
componentName: path
|
|
10365
|
+
});
|
|
10366
|
+
}
|
|
10367
|
+
return finalResponse;
|
|
10365
10368
|
}
|
|
10366
|
-
return finalResponse;
|
|
10367
10369
|
}
|
|
10368
10370
|
return {};
|
|
10369
10371
|
},
|
|
@@ -10433,6 +10435,9 @@ var service = (funcParams) => {
|
|
|
10433
10435
|
config: eventConfig,
|
|
10434
10436
|
componentName
|
|
10435
10437
|
});
|
|
10438
|
+
if (eventConfig.Handler === "refresh") {
|
|
10439
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
|
|
10440
|
+
}
|
|
10436
10441
|
}
|
|
10437
10442
|
}
|
|
10438
10443
|
}));
|
|
@@ -10466,7 +10471,7 @@ var service = (funcParams) => {
|
|
|
10466
10471
|
onBack: async function(functionParameters) {
|
|
10467
10472
|
var _a, _b;
|
|
10468
10473
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
|
|
10469
|
-
|
|
10474
|
+
this.callHandler("onBack", functionParameters);
|
|
10470
10475
|
if (((_b = eventGroups == null ? void 0 : eventGroups["onBack"]) == null ? void 0 : _b[path]) === void 0) {
|
|
10471
10476
|
functionParameters == null ? void 0 : functionParameters.handleBack();
|
|
10472
10477
|
}
|
|
@@ -10474,7 +10479,7 @@ var service = (funcParams) => {
|
|
|
10474
10479
|
onNext: async function(functionParameters) {
|
|
10475
10480
|
var _a, _b;
|
|
10476
10481
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
|
|
10477
|
-
|
|
10482
|
+
this.callHandler("onNext", functionParameters);
|
|
10478
10483
|
if (((_b = eventGroups == null ? void 0 : eventGroups["onNext"]) == null ? void 0 : _b[path]) === void 0) {
|
|
10479
10484
|
functionParameters == null ? void 0 : functionParameters.handleNext();
|
|
10480
10485
|
}
|
|
@@ -10482,27 +10487,38 @@ var service = (funcParams) => {
|
|
|
10482
10487
|
onReset: async function(functionParameters) {
|
|
10483
10488
|
var _a, _b;
|
|
10484
10489
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
|
|
10485
|
-
|
|
10490
|
+
this.callHandler("onReset", functionParameters);
|
|
10486
10491
|
if (((_b = eventGroups == null ? void 0 : eventGroups["onReset"]) == null ? void 0 : _b[path]) === void 0) {
|
|
10487
10492
|
functionParameters == null ? void 0 : functionParameters.handleReset();
|
|
10488
10493
|
}
|
|
10489
10494
|
},
|
|
10490
|
-
callHandler:
|
|
10495
|
+
callHandler: function(eventType, functionParameters) {
|
|
10491
10496
|
var _a, _b, _c;
|
|
10492
10497
|
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[funcParams.dynamicData.path.split(".").length - 1];
|
|
10493
10498
|
if (((_b = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _b[path]) !== void 0) {
|
|
10494
|
-
|
|
10499
|
+
(_c = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _c[path].map((eventConfig) => {
|
|
10495
10500
|
executeEventsParameters.store.functionParameters = functionParameters;
|
|
10496
|
-
|
|
10497
|
-
|
|
10498
|
-
|
|
10499
|
-
|
|
10500
|
-
|
|
10501
|
-
|
|
10501
|
+
if (eventConfig.Handler === "refresh") {
|
|
10502
|
+
executeEvents({
|
|
10503
|
+
...executeEventsParameters,
|
|
10504
|
+
config: eventConfig,
|
|
10505
|
+
componentName: path,
|
|
10506
|
+
formDataHolder
|
|
10507
|
+
}).then((res) => {
|
|
10508
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
|
|
10509
|
+
});
|
|
10510
|
+
} else {
|
|
10511
|
+
executeEvents({
|
|
10512
|
+
...executeEventsParameters,
|
|
10513
|
+
config: eventConfig,
|
|
10514
|
+
componentName: path
|
|
10515
|
+
});
|
|
10516
|
+
}
|
|
10517
|
+
});
|
|
10502
10518
|
}
|
|
10503
10519
|
},
|
|
10504
10520
|
downloadFile: downloadFile$1,
|
|
10505
|
-
|
|
10521
|
+
downloadFileFromUrl,
|
|
10506
10522
|
...funcParams.functionsProvider
|
|
10507
10523
|
};
|
|
10508
10524
|
};
|
|
@@ -11115,6 +11131,9 @@ const buildTable = (config2, componentScope2) => {
|
|
|
11115
11131
|
if (config2.lazyLoading) {
|
|
11116
11132
|
table.config.main.lazyLoading = config2.lazyLoading === "YES" ? true : false;
|
|
11117
11133
|
}
|
|
11134
|
+
if (config2.defaultColumnSize) {
|
|
11135
|
+
table.config.main.defaultColumnSize = config2.defaultColumnSize;
|
|
11136
|
+
}
|
|
11118
11137
|
if (config2.enableRowMovement) {
|
|
11119
11138
|
table.config.main.enableRowMovement = config2.enableRowMovement === "YES" ? true : false;
|
|
11120
11139
|
}
|
|
@@ -11178,9 +11197,6 @@ const buildTable = (config2, componentScope2) => {
|
|
|
11178
11197
|
if (config2.maxPageSize) {
|
|
11179
11198
|
table.config.main.maxPageSize = config2.maxPageSize;
|
|
11180
11199
|
}
|
|
11181
|
-
if (config2.initialDensity) {
|
|
11182
|
-
table.config.main.initialDensity = config2.initialDensity;
|
|
11183
|
-
}
|
|
11184
11200
|
return table;
|
|
11185
11201
|
};
|
|
11186
11202
|
const Box = {
|
|
@@ -12311,113 +12327,65 @@ let schema = {
|
|
|
12311
12327
|
properties: {},
|
|
12312
12328
|
required: []
|
|
12313
12329
|
};
|
|
12314
|
-
function
|
|
12315
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
12316
|
-
if (
|
|
12317
|
-
if (
|
|
12318
|
-
|
|
12319
|
-
|
|
12320
|
-
|
|
12321
|
-
schema.properties[tableName].items.properties[configObj.name] = {
|
|
12322
|
-
oneOf: configObj.value.map((e) => {
|
|
12323
|
-
return { const: e.value, title: e.label };
|
|
12324
|
-
})
|
|
12325
|
-
};
|
|
12326
|
-
} else if (configObj.type === "MultipleSelect" && ((_i = configObj.value) == null ? void 0 : _i.length) > 0) {
|
|
12327
|
-
schema.properties[tableName].items.properties[configObj.name] = {
|
|
12328
|
-
items: {
|
|
12329
|
-
oneOf: configObj.value.map((e) => {
|
|
12330
|
-
return { const: e.value, title: e.label };
|
|
12331
|
-
})
|
|
12332
|
-
}
|
|
12333
|
-
};
|
|
12334
|
-
}
|
|
12335
|
-
}
|
|
12336
|
-
}
|
|
12337
|
-
} else if ((configObj.type === "Select" || configObj.type === "MultipleSelect") && ((_j = configObj.value) == null ? void 0 : _j.length) > 0) {
|
|
12338
|
-
if (configObj.type === "Select") {
|
|
12339
|
-
schema.properties[configObj.name] = {
|
|
12340
|
-
oneOf: configObj.value.map((e) => {
|
|
12341
|
-
return { const: e.value, title: e.label };
|
|
12342
|
-
})
|
|
12343
|
-
};
|
|
12344
|
-
} else if (configObj.type === "MultipleSelect") {
|
|
12345
|
-
schema.properties[configObj.name] = {
|
|
12330
|
+
function buildSchemaFromConfig(config2, parentSchema) {
|
|
12331
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
12332
|
+
if (config2.elements) {
|
|
12333
|
+
if (config2.type === "Array") {
|
|
12334
|
+
(_a = parentSchema.properties) != null ? _a : parentSchema.properties = {};
|
|
12335
|
+
(_d = (_b = parentSchema.properties)[_c = config2.name]) != null ? _d : _b[_c] = {
|
|
12336
|
+
type: "array",
|
|
12346
12337
|
items: {
|
|
12347
|
-
|
|
12348
|
-
|
|
12349
|
-
|
|
12338
|
+
type: "object",
|
|
12339
|
+
properties: {},
|
|
12340
|
+
required: []
|
|
12350
12341
|
}
|
|
12351
12342
|
};
|
|
12343
|
+
const arrayItemSchema = parentSchema.properties[config2.name].items;
|
|
12344
|
+
(_e = config2.elements) == null ? void 0 : _e.forEach(
|
|
12345
|
+
(child) => buildSchemaFromConfig(child, arrayItemSchema)
|
|
12346
|
+
);
|
|
12347
|
+
return;
|
|
12348
|
+
} else {
|
|
12349
|
+
(_f = config2.elements) == null ? void 0 : _f.forEach(
|
|
12350
|
+
(child) => buildSchemaFromConfig(child, parentSchema)
|
|
12351
|
+
);
|
|
12352
|
+
return;
|
|
12352
12353
|
}
|
|
12353
12354
|
}
|
|
12354
|
-
|
|
12355
|
-
|
|
12356
|
-
|
|
12357
|
-
|
|
12358
|
-
|
|
12359
|
-
|
|
12360
|
-
|
|
12361
|
-
|
|
12362
|
-
|
|
12363
|
-
|
|
12364
|
-
|
|
12365
|
-
})
|
|
12366
|
-
};
|
|
12367
|
-
} else if (configObj.type === "MultipleSelect" || ((_i2 = configObj.value) == null ? void 0 : _i2.length) > 0) {
|
|
12368
|
-
schema.properties[tableName].items.properties[configObj.name] = {
|
|
12369
|
-
items: {
|
|
12370
|
-
oneOf: configObj.value.map((e) => {
|
|
12371
|
-
return { const: e.value, title: e.label };
|
|
12372
|
-
})
|
|
12373
|
-
}
|
|
12374
|
-
};
|
|
12375
|
-
}
|
|
12376
|
-
}
|
|
12377
|
-
if (rule.validationType === "required") {
|
|
12378
|
-
(_l = (_k = (_j2 = schema.properties) == null ? void 0 : _j2[tableName]) == null ? void 0 : _k.items) == null ? void 0 : _l.required.push(configObj.name);
|
|
12379
|
-
} else {
|
|
12380
|
-
schema.properties[tableName].items.properties[configObj.name]["type"] = "string";
|
|
12381
|
-
schema.properties[tableName].items.properties[configObj.name][rule.validationType] = isNaN(rule.validationValue) ? rule.validationValue : Number(rule.validationValue);
|
|
12382
|
-
}
|
|
12383
|
-
}
|
|
12384
|
-
} else {
|
|
12385
|
-
if (!schema.properties[configObj.name]) {
|
|
12386
|
-
schema.properties[configObj.name] = {};
|
|
12387
|
-
}
|
|
12388
|
-
if (rule.validationType === "required") {
|
|
12389
|
-
schema.required.push(configObj.name);
|
|
12390
|
-
} else {
|
|
12391
|
-
schema.properties[configObj.name]["type"] = "string";
|
|
12392
|
-
schema.properties[configObj.name][rule.validationType] = isNaN(rule.validationValue) ? rule.validationValue : Number(rule.validationValue);
|
|
12393
|
-
}
|
|
12394
|
-
}
|
|
12395
|
-
});
|
|
12396
|
-
}
|
|
12397
|
-
}
|
|
12398
|
-
const buildSchema = (config2, tableName, isArrayType) => {
|
|
12399
|
-
buildRule(config2, tableName, isArrayType);
|
|
12400
|
-
if (config2 == null ? void 0 : config2.elements) {
|
|
12401
|
-
if (config2.type == "Array") {
|
|
12402
|
-
if (!schema.properties[config2.name]) {
|
|
12403
|
-
schema.properties[config2.name] = {
|
|
12404
|
-
type: "array",
|
|
12405
|
-
items: {
|
|
12406
|
-
type: "object",
|
|
12407
|
-
properties: {},
|
|
12408
|
-
required: []
|
|
12409
|
-
}
|
|
12410
|
-
};
|
|
12411
|
-
}
|
|
12412
|
-
config2.elements.map((e, elemInd) => {
|
|
12413
|
-
buildSchema(e, config2.name, config2.type === "Array" ? true : false);
|
|
12414
|
-
});
|
|
12355
|
+
(_g = parentSchema.properties) != null ? _g : parentSchema.properties = {};
|
|
12356
|
+
(_j = (_h = parentSchema.properties)[_i = config2.name]) != null ? _j : _h[_i] = {};
|
|
12357
|
+
const fieldSchema = parentSchema.properties[config2.name];
|
|
12358
|
+
(_k = config2.validation) == null ? void 0 : _k.forEach((v) => {
|
|
12359
|
+
var _a2;
|
|
12360
|
+
if (v.validationType === "required") {
|
|
12361
|
+
(_a2 = parentSchema.required) != null ? _a2 : parentSchema.required = [];
|
|
12362
|
+
parentSchema.required.push(config2.name);
|
|
12363
|
+
} else if (v.validationType === "readOnly") {
|
|
12364
|
+
fieldSchema.type = "string";
|
|
12365
|
+
fieldSchema.disabled = true;
|
|
12415
12366
|
} else {
|
|
12416
|
-
|
|
12417
|
-
|
|
12418
|
-
});
|
|
12367
|
+
fieldSchema.type = "string";
|
|
12368
|
+
fieldSchema[v.validationType] = isNaN(v.validationValue) ? v.validationValue : Number(v.validationValue);
|
|
12419
12369
|
}
|
|
12370
|
+
});
|
|
12371
|
+
if (config2.type === "Select" && ((_l = config2.value) == null ? void 0 : _l.length)) {
|
|
12372
|
+
fieldSchema.oneOf = config2.value.map((v) => ({
|
|
12373
|
+
const: v.value,
|
|
12374
|
+
title: v.label
|
|
12375
|
+
}));
|
|
12376
|
+
}
|
|
12377
|
+
if (config2.type === "MultipleSelect" && ((_m = config2.value) == null ? void 0 : _m.length)) {
|
|
12378
|
+
fieldSchema.type = "array";
|
|
12379
|
+
fieldSchema.items = {
|
|
12380
|
+
oneOf: config2.value.map((v) => ({
|
|
12381
|
+
const: v.value,
|
|
12382
|
+
title: v.label
|
|
12383
|
+
}))
|
|
12384
|
+
};
|
|
12420
12385
|
}
|
|
12386
|
+
}
|
|
12387
|
+
const buildSchema = (config2) => {
|
|
12388
|
+
buildSchemaFromConfig(config2, schema);
|
|
12421
12389
|
return schema;
|
|
12422
12390
|
};
|
|
12423
12391
|
const buildUiSchema = (config2, store2) => {
|
|
@@ -12659,5 +12627,5 @@ const buildUiSchema = (config2, store2) => {
|
|
|
12659
12627
|
}
|
|
12660
12628
|
return elements;
|
|
12661
12629
|
};
|
|
12662
|
-
export { buildConfig, buildSchema, buildUiSchema, clearFromSessionStorage, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
|
|
12630
|
+
export { buildConfig, buildSchema, buildUiSchema, clearFromSessionStorage, downloadFile$1 as downloadFile, downloadFileFromUrl, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
|
|
12663
12631
|
//# sourceMappingURL=impaktapps-ui-builder.es.js.map
|