impaktapps-ui-builder 0.0.101-alpha.268 → 0.0.101-alpha.269

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.
@@ -11,6 +11,8 @@ export declare const CoreSection: {
11
11
  scope: string;
12
12
  options: {
13
13
  widget: string;
14
+ elementLabelProp?: undefined;
15
+ detail?: undefined;
14
16
  };
15
17
  config: {
16
18
  layout: {
@@ -23,11 +25,9 @@ export declare const CoreSection: {
23
25
  label: string;
24
26
  type: string;
25
27
  required?: undefined;
26
- childElementLabel?: undefined;
27
28
  };
28
- style?: undefined;
29
29
  };
30
- elements?: undefined;
30
+ layout?: undefined;
31
31
  } | {
32
32
  type: string;
33
33
  scope: string;
@@ -39,17 +39,20 @@ export declare const CoreSection: {
39
39
  lg: number;
40
40
  };
41
41
  main?: undefined;
42
- style?: undefined;
43
42
  };
44
43
  options: {
45
44
  widget: string;
45
+ elementLabelProp?: undefined;
46
+ detail?: undefined;
46
47
  };
47
- elements?: undefined;
48
+ layout?: undefined;
48
49
  } | {
49
50
  type: string;
50
51
  scope: string;
51
52
  options: {
52
53
  widget: string;
54
+ elementLabelProp?: undefined;
55
+ detail?: undefined;
53
56
  };
54
57
  config: {
55
58
  layout: {
@@ -62,91 +65,76 @@ export declare const CoreSection: {
62
65
  label: string;
63
66
  required: boolean;
64
67
  type?: undefined;
65
- childElementLabel?: undefined;
66
68
  };
67
- style?: undefined;
68
69
  };
69
- elements?: undefined;
70
+ layout?: undefined;
70
71
  } | {
71
72
  type: string;
72
73
  scope: string;
74
+ layout: number;
73
75
  options: {
74
- widget: string;
75
- };
76
- config: {
77
- layout: number;
78
- main: {
79
- label: string;
80
- childElementLabel: string;
81
- type?: undefined;
82
- required?: undefined;
83
- };
84
- style: {
85
- marginLeft: string;
86
- marginBottom: string;
87
- labelStyle: {
88
- marginLeft: string;
89
- };
90
- detailsStyle: {
91
- marginLeft: string;
92
- };
93
- };
94
- };
95
- elements: ({
96
- type: string;
97
- scope: string;
98
- options: {
99
- widget: string;
100
- };
101
- config: {
102
- layout: {
103
- xs: number;
104
- sm: number;
105
- md: number;
106
- lg: number;
107
- };
108
- main: {
109
- label: string;
110
- type?: undefined;
111
- helperText?: undefined;
112
- errorMessage?: undefined;
113
- };
114
- };
115
- } | {
116
- type: string;
117
- scope: string;
118
- options: {
119
- widget: string;
120
- };
121
- config: {
122
- layout: {
123
- xs: number;
124
- sm: number;
125
- md: number;
126
- lg: number;
127
- };
128
- main: {
129
- label: string;
76
+ elementLabelProp: string;
77
+ detail: {
78
+ type: string;
79
+ elements: ({
130
80
  type: string;
131
- helperText: string;
132
- errorMessage: string;
133
- };
134
- };
135
- } | {
136
- type: string;
137
- scope: string;
138
- config: {
139
- layout: {
140
- xs: number;
141
- sm: number;
142
- md: number;
143
- lg: number;
144
- };
145
- main?: undefined;
146
- };
147
- options: {
148
- widget: string;
81
+ scope: string;
82
+ options: {
83
+ widget: string;
84
+ };
85
+ config: {
86
+ layout: {
87
+ xs: number;
88
+ sm: number;
89
+ md: number;
90
+ lg: number;
91
+ };
92
+ main: {
93
+ label: string;
94
+ type?: undefined;
95
+ helperText?: undefined;
96
+ errorMessage?: undefined;
97
+ };
98
+ };
99
+ } | {
100
+ type: string;
101
+ scope: string;
102
+ options: {
103
+ widget: string;
104
+ };
105
+ config: {
106
+ layout: {
107
+ xs: number;
108
+ sm: number;
109
+ md: number;
110
+ lg: number;
111
+ };
112
+ main: {
113
+ label: string;
114
+ type: string;
115
+ helperText: string;
116
+ errorMessage: string;
117
+ };
118
+ };
119
+ } | {
120
+ type: string;
121
+ scope: string;
122
+ config: {
123
+ layout: {
124
+ xs: number;
125
+ sm: number;
126
+ md: number;
127
+ lg: number;
128
+ };
129
+ main?: undefined;
130
+ };
131
+ options: {
132
+ widget: string;
133
+ };
134
+ })[];
149
135
  };
150
- })[];
136
+ widget?: undefined;
137
+ };
138
+ config?: undefined;
151
139
  })[];
152
140
  };
