impaktapps-ui-builder 1.0.621 → 1.0.622-copy.2

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 (100) hide show
  1. package/dist/impaktapps-ui-builder.es.js +2016 -897
  2. package/dist/impaktapps-ui-builder.es.js.map +1 -1
  3. package/dist/impaktapps-ui-builder.umd.js +15 -15
  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/buildCamera.d.ts +1 -0
  7. package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.d.ts +1 -0
  8. package/dist/src/impaktapps-ui-builder/builder/build/buildGroupButton.d.ts +1 -0
  9. package/dist/src/impaktapps-ui-builder/builder/build/buildHierarchyChart.d.ts +1 -0
  10. package/dist/src/impaktapps-ui-builder/builder/build/buildHorizontalLayout.d.ts +1 -0
  11. package/dist/src/impaktapps-ui-builder/builder/build/buildImage.d.ts +1 -0
  12. package/dist/src/impaktapps-ui-builder/builder/build/buildMetricCard.d.ts +1 -0
  13. package/dist/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.d.ts +1 -0
  14. package/dist/src/impaktapps-ui-builder/builder/build/buildPdfViewer.d.ts +1 -0
  15. package/dist/src/impaktapps-ui-builder/builder/build/buildPopover.d.ts +1 -0
  16. package/dist/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.d.ts +2 -0
  17. package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +2 -1
  18. package/dist/src/impaktapps-ui-builder/builder/build/uischema/box.d.ts +4 -1
  19. package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +1 -1
  20. package/dist/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.d.ts +22 -0
  21. package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +173 -171
  22. package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +18 -50
  23. package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +50 -4
  24. package/dist/src/impaktapps-ui-builder/builder/build/uischema/hierarchyChart.d.ts +22 -0
  25. package/dist/src/impaktapps-ui-builder/builder/build/uischema/horizontalLayout.d.ts +13 -0
  26. package/dist/src/impaktapps-ui-builder/builder/build/uischema/metricCard.d.ts +17 -0
  27. package/dist/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.d.ts +1 -0
  28. package/dist/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.d.ts +19 -0
  29. package/dist/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.d.ts +1 -0
  30. package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +15 -66
  31. package/dist/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.d.ts +3 -1
  32. package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +2 -1
  33. package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -0
  34. package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +5 -2
  35. package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +8 -4
  36. package/package.json +1 -1
  37. package/src/impaktapps-ui-builder/builder/build/buildAreaGraph.ts +66 -0
  38. package/src/impaktapps-ui-builder/builder/build/buildArray.ts +13 -0
  39. package/src/impaktapps-ui-builder/builder/build/buildCamera.ts +50 -0
  40. package/src/impaktapps-ui-builder/builder/build/buildCard.ts +10 -10
  41. package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +23 -9
  42. package/src/impaktapps-ui-builder/builder/build/buildDate.ts +35 -13
  43. package/src/impaktapps-ui-builder/builder/build/buildDownloadFile.ts +7 -0
  44. package/src/impaktapps-ui-builder/builder/build/buildEmptyBox.ts +4 -0
  45. package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +42 -28
  46. package/src/impaktapps-ui-builder/builder/build/buildGroupButton.ts +24 -0
  47. package/src/impaktapps-ui-builder/builder/build/buildHierarchyChart.ts +35 -0
  48. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +9 -3
  49. package/src/impaktapps-ui-builder/builder/build/buildHorizontalLayout.ts +15 -0
  50. package/src/impaktapps-ui-builder/builder/build/buildImage.ts +38 -0
  51. package/src/impaktapps-ui-builder/builder/build/buildLabel.ts +3 -0
  52. package/src/impaktapps-ui-builder/builder/build/buildLeaderboard.ts +3 -0
  53. package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +9 -3
  54. package/src/impaktapps-ui-builder/builder/build/buildMetricCard.tsx +37 -0
  55. package/src/impaktapps-ui-builder/builder/build/buildMultiSelect.ts +9 -0
  56. package/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.ts +44 -0
  57. package/src/impaktapps-ui-builder/builder/build/buildPdfViewer.ts +16 -0
  58. package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +6 -3
  59. package/src/impaktapps-ui-builder/builder/build/buildPop.ts +1 -0
  60. package/src/impaktapps-ui-builder/builder/build/buildPopover.ts +40 -0
  61. package/src/impaktapps-ui-builder/builder/build/buildProgressBar.ts +31 -21
  62. package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +10 -2
  63. package/src/impaktapps-ui-builder/builder/build/buildSelect.ts +9 -0
  64. package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +9 -3
  65. package/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.ts +72 -0
  66. package/src/impaktapps-ui-builder/builder/build/buildTabSection.ts +5 -0
  67. package/src/impaktapps-ui-builder/builder/build/buildTable.ts +27 -11
  68. package/src/impaktapps-ui-builder/builder/build/buildText.ts +9 -0
  69. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +144 -124
  70. package/src/impaktapps-ui-builder/builder/build/buildUplaodFile.ts +6 -0
  71. package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +8 -2
  72. package/src/impaktapps-ui-builder/builder/build/uischema/box.ts +4 -1
  73. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +319 -21
  74. package/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.ts +17 -0
  75. package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +142 -169
  76. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +74 -19
  77. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +30 -54
  78. package/src/impaktapps-ui-builder/builder/build/uischema/file.ts +1 -1
  79. package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +37 -4
  80. package/src/impaktapps-ui-builder/builder/build/uischema/hierarchyChart.ts +13 -0
  81. package/src/impaktapps-ui-builder/builder/build/uischema/horizontalLayout.ts +11 -0
  82. package/src/impaktapps-ui-builder/builder/build/uischema/metricCard.ts +13 -0
  83. package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +2 -0
  84. package/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.ts +18 -0
  85. package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +2 -0
  86. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +34 -60
  87. package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +3 -1
  88. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +219 -75
  89. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +61 -1
  90. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +94 -106
  91. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +4 -3
  92. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +31 -55
  93. package/src/impaktapps-ui-builder/builder/services/component.ts +177 -86
  94. package/src/impaktapps-ui-builder/builder/services/event.ts +3 -0
  95. package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +18 -15
  96. package/src/impaktapps-ui-builder/builder/services/utils.ts +15 -3
  97. package/src/impaktapps-ui-builder/lib/index.ts +10 -9
  98. package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +42 -22
  99. package/src/impaktapps-ui-builder/runtime/services/events.ts +9 -11
  100. package/src/impaktapps-ui-builder/runtime/services/service.ts +118 -158
