impaktapps-ui-builder 1.0.114-test.1 → 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.
@@ -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, 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;
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 Uint8Array(result2).set(new Uint8Array(arrayBuffer));
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 Uint8Array(object), new Uint8Array(other))) {
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
- emptyBox$1("LazyLoadingTableEmpty2"),
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: "Download", const: "download" }
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
- 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();
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
- document.body.removeChild(link);
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, service2, formDataHolder) {
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
- store2.setFormdata((pre) => {
10141
- return { ...pre, ...handlerResponse == null ? void 0 : handlerResponse.data };
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: doDownload, ...funcParams.functionsProvider },
10293
+ serviceHolder: { downloadFile: downloadFile$1, download: downloadFileFromUrl, ...funcParams.functionsProvider },
10296
10294
  eventGroups,
10297
10295
  functionsProvider: funcParams.functionsProvider,
10298
10296
  formDataHolder
@@ -10301,10 +10299,7 @@ var service = (funcParams) => {
10301
10299
  setPage: async function() {
10302
10300
  var _a, _b, _c;
10303
10301
  funcParams.store.setAdditionalErrors([]);
10304
- funcParams.store.setFormdata((pre) => ({
10305
- ...pre,
10306
- ...funcParams == null ? void 0 : funcParams.initFormData()
10307
- }));
10302
+ funcParams.store.setFormdata((funcParams == null ? void 0 : funcParams.initFormData()) || {});
10308
10303
  funcParams.store.setSchema({ type: "object", properties: {} });
10309
10304
  funcParams.store.newData = {};
10310
10305
  eventGroups = {};
@@ -10348,25 +10343,29 @@ var service = (funcParams) => {
10348
10343
  service: funcParams.service,
10349
10344
  serviceHolder: this,
10350
10345
  eventGroups,
10351
- formDataHolder: {}
10346
+ formDataHolder
10352
10347
  });
10348
+ funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
10353
10349
  uiSchema.elements.push(notifyUiSchema);
10354
10350
  funcParams.store.setUiSchema(uiSchema);
10355
10351
  },
10356
10352
  onCellRenderer: (cellParams) => {
10357
- var _a, _b, _c, _d;
10358
- if (eventGroups.onCellRenderer) {
10353
+ var _a, _b, _c, _d, _e;
10354
+ const cloneEventGroup = _.cloneDeep(eventGroups);
10355
+ if (cloneEventGroup.onCellRenderer) {
10359
10356
  let finalResponse = {};
10360
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]);
10361
- for (const eventConfig of (_d = eventGroups == null ? void 0 : eventGroups.onCellRenderer) == null ? void 0 : _d[path]) {
10362
- executeEventsParameters.store.functionParameters = cellParams;
10363
- finalResponse = executeEvents({
10364
- ...executeEventsParameters,
10365
- config: eventConfig,
10366
- componentName: path
10367
- });
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;
10368
10368
  }
10369
- return finalResponse;
10370
10369
  }
10371
10370
  return {};
10372
10371
  },
@@ -10436,6 +10435,9 @@ var service = (funcParams) => {
10436
10435
  config: eventConfig,
10437
10436
  componentName
10438
10437
  });
10438
+ if (eventConfig.Handler === "refresh") {
10439
+ funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }));
10440
+ }
10439
10441
  }
10440
10442
  }
10441
10443
  }));
