impaktapps-ui-builder 1.0.4 → 1.0.6

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 (122) hide show
  1. package/dist/impaktapps-ui-builder.es.js +2268 -1162
  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/buildArray.d.ts +1 -11
  7. package/dist/src/impaktapps-ui-builder/builder/build/buildCamera.d.ts +1 -0
  8. package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.d.ts +2 -1
  9. package/dist/src/impaktapps-ui-builder/builder/build/buildGroupButton.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/apiSection.d.ts +1 -3
  19. package/dist/src/impaktapps-ui-builder/builder/build/uischema/box.d.ts +10 -2
  20. package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +1 -1
  21. package/dist/src/impaktapps-ui-builder/builder/build/uischema/button.d.ts +6 -1
  22. package/dist/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.d.ts +22 -0
  23. package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +173 -171
  24. package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +82 -72
  25. package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +18 -50
  26. package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +50 -4
  27. package/dist/src/impaktapps-ui-builder/builder/build/uischema/horizontalLayout.d.ts +13 -0
  28. package/dist/src/impaktapps-ui-builder/builder/build/uischema/metricCard.d.ts +17 -0
  29. package/dist/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.d.ts +1 -0
  30. package/dist/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.d.ts +19 -0
  31. package/dist/src/impaktapps-ui-builder/builder/build/uischema/refresh.d.ts +0 -3
  32. package/dist/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.d.ts +1 -0
  33. package/dist/src/impaktapps-ui-builder/builder/build/uischema/table.d.ts +1 -0
  34. package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +15 -66
  35. package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +48 -38
  36. package/dist/src/impaktapps-ui-builder/builder/build/uischema/valueTab.d.ts +0 -3
  37. package/dist/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.d.ts +4 -1
  38. package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +2 -1
  39. package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -0
  40. package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +5 -2
  41. package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +10 -4
  42. package/package.json +1 -1
  43. package/src/impaktapps-ui-builder/builder/build/buildAadharCard.ts +2 -2
  44. package/src/impaktapps-ui-builder/builder/build/buildAreaGraph.ts +66 -0
  45. package/src/impaktapps-ui-builder/builder/build/buildArray.ts +35 -15
  46. package/src/impaktapps-ui-builder/builder/build/buildButton.ts +1 -1
  47. package/src/impaktapps-ui-builder/builder/build/buildCamera.ts +50 -0
  48. package/src/impaktapps-ui-builder/builder/build/buildCard.ts +10 -10
  49. package/src/impaktapps-ui-builder/builder/build/buildCheckbox.ts +1 -1
  50. package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +34 -16
  51. package/src/impaktapps-ui-builder/builder/build/buildDataGrid.ts +2 -2
  52. package/src/impaktapps-ui-builder/builder/build/buildDate.ts +35 -13
  53. package/src/impaktapps-ui-builder/builder/build/buildDownloadFile.ts +7 -0
  54. package/src/impaktapps-ui-builder/builder/build/buildEmptyBox.ts +1 -0
  55. package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +42 -28
  56. package/src/impaktapps-ui-builder/builder/build/buildGroupButton.ts +24 -0
  57. package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +10 -4
  58. package/src/impaktapps-ui-builder/builder/build/buildHorizontalLayout.ts +15 -0
  59. package/src/impaktapps-ui-builder/builder/build/buildImage.ts +38 -0
  60. package/src/impaktapps-ui-builder/builder/build/buildLabel.ts +3 -0
  61. package/src/impaktapps-ui-builder/builder/build/buildLeaderboard.ts +4 -1
  62. package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +10 -4
  63. package/src/impaktapps-ui-builder/builder/build/buildMetricCard.tsx +37 -0
  64. package/src/impaktapps-ui-builder/builder/build/buildMultiSelect.ts +12 -0
  65. package/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.ts +44 -0
  66. package/src/impaktapps-ui-builder/builder/build/buildPdfViewer.ts +16 -0
  67. package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +7 -4
  68. package/src/impaktapps-ui-builder/builder/build/buildPop.ts +3 -2
  69. package/src/impaktapps-ui-builder/builder/build/buildPopover.ts +40 -0
  70. package/src/impaktapps-ui-builder/builder/build/buildProgressBar.ts +31 -21
  71. package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +11 -3
  72. package/src/impaktapps-ui-builder/builder/build/buildSelect.ts +12 -0
  73. package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +10 -4
  74. package/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.ts +72 -0
  75. package/src/impaktapps-ui-builder/builder/build/buildTabSection.ts +5 -0
  76. package/src/impaktapps-ui-builder/builder/build/buildTable.ts +21 -11
  77. package/src/impaktapps-ui-builder/builder/build/buildText.ts +12 -0
  78. package/src/impaktapps-ui-builder/builder/build/buildTextArea.ts +2 -2
  79. package/src/impaktapps-ui-builder/builder/build/buildThoughtOfTheDay.ts +1 -1
  80. package/src/impaktapps-ui-builder/builder/build/buildTreeMap.ts +2 -1
  81. package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +140 -130
  82. package/src/impaktapps-ui-builder/builder/build/buildUplaodFile.ts +6 -0
  83. package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +8 -3
  84. package/src/impaktapps-ui-builder/builder/build/uischema/apiSection.ts +0 -6
  85. package/src/impaktapps-ui-builder/builder/build/uischema/array.ts +1 -1
  86. package/src/impaktapps-ui-builder/builder/build/uischema/box.ts +5 -2
  87. package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +396 -142
  88. package/src/impaktapps-ui-builder/builder/build/uischema/button.ts +1 -1
  89. package/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.ts +17 -0
  90. package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +142 -169
  91. package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +127 -133
  92. package/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.ts +2 -2
  93. package/src/impaktapps-ui-builder/builder/build/uischema/emptyBox.ts +1 -1
  94. package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +30 -54
  95. package/src/impaktapps-ui-builder/builder/build/uischema/file.ts +3 -3
  96. package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +37 -4
  97. package/src/impaktapps-ui-builder/builder/build/uischema/horizontalLayout.ts +11 -0
  98. package/src/impaktapps-ui-builder/builder/build/uischema/metricCard.ts +13 -0
  99. package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +4 -2
  100. package/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.ts +18 -0
  101. package/src/impaktapps-ui-builder/builder/build/uischema/refresh.ts +0 -3
  102. package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +3 -1
  103. package/src/impaktapps-ui-builder/builder/build/uischema/table.ts +1 -0
  104. package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +34 -60
  105. package/src/impaktapps-ui-builder/builder/build/uischema/textInputField.ts +1 -1
  106. package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +58 -113
  107. package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +0 -3
  108. package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +4 -1
  109. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +228 -59
  110. package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +121 -119
  111. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.ts +1 -1
  112. package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +94 -106
  113. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +11 -5
  114. package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +31 -55
  115. package/src/impaktapps-ui-builder/builder/services/component.ts +173 -86
  116. package/src/impaktapps-ui-builder/builder/services/event.ts +3 -0
  117. package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +18 -15
  118. package/src/impaktapps-ui-builder/builder/services/utils.ts +15 -3
  119. package/src/impaktapps-ui-builder/lib/index.ts +10 -9
  120. package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +33 -18
  121. package/src/impaktapps-ui-builder/runtime/services/events.ts +9 -11
  122. package/src/impaktapps-ui-builder/runtime/services/service.ts +121 -162
