impaktapps-ui-builder 0.0.351 → 0.0.353
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 +159 -34
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +5 -5
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildPop.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildStepper.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/buildFileInput.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildPop.ts +43 -0
- package/src/impaktapps-ui-builder/builder/build/buildStepper.ts +49 -0
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +8 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +23 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +14 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +7 -3
- package/src/impaktapps-ui-builder/builder/services/component.ts +2 -0
- package/src/impaktapps-ui-builder/runtime/services/service.ts +33 -32
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildPopUp: (config: any, componentScope: any) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildStepper: (config: any, componentScope: any) => any;
|
|
@@ -17,6 +17,10 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
17
17
|
getSelectOptions: (param: any) => Promise<any>;
|
|
18
18
|
onChange: () => Promise<void>;
|
|
19
19
|
updateConfigApiBody: (paramValue: any, apiBody: any) => Promise<any>;
|
|
20
|
+
StepperBackHandler: (param: any) => Promise<void>;
|
|
21
|
+
StepperSkipHandler: (param: any) => Promise<void>;
|
|
22
|
+
StepperNextHandler: (param: any) => Promise<void>;
|
|
23
|
+
callHandler: (eventType: string) => Promise<void>;
|
|
20
24
|
downloadFile: (obj: any) => void;
|
|
21
25
|
};
|
|
22
26
|
export default _default;
|
package/package.json
CHANGED
|
@@ -24,7 +24,7 @@ const FileInput = {
|
|
|
24
24
|
export const buildFileInput = (config,componentScope) => {
|
|
25
25
|
const box: any = _.cloneDeep(FileInput);
|
|
26
26
|
box.scope = componentScope;
|
|
27
|
-
box.config.main.
|
|
27
|
+
box.config.main.label = config.label
|
|
28
28
|
if(config.layout){
|
|
29
29
|
box.config.layout = createLayoutFormat(config.layout)
|
|
30
30
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
2
|
+
import WrapperSection from "./uischema/wrapperSection";
|
|
3
|
+
import _ from "lodash";
|
|
4
|
+
|
|
5
|
+
const PopUP = {
|
|
6
|
+
type: "Control",
|
|
7
|
+
scope: "#/properties/text",
|
|
8
|
+
options: {
|
|
9
|
+
widget: "PopUp",
|
|
10
|
+
},
|
|
11
|
+
config: {
|
|
12
|
+
layout: {
|
|
13
|
+
xs: 12,
|
|
14
|
+
sm: 12,
|
|
15
|
+
md: 12,
|
|
16
|
+
lg: 12,
|
|
17
|
+
},
|
|
18
|
+
main: {
|
|
19
|
+
label: "PopUp",
|
|
20
|
+
fullScreen:false,
|
|
21
|
+
fullWidth:false,
|
|
22
|
+
maxWidth:false,
|
|
23
|
+
alignItems:false,
|
|
24
|
+
spacing:2
|
|
25
|
+
},
|
|
26
|
+
style:{}
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
export const buildPopUp = (config,componentScope) =>{
|
|
30
|
+
const popup: any = _.cloneDeep(PopUP);
|
|
31
|
+
popup.scope = componentScope;
|
|
32
|
+
popup.config.main.label = config.label;
|
|
33
|
+
popup.config.main.fullScreen = config.fullScreen === "YES" ? true : false;
|
|
34
|
+
popup.config.main.fullWidth = config.fullWidth === "YES" ? true : false;
|
|
35
|
+
popup.config.main.maxWidth = config.maxWidth||false;
|
|
36
|
+
if (config.layout) {
|
|
37
|
+
popup.config.layout = createLayoutFormat(config.layout)
|
|
38
|
+
}
|
|
39
|
+
if (config.style) {
|
|
40
|
+
PopUP.config.style = JSON.parse(config.style)
|
|
41
|
+
}
|
|
42
|
+
return popup;
|
|
43
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
3
|
+
|
|
4
|
+
const Stepper =
|
|
5
|
+
|
|
6
|
+
{
|
|
7
|
+
type: "Control",
|
|
8
|
+
scope: "#/properties/Stepper",
|
|
9
|
+
options: {
|
|
10
|
+
widget: "Stepper",
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
config: {
|
|
14
|
+
main: {
|
|
15
|
+
label: ["First", "Second", "Third"],
|
|
16
|
+
stepsSkip: { 0: "false", 1: "false" },
|
|
17
|
+
resetButton: false,
|
|
18
|
+
resetText: "RESETdaad",
|
|
19
|
+
orientation: "vertical"
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
"elements":
|
|
23
|
+
[],
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const buildStepper = (config, componentScope) => {
|
|
27
|
+
const stepper: any = _.cloneDeep(Stepper);
|
|
28
|
+
stepper.scope = componentScope;
|
|
29
|
+
stepper.config.main.complete = config.fullScreen === "YES" ? true : false;
|
|
30
|
+
stepper.config.main.resetButton = config.fullWidth === "YES" ? true : false;
|
|
31
|
+
stepper.config.main.resetText = config.resetText || "ResetData";
|
|
32
|
+
stepper.config.main.completeText = config.completeText || "CompleteText";
|
|
33
|
+
stepper.config.main.orientation = config.orientation || "horizontal";
|
|
34
|
+
if (config.sectionLabels) {
|
|
35
|
+
stepper.config.main.tabLabels = config.sectionLabels.map((e,i:number) =>{
|
|
36
|
+
return {label:e.label,id:i}});
|
|
37
|
+
}
|
|
38
|
+
if (config.skipAvailable) {
|
|
39
|
+
stepper.config.main.tabLabels = config.skipAvailable.map((e,i:number) =>{
|
|
40
|
+
return {[e.skipId]:true}});
|
|
41
|
+
}
|
|
42
|
+
if (config.layout) {
|
|
43
|
+
stepper.config.layout = createLayoutFormat(config.layout)
|
|
44
|
+
}
|
|
45
|
+
if (config.style) {
|
|
46
|
+
stepper.config.style = JSON.parse(config.style)
|
|
47
|
+
}
|
|
48
|
+
return stepper;
|
|
49
|
+
}
|
|
@@ -34,6 +34,8 @@ import { buildEmptyBox } from "./buildEmptyBox";
|
|
|
34
34
|
import { buildArray } from "./buildArray";
|
|
35
35
|
import { buildAdhaarField, buildPanField } from "./buildAadharCard";
|
|
36
36
|
import { buildFileInput } from "./buildFileInput";
|
|
37
|
+
import { buildStepper } from "./buildStepper";
|
|
38
|
+
import { buildPopUp } from "./buildPop";
|
|
37
39
|
export let schema = {
|
|
38
40
|
type: "object",
|
|
39
41
|
properties: {},
|
|
@@ -164,6 +166,12 @@ const buildUiSchema = (config: any) => {
|
|
|
164
166
|
let elements: any = {};
|
|
165
167
|
const componentScope = `#/properties/${config.name}`;
|
|
166
168
|
switch (config.type) {
|
|
169
|
+
case "Stepper":
|
|
170
|
+
elements = buildStepper(config, componentScope);
|
|
171
|
+
break;
|
|
172
|
+
case "PopUp":
|
|
173
|
+
elements = buildPopUp(config, componentScope);
|
|
174
|
+
break;
|
|
167
175
|
case "FileInput":
|
|
168
176
|
elements = buildFileInput(config, componentScope);
|
|
169
177
|
break;
|
|
@@ -160,6 +160,29 @@ const GraphSection = {
|
|
|
160
160
|
export const buildPropertiesSection = function (type: String) {
|
|
161
161
|
let uiSchema = _.cloneDeep(GraphSection);
|
|
162
162
|
switch (type) {
|
|
163
|
+
case "Stepper":
|
|
164
|
+
uiSchema.elements = [
|
|
165
|
+
getRadioInputField("complete", "Complete Needed", ["YES", "NO"]),
|
|
166
|
+
getRadioInputField("resetButton", "Reset Button", ["YES", "NO"]),
|
|
167
|
+
getInputField("resetText", "Reset Text"),
|
|
168
|
+
getInputField("completeText", "Complete Text"),
|
|
169
|
+
getSelectField("orientation", "Orientation Type", [
|
|
170
|
+
{ label: "Horizontal", value: "horizontal" },
|
|
171
|
+
{ label: "Vertical", value: "vertical" },
|
|
172
|
+
]),
|
|
173
|
+
getArrayControl("sectionLabels", "label"),
|
|
174
|
+
getArrayControl("skipAvailable", "skipId"),
|
|
175
|
+
EmptyBox
|
|
176
|
+
]
|
|
177
|
+
break;
|
|
178
|
+
case "PopUp":
|
|
179
|
+
uiSchema.elements = [
|
|
180
|
+
getRadioInputField("fullScreen", "FullScreen", ["YES", "NO"]),
|
|
181
|
+
getRadioInputField("fullWidth", "FullWidth", ["YES", "NO"]),
|
|
182
|
+
getInputField("maxWidth", "Max. Width"),
|
|
183
|
+
EmptyBox
|
|
184
|
+
]
|
|
185
|
+
break;
|
|
163
186
|
case "Text":
|
|
164
187
|
uiSchema.elements = [
|
|
165
188
|
getInputField("placeholder", "Placeholder"),
|
|
@@ -19,11 +19,13 @@ export const ComponentSchema: any = {
|
|
|
19
19
|
{ title: "LeaderBoard", const: "LeaderBoard" },
|
|
20
20
|
{ title: "MultipleSelect", const: "MultipleSelect" },
|
|
21
21
|
{ title: "PanCardText", const: "PanCardText" },
|
|
22
|
+
{ title: "Popup Container", const: "PopUp" },
|
|
22
23
|
{ title: "ProgressBar", const: "ProgressBar" },
|
|
23
24
|
{ title: "ProgressBar Card", const: "ProgressBarCard" },
|
|
24
25
|
{ title: "Select", const: "Select" },
|
|
25
26
|
{ title: "Slider", const: "Slider" },
|
|
26
27
|
{ title: "SpeedoMeter", const: "SpeedoMeter" },
|
|
28
|
+
{ title: "Stepper Container", const: "Stepper" },
|
|
27
29
|
{ title: "Radio", const: "Radio" },
|
|
28
30
|
{ title: "Rank", const: "Rank" },
|
|
29
31
|
{ title: "Rank Card", const: "RankCard" },
|
|
@@ -122,6 +124,18 @@ export const ComponentSchema: any = {
|
|
|
122
124
|
},
|
|
123
125
|
},
|
|
124
126
|
},
|
|
127
|
+
skipAvailable: {
|
|
128
|
+
type: "array",
|
|
129
|
+
items: {
|
|
130
|
+
type: "object",
|
|
131
|
+
properties: {
|
|
132
|
+
skipId: {
|
|
133
|
+
type: "string",
|
|
134
|
+
},
|
|
135
|
+
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
},
|
|
125
139
|
Table_Download_Keys_Name: {
|
|
126
140
|
type: "array",
|
|
127
141
|
items: {
|
|
@@ -39,12 +39,16 @@ export const EventSchema = {
|
|
|
39
39
|
type: "string",
|
|
40
40
|
oneOf: [
|
|
41
41
|
{ title: "Click Event", const: "onClick" },
|
|
42
|
-
{ title: "onStart", const: "onStart" },
|
|
43
42
|
{ title: "Load Event", const: "onLoad" },
|
|
44
|
-
{ title: "File Upload Event", const: "onUpload" },
|
|
45
|
-
{ title: "File Download Event", const: "onDownload" },
|
|
46
43
|
{ title: "Change Event", const: "onChange" },
|
|
47
44
|
{ title: "Success", const: "Success" },
|
|
45
|
+
{ title: "onStart", const: "onStart" },
|
|
46
|
+
|
|
47
|
+
{ title: "File Upload Event", const: "onUpload" },
|
|
48
|
+
{ title: "Stepper Back Event", const: "onStepperBack" },
|
|
49
|
+
{ title: "Stepper Next Event", const: "onStepperNext" },
|
|
50
|
+
{ title: "Stepper Skip Event", const: "onStepperSkip" },
|
|
51
|
+
{ title: "File Download Event", const: "onDownload" },
|
|
48
52
|
{ title: "Fail", const: "Fail" }
|
|
49
53
|
]
|
|
50
54
|
},
|
|
@@ -33,6 +33,8 @@ const sectionLabels = {
|
|
|
33
33
|
Radio:["Core", "Properties", "style", "Event","Validation"],
|
|
34
34
|
Text:["Core","Properties","style", "Event","Validation"],
|
|
35
35
|
TextArea:["Core","Properties","style", "Event","Validation"],
|
|
36
|
+
PopUp: ["Core", "Components","Properties", "style"],
|
|
37
|
+
Stepper: ["Core", "Components","Properties","Event", "style"],
|
|
36
38
|
}
|
|
37
39
|
|
|
38
40
|
|
|
@@ -30,7 +30,7 @@ export const extractEvents = (eventConfig: any) => {
|
|
|
30
30
|
return elem.eventType === "Success"
|
|
31
31
|
})
|
|
32
32
|
if (!(!!SuccessEvent) && event.eventType === "onLoad") {
|
|
33
|
-
event.events.push({ Handler: "mergeFormdata", eventType: "Success", type: compType,lazyLoading:eventConfig.lazyLoading==="YES"?true:false })
|
|
33
|
+
event.events.push({ Handler: "mergeFormdata", eventType: "Success", type: compType, lazyLoading: eventConfig.lazyLoading === "YES" ? true : false })
|
|
34
34
|
}
|
|
35
35
|
eventGroups[event.eventType][eventConfigObj.name].push({ ...event, type: compType })
|
|
36
36
|
});
|
|
@@ -59,7 +59,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
59
59
|
let executeEventsParameters: handlersProps = {
|
|
60
60
|
config: {}, componentName: "",
|
|
61
61
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
62
|
-
serviceHolder: {downloadFile}, eventGroups
|
|
62
|
+
serviceHolder: { downloadFile }, eventGroups
|
|
63
63
|
};
|
|
64
64
|
return {
|
|
65
65
|
setPage: async function () {
|
|
@@ -76,54 +76,33 @@ export default (funcParams: funcParamsProps) => {
|
|
|
76
76
|
{ ...funcParams.schema.properties, ...pre.properties, }
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
|
-
|
|
79
|
+
)
|
|
80
80
|
funcParams.uiSchema.elements.push(notifyUiSchema);
|
|
81
81
|
funcParams.store.setUiSchema(funcParams.uiSchema);
|
|
82
|
-
await executeRefreshHandler(
|
|
82
|
+
await executeRefreshHandler({
|
|
83
83
|
config: {}, componentName: "",
|
|
84
84
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
85
85
|
serviceHolder: this, eventGroups
|
|
86
86
|
})
|
|
87
87
|
},
|
|
88
88
|
onClick: async function () {
|
|
89
|
-
|
|
90
|
-
for (const eventConfig of eventGroups?.onClick[path]) {
|
|
91
|
-
await executeEvents({
|
|
92
|
-
...executeEventsParameters,
|
|
93
|
-
config: eventConfig,
|
|
94
|
-
componentName: path
|
|
95
|
-
})
|
|
96
|
-
}
|
|
89
|
+
await this.callHandler("onClick")
|
|
97
90
|
},
|
|
98
|
-
onFileDownload:async ()
|
|
99
|
-
|
|
100
|
-
for (const eventConfig of eventGroups?.onDownload[path]) {
|
|
101
|
-
await executeEvents({
|
|
102
|
-
...executeEventsParameters,
|
|
103
|
-
config: eventConfig,
|
|
104
|
-
componentName: path
|
|
105
|
-
})
|
|
106
|
-
}
|
|
91
|
+
onFileDownload: async function () {
|
|
92
|
+
await this.callHandler("onDownload")
|
|
107
93
|
},
|
|
108
|
-
onFileUpload:async ()
|
|
109
|
-
|
|
110
|
-
for (const eventConfig of eventGroups?.onUpload[path]) {
|
|
111
|
-
await executeEvents({
|
|
112
|
-
...executeEventsParameters,
|
|
113
|
-
config: eventConfig,
|
|
114
|
-
componentName: path
|
|
115
|
-
})
|
|
116
|
-
}
|
|
94
|
+
onFileUpload: async function () {
|
|
95
|
+
await this.callHandler("onUpload")
|
|
117
96
|
},
|
|
118
97
|
onPaginationChange: async function (paginationValues) {
|
|
119
98
|
const apiBody = [
|
|
120
99
|
{ key: "size", value: paginationValues.pagination.pageSize },
|
|
121
|
-
{ key: "pageIndex", value: paginationValues.pagination.pageIndex
|
|
100
|
+
{ key: "pageIndex", value: paginationValues.pagination.pageIndex },
|
|
122
101
|
{ key: "sorting", value: paginationValues.sorting || [] },
|
|
123
102
|
{ key: "filters", value: paginationValues.columnFilters || [] },
|
|
124
103
|
{ key: "globalFilter", value: paginationValues.globalFilter ?? '' }
|
|
125
104
|
]
|
|
126
|
-
const response =
|
|
105
|
+
const response = await this.updateConfigApiBody(paginationValues, apiBody);
|
|
127
106
|
return response?.data;
|
|
128
107
|
},
|
|
129
108
|
getSelectOptions: async function (param) {
|
|
@@ -175,6 +154,28 @@ export default (funcParams: funcParamsProps) => {
|
|
|
175
154
|
}
|
|
176
155
|
return LastCallResponse
|
|
177
156
|
},
|
|
157
|
+
StepperBackHandler: async function (param) {
|
|
158
|
+
await this.callHandler("onStepperBack")
|
|
159
|
+
param.handleBack()
|
|
160
|
+
},
|
|
161
|
+
StepperSkipHandler: async function (param) {
|
|
162
|
+
await this.callHandler("onStepperSkip")
|
|
163
|
+
param.handleSkip()
|
|
164
|
+
},
|
|
165
|
+
StepperNextHandler: async function (param) {
|
|
166
|
+
await this.callHandler("onStepperNext")
|
|
167
|
+
param.handleNext()
|
|
168
|
+
},
|
|
169
|
+
callHandler: async function (eventType: string) {
|
|
170
|
+
const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
|
|
171
|
+
for (const eventConfig of eventGroups?.[eventType]?.[path]) {
|
|
172
|
+
await executeEvents({
|
|
173
|
+
...executeEventsParameters,
|
|
174
|
+
config: eventConfig,
|
|
175
|
+
componentName: path
|
|
176
|
+
})
|
|
177
|
+
}
|
|
178
|
+
},
|
|
178
179
|
downloadFile: downloadFile
|
|
179
180
|
};
|
|
180
181
|
};
|