@@ -8,40 +8,52 @@ 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, 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", "Validation"],
16
- LeaderBoard: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
17
- WrapperSection: ["Core", "Components", "Properties", "Style", "Validation"],
18
- TabSection: ["Core", "Components", "Properties", "Style", "Validation"],
19
- SpeedoMeter: ["Core", "Properties", "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", "TabTitles", "Properties", "Style", "Validation"],
20
+ SpeedoMeter: ["Core", "Properties", "Events", "Style",],
20
21
  card: ["Core", "Properties", "Events", "Style", "Validation"],
21
22
  UploadFile: ["Core", "Events", "Style", "Validation"],
22
23
  Graph: ["Core", "Properties", "Events", "Style", "Validation"],
23
24
  DownloadFile: ["Core", "Events", "Style", "Validation"],
24
- Box: ["Core", "Events", "Style", "Validation"],
25
+ Box: ["Core", "Properties", "Events", "Style", "Validation"],
25
26
  Properties: ["Core", "Properties", "Events", "Style", "Validation"],
26
- ProgressBarCard: ["Core", "Properties", "Events", "Style", "Validation"],
27
- RankCard: ["Core", "Properties", "Events", "Style", "Validation"],
27
+ ProgressBarCard: ["Core", "Properties", "Events", "Style"],
28
+ ProgressBar: ["Core", "Properties", "Events", "Style",],
29
+ RankCard: ["Core", "Properties", "Events", "Style",],
30
+ MetricCard: ["Core", "Properties", "Events", "Style", "Validation"],
31
+ HierarchyChart: ["Core","Components","Properties", "Events", "Style", "Validation"],
28
32
  Slider: ["Core", "Components", "Events", "Style", "Validation"],
29
- Timer: ["Core", "Events", "Style", "Validation"],
30
- Rank: ["Core", "Events", "Style", "Validation"],
33
+ Timer: ["Core", "Events", "Style",],
34
+ Rank: ["Core", "Events", "Style",],
31
35
  Button: ["Core", "Properties", "Events", "Style", "Validation"],
32
- Array: ["Core", "Components", "Properties","Validation"],
36
+ ButtonGroup: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
37
+ Array: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
33
38
  Radio: ["Core", "Properties", "Events", "Style", "Validation"],
34
39
  Text: ["Core", "Properties", "Events", "Style", "Validation"],
35
40
  TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
