impaktapps-ui-builder 1.0.102 → 1.0.104
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 +136 -121
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +13 -13
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildUiSchema.d.ts +1 -5
- package/dist/src/impaktapps-ui-builder/lib/index.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/downloadFile.d.ts +5 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +3 -1
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildTable.ts +12 -9
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +98 -109
- package/src/impaktapps-ui-builder/builder/build/uischema/buildPropertiesSection.ts +6 -6
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +7 -6
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +4 -1
- package/src/impaktapps-ui-builder/builder/services/component.ts +1 -1
- package/src/impaktapps-ui-builder/lib/index.ts +10 -9
- package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +34 -2
- package/src/impaktapps-ui-builder/runtime/services/service.ts +18 -15
|
@@ -3,10 +3,6 @@ export declare let schema: {
|
|
|
3
3
|
properties: {};
|
|
4
4
|
required: any[];
|
|
5
5
|
};
|
|
6
|
-
export declare
|
|
7
|
-
type: string;
|
|
8
|
-
properties: {};
|
|
9
|
-
required: any[];
|
|
10
|
-
};
|
|
6
|
+
export declare function buildSchema(config: any): any;
|
|
11
7
|
declare const buildUiSchema: (config: any, store?: any) => any;
|
|
12
8
|
export default buildUiSchema;
|
|
@@ -7,3 +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";
|
|
@@ -1,2 +1,6 @@
|
|
|
1
1
|
export declare const downloadFile: (obj: any) => void;
|
|
2
|
-
export declare
|
|
2
|
+
export declare function downloadFileFromBase64({ data, name }: {
|
|
3
|
+
data: string;
|
|
4
|
+
name: string;
|
|
5
|
+
}): void;
|
|
6
|
+
export declare const downloadFileFromUrl: (response: any, service: any) => void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { downloadFileFromBase64 } from "./downloadFile";
|
|
1
2
|
interface funcParamsProps {
|
|
2
3
|
store: any;
|
|
3
4
|
dynamicData: any;
|
|
@@ -28,6 +29,7 @@ declare const _default: (funcParams: funcParamsProps) => {
|
|
|
28
29
|
onReset: (functionParameters: any) => Promise<void>;
|
|
29
30
|
callHandler: (eventType: string, functionParameters?: any) => Promise<void>;
|
|
30
31
|
downloadFile: (obj: any) => void;
|
|
31
|
-
|
|
32
|
+
downloadFileFromUrl: (response: any, service: any) => void;
|
|
33
|
+
downloadFileFromBase64: typeof downloadFileFromBase64;
|
|
32
34
|
};
|
|
33
35
|
export default _default;
|
package/package.json
CHANGED
|
@@ -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;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import _ from "lodash";
|
|
2
|
-
import emptyBox from "./uischema/emptyBox";
|
|
3
|
-
import cardSlider from "./uischema/cardSlider";
|
|
4
2
|
import { buildLeaderBoard } from "./buildLeaderboard";
|
|
5
3
|
import { buildProgressBarCard } from "./buildProgressBarCard";
|
|
6
4
|
import { buildProgressBar } from "./buildProgressBar";
|
|
@@ -47,126 +45,117 @@ export let schema = {
|
|
|
47
45
|
properties: {},
|
|
48
46
|
required: []
|
|
49
47
|
};
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
items: {
|
|
66
|
-
oneOf: configObj.value.map((e) => {
|
|
67
|
-
return { const: e.value, title: e.label }
|
|
68
|
-
})
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
48
|
+
function buildOneOf(values: any[]) {
|
|
49
|
+
return values.map((e) => ({
|
|
50
|
+
const: e.value,
|
|
51
|
+
title: e.label
|
|
52
|
+
}));
|
|
53
|
+
}
|
|
54
|
+
function applyValidations(
|
|
55
|
+
schemaNode: any,
|
|
56
|
+
validations: any[] = [],
|
|
57
|
+
requiredArr?: string[],
|
|
58
|
+
fieldName?: string
|
|
59
|
+
) {
|
|
60
|
+
validations.forEach((rule) => {
|
|
61
|
+
if (rule.validationType === "readOnly") {
|
|
62
|
+
schemaNode.disabled = true
|
|
73
63
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
oneOf: configObj.value.map((e) => {
|
|
78
|
-
return { const: e.value, title: e.label }
|
|
79
|
-
})
|
|
64
|
+
if (rule.validationType === "required") {
|
|
65
|
+
if (requiredArr && fieldName) {
|
|
66
|
+
requiredArr.push(fieldName);
|
|
80
67
|
}
|
|
68
|
+
} else {
|
|
69
|
+
schemaNode.type = "string";
|
|
70
|
+
schemaNode[rule.validationType] =
|
|
71
|
+
isNaN(rule.validationValue)
|
|
72
|
+
? rule.validationValue
|
|
73
|
+
: Number(rule.validationValue);
|
|
81
74
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function buildNode(config: any): any {
|
|
79
|
+
if (config.type === "Array") {
|
|
80
|
+
const arraySchema: any = {
|
|
81
|
+
type: "array",
|
|
82
|
+
items: {
|
|
83
|
+
type: "object",
|
|
84
|
+
properties: {},
|
|
85
|
+
required: []
|
|
89
86
|
}
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
if (configObj.validation) {
|
|
93
|
-
configObj.validation.forEach((rule: any) => {
|
|
94
|
-
if (tableName) {
|
|
95
|
-
if (schema.properties?.[tableName]?.items?.properties) {
|
|
96
|
-
if (!schema.properties?.[tableName]?.items?.properties?.[configObj.name]) {
|
|
97
|
-
schema.properties[tableName].items.properties[configObj.name] = {};
|
|
98
|
-
if (configObj.type === "Select" || configObj.value?.length > 0) {
|
|
99
|
-
schema.properties[tableName].items.properties[configObj.name] = {
|
|
100
|
-
oneOf: configObj.value.map((e) => {
|
|
101
|
-
return { const: e.value, title: e.label }
|
|
102
|
-
})
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
else if (configObj.type === "MultipleSelect" || configObj.value?.length > 0) {
|
|
106
|
-
schema.properties[tableName].items.properties[configObj.name] = {
|
|
107
|
-
items: {
|
|
108
|
-
oneOf: configObj.value.map((e) => {
|
|
109
|
-
return { const: e.value, title: e.label }
|
|
110
|
-
})
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
if (rule.validationType === "required") {
|
|
116
|
-
schema.properties?.[tableName]?.items?.required.push(configObj.name)
|
|
117
|
-
} else {
|
|
118
|
-
schema.properties[tableName].items.properties[configObj.name]["type"] = "string"
|
|
119
|
-
schema.properties[tableName].items.properties[configObj.name][rule.validationType] =
|
|
120
|
-
isNaN(rule.validationValue) ?
|
|
121
|
-
rule.validationValue : Number(rule.validationValue)
|
|
122
|
-
}
|
|
87
|
+
};
|
|
123
88
|
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
schema.properties[configObj.name]["type"] = "string"
|
|
133
|
-
schema.properties[configObj.name][rule.validationType] =
|
|
134
|
-
isNaN(rule.validationValue) ?
|
|
135
|
-
rule.validationValue : Number(rule.validationValue)
|
|
136
|
-
}
|
|
89
|
+
config.elements?.forEach((child: any) => {
|
|
90
|
+
const childNode = buildNode(child);
|
|
91
|
+
if (!childNode) return;
|
|
92
|
+
|
|
93
|
+
arraySchema.items.properties[child.name] = childNode.schema;
|
|
94
|
+
|
|
95
|
+
if (childNode.required?.length) {
|
|
96
|
+
arraySchema.items.required.push(child.name);
|
|
137
97
|
}
|
|
138
98
|
});
|
|
99
|
+
|
|
100
|
+
return { schema: arraySchema };
|
|
139
101
|
}
|
|
140
102
|
|
|
103
|
+
let fieldSchema: any = {};
|
|
104
|
+
if (
|
|
105
|
+
(config.type === "Select" || config.type === "MultipleSelect") &&
|
|
106
|
+
config.value?.length > 0
|
|
107
|
+
) {
|
|
108
|
+
if (config.type === "Select") {
|
|
109
|
+
fieldSchema.oneOf = buildOneOf(config.value);
|
|
110
|
+
} else {
|
|
111
|
+
fieldSchema.type = "array";
|
|
112
|
+
fieldSchema.items = {
|
|
113
|
+
oneOf: buildOneOf(config.value)
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
if (config.validation) {
|
|
119
|
+
applyValidations(fieldSchema, config.validation);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
const required =
|
|
123
|
+
config.validation?.some(
|
|
124
|
+
(v: any) => v.validationType === "required"
|
|
125
|
+
)
|
|
126
|
+
? [config.name]
|
|
127
|
+
: [];
|
|
141
128
|
|
|
129
|
+
return {
|
|
130
|
+
schema: fieldSchema,
|
|
131
|
+
required
|
|
132
|
+
};
|
|
142
133
|
}
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
})
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
config.elements.map((e, elemInd) => {
|
|
163
|
-
buildSchema(e)
|
|
164
|
-
})
|
|
134
|
+
|
|
135
|
+
export function buildSchema(config: any): any {
|
|
136
|
+
const schema: any = {
|
|
137
|
+
type: "object",
|
|
138
|
+
properties: {},
|
|
139
|
+
required: []
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
config.elements?.forEach((element: any) => {
|
|
143
|
+
const node = buildNode(element);
|
|
144
|
+
if (!node) return;
|
|
145
|
+
|
|
146
|
+
schema.properties[element.name] = node.schema;
|
|
147
|
+
|
|
148
|
+
if (node.required?.length) {
|
|
149
|
+
schema.required.push(element.name);
|
|
165
150
|
}
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
if (schema.required.length === 0) {
|
|
154
|
+
delete schema.required;
|
|
166
155
|
}
|
|
167
|
-
return schema;
|
|
168
|
-
}
|
|
169
156
|
|
|
157
|
+
return schema;
|
|
158
|
+
};
|
|
170
159
|
|
|
171
160
|
const buildUiSchema = (config: any, store?: any) => {
|
|
172
161
|
let elements: any = {};
|
|
@@ -387,7 +376,7 @@ const buildUiSchema = (config: any, store?: any) => {
|
|
|
387
376
|
}
|
|
388
377
|
if (cellElem.elementType == "tableHeader") {
|
|
389
378
|
const headerElem = buildUiSchema(cellElem, store);
|
|
390
|
-
tableHeaderElements.push({widget:headerElem});
|
|
379
|
+
tableHeaderElements.push({ widget: headerElem });
|
|
391
380
|
return false;
|
|
392
381
|
}
|
|
393
382
|
const tableElem = {
|
|
@@ -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
|
-
|
|
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
|
}
|
|
@@ -58,15 +58,15 @@ export const ComponentSchema: any = {
|
|
|
58
58
|
{ title: "Date Column", const: "date" },
|
|
59
59
|
{ title: "DateTime Column", const: "dateTime" },
|
|
60
60
|
{ title: "Amount Column", const: "amount" },
|
|
61
|
-
{ title: "Center Column", const: "action"}
|
|
61
|
+
{ title: "Center Column", const: "action" }
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
variant: {
|
|
65
65
|
oneOf: [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
{ title: "Outlined", const: "outlined" },
|
|
67
|
+
{ title: "Filled", const: "filled" },
|
|
68
|
+
{ title: "Standard", const: "standard" },
|
|
69
|
+
]
|
|
70
70
|
},
|
|
71
71
|
orientation: {
|
|
72
72
|
oneOf: [
|
|
@@ -83,7 +83,7 @@ export const ComponentSchema: any = {
|
|
|
83
83
|
{ title: "Put", const: "put" },
|
|
84
84
|
]
|
|
85
85
|
},
|
|
86
|
-
maxPageSize:{
|
|
86
|
+
maxPageSize: {
|
|
87
87
|
type: "number",
|
|
88
88
|
oneOf: [
|
|
89
89
|
{ title: "10", const: 10 },
|
|
@@ -297,6 +297,7 @@ export const ComponentSchema: any = {
|
|
|
297
297
|
{ const: "minLength", title: "Minimum Length" },
|
|
298
298
|
{ const: "maxLength", title: "Maximum Length" },
|
|
299
299
|
{ const: "pattern", title: "Pattern" },
|
|
300
|
+
{ const: "readOnly", title: "Read Only" },
|
|
300
301
|
]
|
|
301
302
|
},
|
|
302
303
|
validationValue: {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { title } from "process";
|
|
2
|
+
|
|
1
3
|
export const EventSchema = {
|
|
2
4
|
type: "object",
|
|
3
5
|
properties: {
|
|
@@ -72,7 +74,8 @@ export const EventSchema = {
|
|
|
72
74
|
oneOf: [
|
|
73
75
|
{ title: "RankProvider", const: "RankProvider" },
|
|
74
76
|
{ title: "Download File", const: "downloadFile" },
|
|
75
|
-
{ title: "
|
|
77
|
+
{ title: "downloadFileFromUrl", const: "downloadFileFromUrl" },
|
|
78
|
+
{ title: "downloadFileFromBase64", const: "downloadFileFromBase64" }
|
|
76
79
|
]
|
|
77
80
|
},
|
|
78
81
|
body: {
|
|
@@ -30,7 +30,7 @@ const sectionLabels = {
|
|
|
30
30
|
Timer: ["Core", "Events", "Style", "Validation"],
|
|
31
31
|
Rank: ["Core", "Events", "Style", "Validation"],
|
|
32
32
|
Button: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
33
|
-
Array: ["Core", "Components", "Properties","Validation"],
|
|
33
|
+
Array: ["Core", "Components", "Properties","Events","Validation"],
|
|
34
34
|
Radio: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
35
35
|
Text: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
36
36
|
TextArea: ["Core", "Properties", "Events", "Style", "Validation"],
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
|
|
2
|
-
export {default as pageMaster} from "../builder/services/pageMaster"
|
|
3
|
-
export {default as pageMasterEvents} from "../builder/services/event"
|
|
4
|
-
export {default as pageMasterComponents} from "../builder/services/component"
|
|
5
|
-
export {default as pageService} from "../runtime/services/service"
|
|
6
|
-
export { schema} from "../builder/build/buildUiSchema"
|
|
7
|
-
export {default as buildConfig} from "../builder/build/buildConfig"
|
|
8
|
-
export
|
|
9
|
-
export
|
|
10
|
-
export {default as clearFromSessionStorage} from "../builder/services/utils"
|
|
2
|
+
export { default as pageMaster } from "../builder/services/pageMaster"
|
|
3
|
+
export { default as pageMasterEvents } from "../builder/services/event"
|
|
4
|
+
export { default as pageMasterComponents } from "../builder/services/component"
|
|
5
|
+
export { default as pageService } from "../runtime/services/service"
|
|
6
|
+
export { schema } from "../builder/build/buildUiSchema"
|
|
7
|
+
export { default as buildConfig } from "../builder/build/buildConfig"
|
|
8
|
+
export { default as buildUiSchema } from "../builder/build/buildUiSchema"
|
|
9
|
+
export { buildSchema } from "../builder/build/buildUiSchema"
|
|
10
|
+
export { default as clearFromSessionStorage } from "../builder/services/utils"
|
|
11
|
+
export { downloadFileFromBase64, downloadFileFromUrl } from "../runtime/services/downloadFile"
|
|
@@ -15,13 +15,43 @@ export const downloadFile = (obj: any) => {
|
|
|
15
15
|
URL.revokeObjectURL(url);
|
|
16
16
|
document.body.removeChild(link);
|
|
17
17
|
};
|
|
18
|
+
export function downloadFileFromBase64({ data, name }: { data: string; name: string }) {
|
|
19
|
+
const binary = window.atob(data);
|
|
20
|
+
const bytes = new Uint8Array(binary.length);
|
|
18
21
|
|
|
19
|
-
|
|
22
|
+
for (let i = 0; i < binary.length; i++) {
|
|
23
|
+
bytes[i] = binary.charCodeAt(i);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const extension = name.split(".").pop()?.toLowerCase();
|
|
27
|
+
const mimeMap: Record<string, string> = {
|
|
28
|
+
pdf: "application/pdf",
|
|
29
|
+
png: "image/png",
|
|
30
|
+
jpg: "image/jpeg",
|
|
31
|
+
jpeg: "image/jpeg",
|
|
32
|
+
xlsx: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
|
33
|
+
csv: "text/csv",
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const blob = new Blob([bytes], {
|
|
37
|
+
type: mimeMap[extension!] || "application/octet-stream",
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
const url = URL.createObjectURL(blob);
|
|
41
|
+
const a = document.createElement("a");
|
|
42
|
+
a.href = url;
|
|
43
|
+
a.download = name;
|
|
44
|
+
a.click();
|
|
45
|
+
|
|
46
|
+
URL.revokeObjectURL(url);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export const downloadFileFromUrl = (response: any, service) => {
|
|
20
50
|
let url = `${service.defaults.baseURL}/${response.path}`;
|
|
21
51
|
if (response?.params) {
|
|
22
52
|
const keysArray = Object.keys(response?.params);
|
|
23
53
|
keysArray.map((e, i) => {
|
|
24
|
-
url = url + `${i === 0?"?":"&"}${e}=${response?.params[e]}`
|
|
54
|
+
url = url + `${i === 0 ? "?" : "&"}${e}=${response?.params[e]}`
|
|
25
55
|
})
|
|
26
56
|
}
|
|
27
57
|
const link = document.createElement('a');
|
|
@@ -30,3 +60,5 @@ export const doDownload = (response: any, service) => {
|
|
|
30
60
|
link.click();
|
|
31
61
|
link.parentNode.removeChild(link);
|
|
32
62
|
};
|
|
63
|
+
|
|
64
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _, { isEmpty } from "lodash";
|
|
2
|
-
import {
|
|
2
|
+
import { downloadFileFromUrl, downloadFile, downloadFileFromBase64 } 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:
|
|
69
|
+
serviceHolder: { downloadFile, download: downloadFileFromUrl, downloadFileFromBase64, ...funcParams.functionsProvider }, eventGroups,
|
|
70
70
|
functionsProvider: funcParams.functionsProvider, formDataHolder
|
|
71
71
|
};
|
|
72
72
|
return {
|
|
@@ -106,24 +106,26 @@ export default (funcParams: funcParamsProps) => {
|
|
|
106
106
|
store: funcParams.store, dynamicData: funcParams.dynamicData, userValue: funcParams.userValue, service: funcParams.service,
|
|
107
107
|
serviceHolder: this, eventGroups, formDataHolder: {}
|
|
108
108
|
})
|
|
109
|
-
|
|
109
|
+
|
|
110
110
|
uiSchema.elements.push(notifyUiSchema);
|
|
111
111
|
funcParams.store.setUiSchema(uiSchema);
|
|
112
112
|
},
|
|
113
113
|
onCellRenderer: (cellParams) => {
|
|
114
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
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
|
},
|
|
@@ -165,7 +167,7 @@ export default (funcParams: funcParamsProps) => {
|
|
|
165
167
|
{ key: "sorting", value: paginationValues.sorting || [] },
|
|
166
168
|
{ key: "filters", value: paginationValues.tableColumnConfig || [] },
|
|
167
169
|
{ key: "globalFilter", value: paginationValues.globalFilter ?? '' },
|
|
168
|
-
{ key: "expandedRowIds", value: paginationValues.expandedRowIds ?? []}
|
|
170
|
+
{ key: "expandedRowIds", value: paginationValues.expandedRowIds ?? [] }
|
|
169
171
|
]
|
|
170
172
|
const response = await this.callExecuteEvents(paginationValues, apiBody, "onLoad");
|
|
171
173
|
return response?.data;
|
|
@@ -256,7 +258,8 @@ export default (funcParams: funcParamsProps) => {
|
|
|
256
258
|
}
|
|
257
259
|
},
|
|
258
260
|
downloadFile: downloadFile,
|
|
259
|
-
|
|
261
|
+
downloadFileFromUrl: downloadFileFromUrl,
|
|
262
|
+
downloadFileFromBase64: downloadFileFromBase64,
|
|
260
263
|
...funcParams.functionsProvider
|
|
261
264
|
};
|
|
262
265
|
};
|