impaktapps-ui-builder 1.0.101 → 1.0.103

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;
@@ -6299,6 +6299,17 @@ const ComponentSchema = {
6299
6299
  { title: "Put", const: "put" }
6300
6300
  ]
6301
6301
  },
6302
+ maxPageSize: {
6303
+ type: "number",
6304
+ oneOf: [
6305
+ { title: "10", const: 10 },
6306
+ { title: "20", const: 20 },
6307
+ { title: "30", const: 30 },
6308
+ { title: "50", const: 50 },
6309
+ { title: "100", const: 100 },
6310
+ { title: "500", const: 500 }
6311
+ ]
6312
+ },
6302
6313
  layout: {
6303
6314
  type: "array",
6304
6315
  items: {
@@ -6476,7 +6487,8 @@ const ComponentSchema = {
6476
6487
  { const: "required", title: "Required" },
6477
6488
  { const: "minLength", title: "Minimum Length" },
6478
6489
  { const: "maxLength", title: "Maximum Length" },
6479
- { const: "pattern", title: "Pattern" }
6490
+ { const: "pattern", title: "Pattern" },
6491
+ { const: "readOnly", title: "Read Only" }
6480
6492
  ]
6481
6493
  },
6482
6494
  validationValue: {
@@ -7623,8 +7635,7 @@ const getSelectField = (scope, label, options) => {
7623
7635
  layout: { xs: 6, sm: 6, md: 4, lg: 3 },
7624
7636
  main: {
7625
7637
  label,
7626
- type: "text",
7627
- options
7638
+ type: "text"
7628
7639
  }
7629
7640
  }
7630
7641
  };
@@ -7671,7 +7682,7 @@ const buildPropertiesSection = function(type) {
7671
7682
  break;
7672
7683
  case "TreeMap":
7673
7684
  uiSchema.elements = [
7674
- getSelectField("orientation", "orientation", []),
7685
+ getSelectField("orientation", "orientation"),
7675
7686
  getInputField("linkType", "linkType"),
7676
7687
  getInputField("graphHeight", "Graph Height"),
7677
7688
  getInputField("graphWidth", "Graph Width"),
@@ -7706,10 +7717,7 @@ const buildPropertiesSection = function(type) {
7706
7717
  getRadioInputField("defaultButtonAvailable", "Use Default Buttons ", ["YES", "NO"]),
7707
7718
  getInputField("resetText", "Reset Text"),
7708
7719
  getInputField("completeText", "Complete Text"),
7709
- getSelectField("orientation", "Orientation Type", [
7710
- { label: "Horizontal", value: "horizontal" },
7711
- { label: "Vertical", value: "vertical" }
7712
- ]),
7720
+ getSelectField("orientation", "Orientation Type"),
7713
7721
  emptyBox$1("Stepper", { xs: 6, sm: 6, md: 4, lg: 4 }),
7714
7722
  getArrayControl("sectionLabels", "label")
7715
7723
  ];
@@ -7726,11 +7734,7 @@ const buildPropertiesSection = function(type) {
7726
7734
  uiSchema.elements = [
7727
7735
  getInputField("placeholder", "Placeholder"),
7728
7736
  getRadioInputField("multiline", "Multiline", ["YES", "NO"]),
7729
- getSelectField("variant", "Variant", [
7730
- { label: "Outlined", value: "outlined" },
7731
- { label: "Filled", value: "filled" },
7732
- { label: "Standard", value: "standard" }
7733
- ]),
7737
+ getSelectField("variant", "Variant"),
7734
7738
  emptyBox$1("TextEmpty1", { xs: 6, sm: 6, md: 0, lg: 3 }),
7735
7739
  getArrayControl("InputFormatingAndMasking", "formatElement", "Format Element"),
7736
7740
  getInputField("keyName", "Event Key Name")
@@ -7800,20 +7804,17 @@ const buildPropertiesSection = function(type) {
7800
7804
  break;
7801
7805
  case "Button":
7802
7806
  uiSchema.elements = [
7803
- getSelectField("buttonType", "Button Type", []),
7804
- getSelectField("iconName", "Icon Name", []),
7805
- getSelectField("color", "Color", []),
7807
+ getSelectField("buttonType", "Button Type"),
7808
+ getSelectField("iconName", "Icon Name"),
7809
+ getSelectField("color", "Color"),
7806
7810
  getInputField("tooltipMessage", "Tooltip Message"),
7807
- getSelectField("defaultStyle", "Default Style", [
7808
- { label: "Apply Default Style", value: "true" },
7809
- { label: "No Style", value: "false" }
7810
- ]),
7811
+ getSelectField("defaultStyle", "Default Style"),
7811
7812
  emptyBox$1("ButtonEmpty1", { xs: 6, sm: 6, md: 4, lg: 4 })
7812
7813
  ];
7813
7814
  break;
7814
7815
  case "Box":
7815
7816
  uiSchema.elements = [
7816
- getSelectField("iconName", "Icon Name", []),
7817
+ getSelectField("iconName", "Icon Name"),
7817
7818
  emptyBox$1("BoxEmpty1", { xs: 6, sm: 6, md: 4, lg: 8 })
7818
7819
  ];
7819
7820
  break;
@@ -7821,14 +7822,7 @@ const buildPropertiesSection = function(type) {
7821
7822
  uiSchema.elements = [
7822
7823
  getInputField("height", "Height"),
7823
7824
  getInputField("heading", "Heading"),
7824
- getSelectField("graphType", "Graph Type", [
7825
- { label: "Bar Graph", value: "BarGraph" },
7826
- { label: "Stack Bar Graph", value: "StackBarGraph" },
7827
- { label: "Line Graph", value: "LineGraph" },
7828
- { label: "Pie Graph", value: "PieGraph" },
7829
- { label: "Horizontal Bar Graph", value: "HorizontalBarGraph" },
7830
- { label: "Stack Horizontal Bar Graph", value: "HorizontalStackBarGraph" }
7831
- ]),
7825
+ getSelectField("graphType", "Graph Type"),
7832
7826
  getInputField("leftLabel", "Left Label"),
7833
7827
  getInputField("bottomLabel", "Bottom Label"),
7834
7828
  emptyBox$1("GraphEmpty1", { xs: 6, sm: 0, md: 0, lg: 0 }),
@@ -7877,14 +7871,7 @@ const buildPropertiesSection = function(type) {
7877
7871
  getRadioInputField("disablePagination", "Disable Pagination", ["YES", "NO"]),
7878
7872
  getInputField("selectKey", "Selection Key"),
7879
7873
  getMultiSelectField("filteringOptions", "Filtering Options"),
7880
- getSelectField("maxPageSize", "Max Page Size", [
7881
- { label: "10", value: 10 },
7882
- { label: "20", value: 20 },
7883
- { label: "30", value: 30 },
7884
- { label: "50", value: 50 },
7885
- { label: "100", value: 100 },
7886
- { label: "500", value: 500 }
7887
- ]),
7874
+ getSelectField("maxPageSize", "Max Page Size"),
7888
7875
  buildWrapper("Tree Table Properties", [
7889
7876
  getRadioInputField("enableRowMovement", "Row Rearrangement", ["YES", "NO"]),
7890
7877
  getRadioInputField("enableExpanding", "Row Expanding", ["YES", "NO"]),
@@ -7910,43 +7897,27 @@ const buildPropertiesSection = function(type) {
7910
7897
  uiSchema.elements = [
7911
7898
  getRadioInputField("lazyLoading", "Lazy Loading", ["YES", "NO"]),
7912
7899
  getRadioInputField("freeSolo", "FreeSolo", ["YES", "NO"]),
7913
- getSelectField("variant", "Variant", [
7914
- { label: "Outlined", value: "outlined" },
7915
- { label: "Filled", value: "filled" },
7916
- { label: "Standard", value: "standard" }
7917
- ]),
7900
+ getSelectField("variant", "Variant"),
7918
7901
  emptyBox$1("SelectEmpty")
7919
7902
  ];
7920
7903
  break;
7921
7904
  case "MultipleSelect":
7922
7905
  uiSchema.elements = [
7923
7906
  getRadioInputField("lazyLoading", "Lazy Loading", ["YES", "NO"]),
7924
- getSelectField("variant", "Variant", [
7925
- { label: "Outlined", value: "outlined" },
7926
- { label: "Filled", value: "filled" },
7927
- { label: "Standard", value: "standard" }
7928
- ]),
7907
+ getSelectField("variant", "Variant"),
7929
7908
  emptyBox$1("MultipleSelectEmpty1", { xs: 0, sm: 6, md: 4, lg: 4 }),
7930
7909
  emptyBox$1("MultipleSelectEmpty2")
7931
7910
  ];
7932
7911
  break;
7933
7912
  case "Date":
7934
7913
  uiSchema.elements = [
7935
- getSelectField("variant", "Variant", [
7936
- { label: "Outlined", value: "outlined" },
7937
- { label: "Filled", value: "filled" },
7938
- { label: "Standard", value: "standard" }
7939
- ]),
7914
+ getSelectField("variant", "Variant"),
7940
7915
  emptyBox$1("DateEmpty1", { xs: 6, sm: 6, md: 8, lg: 9 })
7941
7916
  ];
7942
7917
  break;
7943
7918
  case "DateTime":
7944
7919
  uiSchema.elements = [
7945
- getSelectField("variant", "Variant", [
7946
- { label: "Outlined", value: "outlined" },
7947
- { label: "Filled", value: "filled" },
7948
- { label: "Standard", value: "standard" }
7949
- ]),
7920
+ getSelectField("variant", "Variant"),
7950
7921
  emptyBox$1("DateTimeEmpty1", { xs: 6, sm: 6, md: 8, lg: 9 })
7951
7922
  ];
7952
7923
  break;
@@ -8461,7 +8432,7 @@ const sectionLabels = {
8461
8432
  Timer: ["Core", "Events", "Style", "Validation"],
8462
8433
  Rank: ["Core", "Events", "Style", "Validation"],
8463
8434
  Button: ["Core", "Properties", "Events", "Style", "Validation"],
8464
- Array: ["Core", "Components", "Properties", "Validation"],
8435
+ Array: ["Core", "Components", "Properties", "Events", "Validation"],
8465
8436
  Radio: ["Core", "Properties", "Events", "Style", "Validation"],
8466
8437
  Text: ["Core", "Properties", "Events", "Style", "Validation"],
8467
8438
  TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
@@ -9012,7 +8983,8 @@ const EventSchema = {
9012
8983
  oneOf: [
9013
8984
  { title: "RankProvider", const: "RankProvider" },
9014
8985
  { title: "Download File", const: "downloadFile" },
9015
- { title: "Download", const: "download" }
8986
+ { title: "downloadFileFromUrl", const: "downloadFileFromUrl" },
8987
+ { title: "downloadFileFromBase64", const: "downloadFileFromBase64" }
9016
8988
  ]
9017
8989
  },
9018
8990
  body: {
@@ -9089,12 +9061,7 @@ const EventUiSchema = (theme) => {
9089
9061
  }
9090
9062
  }
9091
9063
  },
9092
- getSelectField("Handler", "Handler", [
9093
- { label: "Custom", value: "custom" },
9094
- { label: "API", value: "api" },
9095
- { label: "Inbuilt Function", value: "inBuiltFunction" },
9096
- { label: "Refresh", value: "refresh" }
9097
- ]),
9064
+ getSelectField("Handler", "Handler"),
9098
9065
  {
9099
9066
  type: "Control",
9100
9067
  scope: "#/properties/EmptyBox",
@@ -9773,12 +9740,7 @@ var event = (store2, dynamicData2, submitHandler, service2, functionsName) => {
9773
9740
  } else if (handlerType === "inBuiltFunction") {
9774
9741
  uiSchema.elements[0].elements[0].elements[2] = getSelectField(
9775
9742
  "inBuiltFunctionType",
9776
- "Function Name",
9777
- [
9778
- { label: "RankProvider", value: "RankProvider" },
9779
- { label: "Download File", value: "downloadFile" },
9780
- { label: "Download Blob File", value: "downloadBlobFile" }
9781
- ]
9743
+ "Function Name"
9782
9744
  );
9783
9745
  uiSchema.elements[0].elements[0].elements[3] = {
9784
9746
  type: "Control",
@@ -9974,7 +9936,33 @@ const downloadFile$1 = (obj) => {
9974
9936
  URL.revokeObjectURL(url);
9975
9937
  document.body.removeChild(link);
9976
9938
  };
9977
- const doDownload = (response, service2) => {
9939
+ function downloadFileFromBase64({ data, name }) {
9940
+ var _a;
9941
+ const binary = window.atob(data);
9942
+ const bytes = new Uint8Array(binary.length);
9943
+ for (let i = 0; i < binary.length; i++) {
9944
+ bytes[i] = binary.charCodeAt(i);
9945
+ }
9946
+ const extension = (_a = name.split(".").pop()) == null ? void 0 : _a.toLowerCase();
9947
+ const mimeMap = {
9948
+ pdf: "application/pdf",
9949
+ png: "image/png",
9950
+ jpg: "image/jpeg",
9951
+ jpeg: "image/jpeg",
9952
+ xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
9953
+ csv: "text/csv"
9954
+ };
9955
+ const blob = new Blob([bytes], {
9956
+ type: mimeMap[extension] || "application/octet-stream"
9957
+ });
9958
+ const url = URL.createObjectURL(blob);
9959
+ const a = document.createElement("a");
9960
+ a.href = url;
9961
+ a.download = name;
9962
+ a.click();
9963
+ URL.revokeObjectURL(url);
9964
+ }
9965
+ const downloadFileFromUrl = (response, service2) => {
9978
9966
  let url = `${service2.defaults.baseURL}/${response.path}`;
9979
9967
  if (response == null ? void 0 : response.params) {
9980
9968
  const keysArray = Object.keys(response == null ? void 0 : response.params);
@@ -10323,7 +10311,7 @@ var service = (funcParams) => {
10323
10311
  dynamicData: funcParams.dynamicData,
10324
10312
  userValue: funcParams.userValue,
10325
10313
  service: funcParams.service,
10326
- serviceHolder: { downloadFile: downloadFile$1, download: doDownload, ...funcParams.functionsProvider },
10314
+ serviceHolder: { downloadFile: downloadFile$1, download: downloadFileFromUrl, downloadFileFromBase64, ...funcParams.functionsProvider },
10327
10315
  eventGroups,
10328
10316
  functionsProvider: funcParams.functionsProvider,
10329
10317
  formDataHolder
@@ -10533,7 +10521,8 @@ var service = (funcParams) => {
10533
10521
  }
10534
10522
  },
10535
10523
  downloadFile: downloadFile$1,
10536
- download: doDownload,
10524
+ downloadFileFromUrl,
10525
+ downloadFileFromBase64,
10537
10526
  ...funcParams.functionsProvider
10538
10527
  };
10539
10528
  };
@@ -12339,115 +12328,94 @@ let schema = {
12339
12328
  properties: {},
12340
12329
  required: []
12341
12330
  };
12342
- function buildRule(configObj, tableName, arrayHolderName) {
12343
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
12344
- if (arrayHolderName) {
12345
- if ((_c = (_b = (_a = schema.properties) == null ? void 0 : _a[tableName]) == null ? void 0 : _b.items) == null ? void 0 : _c.properties) {
12346
- 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])) {
12347
- schema.properties[tableName].items.properties[configObj.name] = {};
12348
- if (configObj.type === "Select" && ((_h = configObj.value) == null ? void 0 : _h.length) > 0) {
12349
- schema.properties[tableName].items.properties[configObj.name] = {
12350
- oneOf: configObj.value.map((e) => {
12351
- return { const: e.value, title: e.label };
12352
- })
12353
- };
12354
- } else if (configObj.type === "MultipleSelect" && ((_i = configObj.value) == null ? void 0 : _i.length) > 0) {
12355
- schema.properties[tableName].items.properties[configObj.name] = {
12356
- items: {
12357
- oneOf: configObj.value.map((e) => {
12358
- return { const: e.value, title: e.label };
12359
- })
12360
- }
12361
- };
12362
- }
12331
+ function buildOneOf(values) {
12332
+ return values.map((e) => ({
12333
+ const: e.value,
12334
+ title: e.label
12335
+ }));
12336
+ }
12337
+ function applyValidations(schemaNode, validations = [], requiredArr, fieldName) {
12338
+ validations.forEach((rule) => {
12339
+ if (rule.validationType === "readOnly") {
12340
+ schemaNode.disabled = true;
12341
+ }
12342
+ if (rule.validationType === "required") {
12343
+ if (requiredArr && fieldName) {
12344
+ requiredArr.push(fieldName);
12363
12345
  }
12346
+ } else {
12347
+ schemaNode.type = "string";
12348
+ schemaNode[rule.validationType] = isNaN(rule.validationValue) ? rule.validationValue : Number(rule.validationValue);
12364
12349
  }
12365
- } else if ((configObj.type === "Select" || configObj.type === "MultipleSelect") && ((_j = configObj.value) == null ? void 0 : _j.length) > 0) {
12366
- if (configObj.type === "Select") {
12367
- schema.properties[configObj.name] = {
12368
- oneOf: configObj.value.map((e) => {
12369
- return { const: e.value, title: e.label };
12370
- })
12371
- };
12372
- } else if (configObj.type === "MultipleSelect") {
12373
- schema.properties[configObj.name] = {
12374
- items: {
12375
- oneOf: configObj.value.map((e) => {
12376
- return { const: e.value, title: e.label };
12377
- })
12378
- }
12350
+ });
12351
+ }
12352
+ function buildNode(config2) {
12353
+ var _a, _b, _c;
12354
+ if (config2.type === "Array") {
12355
+ const arraySchema = {
12356
+ type: "array",
12357
+ items: {
12358
+ type: "object",
12359
+ properties: {},
12360
+ required: []
12361
+ }
12362
+ };
12363
+ (_a = config2.elements) == null ? void 0 : _a.forEach((child) => {
12364
+ var _a2;
12365
+ const childNode = buildNode(child);
12366
+ if (!childNode)
12367
+ return;
12368
+ arraySchema.items.properties[child.name] = childNode.schema;
12369
+ if ((_a2 = childNode.required) == null ? void 0 : _a2.length) {
12370
+ arraySchema.items.required.push(child.name);
12371
+ }
12372
+ });
12373
+ return { schema: arraySchema };
12374
+ }
12375
+ let fieldSchema = {};
12376
+ if ((config2.type === "Select" || config2.type === "MultipleSelect") && ((_b = config2.value) == null ? void 0 : _b.length) > 0) {
12377
+ if (config2.type === "Select") {
12378
+ fieldSchema.oneOf = buildOneOf(config2.value);
12379
+ } else {
12380
+ fieldSchema.type = "array";
12381
+ fieldSchema.items = {
12382
+ oneOf: buildOneOf(config2.value)
12379
12383
  };
12380
12384
  }
12381
12385
  }
12382
- if (configObj.validation) {
12383
- configObj.validation.forEach((rule) => {
12384
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l;
12385
- if (tableName) {
12386
- if ((_c2 = (_b2 = (_a2 = schema.properties) == null ? void 0 : _a2[tableName]) == null ? void 0 : _b2.items) == null ? void 0 : _c2.properties) {
12387
- 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])) {
12388
- schema.properties[tableName].items.properties[configObj.name] = {};
12389
- if (configObj.type === "Select" || ((_h2 = configObj.value) == null ? void 0 : _h2.length) > 0) {
12390
- schema.properties[tableName].items.properties[configObj.name] = {
12391
- oneOf: configObj.value.map((e) => {
12392
- return { const: e.value, title: e.label };
12393
- })
12394
- };
12395
- } else if (configObj.type === "MultipleSelect" || ((_i2 = configObj.value) == null ? void 0 : _i2.length) > 0) {
12396
- schema.properties[tableName].items.properties[configObj.name] = {
12397
- items: {
12398
- oneOf: configObj.value.map((e) => {
12399
- return { const: e.value, title: e.label };
12400
- })
12401
- }
12402
- };
12403
- }
12404
- }
12405
- if (rule.validationType === "required") {
12406
- (_l = (_k = (_j2 = schema.properties) == null ? void 0 : _j2[tableName]) == null ? void 0 : _k.items) == null ? void 0 : _l.required.push(configObj.name);
12407
- } else {
12408
- schema.properties[tableName].items.properties[configObj.name]["type"] = "string";
12409
- schema.properties[tableName].items.properties[configObj.name][rule.validationType] = isNaN(rule.validationValue) ? rule.validationValue : Number(rule.validationValue);
12410
- }
12411
- }
12412
- } else {
12413
- if (!schema.properties[configObj.name]) {
12414
- schema.properties[configObj.name] = {};
12415
- }
12416
- if (rule.validationType === "required") {
12417
- schema.required.push(configObj.name);
12418
- } else {
12419
- schema.properties[configObj.name]["type"] = "string";
12420
- schema.properties[configObj.name][rule.validationType] = isNaN(rule.validationValue) ? rule.validationValue : Number(rule.validationValue);
12421
- }
12422
- }
12423
- });
12386
+ if (config2.validation) {
12387
+ applyValidations(fieldSchema, config2.validation);
12424
12388
  }
12389
+ const required = ((_c = config2.validation) == null ? void 0 : _c.some(
12390
+ (v) => v.validationType === "required"
12391
+ )) ? [config2.name] : [];
12392
+ return {
12393
+ schema: fieldSchema,
12394
+ required
12395
+ };
12425
12396
  }
12426
- const buildSchema = (config2, tableName, isArrayType) => {
12427
- buildRule(config2, tableName, isArrayType);
12428
- if (config2 == null ? void 0 : config2.elements) {
12429
- if (config2.type == "Array") {
12430
- if (!schema.properties[config2.name]) {
12431
- schema.properties[config2.name] = {
12432
- type: "array",
12433
- items: {
12434
- type: "object",
12435
- properties: {},
12436
- required: []
12437
- }
12438
- };
12439
- }
12440
- config2.elements.map((e, elemInd) => {
12441
- buildSchema(e, config2.name, config2.type === "Array" ? true : false);
12442
- });
12443
- } else {
12444
- config2.elements.map((e, elemInd) => {
12445
- buildSchema(e);
12446
- });
12397
+ function buildSchema(config2) {
12398
+ var _a;
12399
+ const schema2 = {
12400
+ type: "object",
12401
+ properties: {},
12402
+ required: []
12403
+ };
12404
+ (_a = config2.elements) == null ? void 0 : _a.forEach((element) => {
12405
+ var _a2;
12406
+ const node = buildNode(element);
12407
+ if (!node)
12408
+ return;
12409
+ schema2.properties[element.name] = node.schema;
12410
+ if ((_a2 = node.required) == null ? void 0 : _a2.length) {
12411
+ schema2.required.push(element.name);
12447
12412
  }
12413
+ });
12414
+ if (schema2.required.length === 0) {
12415
+ delete schema2.required;
12448
12416
  }
12449
- return schema;
12450
- };
12417
+ return schema2;
12418
+ }
12451
12419
  const buildUiSchema = (config2, store2) => {
12452
12420
  let elements = {};
12453
12421
  const componentScope2 = `#/properties/${config2.name}`;
@@ -12687,5 +12655,5 @@ const buildUiSchema = (config2, store2) => {
12687
12655
  }
12688
12656
  return elements;
12689
12657
  };
12690
- export { buildConfig, buildSchema, buildUiSchema, clearFromSessionStorage, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
12658
+ export { buildConfig, buildSchema, buildUiSchema, clearFromSessionStorage, downloadFileFromBase64, downloadFileFromUrl, pageMaster, Component as pageMasterComponents, event as pageMasterEvents, service as pageService, schema };
12691
12659
  //# sourceMappingURL=impaktapps-ui-builder.es.js.map