impaktapps-ui-builder 0.0.409-g → 0.0.409-j

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.
@@ -18,6 +18,9 @@ export declare const CoreSection: {
18
18
  main: {
19
19
  label: string;
20
20
  type: string;
21
+ options?: undefined;
22
+ color?: undefined;
23
+ required?: undefined;
21
24
  };
22
25
  };
23
26
  layout?: undefined;
@@ -39,6 +42,33 @@ export declare const CoreSection: {
39
42
  main: {
40
43
  label: string;
41
44
  type?: undefined;
45
+ options?: undefined;
46
+ color?: undefined;
47
+ required?: undefined;
48
+ };
49
+ };
50
+ layout?: undefined;
51
+ } | {
52
+ type: string;
53
+ scope: string;
54
+ options: {
55
+ widget: string;
56
+ elementLabelProp?: undefined;
57
+ detail?: undefined;
58
+ };
59
+ config: {
60
+ layout: {
61
+ xs: number;
62
+ sm: number;
63
+ md: number;
64
+ lg: number;
65
+ };
66
+ main: {
67
+ label: string;
68
+ options: any[];
69
+ color: string;
70
+ required: boolean;
71
+ type?: undefined;
42
72
  };
43
73
  };
44
74
  layout?: undefined;
@@ -2,7 +2,7 @@ declare const _default: {
2
2
  type: string;
3
3
  config: {
4
4
  main: {
5
- label: string;
5
+ rowSpacing: number;
6
6
  divider: boolean;
7
7
  };
8
8
  defaultStyle: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.409g",
3
+ "version": "0.0.409j",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -170,7 +170,7 @@ const buildUiSchema = (config: any) => {
170
170
  const componentScope = `#/properties/${config.name}`;
171
171
  switch (config.type) {
172
172
  case "TreeMap":
173
- elements = buildTreeMap(config,componentScope)
173
+ elements = buildTreeMap(config, componentScope)
174
174
  break;
175
175
  case "DateTime":
176
176
  elements = buildDateTime(config, componentScope);
@@ -316,23 +316,7 @@ const buildUiSchema = (config: any) => {
316
316
  sizeMap[e.keyName] = e.value
317
317
  });
318
318
  }
319
- elements.elements = config.elements.map((e, elemInd) => {
320
- if (e.type && e.type !== "date" && e.type !== "dateTime" && e.type !== "amount") {
321
- return {
322
- accessorKey: e.name,
323
- header: e.label || e.name,
324
- size: sizeMap[e.name] || 180,
325
- type: e.type,
326
- widget: buildUiSchema(e)
327
- }
328
- }
329
- return {
330
- type: e.type,
331
- accessorKey: e.name,
332
- header: e.label || e.name,
333
- size: sizeMap[e.name] || 180
334
- }
335
- })
319
+ elements.elements = transformConfigToOutput(config, sizeMap)
336
320
  }
337
321
  else if (config.type == "Array") {
338
322
  elements.options.detail.elements = config.elements.map((e: any, elemInd: number) => {
@@ -378,9 +362,51 @@ export default buildUiSchema;
378
362
 
379
363
 
380
364
 
365
+ function nodeProvider(element, sizeMap) {
366
+ if (element.type) {
367
+ return {
368
+ accessorKey: element.name,
369
+ type: element.columnFormat,
370
+ header: element.label || element.name,
371
+ size: sizeMap[element.name] || 180,
372
+ widget: buildUiSchema(element)
381
373
 
374
+ };
375
+ }
376
+ return {
377
+ accessorKey: element.name,
378
+ type: element.columnFormat,
379
+ header: element.label || element.name,
380
+ size: sizeMap[element.name] || 180,
381
+ }
382
+ }
382
383
 
384
+ function buildHierarchy(elements, parentName = null, sizeMap) {
385
+ const result = [];
386
+ for (const element of elements) {
387
+ if (element?.parent === parentName) {
388
+ const children = buildHierarchy(elements, element.name, sizeMap);
389
+ const node: any = nodeProvider(element, sizeMap)
390
+ if (children.length > 0) {
391
+ node.columns = children;
392
+ node.type = "group";
393
+ }
394
+ result.push(node);
395
+ }
396
+ }
397
+ return result;
398
+ }
383
399
 
384
-
400
+ function transformConfigToOutput(config, sizeMap) {
401
+ const output = [];
402
+ const hierarchy = buildHierarchy(config.elements, config.name,schema);
403
+ for (const element of config.elements) {
404
+ const parentExists = config.elements.some(e => e.name === element.parent);
405
+ if (!parentExists && element.parent !== config.name) {
406
+ output.push(nodeProvider(element,sizeMap))
407
+ }
408
+ }
409
+ return [...hierarchy, ...output,];
410
+ }
385
411
 
386
412
 
@@ -9,7 +9,7 @@ export const buildWrapperSection = (config, componentScope) => {
9
9
  wrapper.config.main.divider = config.divider === "YES" ? true : false;
10
10
  wrapper.config.main.isAccordion = config.isAccordion === "YES" ? true : false;
11
11
  if(config.defaultStyle){
12
- wrapper.config.main.defaultStyle = config.defaultStyle ==="YES" ? true : false;
12
+ wrapper.config.defaultStyle = config.defaultStyle ==="YES" ? true : false;
13
13
  }
14
14
  if (config.style) {
15
15
  wrapper.config.style = JSON.parse(config.style)
@@ -380,7 +380,9 @@ export const buildPropertiesSection = function (type: String) {
380
380
  case "WrapperSection":
381
381
  uiSchema.elements = [getRadioInputField("divider", "Divider", ["YES", "No"]),
382
382
  getRadioInputField("isAccordion", "Accordion", ["YES", "No"])
383
- , getRadioInputField("defaultStyle", "Default Style", ["YES", "No"]),emptyBox]
383
+ , getRadioInputField("defaultStyle", "Default Style", ["YES", "No"]),
384
+ getInputField("rowSpacing", "Row Spacing"),
385
+ ]
384
386
  break;
385
387
 
386
388
  case "TabSection":
@@ -54,6 +54,47 @@ export const CoreSection = {
54
54
  },
55
55
  },
56
56
  },
57
+ {
58
+ type: "Control",
59
+ scope: "#/properties/parent",
60
+
61
+ options: {
62
+ widget: "InputField",
63
+ },
64
+ config: {
65
+ layout: {
66
+ xs: 12,
67
+ sm: 12,
68
+ md: 6,
69
+ lg: 6,
70
+ },
71
+ main: {
72
+ label: "parent",
73
+ options: [],
74
+ color: "secondary",
75
+ required: true,
76
+ },
77
+ },
78
+ },
79
+ {
80
+ type: "Control",
81
+ scope: "#/properties/columnFormat",
82
+ options: {
83
+ widget: "SelectInputField",
84
+ },
85
+ config: {
86
+ layout: {
87
+ xs: 11,
88
+ sm: 11,
89
+ md: 5.5,
90
+ lg: 5.5,
91
+ },
92
+ main: {
93
+ label: "Column Format",
94
+
95
+ },
96
+ },
97
+ },
57
98
  {
58
99
  type: "Control",
59
100
  scope: "#/properties/proc",
@@ -2,7 +2,7 @@ export default {
2
2
  type: "WrapperLayout",
3
3
  config: {
4
4
  main: {
5
- label: "Default Label",
5
+ rowSpacing: 3,
6
6
  divider: true,
7
7
  },
8
8
  defaultStyle: true,
@@ -4,7 +4,7 @@ export const ComponentSchema: any = {
4
4
  type: {
5
5
  // type: "string",
6
6
  oneOf: [
7
- { title: "AadharcardText", const: "AadharcardText"},
7
+ { title: "AadharcardText", const: "AadharcardText" },
8
8
  { title: "Array", const: "Array" },
9
9
  { title: "Button", const: "Button" },
10
10
  { title: "Card", const: "card" },
@@ -12,7 +12,7 @@ export const ComponentSchema: any = {
12
12
  { title: "Container", const: "WrapperSection" },
13
13
  { title: "DataGrid", const: "DataGrid" },
14
14
  { title: "Date", const: "Date" },
15
- { title: "DateTime", const: "DateTime"},
15
+ { title: "DateTime", const: "DateTime" },
16
16
  { title: "Download File", const: "DownloadFile" },
17
17
  { title: "Empty Box", const: "EmptyBox" },
18
18
  { title: "File", const: "FileInput" },
@@ -39,20 +39,25 @@ export const ComponentSchema: any = {
39
39
  { title: "Text Area", const: "TextArea" },
40
40
  { title: "Timer", const: "Timer" },
41
41
  { title: "Upload File", const: "UploadFile" },
42
- { title: "Text Area", const: "TextArea" },
43
42
  { title: "Timer", const: "Timer" },
44
43
  { title: "Upload File", const: "UploadFile" },
44
+
45
+ { title: "TreeMap", const: "TreeMap" },
46
+ ]
47
+ },
48
+ columnFormat: {
49
+ oneOf: [
45
50
  { title: "Date Column", const: "date" },
46
51
  { title: "DateTime Column", const: "dateTime" },
47
52
  { title: "Amount Column", const: "amount" },
48
- { title: "TreeMap", const: "TreeMap" },
49
53
  ]
50
54
  },
51
- orientation:{
55
+ orientation: {
52
56
  oneOf: [
53
- { title: "Horizontal", const: "horizontal" },
54
- { title: "Vertical", const: "vertical" },
55
- ]},
57
+ { title: "Horizontal", const: "horizontal" },
58
+ { title: "Vertical", const: "vertical" },
59
+ ]
60
+ },
56
61
  method: {
57
62
  type: "string",
58
63
  oneOf: [
@@ -78,7 +83,7 @@ export const ComponentSchema: any = {
78
83
  },
79
84
  value: {
80
85
  // type: "string",
81
-
86
+
82
87
  },
83
88
  },
84
89
  },
@@ -99,7 +104,7 @@ export const ComponentSchema: any = {
99
104
  },
100
105
  value: {
101
106
  // type: "string",
102
-
107
+
103
108
  },
104
109
  },
105
110
  },
@@ -181,8 +186,8 @@ export const ComponentSchema: any = {
181
186
  keyName: {
182
187
  type: "string",
183
188
  },
184
- value:{
185
- type:"string"
189
+ value: {
190
+ type: "string"
186
191
  }
187
192
  },
188
193
  },
@@ -272,9 +277,9 @@ export const ComponentSchema: any = {
272
277
  { title: "Horizontal Bar Graph", const: "HorizontalBarGraph" },
273
278
  ]
274
279
  },
275
- iconName:{
276
- type:"string",
277
- oneOf:[
280
+ iconName: {
281
+ type: "string",
282
+ oneOf: [
278
283
  { title: "Search Icon", const: "SearchIcon" },
279
284
  { title: "Edit Icon", const: "EditIcon" },
280
285
  { title: "Add Icon", const: "AddIcon" },
@@ -294,8 +299,8 @@ export const ComponentSchema: any = {
294
299
  { title: "Exception Icon", const: "ExceptionIcon" },
295
300
  ]
296
301
  },
297
- color:{
298
- type:"string",
302
+ color: {
303
+ type: "string",
299
304
  oneOf: [
300
305
  { title: "Primary", const: "primary" },
301
306
  { title: "Secondary", const: "secondary" },
@@ -309,6 +314,6 @@ export const ComponentSchema: any = {
309
314
  },
310
315
  label: { type: 'string' }
311
316
  },
312
-
313
- required: [ "name", ]
317
+
318
+ required: ["name",]
314
319
  };
@@ -149,6 +149,47 @@ export const componentBasicUiSchema: any = {
149
149
  },
150
150
  },
151
151
 
152
+ {
153
+ type: "Control",
154
+ scope: "#/properties/parent",
155
+
156
+ options: {
157
+ widget: "InputField",
158
+ },
159
+ config: {
160
+ layout: {
161
+ xs: 12,
162
+ sm: 12,
163
+ md: 6,
164
+ lg: 6,
165
+ },
166
+ main: {
167
+ label: "parent",
168
+ options: [],
169
+ color: "secondary",
170
+ required: true,
171
+ },
172
+ },
173
+ },
174
+ {
175
+ type: "Control",
176
+ scope: "#/properties/columnFormat",
177
+ options: {
178
+ widget: "SelectInputField",
179
+ },
180
+ config: {
181
+ layout: {
182
+ xs: 11,
183
+ sm: 11,
184
+ md: 5.5,
185
+ lg: 5.5,
186
+ },
187
+ main: {
188
+ label: "Column Format",
189
+
190
+ },
191
+ },
192
+ },
152
193
  {
153
194
  type: "Control",
154
195
  scope: "#/properties/proc",
@@ -122,7 +122,7 @@ export default (funcParams: funcParamsProps) => {
122
122
  },
123
123
  onCellRenderer: (cellParams) => {
124
124
  let finalResponse = {};
125
- cellParams.spanRef.current.style.color = "yellow";
125
+ // cellParams.spanRef.current.style.color = "yellow";
126
126
  const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
127
127
  for (const eventConfig of eventGroups?.onCellRenderer[path]) {
128
128
  executeEventsParameters.store.functionParameters = cellParams