impaktapps-ui-builder 0.0.288 → 0.0.290

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.
@@ -42,11 +42,8 @@ export declare const APISection: {
42
42
  main: {
43
43
  label: string;
44
44
  type: string;
45
- options: {
46
- label: string;
47
- value: string;
48
- }[];
49
45
  multiple?: undefined;
46
+ options?: undefined;
50
47
  };
51
48
  };
52
49
  layout?: undefined;
@@ -18,10 +18,6 @@ export declare const CoreSection: {
18
18
  main: {
19
19
  label: string;
20
20
  type: string;
21
- options: {
22
- label: string;
23
- value: string;
24
- }[];
25
21
  };
26
22
  };
27
23
  layout?: undefined;
@@ -43,7 +39,6 @@ export declare const CoreSection: {
43
39
  main: {
44
40
  label: string;
45
41
  type?: undefined;
46
- options?: undefined;
47
42
  };
48
43
  };
49
44
  layout?: undefined;
@@ -88,10 +83,6 @@ export declare const CoreSection: {
88
83
  };
89
84
  main: {
90
85
  label: string;
91
- options: {
92
- label: string;
93
- value: string;
94
- }[];
95
86
  };
96
87
  };
97
88
  }[];
@@ -8,7 +8,7 @@ export declare const ValidationSection: {
8
8
  elementLabelProp: string;
9
9
  detail: {
10
10
  type: string;
11
- elements: ({
11
+ elements: {
12
12
  type: string;
13
13
  scope: string;
14
14
  options: {
@@ -23,31 +23,9 @@ export declare const ValidationSection: {
23
23
  };
24
24
  main: {
25
25
  label: string;
26
- options: {
27
- value: string;
28
- label: string;
29
- }[];
30
26
  };
31
27
  };
32
- } | {
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
- options?: undefined;
48
- };
49
- };
50
- })[];
28
+ }[];
51
29
  };
52
30
  };
53
31
  }[];
@@ -15,6 +15,13 @@ export declare const EventSchema: {
15
15
  };
16
16
  };
17
17
  };
18
+ method: {
19
+ type: string;
20
+ oneOf: {
21
+ title: string;
22
+ const: string;
23
+ }[];
24
+ };
18
25
  refreshElements: {
19
26
  type: string;
20
27
  items: {
@@ -26,6 +33,27 @@ export declare const EventSchema: {
26
33
  };
27
34
  };
28
35
  };
36
+ eventType: {
37
+ type: string;
38
+ oneOf: {
39
+ title: string;
40
+ const: string;
41
+ }[];
42
+ };
43
+ Handler: {
44
+ type: string;
45
+ oneOf: {
46
+ title: string;
47
+ const: string;
48
+ }[];
49
+ };
50
+ inBuiltFunctionType: {
51
+ type: string;
52
+ oneOf: {
53
+ title: string;
54
+ const: string;
55
+ }[];
56
+ };
29
57
  body: {
30
58
  type: string;
31
59
  items: {
@@ -20,6 +20,13 @@ declare const _default: (store: any, dynamicData: any) => {
20
20
  };
21
21
  };
22
22
  };
23
+ method: {
24
+ type: string;
25
+ oneOf: {
26
+ title: string;
27
+ const: string;
28
+ }[];
29
+ };
23
30
  refreshElements: {
24
31
  type: string;
25
32
  items: {
@@ -31,6 +38,27 @@ declare const _default: (store: any, dynamicData: any) => {
31
38
  };
32
39
  };
33
40
  };
41
+ eventType: {
42
+ type: string;
43
+ oneOf: {
44
+ title: string;
45
+ const: string;
46
+ }[];
47
+ };
48
+ Handler: {
49
+ type: string;
50
+ oneOf: {
51
+ title: string;
52
+ const: string;
53
+ }[];
54
+ };
55
+ inBuiltFunctionType: {
56
+ type: string;
57
+ oneOf: {
58
+ title: string;
59
+ const: string;
60
+ }[];
61
+ };
34
62
  body: {
35
63
  type: string;
36
64
  items: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.288",
3
+ "version": "0.0.290",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -15,12 +15,6 @@ export const APISection = {
15
15
  main: {
16
16
  label: "Method",
17
17
  type: "text",
18
- options: [
19
- { label: "Get", value: "get" },
20
- { label: "Post", value: "post" },
21
- { label: "Delete", value: "delete" },
22
- { label: "Put", value: "put" },
23
- ],
24
18
  },
25
19
  },
26
20
  },
