impaktapps-ui-builder 1.0.4 → 1.0.5
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 +2272 -1158
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +15 -15
- 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/buildArray.d.ts +1 -11
- package/dist/src/impaktapps-ui-builder/builder/build/buildCamera.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.d.ts +2 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildGroupButton.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildHorizontalLayout.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildImage.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/buildUiSchema.d.ts +2 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/apiSection.d.ts +1 -3
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/box.d.ts +10 -2
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/button.d.ts +6 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.d.ts +22 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +173 -171
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +82 -72
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +18 -50
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +50 -4
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/horizontalLayout.d.ts +13 -0
- 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/refresh.d.ts +0 -3
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/table.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +15 -66
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +48 -38
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/valueTab.d.ts +0 -3
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.d.ts +4 -1
- package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +2 -1
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +5 -2
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +10 -4
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildAadharCard.ts +2 -2
- package/src/impaktapps-ui-builder/builder/build/buildAreaGraph.ts +66 -0
- package/src/impaktapps-ui-builder/builder/build/buildArray.ts +35 -15
- package/src/impaktapps-ui-builder/builder/build/buildButton.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildCamera.ts +50 -0
- package/src/impaktapps-ui-builder/builder/build/buildCard.ts +10 -10
- package/src/impaktapps-ui-builder/builder/build/buildCheckbox.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +34 -16
- package/src/impaktapps-ui-builder/builder/build/buildDataGrid.ts +2 -2
- package/src/impaktapps-ui-builder/builder/build/buildDate.ts +35 -13
- package/src/impaktapps-ui-builder/builder/build/buildDownloadFile.ts +7 -0
- package/src/impaktapps-ui-builder/builder/build/buildEmptyBox.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +42 -28
- package/src/impaktapps-ui-builder/builder/build/buildGroupButton.ts +24 -0
- package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +10 -4
- package/src/impaktapps-ui-builder/builder/build/buildHorizontalLayout.ts +15 -0
- package/src/impaktapps-ui-builder/builder/build/buildImage.ts +38 -0
- package/src/impaktapps-ui-builder/builder/build/buildLabel.ts +3 -0
- package/src/impaktapps-ui-builder/builder/build/buildLeaderboard.ts +4 -1
- package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +10 -4
- package/src/impaktapps-ui-builder/builder/build/buildMetricCard.tsx +37 -0
- package/src/impaktapps-ui-builder/builder/build/buildMultiSelect.ts +12 -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 +7 -4
- package/src/impaktapps-ui-builder/builder/build/buildPop.ts +3 -2
- package/src/impaktapps-ui-builder/builder/build/buildPopover.ts +40 -0
- package/src/impaktapps-ui-builder/builder/build/buildProgressBar.ts +31 -21
- package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +11 -3
- package/src/impaktapps-ui-builder/builder/build/buildSelect.ts +12 -0
- package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +10 -4
- package/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.ts +72 -0
- package/src/impaktapps-ui-builder/builder/build/buildTabSection.ts +5 -0
- package/src/impaktapps-ui-builder/builder/build/buildTable.ts +21 -8
- package/src/impaktapps-ui-builder/builder/build/buildText.ts +15 -0
- package/src/impaktapps-ui-builder/builder/build/buildTextArea.ts +2 -2
- package/src/impaktapps-ui-builder/builder/build/buildThoughtOfTheDay.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildTreeMap.ts +2 -1
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +140 -130
- package/src/impaktapps-ui-builder/builder/build/buildUplaodFile.ts +6 -0
- package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +8 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/apiSection.ts +0 -6
- package/src/impaktapps-ui-builder/builder/build/uischema/array.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/box.ts +5 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +397 -141
- package/src/impaktapps-ui-builder/builder/build/uischema/button.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.ts +17 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +142 -169
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +127 -133
- package/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.ts +2 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/emptyBox.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +30 -54
- package/src/impaktapps-ui-builder/builder/build/uischema/file.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +37 -4
- package/src/impaktapps-ui-builder/builder/build/uischema/horizontalLayout.ts +11 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/metricCard.ts +13 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +4 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.ts +18 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/refresh.ts +0 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +3 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/table.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +34 -60
- package/src/impaktapps-ui-builder/builder/build/uischema/textInputField.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +58 -113
- package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +0 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +4 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +228 -59
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +121 -119
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +94 -106
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +11 -5
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +31 -55
- package/src/impaktapps-ui-builder/builder/services/component.ts +173 -86
- package/src/impaktapps-ui-builder/builder/services/event.ts +3 -0
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +18 -15
- package/src/impaktapps-ui-builder/builder/services/utils.ts +15 -3
- package/src/impaktapps-ui-builder/lib/index.ts +10 -9
- package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +33 -18
- package/src/impaktapps-ui-builder/runtime/services/events.ts +9 -11
- package/src/impaktapps-ui-builder/runtime/services/service.ts +121 -162
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _, { isEmpty } from "lodash";
|
|
2
|
-
import {
|
|
2
|
+
import { downloadFileFromUrl, downloadFile } from "./downloadFile";
|
|
3
3
|
import { executeEvents, executeRefreshHandler } from "./events";
|
|
4
4
|
import { handlersProps } from "./interface";
|
|
5
5
|
let compType: string;
|
|
@@ -19,7 +19,8 @@ interface funcParamsProps {
|
|
|
19
19
|
service: any,
|
|
20
20
|
userValue: any,
|
|
21
21
|
pageDataProvider: any,
|
|
22
|
-
functionsProvider?: Record<string, any
|
|
22
|
+
functionsProvider?: Record<string, any>,
|
|
23
|
+
initFormData?: any
|
|
23
24
|
}
|
|
24
25
|
let pageData: any = false;
|
|
25
26
|
export const extractEvents = (eventConfig: any) => {
|
|
@@ -61,17 +62,17 @@ export const extractEvents = (eventConfig: any) => {
|
|
|
61
62
|
return eventGroups;
|
|
62
63
|
};
|
|
63
64
|
export default (funcParams: funcParamsProps) => {
|
|
64
|
-
const formDataHolder = {}
|
|
65
|
+
const formDataHolder = {};
|
|
65
66
|
let executeEventsParameters: handlersProps = {
|
|
66
67
|
config: {}, componentName: "",
|
|
67
68
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
68
|
-
serviceHolder: { downloadFile, download:
|
|
69
|
+
serviceHolder: { downloadFile, download: downloadFileFromUrl, ...funcParams.functionsProvider }, eventGroups,
|
|
69
70
|
functionsProvider: funcParams.functionsProvider, formDataHolder
|
|
70
71
|
};
|
|
71
72
|
return {
|
|
72
73
|
setPage: async function () {
|
|
73
74
|
funcParams.store.setAdditionalErrors([]);
|
|
74
|
-
funcParams.store.setFormdata({});
|
|
75
|
+
funcParams.store.setFormdata(funcParams?.initFormData() || {});
|
|
75
76
|
funcParams.store.setSchema({ type: "object", properties: {} });
|
|
76
77
|
funcParams.store.newData = {};
|
|
77
78
|
eventGroups = {};
|
|
@@ -79,129 +80,19 @@ export default (funcParams: funcParamsProps) => {
|
|
|
79
80
|
const config = pageData?.config;
|
|
80
81
|
const uiSchema = pageData?.uiSchema;
|
|
81
82
|
const event = new CustomEvent('pageNameChanged', {
|
|
82
|
-
detail: { pageName: config.label }
|
|
83
|
+
detail: { pageName: config.label, pageIconUrl: config.pageIconUrl, hasBackIcon: config.hasBackIcon === "NO" ? false : true }
|
|
83
84
|
});
|
|
84
85
|
window.dispatchEvent(event)
|
|
85
86
|
const theme = funcParams?.store?.theme?.myTheme;
|
|
86
|
-
uiSchema.elements.push(
|
|
87
|
-
{
|
|
88
|
-
type: "HorizontalLayout",
|
|
89
|
-
config: {
|
|
90
|
-
main: {
|
|
91
|
-
direction: "row",
|
|
92
|
-
},
|
|
93
|
-
style: {
|
|
94
|
-
flexDirection: "row",
|
|
95
|
-
position: "absolute",
|
|
96
|
-
bottom: 0,
|
|
97
|
-
height: "fit-content",
|
|
98
|
-
overflow: "hidden",
|
|
99
|
-
zIndex: 1000,
|
|
100
|
-
width: "inherit",
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
elements: [
|
|
104
|
-
{
|
|
105
|
-
type: "Control",
|
|
106
|
-
scope: "#/properties/FooterText",
|
|
107
|
-
options: {
|
|
108
|
-
widget: "Box",
|
|
109
|
-
},
|
|
110
|
-
config: {
|
|
111
|
-
main: {
|
|
112
|
-
heading: "Copywriter@ACT21.IO",
|
|
113
|
-
},
|
|
114
|
-
style: {
|
|
115
|
-
color: theme?.palette?.text?.disabled || "#AFAFAF",
|
|
116
|
-
fontSize: "11px",
|
|
117
|
-
textAlign: "center",
|
|
118
|
-
lineHeight: 2,
|
|
119
|
-
width: "fit-content",
|
|
120
|
-
left: "50%",
|
|
121
|
-
position: "relative",
|
|
122
|
-
margin: 0,
|
|
123
|
-
flexGrow: 1,
|
|
124
|
-
height: 0,
|
|
125
|
-
transform: "translate(-50%, 0%)",
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
type: "Control",
|
|
131
|
-
scope: "#/properties/FooterBackIcon",
|
|
132
|
-
options: {
|
|
133
|
-
widget: "Box",
|
|
134
|
-
},
|
|
135
|
-
config: {
|
|
136
|
-
main: {
|
|
137
|
-
iconName: "PrevIcon",
|
|
138
|
-
onClick: "backHandler",
|
|
139
|
-
width: "fit-content",
|
|
140
|
-
},
|
|
141
|
-
style: {
|
|
142
|
-
fill: theme?.palette?.primary?.main,
|
|
143
|
-
width: 20,
|
|
144
|
-
height: 0,
|
|
145
|
-
top: 0,
|
|
146
|
-
right: { xs: "12px", sm: "84px" },
|
|
147
|
-
position: "absolute",
|
|
148
|
-
fontSize: "12px",
|
|
149
|
-
cursor: "pointer",
|
|
150
|
-
":hover": {
|
|
151
|
-
fill: theme?.palette?.primary?.dark,
|
|
152
|
-
},
|
|
153
|
-
marginRight: "20px",
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
type: "Control",
|
|
159
|
-
scope: "#/properties/FooterBackHandlerText",
|
|
160
|
-
options: {
|
|
161
|
-
widget: "Box",
|
|
162
|
-
},
|
|
163
|
-
config: {
|
|
164
|
-
main: {
|
|
165
|
-
heading: "Previous Page",
|
|
166
|
-
onClick: "backHandler",
|
|
167
|
-
},
|
|
168
|
-
style: {
|
|
169
|
-
display: { xs: "none", sm: "flex" },
|
|
170
|
-
textAlign: "left",
|
|
171
|
-
lineHeight: 1,
|
|
172
|
-
height: 0,
|
|
173
|
-
width: "fit-content",
|
|
174
|
-
color: theme?.palette?.primary?.main,
|
|
175
|
-
fontSize: "12px",
|
|
176
|
-
cursor: "pointer",
|
|
177
|
-
marginLeft: "2px",
|
|
178
|
-
|
|
179
|
-
top: 3,
|
|
180
|
-
right: "12px",
|
|
181
|
-
position: "absolute",
|
|
182
|
-
":hover": {
|
|
183
|
-
color: theme?.palette?.primary?.dark,
|
|
184
|
-
},
|
|
185
|
-
marginRight: "4px",
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
},
|
|
189
|
-
],
|
|
190
|
-
}
|
|
191
|
-
);
|
|
192
87
|
const schema = pageData?.schema ?? { type: "object", properties: {} };
|
|
193
88
|
eventGroups = extractEvents(config);
|
|
194
89
|
executeEventsParameters = {
|
|
195
90
|
config: {}, componentName: "",
|
|
196
91
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
197
92
|
functionsProvider: funcParams.functionsProvider,
|
|
198
|
-
serviceHolder: this, eventGroups, formDataHolder
|
|
93
|
+
serviceHolder: this, eventGroups, formDataHolder,
|
|
199
94
|
}
|
|
200
|
-
|
|
201
|
-
config: {}, componentName: "",
|
|
202
|
-
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
203
|
-
serviceHolder: this, eventGroups, formDataHolder: {}
|
|
204
|
-
})
|
|
95
|
+
|
|
205
96
|
funcParams.store.setSchema(
|
|
206
97
|
(pre: any) => {
|
|
207
98
|
return {
|
|
@@ -210,29 +101,66 @@ export default (funcParams: funcParamsProps) => {
|
|
|
210
101
|
}
|
|
211
102
|
}
|
|
212
103
|
)
|
|
213
|
-
|
|
214
|
-
|
|
104
|
+
|
|
105
|
+
executeRefreshHandler({
|
|
106
|
+
config: {}, componentName: "",
|
|
107
|
+
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
108
|
+
serviceHolder: this, eventGroups, formDataHolder: formDataHolder
|
|
109
|
+
}).then((e) => {
|
|
110
|
+
funcParams.store.setFormdata((pre) => ({ ...pre, ...formDataHolder }))
|
|
111
|
+
uiSchema.elements.push(notifyUiSchema);
|
|
112
|
+
funcParams.store.setUiSchema(uiSchema);
|
|
113
|
+
});
|
|
114
|
+
},
|
|
115
|
+
getStyle: () => {
|
|
116
|
+
const cloneEventGroup = _.cloneDeep(eventGroups)
|
|
117
|
+
if (cloneEventGroup.setStyle) {
|
|
118
|
+
let finalResponse = {};
|
|
119
|
+
const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData.path?.split(".").pop();
|
|
120
|
+
if (cloneEventGroup?.setStyle?.[path]) {
|
|
121
|
+
for (const eventConfig of cloneEventGroup?.setStyle?.[path]) {
|
|
122
|
+
finalResponse = executeEvents({
|
|
123
|
+
...executeEventsParameters,
|
|
124
|
+
config: eventConfig,
|
|
125
|
+
componentName: path
|
|
126
|
+
})
|
|
127
|
+
}
|
|
128
|
+
return finalResponse
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
return {}
|
|
215
132
|
},
|
|
216
133
|
onCellRenderer: (cellParams) => {
|
|
217
|
-
|
|
134
|
+
const cloneEventGroup = _.cloneDeep(eventGroups)
|
|
135
|
+
if (cloneEventGroup.onCellRenderer) {
|
|
218
136
|
let finalResponse = {};
|
|
219
137
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData?.path?.split(".")[0];
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
138
|
+
if (cloneEventGroup?.onCellRenderer?.[path]) {
|
|
139
|
+
for (const eventConfig of cloneEventGroup?.onCellRenderer?.[path]) {
|
|
140
|
+
executeEventsParameters.store.functionParameters = cellParams
|
|
141
|
+
finalResponse = executeEvents({
|
|
142
|
+
...executeEventsParameters,
|
|
143
|
+
config: eventConfig,
|
|
144
|
+
componentName: path
|
|
145
|
+
})
|
|
146
|
+
}
|
|
147
|
+
return finalResponse
|
|
228
148
|
}
|
|
229
|
-
return finalResponse
|
|
230
149
|
}
|
|
231
150
|
return {}
|
|
232
151
|
},
|
|
233
152
|
onClick: function () {
|
|
234
153
|
this.callHandler("onClick")
|
|
235
154
|
},
|
|
155
|
+
onKeyDown: function () {
|
|
156
|
+
this.callHandler("onKeyDown")
|
|
157
|
+
},
|
|
158
|
+
onFileDelete: async function () {
|
|
159
|
+
this.callHandler("onFileDelete")
|
|
160
|
+
},
|
|
161
|
+
onClose: function () {
|
|
162
|
+
this.callHandler("onClose")
|
|
163
|
+
},
|
|
236
164
|
onMount: function () {
|
|
237
165
|
this.callHandler("onMount")
|
|
238
166
|
},
|
|
@@ -261,7 +189,8 @@ export default (funcParams: funcParamsProps) => {
|
|
|
261
189
|
{ key: "pageIndex", value: paginationValues.pagination.pageIndex },
|
|
262
190
|
{ key: "sorting", value: paginationValues.sorting || [] },
|
|
263
191
|
{ key: "filters", value: paginationValues.tableColumnConfig || [] },
|
|
264
|
-
{ key: "globalFilter", value: paginationValues.globalFilter ?? '' }
|
|
192
|
+
{ key: "globalFilter", value: paginationValues.globalFilter ?? '' },
|
|
193
|
+
{ key: "expandedRowIds", value: paginationValues.expandedRowIds ?? [] }
|
|
265
194
|
]
|
|
266
195
|
const response = await this.callExecuteEvents(paginationValues, apiBody, "onLoad");
|
|
267
196
|
return response?.data;
|
|
@@ -276,29 +205,43 @@ export default (funcParams: funcParamsProps) => {
|
|
|
276
205
|
return response?.data;
|
|
277
206
|
}
|
|
278
207
|
},
|
|
279
|
-
onChange:
|
|
280
|
-
if (eventGroups.onChange)
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
208
|
+
onChange: function () {
|
|
209
|
+
if (!eventGroups.onChange) return;
|
|
210
|
+
|
|
211
|
+
const ChangeEventsKeysArray = Object.keys(eventGroups.onChange);
|
|
212
|
+
|
|
213
|
+
const promises = ChangeEventsKeysArray.flatMap((componentName: string) => {
|
|
214
|
+
if (
|
|
215
|
+
funcParams.store?.formData[componentName] === funcParams.store.newData[componentName]
|
|
216
|
+
) {
|
|
217
|
+
return [];
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return eventGroups.onChange[componentName].map(eventConfig =>
|
|
221
|
+
Promise.resolve(
|
|
222
|
+
executeEvents({
|
|
223
|
+
...executeEventsParameters,
|
|
224
|
+
config: eventConfig,
|
|
225
|
+
componentName,
|
|
226
|
+
formDataHolder
|
|
227
|
+
})
|
|
228
|
+
).then(() => {
|
|
229
|
+
if (!isEmpty(formDataHolder)) {
|
|
230
|
+
funcParams.store.setFormdata(pre => ({
|
|
231
|
+
...pre,
|
|
232
|
+
...formDataHolder
|
|
233
|
+
}));
|
|
293
234
|
}
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
}
|
|
235
|
+
})
|
|
236
|
+
);
|
|
237
|
+
});
|
|
238
|
+
|
|
239
|
+
Promise.allSettled(promises);
|
|
297
240
|
},
|
|
298
241
|
callExecuteEvents: async function (paramValue, apiBody, eventType: string) {
|
|
299
242
|
let LastCallResponse = undefined;
|
|
300
|
-
const
|
|
301
|
-
for (const eventConfig of
|
|
243
|
+
const cloneEventGroup = _.cloneDeep(eventGroups)
|
|
244
|
+
for (const eventConfig of cloneEventGroup?.[eventType]?.[paramValue.path]) {
|
|
302
245
|
if (eventConfig.body) {
|
|
303
246
|
eventConfig.body = [
|
|
304
247
|
...eventConfig.body,
|
|
@@ -319,40 +262,56 @@ export default (funcParams: funcParamsProps) => {
|
|
|
319
262
|
},
|
|
320
263
|
onBack: async function (functionParameters) {
|
|
321
264
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
322
|
-
|
|
265
|
+
this.callHandler("onBack", functionParameters)
|
|
323
266
|
if (eventGroups?.["onBack"]?.[path] === undefined) {
|
|
324
267
|
functionParameters?.handleBack()
|
|
325
268
|
}
|
|
326
269
|
},
|
|
327
270
|
onNext: async function (functionParameters) {
|
|
328
271
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
329
|
-
|
|
272
|
+
this.callHandler("onNext", functionParameters)
|
|
330
273
|
if (eventGroups?.["onNext"]?.[path] === undefined) {
|
|
331
274
|
functionParameters?.handleNext()
|
|
332
275
|
}
|
|
333
276
|
},
|
|
334
277
|
onReset: async function (functionParameters) {
|
|
335
278
|
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
336
|
-
|
|
279
|
+
this.callHandler("onReset", functionParameters)
|
|
337
280
|
if (eventGroups?.["onReset"]?.[path] === undefined) {
|
|
338
281
|
functionParameters?.handleReset()
|
|
339
282
|
}
|
|
340
283
|
},
|
|
341
|
-
callHandler:
|
|
342
|
-
const path =
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
284
|
+
callHandler: function (eventType: string, functionParameters?: any) {
|
|
285
|
+
const path =
|
|
286
|
+
funcParams.dynamicData?.tableButtonPath ||
|
|
287
|
+
funcParams.dynamicData.path.split(".").pop();
|
|
288
|
+
|
|
289
|
+
if (!eventGroups?.[eventType]?.[path]) return;
|
|
290
|
+
|
|
291
|
+
const promises = eventGroups[eventType][path].map(eventConfig => {
|
|
292
|
+
executeEventsParameters.store.functionParameters = functionParameters;
|
|
293
|
+
|
|
294
|
+
return Promise.resolve(
|
|
346
295
|
executeEvents({
|
|
347
296
|
...executeEventsParameters,
|
|
348
297
|
config: eventConfig,
|
|
349
|
-
componentName: path
|
|
298
|
+
componentName: path,
|
|
299
|
+
formDataHolder
|
|
350
300
|
})
|
|
351
|
-
|
|
352
|
-
|
|
301
|
+
).then(() => {
|
|
302
|
+
if (!isEmpty(formDataHolder)) {
|
|
303
|
+
funcParams.store.setFormdata(pre => ({
|
|
304
|
+
...pre,
|
|
305
|
+
...formDataHolder
|
|
306
|
+
}));
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
|
|
311
|
+
Promise.allSettled(promises);
|
|
353
312
|
},
|
|
354
313
|
downloadFile: downloadFile,
|
|
355
|
-
|
|
314
|
+
downloadFileFromUrl: downloadFileFromUrl,
|
|
356
315
|
...funcParams.functionsProvider
|
|
357
316
|
};
|
|
358
317
|
};
|