impaktapps-ui-builder 0.0.412 → 0.0.591

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 (74) hide show
  1. package/dist/impaktapps-ui-builder.es.js +2170 -1539
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +14 -14
  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/buildConfig.d.ts +1 -1
  7. package/dist/src/impaktapps-ui-builder/builder/build/uischema/apiSection.d.ts +35 -2
  8. package/dist/src/impaktapps-ui-builder/builder/build/uischema/box.d.ts +2 -2
  9. package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +18 -0
  10. package/dist/src/impaktapps-ui-builder/builder/build/uischema/button.d.ts +1 -6
  11. package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +10 -12
  12. package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +15 -0
  13. package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +71 -122
  14. package/dist/src/impaktapps-ui-builder/builder/build/uischema/file.d.ts +6 -6
  15. package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +4 -106
  16. package/dist/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.d.ts +58 -45
  17. package/dist/src/impaktapps-ui-builder/builder/build/uischema/table.d.ts +1 -0
  18. package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +74 -99
  19. package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +17 -2
  20. package/dist/src/impaktapps-ui-builder/builder/build/uischema/valueTab.d.ts +17 -2
  21. package/dist/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.d.ts +1 -0
  22. package/dist/src/impaktapps-ui-builder/builder/services/component.d.ts +4 -2
  23. package/dist/src/impaktapps-ui-builder/builder/services/event.d.ts +2 -1
  24. package/dist/src/impaktapps-ui-builder/builder/services/pageMaster.d.ts +3 -1
  25. package/dist/src/impaktapps-ui-builder/runtime/services/events.d.ts +1 -1
  26. package/dist/src/impaktapps-ui-builder/runtime/services/interface.d.ts +1 -0
  27. package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +2 -1
  28. package/package.json +1 -1
  29. package/src/impaktapps-ui-builder/builder/build/buildBasicUiSchema.ts +1 -1
  30. package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +5 -5
  31. package/src/impaktapps-ui-builder/builder/build/buildDate.ts +1 -1
  32. package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +1 -1
  33. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +7 -2
  34. package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +13 -2
  35. package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +1 -1
  36. package/src/impaktapps-ui-builder/builder/build/buildSchema.ts +0 -1
  37. package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +1 -5
  38. package/src/impaktapps-ui-builder/builder/build/buildTable.ts +17 -1
  39. package/src/impaktapps-ui-builder/builder/build/buildTreeMap.ts +3 -0
  40. package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +1 -1
  41. package/src/impaktapps-ui-builder/builder/build/uischema/apiSection.ts +50 -27
  42. package/src/impaktapps-ui-builder/builder/build/uischema/box.ts +3 -2
  43. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +86 -73
  44. package/src/impaktapps-ui-builder/builder/build/uischema/button.ts +2 -7
  45. package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +88 -90
  46. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +30 -47
  47. package/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.ts +3 -13
  48. package/src/impaktapps-ui-builder/builder/build/uischema/emptyBox.ts +1 -1
  49. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +34 -56
  50. package/src/impaktapps-ui-builder/builder/build/uischema/file.ts +2 -12
  51. package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +7 -118
  52. package/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.ts +82 -72
  53. package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +1 -1
  54. package/src/impaktapps-ui-builder/builder/build/uischema/refresh.ts +15 -11
  55. package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +1 -6
  56. package/src/impaktapps-ui-builder/builder/build/uischema/table.ts +5 -7
  57. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +85 -101
  58. package/src/impaktapps-ui-builder/builder/build/uischema/textInputField.ts +1 -6
  59. package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +12 -12
  60. package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +13 -13
  61. package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +1 -0
  62. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +0 -2
  63. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +355 -165
  64. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.ts +1 -1
  65. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +533 -315
  66. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +1 -0
  67. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +397 -264
  68. package/src/impaktapps-ui-builder/builder/services/component.ts +26 -9
  69. package/src/impaktapps-ui-builder/builder/services/event.ts +17 -7
  70. package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +19 -3
  71. package/src/impaktapps-ui-builder/builder/services/utils.ts +0 -1
  72. package/src/impaktapps-ui-builder/runtime/services/events.ts +31 -18
  73. package/src/impaktapps-ui-builder/runtime/services/interface.ts +1 -0
  74. package/src/impaktapps-ui-builder/runtime/services/service.ts +134 -15
