impaktapps-ui-builder 0.0.412-mtreemap.2 → 0.0.412-mtreemap.20

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.
Files changed (44) hide show
  1. package/dist/impaktapps-ui-builder.es.js +716 -362
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +13 -13
  4. package/dist/impaktapps-ui-builder.umd.js.map +1 -1
  5. package/dist/src/impaktapps-ui-builder/builder/build/buildBasicUiSchema.d.ts +1 -1
  6. package/dist/src/impaktapps-ui-builder/builder/build/uischema/button.d.ts +1 -6
  7. package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +12 -10
  8. package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +5 -5
  9. package/dist/src/impaktapps-ui-builder/builder/build/uischema/file.d.ts +6 -6
  10. package/dist/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.d.ts +8 -5
  11. package/dist/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.d.ts +1 -0
  12. package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +4 -2
  13. package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +3 -2
  14. package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +3 -1
  15. package/package.json +1 -1
  16. package/src/impaktapps-ui-builder/builder/build/buildBasicUiSchema.ts +2 -2
  17. package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +4 -4
  18. package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +1 -1
  19. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +27 -26
  20. package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +2 -0
  21. package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +1 -1
  22. package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +2 -2
  23. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +39 -38
  24. package/src/impaktapps-ui-builder/builder/build/uischema/button.ts +2 -7
  25. package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +10 -9
  26. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +21 -28
  27. package/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.ts +3 -8
  28. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +155 -102
  29. package/src/impaktapps-ui-builder/builder/build/uischema/file.ts +2 -12
  30. package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +1 -1
  31. package/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.ts +9 -5
  32. package/src/impaktapps-ui-builder/builder/build/uischema/refresh.ts +14 -0
  33. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +1 -1
  34. package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +1 -1
  35. package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +1 -0
  36. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +0 -2
  37. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +495 -283
  38. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.ts +1 -1
  39. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +346 -208
  40. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +70 -23
  41. package/src/impaktapps-ui-builder/builder/services/component.ts +39 -21
  42. package/src/impaktapps-ui-builder/builder/services/event.ts +16 -6
  43. package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +18 -2
  44. package/src/impaktapps-ui-builder/runtime/services/service.ts +112 -4
@@ -1,3 +1,5 @@
1
+ import { getSelectField } from "../../../build/uischema/buildPropertiesSection";
2
+
1
3
  export const EventUiSchema: any = (theme) => {
2
4
  const uiSchema = {
3
5
  type: "HorizontalLayout",
@@ -106,33 +108,77 @@ export const EventUiSchema: any = (theme) => {
106
108
  },
107
109
  },
108
110
  },
111
+ getSelectField("Handler", "Handler", [
112
+ { label: "Custom", value: "custom" },
113
+ { label: "Api", value: "api" },
114
+ { label: "Inbuilt Function", value: "inBuiltFunction" },
115
+ { label: "Refresh", value: "refresh" },
116
+ ]),
109
117
  {
110
118
  type: "Control",
111
- scope: `#/properties/Handler`,
112
-
119
+ scope: "#/properties/EmptyBox",
113
120
  options: {
114
- widget: "SelectInputField",
121
+ widget: "EmptyBox",
115
122
  },
116
123
  config: {
117
- layout: { xs: 11, sm: 4, md: 4, lg: 4 },
118
- main: {
119
- label: "Handler",
120
- type: "text",
121
- },
124
+ layout: { xs: 0, sm: 4, md: 4, lg: 4 },
122
125
  },
123
126
  },
124
- {
125
- type: "Control",
126
- scope: "#/properties/emptyBox",
127
- options: {
128
- widget: "EmptyBox"
129
- },
130
- config: {
131
- layout: { xs: 0, sm: 4 }
132
- }
133
- }
134
127
  ],
135
128
  },
