impaktapps-ui-builder 1.0.111 → 1.0.113

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,34 +10345,30 @@ 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
  },
10372
- onClick: async function() {
10373
- await this.callHandler("onClick");
10370
+ onClick: function() {
10371
+ this.callHandler("onClick");
10374
10372
  },
10375
10373
  onKeyDown: function() {
10376
10374
  this.callHandler("onKeyDown");
@@ -10484,7 +10482,7 @@ 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
  }
@@ -10493,28 +10491,18 @@ var service = (funcParams) => {
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(async (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
- await executeRefreshHandler({
10500
- ...executeEventsParameters,
10501
- config: eventConfig,
10502
- componentName: path,
10503
- formDataHolder
10504
- });
10505
- funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
10506
- } else {
10507
- executeEvents({
10508
- ...executeEventsParameters,
10509
- config: eventConfig,
10510
- componentName: path
10511
- });
10512
- }
10513
- });
10496
+ executeEvents({
10497
+ ...executeEventsParameters,
10498
+ config: eventConfig,
10499
+ componentName: path
10500
+ });
10501
+ }));
10514
10502
  }
10515
10503
  },
10516
10504
  downloadFile: downloadFile$1,
10517
- downloadFileFromUrl,
10505
+ download: doDownload,
10518
10506
  ...funcParams.functionsProvider
10519
10507
  };
10520
10508
  };
@@ -11127,9 +11115,6 @@ const buildTable = (config2, componentScope2) => {
11127
11115
  if (config2.lazyLoading) {
11128
11116
  table.config.main.lazyLoading = config2.lazyLoading === "YES" ? true : false;
11129
11117
  }
11130
- if (config2.defaultColumnSize) {
11131
- table.config.main.defaultColumnSize = config2.defaultColumnSize;
11132
- }
11133
11118
  if (config2.enableRowMovement) {
11134
11119
  table.config.main.enableRowMovement = config2.enableRowMovement === "YES" ? true : false;
11135
11120
  }
@@ -11193,6 +11178,9 @@ const buildTable = (config2, componentScope2) => {
11193
11178
  if (config2.maxPageSize) {
11194
11179
  table.config.main.maxPageSize = config2.maxPageSize;
11195
11180
  }
11181
+ if (config2.initialDensity) {
11182
+ table.config.main.initialDensity = config2.initialDensity;
11183
+ }
11196
11184
  return table;
11197
11185
  };
11198
11186
  const Box = {
@@ -12323,65 +12311,113 @@ let schema = {
12323
12311
  properties: {},
12324
12312
  required: []
12325
12313
  };
12326
- function buildSchemaFromConfig(config2, parentSchema) {
12327
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
12328
- if (config2.elements) {
12329
- if (config2.type === "Array") {
12330
- (_a = parentSchema.properties) != null ? _a : parentSchema.properties = {};
12331
- (_d = (_b = parentSchema.properties)[_c = config2.name]) != null ? _d : _b[_c] = {
12332
- type: "array",
12314
+ function buildRule(configObj, tableName, arrayHolderName) {
12315
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12316
+ if (arrayHolderName) {
12317
+ if ((_c = (_b = (_a = schema.properties) == null ? void 0 : _a[tableName]) == null ? void 0 : _b.items) == null ? void 0 : _c.properties) {
12318
+ 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])) {
12319
+ schema.properties[tableName].items.properties[configObj.name] = {};
12320
+ if (configObj.type === "Select" && ((_h = configObj.value) == null ? void 0 : _h.length) > 0) {
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] = {
12333
12346
  items: {
12334
- type: "object",
12335
- properties: {},
12336
- required: []
12347
+ oneOf: configObj.value.map((e) => {
12348
+ return { const: e.value, title: e.label };
12349
+ })
12337
12350
  }
12338
12351
  };
12339
- const arrayItemSchema = parentSchema.properties[config2.name].items;
12340
- (_e = config2.elements) == null ? void 0 : _e.forEach(
12341
- (child) => buildSchemaFromConfig(child, arrayItemSchema)
12342
- );
12343
- return;
12344
- } else {
12345
- (_f = config2.elements) == null ? void 0 : _f.forEach(
12346
- (child) => buildSchemaFromConfig(child, parentSchema)
12347
- );
12348
- return;
12349
12352
  }
12350
12353
  }
12351
- (_g = parentSchema.properties) != null ? _g : parentSchema.properties = {};
12352
- (_j = (_h = parentSchema.properties)[_i = config2.name]) != null ? _j : _h[_i] = {};
12353
- const fieldSchema = parentSchema.properties[config2.name];
12354
- (_k = config2.validation) == null ? void 0 : _k.forEach((v) => {
12355
- var _a2;
12356
- if (v.validationType === "required") {
12357
- (_a2 = parentSchema.required) != null ? _a2 : parentSchema.required = [];
12358
- parentSchema.required.push(config2.name);
12359
- } else if (v.validationType === "readOnly") {
12360
- fieldSchema.type = "string";
12361
- fieldSchema.disabled = true;
12354
+ if (configObj.validation) {
12355
+ configObj.validation.forEach((rule) => {
12356
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l;
12357
+ if (tableName) {
12358
+ if ((_c2 = (_b2 = (_a2 = schema.properties) == null ? void 0 : _a2[tableName]) == null ? void 0 : _b2.items) == null ? void 0 : _c2.properties) {
12359
+ 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])) {
12360
+ schema.properties[tableName].items.properties[configObj.name] = {};
12361
+ if (configObj.type === "Select" || ((_h2 = configObj.value) == null ? void 0 : _h2.length) > 0) {
12362
+ schema.properties[tableName].items.properties[configObj.name] = {
12363
+ oneOf: configObj.value.map((e) => {
12364
+ return { const: e.value, title: e.label };
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
+ });
12362
12415
  } else {
12363
- fieldSchema.type = "string";
12364
- fieldSchema[v.validationType] = isNaN(v.validationValue) ? v.validationValue : Number(v.validationValue);
12416
+ config2.elements.map((e, elemInd) => {
12417
+ buildSchema(e);
12418
+ });
12365
12419
  }
12366
- });
12367
- if (config2.type === "Select" && ((_l = config2.value) == null ? void 0 : _l.length)) {
12368
- fieldSchema.oneOf = config2.value.map((v) => ({
12369
- const: v.value,
12370
- title: v.label
12371
- }));
12372
- }
12373
- if (config2.type === "MultipleSelect" && ((_m = config2.value) == null ? void 0 : _m.length)) {
12374
- fieldSchema.type = "array";
12375
- fieldSchema.items = {
12376
- oneOf: config2.value.map((v) => ({
12377
- const: v.value,
12378
- title: v.label
12379
- }))
12380
- };
12381
12420
  }
12382
- }
12383
- const buildSchema = (config2) => {
12384
- buildSchemaFromConfig(config2, schema);
12385
12421
  return schema;
12386
12422
  };
12387
12423
  const buildUiSchema = (config2, store2) => {
@@ -12623,5 +12659,5 @@ const buildUiSchema = (config2, store2) => {
12623
12659
  }
12624
12660
  return elements;
12625
12661
  };
12626
- export { buildConfig, buildSchema, buildUiSchema, clearFromSessionStorage, downloadFile$1 as downloadFile, downloadFileFromUrl, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
12662
+ export { buildConfig, buildSchema, buildUiSchema, clearFromSessionStorage, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
12627
12663
  //# sourceMappingURL=impaktapps-ui-builder.es.js.map