impaktapps-ui-builder 1.0.103 → 1.0.105

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.
@@ -7,4 +7,4 @@ export { default as buildConfig } from "../builder/build/buildConfig";
7
7
  export { default as buildUiSchema } from "../builder/build/buildUiSchema";
8
8
  export { buildSchema } from "../builder/build/buildUiSchema";
9
9
  export { default as clearFromSessionStorage } from "../builder/services/utils";
10
- export { downloadFileFromBase64, downloadFileFromUrl } from "../runtime/services/downloadFile";
10
+ export { downloadFile, downloadFileFromUrl } from "../runtime/services/downloadFile";
@@ -1,5 +1,4 @@
1
- export declare const downloadFile: (obj: any) => void;
2
- export declare function downloadFileFromBase64({ data, name }: {
1
+ export declare function downloadFile({ data, name }: {
3
2
  data: string;
4
3
  name: string;
5
4
  }): void;
@@ -1,4 +1,4 @@
1
- import { downloadFileFromBase64 } from "./downloadFile";
1
+ import { downloadFile } from "./downloadFile";
2
2
  interface funcParamsProps {
3
3
  store: any;
4
4
  dynamicData: any;
@@ -28,8 +28,7 @@ declare const _default: (funcParams: funcParamsProps) => {
28
28
  onNext: (functionParameters: any) => Promise<void>;
29
29
  onReset: (functionParameters: any) => Promise<void>;
30
30
  callHandler: (eventType: string, functionParameters?: any) => Promise<void>;
31
- downloadFile: (obj: any) => void;
31
+ downloadFile: typeof downloadFile;
32
32
  downloadFileFromUrl: (response: any, service: any) => void;
33
- downloadFileFromBase64: typeof downloadFileFromBase64;
34
33
  };
35
34
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.103",
3
+ "version": "1.0.105",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -10,6 +10,9 @@ export const buildTable = (config: any, componentScope: string) => {
10
10
  if (config.lazyLoading) {
11
11
  table.config.main.lazyLoading = config.lazyLoading === "YES" ? true : false;
12
12
  }
13
+ if (config.defaultColumnSize) {
14
+ table.config.main.enableRowMovement = config.defaultColumnSize
15
+ }
13
16
  if (config.enableRowMovement) {
14
17
  table.config.main.enableRowMovement = config.enableRowMovement === "YES" ? true : false;
15
18
  }
@@ -41,28 +44,28 @@ export const buildTable = (config: any, componentScope: string) => {
41
44
  if (config.downloadAllData) {
42
45
  table.config.main.downloadAllData = config.downloadAllData === "YES" ? true : false
43
46
  }
44
- if(config.disableGlobalSearch){
47
+ if (config.disableGlobalSearch) {
45
48
  table.config.main.disableGlobalSearch = config.disableGlobalSearch === "YES" ? true : false
46
49
  }
47
- if(config.disableColumnFilter){
50
+ if (config.disableColumnFilter) {
48
51
  table.config.main.disableColumnFilter = config.disableColumnFilter === "YES" ? true : false
49
52
  }
50
- if(config.disableSorting){
53
+ if (config.disableSorting) {
51
54
  table.config.main.disableSorting = config.disableSorting === "YES" ? true : false
52
55
  }
53
- if(config.disableEditColumn){
56
+ if (config.disableEditColumn) {
54
57
  table.config.main.disableEditColumn = config.disableEditColumn === "YES" ? true : false
55
58
  }
56
- if(config.disableFullScreenToggle){
59
+ if (config.disableFullScreenToggle) {
57
60
  table.config.main.disableFullScreenToggle = config.disableFullScreenToggle === "YES" ? true : false
58
61
  }
59
- if(config.disableDensityToggle){
62
+ if (config.disableDensityToggle) {
60
63
  table.config.main.disableDensityToggle = config.disableDensityToggle === "YES" ? true : false
61
64
  }
62
- if(config.disableDownloadFile){
65
+ if (config.disableDownloadFile) {
63
66
  table.config.main.disableDownloadFile = config.disableDownloadFile === "YES" ? true : false
64
67
  }
65
- if(config.disablePagination){
68
+ if (config.disablePagination) {
66
69
  table.config.main.disablePagination = config.disablePagination === "YES" ? true : false
67
70
  }
68
71
  if (config.Table_Download_Keys_Name) {
@@ -71,7 +74,7 @@ export const buildTable = (config: any, componentScope: string) => {
71
74
  if (config.selectKey) {
72
75
  table.config.main.selectKey = config.selectKey
73
76
  }
74
- if(config.maxPageSize){
77
+ if (config.maxPageSize) {
75
78
  table.config.main.maxPageSize = config.maxPageSize
76
79
  }
77
80
  return table;
@@ -327,7 +327,7 @@ export const buildPropertiesSection = function (type: String) {
327
327
  emptyBox("PopUpEmpty", { xs: 6, sm: 6, md: 0, lg: 0 })
328
328
  ]
329
329
  break;
330
- case "Text":
330
+ case "Text":
331
331
  uiSchema.elements = [
332
332
  getInputField("placeholder", "Placeholder"),
333
333
  getRadioInputField("multiline", "Multiline", ["YES", "NO"]),
@@ -477,7 +477,7 @@ export const buildPropertiesSection = function (type: String) {
477
477
  getRadioInputField("disableDensityToggle", "Disable Density Toggle", ["YES", "NO"]),
478
478
  getRadioInputField("disableDownloadFile", "Disable Download File", ["YES", "NO"]),
479
479
  getRadioInputField("disablePagination", "Disable Pagination", ["YES", "NO"]),
480
- getInputField("selectKey", "Selection Key"),
480
+ getInputField("selectKey", "Selection Key"),//defaultColumnSize
481
481
  getMultiSelectField("filteringOptions", "Filtering Options"),
482
482
  getSelectField("maxPageSize", "Max Page Size", [
483
483
  { label: "10", value: 10 },
@@ -494,7 +494,7 @@ export const buildPropertiesSection = function (type: String) {
494
494
  getRadioInputField("paginateExpandedRows", "Multi Page Expansion", ["YES", "NO"]),
495
495
  getRadioInputField("treeStructure", "Flat Tree Structure", ["YES", "NO"]),
496
496
  getRadioInputField("filterFromLeafRows", "Filter from tree rows", ["YES", "NO"]),
497
- emptyBox("LazyLoadingTableEmpty2"), emptyBox("LazyLoadingTableEmpty3")
497
+ getInputField("defaultColumnSize", "Default Column Size"), , emptyBox("LazyLoadingTableEmpty3")
498
498
  ]),
499
499
  getArrayControl("Table_Download_Keys_Name", "KeyName", "Table Key Name"),
500
500
  sizeHolder,
@@ -532,7 +532,7 @@ export const buildPropertiesSection = function (type: String) {
532
532
  emptyBox("MultipleSelectEmpty2")
533
533
  ]
534
534
  break;
535
- case "Date":
535
+ case "Date":
536
536
  uiSchema.elements = [
537
537
  getSelectField("variant", "Variant", [
538
538
  { label: "Outlined", value: "outlined" },
@@ -542,7 +542,7 @@ export const buildPropertiesSection = function (type: String) {
542
542
  emptyBox("DateEmpty1", { xs: 6, sm: 6, md: 8, lg: 9 }),
543
543
  ]
544
544
  break;
545
- case "DateTime":
545
+ case "DateTime":
546
546
  uiSchema.elements = [
547
547
  getSelectField("variant", "Variant", [
548
548
  { label: "Outlined", value: "outlined" },
@@ -569,7 +569,7 @@ export const buildPropertiesSection = function (type: String) {
569
569
  getRadioInputField("variant", "Variant", ["Outlined", "Standard"]),
570
570
  getRadioInputField("disableUpload", "Disable Upload", ["YES", "NO"]),
571
571
  getRadioInputField("disableDelete", "Disable Delete", ["YES", "NO"]),
572
- getRadioInputField("disableDownload", "Disable Download", ["YES", "NO"])
572
+ getRadioInputField("disableDownload", "Disable Download", ["YES", "NO"])
573
573
  ]
574
574
  break;
575
575
  }
@@ -75,7 +75,6 @@ export const EventSchema = {
75
75
  { title: "RankProvider", const: "RankProvider" },
76
76
  { title: "Download File", const: "downloadFile" },
77
77
  { title: "downloadFileFromUrl", const: "downloadFileFromUrl" },
78
- { title: "downloadFileFromBase64", const: "downloadFileFromBase64" }
79
78
  ]
80
79
  },
81
80
  body: {
@@ -8,4 +8,4 @@ export { default as buildConfig } from "../builder/build/buildConfig"
8
8
  export { default as buildUiSchema } from "../builder/build/buildUiSchema"
9
9
  export { buildSchema } from "../builder/build/buildUiSchema"
10
10
  export { default as clearFromSessionStorage } from "../builder/services/utils"
11
- export { downloadFileFromBase64, downloadFileFromUrl } from "../runtime/services/downloadFile"
11
+ export { downloadFile, downloadFileFromUrl } from "../runtime/services/downloadFile"
@@ -1,21 +1,4 @@
1
- export const downloadFile = (obj: any) => {
2
- const typeArr = obj.name.split(".");
3
- const data = obj.data;
4
- const finalData = window.atob(data);
5
- let file;
6
- file = new File([finalData], typeArr[typeArr.length - 1]);
7
-
8
- const url = URL.createObjectURL(file);
9
- const link = document.createElement("a");
10
- link.href = typeArr[typeArr.length - 1] === 'pdf' ? 'data:application/octet-stream;base64,' + data : url;
11
- link.download = `${obj.name}`;
12
- document.body.appendChild(link);
13
- link.click();
14
-
15
- URL.revokeObjectURL(url);
16
- document.body.removeChild(link);
17
- };
18
- export function downloadFileFromBase64({ data, name }: { data: string; name: string }) {
1
+ export function downloadFile({ data, name }: { data: string; name: string }) {
19
2
  const binary = window.atob(data);
20
3
  const bytes = new Uint8Array(binary.length);
21
4
 
@@ -53,7 +36,7 @@ export const downloadFileFromUrl = (response: any, service) => {
53
36
  keysArray.map((e, i) => {
54
37
  url = url + `${i === 0 ? "?" : "&"}${e}=${response?.params[e]}`
55
38
  })
56
- }
39
+ };
57
40
  const link = document.createElement('a');
58
41
  link.href = url;
59
42
  document.body.appendChild(link);
@@ -1,5 +1,5 @@
1
1
  import _, { isEmpty } from "lodash";
2
- import { downloadFileFromUrl, downloadFile, downloadFileFromBase64 } from "./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;
@@ -66,7 +66,7 @@ export default (funcParams: funcParamsProps) => {
66
66
  let executeEventsParameters: handlersProps = {
67
67
  config: {}, componentName: "",
68
68
  store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
69
- serviceHolder: { downloadFile, download: downloadFileFromUrl,downloadFileFromBase64, ...funcParams.functionsProvider }, eventGroups,
69
+ serviceHolder: { downloadFile, download: downloadFileFromUrl, ...funcParams.functionsProvider }, eventGroups,
70
70
  functionsProvider: funcParams.functionsProvider, formDataHolder
71
71
  };
72
72
  return {
@@ -111,19 +111,21 @@ export default (funcParams: funcParamsProps) => {
111
111
  funcParams.store.setUiSchema(uiSchema);
112
112
  },
113
113
  onCellRenderer: (cellParams) => {
114
- if (eventGroups.onCellRenderer) {
114
+ const cloneEventGroup = _.cloneDeep(eventGroups)
115
+ if (cloneEventGroup.onCellRenderer) {
115
116
  let finalResponse = {};
116
117
  const path = funcParams.dynamicData?.tableButtonPath || funcParams?.dynamicData?.path?.split(".")[0];
117
-
118
- for (const eventConfig of eventGroups?.onCellRenderer?.[path]) {
119
- executeEventsParameters.store.functionParameters = cellParams
120
- finalResponse = executeEvents({
121
- ...executeEventsParameters,
122
- config: eventConfig,
123
- componentName: path
124
- })
118
+ if (cloneEventGroup?.onCellRenderer?.[path]) {
119
+ for (const eventConfig of cloneEventGroup?.onCellRenderer?.[path]) {
120
+ executeEventsParameters.store.functionParameters = cellParams
121
+ finalResponse = executeEvents({
122
+ ...executeEventsParameters,
123
+ config: eventConfig,
124
+ componentName: path
125
+ })
126
+ }
127
+ return finalResponse
125
128
  }
126
- return finalResponse
127
129
  }
128
130
  return {}
129
131
  },
@@ -257,7 +259,6 @@ export default (funcParams: funcParamsProps) => {
257
259
  },
258
260
  downloadFile: downloadFile,
259
261
  downloadFileFromUrl: downloadFileFromUrl,
260
- downloadFileFromBase64: downloadFileFromBase64,
261
262
  ...funcParams.functionsProvider
262
263
  };
263
264
  };