@@ -44,21 +44,20 @@ const sectionLabels = {
44
44
 
45
45
 
46
46
  export const refreshPage = (type: string, store: any) => {
47
- const UiSchema = _.cloneDeep(componentBasicUiSchema)
47
+ const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
48
48
  if (type) {
49
49
  const sectionUiSchema = {
50
50
  Core: CoreSection,
51
51
  Value: ValueTab,
52
52
  Style: StyleSection,
53
- Event: EventSection,
54
- Components: TableSection,
53
+ Event: EventSection(store.theme.myTheme),
54
+ Components: TableSection(store.theme.myTheme),
55
55
  Properties: buildPropertiesSection(type),
56
56
  Validation: ValidationSection
57
-
58
57
  }
59
58
  const elements = sectionLabels[type]?.map(e => sectionUiSchema[e]);
60
59
  UiSchema.elements[1].config.main.tabLabels = sectionLabels[type] || ["Core", "Style", "Event", "Validation"];
61
- UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection, ValidationSection];
60
+ UiSchema.elements[1].elements = elements || [CoreSection, StyleSection, EventSection(store.theme.myTheme), ValidationSection];
62
61
 
63
62
  }
64
63
  store.setUiSchema(UiSchema);
@@ -107,20 +106,28 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
107
106
  store.navigate(`/Component?path=${`elements[${rowId}]`}&id=${id}`)
108
107
  }
109
108
  },