129
+ // {
130
+ // type: "WrapperLayout",
131
+ // config: {
132
+ // main: {
133
+ // // label: "Success Case Event",
134
+ // // divider: true,
135
+ // },
136
+ // wrapperStyle: {
137
+ // border: "1px solid gray"
138
+ // },
139
+ // },
140
+ // elements: [
141
+ // {
142
+ // type: "Control",
143
+ // scope: "#/properties/heading",
144
+
145
+ // options: {
146
+ // widget: "Box",
147
+ // },
148
+ // config: {
149
+ // layout: 8,
150
+ // main: {
151
+ // heading: "Response Event",
152
+ // },
153
+ // style: {
154
+ // fontFamily: "Roboto",
155
+ // fontWeight: "500",
156
+ // paddingLeft: "-10px",
157
+ // fontSize: "20px",
158
+ // },
159
+ // },
160
+ // },
161
+ // {
162
+ // type: "Control",
163
+ // scope: "#/properties/AddButton",
164
+ // options: {
165
+ // widget: "IconButton",
166
+ // },
167
+ // config: {
168
+ // layout: 3,
169
+ // main: {
170
+ // icon: "AddIcon",
171
+ // styleDefault: true,
172
+ // size: "small",
173
+ // onClick: "addEvent",
174
+ // tooltipMessage: "Back",
175
+ // },
176
+ // style: {
177
+ // float: "right",
178
+ // },
179
+ // },
180
+ // },
181
+
136
182
  {
137
183
  type: "Control",
138
184
  scope: "#/properties/events",
@@ -195,7 +241,7 @@ export const EventUiSchema: any = (theme) => {
195
241
  },
196
242
  config: {
197
243
  main: {
198
- // color: "info",
244
+ color: "info",
199
245
  size: "small",
200
246
  icon: "EditIcon",
201
247
  tooltipMessage: "Edit This Record",
@@ -227,6 +273,7 @@ export const EventUiSchema: any = (theme) => {
227
273
  },
228
274
  },
229
275
  ]
276
+ // }]
230
277
  }
231
278
  ],
232
279
  },
@@ -323,7 +370,7 @@ export const EventUiSchema: any = (theme) => {
323
370
  },