@@ -145,94 +145,70 @@ export const EventUiSchema: any = (theme) => {
145
145
  enableDrag: true,
146
146
 
147
147
  },
148
- },
149
- elements: [
150
-
151
- {
152
- accessorKey: "eventType",
153
- header: "Event's Type",
154
- size: 300,
155
- type: "string"
156
- },
157
- {
158
- accessorKey: "Handler",
159
- header: "Handler",
160
- size: 200,
161
- type: "string"
162
- },
163
- {
164
- accessorKey: "Edit_Approve_Records",
165
- header: "Edit",
166
- type: "action",
167
- size: 150,
168
- widget: {
148
+ action: [
149
+ {
169
150
  type: "Control",
170
151
  scope: "#/properties/Edit_Records",
171
152
  options: {
172
- widget: "IconButton",
153
+ widget: "Button",
173
154
  },
174
155
  config: {
175
156
  main: {
176
157
  size: "small",
177
- icon: "TableEditIcon",
158
+ startIcon: "EditIcon",
178
159
  tooltipMessage: "Edit This Record",
179
160
  onClick: "editEvent",
180
- },
181
- style: {
182
- fill: theme.palette.primary.main,
183
- "& :hover": {
184
- fill: theme.palette.primary.dark,
185
- },
161
+ name: "Edit"
186
162
  },
187
163
  },
188
164
  },
189
- },
190
- {
191
- accessorKey: "Reject_Records",
192
- header: "Delete",
193
- type: "action",
194
- size: 150,
195
- widget: {
165
+ {
196
166
  type: "Control",
197
167
  scope: "#/properties/RejectButton",
198
168
  options: {
199
- widget: "IconButton",
169
+ widget: "Button",
200
170
  },
201
171
  config: {
202
172
  main: {
203
- icon: "Bin",
173
+ startIcon: "Bin",
204
174
  tooltipMessage: "Reject This Record",
205
175
  onClick: "deletePopUpEvent",
206
- },
207
- style: {
208
- fill: theme.palette.primary.main,
209
- "& :hover": {
210
- fill: theme.palette.primary.dark,
211
- },
176
+ name: "Delete",
177
+ size: "small"
212
178
  },
213
179
  },
214
180
  },
215
- },
216
-
217
- {
218
- header: "Copy",
219
- field: "Copy_Event",
220
- type: "action",
221
- size: 150,
222
- widget: {
181
+ {
223
182
  type: "Control",
224
183
  scope: "#/properties/Copy_Event",
225
184
  options: {
226
- widget: "IconButton",
185
+ widget: "Button",
227
186
  },
228
187
  config: {
229
188
  main: {
230
- icon: "FileCopyIcon",
189
+ startIcon: "FileCopyIcon",
231
190
  onClick: "copyPasteElement",
232
- styleDefault: true,
191
+ styleDefault: false,
192
+ name: "Copy",
193
+ size: "small"
233
194
  },
234
195
  },
235
196
  },
197
+ ]
198
+ },
199
+ elements: [
200
+
201
+ {
202
+ accessorKey: "eventType",
203
+ header: "Event's Type",
204
+ size: 300,
205
+ type: "string"
206
+ },
207
+ {
208
+ accessorKey: "Handler",
209
+ header: "Handler",
210
+ size: 200,
211
+ type: "string"
236
212
  },
237
213
  ]
238
214
  }
@@ -8,40 +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, 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"],
28
31
  Slider: ["Core", "Components", "Events", "Style", "Validation"],
29
- Timer: ["Core", "Events", "Style", "Validation"],
30
- Rank: ["Core", "Events", "Style", "Validation"],
32
+ Timer: ["Core", "Events", "Style",],
33
+ Rank: ["Core", "Events", "Style",],
31
34
  Button: ["Core", "Properties", "Events", "Style", "Validation"],
32
- Array: ["Core", "Components", "Validation"],
35
+ ButtonGroup: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
36
+ Array: ["Core", "Components", "Properties", "Events", "Style", "Validation"],
33
37
  Radio: ["Core", "Properties", "Events", "Style", "Validation"],
34
38
  Text: ["Core", "Properties", "Events", "Style", "Validation"],
35
39
  TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
36
- PopUp: ["Core", "Components", "Properties", "Style"],
40
+ PopUp: ["Core", "Components", "Properties", "Events", "Style"],
41
+ PopOver: ["Core", "Components", "Properties", "Style"],
42
+ PdfViewer: ["Core", "Properties", "Style"],
37
43
  Stepper: ["Core", "Components", "Properties", "Events", "Style"],
38
44
  DataGrid: ["Core", "Components", "Properties", "Events", "Style"],
39
45
  InputSlider: ["Core", "Properties", "Events", "Style", "Validation"],
40
46
  TreeMap: ["Core", "Components", "Properties", "Events", "Style"],
41
47
  ColumnGroup: ["Core", "Components"],
42
- Thought: ["Core", "Properties", "Events", "Style", "Validation"]
48
+ Thought: ["Core", "Properties", "Events", "Style",],
49
+ Date: ["Core", "Properties", "Events", "Style", "Validation"],
50
+ DateTime: ["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"],
43
55
  }
44
-
45
56
  export function refreshPage(type: string, store: any) {
46
57
  const UiSchema = _.cloneDeep(componentBasicUiSchema(store.theme.myTheme))
47
58
  const currentConfig = JSON.parse(sessionStorage.getItem("pageFormdata"));
@@ -52,6 +63,7 @@ export function refreshPage(type: string, store: any) {
52
63
  Style: StyleSection,
53
64
  Events: EventSection(store.theme.myTheme),
54
65
  Components: TableSection(store.theme.myTheme),
66
+ TabTitles: TableSection(store.theme.myTheme, "tabLabelElements"),
55
67
  Properties: buildPropertiesSection(type),
56
68
  Validation: ValidationSection
57
69
  }
@@ -63,12 +75,12 @@ export function refreshPage(type: string, store: any) {
63
75
  // Get Widget Type of parent
64
76
  const path = store.searchParams?.get("path");
65
77
  const lastDotIndex = path.lastIndexOf('.')
66
- const parentPath = path.slice(0,lastDotIndex)
78
+ const parentPath = path.slice(0, lastDotIndex)
67
79
 
68
80
  const parentObj = _.get(currentConfig, parentPath)
69
81
 
70
- if(parentObj?.type === "Table"){
71
- UiSchema.elements[0].elements[0].elements[4] =
82
+ if (parentObj?.type === "Table" || parentObj?.type === "ColumnGroup") {
83
+ UiSchema.elements[0].elements[0].elements[4] =
72
84
  {
73
85
  type: "Control",
74
86
  scope: "#/properties/columnFormat",
@@ -83,7 +95,7 @@ export function refreshPage(type: string, store: any) {
83
95
  },
84
96
  },
85
97
  };
86
- UiSchema.elements[0].elements[0].elements[6] =
98
+ UiSchema.elements[0].elements[0].elements[6] =
87
99
  {
88
100
  type: "Control",
89
101
  scope: "#/properties/filteringOptions",
@@ -98,7 +110,7 @@ export function refreshPage(type: string, store: any) {
98
110
  },
99
111
  },
100
112
  };
101
- UiSchema.elements[0].elements[0].elements[5] =
113
+ UiSchema.elements[0].elements[0].elements[5] =
102
114
  {
103
115
  type: "Control",
104
116
  scope: "#/properties/enableFilter",
@@ -113,52 +125,91 @@ export function refreshPage(type: string, store: any) {
113
125
  },
114
126
  },
115
127
  },
116
- UiSchema.elements[0].elements[0].elements[7] =
117
- {
118
- type: "Control",
119
- scope: "#/properties/enableSorting",
120
- options: {
121
- widget: "RadioInputField",
128
+ UiSchema.elements[0].elements[0].elements[7] =
129
+ {
130
+ type: "Control",
131
+ scope: "#/properties/enableSorting",
132
+ options: {
133
+ widget: "RadioInputField",
134
+ },
135
+ config: {
136
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 },
137
+ main: {
138
+ label: "Enable Sorting",
139
+ options: ["Yes", "No"],
140
+ },
141
+ },
122
142
  },
123
- config: {
124
- layout: { xs: 6, sm: 6, md: 4, lg: 3 },
125
- main: {
126
- label: "Enable Sorting",
127
- options: ["Yes", "No"],
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",
128
155
  },
129
156
  },
130
- },
131
- UiSchema.elements[0].elements[0].elements[8] =
132
- {
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
+ }
171
+ UiSchema.elements[0].elements[0].elements[10] = {
133
172
  type: "Control",
134
- scope: "#/properties/columnKey",
173
+ scope: "#/properties/dateFormat",
174
+ options: {
175
+ widget: "SelectInputField",
176
+ },
135
177
  config: {
136
178
  layout: { xs: 6, sm: 6, md: 4, lg: 3 },
137
179
  main: {
138
- label: "Column Key",
180
+ label: "Date Time Format",
139
181
  },
140
182
  },
183
+ }
184
+ UiSchema.elements[0].elements[0].elements[11] = {
185
+ type: "Control",
186
+ scope: "#/properties/emptyBox",
141
187
  options: {
142
- widget: "InputField",
188
+ widget: "EmptyBox",
143
189
  },
144
- },
145
- UiSchema.elements[0].elements[0].elements[9] =
146
- {
190
+ config: {
191
+ layout: { xs: 0, sm: 0, md: 0, lg: 6 },
192
+ },
193
+ }
194
+ }
195
+ if (parentObj?.type === "LeaderBoard") {
196
+ UiSchema.elements[0].elements[0].elements[4] =
197
+ {
147
198
  type: "Control",
148
- scope: "#/properties/elementType",
199
+ scope: "#/properties/columnFormat",
149
200
  options: {
150
201
  widget: "SelectInputField",
151
202
  },
152
203
  config: {
153
204
  layout: { xs: 6, sm: 6, md: 4, lg: 3 },
154
205
  main: {
155
- label: "Element Type",
206
+ label: "Column Format",
156
207
  },
157
208
  },
158
- }
209
+ };
159
210
  }
160
211
 
161
- if (sessionStorage.getItem("copiedConfig") ) {
212
+ if (sessionStorage.getItem("copiedConfig")) {
162
213
  this.ElementPathSetter(UiSchema);
163
214
  }
164
215
  store.setUiSchema(UiSchema);
@@ -184,33 +235,33 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
184
235
  if (sessionStorage.getItem("copiedConfig")) {
185
236
  schema.properties.RemoveItemButton.disabled = false;
186
237
  }
187
-
238
+
188
239
  const config = JSON.parse(sessionStorage.getItem("pageFormdata"));
189
240
  const path = store.searchParams?.get("path");
190
241
  const id = store.searchParams?.get("id")
191
242
 
192
- let pathArray = [{label: config.name ?? "NewPage", path: `/PageMaster${id ? `?id=${id}` : ''}`}];
243
+ let pathArray = [{ label: config.name ?? "NewPage", path: `/PageMaster${id ? `?id=${id}` : ''}` }];
193
244
 
194
245
  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
- })
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
+ })
204
255
 
