impaktapps-ui-builder 1.0.173 → 1.0.180

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 (68) hide show
  1. package/dist/impaktapps-ui-builder.es.js +756 -90
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +11 -11
  4. package/dist/impaktapps-ui-builder.umd.js.map +1 -1
  5. package/dist/src/impaktapps-ui-builder/builder/build/buildAreaGraph.d.ts +2 -0
  6. package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.d.ts +1 -0
  7. package/dist/src/impaktapps-ui-builder/builder/build/buildGroupButton.d.ts +1 -0
  8. package/dist/src/impaktapps-ui-builder/builder/build/buildMetricCard.d.ts +1 -0
  9. package/dist/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.d.ts +1 -0
  10. package/dist/src/impaktapps-ui-builder/builder/build/buildPdfViewer.d.ts +1 -0
  11. package/dist/src/impaktapps-ui-builder/builder/build/buildPopover.d.ts +1 -0
  12. package/dist/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.d.ts +2 -0
  13. package/dist/src/impaktapps-ui-builder/builder/build/uischema/box.d.ts +1 -0
  14. package/dist/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.d.ts +22 -0
  15. package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +50 -4
  16. package/dist/src/impaktapps-ui-builder/builder/build/uischema/metricCard.d.ts +17 -0
  17. package/dist/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.d.ts +1 -0
  18. package/dist/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.d.ts +19 -0
  19. package/dist/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.d.ts +1 -0
  20. package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +1 -1
  21. package/dist/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.d.ts +3 -1
  22. package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +1 -1
  23. package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +2 -0
  24. package/package.json +1 -1
  25. package/src/impaktapps-ui-builder/builder/build/buildAreaGraph.ts +66 -0
  26. package/src/impaktapps-ui-builder/builder/build/buildArray.ts +10 -6
  27. package/src/impaktapps-ui-builder/builder/build/buildCamera.ts +1 -1
  28. package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +19 -7
  29. package/src/impaktapps-ui-builder/builder/build/buildDate.ts +26 -22
  30. package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +42 -49
  31. package/src/impaktapps-ui-builder/builder/build/buildGroupButton.ts +24 -0
  32. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +3 -3
  33. package/src/impaktapps-ui-builder/builder/build/buildImage.ts +6 -3
  34. package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +3 -3
  35. package/src/impaktapps-ui-builder/builder/build/buildMetricCard.tsx +37 -0
  36. package/src/impaktapps-ui-builder/builder/build/buildMultiSelect.ts +3 -0
  37. package/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.ts +44 -0
  38. package/src/impaktapps-ui-builder/builder/build/buildPdfViewer.ts +16 -0
  39. package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +3 -3
  40. package/src/impaktapps-ui-builder/builder/build/buildPop.ts +1 -0
  41. package/src/impaktapps-ui-builder/builder/build/buildPopover.ts +40 -0
  42. package/src/impaktapps-ui-builder/builder/build/buildSelect.ts +3 -0
  43. package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +3 -3
  44. package/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.ts +72 -0
  45. package/src/impaktapps-ui-builder/builder/build/buildTabSection.ts +2 -0
  46. package/src/impaktapps-ui-builder/builder/build/buildTable.ts +0 -3
  47. package/src/impaktapps-ui-builder/builder/build/buildText.ts +3 -0
  48. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +33 -0
  49. package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +7 -3
  50. package/src/impaktapps-ui-builder/builder/build/uischema/box.ts +2 -1
  51. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +172 -16
  52. package/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.ts +17 -0
  53. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +0 -1
  54. package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +37 -4
  55. package/src/impaktapps-ui-builder/builder/build/uischema/metricCard.ts +13 -0
  56. package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +2 -0
  57. package/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.ts +18 -0
  58. package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +2 -0
  59. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +5 -6
  60. package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +3 -1
  61. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +80 -1
  62. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +17 -0
  63. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +2 -3
  64. package/src/impaktapps-ui-builder/builder/services/component.ts +144 -109
  65. package/src/impaktapps-ui-builder/builder/services/event.ts +3 -3
  66. package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +4 -4
  67. package/src/impaktapps-ui-builder/builder/services/utils.ts +1 -1
  68. package/src/impaktapps-ui-builder/runtime/services/service.ts +26 -4
