impaktapps-ui-builder 1.0.174 → 1.0.181-test
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.
- package/dist/impaktapps-ui-builder.es.js +816 -84
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +10 -10
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildAreaGraph.d.ts +2 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildGroupButton.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildMetricCard.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildPdfViewer.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildPopover.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.d.ts +2 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/box.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.d.ts +22 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +50 -4
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/metricCard.d.ts +17 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.d.ts +19 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.d.ts +3 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/interface.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +4 -0
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildAreaGraph.ts +66 -0
- package/src/impaktapps-ui-builder/builder/build/buildArray.ts +10 -6
- package/src/impaktapps-ui-builder/builder/build/buildCamera.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +19 -7
- package/src/impaktapps-ui-builder/builder/build/buildDate.ts +26 -22
- package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +42 -49
- package/src/impaktapps-ui-builder/builder/build/buildGroupButton.ts +24 -0
- package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/buildImage.ts +6 -3
- package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/buildMetricCard.tsx +37 -0
- package/src/impaktapps-ui-builder/builder/build/buildMultiSelect.ts +3 -0
- package/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.ts +44 -0
- package/src/impaktapps-ui-builder/builder/build/buildPdfViewer.ts +16 -0
- package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/buildPop.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/buildPopover.ts +40 -0
- package/src/impaktapps-ui-builder/builder/build/buildSelect.ts +3 -0
- package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.ts +72 -0
- package/src/impaktapps-ui-builder/builder/build/buildTabSection.ts +2 -0
- package/src/impaktapps-ui-builder/builder/build/buildTable.ts +0 -3
- package/src/impaktapps-ui-builder/builder/build/buildText.ts +3 -0
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +33 -0
- package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +7 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/box.ts +2 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +172 -16
- package/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.ts +17 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +0 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +37 -4
- package/src/impaktapps-ui-builder/builder/build/uischema/metricCard.ts +13 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +2 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.ts +18 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +2 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +5 -6
- package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +3 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +80 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +17 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +3 -3
- package/src/impaktapps-ui-builder/builder/services/component.ts +143 -108
- package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +80 -0
- package/src/impaktapps-ui-builder/runtime/services/events.ts +6 -3
- package/src/impaktapps-ui-builder/runtime/services/interface.ts +1 -0
- 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"
|
|
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
|
-
|
|
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
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
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
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
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
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
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
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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
|
-
|
|
283
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
509
|
+
onNavigatePopupNo: function () {
|
|
510
|
+
store.updateDialog(`pageNamepopup`)
|
|
476
511
|
}
|
|
477
512
|
}
|
|
478
513
|
};
|
|
@@ -44,4 +44,84 @@ 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
|
+
let response: Response;
|
|
47
50
|
|
|
51
|
+
if (params.method === "GET") {
|
|
52
|
+
response = await params.fetchservice.getStream(
|
|
53
|
+
params.url,
|
|
54
|
+
params.config
|
|
55
|
+
);
|
|
56
|
+
} else if (params.method === "POST") {
|
|
57
|
+
response = await params.fetchservice.postStream(
|
|
58
|
+
params.url,
|
|
59
|
+
params.body,
|
|
60
|
+
params.config
|
|
61
|
+
);
|
|
62
|
+
} else {
|
|
63
|
+
throw new Error(
|
|
64
|
+
`Unsupported HTTP method: ${params.method}. Only GET and POST are supported.`
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (!response.ok) {
|
|
69
|
+
throw new Error("Download failed");
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Notify when download starts
|
|
73
|
+
params.store.setNotify({
|
|
74
|
+
SuccessMessage: "File Download Started Successfully",
|
|
75
|
+
Success: true,
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const fileName =
|
|
79
|
+
response.headers.get("filename") || "downloaded_file";
|
|
80
|
+
|
|
81
|
+
const extension = fileName.includes(".")
|
|
82
|
+
? fileName.substring(fileName.lastIndexOf("."))
|
|
83
|
+
: "";
|
|
84
|
+
|
|
85
|
+
const reader = response.body!.getReader();
|
|
86
|
+
|
|
87
|
+
//@ts-ignore
|
|
88
|
+
const fileHandle = await window.showSaveFilePicker({
|
|
89
|
+
suggestedName: fileName,
|
|
90
|
+
types: extension
|
|
91
|
+
? [
|
|
92
|
+
{
|
|
93
|
+
description: "File",
|
|
94
|
+
accept: {
|
|
95
|
+
"application/octet-stream": [extension],
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
]
|
|
99
|
+
: undefined,
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const writable = await fileHandle.createWritable();
|
|
103
|
+
|
|
104
|
+
while (true) {
|
|
105
|
+
const { done, value } = await reader.read();
|
|
106
|
+
|
|
107
|
+
if (done) break;
|
|
108
|
+
|
|
109
|
+
await writable.write(value);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
await writable.close();
|
|
113
|
+
|
|
114
|
+
// Notify when download completes
|
|
115
|
+
params.store.setNotify({
|
|
116
|
+
SuccessMessage: `File "${fileHandle.name}" downloaded successfully.`,
|
|
117
|
+
Success: true,
|
|
118
|
+
});
|
|
119
|
+
} catch (e) {
|
|
120
|
+
params.store.setNotify({
|
|
121
|
+
FailMessage: "File Download Failed",
|
|
122
|
+
Fail: true,
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
console.error(e);
|
|
126
|
+
}
|
|
127
|
+
};
|
|
@@ -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](
|
|
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
|
|