impaktapps-ui-builder 0.0.366 → 0.0.369
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 +60 -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/buildDataGrid.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +1 -0
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildDataGrid.ts +45 -0
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +4 -0
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +9 -3
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +1 -0
- package/src/impaktapps-ui-builder/builder/services/component.ts +1 -0
- package/src/impaktapps-ui-builder/builder/services/event.ts +1 -0
- package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +11 -1
- package/src/impaktapps-ui-builder/runtime/services/service.ts +3 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const buildDataGrid: (config: any, componentScope: any) => any;
|
|
@@ -22,5 +22,6 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
22
22
|
onReset: (functionParameters: any) => Promise<void>;
|
|
23
23
|
callHandler: (eventType: string, functionParameters?: any) => Promise<void>;
|
|
24
24
|
downloadFile: (obj: any) => void;
|
|
25
|
+
downloadBlobFile: (response: any) => void;
|
|
25
26
|
};
|
|
26
27
|
export default _default;
|
package/package.json
CHANGED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import _ from "lodash";
|
|
2
|
+
import { createLayoutFormat } from "./buildConfig";
|
|
3
|
+
|
|
4
|
+
const dataGrid = {
|
|
5
|
+
"type": "Control",
|
|
6
|
+
"scope": "#/properties/dataGrid",
|
|
7
|
+
"layout": 12,
|
|
8
|
+
"options": {
|
|
9
|
+
"widget": "DataGrid"
|
|
10
|
+
},
|
|
11
|
+
elements: [
|
|
12
|
+
],
|
|
13
|
+
"config": {
|
|
14
|
+
"main": {
|
|
15
|
+
// "label": "Data Grid",
|
|
16
|
+
elevation: 0,
|
|
17
|
+
useWrapper: false
|
|
18
|
+
},
|
|
19
|
+
style: {
|
|
20
|
+
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const buildDataGrid = (config, componentScope) => {
|
|
26
|
+
const DataGrid: any = _.cloneDeep(dataGrid);
|
|
27
|
+
DataGrid.scope = componentScope;
|
|
28
|
+
DataGrid.config.main.useWrapper = config.useWrapper === "NO" ? false : true;
|
|
29
|
+
if (config.elevation) {
|
|
30
|
+
DataGrid.config.main.elevation = +config.elevation;
|
|
31
|
+
}
|
|
32
|
+
if (config.height) {
|
|
33
|
+
DataGrid.config.main.height = `${config.height}px`;
|
|
34
|
+
}
|
|
35
|
+
if (config.label) {
|
|
36
|
+
DataGrid.config.main.label = config.label;
|
|
37
|
+
}
|
|
38
|
+
if (config.layout) {
|
|
39
|
+
DataGrid.config.layout = createLayoutFormat(config.layout)
|
|
40
|
+
}
|
|
41
|
+
if (config.style) {
|
|
42
|
+
DataGrid.config.style = JSON.parse(config.style)
|
|
43
|
+
}
|
|
44
|
+
return DataGrid;
|
|
45
|
+
}
|
|
@@ -36,6 +36,7 @@ import { buildAdhaarField, buildPanField } from "./buildAadharCard";
|
|
|
36
36
|
import { buildFileInput } from "./buildFileInput";
|
|
37
37
|
import { buildStepper } from "./buildStepper";
|
|
38
38
|
import { buildPopUp } from "./buildPop";
|
|
39
|
+
import { buildDataGrid } from "./buildDataGrid";
|
|
39
40
|
export let schema = {
|
|
40
41
|
type: "object",
|
|
41
42
|
properties: {},
|
|
@@ -166,6 +167,9 @@ const buildUiSchema = (config: any) => {
|
|
|
166
167
|
let elements: any = {};
|
|
167
168
|
const componentScope = `#/properties/${config.name}`;
|
|
168
169
|
switch (config.type) {
|
|
170
|
+
case "DataGrid":
|
|
171
|
+
elements = buildDataGrid(config, componentScope);
|
|
172
|
+
break;
|
|
169
173
|
case "Stepper":
|
|
170
174
|
elements = buildStepper(config, componentScope);
|
|
171
175
|
break;
|
|
@@ -53,9 +53,9 @@ const getArrayControl = (parentScope: string, childScope: string, childLabel?: s
|
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
}
|
|
56
|
-
}
|
|
57
|
-
const sizeHolder = getArrayControl("sizeHolder","keyName","Component Name");
|
|
58
|
-
sizeHolder.options.detail.elements[1] =
|
|
56
|
+
};
|
|
57
|
+
const sizeHolder = getArrayControl("sizeHolder", "keyName", "Component Name");
|
|
58
|
+
sizeHolder.options.detail.elements[1] = {
|
|
59
59
|
type: "Control",
|
|
60
60
|
scope: `#/properties/value`,
|
|
61
61
|
|
|
@@ -180,6 +180,12 @@ const GraphSection = {
|
|
|
180
180
|
export const buildPropertiesSection = function (type: String) {
|
|
181
181
|
let uiSchema = _.cloneDeep(GraphSection);
|
|
182
182
|
switch (type) {
|
|
183
|
+
case "DataGrid":
|
|
184
|
+
uiSchema.elements = [
|
|
185
|
+
getRadioInputField("useWrapper", "use Item Wrapper", ["YES", "NO"]),
|
|
186
|
+
getInputField("elevation", "Item Wrapper Elevation"),
|
|
187
|
+
]
|
|
188
|
+
break;
|
|
183
189
|
case "Stepper":
|
|
184
190
|
uiSchema.elements = [
|
|
185
191
|
getRadioInputField("resetButton", "Reset Button", ["YES", "NO"]),
|
|
@@ -10,6 +10,7 @@ export const ComponentSchema: any = {
|
|
|
10
10
|
{ title: "Card", const: "card" },
|
|
11
11
|
{ title: "CheckBox", const: "CheckBox" },
|
|
12
12
|
{ title: "Container", const: "WrapperSection" },
|
|
13
|
+
{ title: "DataGrid", const: "DataGrid" },
|
|
13
14
|
{ title: "Date", const: "Date" },
|
|
14
15
|
{ title: "Download File", const: "DownloadFile" },
|
|
15
16
|
{ title: "Empty Box", const: "EmptyBox" },
|
|
@@ -35,6 +35,7 @@ const sectionLabels = {
|
|
|
35
35
|
TextArea:["Core","Properties","style", "Event","Validation"],
|
|
36
36
|
PopUp: ["Core", "Components","Properties", "style"],
|
|
37
37
|
Stepper: ["Core", "Components","Properties","Event", "style"],
|
|
38
|
+
DataGrid: ["Core", "Components","Properties","Event", "style"],
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
|
|
@@ -36,6 +36,7 @@ export default (
|
|
|
36
36
|
uiSchema.elements[1].elements[0].elements[2] = getSelectField("inBuiltFunctionType", "Function Name", [
|
|
37
37
|
{ label: "RankProvider", value: "RankProvider" },
|
|
38
38
|
{ label: "Download File", value: "downloadFile" },
|
|
39
|
+
{ label: "Download Blob File", value: "downloadBlobFile" }
|
|
39
40
|
])
|
|
40
41
|
uiSchema.elements[1].elements[0].elements[3] = getTextArea("funcParametersCode", "Write Custom Code for Functions Parameter", true, { xs: 12, sm: 12, md: 6 });
|
|
41
42
|
schema.required = ["eventType", "Handler", "inBuiltFunctionType"]
|
|
@@ -14,4 +14,14 @@ export const downloadFile = (obj: any) => {
|
|
|
14
14
|
|
|
15
15
|
URL.revokeObjectURL(url);
|
|
16
16
|
document.body.removeChild(link);
|
|
17
|
-
};
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export const downloadBlobFile = (response: any) => {
|
|
20
|
+
const url = window.URL.createObjectURL(new Blob([response.data]));
|
|
21
|
+
const link = document.createElement('a');
|
|
22
|
+
link.href = url;
|
|
23
|
+
link.setAttribute('download', `${response.headers.data}`);
|
|
24
|
+
document.body.appendChild(link);
|
|
25
|
+
link.click();
|
|
26
|
+
link.parentNode.removeChild(link);
|
|
27
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _, { isEmpty } from "lodash";
|
|
2
|
-
import { downloadFile } from "./downloadFile";
|
|
2
|
+
import { downloadBlobFile, downloadFile } from "./downloadFile";
|
|
3
3
|
import { executeEvents, executeRefreshHandler } from "./events";
|
|
4
4
|
import { handlersProps } from "./interface";
|
|
5
5
|
let compType: string;
|
|
@@ -191,7 +191,8 @@ export default (funcParams: funcParamsProps) => {
|
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
193
|
},
|
|
194
|
-
downloadFile: downloadFile
|
|
194
|
+
downloadFile: downloadFile,
|
|
195
|
+
downloadBlobFile:downloadBlobFile,
|
|
195
196
|
};
|
|
196
197
|
};
|
|
197
198
|
|