205
256
 
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
- }
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
+ }
214
265
 
215
266
  schema.properties.pageName.path = pathArray
216
267
  return schema;
@@ -226,13 +277,19 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
226
277
  }
227
278
  },
228
279
  editComponents: function () {
280
+
281
+ if (validateAndShowErrors(store)) return;
229
282
  const rowId = dynamicData.path.split(".")[1];
230
283
  const path = store.searchParams?.get("path");
231
284
  const id = store.searchParams?.get("id");
232
285
  saveFormdataInSessionStorage(store.ctx.core.data, path)
233
286
  if (path) {
234
- const path = store.searchParams?.get("path");
235
- 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
+ }
236
293
  store.searchParams.set("path", finalPath)
237
294
  store.setSearchParams(store.searchParams)
238
295
  this.setPage()
@@ -243,7 +300,12 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
243
300
  deleteComponents: function (shouldUpdateDialog: boolean = true) {
244
301
  const path = store.searchParams?.get("path");
245
302
  const rowId = sessionStorage.getItem('rowId');
246
- 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
+ }
247
309
  const response = saveFormdataInSessionStorage(store.ctx.core.data, path)
248
310
  const data = path ? _.get(response, path) : response;
249
311
  store.setFormdata(data);
@@ -251,6 +313,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
251
313
  store.updateDialog("popUpComponentSection");
252
314
  }
