impaktapps-ui-builder 0.0.310 → 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.
- package/dist/impaktapps-ui-builder.es.js +64 -3
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +5 -5
- package/dist/impaktapps-ui-builder.umd.js.map +1 -1
- package/dist/src/impaktapps-ui-builder/builder/build/buildFileInput.d.ts +1 -0
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +2 -0
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildFileInput.ts +35 -0
- package/src/impaktapps-ui-builder/builder/build/buildUiSchema.ts +4 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/Component/schema.ts +1 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +2 -0
- package/src/impaktapps-ui-builder/runtime/services/events.ts +4 -3
- package/src/impaktapps-ui-builder/runtime/services/service.ts +20 -5
|
@@ -5874,6 +5874,7 @@ const ComponentSchema = {
|
|
|
5874
5874
|
{ title: "Date", const: "Date" },
|
|
5875
5875
|
{ title: "Download File", const: "DownloadFile" },
|
|
5876
5876
|
{ title: "Empty Box", const: "EmptyBox" },
|
|
5877
|
+
{ title: "File", const: "FileInput" },
|
|
5877
5878
|
{ title: "Graph", const: "Graph" },
|
|
5878
5879
|
{ title: "Label", const: "Box" },
|
|
5879
5880
|
{ title: "LeaderBoard", const: "LeaderBoard" },
|
|
@@ -7465,6 +7466,8 @@ const EventSchema = {
|
|
|
7465
7466
|
{ title: "Click Event", const: "onClick" },
|
|
7466
7467
|
{ title: "onStart", const: "onStart" },
|
|
7467
7468
|
{ title: "Load Event", const: "onLoad" },
|
|
7469
|
+
{ title: "File Upload Event", const: "onUpload" },
|
|
7470
|
+
{ title: "File Download Event", const: "onDownload" },
|
|
7468
7471
|
{ title: "Change Event", const: "onChange" },
|
|
7469
7472
|
{ title: "Success", const: "Success" },
|
|
7470
7473
|
{ title: "Fail", const: "Fail" }
|
|
@@ -8081,11 +8084,12 @@ async function executeEventsHandler(params2) {
|
|
|
8081
8084
|
} else if (params2.config.Handler === "refresh") {
|
|
8082
8085
|
return await executeRefreshHandler(params2);
|
|
8083
8086
|
} else if (params2.config.Handler === "mergeFormdata") {
|
|
8084
|
-
const result = mergeFormdata(
|
|
8087
|
+
const result = await mergeFormdata(
|
|
8085
8088
|
params2.parentEventOutput,
|
|
8086
8089
|
params2.componentName,
|
|
8087
8090
|
params2.config,
|
|
8088
|
-
params2.store
|
|
8091
|
+
params2.store,
|
|
8092
|
+
params2.service
|
|
8089
8093
|
);
|
|
8090
8094
|
return result;
|
|
8091
8095
|
}
|
|
@@ -8126,7 +8130,7 @@ async function executeCustomHandler(params) {
|
|
|
8126
8130
|
const response = await makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service, params.componentName);
|
|
8127
8131
|
return response;
|
|
8128
8132
|
}
|
|
8129
|
-
function mergeFormdata(handlerResponse, componentName, eventConfig, store2) {
|
|
8133
|
+
async function mergeFormdata(handlerResponse, componentName, eventConfig, store2, service2) {
|
|
8130
8134
|
if (eventConfig.type === "Select" && !(_.isEmpty(handlerResponse == null ? void 0 : handlerResponse.data) && (handlerResponse == null ? void 0 : handlerResponse.data))) {
|
|
8131
8135
|
store2.setSchema((pre) => {
|
|
8132
8136
|
var _a;
|
|
@@ -8169,6 +8173,7 @@ function mergeFormdata(handlerResponse, componentName, eventConfig, store2) {
|
|
|
8169
8173
|
store2.setFormdata((pre) => {
|
|
8170
8174
|
return { ...pre, [componentName]: eventConfig.lazyLoading ? handlerResponse.data.data : handlerResponse.data };
|
|
8171
8175
|
});
|
|
8176
|
+
await service2.get("https://jsonplaceholder.typicode.com/posts/1");
|
|
8172
8177
|
}
|
|
8173
8178
|
}
|
|
8174
8179
|
}
|
|
@@ -8338,6 +8343,28 @@ var service = (funcParams) => {
|
|
|
8338
8343
|
});
|
|
8339
8344
|
}
|
|
8340
8345
|
},
|
|
8346
|
+
onFileDownload: async () => {
|
|
8347
|
+
var _a;
|
|
8348
|
+
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
|
|
8349
|
+
for (const eventConfig of eventGroups == null ? void 0 : eventGroups.onFileDownload[path]) {
|
|
8350
|
+
await executeEvents({
|
|
8351
|
+
...executeEventsParameters,
|
|
8352
|
+
config: eventConfig,
|
|
8353
|
+
componentName: path
|
|
8354
|
+
});
|
|
8355
|
+
}
|
|
8356
|
+
},
|
|
8357
|
+
onFileUpload: async () => {
|
|
8358
|
+
var _a;
|
|
8359
|
+
const path = ((_a = funcParams.dynamicData) == null ? void 0 : _a.tableButtonPath) || funcParams.dynamicData.path.split(".")[0];
|
|
8360
|
+
for (const eventConfig of eventGroups == null ? void 0 : eventGroups.onFileUpload[path]) {
|
|
8361
|
+
await executeEvents({
|
|
8362
|
+
...executeEventsParameters,
|
|
8363
|
+
config: eventConfig,
|
|
8364
|
+
componentName: path
|
|
8365
|
+
});
|
|
8366
|
+
}
|
|
8367
|
+
},
|
|
8341
8368
|
onPaginationChange: async function(paginationValues) {
|
|
8342
8369
|
var _a;
|
|
8343
8370
|
const apiBody = [
|
|
@@ -10081,6 +10108,37 @@ const buildPanField = (config, componentScope) => {
|
|
|
10081
10108
|
inputField.scope = componentScope;
|
|
10082
10109
|
return inputField;
|
|
10083
10110
|
};
|
|
10111
|
+
const FileInput = {
|
|
10112
|
+
type: "Control",
|
|
10113
|
+
scope: "#/properties/docAggrementCopy",
|
|
10114
|
+
options: {
|
|
10115
|
+
widget: "FileInput"
|
|
10116
|
+
},
|
|
10117
|
+
config: {
|
|
10118
|
+
layout: 11.5,
|
|
10119
|
+
main: {
|
|
10120
|
+
required: false,
|
|
10121
|
+
onUpload: "onFileUpload",
|
|
10122
|
+
onDownload: "onFileDownload",
|
|
10123
|
+
label: "Aggrement Copy"
|
|
10124
|
+
},
|
|
10125
|
+
style: {
|
|
10126
|
+
backgroundColor: "none"
|
|
10127
|
+
}
|
|
10128
|
+
}
|
|
10129
|
+
};
|
|
10130
|
+
const buildFileInput = (config, componentScope) => {
|
|
10131
|
+
const box = _.cloneDeep(FileInput);
|
|
10132
|
+
box.scope = componentScope;
|
|
10133
|
+
box.config.main.heading = config.label;
|
|
10134
|
+
if (config.layout) {
|
|
10135
|
+
box.config.layout = createLayoutFormat(config.layout);
|
|
10136
|
+
}
|
|
10137
|
+
if (config.style) {
|
|
10138
|
+
box.config.style = JSON.parse(config.style);
|
|
10139
|
+
}
|
|
10140
|
+
return box;
|
|
10141
|
+
};
|
|
10084
10142
|
let schema = {
|
|
10085
10143
|
type: "object",
|
|
10086
10144
|
properties: {},
|
|
@@ -10199,6 +10257,9 @@ const buildUiSchema = (config) => {
|
|
|
10199
10257
|
let elements = {};
|
|
10200
10258
|
const componentScope = `#/properties/${config.name}`;
|
|
10201
10259
|
switch (config.type) {
|
|
10260
|
+
case "FileInput":
|
|
10261
|
+
elements = buildFileInput(config, componentScope);
|
|
10262
|
+
break;
|
|
10202
10263
|
case "AadharcardText":
|
|
10203
10264
|
elements = buildAdhaarField(config, componentScope);
|
|
10204
10265
|
break;
|