impaktapps-ui-builder 1.0.110 → 1.0.112

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