impaktapps-ui-builder 0.0.311 → 0.0.312

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.
@@ -0,0 +1 @@
1
+ export declare const buildFileInput: (config: any, componentScope: any) => any;
@@ -11,6 +11,8 @@ interface funcParamsProps {
11
11
  declare const _default: (funcParams: funcParamsProps) => {
12
12
  setPage: () => Promise<void>;
13
13
  onClick: () => Promise<void>;
14
+ onFileDownload: () => Promise<void>;
15
+ onFileUpload: () => Promise<void>;
14
16
  onPaginationChange: (paginationValues: any) => Promise<any>;
15
17
  getSelectOptions: (param: any) => Promise<any>;
16
18
  onChange: () => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.311",
3
+ "version": "0.0.312",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -0,0 +1,35 @@
1
+ import _ from "lodash";
2
+ import { createLayoutFormat } from "./buildConfig";
3
+
4
+ const FileInput = {
5
+ type: "Control",
6
+ scope: "#/properties/docAggrementCopy",
7
+ options: {
8
+ widget: "FileInput",
9
+ },
10
+ config: {
11
+ layout: 11.5,
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
+ },
22
+ },
23
+ };
24
+ export const buildFileInput = (config,componentScope) => {
25
+ const box: any = _.cloneDeep(FileInput);
26
+ box.scope = componentScope;
27
+ box.config.main.heading = config.label
28
+ if(config.layout){
29
+ box.config.layout = createLayoutFormat(config.layout)
30
+ }
31
+ if (config.style) {
32
+ box.config.style = JSON.parse(config.style)
33
+ }
34
+ return box;
35
+ }
@@ -33,6 +33,7 @@ import { buildRadio } from "./buildRadio";
33
33
  import { buildEmptyBox } from "./buildEmptyBox";
34
34
  import { buildArray } from "./buildArray";
35
35
  import { buildAdhaarField, buildPanField } from "./buildAadharCard";
36
+ import { buildFileInput } from "./buildFileInput";
36
37
  export let schema = {
37
38
  type: "object",
38
39
  properties: {},
@@ -163,6 +164,9 @@ const buildUiSchema = (config: any) => {
163
164
  let elements: any = {};
164
165
  const componentScope = `#/properties/${config.name}`;
165
166
  switch (config.type) {
167
+ case "FileInput":
168
+ elements = buildFileInput(config, componentScope);
169
+ break;
166
170
  case "AadharcardText":
167
171
  elements = buildAdhaarField(config, componentScope);
168
172
  break;
@@ -13,6 +13,7 @@ export const ComponentSchema: any = {
13
13
  { title: "Date", const: "Date" },
14
14
  { title: "Download File", const: "DownloadFile" },
15
15
  { title: "Empty Box", const: "EmptyBox" },
16
+ { title: "File", const: "FileInput" },
16
17
  { title: "Graph", const: "Graph" },
17
18
  { title: "Label", const: "Box" },
18
19
  { title: "LeaderBoard", const: "LeaderBoard" },
@@ -41,6 +41,8 @@ export const EventSchema = {
41
41
  { title: "Click Event", const: "onClick" },
42
42
  { title: "onStart", const: "onStart" },
43
43
  { title: "Load Event", const: "onLoad" },
44
+ { title: "File Upload Event", const: "onUpload" },
45
+ { title: "File Download Event", const: "onDownload" },
44
46
  { title: "Change Event", const: "onChange" },
45
47
  { title: "Success", const: "Success" },
46
48
  { title: "Fail", const: "Fail" }
@@ -70,7 +70,6 @@ export default (funcParams: funcParamsProps) => {
70
70
  serviceHolder: this, eventGroups
71
71
  }
72
72
  funcParams.store.setSchema(
73
- // funcParams.schema
74
73
  (pre: any) => {
75
74
  return {
76
75
  ...funcParams.schema, properties:
@@ -85,10 +84,6 @@ export default (funcParams: funcParamsProps) => {
85
84
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
86
85
  serviceHolder: this, eventGroups
87
86
  })
88
-
89
-
90
-
91
-
92
87
  },
93
88
  onClick: async function () {
94
89
  const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
@@ -100,6 +95,26 @@ export default (funcParams: funcParamsProps) => {
100
95
  })
101
96
  }
102
97
  },
98
+ onFileDownload:async () =>{
99
+ const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
100
+ for (const eventConfig of eventGroups?.onFileDownload[path]) {
101
+ await executeEvents({
102
+ ...executeEventsParameters,
103
+ config: eventConfig,
104
+ componentName: path
105
+ })
106
+ }
107
+ },
108
+ onFileUpload:async () =>{
109
+ const path = funcParams.dynamicData?.tableButtonPath || funcParams.dynamicData.path.split(".")[0];
110
+ for (const eventConfig of eventGroups?.onFileUpload[path]) {
111
+ await executeEvents({
112
+ ...executeEventsParameters,
113
+ config: eventConfig,
114
+ componentName: path
115
+ })
116
+ }
117
+ },
103
118
  onPaginationChange: async function (paginationValues) {
104
119
  const apiBody = [
105
120
  { key: "size", value: paginationValues.pagination.pageSize },