impaktapps-ui-builder 0.0.405 → 0.0.407
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 +14 -2
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +1 -1
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildDate.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.d.ts +19 -0
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +11 -8
- package/src/impaktapps-ui-builder/builder/build/buildDate.ts +11 -1
- package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +22 -23
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +3 -0
- package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +3 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.ts +20 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +1 -0
|
@@ -18,3 +18,22 @@ declare const _default: {
|
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
20
|
export default _default;
|
|
21
|
+
export declare const DateTime: {
|
|
22
|
+
type: string;
|
|
23
|
+
scope: string;
|
|
24
|
+
options: {
|
|
25
|
+
widget: string;
|
|
26
|
+
};
|
|
27
|
+
config: {
|
|
28
|
+
layout: {
|
|
29
|
+
xs: number;
|
|
30
|
+
sm: number;
|
|
31
|
+
md: number;
|
|
32
|
+
lg: number;
|
|
33
|
+
};
|
|
34
|
+
main: {
|
|
35
|
+
label: string;
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
};
|
package/package.json
CHANGED
|
@@ -10,10 +10,10 @@ export default (FormData: any) => {
|
|
|
10
10
|
// if(!formData.type ){
|
|
11
11
|
// component.type = "page";
|
|
12
12
|
// }
|
|
13
|
-
if(formData.pageName){
|
|
13
|
+
if (formData.pageName) {
|
|
14
14
|
delete formData.pageName
|
|
15
15
|
}
|
|
16
|
-
if(formData.eventsSelected){
|
|
16
|
+
if (formData.eventsSelected) {
|
|
17
17
|
delete formData.eventsSelected
|
|
18
18
|
}
|
|
19
19
|
if (formData.type === "Table" ||
|
|
@@ -25,7 +25,7 @@ export default (FormData: any) => {
|
|
|
25
25
|
delete formData.elements
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
-
component.events = formData.events||[];
|
|
28
|
+
component.events = formData.events || [];
|
|
29
29
|
if (formData.events) {
|
|
30
30
|
delete formData.events
|
|
31
31
|
}
|
|
@@ -34,7 +34,7 @@ export default (FormData: any) => {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
export const createLayoutFormat = (config: any[]) => {
|
|
37
|
-
if(_.isEmpty(config)){
|
|
37
|
+
if (_.isEmpty(config)) {
|
|
38
38
|
return {
|
|
39
39
|
xs: 11,
|
|
40
40
|
sm: 11,
|
|
@@ -43,14 +43,17 @@ export const createLayoutFormat = (config: any[]) => {
|
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
let data: any = {};
|
|
46
|
-
config.map((e:any)=>{
|
|
47
|
-
data[e.key||"xs"] = +e.value||5.5
|
|
46
|
+
config.map((e: any) => {
|
|
47
|
+
data[e.key || "xs"] = +e.value || 5.5
|
|
48
48
|
})
|
|
49
49
|
return data;
|
|
50
50
|
};
|
|
51
|
-
export const flatObjectValueInArray = (config:any[])=>{
|
|
51
|
+
export const flatObjectValueInArray = (config: any[]) => {
|
|
52
|
+
if (config[0].length < 1) {
|
|
53
|
+
return
|
|
54
|
+
}
|
|
52
55
|
const keyName = Object.keys(config[0])[0]
|
|
53
|
-
const data = config.map((e)=>{
|
|
56
|
+
const data = config.map((e) => {
|
|
54
57
|
return e[keyName]
|
|
55
58
|
})
|
|
56
59
|
return data;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import DateInputField from "./uischema/dateInputField";
|
|
1
|
+
import DateInputField, { DateTime } from "./uischema/dateInputField";
|
|
2
2
|
import _ from "lodash";
|
|
3
3
|
import { createLayoutFormat } from "./buildConfig";
|
|
4
4
|
|
|
@@ -11,4 +11,14 @@ export const buildDate = (config:any,componentScope:string)=>{
|
|
|
11
11
|
dateInputField.config.layout = createLayoutFormat(config.layout)
|
|
12
12
|
}
|
|
13
13
|
return dateInputField;
|
|
14
|
+
}
|
|
15
|
+
export const buildDateTime = (config:any,componentScope:string)=>{
|
|
16
|
+
const dateTimeInputField: any = _.cloneDeep(DateTime);
|
|
17
|
+
dateTimeInputField.config.main.label = config.label;
|
|
18
|
+
dateTimeInputField.config.main.errorMessage = `${config.name} is empty or invalid`;
|
|
19
|
+
dateTimeInputField.scope = componentScope;
|
|
20
|
+
if(config.layout){
|
|
21
|
+
dateTimeInputField.config.layout = createLayoutFormat(config.layout)
|
|
22
|
+
}
|
|
23
|
+
return dateTimeInputField;
|
|
14
24
|
}
|
|
@@ -1,27 +1,26 @@
|
|
|
1
1
|
import { createLayoutFormat, flatObjectValueInArray } from "./buildConfig";
|
|
2
2
|
import { PieGraph } from "./uischema/graph";
|
|
3
3
|
import _ from "lodash";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
return pieGraph;
|
|
4
|
+
export const buildPieGraph = (config, componentScope) => {
|
|
5
|
+
const pieGraph: any = _.cloneDeep(PieGraph);
|
|
6
|
+
if (config.layout) {
|
|
7
|
+
pieGraph.config.layout = createLayoutFormat(config.layout);
|
|
8
|
+
}
|
|
9
|
+
if (config.height) {
|
|
10
|
+
pieGraph.config.style.containerStyle.height = config.height;
|
|
11
|
+
}
|
|
12
|
+
if (config.legendHide) {
|
|
13
|
+
pieGraph.config.main.legendAvailabe = config.legendHide === "YES" ? false : true;
|
|
14
|
+
}
|
|
15
|
+
pieGraph.scope = componentScope;
|
|
16
|
+
pieGraph.config.main.header = config.heading;
|
|
17
|
+
|
|
18
|
+
if (config.legendLabels) {
|
|
19
|
+
pieGraph.config.main.tooltipDataKey = flatObjectValueInArray(config.legendLabels);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (config.pieArcColors) {
|
|
23
|
+
pieGraph.config.style.pieStyle.colorRange = flatObjectValueInArray(config.pieArcColors);
|
|
24
|
+
}
|
|
25
|
+
return pieGraph;
|
|
27
26
|
}
|
|
@@ -168,6 +168,9 @@ const buildUiSchema = (config: any) => {
|
|
|
168
168
|
let elements: any = {};
|
|
169
169
|
const componentScope = `#/properties/${config.name}`;
|
|
170
170
|
switch (config.type) {
|
|
171
|
+
case "DateTime":
|
|
172
|
+
elements = buildInputSlider(config, componentScope);
|
|
173
|
+
break;
|
|
171
174
|
case "InputSlider":
|
|
172
175
|
elements = buildInputSlider(config, componentScope);
|
|
173
176
|
break;
|
|
@@ -7,6 +7,7 @@ export const buildWrapperSection = (config,componentScope) =>{
|
|
|
7
7
|
wrapper.scope = componentScope;
|
|
8
8
|
wrapper.config.main.label = config.label;
|
|
9
9
|
wrapper.config.main.divider = config.divider === "YES" ? true : false;
|
|
10
|
+
wrapper.config.main.isAccordion = config.isAccordion==="YES"?true:false;
|
|
10
11
|
if (config.style) {
|
|
11
12
|
wrapper.config.style = JSON.parse(config.style)
|
|
12
13
|
}
|
|
@@ -366,7 +366,9 @@ export const buildPropertiesSection = function (type: String) {
|
|
|
366
366
|
];
|
|
367
367
|
break;
|
|
368
368
|
case "WrapperSection":
|
|
369
|
-
uiSchema.elements = [getRadioInputField("divider", "Divider", ["YES", "No"]),
|
|
369
|
+
uiSchema.elements = [getRadioInputField("divider", "Divider", ["YES", "No"]),
|
|
370
|
+
getRadioInputField("isAccordion", "Accordion", ["YES", "No"])
|
|
371
|
+
, EmptyBox]
|
|
370
372
|
break;
|
|
371
373
|
|
|
372
374
|
case "TabSection":
|
|
@@ -18,3 +18,23 @@ export default {
|
|
|
18
18
|
},
|
|
19
19
|
},
|
|
20
20
|
};
|
|
21
|
+
export const DateTime = {
|
|
22
|
+
type: "Control",
|
|
23
|
+
scope: "#/properties/date",
|
|
24
|
+
options: {
|
|
25
|
+
widget: "DateTimeInputField",
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
config: {
|
|
29
|
+
layout: {
|
|
30
|
+
xs: 11,
|
|
31
|
+
sm: 11,
|
|
32
|
+
md: 5.5,
|
|
33
|
+
lg: 5.5,
|
|
34
|
+
},
|
|
35
|
+
main: {
|
|
36
|
+
label: "DateTime",
|
|
37
|
+
type: "date",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
};
|
|
@@ -134,7 +134,7 @@ export const LineGraph = {
|
|
|
134
134
|
leftLabel: "Incentive",
|
|
135
135
|
gridHidden: true,
|
|
136
136
|
numHidden: false,
|
|
137
|
-
tooltipDataKey: ["
|
|
137
|
+
tooltipDataKey: ["First", "Second", "Third"],
|
|
138
138
|
axisLeft: true,
|
|
139
139
|
axisBottom: true,
|
|
140
140
|
hideLeftAxisLine: false,
|
|
@@ -12,6 +12,7 @@ export const ComponentSchema: any = {
|
|
|
12
12
|
{ title: "Container", const: "WrapperSection" },
|
|
13
13
|
{ title: "DataGrid", const: "DataGrid" },
|
|
14
14
|
{ title: "Date", const: "Date" },
|
|
15
|
+
{ title: "DateTime", const: "DateTime"},
|
|
15
16
|
{ title: "Download File", const: "DownloadFile" },
|
|
16
17
|
{ title: "Empty Box", const: "EmptyBox" },
|
|
17
18
|
{ title: "File", const: "FileInput" },
|