impaktapps-ui-builder 0.0.366 → 0.0.368

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.
@@ -1 +1,2 @@
1
1
  export declare const downloadFile: (obj: any) => void;
2
+ export declare const downloadBlobFile: (response: any) => void;
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.366",
3
+ "version": "0.0.368",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -0,0 +1,42 @@
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.label) {
33
+ DataGrid.config.main.label = config.label;
34
+ }
35
+ if (config.layout) {
36
+ DataGrid.config.layout = createLayoutFormat(config.layout)
37
+ }
38
+ if (config.style) {
39
+ DataGrid.config.style = JSON.parse(config.style)
40
+ }
41
+ return DataGrid;
42
+ }
@@ -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
 
@@ -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