impaktapps-ui-builder 0.0.393-alpha.7 → 0.0.393-alpha.9

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.
@@ -10584,7 +10584,7 @@ let schema = {
10584
10584
  required: []
10585
10585
  };
10586
10586
  function buildRule(configObj, tableName, arrayHolderName) {
10587
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
10587
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
10588
10588
  if (arrayHolderName) {
10589
10589
  if ((_c = (_b = (_a = schema.properties) == null ? void 0 : _a[tableName]) == null ? void 0 : _b.items) == null ? void 0 : _c.properties) {
10590
10590
  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])) {
@@ -10606,38 +10606,26 @@ function buildRule(configObj, tableName, arrayHolderName) {
10606
10606
  }
10607
10607
  }
10608
10608
  }
10609
- } else if ((configObj.type === "Select" || configObj.type === "MultipleSelect") && ((_j = configObj.value) == null ? void 0 : _j.length) > 0) {
10609
+ } else if ((configObj.type === "Select" || configObj.type === "MultipleSelect") && ((_j = configObj.value) == null ? void 0 : _j.length) >= 0) {
10610
10610
  if (configObj.type === "Select") {
10611
10611
  schema.properties[configObj.name] = {
10612
- oneOf: configObj.value.map((e) => {
10612
+ oneOf: configObj.value.length > 0 ? configObj.value.map((e) => {
10613
10613
  return { const: e.value, title: e.label };
10614
- })
10614
+ }) : [{ const: "", title: "" }]
10615
10615
  };
10616
10616
  } else if (configObj.type === "MultipleSelect") {
10617
10617
  schema.properties[configObj.name] = {
10618
10618
  items: {
10619
- oneOf: configObj.value.map((e) => {
10619
+ oneOf: configObj.value.length > 0 ? configObj.value.map((e) => {
10620
10620
  return { const: e.value, title: e.label };
10621
- })
10622
- }
10623
- };
10624
- }
10625
- } else if ((configObj.type === "Select" || configObj.type === "MultipleSelect") && ((_k = configObj.value) == null ? void 0 : _k.length) === 0) {
10626
- if (configObj.type === "Select") {
10627
- schema.properties[configObj.name] = {
10628
- oneOf: []
10629
- };
10630
- } else if (configObj.type === "MultipleSelect") {
10631
- schema.properties[configObj.name] = {
10632
- items: {
10633
- oneOf: []
10621
+ }) : [{ const: "", title: "" }]
10634
10622
  }
10635
10623
  };
10636
10624
  }
10637
10625
  }
10638
10626
  if (configObj.validation) {
10639
10627
  configObj.validation.forEach((rule) => {
10640
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l;
10628
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k, _l;
10641
10629
  if (tableName) {
10642
10630
  if ((_c2 = (_b2 = (_a2 = schema.properties) == null ? void 0 : _a2[tableName]) == null ? void 0 : _b2.items) == null ? void 0 : _c2.properties) {
10643
10631
  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])) {
@@ -10659,7 +10647,7 @@ function buildRule(configObj, tableName, arrayHolderName) {
10659
10647
  }
10660
10648
  }
10661
10649
  if (rule.validationType === "required") {
10662
- (_l = (_k2 = (_j2 = schema.properties) == null ? void 0 : _j2[tableName]) == null ? void 0 : _k2.items) == null ? void 0 : _l.required.push(configObj.name);
10650
+ (_l = (_k = (_j2 = schema.properties) == null ? void 0 : _j2[tableName]) == null ? void 0 : _k.items) == null ? void 0 : _l.required.push(configObj.name);
10663
10651
  } else {
10664
10652
  schema.properties[tableName].items.properties[configObj.name]["type"] = "string";
10665
10653
  schema.properties[tableName].items.properties[configObj.name][rule.validationType] = isNaN(rule.validationValue) ? rule.validationValue : Number(rule.validationValue);