36
- PopUp: ["Core", "Components", "Properties", "Style"],
41
+ PopUp: ["Core", "Components", "Properties", "Events", "Style"],
42
+ PopOver: ["Core", "Components", "Properties", "Style"],
43
+ PdfViewer: ["Core", "Properties", "Style"],
37
44
  Stepper: ["Core", "Components", "Properties", "Events", "Style"],
38
45
  DataGrid: ["Core", "Components", "Properties", "Events", "Style"],
39
46
  InputSlider: ["Core", "Properties", "Events", "Style", "Validation"],
40
47
  TreeMap: ["Core", "Components", "Properties", "Events", "Style"],
41
48
  ColumnGroup: ["Core", "Components"],
42
- Thought: ["Core", "Properties", "Events", "Style", "Validation"]
49
+ Thought: ["Core", "Properties", "Events", "Style",],
50
+ Date: ["Core", "Properties", "Events", "Style", "Validation"],
51
+ DateTime: ["Core", "Properties", "Events", "Style", "Validation"],
52
+ Image: ["Core", "Properties", "Events", "Style"],
53
+ FileInput: ["Core", "Properties", "Events", "Style", "Validation"],
54
+ Camera: ["Core", "Properties", "Events", "Style", "Validation"],
55
+ OTP_Input: ["Core", "Properties", "Events", "Style", "Validation"],
43
56
  }