@@ -8,47 +8,51 @@ import { StyleSection } from "../build/uischema/styleSection";
8
8
  import { TableSection } from "../build/uischema/tableSection";
9
9
  import { ValueTab } from "../build/uischema/valueTab";
10
10
  import { ValidationSection } from "../build/uischema/validationSections";
11
- import { getFormdataFromSessionStorage, isErrorExist, okHandler, saveFormdataInSessionStorage, saveHandler } from "./utils";
11
+ import { getFormdataFromSessionStorage, validateAndShowErrors, okHandler, saveFormdataInSessionStorage, saveHandler } from "./utils";
12
12
  const sectionLabels = {
13
13
  Select: ["Core", "Properties", "Value", "Events", "Style", "Validation"],
14
14
  MultipleSelect: ["Core", "Properties", "Value", "Events", "Style", "Validation"],
15
- Table: ["Core", "Components", "Properties", "Events", "Style", ],
16
- LeaderBoard: ["Core", "Components", "Properties", "Events", "Style", ],
17
- WrapperSection: ["Core", "Components", "Properties", "Style", ],
18
- HorizontalLayout: ["Core", "Components", "Properties", "Style", ],
19
- TabSection: ["Core", "Components", "Properties", "Style", "Validation"],
15
+ Table: ["Core", "Components", "Properties", "Events", "Style",],
16
+ LeaderBoard: ["Core", "Components", "Properties", "Events", "Style",],
17
+ WrapperSection: ["Core", "Components", "Properties", "Style",],
18
+ HorizontalLayout: ["Core", "Components", "Properties", "Style",],
19
+ TabSection: ["Core", "Components", "TabTitles", "Properties", "Style", "Validation"],
20
20
  SpeedoMeter: ["Core", "Properties", "Events", "Style",],
21
21
  card: ["Core", "Properties", "Events", "Style", "Validation"],
22
22
  UploadFile: ["Core", "Events", "Style", "Validation"],
23
23
  Graph: ["Core", "Properties", "Events", "Style", "Validation"],
24
24
  DownloadFile: ["Core", "Events", "Style", "Validation"],
25
- Box: ["Core", "Properties" , "Events", "Style", "Validation"],
25
+ Box: ["Core", "Properties", "Events", "Style", "Validation"],
26
26
  Properties: ["Core", "Properties", "Events", "Style", "Validation"],
27
27
  ProgressBarCard: ["Core", "Properties", "Events", "Style"],
28
- ProgressBar:["Core", "Properties", "Events", "Style", ],
29
- RankCard: ["Core", "Properties", "Events", "Style", ],
28
+ ProgressBar: ["Core", "Properties", "Events", "Style",],
29
+ RankCard: ["Core", "Properties", "Events", "Style",],
30
+ MetricCard: ["Core", "Properties", "Events", "Style", "Validation"],
30
31
  Slider: ["Core", "Components", "Events", "Style", "Validation"],
31
32
  Timer: ["Core", "Events", "Style",],
32
- Rank: ["Core", "Events", "Style", ],
33
+ Rank: ["Core", "Events", "Style",],
33
34
  Button: ["Core", "Properties", "Events", "Style", "Validation"],
34
- Array: ["Core", "Components", "Properties","Events","Validation"],
35
+ ButtonGroup: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
36
+ Array: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
35
37
  Radio: ["Core", "Properties", "Events", "Style", "Validation"],
36
38
  Text: ["Core", "Properties", "Events", "Style", "Validation"],
37
39
  TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
38
- PopUp: ["Core", "Components", "Properties", "Style"],
40
+ PopUp: ["Core", "Components", "Properties", "Events", "Style"],
41
+ PopOver: ["Core", "Components", "Properties", "Style"],
42
+ PdfViewer: ["Core", "Properties", "Style"],
39
43
  Stepper: ["Core", "Components", "Properties", "Events", "Style"],
40
44
  DataGrid: ["Core", "Components", "Properties", "Events", "Style"],
41
45
  InputSlider: ["Core", "Properties", "Events", "Style", "Validation"],
42
46
  TreeMap: ["Core", "Components", "Properties", "Events", "Style"],
43
47
  ColumnGroup: ["Core", "Components"],
44
- Thought: ["Core", "Properties", "Events", "Style", ],
48
+ Thought: ["Core", "Properties", "Events", "Style",],
45
49
  Date: ["Core", "Properties", "Events", "Style", "Validation"],
46
50
  DateTime: ["Core", "Properties", "Events", "Style", "Validation"],
47
- Image: ["Core", "Properties","Style"],
48
- FileInput: ["Core","Properties","Events", "Style", "Validation"],
49
- Camera:["Core","Properties","Events", "Style", "Validation"],
51
+ Image: ["Core", "Properties", "Events", "Style"],
52
+ FileInput: ["Core", "Properties", "Events", "Style", "Validation"],
53
+ Camera: ["Core", "Properties", "Events", "Style", "Validation"],
54
+ OTP_Input: ["Core", "Properties", "Events", "Style", "Validation"],
50
55
  }