@@ -9,6 +9,7 @@ declare const _default: {
9
9
  main: {
10
10
  onMount: string;
11
11
  enableExpandAll: boolean;
12
+ headerIcons: {};
12
13
  allRowData: any[];
13
14
  downloadAllData: boolean;
14
15
  columns: {
@@ -9,58 +9,45 @@ export declare const ValidationSection: {
9
9
  elements: {
10
10
  type: string;
11
11
  scope: string;
12
+ layout: number;
12
13
  options: {
13
- widget: string;
14
- };
15
- config: {
16
- layout: number;
17
- main: {
18
- label: string;
19
- childElementLabel: string;
20
- };
21
- style: {
22
- marginLeft: string;
23
- marginBottom: string;
24
- labelStyle: {
25
- marginLeft: string;
26
- };
27
- detailsStyle: {
28
- marginLeft: string;
29
- };
14
+ elementLabelProp: string;
15
+ detail: {
16
+ type: string;
17
+ elements: ({
18
+ type: string;
19
+ scope: string;
20
+ options: {
21
+ widget: string;
22
+ };
23
+ config: {
24
+ layout: {
25
+ xs: number;
26
+ sm: number;
27
+ md: number;
28
+ lg: number;
29
+ };
30
+ main: {
31
+ label: string;
32
+ };
33
+ };
34
+ } | {
35
+ type: string;
36
+ scope: string;
37
+ options: {
38
+ widget: string;
39
+ };
40
+ config: {
41
+ layout: {
42
+ xs: number;
43
+ sm: number;
44
+ md: number;
45
+ lg?: undefined;
46
+ };
47
+ main?: undefined;
48
+ };
49
+ })[];
30
50
  };
31
51
  };
32
- elements: ({
33
- type: string;
34
- scope: string;
35
- options: {
36
- widget: string;
37
- };
38
- config: {
39
- layout: {
40
- xs: number;
41
- sm: number;
42
- md: number;
43
- lg: number;
44
- };
45
- main: {
46
- label: string;
47
- };
48
- };
49
- } | {
50
- type: string;
51
- scope: string;
52
- options: {
53
- widget: string;
54
- };
55
- config: {
56
- layout: {
57
- xs: number;
58
- sm: number;
59
- md: number;
60
- lg: number;
61
- };
62
- main?: undefined;
63
- };
64
- })[];
65
52
  }[];
66
53
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.101-alpha.268",
3
+ "version": "0.0.101-alpha.269",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -338,40 +338,56 @@ const buildUiSchema = (config: any, store?: any) => {
338
338
  elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : []
339
339
  }
340
340
  })
341
- } else if (config.type == "Table") {
341
+ } else if (config.type == "Table") {
342
342
  const sizeMap = {}
343
-
343
+
344
344
  if (config.sizeHolder) {
345
345
  config.sizeHolder.map((e, i) => {
346
346
  sizeMap[e.keyName] = e.value
347
347
  });
348
348
  }
349
-
350
- elements.elements = config.elements.map((cellElem, elemInd) => {
349
+ const tableHeaderElements = [];
350
+ const tableActionElement = [];
351
+ const rowElements = []
352
+ config.elements.filter((cellElem, elemInd) => {
351
353
  const commonProperties = {
352
354
  accessorKey: cellElem.name,
353
355
  type: cellElem.columnFormat,
354
356
  header: cellElem.label || cellElem.name,
355
357
  size: sizeMap[cellElem.name] || 180,
356
- enableColumnFilter: cellElem.enableFilter === "No"?false:true,
358
+ enableColumnFilter: cellElem.enableFilter === "No" ? false : true,
357
359
  columnFilterModeOptions: cellElem.filteringOptions,
358
360
  enableSorting: cellElem.enableSorting === "No" ? false : true,
359
361
  columnKey: cellElem.columnKey
360
362
  }
361
363
  if (cellElem.type) {
362
- return {
364
+ if (cellElem.elementType == "action") {
365
+ const actionElem = buildUiSchema(cellElem, store);
366
+ tableActionElement.push(actionElem);
367
+ return false;
368
+ }
369
+ if (cellElem.elementType == "tableHeader") {
370
+ const headerElem = buildUiSchema(cellElem, store);
371
+ tableHeaderElements.push({widget:headerElem});
372
+ return false;
373
+ }
374
+ const tableElem = {
363
375
  widget: cellElem.type != "ColumnGroup" ? buildUiSchema(cellElem, store) : undefined,
364
376
  elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : [],
365
377
  ...commonProperties
366
-
378
+
367
379
  }
380
+ rowElements.push(tableElem)
368
381
  } else {
369
- return commonProperties
382
+ rowElements.push({ ...commonProperties })
370
383
  }
371
-
384
+
372
385
  })
386
+ elements.elements = rowElements;
387
+ elements.config.action = tableActionElement;
388
+ elements.config.main.headerIcons.elements = tableHeaderElements;
373
389
  }
374
-
390
+
375
391
  else if (config.type == "Array") {
376
392
  elements.options.detail.elements = config.elements.map((e: any, elemInd: number) => {
377
393
  return buildUiSchema(e, store)
@@ -26,65 +26,111 @@ export const emptyBox = (scope:string,layout?: any) => {
26
26
  },
27
27
  }
28
28
  }
29
+ // const cardLayout = {
30
+ // type: "Control",
31
+ // scope: "#/properties/cardLayout",
32
+ // options: {
33
+ // widget: "Array",
34
+ // },
35
+ // config: {
36
+ // layout: 12,
37
+ // main: {
38
+ // label: "Card Layout",
39
+ // childElementLabel: "Card Layout",
40
+ // },
41
+ // style: {
42
+ // marginLeft: "-24px",
43
+ // marginBottom: "24px !important",
44
+ // labelStyle: {
45
+ // marginLeft: "24px",
46
+ // },
47
+ // detailsStyle: {
48
+ // marginLeft: "24px",
49
+ // }
50
+ // }
51
+ // },
52
+ // elements: [
53
+ // {
54
+ // type: "Control",
55
+ // scope: "#/properties/key",
56
+ // options: {
57
+ // widget: "SelectInputField",
58
+ // },
59
+ // config: {
60
+ // layout: { xs: 6, sm: 6, md: 4, lg: 4 },
61
+ // main: {
62
+ // label: "Screen Size",
63
+
64
+ // },
65
+ // },
66
+ // },
67
+ // {
68
+ // type: "Control",
69
+ // scope: "#/properties/value",
70
+
71
+ // options: {
72
+ // widget: "InputField",
73
+ // },
74
+ // config: {
75
+ // layout: { xs: 6, sm: 6, md: 4, lg: 4 },
76
+ // main: {
77
+ // label: "Value",
78
+ // type: "number",
79
+ // // freeSolo:true,
80
+ // helperText: 'Number should be in range of 0 to 12',
81
+ // errorMessage: "Number Can't be greater than 12 and can't be less than 0.",
82
+
83
+ // },
84
+ // },
85
+ // },
86
+ // emptyBox("cardEmpty")
87
+ // ],
88
+ // };
29
89
  const cardLayout = {
30
90
  type: "Control",
31
91
  scope: "#/properties/cardLayout",
92
+ layout: 12,
32
93
  options: {
33
- widget: "Array",
34
- },
35
- config: {
36
- layout: 12,
37
- main: {
38
- label: "Card Layout",
39
- childElementLabel: "Card Layout",
40
- },
41
- style: {
42
- marginLeft: "-24px",
43
- marginBottom: "24px !important",
44
- labelStyle: {
45
- marginLeft: "24px",
46
- },
47
- detailsStyle: {
48
- marginLeft: "24px",
49
- }
50
- }
51
- },
52
- elements: [
53
- {
54
- type: "Control",
55
- scope: "#/properties/key",
56
- options: {
57
- widget: "SelectInputField",
58
- },
59
- config: {
60
- layout: { xs: 6, sm: 6, md: 4, lg: 4 },
61
- main: {
62
- label: "Screen Size",
94
+ detail: {
95
+ type: "HorizontalLayout",
96
+ elements: [
97
+ {
98
+ type: "Control",
99
+ scope: "#/properties/key",
100
+ options: {
101
+ widget: "SelectInputField",
102
+ },
103
+ config: {
104
+ layout: { xs: 6, sm: 6, md: 4, lg: 4 },
105
+ main: {
106
+ label: "Screen Size",
63
107
 
108
+ },
109
+ },
64
110
  },
65
- },
66
- },
67
- {
68
- type: "Control",
69
- scope: "#/properties/value",
111
+ {
112
+ type: "Control",
113
+ scope: "#/properties/value",
70
114
 
71
- options: {
72
- widget: "InputField",
73
- },
74
- config: {
75
- layout: { xs: 6, sm: 6, md: 4, lg: 4 },
76
- main: {
77
- label: "Value",
78
- type: "number",
79
- // freeSolo:true,
80
- helperText: 'Number should be in range of 0 to 12',
81
- errorMessage: "Number Can't be greater than 12 and can't be less than 0.",
115
+ options: {
116
+ widget: "InputField",
117
+ },
118
+ config: {
119
+ layout: { xs: 6, sm: 6, md: 4, lg: 4 },
120
+ main: {
121
+ label: "Value",
122
+ type: "number",
123
+ // freeSolo:true,
124
+ helperText: 'Number should be in range of 0 to 12',
125
+ errorMessage: "Number Can't be greater than 12 and can't be less than 0.",
82
126
 
127
+ },
128
+ },
83
129
  },
84
- },
130
+ emptyBox("cardEmpty")
131
+ ],
85
132
  },
86
- emptyBox("cardEmpty")
87
- ],
133
+ },
88
134
  };
89
135
  const getArrayControl = (parentScope: string, childScope: string, childLabel?: string,) => {
90
136
  return {