110
- deleteComponents: function () {
109
+ deleteComponents: function (shouldUpdateDialog: boolean = true) {
111
110
  const path = store.searchParams?.get("path");
112
- const rowId = dynamicData.path.split(".")[1];
111
+ const rowId = localStorage.getItem('rowId');
113
112
  store.formData.elements.splice(rowId, 1);
114
113
  const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
115
114
  const data = path ? _.get(response, path) : response;
116
115
  store.setFormdata(data);
116
+ if (shouldUpdateDialog) {
117
+ store.updateDialog("popUpComponentSection");
118
+ }
119
+ localStorage.removeItem('rowId');
117
120
  },
118
- deleteEvent: function () {
121
+ deleteEvent: function (shouldUpdateDialog: boolean = true) {
119
122
  const path = store.searchParams?.get("path");
120
- const rowId = dynamicData.path.split(".")[1];
123
+ const rowId = localStorage.getItem('rowId');
121
124
  store.formData.events.splice(rowId, 1);
122
125
  const response = saveFormdataInLocalStorage(store.ctx.core.data, path)
123
126
  store.setFormdata(_.get(response, path));
127
+ if (shouldUpdateDialog) {
128
+ store.updateDialog("popUpEventSection")
129
+ }
130
+ localStorage.removeItem('rowId');
124
131
  },
125
132
  widgetAddClickHandler: function () {
126
133
  if (!Array.isArray(store.formData.elements)) {
@@ -155,6 +162,16 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
155
162
  backHandler: function () {
156
163
  store.navigate(-1)
157
164
  },
165
+ deletePopUpComponent: function () {
166
+ const rowId = dynamicData.path.split(".")[1];
167
+ localStorage.setItem('rowId', rowId);
168
+ store.updateDialog("popUpComponentSection");
169
+ },
170
+ deletePopUpEvent: function () {
171
+ const rowId = dynamicData.path.split(".")[1];
172
+ localStorage.setItem('rowId', rowId);
173
+ store.updateDialog("popUpEventSection");
174
+ },
158
175
  }
159
176
  };
160
177
 
@@ -24,17 +24,18 @@ export default (
24
24
  this.refreshPage(formdata.Handler, store)
25
25
  },
26
26
  refreshPage: (handlerType: any, store: any) => {
27
- const uiSchema = _.cloneDeep(EventUiSchema);
27
+ const uiSchema = _.cloneDeep(EventUiSchema(store.theme.myTheme));
28
28
  const schema: any = _.cloneDeep(EventSchema)
29
29
  if (handlerType) {
30
30
  if (handlerType === "custom") {
31
31
  uiSchema.elements[1].elements[0].elements[2] = getRadioInputField("isSync","Run in Sync",["Yes","No"])
32
- uiSchema.elements[1].elements[0].elements[3] = emptyBox;
33
- uiSchema.elements[1].elements[0].elements[4] = getTextArea("eventCode", "Write Custom Code", false)
32
+ // uiSchema.elements[0].elements[0].elements[3] = emptyBox;
33
+ uiSchema.elements[1].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[1].elements[0].elements[2] = APISection;
37
+ uiSchema.elements[1].elements[0].elements[2] = emptyBox;
38
+ uiSchema.elements[1].elements[0].elements[3] = APISection;
38
39
  schema.required = ["eventType", "Handler", "method", "path"]
39
40
  } else if (handlerType === "inBuiltFunction") {
40
41
  uiSchema.elements[1].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
@@ -42,10 +43,11 @@ export default (
42
43
  { label: "Download File", value: "downloadFile" },
43
44
  { label: "Download Blob File", value: "downloadBlobFile" }
44
45
  ])
45
- uiSchema.elements[1].elements[0].elements[3] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true, { xs: 12, sm: 12, md: 6 });
46
+ uiSchema.elements[1].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") {
48
- uiSchema.elements[1].elements[0].elements[2] = refreshSectionUiSchema;
49
+ uiSchema.elements[1].elements[0].elements[2] = emptyBox;
50
+ uiSchema.elements[1].elements[0].elements[3] = refreshSectionUiSchema;
49
51
  schema.properties.refreshElements.required = ["value"]
50
52
  schema.properties.refreshElements.items.required = ["value"]
51
53
  schema.required = ["eventType", "Handler", "refreshElements"]
@@ -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
  };
@@ -34,7 +34,7 @@ export default (funcParams: funcParamsProps) => {
34
34
  return config
35
35
  },
36
36
  getUiSchema: function () {
37
- return PageMasterUiSchema;
37
+ return PageMasterUiSchema(store.theme.myTheme);
38
38
  },
39
39
  getSchema: () => {
40
40
  return PageMasterSchema;
@@ -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
  };
@@ -91,7 +91,6 @@ export const navigateHandler = (store, isSubmitted, pageName?: string | boolean)
91
91
 
92
92
  export function okHandler(store) {
93
93
  const path = store.searchParams?.get("path");
94
- console.log(store.ctx.core.errors)
95
94
  if (_.isEmpty(store.ctx.core.errors)) {
96
95
  saveFormdataInLocalStorage(store.ctx.core.data, path)
97
96
  store.navigate(-1)
@@ -51,7 +51,7 @@ export const executeEvents = (params: handlersProps) => {
51
51
  }
52
52
  }
53
53
  return finalResponse;
54
- }
54
+ }
55
55
 
56
56
  function executeEventsHandler(params: handlersProps) {
57
57
  if (params.config.Handler === "api") {
@@ -68,7 +68,8 @@ function executeEventsHandler(params: handlersProps) {
68
68
  params.componentName,
69
69
  params.config,
70
70
  params.store,
71
- params.service
71
+ params.service,
72
+ params.formDataHolder
72
73
  );
73
74
  } else if (params.config.Handler === "onBackHandler") {
74
75
  return params.store.functionParameters?.handleBack();
@@ -92,18 +93,20 @@ export function getRefreshElements(eventConfig: any, eventGropus: any) {
92
93
  result.push(result[0]);
93
94
  }
94
95
  }
95
- console.log(result);
96
96
  return result;
97
97
  }
98
- export function executeRefreshHandler(params: handlersProps) {
98
+ export async function executeRefreshHandler(params: handlersProps) {
99
99
  const compToRefresh: string[] = getRefreshElements(params.config, params.eventGroups);
100
-
101
- return Promise.all(compToRefresh.map(componentName => {
102
- return Promise.all(params.eventGroups.onLoad[componentName].map(compEventConfig => {
100
+ return Promise.allSettled(compToRefresh.map(componentName => {
101
+ const eventConfigs = params.eventGroups.onLoad[componentName];
102
+ if (!eventConfigs) {
103
+ return Promise.resolve();
104
+ }
105
+ return Promise.allSettled(eventConfigs.map(compEventConfig => {
103
106
  return executeEvents({ ...params, config: compEventConfig, componentName });
104
107
  }));
105
- }))
106
- };
108
+ }));
109
+ }
107
110
  export function executeApiRequest(params: any) {
108
111
  const initialBody = { ...params.userValue?.payload };
109
112
  const initialHeaders = {
@@ -143,7 +146,7 @@ function executeCustomHandler(params: handlersProps) {
143
146
 
144
147
  }
145
148
 
146
- function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any) {
149
+ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any, formDataHolder: any) {
147
150
  if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
148
151
  store.setSchema((pre) => {
149
152
  return {
@@ -173,17 +176,22 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
173
176
  }
174
177
  else if (eventConfig.type === "page") {
175
178
  if (!(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
179
+ store.newData = {
180
+ ...store.newData,
181
+ ...handlerResponse?.data
182
+ }
176
183
  store.setFormdata((pre: any) => { return { ...pre, ...handlerResponse?.data } })
177
184
  }
178
185
  }
179
186
  else {
180
187
  if (handlerResponse) {
181
- store.setFormdata((pre) => { return { ...pre, [componentName]: eventConfig.lazyLoading ? handlerResponse?.data?.data : handlerResponse.data } });
188
+ formDataHolder[componentName] = handlerResponse.data
189
+ store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
182
190
  }
183
191
  }
184
192
  }
185
193
 
186
- const buildBodyFormat = (body: any[], formData: any, userValue: any) => {
194
+ const buildBodyFormat = (body: any[], formData: any, userValue: any, store: any) => {
187
195
  let finalBody = { ...userValue?.payload };
188
196
  body.map((elem) => {
189
197
  if (typeof elem?.value !== "string") {
@@ -192,6 +200,15 @@ const buildBodyFormat = (body: any[], formData: any, userValue: any) => {
192
200
  if (elem?.value?.startsWith("$userValue")) {
193
201
  const finalpath = elem.value.substring(11);
194
202
  finalBody[elem.key] = _.get(userValue, finalpath);;
203
+ } else if (elem?.value?.startsWith("$urlParams")) {
204
+ const finalpath = elem.value.substring(11);
205
+ const value = store?.searchParams?.get(finalpath);
206
+ finalBody[elem.key] = value;
207
+ }
208
+ else if (elem?.value?.startsWith("$local")) {
209
+ const finalpath = elem.value.substring(7);
210
+ const value = JSON.parse(localStorage.getItem(finalpath) || '""')
211
+ finalBody[elem.key] = value;
195
212
  }
196
213
  else if (elem?.value?.startsWith("$")) {
197
214
  const finalpath = elem.value.substring(1);
@@ -245,14 +262,10 @@ export function buildApiPayload(compConfig: any, body: any, headers: any, store:
245
262
  if (compConfig?.headers) {
246
263
  headers = buildHeadersFormat(compConfig.headers);
247
264
  }
248
-
249
265
  if (compConfig.body) {
250
- body = { ...buildBodyFormat(compConfig.body, store.newData || store?.ctx?.core?.data || store.formData, userValue) };
266
+ body = { ...buildBodyFormat(compConfig.body, store.newData || store?.ctx?.core?.data || store.formData, userValue, store) };
251
267
  }
252
-
253
268
  const promiseChain = { body, headers };
254
-
255
-
256
269
  if (compConfig.apiBody) {
257
270
  const makeFunc = eval(compConfig.apiBody);
258
271
  return { body: makeFunc(store, dynamicData, userValue, promiseChain.body), headers: promiseChain.headers };
@@ -269,4 +282,4 @@ export function asyncOperation() {
269
282
  }
270
283
  }, 50);
271
284
  });
272
- }
285
+ }
@@ -9,4 +9,5 @@ export interface handlersProps {
9
9
  eventGroups?: any,
10
10
  parentEventOutput?: any,
11
11
  functionsProvider?:Record<string,any>
12
+ formDataHolder?:Record<string,any>
12
13
  }
@@ -12,7 +12,7 @@ const notifyUiSchema = {
12
12
  },
13
13
  layout: 6,
14
14
  };
15
-
15
+ let formDataHolder = {}
16
16
  interface funcParamsProps {
17
17
  store: any,
18
18
  dynamicData: any,
@@ -54,7 +54,6 @@ export const extractEvents = (eventConfig: any) => {
54
54
  });
55
55
  }
56
56
  }
57
-
58
57
  extractsConfigEvents(eventConfig)
59
58
  if (eventConfig?.elements) {
60
59
  eventConfig.elements.forEach(extractEvents);
@@ -72,12 +71,12 @@ export default (funcParams: funcParamsProps) => {
72
71
  config: {}, componentName: "",
73
72
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
74
73
  serviceHolder: { downloadFile, download: doDownload, ...funcParams.functionsProvider }, eventGroups,
75
- functionsProvider: funcParams.functionsProvider,
74
+ functionsProvider: funcParams.functionsProvider, formDataHolder
76
75
  };
77
76
  return {
78
77
  setPage: async function () {
79
- funcParams.store.setFormdata({})
80
-
78
+ funcParams.store.setFormdata({});
79
+ funcParams.store.newData = {};
81
80
  const pageBasicDetailString = localStorage.getItem("pagemasterMetaData")
82
81
  if (pageBasicDetailString) {
83
82
  pageData = JSON.parse(pageBasicDetailString)
@@ -90,6 +89,118 @@ export default (funcParams: funcParamsProps) => {
90
89
  }
91
90
  const config = pageData?.config;
92
91
  const uiSchema = pageData?.uiSchema;
92
+ const event = new CustomEvent('pageNameChanged', {
93
+ detail: { pageName: config.label }
94
+ });
95
+ window.dispatchEvent(event)
96
+ const theme = funcParams?.store?.theme?.myTheme;
97
+ uiSchema.elements.push(
98
+
99
+ {
100
+ type: "HorizontalLayout",
101
+ config: {
102
+ main: {
103
+ direction: 'row'
104
+ },
105
+ style: {
106
+ flexDirection: "row",
107
+ position: "absolute",
108
+ bottom: 0,
109
+ marginBottom: '-8px',
110
+ height: 'fit-content',
111
+ overflow: 'hidden',
112
+ zIndex: 1000,
113
+ width: 'inherit'
114
+ }
115
+ },
116
+ elements: [
117
+ {
118
+
119
+ type: "Control",
120
+ scope: "#/properties/FooterText",
121
+ options: {
122
+ widget: "Box",
123
+ },
124
+ config: {
125
+ main: {
126
+ heading: "Copywriter@ACT21.IO"
127
+ },
128
+ style: {
129
+ color: theme?.palette?.text.disabled || "#AFAFAF",
130
+ fontSize: '12px',
131
+ textAlign: 'center',
132
+ lineHeight: 1,
133
+ width: 'fit-content',
134
+ left: '50%',
135
+ position: 'relative',
136
+ margin: 0,
137
+ flexGrow: 1,
138
+ height: 0
139
+ }
140
+ },
141
+ },
142
+ {
143
+ type: "Control",
144
+ scope: "#/properties/backIcon",
145
+ options: {
146
+ widget: "Box",
147
+ },
148
+ config: {
149
+ main: {
150
+ iconName: 'PrevIcon',
151
+ onClick: "backHandler",
152
+ width: 'fit-content',
153
+ },
154
+ style: {
155
+ fill: theme.palette.primary.main,
156
+ width: 20,
157
+ height: 0,
158
+ margin: 0,
159
+ top: 0,
160
+ right: '82px',
161
+ position: 'absolute',
162
+ fontSize: '12px',
163
+ cursor: 'pointer',
164
+ ':hover': {
165
+ fill: theme.palette.primary.dark,
166
+ }
167
+ }
168
+ }
169
+ },
170
+ {
171
+ type: "Control",
172
+ scope: "#/properties/text",
173
+
174
+ options: {
175
+ widget: "Box",
176
+ },
177
+ config: {
178
+ main: {
179
+ heading: "Previous Page",
180
+ onClick: "backHandler"
181
+ },
182
+ style: {
183
+ textAlign: 'left',
184
+ lineHeight: 1,
185
+ height: 0,
186
+ width: 'fit-content',
187
+ color: theme.palette.primary.main,
188
+ fontSize: "12px",
189
+ cursor: 'pointer',
190
+ marginLeft: '2px',
191
+ marginRight: 0,
192
+ top: 3,
193
+ right: '12px',
194
+ position: 'absolute',
195
+ ':hover': {
196
+ color: theme.palette.primary.dark,
197
+ }
198
+ }
199
+ },
200
+ },
201
+ ]
202
+ }
203
+ );
93
204
  const schema = pageData?.schema ?? { type: "object", properties: {} };
94
205
  eventGroups = {}
95
206
  eventGroups = extractEvents(config);
@@ -97,12 +208,12 @@ export default (funcParams: funcParamsProps) => {
97
208
  config: {}, componentName: "",
98
209
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
99
210
  functionsProvider: funcParams.functionsProvider,
100
- serviceHolder: this, eventGroups
211
+ serviceHolder: this, eventGroups, formDataHolder
101
212
  }
102
213
  await executeRefreshHandler({
103
214
  config: {}, componentName: "",
104
215
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
105
- serviceHolder: this, eventGroups
216
+ serviceHolder: this, eventGroups, formDataHolder
106
217
  })
107
218
  funcParams.store.setSchema(
108
219
  (pre: any) => {
@@ -114,7 +225,6 @@ export default (funcParams: funcParamsProps) => {
114
225
  )
115
226
  uiSchema.elements.push(notifyUiSchema);
116
227
  funcParams.store.setUiSchema(uiSchema);
117
-
118
228
  },
119
229
  onCellRenderer: (cellParams) => {
120
230
  if (eventGroups.onCellRenderer) {
@@ -147,6 +257,16 @@ export default (funcParams: funcParamsProps) => {
147
257
  backHandler: function () {
148
258
  funcParams.store.navigate(-1)
149
259
  },
260
+ onRowMovement: async function (paginationValues) {
261
+ const apiBody = [
262
+ { key: "direction", value: paginationValues.rowMovement.direction },
263
+ { key: "movedRowId", value: paginationValues.rowMovement.movedRowId },
264
+ { key: "targetRowId", value: paginationValues.rowMovement.targetRowId || [] }
265
+ ]
266
+ await this.callExecuteEvents({ path: paginationValues?.path }, apiBody, "onRowMovement");
267
+ const response = await this.callExecuteEvents({ path: paginationValues?.path }, apiBody, "onLoad");
268
+ return response?.data;
269
+ },
150
270
  onPaginationChange: async function (paginationValues) {
151
271
  const apiBody = [
152
272
  { key: "size", value: paginationValues.pagination.pageSize },
@@ -155,7 +275,7 @@ export default (funcParams: funcParamsProps) => {
155
275
  { key: "filters", value: paginationValues.columnFilters || [] },
156
276
  { key: "globalFilter", value: paginationValues.globalFilter ?? '' }
157
277
  ]
158
- const response = await this.updateConfigApiBody(paginationValues, apiBody);
278
+ const response = await this.callExecuteEvents(paginationValues, apiBody, "onLoad");
159
279
  return response?.data;
160
280
  },
161
281
  getSelectOptions: async function (param) {
@@ -164,7 +284,7 @@ export default (funcParams: funcParamsProps) => {
164
284
  { key: "searchValue", value: param.serachValue },
165
285
  { key: "currentValue", value: param.currentValue }
166
286
  ]
167
- const response = await this.updateConfigApiBody(param, apiBody);
287
+ const response = await this.callExecuteEvents(param, apiBody);
168
288
  return response?.data;
169
289
  }
170
290
  },
@@ -187,9 +307,9 @@ export default (funcParams: funcParamsProps) => {
187
307
  }))
188
308
  }
189
309
  },
190
- updateConfigApiBody: async function (paramValue, apiBody) {
310
+ callExecuteEvents: async function (paramValue, apiBody, eventType: string) {
191
311
  let LastCallResponse = undefined;
192
- for (const eventConfig of eventGroups?.onLoad[paramValue.path]) {
312
+ for (const eventConfig of eventGroups?.[eventType]?.[paramValue.path]) {
193
313
  if (eventConfig.body) {
194
314
  eventConfig.body = [
195
315
  ...eventConfig.body,
@@ -232,17 +352,16 @@ export default (funcParams: funcParamsProps) => {
232
352
  callHandler: async function (eventType: string, functionParameters?: any) {
233
353
  const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
234
354
  if (eventGroups?.[eventType]?.[path] !== undefined) {
235
- for (const eventConfig of eventGroups?.[eventType]?.[path]) {
355
+ Promise.all(eventGroups?.[eventType]?.[path].map((eventConfig) => {
236
356
  executeEventsParameters.store.functionParameters = functionParameters
237
357
  executeEvents({
238
358
  ...executeEventsParameters,
239
359
  config: eventConfig,
240
360
  componentName: path
241
361
  })
242
- }
362
+ }))
243
363
  }
244
364
  },
245
-
246
365
  downloadFile: downloadFile,
247
366
  download: doDownload,
248
367
  ...funcParams.functionsProvider