253
315
  sessionStorage.removeItem('rowId');
316
+ sessionStorage.removeItem('isTabLabelElements');
254
317
  },
255
318
  deleteEvent: function (shouldUpdateDialog: boolean = true) {
256
319
  const path = store.searchParams?.get("path");
@@ -264,18 +327,29 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
264
327
  sessionStorage.removeItem('rowId');
265
328
  },
266
329
  widgetAddClickHandler: function () {
330
+
331
+ if (validateAndShowErrors(store)) return;
267
332
  if (!Array.isArray(store.formData.elements)) {
268
333
  store.formData.elements = []
269
334
  }
335
+ if (!Array.isArray(store.formData.tabLabelElements)) {
336
+ store.formData.tabLabelElements = []
337
+ }
270
338
  const path = store.searchParams?.get("path");
271
339
  saveFormdataInSessionStorage(store.ctx.core.data, path)
272
- 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
+ }
273
346
  store.searchParams.set("path", finalPath)
274
347
  store.setSearchParams(store.searchParams)
275
348
  this.setPage()
276
349
 
277
350
  },
278
351
  eventEditHandler: function () {
352
+ if (validateAndShowErrors(store)) return;
279
353
  const rowId = dynamicData.path.split(".")[1];
280
354
  const path = store.searchParams?.get("path");
281
355
  const id = store.searchParams?.get("id");
@@ -284,6 +358,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
284
358
  store.navigate(`/ComponentEvents?path=${finalPath}&id=${id}`)
285
359
  },
