impaktapps-ui-builder 1.0.3 → 1.0.5
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 +2278 -1161
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +15 -15
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildAreaGraph.d.ts +2 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildArray.d.ts +1 -11
- package/dist/src/impaktapps-ui-builder/builder/build/buildCamera.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildConfig.d.ts +2 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildGroupButton.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildHorizontalLayout.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildImage.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildMetricCard.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildPdfViewer.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildPopover.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.d.ts +2 -0
- package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +2 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/apiSection.d.ts +1 -3
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/box.d.ts +10 -2
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.d.ts +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/button.d.ts +6 -1
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.d.ts +22 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/card.d.ts +173 -171
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/coreSection.d.ts +82 -72
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/eventSection.d.ts +18 -50
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/graph.d.ts +50 -4
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/horizontalLayout.d.ts +13 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/metricCard.d.ts +17 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.d.ts +19 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/refresh.d.ts +0 -3
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/table.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/tableSection.d.ts +15 -66
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/validationSections.d.ts +48 -38
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/valueTab.d.ts +0 -3
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.d.ts +4 -1
- package/dist/src/impaktapps-ui-builder/builder/services/utils.d.ts +2 -1
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +5 -2
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +10 -4
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildAadharCard.ts +2 -2
- package/src/impaktapps-ui-builder/builder/build/buildAreaGraph.ts +66 -0
- package/src/impaktapps-ui-builder/builder/build/buildArray.ts +35 -15
- package/src/impaktapps-ui-builder/builder/build/buildButton.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildCamera.ts +50 -0
- package/src/impaktapps-ui-builder/builder/build/buildCard.ts +10 -10
- package/src/impaktapps-ui-builder/builder/build/buildCheckbox.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildConfig.ts +34 -16
- package/src/impaktapps-ui-builder/builder/build/buildDataGrid.ts +2 -2
- package/src/impaktapps-ui-builder/builder/build/buildDate.ts +35 -13
- package/src/impaktapps-ui-builder/builder/build/buildDownloadFile.ts +7 -0
- package/src/impaktapps-ui-builder/builder/build/buildEmptyBox.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +42 -28
- package/src/impaktapps-ui-builder/builder/build/buildGroupButton.ts +24 -0
- package/src/impaktapps-ui-builder/builder/build/buildHorizontalBarGraph.ts +10 -4
- package/src/impaktapps-ui-builder/builder/build/buildHorizontalLayout.ts +15 -0
- package/src/impaktapps-ui-builder/builder/build/buildImage.ts +38 -0
- package/src/impaktapps-ui-builder/builder/build/buildLabel.ts +3 -0
- package/src/impaktapps-ui-builder/builder/build/buildLeaderboard.ts +4 -1
- package/src/impaktapps-ui-builder/builder/build/buildLineGraph.ts +10 -4
- package/src/impaktapps-ui-builder/builder/build/buildMetricCard.tsx +37 -0
- package/src/impaktapps-ui-builder/builder/build/buildMultiSelect.ts +12 -0
- package/src/impaktapps-ui-builder/builder/build/buildOTP_inputs.ts +44 -0
- package/src/impaktapps-ui-builder/builder/build/buildPdfViewer.ts +16 -0
- package/src/impaktapps-ui-builder/builder/build/buildPieGraph.ts +7 -4
- package/src/impaktapps-ui-builder/builder/build/buildPop.ts +3 -2
- package/src/impaktapps-ui-builder/builder/build/buildPopover.ts +40 -0
- package/src/impaktapps-ui-builder/builder/build/buildProgressBar.ts +31 -21
- package/src/impaktapps-ui-builder/builder/build/buildRadio.ts +11 -3
- package/src/impaktapps-ui-builder/builder/build/buildSelect.ts +12 -0
- package/src/impaktapps-ui-builder/builder/build/buildStackBarGraph.ts +10 -4
- package/src/impaktapps-ui-builder/builder/build/buildStackBarLineGraph.ts +72 -0
- package/src/impaktapps-ui-builder/builder/build/buildTabSection.ts +5 -0
- package/src/impaktapps-ui-builder/builder/build/buildTable.ts +24 -8
- package/src/impaktapps-ui-builder/builder/build/buildText.ts +15 -0
- package/src/impaktapps-ui-builder/builder/build/buildTextArea.ts +2 -2
- package/src/impaktapps-ui-builder/builder/build/buildThoughtOfTheDay.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildTreeMap.ts +2 -1
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +140 -130
- package/src/impaktapps-ui-builder/builder/build/buildUplaodFile.ts +6 -0
- package/src/impaktapps-ui-builder/builder/build/buildWrapperSection.ts +8 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/apiSection.ts +0 -6
- package/src/impaktapps-ui-builder/builder/build/uischema/array.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/box.ts +5 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +398 -141
- package/src/impaktapps-ui-builder/builder/build/uischema/button.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/buttonGroup.ts +17 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/card.ts +142 -169
- package/src/impaktapps-ui-builder/builder/build/uischema/coreSection.ts +127 -133
- package/src/impaktapps-ui-builder/builder/build/uischema/dateInputField.ts +2 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/emptyBox.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/eventSection.ts +30 -54
- package/src/impaktapps-ui-builder/builder/build/uischema/file.ts +3 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/graph.ts +37 -4
- package/src/impaktapps-ui-builder/builder/build/uischema/horizontalLayout.ts +11 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/metricCard.ts +13 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/multiSelect.ts +4 -2
- package/src/impaktapps-ui-builder/builder/build/uischema/pdfViewer.ts +18 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/refresh.ts +0 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/selectInputField.ts +3 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/table.ts +1 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/tableSection.ts +34 -60
- package/src/impaktapps-ui-builder/builder/build/uischema/textInputField.ts +1 -1
- package/src/impaktapps-ui-builder/builder/build/uischema/validationSections.ts +58 -113
- package/src/impaktapps-ui-builder/builder/build/uischema/valueTab.ts +0 -3
- package/src/impaktapps-ui-builder/builder/build/uischema/wrapperSection.ts +4 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +228 -59
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/uiSchema.ts +121 -119
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/schema.ts +1 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/PageMaster/uiSchema.ts +94 -106
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +11 -5
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/uiSchema.ts +31 -55
- package/src/impaktapps-ui-builder/builder/services/component.ts +173 -86
- package/src/impaktapps-ui-builder/builder/services/event.ts +3 -0
- package/src/impaktapps-ui-builder/builder/services/pageMaster.ts +18 -15
- package/src/impaktapps-ui-builder/builder/services/utils.ts +15 -3
- package/src/impaktapps-ui-builder/lib/index.ts +10 -9
- package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +33 -18
- package/src/impaktapps-ui-builder/runtime/services/events.ts +9 -11
- package/src/impaktapps-ui-builder/runtime/services/service.ts +123 -165
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
declare const clearFromSessionStorage: () => void;
|
|
2
2
|
export default clearFromSessionStorage;
|
|
3
|
+
export declare const validateAndShowErrors: (store: any) => boolean;
|
|
3
4
|
export declare const getNavigationHistory: (config: any, path: string | undefined) => {
|
|
4
5
|
pageName: string;
|
|
5
6
|
};
|
|
6
7
|
export declare const saveFormdataInSessionStorage: (formData: any, path?: string) => any;
|
|
7
8
|
export declare const getFormdataFromSessionStorage: (path?: string) => any;
|
|
8
9
|
export declare function saveHandler(store: any, service: any, submitHandler: any): Promise<void>;
|
|
9
|
-
export declare const navigateHandler: (store: any, isSubmitted: any, pageName?: string | boolean) => void;
|
|
10
|
+
export declare const navigateHandler: (store: any, isSubmitted: any, pageName?: string | boolean, errorMessage?: string) => void;
|
|
10
11
|
export declare function okHandler(store: any): void;
|
|
@@ -7,3 +7,4 @@ export { default as buildConfig } from "../builder/build/buildConfig";
|
|
|
7
7
|
export { default as buildUiSchema } from "../builder/build/buildUiSchema";
|
|
8
8
|
export { buildSchema } from "../builder/build/buildUiSchema";
|
|
9
9
|
export { default as clearFromSessionStorage } from "../builder/services/utils";
|
|
10
|
+
export { downloadFile, downloadFileFromUrl } from "../runtime/services/downloadFile";
|
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
|
|
1
|
+
export declare function downloadFile({ data, name }: {
|
|
2
|
+
data: string;
|
|
3
|
+
name: string;
|
|
4
|
+
}): void;
|
|
5
|
+
export declare const downloadFileFromUrl: (response: any, service: any) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { downloadFile } from "./downloadFile";
|
|
1
2
|
interface funcParamsProps {
|
|
2
3
|
store: any;
|
|
3
4
|
dynamicData: any;
|
|
@@ -5,12 +6,17 @@ interface funcParamsProps {
|
|
|
5
6
|
userValue: any;
|
|
6
7
|
pageDataProvider: any;
|
|
7
8
|
functionsProvider?: Record<string, any>;
|
|
9
|
+
initFormData?: any;
|
|
8
10
|
}
|
|
9
11
|
export declare const extractEvents: (eventConfig: any) => any;
|
|
10
12
|
declare const _default: (funcParams: funcParamsProps) => {
|
|
11
13
|
setPage: () => Promise<void>;
|
|
14
|
+
getStyle: () => {};
|
|
12
15
|
onCellRenderer: (cellParams: any) => {};
|
|
13
16
|
onClick: () => void;
|
|
17
|
+
onKeyDown: () => void;
|
|
18
|
+
onFileDelete: () => Promise<void>;
|
|
19
|
+
onClose: () => void;
|
|
14
20
|
onMount: () => void;
|
|
15
21
|
onFileDownload: () => void;
|
|
16
22
|
onFileUpload: () => void;
|
|
@@ -18,13 +24,13 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
18
24
|
onRowMovement: (paginationValues: any) => Promise<any>;
|
|
19
25
|
onPaginationChange: (paginationValues: any) => Promise<any>;
|
|
20
26
|
getSelectOptions: (param: any) => Promise<any>;
|
|
21
|
-
onChange: () =>
|
|
27
|
+
onChange: () => void;
|
|
22
28
|
callExecuteEvents: (paramValue: any, apiBody: any, eventType: string) => Promise<any>;
|
|
23
29
|
onBack: (functionParameters: any) => Promise<void>;
|
|
24
30
|
onNext: (functionParameters: any) => Promise<void>;
|
|
25
31
|
onReset: (functionParameters: any) => Promise<void>;
|
|
26
|
-
callHandler: (eventType: string, functionParameters?: any) =>
|
|
27
|
-
downloadFile:
|
|
28
|
-
|
|
32
|
+
callHandler: (eventType: string, functionParameters?: any) => void;
|
|
33
|
+
downloadFile: typeof downloadFile;
|
|
34
|
+
downloadFileFromUrl: (response: any, service: any) => void;
|
|
29
35
|
};
|
|
30
36
|
export default _default;
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ const TextField = {
|
|
|
11
11
|
"widget": "InputField"
|
|
12
12
|
},
|
|
13
13
|
config:{
|
|
14
|
-
layout: { xs: 12, sm: 6, md: 4, lg:
|
|
14
|
+
layout: { xs: 12, sm: 6, md: 4, lg: 3 },
|
|
15
15
|
main:{
|
|
16
16
|
label:"Adhaar Card",
|
|
17
17
|
formatStrArray:["9","9","9","9"," ","9","9","9","9"," ","X9","X9","X9","X9"],
|
|
@@ -43,7 +43,7 @@ const PanField = {
|
|
|
43
43
|
"widget": "InputField"
|
|
44
44
|
},
|
|
45
45
|
config:{
|
|
46
|
-
layout: { xs: 12, sm: 6, md: 4, lg:
|
|
46
|
+
layout: { xs: 12, sm: 6, md: 4, lg: 3 },
|
|
47
47
|
main:{
|
|
48
48
|
label:"Pan Card",
|
|
49
49
|
placeholder:"AAAAA0000A",
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { createLayoutFormat, createKeyValueMap } from "./buildConfig";
|
|
2
|
+
import { AreaBarGraph } from "./uischema/graph";
|
|
3
|
+
import _ from "lodash";
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const buildAreaGraph = (config:any,componentScope:string) => {
|
|
7
|
+
const AreaGraph: any = _.cloneDeep(AreaBarGraph);
|
|
8
|
+
AreaGraph.scope = componentScope;
|
|
9
|
+
if (config.layout) {
|
|
10
|
+
AreaGraph.config.layout = createLayoutFormat(config.layout, config.type);
|
|
11
|
+
}
|
|
12
|
+
AreaGraph.config.main.type = config.graphType;
|
|
13
|
+
AreaGraph.scope = componentScope;
|
|
14
|
+
AreaGraph.config.main.header = config.heading;
|
|
15
|
+
AreaGraph.config.main.subHeader = config.subHeader;
|
|
16
|
+
if (config.legendHide) {
|
|
17
|
+
AreaGraph.config.main.legendAvailable = config.legendHide==="YES"?false:true;
|
|
18
|
+
}
|
|
19
|
+
if (config.bottomAxisAngle) {
|
|
20
|
+
AreaGraph.config.main.bottomAxisAngle = config.bottomAxisAngle==="YES"?true:false;
|
|
21
|
+
}
|
|
22
|
+
if (config.legendLabels) {
|
|
23
|
+
AreaGraph.config.main.legendLabels = createKeyValueMap(config.legendLabels);
|
|
24
|
+
}
|
|
25
|
+
if(config.legendDirection){
|
|
26
|
+
AreaGraph.config.main.legendDirection = config.legendDirection === "Row" ? "row" : "column";
|
|
27
|
+
}
|
|
28
|
+
if (config.height) {
|
|
29
|
+
AreaGraph.config.style.containerStyle.height = config.height;
|
|
30
|
+
}
|
|
31
|
+
if (config.pieArcColors) {
|
|
32
|
+
AreaGraph.config.style.colorMap = createKeyValueMap(config.pieArcColors);
|
|
33
|
+
}
|
|
34
|
+
if(config.xAxisFormatType){
|
|
35
|
+
AreaGraph.config.main.xAxisFormatType = config.xAxisFormatType
|
|
36
|
+
}
|
|
37
|
+
if(config.yAxisTickCount){
|
|
38
|
+
AreaGraph.config.main.yAxisTickCount = config.yAxisTickCount
|
|
39
|
+
}
|
|
40
|
+
if(config.xAxisTickCount){
|
|
41
|
+
AreaGraph.config.main.xAxisTickCount = config.xAxisTickCount
|
|
42
|
+
}
|
|
43
|
+
if (config.xAxisValue) {
|
|
44
|
+
AreaGraph.config.main.xAxisValue = config.xAxisValue;
|
|
45
|
+
}
|
|
46
|
+
if(config.xAxisType) {
|
|
47
|
+
AreaGraph.config.main.xAxisType = config.xAxisType;
|
|
48
|
+
}
|
|
49
|
+
if (config.bottomLabel) {
|
|
50
|
+
AreaGraph.config.main.bottomLabel = config.bottomLabel;
|
|
51
|
+
}
|
|
52
|
+
if (config.leftLabel) {
|
|
53
|
+
AreaGraph.config.main.leftLabel = config.leftLabel;
|
|
54
|
+
}
|
|
55
|
+
if (config.disableLeftLabel) {
|
|
56
|
+
AreaGraph.config.main.disableLeftLabel = config.disableLeftLabel==="YES"? true: false;
|
|
57
|
+
}
|
|
58
|
+
if (config.leftMargin) {
|
|
59
|
+
AreaGraph.config.style.labelStyle.margin ={
|
|
60
|
+
left: config.leftMargin
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return AreaGraph
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export default buildAreaGraph;
|
|
@@ -1,18 +1,38 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
2
|
|
|
3
|
-
const ArrayUiSchema = {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
3
|
+
const ArrayUiSchema: any = {
|
|
4
|
+
type: "Control",
|
|
5
|
+
scope: "#/properties/adjustments",
|
|
6
|
+
layout: 12,
|
|
7
|
+
elements: [],
|
|
8
|
+
config: {
|
|
9
|
+
main: {}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
export const buildArray = (config: any, componentScope: string) => {
|
|
14
|
+
const array = _.cloneDeep(ArrayUiSchema);
|
|
15
|
+
if (config.allExpanded) {
|
|
16
|
+
array.config.main.allExpanded = config.allExpanded === "YES" ? true : false
|
|
17
|
+
}
|
|
18
|
+
if (config.disableAddButton) {
|
|
19
|
+
array.config.main.disableAddButton = config.disableAddButton === "YES" ? true : false
|
|
20
|
+
}
|
|
21
|
+
if (config.disableExpandAllButton) {
|
|
22
|
+
array.config.main.disableExpandAllButton = config.disableExpandAllButton === "YES" ? true : false
|
|
23
|
+
}
|
|
24
|
+
if (config.disableRowActions) {
|
|
25
|
+
array.config.main.disableRowActions = config.disableRowActions === "YES" ? true : false
|
|
26
|
+
}
|
|
27
|
+
if (config.style) {
|
|
28
|
+
array.config.style = JSON.parse(config.style)
|
|
29
|
+
}
|
|
30
|
+
array.config.main.rowSpacing = Number(config.rowSpacing);
|
|
31
|
+
array.config.main.columnSpacing = Number(config.columnSpacing);
|
|
32
|
+
array.config.main.spacing = Number(config.spacing);
|
|
33
|
+
array.config.main.childElementLabel = config.childElementLabel;
|
|
34
|
+
array.config.main.showKeyAsLabel = config.showKeyAsLabel;
|
|
35
|
+
array.config.main.label = config.label;
|
|
36
|
+
array.scope = componentScope;
|
|
37
|
+
return array;
|
|
18
38
|
}
|
|
@@ -12,7 +12,7 @@ export const buildButton = (config:any,componentScope:string) =>{
|
|
|
12
12
|
|
|
13
13
|
}
|
|
14
14
|
if(config.layout){
|
|
15
|
-
button.config.layout = createLayoutFormat(config.layout)
|
|
15
|
+
button.config.layout = createLayoutFormat(config.layout, config.type)
|
|
16
16
|
}
|
|
17
17
|
if(config.tooltipMessage){
|
|
18
18
|
button.config.main.tooltipMessage = config.tooltipMessage
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
3
|
+
|
|
4
|
+
const cameraUiSchema = {
|
|
5
|
+
type: "Control",
|
|
6
|
+
scope: "#/properties/camera",
|
|
7
|
+
|
|
8
|
+
options: {
|
|
9
|
+
widget: "Camera",
|
|
10
|
+
},
|
|
11
|
+
config: {
|
|
12
|
+
main: {
|
|
13
|
+
label: "Upload Photo",
|
|
14
|
+
multiUplaod: false,
|
|
15
|
+
onUpload: "onFileUpload",
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
export const buildCamera = (config: any, componentScope: string) => {
|
|
20
|
+
const camera: any = _.cloneDeep(cameraUiSchema);
|
|
21
|
+
camera.scope = componentScope;
|
|
22
|
+
if (config.iconName) {
|
|
23
|
+
camera.config.main.startIcon = config.iconName;
|
|
24
|
+
}
|
|
25
|
+
if (config.layout) {
|
|
26
|
+
camera.config.layout = createLayoutFormat(config.layout, config.type);
|
|
27
|
+
}
|
|
28
|
+
if (config.tooltipMessage) {
|
|
29
|
+
camera.config.main.tooltipMessage = config.tooltipMessage;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
camera.config.main.multiUplaod = config.multiUplaod === "YES" ? true : false;
|
|
33
|
+
|
|
34
|
+
if (config.style) {
|
|
35
|
+
camera.config.style = JSON.parse(config.style);
|
|
36
|
+
}
|
|
37
|
+
if (config.size) {
|
|
38
|
+
camera.config.main.size = config.size;
|
|
39
|
+
}
|
|
40
|
+
if (config.variant) {
|
|
41
|
+
camera.config.main.variant = config.variant;
|
|
42
|
+
}
|
|
43
|
+
if (config.color) {
|
|
44
|
+
camera.config.main.color = config.color
|
|
45
|
+
}
|
|
46
|
+
if (config.label) {
|
|
47
|
+
camera.config.main.label = config.label;
|
|
48
|
+
}
|
|
49
|
+
return camera;
|
|
50
|
+
}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import Card from "./uischema/card";
|
|
2
2
|
import _ from "lodash";
|
|
3
3
|
import { createLayoutFormat } from "./buildConfig";
|
|
4
|
-
|
|
4
|
+
|
|
5
5
|
export const buildCard = (config,componentScope,store) =>{
|
|
6
6
|
const card: any = _.cloneDeep(Card(store.theme.myTheme));
|
|
7
7
|
if (config.style) {
|
|
8
8
|
card.config.wrapperStyle = JSON.parse(config.style)
|
|
9
|
-
}
|
|
10
|
-
card.elements[0].
|
|
11
|
-
card.elements[1].scope = `#/properties/${config.name}/properties/
|
|
12
|
-
card.elements[
|
|
9
|
+
}
|
|
10
|
+
card.elements[0].scope = `#/properties/${config.name}/properties/url`;
|
|
11
|
+
card.elements[1].scope = `#/properties/${config.name}/properties/label`;
|
|
12
|
+
card.elements[2].scope = `#/properties/${config.name}/properties/value`;
|
|
13
|
+
|
|
14
|
+
card.elements[3].scope = `#/properties/${config.name}/properties/description`;
|
|
13
15
|
if(config.layout){
|
|
14
16
|
card.config.layout = createLayoutFormat(config.layout)
|
|
15
17
|
}
|
|
@@ -18,16 +20,14 @@ export const buildCard = (config,componentScope,store) =>{
|
|
|
18
20
|
card.elements[0].elements[0].elements[0].elements[1].config.style.left = "24px"
|
|
19
21
|
}
|
|
20
22
|
if(config.label){
|
|
21
|
-
card.elements[
|
|
23
|
+
card.elements[1].config.main.heading = config.label;
|
|
22
24
|
}
|
|
23
25
|
if(config.url){
|
|
24
|
-
card.elements[
|
|
26
|
+
card.elements[0].config.main.url = config.url;
|
|
25
27
|
}
|
|
26
28
|
if(config.description){
|
|
27
|
-
card.elements[
|
|
29
|
+
card.elements[3].config.main.heading = config.description;
|
|
28
30
|
}
|
|
29
31
|
|
|
30
|
-
|
|
31
|
-
|
|
32
32
|
return card;
|
|
33
33
|
}
|
|
@@ -4,11 +4,11 @@ import { createLayoutFormat } from "./buildConfig";
|
|
|
4
4
|
const Checkbox = {
|
|
5
5
|
"type": "Control",
|
|
6
6
|
"scope": "#/properties/username1",
|
|
7
|
-
"layout": 12,
|
|
8
7
|
"options": {
|
|
9
8
|
"widget": "CheckBox"
|
|
10
9
|
},
|
|
11
10
|
"config": {
|
|
11
|
+
"layout": { xs: 6, sm: 6, md: 4, lg: 3 },
|
|
12
12
|
"main": {
|
|
13
13
|
"label": "Welcome to Hyperform",
|
|
14
14
|
}
|
|
@@ -22,31 +22,41 @@ export default (FormData: any) => {
|
|
|
22
22
|
if (formData.events) {
|
|
23
23
|
delete formData.events
|
|
24
24
|
}
|
|
25
|
+
if (formData.tabLabelElements) {
|
|
26
|
+
component.tabLabelElements = formData.tabLabelElements || [];
|
|
27
|
+
delete formData.tabLabelElements
|
|
28
|
+
}
|
|
25
29
|
component = { ...formData, ...component };
|
|
26
30
|
return component;
|
|
27
31
|
};
|
|
28
32
|
|
|
29
|
-
export const createLayoutFormat = (
|
|
30
|
-
if (_.isEmpty(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
sm: 12,
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
export const createLayoutFormat = (layout: any[], type?: string) => {
|
|
34
|
+
if (_.isEmpty(layout)) {
|
|
35
|
+
const fullLayoutComponents: string[] = ["WrapperSection", "DataGrid", "LeaderBoard", "PopUp", "TextArea", "TreeMap", "Thought", "HorizontalLayout", "Table"]
|
|
36
|
+
if (fullLayoutComponents.includes(type)) {
|
|
37
|
+
return { xs: 12, sm: 12, md: 12, lg: 12 }
|
|
38
|
+
}
|
|
39
|
+
else if (type === "Graph") {
|
|
40
|
+
return { xs: 12, sm: 12, md: 12, lg: 6 }
|
|
41
|
+
}
|
|
42
|
+
else if (type === "Button") {
|
|
43
|
+
return { xs: 4, sm: 2.5, md: 2, lg: 1.5 }
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
return { xs: 6, sm: 6, md: 4, lg: 3 }
|
|
36
47
|
}
|
|
37
48
|
}
|
|
38
|
-
let data: any = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
data[e.key || "xs"] = +e.value || 5.5
|
|
49
|
+
let data: any = {};
|
|
50
|
+
|
|
51
|
+
layout.map((e: any) => {
|
|
52
|
+
data[e.key || "xs"] =
|
|
53
|
+
e.value === null || e.value === undefined || e.value === ""
|
|
54
|
+
? 5.5
|
|
55
|
+
: +e.value;
|
|
46
56
|
})
|
|
47
57
|
return data;
|
|
48
58
|
};
|
|
49
|
-
export const flatObjectValueInArray = (config: any[]=[]) => {
|
|
59
|
+
export const flatObjectValueInArray = (config: any[] = []) => {
|
|
50
60
|
if (config.length < 1) {
|
|
51
61
|
return
|
|
52
62
|
}
|
|
@@ -56,3 +66,11 @@ export const flatObjectValueInArray = (config: any[]=[]) => {
|
|
|
56
66
|
})
|
|
57
67
|
return data;
|
|
58
68
|
}
|
|
69
|
+
|
|
70
|
+
export const createKeyValueMap = (config: any[] = []) => {
|
|
71
|
+
return config.reduce((acc, item) => {
|
|
72
|
+
if (!item.key) return acc
|
|
73
|
+
acc[item.key] = item.value
|
|
74
|
+
return acc
|
|
75
|
+
}, {})
|
|
76
|
+
}
|
|
@@ -39,10 +39,10 @@ export const buildDataGrid = (config, componentScope) => {
|
|
|
39
39
|
DataGrid.config.main.label = config.label;
|
|
40
40
|
}
|
|
41
41
|
if (config.layout) {
|
|
42
|
-
DataGrid.config.layout = createLayoutFormat(config.layout)
|
|
42
|
+
DataGrid.config.layout = createLayoutFormat(config.layout, config.type)
|
|
43
43
|
}
|
|
44
44
|
if (config.cardLayout) {
|
|
45
|
-
DataGrid.config.cardLayout = createLayoutFormat(config.cardLayout)
|
|
45
|
+
DataGrid.config.cardLayout = createLayoutFormat(config.cardLayout, config.type)
|
|
46
46
|
}
|
|
47
47
|
if (config.style) {
|
|
48
48
|
DataGrid.config.style = JSON.parse(config.style)
|
|
@@ -2,23 +2,45 @@ import DateInputField, { DateTime } from "./uischema/dateInputField";
|
|
|
2
2
|
import _ from "lodash";
|
|
3
3
|
import { createLayoutFormat } from "./buildConfig";
|
|
4
4
|
|
|
5
|
-
export const buildDate = (config:any,componentScope:string)=> {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
export const buildDate = (config: any, componentScope: string) => {
|
|
6
|
+
const dateInputField: any = _.cloneDeep(DateInputField);
|
|
7
|
+
dateInputField.config.main.label = config.label;
|
|
8
|
+
dateInputField.scope = componentScope;
|
|
9
|
+
if (config.layout) {
|
|
10
|
+
dateInputField.config.layout = createLayoutFormat(config.layout)
|
|
11
|
+
}
|
|
12
|
+
if (config.variant) {
|
|
13
|
+
dateInputField.config.main.variant = config.variant;
|
|
14
|
+
}
|
|
15
|
+
if (config.toolTip) {
|
|
16
|
+
dateInputField.config.main.toolTip = config.toolTip;
|
|
17
|
+
}
|
|
18
|
+
if (config.toolTipPosition) {
|
|
19
|
+
dateInputField.config.main.toolTipPosition = config.toolTipPosition;
|
|
20
|
+
}
|
|
21
|
+
if (config.style) {
|
|
22
|
+
dateInputField.config.style = JSON.parse(config.style)
|
|
23
|
+
}
|
|
24
|
+
return dateInputField;
|
|
14
25
|
}
|
|
15
|
-
export const buildDateTime = (config:any,componentScope:string)=>{
|
|
26
|
+
export const buildDateTime = (config: any, componentScope: string) => {
|
|
16
27
|
const dateTimeInputField: any = _.cloneDeep(DateTime);
|
|
17
28
|
dateTimeInputField.config.main.label = config.label;
|
|
18
|
-
dateTimeInputField.config.main.errorMessage = `${config.name} is empty or invalid`;
|
|
19
29
|
dateTimeInputField.scope = componentScope;
|
|
20
|
-
if(config.layout){
|
|
30
|
+
if (config.layout) {
|
|
21
31
|
dateTimeInputField.config.layout = createLayoutFormat(config.layout)
|
|
22
|
-
|
|
32
|
+
}
|
|
33
|
+
if (config.variant) {
|
|
34
|
+
dateTimeInputField.config.main.variant = config.variant;
|
|
35
|
+
}
|
|
36
|
+
if (config.toolTip) {
|
|
37
|
+
dateTimeInputField.config.main.toolTip = config.toolTip;
|
|
38
|
+
}
|
|
39
|
+
if (config.toolTipPosition) {
|
|
40
|
+
dateTimeInputField.config.main.toolTipPosition = config.toolTipPosition;
|
|
41
|
+
}
|
|
42
|
+
if (config.style) {
|
|
43
|
+
dateTimeInputField.config.style = JSON.parse(config.style)
|
|
44
|
+
}
|
|
23
45
|
return dateTimeInputField;
|
|
24
46
|
}
|
|
@@ -5,6 +5,7 @@ import { createLayoutFormat } from "./buildConfig";
|
|
|
5
5
|
export const buildDownloadFile = (config,componentScope) => {
|
|
6
6
|
const DownloadFile: any = _.cloneDeep(downloadFile);
|
|
7
7
|
DownloadFile.scope = componentScope;
|
|
8
|
+
DownloadFile.config.main.label = config.label;
|
|
8
9
|
if (config.layout) {
|
|
9
10
|
DownloadFile.config.layout = config.layout;
|
|
10
11
|
}
|
|
@@ -20,5 +21,11 @@ export const buildDownloadFile = (config,componentScope) => {
|
|
|
20
21
|
if (config.errorMessage) {
|
|
21
22
|
DownloadFile.config.main.errorMessage = config.errorMessage;
|
|
22
23
|
}
|
|
24
|
+
if (config.toolTip) {
|
|
25
|
+
DownloadFile.config.main.toolTip = config.toolTip;
|
|
26
|
+
}
|
|
27
|
+
if (config.toolTipPosition) {
|
|
28
|
+
DownloadFile.config.main.toolTipPosition = config.toolTipPosition;
|
|
29
|
+
}
|
|
23
30
|
return DownloadFile;
|
|
24
31
|
}
|
|
@@ -4,6 +4,7 @@ import emptyBox from "./uischema/emptyBox";
|
|
|
4
4
|
|
|
5
5
|
export const buildEmptyBox = (config,componentScope) =>{
|
|
6
6
|
const EmptyBox: any = _.cloneDeep(emptyBox);
|
|
7
|
+
EmptyBox.scope = componentScope;
|
|
7
8
|
if (config.layout) {
|
|
8
9
|
EmptyBox.config.layout = createLayoutFormat(config.layout);
|
|
9
10
|
}
|
|
@@ -2,34 +2,48 @@ import _ from "lodash";
|
|
|
2
2
|
import { createLayoutFormat } from "./buildConfig";
|
|
3
3
|
|
|
4
4
|
const FileInput = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
type: "Control",
|
|
6
|
+
scope: "#/properties/docAggrementCopy",
|
|
7
|
+
options: {
|
|
8
|
+
widget: "FileInputField",
|
|
9
|
+
},
|
|
10
|
+
config: {
|
|
11
|
+
layout: { xs: 12, sm: 6, md: 4, lg: 3 },
|
|
12
|
+
main: {
|
|
13
|
+
required: false,
|
|
14
|
+
onUpload: "onFileUpload",
|
|
15
|
+
onDownload: "onFileDownload",
|
|
16
|
+
label: "Aggrement Copy",
|
|
17
|
+
"onClick": "onClick"
|
|
18
|
+
// iconStyleDefault:true,
|
|
9
19
|
},
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
main: {
|
|
13
|
-
required: false,
|
|
14
|
-
onUpload: "onFileUpload",
|
|
15
|
-
onDownload:"onFileDownload",
|
|
16
|
-
label:"Aggrement Copy"
|
|
17
|
-
// iconStyleDefault:true,
|
|
18
|
-
},
|
|
19
|
-
style: {
|
|
20
|
-
backgroundColor: "none",
|
|
21
|
-
},
|
|
20
|
+
style: {
|
|
21
|
+
backgroundColor: "none",
|
|
22
22
|
},
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
export const buildFileInput = (config, componentScope) => {
|
|
26
|
+
const box: any = _.cloneDeep(FileInput);
|
|
27
|
+
box.scope = componentScope;
|
|
28
|
+
box.config.main.label = config.label
|
|
29
|
+
if (config.layout) {
|
|
30
|
+
box.config.layout = createLayoutFormat(config.layout)
|
|
31
|
+
}
|
|
32
|
+
if (config.style) {
|
|
33
|
+
box.config.style = JSON.parse(config.style)
|
|
34
|
+
}
|
|
35
|
+
box.config.main.variant = config.variant
|
|
36
|
+
box.config.main.disableUpload = config.disableUpload === "YES" ? true : false;
|
|
37
|
+
box.config.main.disableDownload = config.disableDownload === "YES" ? true : false;
|
|
38
|
+
box.config.main.disableDelete = config.disableDelete === "YES" ? true : false;
|
|
39
|
+
box.config.main.useLabel = config.useLabel === "YES" ? true : false;
|
|
40
|
+
box.config.main.description = config.description;
|
|
41
|
+
box.config.main.toolTip = config.toolTip;
|
|
42
|
+
box.config.main.chooseButtonLabel = config.chooseButtonLabel;
|
|
43
|
+
box.config.main.noFileAvailableMessage = config.noFileAvailableMessage;
|
|
44
|
+
if (config.toolTipPosition) {
|
|
45
|
+
box.config.main.toolTipPosition = config.toolTipPosition;
|
|
46
|
+
}
|
|
47
|
+
box.config.main.externalUpload = config.externalUpload === "YES" ? true : false;
|
|
48
|
+
return box;
|
|
35
49
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import ButtonGroup from "./uischema/buttonGroup";
|
|
2
|
+
import _ from "lodash";
|
|
3
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
4
|
+
|
|
5
|
+
export const buildButtonGroup = (config:any,componentScope:string) =>{
|
|
6
|
+
const buttonGroup:any = _.cloneDeep(ButtonGroup);
|
|
7
|
+
if(config.layout){
|
|
8
|
+
buttonGroup.config.layout = createLayoutFormat(config.layout, config.type)
|
|
9
|
+
}
|
|
10
|
+
buttonGroup.scope = componentScope;
|
|
11
|
+
if(config.multiSelect){
|
|
12
|
+
buttonGroup.config.main.multiSelect = config.multiSelect === "YES" ? true : false
|
|
13
|
+
}
|
|
14
|
+
if (config.style) {
|
|
15
|
+
buttonGroup.config.style = JSON.parse(config.style)
|
|
16
|
+
}
|
|
17
|
+
if (config.size) {
|
|
18
|
+
buttonGroup.config.main.size = config.size
|
|
19
|
+
}
|
|
20
|
+
if (config.color) {
|
|
21
|
+
buttonGroup.config.main.color = config.color
|
|
22
|
+
}
|
|
23
|
+
return buttonGroup;
|
|
24
|
+
}
|