51
-
52
56
  export function refreshPage(type: string, store: any) {
53
57
  const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
54
58
  const currentConfig = JSON.parse(sessionStorage.getItem("pageFormdata"));
@@ -59,6 +63,7 @@ export function refreshPage(type: string, store: any) {
59
63
  Style: StyleSection,
60
64
  Events: EventSection(store.theme.myTheme),
61
65
  Components: TableSection(store.theme.myTheme),
66
+ TabTitles: TableSection(store.theme.myTheme, "tabLabelElements"),
62
67
  Properties: buildPropertiesSection(type),
63
68
  Validation: ValidationSection
64
69
  }
@@ -70,12 +75,12 @@ export function refreshPage(type: string, store: any) {
70
75
  // Get Widget Type of parent
71
76
  const path = store.searchParams?.get("path");
72
77
  const lastDotIndex = path.lastIndexOf('.')
73
- const parentPath = path.slice(0,lastDotIndex)
78
+ const parentPath = path.slice(0, lastDotIndex)
74
79
 
75
80
  const parentObj = _.get(currentConfig, parentPath)
76
81
 
77
- if(parentObj?.type === "Table" || parentObj?.type === "ColumnGroup"){
78
- UiSchema.elements[0].elements[0].elements[4] =
82
+ if (parentObj?.type === "Table" || parentObj?.type === "ColumnGroup") {
83
+ UiSchema.elements[0].elements[0].elements[4] =
79
84
  {
80
85
  type: "Control",
81
86
  scope: "#/properties/columnFormat",
@@ -90,7 +95,7 @@ export function refreshPage(type: string, store: any) {
90
95
  },
91
96
  },
92
97
  };
93
- UiSchema.elements[0].elements[0].elements[6] =
98
+ UiSchema.elements[0].elements[0].elements[6] =
94
99
  {
95
100
  type: "Control",
96
101
  scope: "#/properties/filteringOptions",
@@ -105,7 +110,7 @@ export function refreshPage(type: string, store: any) {
105
110
  },
106
111
  },
107
112
  };
108
- UiSchema.elements[0].elements[0].elements[5] =
113
+ UiSchema.elements[0].elements[0].elements[5] =
109
114
  {
110
115
  type: "Control",
111
116
  scope: "#/properties/enableFilter",
@@ -120,49 +125,49 @@ export function refreshPage(type: string, store: any) {
120
125
  },
121
126
  },
122
127
  },
123
- UiSchema.elements[0].elements[0].elements[7] =
124
- {
125
- type: "Control",
126
- scope: "#/properties/enableSorting",
127
- options: {
128
- widget: "RadioInputField",
129
- },
130
- config: {
131
- layout: { xs: 6, sm: 6, md: 4, lg: 3 },
132
- main: {
133
- label: "Enable Sorting",
134
- options: ["Yes", "No"],
128
+ UiSchema.elements[0].elements[0].elements[7] =
129
+ {
130
+ type: "Control",
131
+ scope: "#/properties/enableSorting",
132
+ options: {
133
+ widget: "RadioInputField",
135
134
  },
136
- },
137
- },
138
- UiSchema.elements[0].elements[0].elements[8] =
139
- {
140
- type: "Control",
141
- scope: "#/properties/columnKey",
142
- config: {
143
- layout: { xs: 6, sm: 6, md: 4, lg: 3 },
144
- main: {
145
- label: "Column Key",
135
+ config: {
136
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
137
+ main: {
138
+ label: "Enable Sorting",
139
+ options: ["Yes", "No"],
140
+ },
146
141
  },
147
142
  },
148
- options: {
149
- widget: "InputField",
150
- },
151
- },
152
- UiSchema.elements[0].elements[0].elements[9] =
153
- {
154
- type: "Control",
155
- scope: "#/properties/elementType",
156
- options: {
157
- widget: "SelectInputField",
158
- },
159
- config: {
160
- layout: { xs: 6, sm: 6, md: 4, lg: 3 },
161
- main: {
162
- label: "Element Type",
143
+ UiSchema.elements[0].elements[0].elements[8] =
144
+ {
145
+ type: "Control",
146
+ scope: "#/properties/columnKey",
147
+ config: {
148
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
149
+ main: {
150
+ label: "Column Key",
151
+ },
152
+ },
153
+ options: {
154
+ widget: "InputField",
163
155
  },
164
156
  },
165
- }
157
+ UiSchema.elements[0].elements[0].elements[9] =
158
+ {
159
+ type: "Control",
160
+ scope: "#/properties/elementType",
161
+ options: {
162
+ widget: "SelectInputField",
163
+ },
164
+ config: {
165
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
166
+ main: {
167
+ label: "Element Type",
168
+ },
169
+ },
170
+ }
166
171
  UiSchema.elements[0].elements[0].elements[10] = {
167
172
  type: "Control",
168
173
  scope: "#/properties/dateFormat",
@@ -187,8 +192,8 @@ export function refreshPage(type: string, store: any) {
187
192
  },
188
193
  }
189
194
  }
190
- if(parentObj?.type === "LeaderBoard"){
191
- UiSchema.elements[0].elements[0].elements[4] =
195
+ if (parentObj?.type === "LeaderBoard") {
196
+ UiSchema.elements[0].elements[0].elements[4] =
192
197
  {
193
198
  type: "Control",
194
199
  scope: "#/properties/columnFormat",
@@ -204,7 +209,7 @@ export function refreshPage(type: string, store: any) {
204
209
  };
205
210
  }
206
211
 
207
- if (sessionStorage.getItem("copiedConfig") ) {
212
+ if (sessionStorage.getItem("copiedConfig")) {
208
213
  this.ElementPathSetter(UiSchema);
209
214
  }
210
215
  store.setUiSchema(UiSchema);
@@ -230,33 +235,33 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
230
235
  if (sessionStorage.getItem("copiedConfig")) {
231
236
  schema.properties.RemoveItemButton.disabled = false;
232
237
  }
233
-
238
+
234
239
  const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
235
240
  const path = store.searchParams?.get("path");
236
241
  const id = store.searchParams?.get("id")
237
242
 
238
- let pathArray = [{label: config.name ?? "NewPage", path: `/PageMaster${id ? `?id=${id}` : ''}`}];
243
+ let pathArray = [{ label: config.name ?? "NewPage", path: `/PageMaster${id ? `?id=${id}` : ''}` }];
239
244
 
240
245
  if (path) {
241
- const pathArrayAll = path.split(".");
242
- const arr: any = []
243
- pathArrayAll.map((e: string, i: number) => {
244
- if (i === 0) {
245
- arr.push(e)
246
- return;
247
- }
248
- arr.push(`${arr[i - 1]}.${e}`)
249
- })
246
+ const pathArrayAll = path.split(".");
247
+ const arr: any = []
248
+ pathArrayAll.map((e: string, i: number) => {
249
+ if (i === 0) {
250
+ arr.push(e)
251
+ return;
252
+ }
253
+ arr.push(`${arr[i - 1]}.${e}`)
254
+ })
250
255
 
251
256
 
252
- arr.map((e) => {
253
- const data = _.get(config, e)
254
- pathArray.push({
255
- label: data?.name || data?.eventType || "NewComponent",
256
- path: `/Component?path=${e}${id ? `&id=${id}` : ''}`
257
- });
258
- })
259
- }
257
+ arr.map((e) => {
258
+ const data = _.get(config, e)
259
+ pathArray.push({
260
+ label: data?.name || data?.eventType || "NewComponent",
261
+ path: `/Component?path=${e}${id ? `&id=${id}` : ''}`
262
+ });
263
+ })
264
+ }
260
265
 
261
266
  schema.properties.pageName.path = pathArray
262
267
  return schema;
@@ -273,14 +278,18 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
273
278
  },
274
279
  editComponents: function () {
275
280
 
276
- if (isErrorExist(store)) return;
281
+ if (validateAndShowErrors(store)) return;
277
282
  const rowId = dynamicData.path.split(".")[1];
278
283
  const path = store.searchParams?.get("path");
279
284
  const id = store.searchParams?.get("id");
280
285
  saveFormdataInSessionStorage(store.ctx.core.data, path)
281
286
  if (path) {
282
- const path = store.searchParams?.get("path");
283
- const finalPath = `${path}.elements[${rowId}]`
287
+ let finalPath = `${path}`;
288
+ if (dynamicData?.path?.startsWith("tabLabel")) {
289
+ finalPath = `${finalPath}.tabLabelElements[${rowId}]`
290
+ } else {
291
+ finalPath = `${finalPath}.elements[${rowId}]`
292
+ }
284
293
  store.searchParams.set("path", finalPath)
285
294
  store.setSearchParams(store.searchParams)
286
295
  this.setPage()
@@ -291,7 +300,12 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
291
300
  deleteComponents: function (shouldUpdateDialog: boolean = true) {
292
301
  const path = store.searchParams?.get("path");
293
302
  const rowId = sessionStorage.getItem('rowId');
294
- store.formData.elements.splice(rowId, 1);
303
+ const isTabLabelElements = sessionStorage.getItem('isTabLabelElements') === "true";
304
+ if (isTabLabelElements) {
305
+ store.formData.tabLabelElements.splice(rowId, 1);
306
+ } else {
307
+ store.formData.elements.splice(rowId, 1);
308
+ }
295
309
  const response = saveFormdataInSessionStorage(store.ctx.core.data, path)
296
310
  const data = path ? _.get(response, path) : response;
297
311
  store.setFormdata(data);
@@ -299,6 +313,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
299
313
  store.updateDialog("popUpComponentSection");
300
314
  }
301
315
  sessionStorage.removeItem('rowId');
316
+ sessionStorage.removeItem('isTabLabelElements');
302
317
  },
303
318
  deleteEvent: function (shouldUpdateDialog: boolean = true) {
304
319
  const path = store.searchParams?.get("path");
@@ -313,20 +328,28 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
313
328
  },
314
329
  widgetAddClickHandler: function () {
315
330
 
316
- if (isErrorExist(store)) return;
331
+ if (validateAndShowErrors(store)) return;
317
332
  if (!Array.isArray(store.formData.elements)) {
318
333
  store.formData.elements = []
319
334
  }
335
+ if (!Array.isArray(store.formData.tabLabelElements)) {
336
+ store.formData.tabLabelElements = []
337
+ }
320
338
  const path = store.searchParams?.get("path");
321
339
  saveFormdataInSessionStorage(store.ctx.core.data, path)
322
- const finalPath = `${path}.elements[${store.formData.elements.length}]`
340
+ let finalPath = `${path}`;
341
+ if (dynamicData.path.startsWith("tabLabel")) {
342
+ finalPath = `${finalPath}.tabLabelElements[${store.formData.tabLabelElements.length}]`
343
+ } else {
344
+ finalPath = `${finalPath}.elements[${store.formData.elements.length}]`
345
+ }
323
346
  store.searchParams.set("path", finalPath)
324
347
  store.setSearchParams(store.searchParams)
325
348
  this.setPage()
326
349
 
327
350
  },
328
351
  eventEditHandler: function () {
329
- if (isErrorExist(store)) return;
352
+ if (validateAndShowErrors(store)) return;
330
353
  const rowId = dynamicData.path.split(".")[1];
331
354
  const path = store.searchParams?.get("path");
332
355
  const id = store.searchParams?.get("id");
@@ -335,7 +358,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
335
358
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
336
359
  },
337
360
  eventAddHandler: function () {
338
- if (isErrorExist(store)) return;
361
+ if (validateAndShowErrors(store)) return;
339
362
  const path = store.searchParams?.get("path");
340
363
  const id = store.searchParams?.get("id");
341
364
  if (!Array.isArray(store.formData.events)) {
@@ -351,6 +374,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
351
374
  deletePopUpComponent: function () {
352
375
  const rowId = dynamicData.path.split(".")[1];
353
376
  sessionStorage.setItem('rowId', rowId);
377
+ sessionStorage.setItem('isTabLabelElements', dynamicData.path.startsWith("tabLabel") ? "true" : "false");
354
378
  store.updateDialog("popUpComponentSection");
355
379
  },
356
380
  deletePopUpEvent: function () {
@@ -373,8 +397,8 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
373
397
  const copiedElementPath = this.elementPathHandler(parentPathOfCopiedComponent, rowId, elementType);
374
398
  const copiedFormData = getFormdataFromSessionStorage(copiedElementPath);
375
399
 
376
- this.ElementPathSetter(uiSchema,copiedFormData);
377
- sessionStorage.setItem('copiedConfig',JSON.stringify(copiedFormData));
400
+ this.ElementPathSetter(uiSchema, copiedFormData);
401
+ sessionStorage.setItem('copiedConfig', JSON.stringify(copiedFormData));
378
402
  store.setNotify({
379
403
  SuccessMessage: `${elementType} Copied Successfully`,
380
404
  Success: true,
@@ -397,9 +421,17 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
397
421
  if (!Array.isArray(store.formData.events)) {
398
422
  store.formData.events = []
399
423
  }
424
+ if (!Array.isArray(store.formData.tabLabelElements)) {
425
+ store.formData.tabLabelElements = []
426
+ }
400
427
  saveFormdataInSessionStorage(store.ctx.core.data, pastedElementParentPath);
401
428
  const formData = getFormdataFromSessionStorage(pastedElementParentPath);
402
- const insertElementIndex = elementType === "Component" ? formData.elements.length : formData.events.length;
429
+ const currentLength = {
430
+ "TabsComponent": formData.tabLabelElements.length,
431
+ "Component": formData.elements.length,
432
+ "Events": formData.events.length
433
+ };
434
+ const insertElementIndex = currentLength[elementType] || 0;
403
435
  const pastedElementPath = this.elementPathHandler(pastedElementParentPath, insertElementIndex, elementType);
404
436
 
405
437
  const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
@@ -413,7 +445,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
413
445
  Fail: true,
414
446
  });
415
447
  }
416
- else if(copiedConfig.name && elementType === "Events"){
448
+ else if (copiedConfig.name && elementType === "Events") {
417
449
  store.setNotify({
418
450
  FailMessage: notificationMessages.Component,
419
451
  Fail: true,
@@ -436,34 +468,37 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
436
468
  elementPathHandler: function (parentPath: string, rowId: any, elementType: string) {
437
469
  if (elementType === "Component") {
438
470
  return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
471
+ }
472
+ if(elementType === "TabsComponent"){
473
+ return `${parentPath}.tabLabelElements[${rowId}]`
439
474
  }
440
475
  return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
441
476
  },
442
477
  ElementPathSetter: function (uiSchema: any, copiedFormData?: any) {
443
478
  const formData = copiedFormData || JSON.parse(sessionStorage.getItem("copiedConfig"));
444
- if(uiSchema?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons){
445
- uiSchema.elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
479
+ if (uiSchema?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons) {
480
+ uiSchema.elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
446
481
  }
447
- else if(uiSchema?.elements?.[0]?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons){
448
- uiSchema.elements[0].elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
482
+ else if (uiSchema?.elements?.[0]?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons) {
483
+ uiSchema.elements[0].elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
449
484
  }
450
485
 
451
-
452
- if(uiSchema?.elements?.[1]?.elements?.[1]?.config?.main?.headerIcons){
453
- uiSchema.elements[1].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Event: ${formData.eventType}`;
486
+
487
+ if (uiSchema?.elements?.[1]?.elements?.[1]?.config?.main?.headerIcons) {
488
+ uiSchema.elements[1].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Event: ${formData.eventType}`;
454
489
  }
455
- else if(uiSchema?.elements?.[0]?.elements?.[1]?.config?.main?.headerIcons){
456
- uiSchema.elements[0].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.eventType}`;
490
+ else if (uiSchema?.elements?.[0]?.elements?.[1]?.config?.main?.headerIcons) {
491
+ uiSchema.elements[0].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.eventType}`;
457
492
  }
458
493
  },
459
494
 
460
-
461
- onNavigatePopupYes: function() {
462
- try{
495
+
496
+ onNavigatePopupYes: function () {
497
+ try {
463
498
  store.navigate(sessionStorage.getItem("pendingNavigatePath"))
464
499
  store.updateDialog(`pageNamepopup`)
465
500
  }
466
- catch(e){
501
+ catch (e) {
467
502
  store.updateDialog(`pageNamepopup`)
468
503
  store.setNotify({
469
504
  FailMessage: "Couldn't navigate page",
@@ -471,8 +506,8 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
471
506
  })
472
507
  }
473
508
  },
474
- onNavigatePopupNo: function() {
475
- store.updateDialog(`pageNamepopup`)
509
+ onNavigatePopupNo: function () {
510
+ store.updateDialog(`pageNamepopup`)
476
511
  }
477
512
  }
478
513
  };
@@ -6,7 +6,7 @@ import {
6
6
  saveFormdataInSessionStorage,
7
7
  saveHandler,
8
8
  getFormdataFromSessionStorage,
9
- isErrorExist,
9
+ validateAndShowErrors,
10
10
  } from "./utils";
11
11
  import { APISection } from "../build/uischema/apiSection";
12
12
  import {
@@ -211,7 +211,7 @@ export default (
211
211
  }
212
212
  },
213
213
  addEvent: function () {
214
- if (isErrorExist(store)) return;
214
+ if (validateAndShowErrors(store)) return;
215
215
  const path = store.searchParams?.get("path");
216
216
  if (!Array.isArray(store.formData.events)) {
217
217
  store.formData.events = [];
@@ -223,7 +223,7 @@ export default (
223
223
  this.setPage();
224
224
  },
225
225
  editEvent: function () {
226
- if (isErrorExist(store)) return;
226
+ if (validateAndShowErrors(store)) return;
227
227
  const rowId = dynamicData.path.split(".")[1];
228
228
  const path = store.searchParams?.get("path");
229
229
  saveFormdataInSessionStorage(store.ctx.core.data, path);
@@ -2,7 +2,7 @@ import { PageMasterSchema } from "../elements/UiSchema/PageMaster/schema";
2
2
  import { PageMasterUiSchema } from "../elements/UiSchema/PageMaster/uiSchema";
3
3
  import _ from "lodash";
4
4
  import Component from "./component";
5
- import { getFormdataFromSessionStorage, isErrorExist, saveFormdataInSessionStorage, saveHandler } from "./utils";
5
+ import { getFormdataFromSessionStorage, validateAndShowErrors, saveFormdataInSessionStorage, saveHandler } from "./utils";
6
6
 
7
7
 
8
8
  interface funcParamsProps {
@@ -52,7 +52,7 @@ export default (funcParams: funcParamsProps) => {
52
52
  store.navigate("/PageMasterRecords");
53
53
  },
54
54
  onAddClickHandler: function () {
55
- if (isErrorExist(store)) return;
55
+ if (validateAndShowErrors(store)) return;
56
56
  const id = store.searchParams?.get("id");
57
57
  if (!Array.isArray(store.formData.elements)) {
58
58
  store.formData.elements = []
@@ -77,7 +77,7 @@ export default (funcParams: funcParamsProps) => {
77
77
  store.updateDialog("popUpPageMasterComponent");
78
78
  },
79
79
  eventAddHandler: function () {
80
- if (isErrorExist(store)) return;
80
+ if (validateAndShowErrors(store)) return;
81
81
  const id = store.searchParams?.get("id");
82
82
  if (!Array.isArray(store.formData.events)) {
83
83
  store.formData.events = []
@@ -87,7 +87,7 @@ export default (funcParams: funcParamsProps) => {
87
87
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
88
88
  },
89
89
  editEvent: function () {
90
- if (isErrorExist(store)) return;
90
+ if (validateAndShowErrors(store)) return;
91
91
  const rowId = dynamicData.path.split(".")[1];
92
92
  const id = store.searchParams?.get("id");
93
93
  saveFormdataInSessionStorage(store.ctx.core.data)
@@ -6,7 +6,7 @@ const clearFromSessionStorage = () => {
6
6
  }
7
7
  export default clearFromSessionStorage;
8
8
 
9
- export const isErrorExist = (store: any): boolean => {
9
+ export const validateAndShowErrors = (store: any): boolean => {
10
10
  if (_.isEmpty(store.ctx.core.errors)) return false;
11
11
  store.setValidation("ValidateAndShow");
12
12
  store.setNotify({
@@ -80,7 +80,7 @@ export default (funcParams: funcParamsProps) => {
80
80
  const config = pageData?.config;
81
81
  const uiSchema = pageData?.uiSchema;
82
82
  const event = new CustomEvent('pageNameChanged', {
83
- detail: { pageName: config.label, hasBackIcon: config.hasBackIcon === "NO" ? false : true }
83
+ detail: { pageName: config.label, pageIconUrl: config.pageIconUrl, hasBackIcon: config.hasBackIcon === "NO" ? false : true }
84
84
  });
85
85
  window.dispatchEvent(event)
86
86
  const theme = funcParams?.store?.theme?.myTheme;
@@ -101,6 +101,7 @@ export default (funcParams: funcParamsProps) => {
101
101
  }
102
102
  }
103
103
  )
104
+
104
105
  executeRefreshHandler({
105
106
  config: {}, componentName: "",
106
107
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
@@ -111,6 +112,24 @@ export default (funcParams: funcParamsProps) => {
111
112
  funcParams.store.setUiSchema(uiSchema);
112
113
  });
113
114
  },
115
+ getStyle: () => {
116
+ const cloneEventGroup = _.cloneDeep(eventGroups)
117
+ if (cloneEventGroup.setStyle) {
118
+ let finalResponse = {};
119
+ const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData.path?.split(".").pop();
120
+ if (cloneEventGroup?.setStyle?.[path]) {
121
+ for (const eventConfig of cloneEventGroup?.setStyle?.[path]) {
122
+ finalResponse = executeEvents({
123
+ ...executeEventsParameters,
124
+ config: eventConfig,
125
+ componentName: path
126
+ })
127
+ }
128
+ return finalResponse
129
+ }
130
+ }
131
+ return {}
132
+ },
114
133
  onCellRenderer: (cellParams) => {
115
134
  const cloneEventGroup = _.cloneDeep(eventGroups)
116
135
  if (cloneEventGroup.onCellRenderer) {
@@ -139,6 +158,9 @@ export default (funcParams: funcParamsProps) => {
139
158
  onFileDelete: async function () {
140
159
  this.callHandler("onFileDelete")
141
160
  },
161
+ onClose: function () {
162
+ this.callHandler("onClose")
163
+ },
142
164
  onMount: function () {
143
165
  this.callHandler("onMount")
144
166
  },
@@ -168,7 +190,8 @@ export default (funcParams: funcParamsProps) => {
168
190
  { key: "sorting", value: paginationValues.sorting || [] },
169
191
  { key: "filters", value: paginationValues.tableColumnConfig || [] },
170
192
  { key: "globalFilter", value: paginationValues.globalFilter ?? '' },
171
- { key: "expandedRowIds", value: paginationValues.expandedRowIds ?? [] }
193
+ { key: "parentIds", value: paginationValues.parentIds},
194
+ { key: "isExpandAll", value: paginationValues.isExpandAll},
172
195
  ]
173
196
  const response = await this.callExecuteEvents(paginationValues, apiBody, "onLoad");
174
197
  return response?.data;
@@ -190,8 +213,7 @@ export default (funcParams: funcParamsProps) => {
190
213
 
191
214
  const promises = ChangeEventsKeysArray.flatMap((componentName: string) => {
192
215
  if (
193
- funcParams.store?.formData[componentName] === funcParams.store.newData[componentName] ||
194
- funcParams.store?.newData[componentName] === undefined
216
+ funcParams.store?.formData[componentName] === funcParams.store.newData[componentName]
195
217
  ) {
196
218
  return [];
197
219
  }