impaktapps-ui-builder 0.0.355 → 0.0.357
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 +32 -18
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +8 -8
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildStepper.ts +3 -4
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +2 -2
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +5 -0
- package/src/impaktapps-ui-builder/runtime/services/events.ts +16 -4
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ const Stepper =
|
|
|
15
15
|
label: ["First", "Second", "Third"],
|
|
16
16
|
stepsSkip: { 0: "false", 1: "false" },
|
|
17
17
|
resetButton: false,
|
|
18
|
-
resetText: "
|
|
18
|
+
resetText: "Reset",
|
|
19
19
|
orientation: "vertical"
|
|
20
20
|
},
|
|
21
21
|
},
|
|
@@ -26,10 +26,9 @@ const Stepper =
|
|
|
26
26
|
export const buildStepper = (config, componentScope) => {
|
|
27
27
|
const stepper: any = _.cloneDeep(Stepper);
|
|
28
28
|
stepper.scope = componentScope;
|
|
29
|
-
stepper.config.main.
|
|
30
|
-
stepper.config.main.resetButton = config.fullWidth === "YES" ? true : false;
|
|
29
|
+
stepper.config.main.resetButton = config.resetButton === "YES" ? true : false;
|
|
31
30
|
stepper.config.main.resetText = config.resetText || "ResetData";
|
|
32
|
-
stepper.config.main.completeText = config.completeText || "
|
|
31
|
+
stepper.config.main.completeText = config.completeText || "Complete Text";
|
|
33
32
|
stepper.config.main.orientation = config.orientation || "horizontal";
|
|
34
33
|
if (config.sectionLabels) {
|
|
35
34
|
stepper.config.main.label = config.sectionLabels.map((e, i: number) => {
|
|
@@ -162,7 +162,6 @@ export const buildPropertiesSection = function (type: String) {
|
|
|
162
162
|
switch (type) {
|
|
163
163
|
case "Stepper":
|
|
164
164
|
uiSchema.elements = [
|
|
165
|
-
getRadioInputField("complete", "Complete Needed", ["YES", "NO"]),
|
|
166
165
|
getRadioInputField("resetButton", "Reset Button", ["YES", "NO"]),
|
|
167
166
|
getInputField("resetText", "Reset Text"),
|
|
168
167
|
getInputField("completeText", "Complete Text"),
|
|
@@ -170,9 +169,10 @@ export const buildPropertiesSection = function (type: String) {
|
|
|
170
169
|
{ label: "Horizontal", value: "horizontal" },
|
|
171
170
|
{ label: "Vertical", value: "vertical" },
|
|
172
171
|
]),
|
|
172
|
+
EmptyBox,
|
|
173
173
|
getArrayControl("sectionLabels", "label"),
|
|
174
174
|
getArrayControl("skipAvailable", "skipId"),
|
|
175
|
-
|
|
175
|
+
|
|
176
176
|
]
|
|
177
177
|
break;
|
|
178
178
|
case "PopUp":
|
|
@@ -37,6 +37,11 @@ export const ComponentSchema: any = {
|
|
|
37
37
|
{ title: "Timer", const: "Timer" },
|
|
38
38
|
{ title: "Upload File", const: "UploadFile" },]
|
|
39
39
|
},
|
|
40
|
+
orientation:{
|
|
41
|
+
oneOf: [
|
|
42
|
+
{ title: "Horizontal", const: "horizontal" },
|
|
43
|
+
{ title: "Vertical", const: "vertical" },
|
|
44
|
+
]},
|
|
40
45
|
method: {
|
|
41
46
|
type: "string",
|
|
42
47
|
oneOf: [
|
|
@@ -44,7 +44,7 @@ async function executeEventsHandler(params: handlersProps) {
|
|
|
44
44
|
}
|
|
45
45
|
else if (params.config.Handler === "mergeFormdata") {
|
|
46
46
|
const result = await mergeFormdata(
|
|
47
|
-
params.parentEventOutput, params.componentName, params.config, params.store,params.service)
|
|
47
|
+
params.parentEventOutput, params.componentName, params.config, params.store, params.service)
|
|
48
48
|
return result;
|
|
49
49
|
}
|
|
50
50
|
}
|
|
@@ -87,7 +87,7 @@ async function executeCustomHandler(params: handlersProps) {
|
|
|
87
87
|
return response;
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
async function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any,service:any) {
|
|
90
|
+
async function mergeFormdata(handlerResponse: any, componentName: string, eventConfig: any, store: any, service: any) {
|
|
91
91
|
if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse?.data) && handlerResponse?.data)) {
|
|
92
92
|
store.setSchema((pre) => {
|
|
93
93
|
return {
|
|
@@ -123,7 +123,7 @@ async function mergeFormdata(handlerResponse: any, componentName: string, eventC
|
|
|
123
123
|
else {
|
|
124
124
|
if (handlerResponse) {
|
|
125
125
|
store.setFormdata((pre) => { return { ...pre, [componentName]: eventConfig.lazyLoading ? handlerResponse.data.data : handlerResponse.data } });
|
|
126
|
-
const demoData =
|
|
126
|
+
const demoData = await asyncOperation();
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
@@ -165,7 +165,7 @@ async function shouldEventExecute(params: handlersProps) {
|
|
|
165
165
|
if (startEvent?.length > 0) {
|
|
166
166
|
const response = await executeEventsHandler({ ...params, config: startEvent[0] });
|
|
167
167
|
return response;
|
|
168
|
-
}else{
|
|
168
|
+
} else {
|
|
169
169
|
return true
|
|
170
170
|
}
|
|
171
171
|
}
|
|
@@ -203,3 +203,15 @@ export function getRefreshElements(eventConfig: any, eventGropus: any) {
|
|
|
203
203
|
return result;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
+
|
|
207
|
+
function asyncOperation() {
|
|
208
|
+
return new Promise((resolve, reject) => {
|
|
209
|
+
setTimeout(() => {
|
|
210
|
+
const success = true;
|
|
211
|
+
if (success) {
|
|
212
|
+
resolve("Operation completed successfully!");
|
|
213
|
+
reject(new Error("Operation failed!"));
|
|
214
|
+
}
|
|
215
|
+
}, 50);
|
|
216
|
+
});
|
|
217
|
+
}
|