impaktapps-ui-builder 0.0.278 → 0.0.280

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.
@@ -43,8 +43,8 @@ export declare const APISection: {
43
43
  label: string;
44
44
  type: string;
45
45
  options: {
46
- label: string;
47
- value: string;
46
+ title: string;
47
+ const: string;
48
48
  }[];
49
49
  multiple?: undefined;
50
50
  };
@@ -114,7 +114,7 @@ export declare const APISectionSchema: {
114
114
  key: {
115
115
  type: string;
116
116
  };
117
- value: {
117
+ const: {
118
118
  type: string;
119
119
  };
120
120
  };
@@ -128,7 +128,7 @@ export declare const APISectionSchema: {
128
128
  key: {
129
129
  type: string;
130
130
  };
131
- value: {
131
+ const: {
132
132
  type: string;
133
133
  };
134
134
  };
@@ -24,8 +24,8 @@ export declare const getTextArea: (scope: string, heading: string, hideButton: b
24
24
  };
25
25
  };
26
26
  export declare const getSelectField: (scope: string, label: string, options: {
27
- label: string;
28
- value: string;
27
+ title: string;
28
+ const: string;
29
29
  }[]) => {
30
30
  type: string;
31
31
  scope: string;
@@ -43,8 +43,8 @@ export declare const getSelectField: (scope: string, label: string, options: {
43
43
  label: string;
44
44
  type: string;
45
45
  options: {
46
- label: string;
47
- value: string;
46
+ title: string;
47
+ const: string;
48
48
  }[];
49
49
  };
50
50
  };
@@ -19,8 +19,8 @@ export declare const CoreSection: {
19
19
  label: string;
20
20
  type: string;
21
21
  options: {
22
- label: string;
23
- value: string;
22
+ title: string;
23
+ const: string;
24
24
  }[];
25
25
  };
26
26
  };
@@ -89,8 +89,8 @@ export declare const CoreSection: {
89
89
  main: {
90
90
  label: string;
91
91
  options: {
92
- label: string;
93
- value: string;
92
+ title: string;
93
+ const: string;
94
94
  }[];
95
95
  };
96
96
  };
@@ -24,8 +24,8 @@ export declare const ValidationSection: {
24
24
  main: {
25
25
  label: string;
26
26
  options: {
27
- value: string;
28
- label: string;
27
+ const: string;
28
+ title: string;
29
29
  }[];
30
30
  };
31
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.278",
3
+ "version": "0.0.280",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -6,11 +6,17 @@ export const buildMultiSelect = (config,componentScope) =>{
6
6
  const multipleSelect: any = _.cloneDeep(MultipleSelect);
7
7
  multipleSelect.scope = componentScope;
8
8
  if (config.label) {
9
+
9
10
  multipleSelect.config.main.label = config.label;
10
11
  }
11
12
  if(config.layout){
12
13
  multipleSelect.config.layout = createLayoutFormat(config.layout)
13
14
  }
14
- multipleSelect.config.main.options = config.value ?? [];
15
+ if(config.value){
16
+ const options = config.value.map((e:any)=>{
17
+ return {title:e.label,const:e.value}
18
+ });
19
+ multipleSelect.config.main.options = options??[];
20
+ }
15
21
  return multipleSelect;
16
22
  }
@@ -7,7 +7,7 @@ export const buildSelect = (config:any,componentScope:string) =>{
7
7
  selectInputField.config.main.label = config.label;
8
8
  if(config.value){
9
9
  const options = config.value.map((e:any)=>{
10
- return {label:e.label,value:e.value}
10
+ return {title:e.label,const:e.value}
11
11
  });
12
12
  selectInputField.config.main.options = options;
13
13
  };
@@ -16,10 +16,10 @@ export const APISection = {
16
16
  label: "Method",
17
17
  type: "text",
18
18
  options: [
19
- { label: "Get", value: "get" },
20
- { label: "Post", value: "post" },
21
- { label: "Delete", value: "delete" },
22
- { label: "Put", value: "put" },
19
+ { title: "Get", const: "get" },
20
+ { title: "Post", const: "post" },
21
+ { title: "Delete", const: "delete" },
22
+ { title: "Put", const: "put" },
23
23
  ],
24
24
  },
25
25
  },
@@ -155,7 +155,7 @@ export const APISectionSchema = {
155
155
  key: {
156
156
  type: "string",
157
157
  },
158
- value: {
158
+ const: {
159
159
  type: "string",
160
160
  },
161
161
  },
@@ -169,7 +169,7 @@ export const APISectionSchema = {
169
169
  key: {
170
170
  type: "string",
171
171
  },
172
- value: {
172
+ const: {
173
173
  type: "string",
174
174
  },
175
175
  },
@@ -1,6 +1,6 @@
1
1
 
2
2
  import _ from "lodash";
3
- const EmptyBox = {
3
+ const EmptyBox = {
4
4
  type: "Control",
5
5
  scope: `#/properties/empty`,
6
6
 
@@ -15,12 +15,12 @@ const EmptyBox = {
15
15
  lg: 5.5,
16
16
  },
17
17
  main: {
18
-
18
+
19
19
  },
20
20
  },
21
21
  };
22
- const getArrayControl = (parentScope:string,childScope:string,childLabel?:string,) =>{
23
- return {
22
+ const getArrayControl = (parentScope: string, childScope: string, childLabel?: string,) => {
23
+ return {
24
24
  type: "Control",
25
25
  scope: `#/properties/${parentScope}`,
26
26
  layout: 11.5,
@@ -32,7 +32,7 @@ const getArrayControl = (parentScope:string,childScope:string,childLabel?:string
32
32
  {
33
33
  type: "Control",
34
34
  scope: `#/properties/${childScope}`,
35
-
35
+
36
36
  options: {
37
37
  widget: "InputField",
38
38
  },
@@ -44,7 +44,7 @@ const getArrayControl = (parentScope:string,childScope:string,childLabel?:string
44
44
  lg: 5.5,
45
45
  },
46
46
  main: {
47
- label: childLabel||"Labels for Tab",
47
+ label: childLabel || "Labels for Tab",
48
48
  },
49
49
  },
50
50
  },
@@ -75,7 +75,7 @@ const getInputField = (scope: String, label: String) => {
75
75
  };
76
76
  };
77
77
 
78
- const getRadioInputField = (scope: String, label: String,options:string[]) => {
78
+ const getRadioInputField = (scope: String, label: String, options: string[]) => {
79
79
  return {
80
80
  type: "Control",
81
81
  scope: `#/properties/${scope}`,
@@ -92,15 +92,15 @@ const getRadioInputField = (scope: String, label: String,options:string[]) => {
92
92
  },
93
93
  main: {
94
94
  label: label,
95
-
96
- options:options,
95
+
96
+ options: options,
97
97
  },
98
98
  },
99
99
  };
100
100
  };
101
101
 
102
- export const getTextArea = (scope:string,heading:string,hideButton:boolean,layout?:any)=>{
103
- return {
102
+ export const getTextArea = (scope: string, heading: string, hideButton: boolean, layout?: any) => {
103
+ return {
104
104
  type: "Control",
105
105
  scope: `#/properties/${scope}`,
106
106
 
@@ -108,30 +108,30 @@ export const getTextArea = (scope:string,heading:string,hideButton:boolean,layou
108
108
  widget: "TextArea",
109
109
  },
110
110
  config: {
111
- layout:layout||12,
112
- style:{
113
- containerStyle:{
114
- borderRadius:"20px",
111
+ layout: layout || 12,
112
+ style: {
113
+ containerStyle: {
114
+ borderRadius: "20px",
115
115
  },
116
- headerContainerStyle:{
117
-
116
+ headerContainerStyle: {
117
+
118
118
  },
119
- textAreaStyle:{
120
- borderRadius:"20px",
121
- padding:"20px"
119
+ textAreaStyle: {
120
+ borderRadius: "20px",
121
+ padding: "20px"
122
122
  // background:"black",
123
123
  // color:"white"
124
124
  }
125
125
  },
126
126
  main: {
127
- heading:heading,
128
- minRows:8,
129
- hideButton:hideButton
127
+ heading: heading,
128
+ minRows: 8,
129
+ hideButton: hideButton
130
130
  },
131
131
  },
132
132
  }
133
133
  }
134
- export const getSelectField = (scope: string, label: string, options: { label: string, value: string }[]) => {
134
+ export const getSelectField = (scope: string, label: string, options: { title: string, const: string }[]) => {
135
135
  return {
136
136
  type: "Control",
137
137
  scope: `#/properties/${scope}`,
@@ -158,28 +158,28 @@ const GraphSection = {
158
158
 
159
159
  export const buildPropertiesSection = function (type: String) {
160
160
  let uiSchema = _.cloneDeep(GraphSection);
161
- if(type === "SpeedoMeter" ){
162
- uiSchema.elements = [
163
- getInputField("segments", "Segments Count"),
164
- getInputField("heading", "Container Heading"),
165
- getInputField("heading", "Container Heading"),
166
- getInputField("speedoCaption", "Speedometer Caption"),
167
- getInputField("width","Speedometer Width")
168
- ]
169
- }
170
- else if ( type === "RankCard") {
161
+ if (type === "SpeedoMeter") {
162
+ uiSchema.elements = [
163
+ getInputField("segments", "Segments Count"),
164
+ getInputField("heading", "Container Heading"),
165
+ getInputField("heading", "Container Heading"),
166
+ getInputField("speedoCaption", "Speedometer Caption"),
167
+ getInputField("width", "Speedometer Width")
168
+ ]
169
+ }
170
+ else if (type === "RankCard") {
171
171
  uiSchema.elements = [
172
- getInputField("rank", "Rank"),
173
- getInputField("image", "Image Url"),
174
- getInputField("title", "Card Title"),
175
- getInputField("description", "Card Description")];
176
- }
172
+ getInputField("rank", "Rank"),
173
+ getInputField("image", "Image Url"),
174
+ getInputField("title", "Card Title"),
175
+ getInputField("description", "Card Description")];
176
+ }
177
177
  else if (type === "LeaderBoard") {
178
- uiSchema.elements = [getInputField("valueLabel", "Value Label"),
178
+ uiSchema.elements = [getInputField("valueLabel", "Value Label"),
179
179
  getInputField("firstImage", "First Image url"),
180
- getInputField("secondImage", "Second Image url"),
181
- getInputField("thirdImage", "Third Image url"),
182
- getTextArea("functionCode","Write Compare Code",false)
180
+ getInputField("secondImage", "Second Image url"),
181
+ getInputField("thirdImage", "Third Image url"),
182
+ getTextArea("functionCode", "Write Compare Code", false)
183
183
  ];
184
184
  }
185
185
  else if (type === "CardSlider") {
@@ -193,64 +193,66 @@ if(type === "SpeedoMeter" ){
193
193
  const bottomLabel_3 = getInputField("bottomLabel_3", "Third BottomLabel");
194
194
  uiSchema.elements = [heading, bottomLabel_1, bottomLabel_2, bottomLabel_3];
195
195
  } else if (type === "card") {
196
- uiSchema.elements = [getInputField("url", "Image Url"),getInputField("label", "Label"),getInputField("description", "Description"), ];}
197
- else if (type === "Box") {
198
- const iconName = getInputField("value", "Value");
199
- uiSchema.elements = [getSelectField("graphType","Label Type",[
200
- { label: "URL", value: "url" },
201
- { label: "Heading", value: "heading" }
202
- ]), iconName];}
203
- else if (type === "Button" ) {
204
- const caption = getInputField("color", "Color");
205
- const size = getInputField("size", "Size");
206
- const iconName = getInputField("iconName", "Icon Name");
207
- uiSchema.elements = [getSelectField("buttonType","Button Type",[
208
- { label: "Button With Text", value: "Button" },
209
- { label: "Button With Icon", value: "IconButton" },
210
- { label: "Button With Icon and Text", value: "ButtonWithIconAndText" },
211
- ]), iconName,size,caption,
212
- getSelectField("defaultStyle","Default Style",[
213
- { label: "Apply Default Style", value: "true" },
214
- { label: "No Style", value: "false" },
215
- ]),
216
- JSON.parse(JSON.stringify(EmptyBox))
196
+ uiSchema.elements = [getInputField("url", "Image Url"), getInputField("label", "Label"), getInputField("description", "Description"),];
197
+ }
198
+ else if (type === "Box") {
199
+ const iconName = getInputField("value", "Value");
200
+ uiSchema.elements = [getSelectField("graphType", "Label Type", [
201
+ { title: "URL", const: "url" },
202
+ { title: "Heading", const: "heading" }
203
+ ]), iconName];
204
+ }
205
+ else if (type === "Button") {
206
+ const caption = getInputField("color", "Color");
207
+ const size = getInputField("size", "Size");
208
+ const iconName = getInputField("iconName", "Icon Name");
209
+ uiSchema.elements = [getSelectField("buttonType", "Button Type", [
210
+ { title: "Button With Text", const: "Button" },
211
+ { title: "Button With Icon", const: "IconButton" },
212
+ { title: "Button With Icon and Text", const: "ButtonWithIconAndText" },
213
+ ]), iconName, size, caption,
214
+ getSelectField("defaultStyle", "Default Style", [
215
+ { title: "Apply Default Style", const: "true" },
216
+ { title: "No Style", const: "false" },
217
+ ]),
218
+ JSON.parse(JSON.stringify(EmptyBox))
217
219
  ];
218
220
  } else if (type === "Graph") {
219
221
  const height = getInputField("height", "Height");
220
222
  const heading = getInputField("heading", "Heading");
221
223
  const leftLabel = getInputField("leftLabel", "Left Label");
222
224
  const bottomLabel = getInputField("bottomLabel", "Bottom Label");
223
- const legendAvailabe = getRadioInputField("legendHide","Legend Hide",["YES","No"])
225
+ const legendAvailabe = getRadioInputField("legendHide", "Legend Hide", ["YES", "No"])
224
226
 
225
227
  uiSchema.elements = [
226
228
  heading,
227
229
  height,
228
- getSelectField("graphType","Graph Type",[
229
- { label: "Bar Graph", value: "BarGraph" },
230
- { label: "Stack Bar Graph", value: "StackBarGraph" },
231
- { label: "Line Graph", value: "LineGraph" },
232
- { label: "Pie Graph", value: "PieGraph" },
233
- { label: "Horizontal Bar Graph", value: "HorizontalBarGraph" },
230
+ getSelectField("graphType", "Graph Type", [
231
+ { title: "Bar Graph", const: "BarGraph" },
232
+ { title: "Stack Bar Graph", const: "StackBarGraph" },
233
+ { title: "Line Graph", const: "LineGraph" },
234
+ { title: "Pie Graph", const: "PieGraph" },
235
+ { title: "Horizontal Bar Graph", const: "HorizontalBarGraph" },
234
236
  ]),
235
237
  leftLabel,
236
238
  bottomLabel,
237
239
  legendAvailabe,
238
- getArrayControl("legendLabels","label"),
239
- getArrayControl("pieArcColors","color"),
240
+ getArrayControl("legendLabels", "label"),
241
+ getArrayControl("pieArcColors", "color"),
240
242
  ];
241
- }else if(type === "WrapperSection"){
242
- uiSchema.elements = [getRadioInputField("divider","Divider",["YES","No"]),getRadioInputField("heading","Page Heading",["YES","No"])]
243
+ } else if (type === "WrapperSection") {
244
+ uiSchema.elements = [getRadioInputField("divider", "Divider", ["YES", "No"]), getRadioInputField("heading", "Page Heading", ["YES", "No"])]
243
245
  }
244
- else if(type === "TabSection"){
245
- uiSchema.elements =[
246
- getArrayControl("sectionLabels","label"),
247
- ]
246
+ else if (type === "TabSection") {
247
+ uiSchema.elements = [
248
+ getArrayControl("sectionLabels", "label"),
249
+ ]
248
250
  }
249
- else if(type === "Radio"){
250
- uiSchema.elements =[
251
- getArrayControl("sectionLabels","label","Options Of Radio"),
251
+ else if (type === "Radio") {
252
+ uiSchema.elements = [
253
+ getArrayControl("sectionLabels", "label", "Options Of Radio"),
252
254
  ]
253
- }
255
+ }
254
256
 
255
257
  return uiSchema;
256
258
  };
@@ -14,33 +14,33 @@ export const CoreSection = {
14
14
  label: "Type",
15
15
  type: "text",
16
16
  options: [
17
- { label: "Select", value: "Select" },
18
- { label: "Date", value: "Date" },
19
- { label: "CheckBox", value: "CheckBox" },
20
- { label: "Table", value: "Table" },
21
- { label: "Array", value: "Array" },
22
- { label: "Container", value: "WrapperSection" },
23
- { label: "Tabs", value: "TabSection" },
24
- { label: "Text", value: "Text" },
25
- { label: "Text Area", value: "TextArea" },
26
- { label: "Button", value: "Button" },
27
- { label: "Card", value: "card" },
28
- { label: "Radio", value: "Radio" },
29
- { label: "Rank", value: "Rank" },
30
- { label: "SpeedoMeter", value: "SpeedoMeter" },
31
- { label: "ProgressBar", value: "ProgressBar" },
32
- { label: "Graph", value: "Graph" },
33
- { label: "Label", value: "Box" },
34
- { label: "Upload File", value: "UploadFile" },
35
- { label: "Download File", value: "DownloadFile" },
36
- { label: "Empty Box", value: "EmptyBox" },
37
- { label: "ProgressBar Card", value: "ProgressBarCard" },
38
- { label: "Rank Card", value: "RankCard" },
39
- { label: "Runner Boy Progress Bar", value: "RunnerBoyProgressBar" },
40
- { label: "Slider", value: "Slider" },
41
- { label: "Timer", value: "Timer" },
42
- { label: "MultipleSelect", value: "MultipleSelect" },
43
- { label: "LeaderBoard", value: "LeaderBoard" },],
17
+ { title: "Select", const: "Select" },
18
+ { title: "Date", const: "Date" },
19
+ { title: "CheckBox", const: "CheckBox" },
20
+ { title: "Table", const: "Table" },
21
+ { title: "Array", const: "Array" },
22
+ { title: "Container", const: "WrapperSection" },
23
+ { title: "Tabs", const: "TabSection" },
24
+ { title: "Text", const: "Text" },
25
+ { title: "Text Area", const: "TextArea" },
26
+ { title: "Button", const: "Button" },
27
+ { title: "Card", const: "card" },
28
+ { title: "Radio", const: "Radio" },
29
+ { title: "Rank", const: "Rank" },
30
+ { title: "SpeedoMeter", const: "SpeedoMeter" },
31
+ { title: "ProgressBar", const: "ProgressBar" },
32
+ { title: "Graph", const: "Graph" },
33
+ { title: "Label", const: "Box" },
34
+ { title: "Upload File", const: "UploadFile" },
35
+ { title: "Download File", const: "DownloadFile" },
36
+ { title: "Empty Box", const: "EmptyBox" },
37
+ { title: "ProgressBar Card", const: "ProgressBarCard" },
38
+ { title: "Rank Card", const: "RankCard" },
39
+ { title: "Runner Boy Progress Bar", const: "RunnerBoyProgressBar" },
40
+ { title: "Slider", const: "Slider" },
41
+ { title: "Timer", const: "Timer" },
42
+ { title: "MultipleSelect", const: "MultipleSelect" },
43
+ { title: "LeaderBoard", const: "LeaderBoard" },],
44
44
  },
45
45
  },
46
46
  },
@@ -118,10 +118,10 @@ export const CoreSection = {
118
118
  main: {
119
119
  label: "Screen Size",
120
120
  options: [
121
- { label: "Extra Small", value: "xs" },
122
- { label: "Small", value: "sm" },
123
- { label: "Medium", value: "md" },
124
- { label: "Large", value: "lg" },
121
+ { title: "Extra Small", const: "xs" },
122
+ { title: "Small", const: "sm" },
123
+ { title: "Medium", const: "md" },
124
+ { title: "Large", const: "lg" },
125
125
  ],
126
126
  },
127
127
  },
@@ -143,10 +143,10 @@ export const CoreSection = {
143
143
  main: {
144
144
  label: "Value",
145
145
  options: [
146
- { label: "3", value: "3" },
147
- { label: "5.5", value: "5.5" },
148
- { label: "8", value: "8" },
149
- { label: "12", value: "12" },
146
+ { title: "3", const: "3" },
147
+ { title: "5.5", const: "5.5" },
148
+ { title: "8", const: "8" },
149
+ { title: "12", const: "12" },
150
150
  ],
151
151
  },
152
152
  },
@@ -1,32 +1,7 @@
1
1
  export const ValidationSection = {
2
2
  type: "HorizontalLayout",
3
3
  elements: [
4
- // {
5
- // type: "Control",
6
- // scope: "#/properties/validationType",
7
-
8
- // options: {
9
- // widget: "SelectInputField",
10
- // },
11
- // config: {
12
- // layout: {
13
- // xs: 11,
14
- // sm: 11,
15
- // md: 5.5,
16
- // lg: 5.5,
17
- // },
18
- // main: {
19
- // label: "Validation Type",
20
- // options: [
21
- // { value: "String", label: "string" },
22
- // { value: "minLength", label: "Minimum Length" },
23
- // { value: "maxLength", label: "Maximum Length" },
24
- // { value: "pattern", label: "Pattern" },
25
- // ]
26
- // },
27
- // },
28
- // },
29
- {
4
+ {
30
5
  type: "Control",
31
6
  scope: "#/properties/validation",
32
7
  layout: 11.5,
@@ -52,10 +27,10 @@ export const ValidationSection = {
52
27
  main: {
53
28
  label: "Validation Type",
54
29
  options: [
55
- { value: "required", label: "Required" },
56
- { value: "minLength", label: "Minimum Length" },
57
- { value: "maxLength", label: "Maximum Length" },
58
- { value: "pattern", label: "Pattern" },
30
+ { const: "required", title: "Required" },
31
+ { const: "minLength", title: "Minimum Length" },
32
+ { const: "maxLength", title: "Maximum Length" },
33
+ { const: "pattern", title: "Pattern" },
59
34
  ]
60
35
  },
61
36
  },