@@ -195,13 +195,6 @@ export const buildPropertiesSection = function (type: String) {
195
195
  } else if (type === "card") {
196
196
  uiSchema.elements = [getInputField("url", "Image Url"), getInputField("label", "Label"), getInputField("description", "Description"),];
197
197
  }
198
- else if (type === "Box") {
199
- const iconName = getInputField("value", "Value");
200
- uiSchema.elements = [getSelectField("graphType", "Label Type", [
201
- { label: "URL", value: "url" },
202
- { label: "Heading", value: "heading" }
203
- ]), iconName];
204
- }
205
198
  else if (type === "Button") {
206
199
  const caption = getInputField("color", "Color");
207
200
  const size = getInputField("size", "Size");
@@ -13,35 +13,6 @@ export const CoreSection = {
13
13
  main: {
14
14
  label: "Type",
15
15
  type: "text",
16
- options: [
17
- { label: "Select", value: "Select" },
18
- { label: "Date", value: "Date" },
19
- { label: "CheckBox", value: "CheckBox" },
20
- { label: "Table", value: "Table" },
21
- { label: "Lazy Loading Table", value: "LazyLoadingTable" },
22
- { label: "Array", value: "Array" },
23
- { label: "Container", value: "WrapperSection" },
24
- { label: "Tabs", value: "TabSection" },
25
- { label: "Text", value: "Text" },
26
- { label: "Text Area", value: "TextArea" },
27
- { label: "Button", value: "Button" },
28
- { label: "Card", value: "card" },
29
- { label: "Radio", value: "Radio" },
30
- { label: "Rank", value: "Rank" },
31
- { label: "SpeedoMeter", value: "SpeedoMeter" },
32
- { label: "ProgressBar", value: "ProgressBar" },
33
- { label: "Graph", value: "Graph" },
34
- { label: "Label", value: "Box" },
35
- { label: "Upload File", value: "UploadFile" },
36
- { label: "Download File", value: "DownloadFile" },
37
- { label: "Empty Box", value: "EmptyBox" },
38
- { label: "ProgressBar Card", value: "ProgressBarCard" },
39
- { label: "Rank Card", value: "RankCard" },
40
- { label: "Runner Boy Progress Bar", value: "RunnerBoyProgressBar" },
41
- { label: "Slider", value: "Slider" },
42
- { label: "Timer", value: "Timer" },
43
- { label: "MultipleSelect", value: "MultipleSelect" },
44
- { label: "LeaderBoard", value: "LeaderBoard" },],
45
16
  },
46
17
  },
47
18
  },
@@ -118,12 +89,7 @@ export const CoreSection = {
118
89
  },
119
90
  main: {
120
91
  label: "Screen Size",
121
- options: [
122
- { label: "Extra Small", value: "xs" },
123
- { label: "Small", value: "sm" },
124
- { label: "Medium", value: "md" },
125
- { label: "Large", value: "lg" },
126
- ],
92
+
127
93
  },
128
94
  },
129
95
  },
@@ -143,12 +109,7 @@ export const CoreSection = {
143
109
  },
144
110
  main: {
145
111
  label: "Value",
146
- options: [
147
- { label: "3", value: "3" },
148
- { label: "5.5", value: "5.5" },
149
- { label: "8", value: "8" },
150
- { label: "12", value: "12" },
151
- ],
112
+
152
113
  },
153
114
  },
154
115
  },
@@ -26,12 +26,6 @@ export const ValidationSection = {
26
26
  },
27
27
  main: {
28
28
  label: "Validation Type",
29
- options: [
30
- { value: "required", label: "Required" },
31
- { value: "minLength", label: "Minimum Length" },
32
- { value: "maxLength", label: "Maximum Length" },
33
- { value: "pattern", label: "Pattern" },
34
- ]
35
29
  },
36
30
  },
37
31
  },
