impaktapps-ui-builder 1.0.72-flickering.1 → 1.0.72-flickering.3

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 buildUploadFileIcon: (config: any, componentScope: any) => any;
@@ -44,3 +44,27 @@ export declare const downloadFile: {
44
44
  widget: string;
45
45
  };
46
46
  };
47
+ export declare const uploadFileIcon: {
48
+ type: string;
49
+ scope: string;
50
+ config: {
51
+ main: {
52
+ label: string;
53
+ onUpload: string;
54
+ required: boolean;
55
+ errorMessage: string;
56
+ };
57
+ style: {
58
+ backgroundColor: string;
59
+ };
60
+ layout: {
61
+ xs: number;
62
+ sm: number;
63
+ md: number;
64
+ lg: number;
65
+ };
66
+ };
67
+ options: {
68
+ widget: string;
69
+ };
70
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.72-flickering.1",
3
+ "version": "1.0.72-flickering.3",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -42,6 +42,7 @@ import { buildTreeMap } from "./buildTreeMap";
42
42
  import { buildThoughtOfTheDay } from "./buildThoughtOfTheDay";
43
43
  import { buildHorizontalLayout } from "./buildHorizontalLayout";
44
44
  import { buildImage } from "./buildImage";
45
+ import { buildUploadFileIcon } from "./buildUploadFileIcon";
45
46
  export let schema = {
46
47
  type: "object",
47
48
  properties: {},
@@ -315,6 +316,8 @@ const buildUiSchema = (config: any, store?: any) => {
315
316
  case "Image":
316
317
  elements = buildImage(config, componentScope);
317
318
  break;
319
+ case "UploadFileIcon":
320
+ elements = buildUploadFileIcon(config, componentScope);
318
321
  default:
319
322
  schema = {
320
323
  type: "object",
@@ -0,0 +1,21 @@
1
+ import { uploadFileIcon } from "./uischema/file";
2
+ import _ from "lodash";
3
+ import { createLayoutFormat } from "./buildConfig";
4
+
5
+ export const buildUploadFileIcon = (config, componentScope) => {
6
+ const UploadFileIcon: any = _.cloneDeep(uploadFileIcon);
7
+
8
+ UploadFileIcon.scope = componentScope;
9
+ UploadFileIcon.config.main.label = config.label;
10
+ if (config.layout) {
11
+ UploadFileIcon.config.layout = createLayoutFormat(config.layout)
12
+ }
13
+ if (config.style) {
14
+ UploadFileIcon.config.style = JSON.parse(config.style);
15
+ }
16
+ if (config.required) {
17
+ UploadFileIcon.config.main.required = true;
18
+ }
19
+ UploadFileIcon.config.main.errorMessage = config.errorMessage;
20
+ return UploadFileIcon;
21
+ }
@@ -35,4 +35,27 @@ export const downloadFile = {
35
35
  "options": {
36
36
  "widget": "DownloadFile"
37
37
  }
38
- };
38
+ };
39
+
40
+
41
+ export const uploadFileIcon = {
42
+ "type": "Control",
43
+ "scope": "#/properties/uploadFileIcon",
44
+ "config": {
45
+ "main": {
46
+ "label": "AttachmentFile",
47
+ // "onClick": "onClick",
48
+ "onUpload": "onFileUpload",
49
+ // "onDownload":"onFileDownload",
50
+ "required": true,
51
+ "errorMessage": "Attachment File is not uploaded"
52
+ },
53
+ "style": {
54
+ "backgroundColor": "none"
55
+ },
56
+ layout: { xs: 6, sm: 6, md: 4, lg: 3 }
57
+ },
58
+ "options": {
59
+ "widget": "UploadFileIcon"
60
+ }
61
+ };
@@ -43,7 +43,9 @@ export const ComponentSchema: any = {
43
43
  { title: "Upload", const: "UploadFile" },
44
44
  { title: "Tree ", const: "TreeMap" },
45
45
  { title: "Column Group", const: "ColumnGroup" },
46
- { title: "Thought of the day", const: "Thought" }
46
+ { title: "Thought of the day", const: "Thought" },
47
+ { title: "Upload File Icon", const: "UploadFileIcon" }
48
+
47
49
  ]
48
50
  },
49
51
  elementType: {
@@ -20,6 +20,7 @@ const sectionLabels = {
20
20
  SpeedoMeter: ["Core", "Properties", "Events", "Style", "Validation"],
21
21
  card: ["Core", "Properties", "Events", "Style", "Validation"],
22
22
  UploadFile: ["Core", "Events", "Style", "Validation"],
23
+ UploadFileIcon: ["Core", "Events", "Style", "Validation"],
23
24
  Graph: ["Core", "Properties", "Events", "Style", "Validation"],
24
25
  DownloadFile: ["Core", "Events", "Style", "Validation"],
25
26
  Box: ["Core", "Events", "Style", "Validation"],
@@ -1,5 +1,4 @@
1
1
  import _ from "lodash";
2
- import cloneDeep from 'lodash';
3
2
  import { handlersProps } from "./interface";
4
3
  export const executeEvents = (params: handlersProps) => {
5
4
  let nextEvent = [];
@@ -189,25 +188,9 @@ function mergeFormdata(handlerResponse: any, componentName: string, eventConfig:
189
188
  }
190
189
  else if (eventConfig.type === "Table" && eventConfig.lazyLoading) {
191
190
  if (handlerResponse && handlerResponse?.data) {
192
-
193
- const tableData = Array.isArray(handlerResponse.data?.data)
194
- ? cloneDeep(handlerResponse.data.data)
195
- : cloneDeep(handlerResponse.data?.data);
196
-
197
- const rowCount = handlerResponse.data?.meta?.totalRowCount ?? null;
198
-
199
- const newFormDataHolder = {
200
- ...formDataHolder,
201
- [componentName]: tableData,
202
- [`${componentName}_RowCount`]: rowCount,
203
- };
204
- store.setFormdata((prev) => {
205
- // we merge prev with newFormDataHolder immutably:
206
- return { ...prev, ...newFormDataHolder }; // CHANGED: no in-place mutation
207
- });
208
- // formDataHolder[componentName] = handlerResponse.data?.data
209
- // formDataHolder[`${componentName}_RowCount`] = handlerResponse.data?.meta?.totalRowCount
210
- // store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
191
+ formDataHolder[componentName] = handlerResponse.data?.data
192
+ formDataHolder[`${componentName}_RowCount`] = handlerResponse.data?.meta?.totalRowCount
193
+ store.setFormdata((pre) => { return { ...pre, ...formDataHolder } });
211
194
  }
212
195
  }
213
196
  else {