@@ -10469,7 +10471,7 @@ var service = (funcParams) => {
10469
10471
  onBack: async function(functionParameters) {
10470
10472
  var _a, _b;
10471
10473
  const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
10472
- await this.callHandler("onBack", functionParameters);
10474
+ this.callHandler("onBack", functionParameters);
10473
10475
  if (((_b = eventGroups == null ? void 0 : eventGroups["onBack"]) == null ? void 0 : _b[path]) === void 0) {
10474
10476
  functionParameters == null ? void 0 : functionParameters.handleBack();
10475
10477
  }
@@ -10477,7 +10479,7 @@ var service = (funcParams) => {
10477
10479
  onNext: async function(functionParameters) {
10478
10480
  var _a, _b;
10479
10481
  const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
10480
- await this.callHandler("onNext", functionParameters);
10482
+ this.callHandler("onNext", functionParameters);
10481
10483
  if (((_b = eventGroups == null ? void 0 : eventGroups["onNext"]) == null ? void 0 : _b[path]) === void 0) {
10482
10484
  functionParameters == null ? void 0 : functionParameters.handleNext();
10483
10485
  }
@@ -10485,27 +10487,38 @@ var service = (funcParams) => {
10485
10487
  onReset: async function(functionParameters) {
10486
10488
  var _a, _b;
10487
10489
  const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
10488
- await this.callHandler("onReset", functionParameters);
10490
+ this.callHandler("onReset", functionParameters);
10489
10491
  if (((_b = eventGroups == null ? void 0 : eventGroups["onReset"]) == null ? void 0 : _b[path]) === void 0) {
10490
10492
  functionParameters == null ? void 0 : functionParameters.handleReset();
10491
10493
  }
10492
10494
  },
10493
- callHandler: async function(eventType, functionParameters) {
10495
+ callHandler: function(eventType, functionParameters) {
10494
10496
  var _a, _b, _c;
10495
10497
  const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[funcParams.dynamicData.path.split(".").length - 1];
10496
10498
  if (((_b = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _b[path]) !== void 0) {
10497
- Promise.all((_c = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _c[path].map((eventConfig) => {
10499
+ (_c = eventGroups == null ? void 0 : eventGroups[eventType]) == null ? void 0 : _c[path].map((eventConfig) => {
10498
10500
  executeEventsParameters.store.functionParameters = functionParameters;
10499
- executeEvents({
10500
- ...executeEventsParameters,
10501
- config: eventConfig,
10502
- componentName: path
10503
- });
10504
- }));
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
+ });
10505
10518
  }
10506
10519
  },
10507
10520
  downloadFile: downloadFile$1,
10508
- download: doDownload,
10521
+ downloadFileFromUrl,
10509
10522
  ...funcParams.functionsProvider
10510
10523
  };
10511
10524
  };
@@ -11118,6 +11131,9 @@ const buildTable = (config2, componentScope2) => {
11118
11131
  if (config2.lazyLoading) {
11119
11132
  table.config.main.lazyLoading = config2.lazyLoading === "YES" ? true : false;
11120
11133
  }
11134
+ if (config2.defaultColumnSize) {
11135
+ table.config.main.defaultColumnSize = config2.defaultColumnSize;
11136
+ }
11121
11137
  if (config2.enableRowMovement) {
11122
11138
  table.config.main.enableRowMovement = config2.enableRowMovement === "YES" ? true : false;
11123
11139
  }
@@ -11181,9 +11197,6 @@ const buildTable = (config2, componentScope2) => {
11181
11197
  if (config2.maxPageSize) {
11182
11198
  table.config.main.maxPageSize = config2.maxPageSize;
11183
11199
  }
11184
- if (config2.initialDensity) {
11185
- table.config.main.initialDensity = config2.initialDensity;
11186
- }
11187
11200
  return table;
11188
11201
  };
11189
11202
  const Box = {
@@ -12314,113 +12327,65 @@ let schema = {
12314
12327
  properties: {},
12315
12328
  required: []
12316
12329
  };
12317
- function buildRule(configObj, tableName, arrayHolderName) {
12318
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12319
- if (arrayHolderName) {
12320
- if ((_c = (_b = (_a = schema.properties) == null ? void 0 : _a[tableName]) == null ? void 0 : _b.items) == null ? void 0 : _c.properties) {
12321
- 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])) {
12322
- schema.properties[tableName].items.properties[configObj.name] = {};
12323
- if (configObj.type === "Select" && ((_h = configObj.value) == null ? void 0 : _h.length) > 0) {
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] = {
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",
12349
12337
  items: {
12350
- oneOf: configObj.value.map((e) => {
12351
- return { const: e.value, title: e.label };
12352
- })
12338
+ type: "object",
12339
+ properties: {},
12340
+ required: []
12353
12341
  }
12354
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;
12355
12353
  }
12356
12354
  }
12357
- if (configObj.validation) {
12358
- configObj.validation.forEach((rule) => {
12359
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l;
12360
- if (tableName) {
12361
- if ((_c2 = (_b2 = (_a2 = schema.properties) == null ? void 0 : _a2[tableName]) == null ? void 0 : _b2.items) == null ? void 0 : _c2.properties) {
12362
- 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])) {
12363
- schema.properties[tableName].items.properties[configObj.name] = {};
12364
- if (configObj.type === "Select" || ((_h2 = configObj.value) == null ? void 0 : _h2.length) > 0) {
12365
- schema.properties[tableName].items.properties[configObj.name] = {
12366
- oneOf: configObj.value.map((e) => {
12367
- return { const: e.value, title: e.label };
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
- });
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;
12418
12366
  } else {
12419
- config2.elements.map((e, elemInd) => {
12420
- buildSchema(e);
12421
- });
12367
+ fieldSchema.type = "string";
12368
+ fieldSchema[v.validationType] = isNaN(v.validationValue) ? v.validationValue : Number(v.validationValue);
12422
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
+ };
12423
12385
  }
12386
+ }
12387
+ const buildSchema = (config2) => {
12388
+ buildSchemaFromConfig(config2, schema);
12424
12389
  return schema;
12425
12390
  };
12426
12391
  const buildUiSchema = (config2, store2) => {
@@ -12662,5 +12627,5 @@ const buildUiSchema = (config2, store2) => {
12662
12627
  }
12663
12628
  return elements;
12664
12629
  };
12665
- 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 };
12666
12631
  //# sourceMappingURL=impaktapps-ui-builder.es.js.map