impaktapps-ui-builder 0.0.393-alpha.16 → 0.0.393-alpha.18

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.393-alpha.16",
3
+ "version": "0.0.393-alpha.18",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -71,7 +71,7 @@ function buildRule(configObj: any, tableName?: string, arrayHolderName?: boolean
71
71
  if (configObj.type === "Select") {
72
72
  let oneOfOptions = configObj.value && configObj.value.length > 0
73
73
  ? configObj.value.map((e) => ({ const: e.value, title: e.label }))
74
- : [{ const: null, title: null }];
74
+ : [{ const: "", title: "No options available" }];
75
75
 
76
76
  schema.properties[configObj.name] = {
77
77
  oneOf: oneOfOptions
@@ -72,14 +72,32 @@ export default (funcParams: funcParamsProps) => {
72
72
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
73
73
  serviceHolder: this, eventGroups
74
74
  }
75
+ // funcParams.store.setSchema(
76
+ // (pre: any) => {
77
+ // return {
78
+ // ...funcParams.schema, properties:
79
+ // { ...pre.properties,...funcParams.schema.properties,}
80
+ // }
81
+ // }
82
+ // )
75
83
  funcParams.store.setSchema(
76
84
  (pre: any) => {
85
+ const updatedProperties: any = {};
86
+ const mergedProperties = {...pre.properties,...funcParams.schema.properties,};
87
+ Object.keys(mergedProperties).forEach(propertyName => {
88
+ const schemaProperty = funcParams.schema.properties[propertyName];
89
+ if (schemaProperty && (schemaProperty.type === "Select" || schemaProperty.type === "MultipleSelect")) {
90
+ if (schemaProperty.oneOf && schemaProperty.oneOf[0].const === "") {
91
+ delete updatedProperties[propertyName];
92
+ }
93
+ }
94
+ });
77
95
  return {
78
- ...funcParams.schema, properties:
79
- { ...pre.properties,...funcParams.schema.properties,}
80
- }
96
+ ...funcParams.schema,
97
+ properties: updatedProperties,
98
+ };
81
99
  }
82
- )
100
+ );
83
101
  funcParams.uiSchema.elements.push(notifyUiSchema);
84
102
  funcParams.store.setUiSchema(funcParams.uiSchema);
85
103
  await executeRefreshHandler({