324
371
  elements: [
325
372
  {
326
-
373
+
327
374
  type: "Control",
328
375
  scope: "#/properties/FooterText",
329
376
  options: {
@@ -378,7 +425,7 @@ export const EventUiSchema: any = (theme) => {
378
425
  {
379
426
  type: "Control",
380
427
  scope: "#/properties/text",
381
-
428
+
382
429
  options: {
383
430
  widget: "Box",
384
431
  },
@@ -410,5 +457,5 @@ export const EventUiSchema: any = (theme) => {
410
457
  }
411
458
  ],
412
459
  };
413
- return uiSchema
414
- }
460
+ return uiSchema;
461
+ }
@@ -43,25 +43,25 @@ const sectionLabels = {
43
43
 
44
44
 
45
45
 
46
- export const refreshPage = (type:string,store:any) => {
46
+ export const refreshPage = (type: string, store: any) => {
47
47
  const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
48
- if(type){
49
- const sectionUiSchema = {
50
- Core: CoreSection,
51
- Value: ValueTab,
52
- style: StyleSection,
53
- Event: EventSection,
54
- Components: TableSection,
55
- Properties: buildPropertiesSection(type),
56
- Validation:ValidationSection
57
-
48
+ if (type) {
49
+ const sectionUiSchema = {
50
+ Core: CoreSection,
51
+ Value: ValueTab,
52
+ Style: StyleSection,
53
+ Event: EventSection,
54
+ Components: TableSection,
55
+ Properties: buildPropertiesSection(type),
56
+ Validation: ValidationSection
57
+
58
+ }
59
+ const elements = sectionLabels[type]?.map(e => sectionUiSchema[e]);
60
+ UiSchema.elements[0].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Event", "Validation"];
61
+ UiSchema.elements[0].elements = elements || [CoreSection, StyleSection, EventSection, ValidationSection];
62
+
58
63
  }
59
- const elements = sectionLabels[type]?.map(e => sectionUiSchema[e]);
60
- UiSchema.elements[0].config.main.tabLabels = sectionLabels[type] || ["Core", "style","Event","Validation"];
61
- UiSchema.elements[0].elements = elements || [CoreSection, StyleSection,EventSection,ValidationSection];
62
-
63
- }
64
- store.setUiSchema(UiSchema);
64
+ store.setUiSchema(UiSchema);
65
65
  }
66
66
 
67
67
  export default (store: any, dynamicData: any, submitHandler: any, service: any) => {
@@ -107,20 +107,28 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
107
107
  store.navigate(`/Component?path=${`elements[${rowId}]`}&id=${id}`)
108
108
  }
109
109
  },
110
- deleteComponents: function () {
110
+ deleteComponents: function (shouldUpdateDialog: boolean = true) {
111
111
  const path = store.searchParams?.get("path");
112
- const rowId = dynamicData.path.split(".")[1];
112
+ const rowId = localStorage.getItem('rowId');
113
113
  store.formData.elements.splice(rowId, 1);
114
114
  const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
115
115
  const data = path ? _.get(response, path) : response;
116
116
  store.setFormdata(data);
117
+ if(shouldUpdateDialog){
118
+ store.updateDialog("popUpComponentSection");
119
+ }
120
+ localStorage.removeItem('rowId');
117
121
  },
118
- deleteEvent: function () {
122
+ deleteEvent: function (shouldUpdateDialog: boolean = true) {
119
123
  const path = store.searchParams?.get("path");
120
- const rowId = dynamicData.path.split(".")[1];
124
+ const rowId = localStorage.getItem('rowId');
121
125
  store.formData.events.splice(rowId, 1);
122
126
  const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
123
127
  store.setFormdata(_.get(response, path));
128
+ if(shouldUpdateDialog){
129
+ store.updateDialog("popUpEventSection")
130
+ }
131
+ localStorage.removeItem('rowId');
124
132
  },
125
133
  widgetAddClickHandler: function () {
126
134
  if (!Array.isArray(store.formData.elements)) {
@@ -155,6 +163,16 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
155
163
  backHandler: function () {
156
164
  store.navigate(-1)
157
165
  },
166
+ deletePopUpComponent: function(){
167
+ const rowId = dynamicData.path.split(".")[1];
168
+ localStorage.setItem('rowId',rowId);
169
+ store.updateDialog("popUpComponentSection");
170
+ },
171
+ deletePopUpEvent: function(){
172
+ const rowId = dynamicData.path.split(".")[1];
173
+ localStorage.setItem('rowId',rowId);
174
+ store.updateDialog("popUpEventSection");
175
+ },
158
176
  }
159
177
  };
160
178
 
@@ -28,12 +28,13 @@ export default (
28
28
  const schema: any = _.cloneDeep(EventSchema)
29
29
  if (handlerType) {
30
30
  if (handlerType === "custom") {
31
- uiSchema.elements[1].elements[0].elements[2] = getRadioInputField("isSync","Run in Sync",["Yes","No"])
32
- uiSchema.elements[1].elements[0].elements[3] = emptyBox;
31
+ uiSchema.elements[0].elements[0].elements[2] = getRadioInputField("isSync","Run in Sync",["Yes","No"])
32
+ // uiSchema.elements[0].elements[0].elements[3] = emptyBox;
33
33
  uiSchema.elements[0].elements[0].elements[3] = getTextArea("eventCode", "Write Custom Code", false)
34
34
  schema.required = ["eventType", "Handler", "eventCode"]
35
35
 
36
36
  } else if (handlerType === "api") {
37
+ uiSchema.elements[0].elements[0].elements[2] = emptyBox;
37
38
  uiSchema.elements[0].elements[0].elements[3] = APISection;
38
39
  schema.required = ["eventType", "Handler", "method", "path"]
39
40
  } else if (handlerType === "inBuiltFunction") {
@@ -42,9 +43,10 @@ export default (
42
43
  { label: "Download File", value: "downloadFile" },
43
44
  { label: "Download Blob File", value: "downloadBlobFile" }
44
45
  ])
45
- uiSchema.elements[0].elements[0].elements[3] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true, 12);
46
+ uiSchema.elements[0].elements[0].elements[3] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true);
46
47
  schema.required = ["eventType", "Handler", "inBuiltFunctionType"]
47
48
  } else if (handlerType === "refresh") {
49
+ uiSchema.elements[0].elements[0].elements[2] = emptyBox;
48
50
  uiSchema.elements[0].elements[0].elements[3] = refreshSectionUiSchema;
49
51
  schema.properties.refreshElements.required = ["value"]
50
52
  schema.properties.refreshElements.items.required = ["value"]
@@ -62,8 +64,8 @@ export default (
62
64
  },
63
65
 
64
66
  getFormData: Component(store, dynamicData, submitHandler, service).getFormdata,
65
- getUiSchema: async function () {
66
- return await EventUiSchema(store.theme.myTheme);
67
+ getUiSchema: function () {
68
+ return EventUiSchema;
67
69
  },
68
70
  getSchema: () => {
69
71
  return EventSchema;
@@ -99,9 +101,17 @@ export default (
99
101
  this.setPage()
100
102
 
101
103
  },
102
- deleteEvent: Component(store, dynamicData, submitHandler, service).deleteEvent,
104
+ deleteEvent: async function () {
105
+ await Component(store, dynamicData, submitHandler, service).deleteEvent(false);
106
+ store.updateDialog("popUpEvent");
107
+ },
103
108
  backHandler: function () {
104
109
  store.navigate(-1)
105
110
  },
111
+ deletePopUpEvent: function(){
112
+ const rowId = dynamicData.path.split(".")[1];
113
+ localStorage.setItem('rowId',rowId);
114
+ store.updateDialog("popUpEvent");
115
+ }
106
116
  }
107
117
  };
@@ -62,7 +62,11 @@ export default (funcParams: funcParamsProps) => {
62
62
  },
63
63
  saveHandler: async () => await saveHandler(store, service, submitHandler),
64
64
  Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
65
- Delete_Components: Component(store, dynamicData, submitHandler, service).deleteComponents,
65
+
66
+ Delete_Components: async function() {
67
+ await Component(store, dynamicData, submitHandler, service).deleteComponents(false);
68
+ store.updateDialog("popUpPageMasterComponent");
69
+ },
66
70
  eventAddHandler: function () {
67
71
  const id = store.searchParams?.get("id");
68
72
  if (!Array.isArray(store.formData.events)) {
@@ -80,10 +84,22 @@ export default (funcParams: funcParamsProps) => {
80
84
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
81
85
  },
82
86
  deleteEvent: function () {
83
- const rowId = dynamicData.path.split(".")[1];
87
+ const rowId = localStorage.getItem('rowId');
84
88
  store.formData.events.splice(rowId, 1);
85
89
  const response = saveFormdataInLocalStorage(store.ctx.core.data)
86
90
  store.setFormdata(response);
91
+ store.updateDialog("popUpPageMasterEvent");
92
+ localStorage.removeItem('rowId');
93
+ },
94
+ deletePopUpComponent: function(){
95
+ const rowId = dynamicData.path.split(".")[1];
96
+ localStorage.setItem('rowId',rowId);
97
+ store.updateDialog("popUpPageMasterComponent");
98
+ },
99
+ deletePopUpEvent: function(){
100
+ const rowId = dynamicData.path.split(".")[1];
101
+ localStorage.setItem('rowId',rowId);
102
+ store.updateDialog("popUpPageMasterEvent");
87
103
  },
88
104
  }
89
105
  };
@@ -1,6 +1,6 @@
1
1
  import _, { isEmpty } from "lodash";
2
2
  import { doDownload, downloadFile } from "./downloadFile";
3
- import { asyncOperation, executeEvents, executeRefreshHandler } from "./events";
3
+ import { executeEvents, executeRefreshHandler } from "./events";
4
4
  import { handlersProps } from "./interface";
5
5
  let compType: string;
6
6
  let eventGroups: any = {};
@@ -89,6 +89,116 @@ export default (funcParams: funcParamsProps) => {
89
89
  }
90
90
  const config = pageData?.config;
91
91
  const uiSchema = pageData?.uiSchema;
92
+ window.localStorage.setItem("pageName", config.label);
93
+ window.dispatchEvent(new Event('pageNameChanged'))
94
+ const theme = funcParams?.store?.theme?.myTheme;
95
+ uiSchema.elements.push(
96
+
97
+ {
98
+ type: "HorizontalLayout",
99
+ config: {
100
+ main: {
101
+ direction: 'row'
102
+ },
103
+ style: {
104
+ flexDirection: "row",
105
+ position: "absolute",
106
+ bottom: 0,
107
+ marginBottom: '-8px',
108
+ height: 'fit-content',
109
+ overflow: 'hidden',
110
+ zIndex: 1000,
111
+ width: 'inherit'
112
+ }
113
+ },
114
+ elements: [
115
+ {
116
+
117
+ type: "Control",
118
+ scope: "#/properties/FooterText",
119
+ options: {
120
+ widget: "Box",
121
+ },
122
+ config: {
123
+ main: {
124
+ heading: "Copywriter@ACT21.IO"
125
+ },
126
+ style: {
127
+ color: theme?.palette?.text.disabled || "#AFAFAF",
128
+ fontSize: '12px',
129
+ textAlign: 'center',
130
+ lineHeight: 1,
131
+ width: 'fit-content',
132
+ left: '50%',
133
+ position: 'relative',
134
+ margin: 0,
135
+ flexGrow: 1,
136
+ height: 0
137
+ }
138
+ },
139
+ },
140
+ {
141
+ type: "Control",
142
+ scope: "#/properties/backIcon",
143
+ options: {
144
+ widget: "Box",
145
+ },
146
+ config: {
147
+ main: {
148
+ iconName: 'PrevIcon',
149
+ onClick: "backHandler",
150
+ width: 'fit-content',
151
+ },
152
+ style: {
153
+ fill: theme.palette.primary.main,
154
+ width: 20,
155
+ height: 0,
156
+ margin: 0,
157
+ top: 0,
158
+ right: '82px',
159
+ position: 'absolute',
160
+ fontSize: '12px',
161
+ cursor: 'pointer',
162
+ ':hover': {
163
+ fill: theme.palette.primary.dark,
164
+ }
165
+ }
166
+ }
167
+ },
168
+ {
169
+ type: "Control",
170
+ scope: "#/properties/text",
171
+
172
+ options: {
173
+ widget: "Box",
174
+ },
175
+ config: {
176
+ main: {
177
+ heading: "Previous Page",
178
+ onClick: "backHandler"
179
+ },
180
+ style: {
181
+ textAlign: 'left',
182
+ lineHeight: 1,
183
+ height: 0,
184
+ width: 'fit-content',
185
+ color: theme.palette.primary.main,
186
+ fontSize: "12px",
187
+ cursor: 'pointer',
188
+ marginLeft: '2px',
189
+ marginRight: 0,
190
+ top: 3,
191
+ right: '12px',
192
+ position: 'absolute',
193
+ ':hover': {
194
+ color: theme.palette.primary.dark,
195
+ }
196
+ }
197
+ },
198
+ },
199
+ ]
200
+ }
201
+ );
92
202
  const schema = pageData?.schema ?? { type: "object", properties: {} };
93
203
  eventGroups = {}
94
204
  eventGroups = extractEvents(config);
@@ -101,10 +211,8 @@ export default (funcParams: funcParamsProps) => {
101
211
  await executeRefreshHandler({
102
212
  config: {}, componentName: "",
103
213
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
104
- serviceHolder: this, eventGroups,formDataHolder
214
+ serviceHolder: this, eventGroups, formDataHolder
105
215
  })
106
- const jsonres = await fetch('https://jsonplaceholder.typicode.com/todos/1');
107
- const result = await jsonres.json()
108
216
  funcParams.store.setSchema(
109
217
  (pre: any) => {
110
218
  return {