impaktapps-ui-builder 0.0.274 → 0.0.276
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 +398 -121
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +16 -16
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.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 +0 -4
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/cardSlider.d.ts +1 -6
- 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 +31 -0
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -0
- package/package.json +1 -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/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 +34 -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 +44 -37
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +53 -45
- package/src/impaktapps-ui-builder/builder/build/uischema/cardSlider.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.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 +75 -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 +2 -1
- 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/getNavigationHistory.ts +6 -1
- package/src/impaktapps-ui-builder/lib/index.ts +1 -0
- package/src/impaktapps-ui-builder/runtime/services/events.ts +86 -4
- package/src/impaktapps-ui-builder/runtime/services/service.ts +1 -0
|
@@ -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;
|
|
@@ -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,31 @@
|
|
|
1
|
+
export declare const ValidationSection: {
|
|
2
|
+
type: string;
|
|
3
|
+
elements: {
|
|
4
|
+
type: string;
|
|
5
|
+
scope: string;
|
|
6
|
+
layout: number;
|
|
7
|
+
options: {
|
|
8
|
+
detail: {
|
|
9
|
+
type: string;
|
|
10
|
+
elements: {
|
|
11
|
+
type: string;
|
|
12
|
+
scope: string;
|
|
13
|
+
options: {
|
|
14
|
+
widget: string;
|
|
15
|
+
};
|
|
16
|
+
config: {
|
|
17
|
+
layout: {
|
|
18
|
+
xs: number;
|
|
19
|
+
sm: number;
|
|
20
|
+
md: number;
|
|
21
|
+
lg: number;
|
|
22
|
+
};
|
|
23
|
+
main: {
|
|
24
|
+
label: string;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
}[];
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
}[];
|
|
31
|
+
};
|
|
@@ -4,4 +4,5 @@ export { default as pageMasterComponents } from "../builder/services/component";
|
|
|
4
4
|
export { default as pageService } from "../runtime/services/service";
|
|
5
5
|
export { default as buildConfig } from "../builder/build/buildConfig";
|
|
6
6
|
export { default as buildUiSchema } from "../builder/build/buildUiSchema";
|
|
7
|
+
export { default as buildSchema } from "../builder/build/buildSchema";
|
|
7
8
|
export { default as clearPreviousCache } from "../builder/services/clearLocalStorage";
|
package/package.json
CHANGED
|
@@ -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
|
+
}
|
|
@@ -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 { 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 = 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,34 @@
|
|
|
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
|
+
buildRule(config)
|
|
27
|
+
if (config?.elements) {
|
|
28
|
+
config.elements.forEach(buildRule);
|
|
29
|
+
}
|
|
30
|
+
console.log(schema)
|
|
31
|
+
window.localStorage.setItem("schemaDemo",JSON.stringify(schema))
|
|
32
|
+
return schema;
|
|
33
|
+
};
|
|
34
|
+
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
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
2
|
import emptyBox from "./uischema/emptyBox";
|
|
3
|
-
import cardSlider from "./uischema/cardSlider";
|
|
3
|
+
import cardSlider from "./uischema/cardSlider";
|
|
4
4
|
import { buildLeaderBoard } from "./buildLeaderboard";
|
|
5
5
|
import { buildProgressBarCard } from "./buildProgressBarCard";
|
|
6
6
|
import { buildProgressBar } from "./buildProgressBar";
|
|
@@ -31,10 +31,12 @@ import { getTextArea } from "./uischema/buildPropertiesSection";
|
|
|
31
31
|
import { buildTextArea } from "./buildTextArea";
|
|
32
32
|
import { buildSlider } from "./buildSlider";
|
|
33
33
|
import { buildCheckbox } from "./buildCheckbox";
|
|
34
|
+
import { buildLineGraph } from "./buildLineGraph";
|
|
35
|
+
import { buildRadio } from "./buildRadio";
|
|
34
36
|
|
|
35
37
|
|
|
36
38
|
|
|
37
|
-
|
|
39
|
+
const buildUiSchema = (config: any) => {
|
|
38
40
|
let elements: any = {};
|
|
39
41
|
const componentScope = `#/properties/${config.name}`;
|
|
40
42
|
switch (config.type) {
|
|
@@ -50,15 +52,18 @@ import { buildCheckbox } from "./buildCheckbox";
|
|
|
50
52
|
case "Text":
|
|
51
53
|
elements = buildTextField(config, componentScope);
|
|
52
54
|
break;
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
case "TextArea":
|
|
56
|
+
elements = buildTextArea(config, componentScope)
|
|
57
|
+
break;
|
|
56
58
|
case "Date":
|
|
57
59
|
elements = buildDate(config, componentScope);
|
|
58
60
|
break;
|
|
59
61
|
case "Select":
|
|
60
62
|
elements = buildSelect(config, componentScope);
|
|
61
63
|
break;
|
|
64
|
+
case "Radio":
|
|
65
|
+
elements = buildRadio(config, componentScope);
|
|
66
|
+
break;
|
|
62
67
|
case "Button":
|
|
63
68
|
|
|
64
69
|
elements = buildButton(config, componentScope);
|
|
@@ -71,8 +76,8 @@ import { buildCheckbox } from "./buildCheckbox";
|
|
|
71
76
|
elements = buildLabel(config, componentScope);
|
|
72
77
|
break;
|
|
73
78
|
case "CheckBox":
|
|
74
|
-
|
|
75
|
-
|
|
79
|
+
elements = buildCheckbox(config, componentScope);
|
|
80
|
+
break;
|
|
76
81
|
case "UploadFile":
|
|
77
82
|
elements = buildUploadFile(config, componentScope);
|
|
78
83
|
break;
|
|
@@ -96,7 +101,7 @@ import { buildCheckbox } from "./buildCheckbox";
|
|
|
96
101
|
elements = buildStackbarGraph(config, componentScope);
|
|
97
102
|
break;
|
|
98
103
|
case "LineGraph":
|
|
99
|
-
elements =
|
|
104
|
+
elements = buildLineGraph(config, componentScope);
|
|
100
105
|
break;
|
|
101
106
|
case "PieGraph":
|
|
102
107
|
elements = buildPieGraph(config, componentScope);
|
|
@@ -122,7 +127,7 @@ import { buildCheckbox } from "./buildCheckbox";
|
|
|
122
127
|
elements = buildRollAndDice(config, componentScope);
|
|
123
128
|
break;
|
|
124
129
|
case "Slider":
|
|
125
|
-
elements = buildSlider(config,componentScope);
|
|
130
|
+
elements = buildSlider(config, componentScope);
|
|
126
131
|
break;
|
|
127
132
|
case "Timer":
|
|
128
133
|
elements = buildTimer(config, componentScope);
|
|
@@ -139,7 +144,7 @@ import { buildCheckbox } from "./buildCheckbox";
|
|
|
139
144
|
}
|
|
140
145
|
|
|
141
146
|
if (config?.elements) {
|
|
142
|
-
if(config?.type === "LeaderBoard"){
|
|
147
|
+
if (config?.type === "LeaderBoard") {
|
|
143
148
|
return elements;
|
|
144
149
|
}
|
|
145
150
|
else if (config.type == "Table") {
|
|
@@ -156,9 +161,9 @@ import { buildCheckbox } from "./buildCheckbox";
|
|
|
156
161
|
header: e.label || e.name
|
|
157
162
|
}
|
|
158
163
|
})
|
|
159
|
-
}
|
|
164
|
+
}
|
|
160
165
|
else {
|
|
161
|
-
elements.elements = config.elements.map((e:any, elemInd:number) => {
|
|
166
|
+
elements.elements = config.elements.map((e: any, elemInd: number) => {
|
|
162
167
|
return buildUiSchema(e)
|
|
163
168
|
});
|
|
164
169
|
}
|
|
@@ -169,31 +174,33 @@ import { buildCheckbox } from "./buildCheckbox";
|
|
|
169
174
|
|
|
170
175
|
export default buildUiSchema;
|
|
171
176
|
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
config.
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
}
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
// export const buildSchema = (config: any) => {
|
|
180
|
+
// const properties = buildProperties(config)
|
|
181
|
+
// return { properties }
|
|
182
|
+
// }
|
|
183
|
+
// export const buildProperties = (config: any) => {
|
|
184
|
+
// let properties = {}
|
|
185
|
+
// switch (config.type) {
|
|
186
|
+
// case "Array":
|
|
187
|
+
// properties[config.name] = buildArraySchema(config);
|
|
188
|
+
// if (config?.elements) {
|
|
189
|
+
// config.elements.map((e: any, elemInd: number) => {
|
|
190
|
+
// properties[config.name].items.properties[e.name] = buildProperties(e)
|
|
191
|
+
// });
|
|
192
|
+
// }
|
|
193
|
+
// break;
|
|
194
|
+
// default:
|
|
195
|
+
// properties = { "type": "string" }
|
|
196
|
+
// }
|
|
197
|
+
// if (config.elements && config.type !== "Array") {
|
|
198
|
+
// config.elements.map((e) => {
|
|
199
|
+
// properties = buildProperties(e)
|
|
200
|
+
// })
|
|
201
|
+
// }
|
|
202
|
+
// return properties
|
|
203
|
+
// }
|
|
197
204
|
|
|
198
205
|
|
|
199
206
|
|