impaktapps-ui-builder 0.0.275 → 0.0.277
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 +2641 -2247
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +14 -14
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildButton.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildEmptyBox.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildLineGraph.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildRadio.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildSchema.d.ts +6 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +5 -4
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/apiSection.d.ts +3 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/button.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/cardSlider.d.ts +1 -6
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +6 -20
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.d.ts +8 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/speedoMeter.d.ts +9 -3
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +54 -0
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +2 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/events.d.ts +4 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildButton.ts +6 -1
- package/src/impaktapps-ui-builder/builder/build/buildCard.ts +14 -7
- package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +10 -0
- package/src/impaktapps-ui-builder/builder/build/buildEmptyBox.ts +11 -0
- package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +4 -2
- package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +28 -21
- package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +12 -16
- package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +35 -0
- package/src/impaktapps-ui-builder/builder/build/buildSchema.ts +32 -0
- package/src/impaktapps-ui-builder/builder/build/buildSpeedoMeter.ts +21 -8
- package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +2 -1
- package/src/impaktapps-ui-builder/builder/build/buildTimer.ts +2 -1
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +60 -44
- package/src/impaktapps-ui-builder/builder/build/uischema/apiSection.ts +2 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +79 -45
- package/src/impaktapps-ui-builder/builder/build/uischema/button.ts +2 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/cardSlider.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +11 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/leaderBoard.ts +4 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/speedoMeter.ts +5 -4
- package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +88 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +41 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +9 -2
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +1 -0
- package/src/impaktapps-ui-builder/builder/services/component.ts +27 -24
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +2 -0
- package/src/impaktapps-ui-builder/lib/index.ts +2 -0
- package/src/impaktapps-ui-builder/runtime/services/events.ts +37 -8
- package/src/impaktapps-ui-builder/runtime/services/service.ts +18 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildEmptyBox: (config: any, componentScope: any) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildLineGraph: (config: any, componentScope: any) => any;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildRadio: (config: any, componentScope: any) => any;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
declare
|
|
2
|
-
|
|
3
|
-
export declare const buildSchema: (config: any) => {
|
|
1
|
+
export declare let schema: {
|
|
2
|
+
type: string;
|
|
4
3
|
properties: {};
|
|
4
|
+
required: any[];
|
|
5
5
|
};
|
|
6
|
-
|
|
6
|
+
declare const buildUiSchema: (config: any) => any;
|
|
7
|
+
export default buildUiSchema;
|
|
@@ -29,6 +29,7 @@ export declare const APISection: {
|
|
|
29
29
|
scope: string;
|
|
30
30
|
options: {
|
|
31
31
|
widget: string;
|
|
32
|
+
elementLabelProp?: undefined;
|
|
32
33
|
detail?: undefined;
|
|
33
34
|
};
|
|
34
35
|
config: {
|
|
@@ -54,6 +55,7 @@ export declare const APISection: {
|
|
|
54
55
|
scope: string;
|
|
55
56
|
options: {
|
|
56
57
|
widget: string;
|
|
58
|
+
elementLabelProp?: undefined;
|
|
57
59
|
detail?: undefined;
|
|
58
60
|
};
|
|
59
61
|
config: {
|
|
@@ -76,6 +78,7 @@ export declare const APISection: {
|
|
|
76
78
|
scope: string;
|
|
77
79
|
layout: number;
|
|
78
80
|
options: {
|
|
81
|
+
elementLabelProp: string;
|
|
79
82
|
detail: {
|
|
80
83
|
type: string;
|
|
81
84
|
elements: {
|
|
@@ -5,6 +5,7 @@ export declare const CoreSection: {
|
|
|
5
5
|
scope: string;
|
|
6
6
|
options: {
|
|
7
7
|
widget: string;
|
|
8
|
+
elementLabelProp?: undefined;
|
|
8
9
|
detail?: undefined;
|
|
9
10
|
};
|
|
10
11
|
config: {
|
|
@@ -29,6 +30,7 @@ export declare const CoreSection: {
|
|
|
29
30
|
scope: string;
|
|
30
31
|
options: {
|
|
31
32
|
widget: string;
|
|
33
|
+
elementLabelProp?: undefined;
|
|
32
34
|
detail?: undefined;
|
|
33
35
|
};
|
|
34
36
|
config: {
|
|
@@ -59,6 +61,7 @@ export declare const CoreSection: {
|
|
|
59
61
|
};
|
|
60
62
|
options: {
|
|
61
63
|
widget: string;
|
|
64
|
+
elementLabelProp?: undefined;
|
|
62
65
|
detail?: undefined;
|
|
63
66
|
};
|
|
64
67
|
layout?: undefined;
|
|
@@ -67,9 +70,10 @@ export declare const CoreSection: {
|
|
|
67
70
|
scope: string;
|
|
68
71
|
layout: number;
|
|
69
72
|
options: {
|
|
73
|
+
elementLabelProp: string;
|
|
70
74
|
detail: {
|
|
71
75
|
type: string;
|
|
72
|
-
elements:
|
|
76
|
+
elements: {
|
|
73
77
|
type: string;
|
|
74
78
|
scope: string;
|
|
75
79
|
options: {
|
|
@@ -90,25 +94,7 @@ export declare const CoreSection: {
|
|
|
90
94
|
}[];
|
|
91
95
|
};
|
|
92
96
|
};
|
|
93
|
-
}
|
|
94
|
-
type: string;
|
|
95
|
-
scope: string;
|
|
96
|
-
options: {
|
|
97
|
-
widget: string;
|
|
98
|
-
};
|
|
99
|
-
config: {
|
|
100
|
-
layout: {
|
|
101
|
-
xs: number;
|
|
102
|
-
sm: number;
|
|
103
|
-
md: number;
|
|
104
|
-
lg: number;
|
|
105
|
-
};
|
|
106
|
-
main: {
|
|
107
|
-
label: string;
|
|
108
|
-
options?: undefined;
|
|
109
|
-
};
|
|
110
|
-
};
|
|
111
|
-
})[];
|
|
97
|
+
}[];
|
|
112
98
|
};
|
|
113
99
|
widget?: undefined;
|
|
114
100
|
};
|
|
@@ -7,10 +7,17 @@ declare const _default: {
|
|
|
7
7
|
label: string;
|
|
8
8
|
divider: boolean;
|
|
9
9
|
};
|
|
10
|
+
style: {
|
|
11
|
+
wrapperStyle: {
|
|
12
|
+
height: {
|
|
13
|
+
xs: number;
|
|
14
|
+
sm: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
};
|
|
10
18
|
wrapperStyle: {
|
|
11
19
|
position: string;
|
|
12
20
|
width: string;
|
|
13
|
-
height: number;
|
|
14
21
|
};
|
|
15
22
|
};
|
|
16
23
|
elements: ({
|
|
@@ -5,10 +5,17 @@ declare const _default: {
|
|
|
5
5
|
widget: string;
|
|
6
6
|
};
|
|
7
7
|
config: {
|
|
8
|
-
layout:
|
|
8
|
+
layout: {
|
|
9
|
+
xs: number;
|
|
10
|
+
sm: number;
|
|
11
|
+
md: number;
|
|
12
|
+
lg: number;
|
|
13
|
+
};
|
|
14
|
+
width: number;
|
|
15
|
+
segments: string;
|
|
9
16
|
main: {
|
|
10
17
|
currentValueText: string;
|
|
11
|
-
customSegmentLabels:
|
|
18
|
+
customSegmentLabels: any[];
|
|
12
19
|
data: {
|
|
13
20
|
maxValue: number;
|
|
14
21
|
value: number;
|
|
@@ -22,7 +29,6 @@ declare const _default: {
|
|
|
22
29
|
needleColor: string;
|
|
23
30
|
startColor: string;
|
|
24
31
|
textColor: string;
|
|
25
|
-
segments: number;
|
|
26
32
|
endColor: string;
|
|
27
33
|
containerStyle: {
|
|
28
34
|
background: string;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
export declare const ValidationSection: {
|
|
2
|
+
type: string;
|
|
3
|
+
elements: {
|
|
4
|
+
type: string;
|
|
5
|
+
scope: string;
|
|
6
|
+
layout: number;
|
|
7
|
+
options: {
|
|
8
|
+
elementLabelProp: string;
|
|
9
|
+
detail: {
|
|
10
|
+
type: string;
|
|
11
|
+
elements: ({
|
|
12
|
+
type: string;
|
|
13
|
+
scope: string;
|
|
14
|
+
options: {
|
|
15
|
+
widget: string;
|
|
16
|
+
};
|
|
17
|
+
config: {
|
|
18
|
+
layout: {
|
|
19
|
+
xs: number;
|
|
20
|
+
sm: number;
|
|
21
|
+
md: number;
|
|
22
|
+
lg: number;
|
|
23
|
+
};
|
|
24
|
+
main: {
|
|
25
|
+
label: string;
|
|
26
|
+
options: {
|
|
27
|
+
value: string;
|
|
28
|
+
label: string;
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
} | {
|
|
33
|
+
type: string;
|
|
34
|
+
scope: string;
|
|
35
|
+
options: {
|
|
36
|
+
widget: string;
|
|
37
|
+
};
|
|
38
|
+
config: {
|
|
39
|
+
layout: {
|
|
40
|
+
xs: number;
|
|
41
|
+
sm: number;
|
|
42
|
+
md: number;
|
|
43
|
+
lg: number;
|
|
44
|
+
};
|
|
45
|
+
main: {
|
|
46
|
+
label: string;
|
|
47
|
+
options?: undefined;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
})[];
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
}[];
|
|
54
|
+
};
|
|
@@ -2,6 +2,8 @@ export { default as pageMaster } from "../builder/services/pageMaster";
|
|
|
2
2
|
export { default as pageMasterEvents } from "../builder/services/event";
|
|
3
3
|
export { default as pageMasterComponents } from "../builder/services/component";
|
|
4
4
|
export { default as pageService } from "../runtime/services/service";
|
|
5
|
+
export { schema } from "../builder/build/buildUiSchema";
|
|
5
6
|
export { default as buildConfig } from "../builder/build/buildConfig";
|
|
6
7
|
export { default as buildUiSchema } from "../builder/build/buildUiSchema";
|
|
8
|
+
export { default as buildSchema } from "../builder/build/buildSchema";
|
|
7
9
|
export { default as clearPreviousCache } from "../builder/services/clearLocalStorage";
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
export declare const executeEvents: (config: any, componentName: string, store: any, dynamicData: any, userValue: any, service: any, serviceHolder: any, eventGroups?: any, parentEventOutput?: any) => Promise<
|
|
1
|
+
export declare const executeEvents: (config: any, componentName: string, store: any, dynamicData: any, userValue: any, service: any, serviceHolder: any, eventGroups?: any, parentEventOutput?: any) => Promise<{
|
|
2
|
+
response: any;
|
|
3
|
+
events: any;
|
|
4
|
+
}>;
|
|
2
5
|
export declare function buildApiPayload(compConfig: any, body: any, headers: any, store: any, dynamicData: any, userValue: any, service: any): Promise<{
|
|
3
6
|
body: any;
|
|
4
7
|
headers: any;
|
package/package.json
CHANGED
|
@@ -14,6 +14,9 @@ export const buildButton = (config:any,componentScope:string) =>{
|
|
|
14
14
|
if(config.layout){
|
|
15
15
|
button.config.layout = createLayoutFormat(config.layout)
|
|
16
16
|
}
|
|
17
|
+
if(config.defaultStyle){
|
|
18
|
+
button.config.main.styleDefault = config.defaultStyle==="true"?true:false;
|
|
19
|
+
}
|
|
17
20
|
button.scope = componentScope;
|
|
18
21
|
if (config.style) {
|
|
19
22
|
button.config.style = JSON.parse(config.style)
|
|
@@ -22,8 +25,10 @@ export const buildButton = (config:any,componentScope:string) =>{
|
|
|
22
25
|
button.config.main.size = config.size
|
|
23
26
|
}
|
|
24
27
|
if (config.color) {
|
|
25
|
-
button.config.main.
|
|
28
|
+
button.config.main.color = config.color
|
|
26
29
|
}
|
|
30
|
+
if(config.label){
|
|
27
31
|
button.config.main.name = config.label;
|
|
32
|
+
}
|
|
28
33
|
return button;
|
|
29
34
|
}
|
|
@@ -7,16 +7,23 @@ export const buildCard = (config,componentScope) =>{
|
|
|
7
7
|
if (config.style) {
|
|
8
8
|
card.config.style = JSON.parse(config.style)
|
|
9
9
|
}
|
|
10
|
-
card.elements[0].scope = `#/properties/${config.name
|
|
11
|
-
card.elements[1].scope = `#/properties/${config.name
|
|
12
|
-
card.elements[2].scope = `#/properties/${config.name
|
|
10
|
+
card.elements[0].scope = `#/properties/${config.name}/properties/value`
|
|
11
|
+
card.elements[1].scope = `#/properties/${config.name}/properties/url`
|
|
12
|
+
card.elements[2].scope = `#/properties/${config.name}/properties/description`
|
|
13
13
|
if(config.layout){
|
|
14
14
|
card.config.layout = createLayoutFormat(config.layout)
|
|
15
15
|
}
|
|
16
|
-
|
|
17
|
-
card.elements[0].config.main.heading = config.label;
|
|
18
|
-
|
|
19
|
-
|
|
16
|
+
// if(config.label){
|
|
17
|
+
// card.elements[0].config.main.heading = config.label;
|
|
18
|
+
// }
|
|
19
|
+
// if(config.url){
|
|
20
|
+
// card.elements[1].config.main.url = config.url;
|
|
21
|
+
// }
|
|
22
|
+
// if(config.description){
|
|
23
|
+
// card.elements[2].config.main.heading = config.description;
|
|
24
|
+
// }
|
|
25
|
+
|
|
26
|
+
|
|
20
27
|
|
|
21
28
|
return card;
|
|
22
29
|
}
|
|
@@ -7,6 +7,9 @@ export default (FormData: any) => {
|
|
|
7
7
|
// component.layout = createData(FormData?.layout, "layout");
|
|
8
8
|
// delete formData.layout
|
|
9
9
|
// }
|
|
10
|
+
// if(!formData.type ){
|
|
11
|
+
// component.type = "page";
|
|
12
|
+
// }
|
|
10
13
|
if(formData.pageName){
|
|
11
14
|
delete formData.pageName
|
|
12
15
|
}
|
|
@@ -37,3 +40,10 @@ export const createLayoutFormat = (config: any[]) => {
|
|
|
37
40
|
})
|
|
38
41
|
return data;
|
|
39
42
|
};
|
|
43
|
+
export const flatObjectValueInArray = (config:any[])=>{
|
|
44
|
+
const keyName = Object.keys(config[0])[0]
|
|
45
|
+
const data = config.map((e)=>{
|
|
46
|
+
return e[keyName]
|
|
47
|
+
})
|
|
48
|
+
return data;
|
|
49
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
3
|
+
import emptyBox from "./uischema/emptyBox";
|
|
4
|
+
|
|
5
|
+
export const buildEmptyBox = (config,componentScope) =>{
|
|
6
|
+
const EmptyBox: any = _.cloneDeep(emptyBox);
|
|
7
|
+
if (config.layout) {
|
|
8
|
+
EmptyBox.config.layout = createLayoutFormat(config.layout);
|
|
9
|
+
}
|
|
10
|
+
return EmptyBox;
|
|
11
|
+
}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
1
2
|
import { HorizontalBarGraph } from "./uischema/graph";
|
|
2
3
|
import _ from "lodash";
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
const buildHorizontalBarGraph = (config:any,componentScope:string) => {
|
|
6
7
|
const horizontalBarGraph: any = _.cloneDeep(HorizontalBarGraph);
|
|
8
|
+
horizontalBarGraph.scope = componentScope;
|
|
7
9
|
if (config.layout) {
|
|
8
|
-
horizontalBarGraph.config.layout = config.layout;
|
|
10
|
+
horizontalBarGraph.config.layout = createLayoutFormat(config.layout);
|
|
9
11
|
}
|
|
10
12
|
horizontalBarGraph.scope = componentScope;
|
|
11
13
|
horizontalBarGraph.config.main.header = config.heading;
|
|
@@ -17,7 +19,7 @@ const buildHorizontalBarGraph = (config:any,componentScope:string) => {
|
|
|
17
19
|
config.containerBackground;
|
|
18
20
|
}
|
|
19
21
|
if (config.height) {
|
|
20
|
-
horizontalBarGraph.config.containerStyle.height =
|
|
22
|
+
horizontalBarGraph.config.style.containerStyle.height =
|
|
21
23
|
config.height;
|
|
22
24
|
}
|
|
23
25
|
if (config.bottomLabel) {
|
|
@@ -1,25 +1,32 @@
|
|
|
1
|
+
import { createLayoutFormat, flatObjectValueInArray } from "./buildConfig";
|
|
1
2
|
import { LineGraph } from "./uischema/graph";
|
|
2
3
|
import _ from "lodash";
|
|
3
4
|
|
|
4
|
-
const buildLineGraph = (config,componentScope) =>{
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
lineGraph.
|
|
24
|
-
|
|
5
|
+
export const buildLineGraph = (config, componentScope) => {
|
|
6
|
+
const lineGraph: any = _.cloneDeep(LineGraph);
|
|
7
|
+
if (config.layout) {
|
|
8
|
+
lineGraph.config.layout = createLayoutFormat(config.layout);
|
|
9
|
+
}
|
|
10
|
+
lineGraph.config.main.header = config.heading;
|
|
11
|
+
if (config.height) {
|
|
12
|
+
lineGraph.config.style.containerStyle.height = config.height;
|
|
13
|
+
}
|
|
14
|
+
if (config.bottomLabel) {
|
|
15
|
+
lineGraph.config.main.bottomLabel = config.bottomLabel;
|
|
16
|
+
}
|
|
17
|
+
if (config.leftLabel) {
|
|
18
|
+
lineGraph.config.main.leftLabel = config.leftLabel;
|
|
19
|
+
}
|
|
20
|
+
if (config.legendHide) {
|
|
21
|
+
lineGraph.config.main.legendAvailabe = config.legendHide==="YES"?false:true;
|
|
22
|
+
}
|
|
23
|
+
if (config.legendLabels) {
|
|
24
|
+
lineGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (config.pieArcColors) {
|
|
28
|
+
lineGraph.config.style.lineStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
|
|
29
|
+
}
|
|
30
|
+
lineGraph.scope = componentScope;
|
|
31
|
+
return lineGraph;
|
|
25
32
|
}
|
|
@@ -1,31 +1,27 @@
|
|
|
1
|
+
import { createLayoutFormat, flatObjectValueInArray } from "./buildConfig";
|
|
1
2
|
import { PieGraph } from "./uischema/graph";
|
|
2
3
|
import _ from "lodash";
|
|
3
|
-
|
|
4
|
+
// flatObjectValueInArray
|
|
4
5
|
export const buildPieGraph = (config,componentScope) =>{
|
|
5
6
|
const pieGraph: any = _.cloneDeep(PieGraph);
|
|
6
7
|
if (config.layout) {
|
|
7
|
-
pieGraph.config.layout = config.layout;
|
|
8
|
-
}
|
|
9
|
-
if (config.containerBackground) {
|
|
10
|
-
pieGraph.config.style.containerStyle.background =
|
|
11
|
-
config.containerBackground;
|
|
8
|
+
pieGraph.config.layout = createLayoutFormat(config.layout);
|
|
12
9
|
}
|
|
13
10
|
if (config.height) {
|
|
14
11
|
pieGraph.config.style.containerStyle.height = config.height;
|
|
15
12
|
}
|
|
16
|
-
if (config.
|
|
17
|
-
pieGraph.config.main.legendAvailabe = config.
|
|
13
|
+
if (config.legendHide) {
|
|
14
|
+
pieGraph.config.main.legendAvailabe = config.legendHide==="YES"?false:true;
|
|
18
15
|
}
|
|
19
16
|
pieGraph.scope = componentScope;
|
|
20
17
|
pieGraph.config.main.header = config.heading;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
if(config.leftLabel){
|
|
25
|
-
pieGraph.config.main.leftLabel = config.leftLabel;
|
|
26
|
-
}
|
|
27
|
-
if(config.tooltipDataKey){
|
|
28
|
-
pieGraph.config.main.tooltipDataKey = config.tooltipDataKey;
|
|
18
|
+
|
|
19
|
+
if(config.legendLabels){
|
|
20
|
+
pieGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
|
|
29
21
|
}
|
|
22
|
+
|
|
23
|
+
if(config.pieArcColors){
|
|
24
|
+
pieGraph.config.style.pieStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
|
|
25
|
+
}
|
|
30
26
|
return pieGraph;
|
|
31
27
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
3
|
+
|
|
4
|
+
const RadioUiSchema = {
|
|
5
|
+
type: "Control",
|
|
6
|
+
scope: "#/properties/invoiceEnabled",
|
|
7
|
+
|
|
8
|
+
options: {
|
|
9
|
+
widget: "RadioInputField",
|
|
10
|
+
},
|
|
11
|
+
config: {
|
|
12
|
+
layout: { xs: 11, sm: 11, md: 5.5, lg: 5.5 },
|
|
13
|
+
main: {
|
|
14
|
+
label: "Enabled",
|
|
15
|
+
options: ["YES", "NO"],
|
|
16
|
+
errorMessage: "Enabled is not marked as YES or NO",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const buildRadio = (config,componentScope) => {
|
|
22
|
+
const Radio: any = _.cloneDeep(RadioUiSchema);
|
|
23
|
+
Radio.scope = componentScope;
|
|
24
|
+
Radio.config.main.heading = config.label
|
|
25
|
+
if(config.layout){
|
|
26
|
+
Radio.config.layout = createLayoutFormat(config.layout)
|
|
27
|
+
}
|
|
28
|
+
if (config.sectionLabels) {
|
|
29
|
+
Radio.config.main.options = config.sectionLabels.map(e => e.label||e.Options);
|
|
30
|
+
}
|
|
31
|
+
if (config.style) {
|
|
32
|
+
Radio.config.style = JSON.parse(config.style)
|
|
33
|
+
}
|
|
34
|
+
return Radio;
|
|
35
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
const schema = {
|
|
3
|
+
type: "object",
|
|
4
|
+
properties: {},
|
|
5
|
+
required: []
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export const buildSchema = (config: any) => {
|
|
9
|
+
function buildRule(configObj: any) {
|
|
10
|
+
if (configObj.validation) {
|
|
11
|
+
configObj.validation.forEach((rule: any) => {
|
|
12
|
+
if (!schema.properties[configObj.name]) {
|
|
13
|
+
schema.properties[configObj.name] = {};
|
|
14
|
+
}
|
|
15
|
+
if (rule.validationType === "required") {
|
|
16
|
+
schema.required.push(configObj.name)
|
|
17
|
+
} else {
|
|
18
|
+
schema.properties[configObj.name]["type"] = "string"
|
|
19
|
+
schema.properties[configObj.name][rule.validationType] =
|
|
20
|
+
isNaN(rule.validationValue) ?
|
|
21
|
+
rule.validationValue : Number(rule.validationValue)
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
buildRule(config)
|
|
28
|
+
console.log(schema)
|
|
29
|
+
window.localStorage.setItem("schemaDemo",JSON.stringify(schema))
|
|
30
|
+
return schema;
|
|
31
|
+
};
|
|
32
|
+
export default buildSchema;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
1
2
|
import SpeedoMeter from "./uischema/speedoMeter";
|
|
2
3
|
import _ from "lodash";
|
|
3
4
|
|
|
@@ -5,19 +6,31 @@ export const buildSpeedoMeter = (config:any,componentScope:string) => {
|
|
|
5
6
|
const speedoMeter: any = _.cloneDeep(SpeedoMeter);
|
|
6
7
|
speedoMeter.scope = componentScope;
|
|
7
8
|
if (config.layout) {
|
|
8
|
-
speedoMeter.config.layout = config.layout;
|
|
9
|
+
speedoMeter.config.layout = createLayoutFormat(config.layout);
|
|
9
10
|
}
|
|
10
11
|
if (config.heading) {
|
|
11
12
|
speedoMeter.config.main.header = config.heading;
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
if (config.segments) {
|
|
15
|
+
speedoMeter.config.main.segments = config.segments;
|
|
16
|
+
}
|
|
17
|
+
if (config.style) {
|
|
18
|
+
const styleObj = JSON.parse(config.style)
|
|
19
|
+
if(styleObj?.style){
|
|
20
|
+
speedoMeter.config.style = {...speedoMeter.config.style,...styleObj.style}
|
|
21
|
+
}
|
|
22
|
+
if(styleObj?.containerStyle){
|
|
23
|
+
speedoMeter.config.style.containerStyle = {...speedoMeter.config.style.containerStyle,...styleObj.containerStyle}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
}
|
|
27
|
+
if(config.width){
|
|
28
|
+
speedoMeter.config.main.width =
|
|
29
|
+
config.width;
|
|
30
|
+
}
|
|
31
|
+
if (config.speedoCaption) {
|
|
15
32
|
speedoMeter.config.main.currentValueText =
|
|
16
|
-
config.
|
|
17
|
-
}
|
|
18
|
-
if (config.customSegmentLabels) {
|
|
19
|
-
speedoMeter.config.main.customSegmentLabels =
|
|
20
|
-
config.customSegmentLabels;
|
|
33
|
+
config.speedoCaption;
|
|
21
34
|
}
|
|
22
35
|
if (config.data) {
|
|
23
36
|
speedoMeter.config.main.data = config.data;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
1
2
|
import { BarGraph } from "./uischema/graph";
|
|
2
3
|
import _ from "lodash";
|
|
3
4
|
|
|
4
5
|
export const buildStackbarGraph = (config:any,componentScope:string) => {
|
|
5
6
|
const barGraph: any = _.cloneDeep(BarGraph);
|
|
6
7
|
if (config.layout) {
|
|
7
|
-
barGraph.config.layout = config.layout;
|
|
8
|
+
barGraph.config.layout = createLayoutFormat(config.layout);
|
|
8
9
|
}
|
|
9
10
|
if (config.legendHide) {
|
|
10
11
|
barGraph.config.main.legendAvailable = false;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
1
2
|
import Timer from "./uischema/timer";
|
|
2
3
|
import _ from "lodash";
|
|
3
4
|
|
|
@@ -8,7 +9,7 @@ export const buildTimer = (config,componentScope)=>{
|
|
|
8
9
|
timer.config.main.label = config.label;
|
|
9
10
|
}
|
|
10
11
|
if (config.layout) {
|
|
11
|
-
timer.config.layout = config.layout;
|
|
12
|
+
timer.config.layout = createLayoutFormat(config.layout);
|
|
12
13
|
}
|
|
13
14
|
return timer;
|
|
14
15
|
}
|