impaktapps-ui-builder 1.0.148 → 1.0.150

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.
@@ -0,0 +1 @@
1
+ export declare const buildSegmentChart: (config: any, componentScope: any) => any;
@@ -2,28 +2,30 @@ export default function Card(theme: any): {
2
2
  type: string;
3
3
  config: {
4
4
  main: {};
5
- wrapperStyle: {
6
- position: string;
7
- top: string;
8
- transform: string;
9
- marginBottom: number;
10
- };
11
- componentsBoxStyle: {
12
- boxShadow: string;
13
- flexDirection: string;
14
- flexWrap: string;
15
- width: string;
16
- background: string;
17
- border: string;
18
- borderRadius: string;
19
- padding: string;
20
- height: string;
21
- alignItems: string;
22
- marginLeft: string;
23
- "&: hover": {
5
+ style: {
6
+ wrapperStyle: {
7
+ position: string;
8
+ top: string;
9
+ transform: string;
10
+ marginBottom: number;
11
+ borderRadius: string;
12
+ fontFamily: string;
13
+ };
14
+ componentsBoxStyle: {
15
+ boxShadow: string;
16
+ flexDirection: string;
17
+ overflow: string;
18
+ flexWrap: string;
19
+ width: string;
24
20
  background: string;
25
- border: string;
26
- "& p": {
21
+ borderRadius: string;
22
+ padding: string;
23
+ height: string;
24
+ minHeight: string;
25
+ position: string;
26
+ marginLeft: string;
27
+ "&: hover": {
28
+ background: string;
27
29
  color: string;
28
30
  };
29
31
  };
@@ -37,205 +39,178 @@ export default function Card(theme: any): {
37
39
  };
38
40
  elements: ({
39
41
  type: string;
42
+ scope: string;
40
43
  config: {
41
- layout: number;
42
- main?: undefined;
43
- style?: undefined;
44
- };
45
- elements: {
46
- type: string;
47
- config: {
48
- main: {
49
- columnSpacing: number;
50
- gap: number;
51
- };
52
- wrapperStyle: {
53
- background: string;
54
- marginBottom: number;
44
+ main: {
45
+ url: string;
46
+ heading?: undefined;
47
+ };
48
+ style: {
49
+ containerStyle: {
50
+ position: string;
51
+ color: string;
52
+ top: string;
53
+ right: string;
54
+ display: string;
55
+ justifyContent: string;
56
+ alignItems: string;
55
57
  };
56
- componentsBoxStyle: {
57
- flexDirection: string;
58
- flexWrap: string;
58
+ imageStyle: {
59
+ color: string;
59
60
  width: string;
60
61
  height: string;
61
- background: string;
62
- borderRadius: string;
63
- paddingRight: number;
62
+ padding: string;
63
+ margin: string;
64
64
  };
65
- layout: number;
65
+ color?: undefined;
66
+ fontSize?: undefined;
67
+ fontWeight?: undefined;
68
+ fontFamily?: undefined;
69
+ justifyContent?: undefined;
70
+ background?: undefined;
71
+ position?: undefined;
72
+ top?: undefined;
73
+ left?: undefined;
74
+ display?: undefined;
75
+ maxWidth?: undefined;
76
+ whiteSpace?: undefined;
77
+ overflowX?: undefined;
78
+ scrollbarWidth?: undefined;
79
+ "&::-webkit-scrollbar"?: undefined;
80
+ width?: undefined;
81
+ margin?: undefined;
82
+ marginBottom?: undefined;
83
+ marginTop?: undefined;
84
+ lineHeight?: undefined;
85
+ overflowY?: undefined;
86
+ paddingLeft?: undefined;
87
+ };
88
+ };
89
+ options: {
90
+ widget: string;
91
+ };
92
+ } | {
93
+ type: string;
94
+ scope: string;
95
+ config: {
96
+ main: {
97
+ heading: string;
98
+ url?: undefined;
66
99
  };
67
- elements: ({
68
- type: string;
69
- config: {
70
- main: {
71
- columnSpacing: number;
72
- gap: number;
73
- heading?: undefined;
74
- };
75
- wrapperStyle: {
76
- background: string;
77
- marginBottom: number;
78
- };
79
- componentsBoxStyle: {
80
- flexDirection: string;
81
- flexWrap: string;
82
- width: string;
83
- height: string;
84
- background: string;
85
- borderRadius: string;
86
- marginLeft: string;
87
- marginTop: string;
88
- justifyContent: string;
89
- position: string;
90
- };
91
- layout: number;
92
- style?: undefined;
100
+ style: {
101
+ color: string;
102
+ fontSize: string;
103
+ fontWeight: number;
104
+ fontFamily: string;
105
+ justifyContent: string;
106
+ background: string;
107
+ position: string;
108
+ top: string;
109
+ left: string;
110
+ display: string;
111
+ maxWidth: string;
112
+ whiteSpace: string;
113
+ overflowX: string;
114
+ scrollbarWidth: string;
115
+ "&::-webkit-scrollbar": {
116
+ display: string;
93
117
  };
94
- elements: ({
95
- type: string;
96
- scope: string;
97
- config: {
98
- main: {
99
- heading: string;
100
- };
101
- style: {
102
- color: string;
103
- display: string;
104
- fontSize: {
105
- xs: string;
106
- md: string;
107
- };
108
- fontWeight: string;
109
- background: string;
110
- justifyContent: string;
111
- width: string;
112
- margin: string;
113
- marginLeft: string;
114
- height: number;
115
- marginTop?: undefined;
116
- position?: undefined;
117
- left?: undefined;
118
- whiteSpace?: undefined;
119
- overflowX?: undefined;
120
- overflowY?: undefined;
121
- scrollbarWidth?: undefined;
122
- msOverflowStyle?: undefined;
123
- maxWidth?: undefined;
124
- "&::-webkit-scrollbar"?: undefined;
125
- };
126
- };
127
- options: {
128
- widget: string;
129
- };
130
- } | {
131
- type: string;
132
- scope: string;
133
- config: {
134
- main: {
135
- heading: string;
136
- };
137
- style: {
138
- color: string;
139
- display: string;
140
- fontSize: {
141
- xs: string;
142
- md: string;
143
- };
144
- fontWeight: string;
145
- background: string;
146
- justifyContent: string;
147
- width: string;
148
- margin: string;
149
- marginTop: string;
150
- position: string;
151
- left: string;
152
- whiteSpace: string;
153
- overflowX: string;
154
- overflowY: string;
155
- scrollbarWidth: string;
156
- msOverflowStyle: string;
157
- maxWidth: string;
158
- "&::-webkit-scrollbar": {
159
- display: string;
160
- };
161
- marginLeft?: undefined;
162
- height?: undefined;
163
- };
164
- };
165
- options: {
166
- widget: string;
167
- };
168
- })[];
169
- scope?: undefined;
170
- options?: undefined;
171
- } | {
172
- type: string;
173
- scope: string;
174
- config: {
175
- main: {
176
- heading: string;
177
- columnSpacing?: undefined;
178
- gap?: undefined;
179
- };
180
- style: {
181
- color: string;
182
- fontSize: string;
183
- fontWeight: string;
184
- justifyContent: string;
185
- whiteSpace: string;
186
- overflowX: string;
187
- overflowY: string;
188
- scrollbarWidth: string;
189
- msOverflowStyle: string;
190
- background: string;
191
- width: string;
192
- margin: string;
193
- marginTop: {
194
- xs: string;
195
- md: string;
196
- };
197
- "&::-webkit-scrollbar": {
198
- display: string;
199
- };
200
- };
201
- layout: number;
202
- wrapperStyle?: undefined;
203
- componentsBoxStyle?: undefined;
118
+ containerStyle?: undefined;
119
+ imageStyle?: undefined;
120
+ width?: undefined;
121
+ margin?: undefined;
122
+ marginBottom?: undefined;
123
+ marginTop?: undefined;
124
+ lineHeight?: undefined;
125
+ overflowY?: undefined;
126
+ paddingLeft?: undefined;
127
+ };
128
+ };
129
+ options: {
130
+ widget: string;
131
+ };
132
+ } | {
133
+ type: string;
134
+ scope: string;
135
+ config: {
136
+ main: {
137
+ heading: string;
138
+ url?: undefined;
139
+ };
140
+ style: {
141
+ color: string;
142
+ display: string;
143
+ fontSize: {
144
+ xs: string;
145
+ md: string;
204
146
  };
205
- options: {
206
- widget: string;
147
+ fontWeight: number;
148
+ background: string;
149
+ justifyContent: string;
150
+ width: string;
151
+ margin: string;
152
+ marginBottom: string;
153
+ marginTop: string;
154
+ lineHeight: string;
155
+ maxWidth: string;
156
+ whiteSpace: string;
157
+ overflowX: string;
158
+ overflowY: string;
159
+ scrollbarWidth: string;
160
+ "&::-webkit-scrollbar": {
161
+ display: string;
207
162
  };
208
- elements?: undefined;
209
- })[];
210
- }[];
211
- scope?: undefined;
212
- options?: undefined;
163
+ containerStyle?: undefined;
164
+ imageStyle?: undefined;
165
+ fontFamily?: undefined;
166
+ position?: undefined;
167
+ top?: undefined;
168
+ left?: undefined;
169
+ paddingLeft?: undefined;
170
+ };
171
+ };
172
+ options: {
173
+ widget: string;
174
+ };
213
175
  } | {
214
176
  type: string;
215
177
  scope: string;
216
178
  config: {
217
179
  main: {
218
- url: string;
180
+ heading: string;
181
+ url?: undefined;
219
182
  };
220
183
  style: {
221
- containerStyle: {
222
- height: string;
184
+ color: string;
185
+ fontSize: string;
186
+ fontWeight: string;
187
+ justifyContent: string;
188
+ background: string;
189
+ margin: string;
190
+ paddingLeft: string;
191
+ marginBottom: string;
192
+ maxWidth: string;
193
+ whiteSpace: string;
194
+ overflowX: string;
195
+ scrollbarWidth: string;
196
+ "&::-webkit-scrollbar": {
223
197
  display: string;
224
- justifyContent: string;
225
- };
226
- imageStyle: {
227
- width: string;
228
- fontSize: string;
229
- padding: string;
230
- margin: string;
231
- height: string;
232
198
  };
199
+ containerStyle?: undefined;
200
+ imageStyle?: undefined;
201
+ fontFamily?: undefined;
202
+ position?: undefined;
203
+ top?: undefined;
204
+ left?: undefined;
205
+ display?: undefined;
206
+ width?: undefined;
207
+ marginTop?: undefined;
208
+ lineHeight?: undefined;
209
+ overflowY?: undefined;
233
210
  };
234
- layout: number;
235
211
  };
236
212
  options: {
237
213
  widget: string;
238
214
  };
239
- elements?: undefined;
240
215
  })[];
241
216
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.148",
3
+ "version": "1.0.150",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -1,26 +1,33 @@
1
1
  import progressBar from "./uischema/progressBar";
2
2
  import _ from "lodash";
3
- import { createLayoutFormat } from "./buildConfig";
3
+ import { createLayoutFormat, flatObjectValueInArray } from "./buildConfig";
4
4
 
5
- export const buildProgressBar = (config:any,componentScope:any) =>{
6
- const ProgressBar: any = _.cloneDeep(progressBar);
7
- ProgressBar.scope = componentScope;
8
- if (config.layout) {
9
- ProgressBar.config.layout = config.layout;
10
- }
11
- ProgressBar.config.main.heading = config.label;
12
- if (config.bottomLabel_3) {
13
- ProgressBar.config.main.bottomLabel_3 = config.bottomLabel_3;
14
- }
15
- if(config.layout){
16
- ProgressBar.config.layout = createLayoutFormat(config.layout)
17
- }
18
- if (config.bottomLabel_2) {
19
- ProgressBar.config.main.bottomLabel_2 = config.bottomLabel_2;
20
- }
21
- if (config.bottomLabel_1) {
22
- ProgressBar.config.main.bottomLabel_1 = config.bottomLabel_1;
23
- }
24
- return ProgressBar;
5
+ export const buildProgressBar = (config: any, componentScope: any) => {
6
+ const ProgressBar: any = _.cloneDeep(progressBar);
7
+ ProgressBar.scope = componentScope;
8
+ if (config.layout) {
9
+ ProgressBar.config.layout = config.layout;
10
+ }
11
+ ProgressBar.config.main.variant = config.variant;
12
+ ProgressBar.config.main.heading = config.label;
13
+ if (config.pieArcColors) {
14
+ ProgressBar.config.main.colorRange = flatObjectValueInArray(config.pieArcColors);
15
+ }
16
+ if (config.size) {
17
+ ProgressBar.config.main.size = Number(config.size);
18
+ }
19
+ if (config.bottomLabel_3) {
20
+ ProgressBar.config.main.bottomLabel_3 = config.bottomLabel_3;
21
+ }
22
+ if (config.layout) {
23
+ ProgressBar.config.layout = createLayoutFormat(config.layout)
24
+ }
25
+ if (config.bottomLabel_2) {
26
+ ProgressBar.config.main.bottomLabel_2 = config.bottomLabel_2;
27
+ }
28
+ if (config.bottomLabel_1) {
29
+ ProgressBar.config.main.bottomLabel_1 = config.bottomLabel_1;
30
+ }
31
+ return ProgressBar;
25
32
 
26
33
  }
@@ -0,0 +1,34 @@
1
+ import _ from "lodash";
2
+ import { createLayoutFormat, flatObjectValueInArray } from "./buildConfig";
3
+ const segmentUISchema = {
4
+ type: "Control",
5
+ scope: "#/properties/SegmentChart",
6
+ options: {
7
+ widget: "SegmentChart",
8
+ },
9
+
10
+ config: {
11
+ layout: { xs: 12, sm: 12, md: 12, lg: 12 },
12
+ main: {
13
+ //colorRange
14
+ },
15
+ },
16
+ };
17
+
18
+
19
+
20
+ export const buildSegmentChart = (config,componentScope) => {
21
+ const segment: any = _.cloneDeep(segmentUISchema);
22
+ segment.scope = componentScope;
23
+
24
+ if(config.layout){
25
+ segment.config.layout = createLayoutFormat(config.layout)
26
+ }
27
+ if (config.pieArcColors) {
28
+ segment.config.main.colorRange = flatObjectValueInArray(config.pieArcColors);
29
+ }
30
+ if (config.style) {
31
+ segment.config.style = JSON.parse(config.style)
32
+ }
33
+ return segment;
34
+ };
@@ -40,6 +40,7 @@ import { buildTreeMap } from "./buildTreeMap";
40
40
  import { buildThoughtOfTheDay } from "./buildThoughtOfTheDay";
41
41
  import { buildHorizontalLayout } from "./buildHorizontalLayout";
42
42
  import { buildImage } from "./buildImage";
43
+ import { buildSegmentChart } from "./buildSegmentChart";
43
44
  export let schema = {
44
45
  type: "object",
45
46
  properties: {},
@@ -263,6 +264,9 @@ const buildUiSchema = (config: any, store?: any) => {
263
264
  case "Image":
264
265
  elements = buildImage(config, componentScope);
265
266
  break;
267
+ case "SegmentChart":
268
+ elements = buildSegmentChart(config, componentScope);
269
+ break;
266
270
  default:
267
271
  schema = {
268
272
  type: "object",
@@ -389,7 +389,12 @@ export const buildPropertiesSection = function (type: String) {
389
389
  getInputField("bottomLabel_1", "First BottomLabel"),
390
390
  getInputField("bottomLabel_2", "Second BottomLabel"),
391
391
  getInputField("bottomLabel_3", "Third BottomLabel"),
392
- emptyBox("ProgressBarCardEmpty1"), emptyBox("ProgressBarCardEmpty2")
392
+ getInputField("size", "Size"),
393
+ getSelectField("variant", "Variant", [
394
+ { label: "Circular", value: "circular" },
395
+ { label: "Horizontal", value: "horizontal" },
396
+ ]),
397
+ getArrayControl("pieArcColors", "color","Color"),
393
398
  ];
394
399
  break;
395
400
  case "card":