@@ -1,6 +1,47 @@
1
1
  export const ComponentSchema:any = {
2
2
  type: "object",
3
3
  properties: {
4
+ type:{
5
+ type:"string",
6
+ oneOf:[
7
+ { title: "Select", const: "Select" },
8
+ { title: "Date", const: "Date" },
9
+ { title: "CheckBox", const: "CheckBox" },
10
+ { title: "Table", const: "Table" },
11
+ { title: "Lazy Loading Table", const: "LazyLoadingTable" },
12
+ { title: "Array", const: "Array" },
13
+ { title: "Container", const: "WrapperSection" },
14
+ { title: "Tabs", const: "TabSection" },
15
+ { title: "Text", const: "Text" },
16
+ { title: "Text Area", const: "TextArea" },
17
+ { title: "Button", const: "Button" },
18
+ { title: "Card", const: "card" },
19
+ { title: "Radio", const: "Radio" },
20
+ { title: "Rank", const: "Rank" },
21
+ { title: "SpeedoMeter", const: "SpeedoMeter" },
22
+ { title: "ProgressBar", const: "ProgressBar" },
23
+ { title: "Graph", const: "Graph" },
24
+ { title: "Label", const: "Box" },
25
+ { title: "Upload File", const: "UploadFile" },
26
+ { title: "Download File", const: "DownloadFile" },
27
+ { title: "Empty Box", const: "EmptyBox" },
28
+ { title: "ProgressBar Card", const: "ProgressBarCard" },
29
+ { title: "Rank Card", const: "RankCard" },
30
+ { title: "Runner Boy Progress Bar", const: "RunnerBoyProgressBar" },
31
+ { title: "Slider", const: "Slider" },
32
+ { title: "Timer", const: "Timer" },
33
+ { title: "MultipleSelect", const: "MultipleSelect" },
34
+ { title: "LeaderBoard", const: "LeaderBoard" },]
35
+ },
36
+ method:{
37
+ type:"string",
38
+ oneOf: [
39
+ { title: "Get", const: "get" },
40
+ { title: "Post", const: "post" },
41
+ { title: "Delete", const: "delete" },
42
+ { title: "Put", const: "put" },
43
+ ]
44
+ },
4
45
  layout: {
5
46
  type: "array",
6
47
  items: {
@@ -8,9 +49,21 @@ export const ComponentSchema:any = {
8
49
  properties: {
9
50
  key: {
10
51
  type: "string",
52
+ oneOf:[
53
+ { title: "Extra Small", const: "xs" },
54
+ { title: "Small", const: "sm" },
55
+ { title: "Medium", const: "md" },
56
+ { title: "Large", const: "lg" },
57
+ ],
11
58
  },
12
59
  value: {
13
60
  type: "string",
61
+ oneOf: [
62
+ { title: "3", const: "3" },
63
+ { title: "5.5", const: "5.5" },
64
+ { title: "8", const: "8" },
65
+ { title: "12", const: "12" },
66
+ ],
14
67
  },
15
68
  },
16
69
  },
@@ -103,15 +156,47 @@ export const ComponentSchema:any = {
103
156
  properties: {
104
157
  componentName: {
105
158
  type: "string",
159
+
106
160
  },
107
161
  validationType:{
108
162
  type: "string",
163
+ oneOf:[
164
+ { const: "required", title: "Required" },
165
+ { const: "minLength", title: "Minimum Length" },
166
+ { const: "maxLength", title: "Maximum Length" },
167
+ { const: "pattern", title: "Pattern" },
168
+ ]
109
169
  },
110
170
  validationValue: {
111
171
  type: "string",
112
172
  },
113
173
  },
114
174
  },
175
+ },
176
+ buttonType:{
177
+ type:"string",
178
+ oneOf:[
179
+ { title: "Button With Text", const: "Button" },
180
+ { title: "Button With Icon", const: "IconButton" },
181
+ { title: "Button With Icon and Text", const: "ButtonWithIconAndText" },
182
+ ]
183
+ },
184
+ defaultStyle:{
185
+ type:"string",
186
+ oneOf:[
187
+ { title: "Apply Default Style", const: "true" },
188
+ { title: "No Style", const: "false" },
189
+ ]
190
+ },
191
+ graphType:{
192
+ type:"string",
193
+ oneOf:[
194
+ { title: "Bar Graph", const: "BarGraph" },
195
+ { title: "Stack Bar Graph", const: "StackBarGraph" },
196
+ { title: "Line Graph", const: "LineGraph" },
197
+ { title: "Pie Graph", const: "PieGraph" },
198
+ { title: "Horizontal Bar Graph", const: "HorizontalBarGraph" },
199
+ ]
115
200
  }
116
201
  },
117
202
 
@@ -15,6 +15,15 @@ export const EventSchema = {
15
15
  },
16
16
  },
17
17
  },
