impaktapps-ui-builder 1.0.174 → 1.0.181

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 (69) hide show
  1. package/dist/impaktapps-ui-builder.es.js +812 -84
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +10 -10
  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/runtime/services/downloadFile.d.ts +1 -0
  23. package/dist/src/impaktapps-ui-builder/runtime/services/interface.d.ts +1 -0
  24. package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +4 -0
  25. package/package.json +1 -1
  26. package/src/impaktapps-ui-builder/builder/build/buildAreaGraph.ts +66 -0
  27. package/src/impaktapps-ui-builder/builder/build/buildArray.ts +10 -6
  28. package/src/impaktapps-ui-builder/builder/build/buildCamera.ts +1 -1
  29. package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +19 -7
  30. package/src/impaktapps-ui-builder/builder/build/buildDate.ts +26 -22
  31. package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +42 -49
  32. package/src/impaktapps-ui-builder/builder/build/buildGroupButton.ts +24 -0
  33. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +3 -3
  34. package/src/impaktapps-ui-builder/builder/build/buildImage.ts +6 -3
  35. package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +3 -3
  36. package/src/impaktapps-ui-builder/builder/build/buildMetricCard.tsx +37 -0
  37. package/src/impaktapps-ui-builder/builder/build/buildMultiSelect.ts +3 -0
  38. package/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.ts +44 -0
  39. package/src/impaktapps-ui-builder/builder/build/buildPdfViewer.ts +16 -0
  40. package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +3 -3
  41. package/src/impaktapps-ui-builder/builder/build/buildPop.ts +1 -0
  42. package/src/impaktapps-ui-builder/builder/build/buildPopover.ts +40 -0
  43. package/src/impaktapps-ui-builder/builder/build/buildSelect.ts +3 -0
  44. package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +3 -3
  45. package/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.ts +72 -0
  46. package/src/impaktapps-ui-builder/builder/build/buildTabSection.ts +2 -0
  47. package/src/impaktapps-ui-builder/builder/build/buildTable.ts +0 -3
  48. package/src/impaktapps-ui-builder/builder/build/buildText.ts +3 -0
  49. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +33 -0
  50. package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +7 -3
  51. package/src/impaktapps-ui-builder/builder/build/uischema/box.ts +2 -1
  52. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +172 -16
  53. package/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.ts +17 -0
  54. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +0 -1
  55. package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +37 -4
  56. package/src/impaktapps-ui-builder/builder/build/uischema/metricCard.ts +13 -0
  57. package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +2 -0
  58. package/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.ts +18 -0
  59. package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +2 -0
  60. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +5 -6
  61. package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +3 -1
  62. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +80 -1
  63. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +17 -0
  64. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +3 -3
  65. package/src/impaktapps-ui-builder/builder/services/component.ts +143 -108
  66. package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +78 -0
  67. package/src/impaktapps-ui-builder/runtime/services/events.ts +6 -3
  68. package/src/impaktapps-ui-builder/runtime/services/interface.ts +1 -0
  69. package/src/impaktapps-ui-builder/runtime/services/service.ts +31 -7