44
-
45
57
  export function refreshPage(type: string, store: any) {
46
58
  const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
47
59
  const currentConfig = JSON.parse(sessionStorage.getItem("pageFormdata"));
@@ -52,6 +64,7 @@ export function refreshPage(type: string, store: any) {
52
64
  Style: StyleSection,
53
65
  Events: EventSection(store.theme.myTheme),
54
66
  Components: TableSection(store.theme.myTheme),
67
+ TabTitles: TableSection(store.theme.myTheme, "tabLabelElements"),
55
68
  Properties: buildPropertiesSection(type),
56
69
  Validation: ValidationSection
57
70
  }
@@ -63,12 +76,12 @@ export function refreshPage(type: string, store: any) {
63
76
  // Get Widget Type of parent
64
77
  const path = store.searchParams?.get("path");
65
78
  const lastDotIndex = path.lastIndexOf('.')
66
- const parentPath = path.slice(0,lastDotIndex)
79
+ const parentPath = path.slice(0, lastDotIndex)
67
80
 
68
81
  const parentObj = _.get(currentConfig, parentPath)
69
82
 
70
- if(parentObj?.type === "Table"){
71
- UiSchema.elements[0].elements[0].elements[4] =
83
+ if (parentObj?.type === "Table" || parentObj?.type === "ColumnGroup") {
84
+ UiSchema.elements[0].elements[0].elements[4] =
72
85
  {
73
86
  type: "Control",
74
87
  scope: "#/properties/columnFormat",
@@ -83,7 +96,7 @@ export function refreshPage(type: string, store: any) {
83
96
  },
84
97
  },
85
98
  };
86
- UiSchema.elements[0].elements[0].elements[6] =
99
+ UiSchema.elements[0].elements[0].elements[6] =
87
100
  {
88
101
  type: "Control",
89
102
  scope: "#/properties/filteringOptions",
@@ -98,7 +111,7 @@ export function refreshPage(type: string, store: any) {
98
111
  },
99
112
  },
100
113
  };
101
- UiSchema.elements[0].elements[0].elements[5] =
114
+ UiSchema.elements[0].elements[0].elements[5] =
102
115
  {
103
116
  type: "Control",
104
117
  scope: "#/properties/enableFilter",
@@ -113,52 +126,91 @@ export function refreshPage(type: string, store: any) {
113
126
  },
114
127
  },
115
128
  },
116
- UiSchema.elements[0].elements[0].elements[7] =
117
- {
118
- type: "Control",
119
- scope: "#/properties/enableSorting",
120
- options: {
121
- widget: "RadioInputField",
129
+ UiSchema.elements[0].elements[0].elements[7] =
130
+ {
131
+ type: "Control",
132
+ scope: "#/properties/enableSorting",
133
+ options: {
134
+ widget: "RadioInputField",
135
+ },
136
+ config: {
137
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
138
+ main: {
139
+ label: "Enable Sorting",
140
+ options: ["Yes", "No"],
141
+ },
142
+ },
122
143
  },
123
- config: {
124
- layout: { xs: 6, sm: 6, md: 4, lg: 3 },
125
- main: {
126
- label: "Enable Sorting",
127
- options: ["Yes", "No"],
144
+ UiSchema.elements[0].elements[0].elements[8] =
145
+ {
146
+ type: "Control",
147
+ scope: "#/properties/columnKey",
148
+ config: {
149
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
150
+ main: {
151
+ label: "Column Key",
152
+ },
153
+ },
154
+ options: {
155
+ widget: "InputField",
128
156
  },
129
157
  },
130
- },
131
- UiSchema.elements[0].elements[0].elements[8] =
132
- {
158
+ UiSchema.elements[0].elements[0].elements[9] =
159
+ {
160
+ type: "Control",
161
+ scope: "#/properties/elementType",
162
+ options: {
163
+ widget: "SelectInputField",
164
+ },
165
+ config: {
166
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
167
+ main: {
168
+ label: "Element Type",
169
+ },
170
+ },
171
+ }
172
+ UiSchema.elements[0].elements[0].elements[10] = {
133
173
  type: "Control",
134
- scope: "#/properties/columnKey",
174
+ scope: "#/properties/dateFormat",
175
+ options: {
176
+ widget: "SelectInputField",
177
+ },
135
178
  config: {
136
179
  layout: { xs: 6, sm: 6, md: 4, lg: 3 },
137
180
  main: {
138
- label: "Column Key",
181
+ label: "Date Time Format",
139
182
  },
140
183
  },
184
+ }
185
+ UiSchema.elements[0].elements[0].elements[11] = {
186
+ type: "Control",
187
+ scope: "#/properties/emptyBox",
141
188
  options: {
142
- widget: "InputField",
189
+ widget: "EmptyBox",
143
190
  },
144
- },
145
- UiSchema.elements[0].elements[0].elements[9] =
146
- {
191
+ config: {
192
+ layout: { xs: 0, sm: 0, md: 0, lg: 6 },
193
+ },
194
+ }
195
+ }
196
+ if (parentObj?.type === "LeaderBoard") {
197
+ UiSchema.elements[0].elements[0].elements[4] =
198
+ {
147
199
  type: "Control",
148
- scope: "#/properties/elementType",
200
+ scope: "#/properties/columnFormat",
149
201
  options: {
150
202
  widget: "SelectInputField",
151
203
  },
152
204
  config: {
153
205
  layout: { xs: 6, sm: 6, md: 4, lg: 3 },
154
206
  main: {
155
- label: "Element Type",
207
+ label: "Column Format",
156
208
  },
157
209
  },
158
- }
210
+ };
159
211
  }
160
212
 
161
- if (sessionStorage.getItem("copiedConfig") ) {
213
+ if (sessionStorage.getItem("copiedConfig")) {
162
214
  this.ElementPathSetter(UiSchema);
163
215
  }
164
216
  store.setUiSchema(UiSchema);
@@ -184,33 +236,33 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
184
236
  if (sessionStorage.getItem("copiedConfig")) {
185
237
  schema.properties.RemoveItemButton.disabled = false;
186
238
  }
187
-
239
+
188
240
  const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
189
241
  const path = store.searchParams?.get("path");
190
242
  const id = store.searchParams?.get("id")
191
243
 
192
- let pathArray = [{label: config.name ?? "NewPage", path: `/PageMaster${id ? `?id=${id}` : ''}`}];
244
+ let pathArray = [{ label: config.name ?? "NewPage", path: `/PageMaster${id ? `?id=${id}` : ''}` }];
193
245
 
194
246
  if (path) {
195
- const pathArrayAll = path.split(".");
196
- const arr: any = []
197
- pathArrayAll.map((e: string, i: number) => {
198
- if (i === 0) {
199
- arr.push(e)
200
- return;
201
- }
202
- arr.push(`${arr[i - 1]}.${e}`)
203
- })
247
+ const pathArrayAll = path.split(".");
248
+ const arr: any = []
249
+ pathArrayAll.map((e: string, i: number) => {
250
+ if (i === 0) {
251
+ arr.push(e)
252
+ return;
253
+ }
254
+ arr.push(`${arr[i - 1]}.${e}`)
255
+ })
204
256
 
205
257
 
206
- arr.map((e) => {
207
- const data = _.get(config, e)
208
- pathArray.push({
209
- label: data?.name || data?.eventType || "NewComponent",
210
- path: `/Component?path=${e}${id ? `&id=${id}` : ''}`
211
- });
212
- })
213
- }
258
+ arr.map((e) => {
259
+ const data = _.get(config, e)
260
+ pathArray.push({
261
+ label: data?.name || data?.eventType || "NewComponent",
262
+ path: `/Component?path=${e}${id ? `&id=${id}` : ''}`
263
+ });
264
+ })
265
+ }
214
266
 
215
267
  schema.properties.pageName.path = pathArray
216
268
  return schema;
@@ -226,13 +278,19 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
226
278
  }
227
279
  },
228
280
  editComponents: function () {
281
+
282
+ if (validateAndShowErrors(store)) return;
229
283
  const rowId = dynamicData.path.split(".")[1];
230
284
  const path = store.searchParams?.get("path");
231
285
  const id = store.searchParams?.get("id");
232
286
  saveFormdataInSessionStorage(store.ctx.core.data, path)
233
287
  if (path) {
234
- const path = store.searchParams?.get("path");
235
- const finalPath = `${path}.elements[${rowId}]`
288
+ let finalPath = `${path}`;
289
+ if (dynamicData?.path?.startsWith("tabLabel")) {
290
+ finalPath = `${finalPath}.tabLabelElements[${rowId}]`
291
+ } else {
292
+ finalPath = `${finalPath}.elements[${rowId}]`
293
+ }
236
294
  store.searchParams.set("path", finalPath)
237
295
  store.setSearchParams(store.searchParams)
238
296
  this.setPage()
@@ -243,7 +301,12 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
243
301
  deleteComponents: function (shouldUpdateDialog: boolean = true) {
244
302
  const path = store.searchParams?.get("path");
245
303
  const rowId = sessionStorage.getItem('rowId');
246
- store.formData.elements.splice(rowId, 1);
304
+ const isTabLabelElements = sessionStorage.getItem('isTabLabelElements') === "true";
305
+ if (isTabLabelElements) {
306
+ store.formData.tabLabelElements.splice(rowId, 1);
307
+ } else {
308
+ store.formData.elements.splice(rowId, 1);
309
+ }
247
310
  const response = saveFormdataInSessionStorage(store.ctx.core.data, path)
248
311
  const data = path ? _.get(response, path) : response;
249
312
  store.setFormdata(data);
@@ -251,6 +314,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
251
314
  store.updateDialog("popUpComponentSection");
252
315
  }
253
316
  sessionStorage.removeItem('rowId');
317
+ sessionStorage.removeItem('isTabLabelElements');
254
318
  },
255
319
  deleteEvent: function (shouldUpdateDialog: boolean = true) {
256
320
  const path = store.searchParams?.get("path");
@@ -264,18 +328,29 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
264
328
  sessionStorage.removeItem('rowId');
265
329
  },
266
330
  widgetAddClickHandler: function () {
331
+
332
+ if (validateAndShowErrors(store)) return;
267
333
  if (!Array.isArray(store.formData.elements)) {
268
334
  store.formData.elements = []
269
335
  }
336
+ if (!Array.isArray(store.formData.tabLabelElements)) {
337
+ store.formData.tabLabelElements = []
338
+ }
270
339
  const path = store.searchParams?.get("path");
271
340
  saveFormdataInSessionStorage(store.ctx.core.data, path)
272
- const finalPath = `${path}.elements[${store.formData.elements.length}]`
341
+ let finalPath = `${path}`;
342
+ if (dynamicData.path.startsWith("tabLabel")) {
343
+ finalPath = `${finalPath}.tabLabelElements[${store.formData.tabLabelElements.length}]`
344
+ } else {
345
+ finalPath = `${finalPath}.elements[${store.formData.elements.length}]`
346
+ }
273
347
  store.searchParams.set("path", finalPath)
274
348
  store.setSearchParams(store.searchParams)
275
349
  this.setPage()
276
350
 
277
351
  },
278
352
  eventEditHandler: function () {
353
+ if (validateAndShowErrors(store)) return;
279
354
  const rowId = dynamicData.path.split(".")[1];
280
355
  const path = store.searchParams?.get("path");
281
356
  const id = store.searchParams?.get("id");
@@ -284,6 +359,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
284
359
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
285
360
  },
286
361
  eventAddHandler: function () {
362
+ if (validateAndShowErrors(store)) return;
287
363
  const path = store.searchParams?.get("path");
288
364
  const id = store.searchParams?.get("id");
289
365
  if (!Array.isArray(store.formData.events)) {
@@ -299,6 +375,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
299
375
  deletePopUpComponent: function () {
300
376
  const rowId = dynamicData.path.split(".")[1];
301
377
  sessionStorage.setItem('rowId', rowId);
378
+ sessionStorage.setItem('isTabLabelElements', dynamicData.path.startsWith("tabLabel") ? "true" : "false");
302
379
  store.updateDialog("popUpComponentSection");
303
380
  },
304
381
  deletePopUpEvent: function () {
@@ -309,9 +386,11 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
309
386
 
310
387
  copyPasteElement: function (paramStore: any, setPage: any = this.setPage.bind(this)) {
311
388
  const [actionType, elementType] = dynamicData.path.split('.').pop()?.split('_');
389
+ console.log("BEFORE FUNCTION");
312
390
  actionType === "Copy" ? this.CopyElement(paramStore, elementType) : this.PasteElement(setPage, elementType);
313
391
  },
314
392
  CopyElement: function (paramStore: any = store, elementType: string) {
393
+ console.log("START FUNCTION");
315
394
  const schema = cloneDeep(paramStore.schema);
316
395
  const uiSchema = cloneDeep(paramStore.uiSchema);
317
396
  schema.properties.RemoveItemButton.disabled = false;
@@ -321,14 +400,15 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
321
400
  const copiedElementPath = this.elementPathHandler(parentPathOfCopiedComponent, rowId, elementType);
322
401
  const copiedFormData = getFormdataFromSessionStorage(copiedElementPath);
323
402
 
324
- this.ElementPathSetter(uiSchema,copiedFormData);
325
- sessionStorage.setItem('copiedConfig',JSON.stringify(copiedFormData));
403
+ this.ElementPathSetter(uiSchema, copiedFormData);
404
+ sessionStorage.setItem('copiedConfig', JSON.stringify(copiedFormData));
326
405
  store.setNotify({
327
406
  SuccessMessage: `${elementType} Copied Successfully`,
328
407
  Success: true,
329
408
  })
330
409
  store.setSchema(schema);
331
410
  store.setUiSchema(uiSchema);
411
+ console.log("END FUNCTION");
332
412
  },
333
413
  PasteElement: function (setPage: any, elementType: string) {
334
414
  if (!sessionStorage.getItem("copiedConfig")) {
@@ -345,9 +425,17 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
345
425
  if (!Array.isArray(store.formData.events)) {
346
426
  store.formData.events = []
347
427
  }
428
+ if (!Array.isArray(store.formData.tabLabelElements)) {
429
+ store.formData.tabLabelElements = []
430
+ }
348
431
  saveFormdataInSessionStorage(store.ctx.core.data, pastedElementParentPath);
349
432
  const formData = getFormdataFromSessionStorage(pastedElementParentPath);
350
- const insertElementIndex = elementType === "Component" ? formData.elements.length : formData.events.length;
433
+ const currentLength = {
434
+ "TabsComponent": formData.tabLabelElements.length,
435
+ "Component": formData.elements.length,
436
+ "Events": formData.events.length
437
+ };
438
+ const insertElementIndex = currentLength[elementType] || 0;
351
439
  const pastedElementPath = this.elementPathHandler(pastedElementParentPath, insertElementIndex, elementType);
352
440
 
353
441
  const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
@@ -361,7 +449,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
361
449
  Fail: true,
362
450
  });
363
451
  }
364
- else if(copiedConfig.name && elementType === "Events"){
452
+ else if (copiedConfig.name && elementType === "Events") {
365
453
  store.setNotify({
366
454
  FailMessage: notificationMessages.Component,
367
455
  Fail: true,
@@ -384,34 +472,37 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
384
472
  elementPathHandler: function (parentPath: string, rowId: any, elementType: string) {
385
473
  if (elementType === "Component") {
386
474
  return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
475
+ }
476
+ if(elementType === "TabsComponent"){
477
+ return `${parentPath}.tabLabelElements[${rowId}]`
387
478
  }
388
479
  return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
389
480
  },
390
481
  ElementPathSetter: function (uiSchema: any, copiedFormData?: any) {
391
482
  const formData = copiedFormData || JSON.parse(sessionStorage.getItem("copiedConfig"));
392
- if(uiSchema?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons){
393
- uiSchema.elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
483
+ if (uiSchema?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons) {
484
+ uiSchema.elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
394
485
  }
395
- else if(uiSchema?.elements?.[0]?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons){
396
- uiSchema.elements[0].elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
486
+ else if (uiSchema?.elements?.[0]?.elements?.[1]?.elements?.[0]?.config?.main?.headerIcons) {
487
+ uiSchema.elements[0].elements[1].elements[0].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.name}`;
397
488
  }
398
489
 
399
-
400
- if(uiSchema?.elements?.[1]?.elements?.[1]?.config?.main?.headerIcons){
401
- uiSchema.elements[1].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Event: ${formData.eventType}`;
490
+
491
+ if (uiSchema?.elements?.[1]?.elements?.[1]?.config?.main?.headerIcons) {
492
+ uiSchema.elements[1].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Event: ${formData.eventType}`;
402
493
  }
403
- else if(uiSchema?.elements?.[0]?.elements?.[1]?.config?.main?.headerIcons){
404
- uiSchema.elements[0].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.eventType}`;
494
+ else if (uiSchema?.elements?.[0]?.elements?.[1]?.config?.main?.headerIcons) {
495
+ uiSchema.elements[0].elements[1].config.main.headerIcons.elements[1].widget.config.main.tooltipMessage = `Copied Component: ${formData.eventType}`;
405
496
  }
406
497
  },
407
498
 
408
-
409
- onNavigatePopupYes: function() {
410
- try{
499
+
500
+ onNavigatePopupYes: function () {
501
+ try {
411
502
  store.navigate(sessionStorage.getItem("pendingNavigatePath"))
412
503
  store.updateDialog(`pageNamepopup`)
413
504
  }
414
- catch(e){
505
+ catch (e) {
415
506
  store.updateDialog(`pageNamepopup`)
416
507
  store.setNotify({
417
508
  FailMessage: "Couldn't navigate page",
@@ -419,8 +510,8 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
419
510
  })
420
511
  }
421
512
  },
422
- onNavigatePopupNo: function() {
423
- store.updateDialog(`pageNamepopup`)
513
+ onNavigatePopupNo: function () {
514
+ store.updateDialog(`pageNamepopup`)
424
515
  }
425
516
  }
426
517
  };
@@ -6,6 +6,7 @@ import {
6
6
  saveFormdataInSessionStorage,
7
7
  saveHandler,
8
8
  getFormdataFromSessionStorage,
9
+ validateAndShowErrors,
9
10
  } from "./utils";
10
11
  import { APISection } from "../build/uischema/apiSection";
11
12
  import {
@@ -210,6 +211,7 @@ export default (
210
211
  }
211
212
  },
212
213
  addEvent: function () {
214
+ if (validateAndShowErrors(store)) return;
213
215
  const path = store.searchParams?.get("path");
214
216
  if (!Array.isArray(store.formData.events)) {
215
217
  store.formData.events = [];
@@ -221,6 +223,7 @@ export default (
221
223
  this.setPage();
222
224
  },
223
225
  editEvent: function () {
226
+ if (validateAndShowErrors(store)) return;
224
227
  const rowId = dynamicData.path.split(".")[1];
225
228
  const path = store.searchParams?.get("path");
226
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, saveFormdataInSessionStorage, saveHandler } from "./utils";
5
+ import { getFormdataFromSessionStorage, validateAndShowErrors, saveFormdataInSessionStorage, saveHandler } from "./utils";
6
6
 
7
7
 
8
8
  interface funcParamsProps {
@@ -31,18 +31,18 @@ export default (funcParams: funcParamsProps) => {
31
31
  return formData;
32
32
  }
33
33
  saveFormdataInSessionStorage(config)
34
- return config
34
+ return { ...config, type: "page" }
35
35
  },
36
36
  getUiSchema: function () {
37
37
  const UiSchema = _.cloneDeep(PageMasterUiSchema(store.theme.myTheme));
38
- if (sessionStorage.getItem("copiedConfig") ) {
38
+ if (sessionStorage.getItem("copiedConfig")) {
39
39
  Component(store, dynamicData, submitHandler, service).ElementPathSetter(UiSchema)
40
40
  }
41
41
  return UiSchema;
42
42
  },
43
43
  getSchema: () => {
44
44
  const schema = _.cloneDeep(PageMasterSchema);
45
- if (sessionStorage.getItem("copiedConfig") ) {
45
+ if (sessionStorage.getItem("copiedConfig")) {
46
46
  schema.properties.RemoveItemButton.disabled = false;
47
47
  }
48
48
  return schema;
@@ -52,6 +52,7 @@ export default (funcParams: funcParamsProps) => {
52
52
  store.navigate("/PageMasterRecords");
53
53
  },
54
54
  onAddClickHandler: function () {
55
+ if (validateAndShowErrors(store)) return;
55
56
  const id = store.searchParams?.get("id");
56
57
  if (!Array.isArray(store.formData.elements)) {
57
58
  store.formData.elements = []
@@ -70,12 +71,13 @@ export default (funcParams: funcParamsProps) => {
70
71
  },
71
72
  saveHandler: async () => await saveHandler(store, service, submitHandler),
72
73
  Edit_Components: Component(store, dynamicData, submitHandler, service).editComponents,
73
-
74
- Delete_Components: async function() {
74
+
75
+ Delete_Components: async function () {
75
76
  await Component(store, dynamicData, submitHandler, service).deleteComponents(false);
76
77
  store.updateDialog("popUpPageMasterComponent");
77
78
  },
78
79
  eventAddHandler: function () {
80
+ if (validateAndShowErrors(store)) return;
79
81
  const id = store.searchParams?.get("id");
80
82
  if (!Array.isArray(store.formData.events)) {
81
83
  store.formData.events = []
@@ -85,6 +87,7 @@ export default (funcParams: funcParamsProps) => {
85
87
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
86
88
  },
87
89
  editEvent: function () {
90
+ if (validateAndShowErrors(store)) return;
88
91
  const rowId = dynamicData.path.split(".")[1];
89
92
  const id = store.searchParams?.get("id");
90
93
  saveFormdataInSessionStorage(store.ctx.core.data)
@@ -99,25 +102,25 @@ export default (funcParams: funcParamsProps) => {
99
102
  store.updateDialog("popUpPageMasterEvent");
100
103
  sessionStorage.removeItem('rowId');
101
104
  },
102
- deletePopUpComponent: function(){
105
+ deletePopUpComponent: function () {
103
106
  const rowId = dynamicData.path.split(".")[1];
104
- sessionStorage.setItem('rowId',rowId);
107
+ sessionStorage.setItem('rowId', rowId);
105
108
  store.updateDialog("popUpPageMasterComponent");
106
109
  },
107
- deletePopUpEvent: function(){
110
+ deletePopUpEvent: function () {
108
111
  const rowId = dynamicData.path.split(".")[1];
109
- sessionStorage.setItem('rowId',rowId);
112
+ sessionStorage.setItem('rowId', rowId);
110
113
  store.updateDialog("popUpPageMasterEvent");
111
114
  },
112
115
 
113
116
 
114
- copyPasteElement: function(){
115
- Component(store, dynamicData, submitHandler, service).copyPasteElement(store,this.setPage.bind(this));
117
+ copyPasteElement: function () {
118
+ Component(store, dynamicData, submitHandler, service).copyPasteElement(store, this.setPage.bind(this));
116
119
  },
117
-
118
- RemoveItemButton: function(){
120
+
121
+ RemoveItemButton: function () {
119
122
  Component(store, dynamicData, submitHandler, service).RemoveItemButton(store)
120
123
  },
121
-
124
+
122
125
  }
123
126
  };
@@ -5,6 +5,16 @@ const clearFromSessionStorage = () => {
5
5
  sessionStorage.removeItem("pageFormdata")
6
6
  }
7
7
  export default clearFromSessionStorage;
8
+
9
+ export const validateAndShowErrors = (store: any): boolean => {
10
+ if (_.isEmpty(store.ctx.core.errors)) return false;
11
+ store.setValidation("ValidateAndShow");
12
+ store.setNotify({
13
+ Fail: true,
14
+ FailMessage: "Error on Page"
15
+ });
16
+ return true;
17
+ };
8
18
  export const getNavigationHistory = (config: any, path: string | undefined) => {
9
19
  if (path) {
10
20
  let urlRoutes: string = config.name;
@@ -67,12 +77,14 @@ export async function saveHandler(store, service, submitHandler) {
67
77
  const saveReturn = await submitHandler(store, service, config);
68
78
  navigateHandler(store, true,"/PageMasterRecords")
69
79
  } catch (err) {
70
- navigateHandler(store, false)
80
+ navigateHandler(store, false, undefined, err.message);
71
81
  }
82
+ }else{
83
+ navigateHandler(store, false)
72
84
  }
73
85
  }
74
86
 
75
- export const navigateHandler = (store, isSubmitted, pageName?: string | boolean) => {
87
+ export const navigateHandler = (store, isSubmitted,pageName?: string | boolean, errorMessage?: string) => {
76
88
  if (isSubmitted) {
77
89
  sessionStorage.removeItem("pageFormdata");
78
90
  store.navigate(pageName || -1)
@@ -84,7 +96,7 @@ export const navigateHandler = (store, isSubmitted, pageName?: string | boolean)
84
96
  store.setValidation("ValidateAndShow");
85
97
  store.setNotify({
86
98
  Fail: true,
87
- FailMessage: "Errors on Page"
99
+ FailMessage: errorMessage || "Errors on Page"
88
100
  });
89
101
  }
90
102
  };