18
+ method:{
19
+ type:"string",
20
+ oneOf: [
21
+ { title: "Get", const: "get" },
22
+ { title: "Post", const: "post" },
23
+ { title: "Delete", const: "delete" },
24
+ { title: "Put", const: "put" },
25
+ ]
26
+ },
18
27
  refreshElements: {
19
28
  type: "array",
20
29
  items: {
@@ -26,6 +35,33 @@ export const EventSchema = {
26
35
  },
27
36
  },
28
37
  },
38
+ eventType:{
39
+ type:"string",
40
+ oneOf:[
41
+ { title: "Click Event", const: "onClick" },
42
+ { title: "onStart", const: "onStart" },
43
+ { title: "Load Event", const: "onLoad" },
44
+ { title: "Change Event", const: "onChange" },
45
+ { title: "Success", const: "Success" },
46
+ { title: "Fail", const: "Fail" }
47
+ ]
48
+ },
49
+ Handler:{
50
+ type:"string",
51
+ oneOf:[
52
+ { title: "Custom", const: "custom" },
53
+ { title: "Api", const: "api" },
54
+ { title: "Inbuilt Function", const: "inBuiltFunction" },
55
+ { title: "Refresh", const: "refresh" },
56
+ ]
57
+ },
58
+ inBuiltFunctionType:{
59
+ type:"string",
60
+ oneOf:[
61
+ { title: "RankProvider", const: "RankProvider" },
62
+ { title: "Download File", const: "downloadFile" },
63
+ ]
64
+ },
29
65
  body: {
30
66
  type: "array",
31
67
  items: {
@@ -101,15 +101,7 @@ export const EventUiSchema: any = {
101
101
  layout: { xs: 11, sm: 11, md: 5.5, lg: 5.5 },
102
102
  main: {
103
103
  label: "Event Type",
104
- type: "text",
105
- options: [
106
- { label: "Click Event", value: "onClick" },
107
- { label: "onStart", value: "onStart" },
108
- { label: "Load Event", value: "onLoad" },
109
- { label: "Change Event", value: "onChange" },
110
- { label: "Success", value: "Success" },
111
- { label: "Fail", value: "Fail" }
112
- ]
104
+ type: "text",
113
105
 
114
106
  },
115
107
  },
@@ -22,7 +22,7 @@ const sectionLabels = {
22
22
  UploadFile:["Core", "style", "Event","Validation"],
23
23
  Graph:["Core", "Properties", "style", "Event","Validation"],
24
24
  DownloadFile:["Core", "style", "Event","Validation"],
25
- Box: ["Core", "Properties", "style", "Event","Validation"],
25
+ Box: ["Core", "style", "Event","Validation"],
26
26
  Properties: ["Core", "Properties", "style", "Event","Validation"],
27
27
  ProgressBarCard: ["Core", "Properties", "style", "Event","Validation"],
28
28
  RankCard: ["Core", "Properties", "style", "Event","Validation"],
@@ -101,6 +101,21 @@ async function mergeFormdata(handlerResponse: any, componentName: string, eventC
101
101
  }
102
102
  })
103
103
  }
104
+ else if(eventConfig.type = "MultipleSelect" && !(_.isEmpty(handlerResponse) && handlerResponse)){
105
+ store.setSchema((pre) => {
106
+ return {
107
+ ...pre, properties: {
108
+ ...pre.properties, [componentName]: {
109
+ ...pre.properties?.[componentName],
110
+ type:"array",
111
+ items:{
112
+ oneOf: handlerResponse.data
113
+ }
114
+ }
115
+ }
116
+ }
117
+ })
118
+ }
104
119
  else if (eventConfig.type === "page") {
105
120
  store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
106
121
  }
@@ -114,7 +129,7 @@ async function mergeFormdata(handlerResponse: any, componentName: string, eventC
114
129
  const buildBodyFormat = (body: any[], formData: any, userValue: any) => {
115
130
  const finalBody = { ...userValue?.payload };
116
131
  body.map((elem) => {
117
- if (elem?.value !== "string") {
132
+ if(typeof elem?.value !== "string") {
118
133
  finalBody[elem.key] = elem.value;
119
134
  } else {
120
135
  if (elem?.value?.startsWith("$userValue")) {
@@ -134,7 +149,7 @@ const buildBodyFormat = (body: any[], formData: any, userValue: any) => {
134
149
 
135
150
  const buildHeadersFormat = (headers: any[]) => {
136
151
  const headerObj = {
137
- "Content-Type": "application/json",
152
+ // "Content-Type": "application/json",
138
153
  "X-Requested-With": "XMLHttpRequest"
139
154
  }
140
155
  headers.map((elem) => {