286
360
  eventAddHandler: function () {
361
+ if (validateAndShowErrors(store)) return;
287
362
  const path = store.searchParams?.get("path");
288
363
  const id = store.searchParams?.get("id");
289
364
  if (!Array.isArray(store.formData.events)) {
@@ -299,6 +374,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
299
374
  deletePopUpComponent: function () {
300
375
  const rowId = dynamicData.path.split(".")[1];
301
376
  sessionStorage.setItem('rowId', rowId);
377
+ sessionStorage.setItem('isTabLabelElements', dynamicData.path.startsWith("tabLabel") ? "true" : "false");
302
378
  store.updateDialog("popUpComponentSection");
303
379
  },
304
380
  deletePopUpEvent: function () {
@@ -321,8 +397,8 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
321
397
  const copiedElementPath = this.elementPathHandler(parentPathOfCopiedComponent, rowId, elementType);
322
398
  const copiedFormData = getFormdataFromSessionStorage(copiedElementPath);
323
399
 
324
- this.ElementPathSetter(uiSchema,copiedFormData);
325
- sessionStorage.setItem('copiedConfig',JSON.stringify(copiedFormData));
400
+ this.ElementPathSetter(uiSchema, copiedFormData);
401
+ sessionStorage.setItem('copiedConfig', JSON.stringify(copiedFormData));
326
402
  store.setNotify({
327
403
  SuccessMessage: `${elementType} Copied Successfully`,
328
404
  Success: true,
@@ -345,9 +421,17 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
345
421
  if (!Array.isArray(store.formData.events)) {
346
422
  store.formData.events = []
347
423
  }
424
+ if (!Array.isArray(store.formData.tabLabelElements)) {
425
+ store.formData.tabLabelElements = []
426
+ }
348
427
  saveFormdataInSessionStorage(store.ctx.core.data, pastedElementParentPath);
349
428
  const formData = getFormdataFromSessionStorage(pastedElementParentPath);
350
- 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;
351
435
  const pastedElementPath = this.elementPathHandler(pastedElementParentPath, insertElementIndex, elementType);
352
436
 
353
437
  const copiedConfig = JSON.parse(sessionStorage.getItem("copiedConfig"));
@@ -361,7 +445,7 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
361
445
  Fail: true,
362
446
  });
363
447
  }
364
- else if(copiedConfig.name && elementType === "Events"){
448
+ else if (copiedConfig.name && elementType === "Events") {
365
449
  store.setNotify({
366
450
  FailMessage: notificationMessages.Component,
367
451
  Fail: true,
@@ -384,34 +468,37 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
384
468
  elementPathHandler: function (parentPath: string, rowId: any, elementType: string) {
385
469
  if (elementType === "Component") {
386
470
  return parentPath ? `${parentPath}.elements[${rowId}]` : `elements[${rowId}]`;
471
+ }
472
+ if(elementType === "TabsComponent"){
473
+ return `${parentPath}.tabLabelElements[${rowId}]`
387
474
  }
388
475
  return parentPath ? `${parentPath}.events[${rowId}]` : `events[${rowId}]`;
389
476
  },
390
477
  ElementPathSetter: function (uiSchema: any, copiedFormData?: any) {
391
478
  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}`;
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}`;
394
481
  }
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}`;
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}`;
397
484
  }
398
485
 
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}`;
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}`;
402
489
  }
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}`;
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}`;
405
492
  }
406
493
  },
407
494
 
408
-
409
- onNavigatePopupYes: function() {
410
- try{
495
+
496
+ onNavigatePopupYes: function () {
497
+ try {
411
498
  store.navigate(sessionStorage.getItem("pendingNavigatePath"))
412
499
  store.updateDialog(`pageNamepopup`)
413
500
  }
414
- catch(e){
501
+ catch (e) {
415
502
  store.updateDialog(`pageNamepopup`)
416
503
  store.setNotify({
417
504
  FailMessage: "Couldn't navigate page",
@@ -419,8 +506,8 @@ export default (store: any, dynamicData: any, submitHandler: any, service: any)
419
506
  })
420
507
  }
421
508
  },
422
- onNavigatePopupNo: function() {
423
- store.updateDialog(`pageNamepopup`)
509
+ onNavigatePopupNo: function () {
510
+ store.updateDialog(`pageNamepopup`)
424
511
  }
425
512
  }
426
513
  };
@@ -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);