@@ -12,43 +12,47 @@ import { getFormdataFromSessionStorage, validateAndShowErrors, okHandler, saveFo
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 (validateAndShowErrors(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 (validateAndShowErrors(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 (validateAndShowErrors(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 (validateAndShowErrors(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
  };
@@ -44,4 +44,82 @@ export const downloadFileFromUrl = (response: any, service) => {
44
44
  link.parentNode.removeChild(link);
45
45
  };
46
46
 
47
+ export const downloadFileStream = async (params: any) => {
48
+ try {
49
+ // const response = await params.fetchservice.postStream(
50
+ // params.url,
51
+ // params.body,
52
+ // params.config
53
+ // );
54
+ let response: Response;
47
55
 
56
+ if (params.method === "GET") {
57
+ response = await params.fetchservice.getStream(
58
+ params.url,
59
+ params.config
60
+ );
61
+ } else if (params.method === "POST") {
62
+ response = await params.fetchservice.postStream(
63
+ params.url,
64
+ params.body,
65
+ params.config
66
+ );
67
+ } else {
68
+ throw new Error(
69
+ `Unsupported HTTP method: ${params.method}. Only GET and POST are supported.`
70
+ );
71
+ }
72
+
73
+ if (!response.ok) {
74
+ throw new Error("Download failed");
75
+ }
76
+
77
+ const fileName =
78
+ response.headers.get("filename") || "downloaded_file";
79
+
80
+ const extension = fileName.includes(".")
81
+ ? fileName.substring(fileName.lastIndexOf("."))
82
+ : "";
83
+
84
+ const reader = response.body!.getReader();
85
+
86
+ //@ts-ignore
87
+ const fileHandle = await window.showSaveFilePicker({
88
+ suggestedName: fileName,
89
+ types: extension
90
+ ? [
91
+ {
92
+ description: "File",
93
+ accept: {
94
+ "application/octet-stream": [extension],
95
+ },
96
+ },
97
+ ]
98
+ : undefined,
99
+ });
100
+
101
+ const writable = await fileHandle.createWritable();
102
+
103
+ while (true) {
104
+ const { done, value } = await reader.read();
105
+
106
+ if (done) break;
107
+
108
+ await writable.write(value);
109
+ }
110
+
111
+ await writable.close();
112
+
113
+ params.store.setNotify({
114
+ SuccessMessage: "File Downloaded Successfully",
115
+ Success: true,
116
+ });
117
+ } catch (e) {
118
+ params.store.setNotify({
119
+ FailMessage: "File Download Failed",
120
+ Fail: true,
121
+ });
122
+
123
+ console.error(e);
124
+ }
125
+ };
@@ -126,10 +126,13 @@ function executeInBuiltFunctionHandler(params: handlersProps) {
126
126
  let parameter = {};
127
127
  if (params.config.funcParametersCode) {
128
128
  const makeFunc = eval(params.config.funcParametersCode)
129
- parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service);
130
- params.serviceHolder[params.config.inBuiltFunctionType](parameter, params.service)
129
+ parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service, params.fetchservice);
130
+ params.serviceHolder[params.config.inBuiltFunctionType](
131
+ parameter,
132
+ params.service
133
+ );
131
134
  } else {
132
- params.serviceHolder[params.config.inBuiltFunctionType](params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service)
135
+ params.serviceHolder[params.config.inBuiltFunctionType](params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service, params.fetchservice)
133
136
  }
134
137
  }
135
138
 
@@ -5,6 +5,7 @@ export interface handlersProps {
5
5
  dynamicData: any,
6
6
  userValue: any,
7
7
  service: any,
8
+ fetchservice?: any,
8
9
  serviceHolder: any,
9
10
  eventGroups?: any,
10
11
  parentEventOutput?: any,
@@ -1,5 +1,5 @@
1
1
  import _, { isEmpty } from "lodash";
2
- import { downloadFileFromUrl, downloadFile } from "./downloadFile";
2
+ import { downloadFileFromUrl, downloadFile, downloadFileStream } from "./downloadFile";
3
3
  import { executeEvents, executeRefreshHandler } from "./events";
4
4
  import { handlersProps } from "./interface";
5
5
  let compType: string;
@@ -17,6 +17,7 @@ interface funcParamsProps {
17
17
  store: any,
18
18
  dynamicData: any,
19
19
  service: any,
20
+ fetchservice: any,
20
21
  userValue: any,
21
22
  pageDataProvider: any,
22
23
  functionsProvider?: Record<string, any>,
@@ -65,8 +66,8 @@ export default (funcParams: funcParamsProps) => {
65
66
  const formDataHolder = {};
66
67
  let executeEventsParameters: handlersProps = {
67
68
  config: {}, componentName: "",
68
- store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
69
- serviceHolder: { downloadFile, download: downloadFileFromUrl, ...funcParams.functionsProvider }, eventGroups,
69
+ store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service, fetchservice: funcParams.fetchservice,
70
+ serviceHolder: { downloadFile, download: downloadFileFromUrl, downloadFileStream, ...funcParams.functionsProvider }, eventGroups,
70
71
  functionsProvider: funcParams.functionsProvider, formDataHolder
71
72
  };
72
73
  return {
@@ -80,7 +81,7 @@ export default (funcParams: funcParamsProps) => {
80
81
  const config = pageData?.config;
81
82
  const uiSchema = pageData?.uiSchema;
82
83
  const event = new CustomEvent('pageNameChanged', {
83
- detail: { pageName: config.label, hasBackIcon: config.hasBackIcon === "NO" ? false : true }
84
+ detail: { pageName: config.label, pageIconUrl: config.pageIconUrl, hasBackIcon: config.hasBackIcon === "NO" ? false : true }
84
85
  });
85
86
  window.dispatchEvent(event)
86
87
  const theme = funcParams?.store?.theme?.myTheme;
@@ -101,6 +102,7 @@ export default (funcParams: funcParamsProps) => {
101
102
  }
102
103
  }
103
104
  )
105
+
104
106
  executeRefreshHandler({
105
107
  config: {}, componentName: "",
106
108
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
@@ -111,6 +113,24 @@ export default (funcParams: funcParamsProps) => {
111
113
  funcParams.store.setUiSchema(uiSchema);
112
114
  });
113
115
  },
116
+ getStyle: () => {
117
+ const cloneEventGroup = _.cloneDeep(eventGroups)
118
+ if (cloneEventGroup.setStyle) {
119
+ let finalResponse = {};
120
+ const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData.path?.split(".").pop();
121
+ if (cloneEventGroup?.setStyle?.[path]) {
122
+ for (const eventConfig of cloneEventGroup?.setStyle?.[path]) {
123
+ finalResponse = executeEvents({
124
+ ...executeEventsParameters,
125
+ config: eventConfig,
126
+ componentName: path
127
+ })
128
+ }
129
+ return finalResponse
130
+ }
131
+ }
132
+ return {}
133
+ },
114
134
  onCellRenderer: (cellParams) => {
115
135
  const cloneEventGroup = _.cloneDeep(eventGroups)
116
136
  if (cloneEventGroup.onCellRenderer) {
@@ -139,6 +159,9 @@ export default (funcParams: funcParamsProps) => {
139
159
  onFileDelete: async function () {
140
160
  this.callHandler("onFileDelete")
141
161
  },
162
+ onClose: function () {
163
+ this.callHandler("onClose")
164
+ },
142
165
  onMount: function () {
143
166
  this.callHandler("onMount")
144
167
  },
@@ -168,7 +191,8 @@ export default (funcParams: funcParamsProps) => {
168
191
  { key: "sorting", value: paginationValues.sorting || [] },
169
192
  { key: "filters", value: paginationValues.tableColumnConfig || [] },
170
193
  { key: "globalFilter", value: paginationValues.globalFilter ?? '' },
171
- { key: "expandedRowIds", value: paginationValues.expandedRowIds ?? [] }
194
+ { key: "parentIds", value: paginationValues.parentIds},
195
+ { key: "isExpandAll", value: paginationValues.isExpandAll},
172
196
  ]
173
197
  const response = await this.callExecuteEvents(paginationValues, apiBody, "onLoad");
174
198
  return response?.data;
@@ -190,8 +214,7 @@ export default (funcParams: funcParamsProps) => {
190
214
 
191
215
  const promises = ChangeEventsKeysArray.flatMap((componentName: string) => {
192
216
  if (
193
- funcParams.store?.formData[componentName] === funcParams.store.newData[componentName] ||
194
- funcParams.store?.newData[componentName] === undefined
217
+ funcParams.store?.formData[componentName] === funcParams.store.newData[componentName]
195
218
  ) {
196
219
  return [];
197
220
  }
@@ -291,6 +314,7 @@ export default (funcParams: funcParamsProps) => {
291
314
  },
292
315
  downloadFile: downloadFile,
293
316
  downloadFileFromUrl: downloadFileFromUrl,
317
+ downloadFileStream: downloadFileStream,
294
318
  ...funcParams.functionsProvider
295
319
  };
296
320
  };