impaktapps-ui-builder 1.0.182 → 1.0.196-test
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 +81 -72
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +6 -6
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildHierarchyChart.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/builder/build/uischema/hierarchyChart.d.ts +22 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +0 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/interface.d.ts +0 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +1 -2
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildEmptyBox.ts +3 -0
- package/src/impaktapps-ui-builder/builder/build/buildHierarchyChart.ts +35 -0
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +4 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +15 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/hierarchyChart.ts +13 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +9 -1
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +1 -2
- package/src/impaktapps-ui-builder/builder/services/component.ts +1 -0
- package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +1 -81
- package/src/impaktapps-ui-builder/runtime/services/events.ts +3 -6
- package/src/impaktapps-ui-builder/runtime/services/interface.ts +0 -1
- package/src/impaktapps-ui-builder/runtime/services/service.ts +10 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildHierarchyChart: (config: any, componentScope: any, store: any) => any;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const HierarchyChart: {
|
|
2
|
+
type: string;
|
|
3
|
+
scope: string;
|
|
4
|
+
options: {
|
|
5
|
+
widget: string;
|
|
6
|
+
};
|
|
7
|
+
config: {
|
|
8
|
+
layout: {
|
|
9
|
+
xs: number;
|
|
10
|
+
sm: number;
|
|
11
|
+
md: number;
|
|
12
|
+
lg: number;
|
|
13
|
+
};
|
|
14
|
+
main: {};
|
|
15
|
+
style: {
|
|
16
|
+
containerStyle: {};
|
|
17
|
+
labelStyle: {
|
|
18
|
+
margin: {};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -3,7 +3,6 @@ interface funcParamsProps {
|
|
|
3
3
|
store: any;
|
|
4
4
|
dynamicData: any;
|
|
5
5
|
service: any;
|
|
6
|
-
fetchservice: any;
|
|
7
6
|
userValue: any;
|
|
8
7
|
pageDataProvider: any;
|
|
9
8
|
functionsProvider?: Record<string, any>;
|
|
@@ -24,6 +23,7 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
24
23
|
backHandler: () => void;
|
|
25
24
|
onRowMovement: (paginationValues: any) => Promise<any>;
|
|
26
25
|
onPaginationChange: (paginationValues: any) => Promise<any>;
|
|
26
|
+
onNodeExpandChange: (param: any) => Promise<any>;
|
|
27
27
|
getSelectOptions: (param: any) => Promise<any>;
|
|
28
28
|
onChange: () => void;
|
|
29
29
|
callExecuteEvents: (paramValue: any, apiBody: any, eventType: string) => Promise<any>;
|
|
@@ -33,6 +33,5 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
33
33
|
callHandler: (eventType: string, functionParameters?: any) => void;
|
|
34
34
|
downloadFile: typeof downloadFile;
|
|
35
35
|
downloadFileFromUrl: (response: any, service: any) => void;
|
|
36
|
-
downloadFileStream: (params: any) => Promise<void>;
|
|
37
36
|
};
|
|
38
37
|
export default _default;
|
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { HierarchyChart } from "./uischema/hierarchyChart";
|
|
2
|
+
import _ from "lodash";
|
|
3
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
4
|
+
|
|
5
|
+
export const buildHierarchyChart = (config, componentScope, store) => {
|
|
6
|
+
const hierarchyChart: any = _.cloneDeep(HierarchyChart);
|
|
7
|
+
|
|
8
|
+
hierarchyChart.scope = componentScope;
|
|
9
|
+
if (config.style) {
|
|
10
|
+
hierarchyChart.config.style = JSON.parse(config.style)
|
|
11
|
+
}
|
|
12
|
+
if (config.layout) {
|
|
13
|
+
hierarchyChart.config.layout = createLayoutFormat(config.layout)
|
|
14
|
+
}
|
|
15
|
+
if (config.linkType) {
|
|
16
|
+
hierarchyChart.config.main.linkType = config.linkType;
|
|
17
|
+
}
|
|
18
|
+
if (config.stepPercent) {
|
|
19
|
+
hierarchyChart.config.main.stepPercent = config.stepPercent;
|
|
20
|
+
}
|
|
21
|
+
if (config.nodeWidth) {
|
|
22
|
+
hierarchyChart.config.main.nodeWidth = config.nodeWidth;
|
|
23
|
+
}
|
|
24
|
+
if (config.nodeHeight) {
|
|
25
|
+
hierarchyChart.config.main.nodeHeight = config.nodeHeight;
|
|
26
|
+
}
|
|
27
|
+
if (config.chartHeight) {
|
|
28
|
+
hierarchyChart.config.main.chartHeight = config.chartHeight;
|
|
29
|
+
}
|
|
30
|
+
if (config.lazyLoading) {
|
|
31
|
+
hierarchyChart.config.main.lazyLoading = config.lazyLoading === "YES" ? true : false;
|
|
32
|
+
}
|
|
33
|
+
return hierarchyChart;
|
|
34
|
+
}
|
|
35
|
+
|
|
@@ -48,6 +48,7 @@ import { buildButtonGroup } from "./buildGroupButton";
|
|
|
48
48
|
import { buildPopOver } from "./buildPopover";
|
|
49
49
|
import { buildOTP_Input } from "./buildOTP_inputs";
|
|
50
50
|
import { buildPdfViewer } from "./buildPdfViewer";
|
|
51
|
+
import { buildHierarchyChart } from "./buildHierarchyChart";
|
|
51
52
|
export let schema = {
|
|
52
53
|
type: "object",
|
|
53
54
|
properties: {},
|
|
@@ -222,6 +223,9 @@ const buildUiSchema = (config: any, store?: any) => {
|
|
|
222
223
|
case "MetricCard":
|
|
223
224
|
elements = buildMetricCard(config, componentScope, store);
|
|
224
225
|
break;
|
|
226
|
+
case "HierarchyChart":
|
|
227
|
+
elements = buildHierarchyChart(config, componentScope, store);
|
|
228
|
+
break;
|
|
225
229
|
case "Graph":
|
|
226
230
|
switch (config.graphType) {
|
|
227
231
|
case "BarGraph":
|
|
@@ -509,6 +509,21 @@ export const buildPropertiesSection = function (type: String) {
|
|
|
509
509
|
emptyBox("cardEmpty", { xs: 0, sm: 0, md: 8, lg: 8 })
|
|
510
510
|
];
|
|
511
511
|
break;
|
|
512
|
+
case "HierarchyChart":
|
|
513
|
+
uiSchema.elements = [
|
|
514
|
+
getRadioInputField("lazyLoading", "Lazy Loading", ["YES", "NO"]),
|
|
515
|
+
getSelectField("linkType", "Link Type", [
|
|
516
|
+
{ label: "Step", value: "step" },
|
|
517
|
+
{ label: "Diagonal", value: "diagonal" },
|
|
518
|
+
{ label: "Line", value: "line" },
|
|
519
|
+
]),
|
|
520
|
+
getInputField("nodeWidth", "Node Width"),
|
|
521
|
+
getInputField("nodeHeight", "Node Height"),
|
|
522
|
+
getInputField("chartHeight", "Chart Height"),
|
|
523
|
+
getInputField("stepPercent", "Link Bend Position"),
|
|
524
|
+
emptyBox("HierarchyChart", { xs: 0, sm: 0, md: 4, lg: 6 }),
|
|
525
|
+
];
|
|
526
|
+
break;
|
|
512
527
|
case "MetricCard":
|
|
513
528
|
uiSchema.elements = [
|
|
514
529
|
getInputField("url", "Image Url"),
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const HierarchyChart = {
|
|
2
|
+
type: "Control",
|
|
3
|
+
scope: "#/properties/HierarchyChart",
|
|
4
|
+
options: {
|
|
5
|
+
widget: "HierarchyChart",
|
|
6
|
+
},
|
|
7
|
+
config: {
|
|
8
|
+
layout: {xs :12,sm:12,md:12,lg:12},
|
|
9
|
+
main: {
|
|
10
|
+
},
|
|
11
|
+
style:{ containerStyle: {},labelStyle:{margin:{}} }
|
|
12
|
+
},
|
|
13
|
+
};
|
|
@@ -40,6 +40,7 @@ export const ComponentSchema: any = {
|
|
|
40
40
|
{ title: "Rank", const: "Rank" },
|
|
41
41
|
{ title: "Rank Card", const: "RankCard" },
|
|
42
42
|
{ title: "Metric Card", const: "MetricCard" },
|
|
43
|
+
{ title: "Hierarchy Chart", const: "HierarchyChart" },
|
|
43
44
|
{ title: "Runner Boy", const: "RunnerBoyProgressBar" },
|
|
44
45
|
{ title: "Table", const: "Table" },
|
|
45
46
|
{ title: "Tabs", const: "TabSection" },
|
|
@@ -103,7 +104,14 @@ export const ComponentSchema: any = {
|
|
|
103
104
|
{ title: "Standard", const: "standard" },
|
|
104
105
|
],
|
|
105
106
|
},
|
|
106
|
-
|
|
107
|
+
linkType:{
|
|
108
|
+
oneOf:[
|
|
109
|
+
{ title: "Step", const: "step" },
|
|
110
|
+
{ title: "Diagonal", const: "diagonal" },
|
|
111
|
+
{ title: "Line", const: "line" },
|
|
112
|
+
]
|
|
113
|
+
},
|
|
114
|
+
positionVertical:{
|
|
107
115
|
oneOf: [
|
|
108
116
|
{ title: "Top", const: "top" },
|
|
109
117
|
{ title: "Center", const: "center" },
|
|
@@ -56,7 +56,7 @@ export const EventSchema = {
|
|
|
56
56
|
{ title: "onClose", const: "onClose" },
|
|
57
57
|
{ title: "Key Down", const: "onKeyDown" },
|
|
58
58
|
{ title: "Set Style", const: "setStyle" },
|
|
59
|
-
|
|
59
|
+
{ title: "Expand Node", const: "onNodeExpandChange" },
|
|
60
60
|
]
|
|
61
61
|
},
|
|
62
62
|
Handler: {
|
|
@@ -73,7 +73,6 @@ export const EventSchema = {
|
|
|
73
73
|
oneOf: [
|
|
74
74
|
{ title: "RankProvider", const: "RankProvider" },
|
|
75
75
|
{ title: "Download File", const: "downloadFile" },
|
|
76
|
-
{ title: "Download File Stream", const: "downloadFileStream" },
|
|
77
76
|
{ title: "downloadFileFromUrl", const: "downloadFileFromUrl" },
|
|
78
77
|
]
|
|
79
78
|
},
|
|
@@ -28,6 +28,7 @@ const sectionLabels = {
|
|
|
28
28
|
ProgressBar: ["Core", "Properties", "Events", "Style",],
|
|
29
29
|
RankCard: ["Core", "Properties", "Events", "Style",],
|
|
30
30
|
MetricCard: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
31
|
+
HierarchyChart: ["Core","Components","Properties", "Events", "Style", "Validation"],
|
|
31
32
|
Slider: ["Core", "Components", "Events", "Style", "Validation"],
|
|
32
33
|
Timer: ["Core", "Events", "Style",],
|
|
33
34
|
Rank: ["Core", "Events", "Style",],
|
|
@@ -30,7 +30,7 @@ export function downloadFile({ data, name }: { data: string; name: string }) {
|
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
export const downloadFileFromUrl = (response: any, service) => {
|
|
33
|
-
let url = `${service.defaults.baseURL}
|
|
33
|
+
let url = `${service.defaults.baseURL}${response.path}`;
|
|
34
34
|
if (response?.params) {
|
|
35
35
|
const keysArray = Object.keys(response?.params);
|
|
36
36
|
keysArray.map((e, i) => {
|
|
@@ -44,84 +44,4 @@ export const downloadFileFromUrl = (response: any, service) => {
|
|
|
44
44
|
link.parentNode.removeChild(link);
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
-
export const downloadFileStream = async (params: any) => {
|
|
48
|
-
try {
|
|
49
|
-
let response: Response;
|
|
50
47
|
|
|
51
|
-
if (params.method === "GET") {
|
|
52
|
-
response = await params.fetchservice.getStream(
|
|
53
|
-
params.url,
|
|
54
|
-
params.config
|
|
55
|
-
);
|
|
56
|
-
} else if (params.method === "POST") {
|
|
57
|
-
response = await params.fetchservice.postStream(
|
|
58
|
-
params.url,
|
|
59
|
-
params.body,
|
|
60
|
-
params.config
|
|
61
|
-
);
|
|
62
|
-
} else {
|
|
63
|
-
throw new Error(
|
|
64
|
-
`Unsupported HTTP method: ${params.method}. Only GET and POST are supported.`
|
|
65
|
-
);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
if (!response.ok) {
|
|
69
|
-
throw new Error("Download failed");
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Notify when download starts
|
|
73
|
-
params.store.setNotify({
|
|
74
|
-
SuccessMessage: "File Download Started Successfully",
|
|
75
|
-
Success: true,
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
const fileName =
|
|
79
|
-
response.headers.get("filename") || "downloaded_file";
|
|
80
|
-
|
|
81
|
-
const extension = fileName.includes(".")
|
|
82
|
-
? fileName.substring(fileName.lastIndexOf("."))
|
|
83
|
-
: "";
|
|
84
|
-
|
|
85
|
-
const reader = response.body!.getReader();
|
|
86
|
-
|
|
87
|
-
//@ts-ignore
|
|
88
|
-
const fileHandle = await window.showSaveFilePicker({
|
|
89
|
-
suggestedName: fileName,
|
|
90
|
-
types: extension
|
|
91
|
-
? [
|
|
92
|
-
{
|
|
93
|
-
description: "File",
|
|
94
|
-
accept: {
|
|
95
|
-
"application/octet-stream": [extension],
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
]
|
|
99
|
-
: undefined,
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
const writable = await fileHandle.createWritable();
|
|
103
|
-
|
|
104
|
-
while (true) {
|
|
105
|
-
const { done, value } = await reader.read();
|
|
106
|
-
|
|
107
|
-
if (done) break;
|
|
108
|
-
|
|
109
|
-
await writable.write(value);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
await writable.close();
|
|
113
|
-
|
|
114
|
-
// Notify when download completes
|
|
115
|
-
params.store.setNotify({
|
|
116
|
-
SuccessMessage: `File "${fileHandle.name}" downloaded successfully.`,
|
|
117
|
-
Success: true,
|
|
118
|
-
});
|
|
119
|
-
} catch (e) {
|
|
120
|
-
params.store.setNotify({
|
|
121
|
-
FailMessage: "File Download Failed",
|
|
122
|
-
Fail: true,
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
console.error(e);
|
|
126
|
-
}
|
|
127
|
-
};
|
|
@@ -126,13 +126,10 @@ function executeInBuiltFunctionHandler(params: handlersProps) {
|
|
|
126
126
|
let parameter = {};
|
|
127
127
|
if (params.config.funcParametersCode) {
|
|
128
128
|
const makeFunc = eval(params.config.funcParametersCode)
|
|
129
|
-
parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service
|
|
130
|
-
params.serviceHolder[params.config.inBuiltFunctionType](
|
|
131
|
-
parameter,
|
|
132
|
-
params.service
|
|
133
|
-
);
|
|
129
|
+
parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service);
|
|
130
|
+
params.serviceHolder[params.config.inBuiltFunctionType](parameter, params.service)
|
|
134
131
|
} else {
|
|
135
|
-
params.serviceHolder[params.config.inBuiltFunctionType](params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service
|
|
132
|
+
params.serviceHolder[params.config.inBuiltFunctionType](params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service)
|
|
136
133
|
}
|
|
137
134
|
}
|
|
138
135
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _, { isEmpty } from "lodash";
|
|
2
|
-
import { downloadFileFromUrl, downloadFile
|
|
2
|
+
import { downloadFileFromUrl, downloadFile } from "./downloadFile";
|
|
3
3
|
import { executeEvents, executeRefreshHandler } from "./events";
|
|
4
4
|
import { handlersProps } from "./interface";
|
|
5
5
|
let compType: string;
|
|
@@ -17,7 +17,6 @@ interface funcParamsProps {
|
|
|
17
17
|
store: any,
|
|
18
18
|
dynamicData: any,
|
|
19
19
|
service: any,
|
|
20
|
-
fetchservice: any,
|
|
21
20
|
userValue: any,
|
|
22
21
|
pageDataProvider: any,
|
|
23
22
|
functionsProvider?: Record<string, any>,
|
|
@@ -66,8 +65,8 @@ export default (funcParams: funcParamsProps) => {
|
|
|
66
65
|
const formDataHolder = {};
|
|
67
66
|
let executeEventsParameters: handlersProps = {
|
|
68
67
|
config: {}, componentName: "",
|
|
69
|
-
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
70
|
-
serviceHolder: { downloadFile, download: downloadFileFromUrl,
|
|
68
|
+
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
69
|
+
serviceHolder: { downloadFile, download: downloadFileFromUrl, ...funcParams.functionsProvider }, eventGroups,
|
|
71
70
|
functionsProvider: funcParams.functionsProvider, formDataHolder
|
|
72
71
|
};
|
|
73
72
|
return {
|
|
@@ -197,6 +196,13 @@ export default (funcParams: funcParamsProps) => {
|
|
|
197
196
|
const response = await this.callExecuteEvents(paginationValues, apiBody, "onLoad");
|
|
198
197
|
return response?.data;
|
|
199
198
|
},
|
|
199
|
+
onNodeExpandChange: async function (param) {
|
|
200
|
+
const apiBody = [
|
|
201
|
+
{ key: "expandedNodeId", value: param.expandedNodeId }
|
|
202
|
+
]
|
|
203
|
+
const response = await this.callExecuteEvents(param, apiBody, "onNodeExpandChange");
|
|
204
|
+
return response?.data;
|
|
205
|
+
},
|
|
200
206
|
getSelectOptions: async function (param) {
|
|
201
207
|
if (param.serachValue !== "" && param.serachValue !== undefined) {
|
|
202
208
|
const apiBody = [
|
|
@@ -314,7 +320,6 @@ export default (funcParams: funcParamsProps) => {
|
|
|
314
320
|
},
|
|
315
321
|
downloadFile: downloadFile,
|
|
316
322
|
downloadFileFromUrl: downloadFileFromUrl,
|
|
317
|
-
downloadFileStream: downloadFileStream,
|
|
318
323
|
...funcParams.functionsProvider
|
|
319
324
|
};
|
|
320
325
|
};
|