impaktapps-ui-builder 1.0.181 → 1.0.195
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 +7 -66
- 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/runtime/services/downloadFile.d.ts +0 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/interface.d.ts +0 -1
- package/dist/src/impaktapps-ui-builder/runtime/services/service.d.ts +0 -2
- package/package.json +1 -1
- package/src/impaktapps-ui-builder/builder/build/buildEmptyBox.ts +3 -0
- package/src/impaktapps-ui-builder/builder/elements/UiSchema/event/schema.ts +0 -1
- package/src/impaktapps-ui-builder/runtime/services/downloadFile.ts +0 -78
- package/src/impaktapps-ui-builder/runtime/services/events.ts +3 -6
- package/src/impaktapps-ui-builder/runtime/services/interface.ts +0 -1
- package/src/impaktapps-ui-builder/runtime/services/service.ts +3 -5
|
@@ -9521,7 +9521,6 @@ const EventSchema = {
|
|
|
9521
9521
|
oneOf: [
|
|
9522
9522
|
{ title: "RankProvider", const: "RankProvider" },
|
|
9523
9523
|
{ title: "Download File", const: "downloadFile" },
|
|
9524
|
-
{ title: "Download File Stream", const: "downloadFileStream" },
|
|
9525
9524
|
{ title: "downloadFileFromUrl", const: "downloadFileFromUrl" }
|
|
9526
9525
|
]
|
|
9527
9526
|
},
|
|
@@ -10503,62 +10502,6 @@ const downloadFileFromUrl = (response, service2) => {
|
|
|
10503
10502
|
link.click();
|
|
10504
10503
|
link.parentNode.removeChild(link);
|
|
10505
10504
|
};
|
|
10506
|
-
const downloadFileStream = async (params2) => {
|
|
10507
|
-
try {
|
|
10508
|
-
let response;
|
|
10509
|
-
if (params2.method === "GET") {
|
|
10510
|
-
response = await params2.fetchservice.getStream(
|
|
10511
|
-
params2.url,
|
|
10512
|
-
params2.config
|
|
10513
|
-
);
|
|
10514
|
-
} else if (params2.method === "POST") {
|
|
10515
|
-
response = await params2.fetchservice.postStream(
|
|
10516
|
-
params2.url,
|
|
10517
|
-
params2.body,
|
|
10518
|
-
params2.config
|
|
10519
|
-
);
|
|
10520
|
-
} else {
|
|
10521
|
-
throw new Error(
|
|
10522
|
-
`Unsupported HTTP method: ${params2.method}. Only GET and POST are supported.`
|
|
10523
|
-
);
|
|
10524
|
-
}
|
|
10525
|
-
if (!response.ok) {
|
|
10526
|
-
throw new Error("Download failed");
|
|
10527
|
-
}
|
|
10528
|
-
const fileName = response.headers.get("filename") || "downloaded_file";
|
|
10529
|
-
const extension = fileName.includes(".") ? fileName.substring(fileName.lastIndexOf(".")) : "";
|
|
10530
|
-
const reader = response.body.getReader();
|
|
10531
|
-
const fileHandle = await window.showSaveFilePicker({
|
|
10532
|
-
suggestedName: fileName,
|
|
10533
|
-
types: extension ? [
|
|
10534
|
-
{
|
|
10535
|
-
description: "File",
|
|
10536
|
-
accept: {
|
|
10537
|
-
"application/octet-stream": [extension]
|
|
10538
|
-
}
|
|
10539
|
-
}
|
|
10540
|
-
] : void 0
|
|
10541
|
-
});
|
|
10542
|
-
const writable = await fileHandle.createWritable();
|
|
10543
|
-
while (true) {
|
|
10544
|
-
const { done, value } = await reader.read();
|
|
10545
|
-
if (done)
|
|
10546
|
-
break;
|
|
10547
|
-
await writable.write(value);
|
|
10548
|
-
}
|
|
10549
|
-
await writable.close();
|
|
10550
|
-
params2.store.setNotify({
|
|
10551
|
-
SuccessMessage: "File Downloaded Successfully",
|
|
10552
|
-
Success: true
|
|
10553
|
-
});
|
|
10554
|
-
} catch (e) {
|
|
10555
|
-
params2.store.setNotify({
|
|
10556
|
-
FailMessage: "File Download Failed",
|
|
10557
|
-
Fail: true
|
|
10558
|
-
});
|
|
10559
|
-
console.error(e);
|
|
10560
|
-
}
|
|
10561
|
-
};
|
|
10562
10505
|
const executeEvents = (params2) => {
|
|
10563
10506
|
var _a, _b, _c;
|
|
10564
10507
|
let nextEvent = [];
|
|
@@ -10680,13 +10623,10 @@ function executeInBuiltFunctionHandler(params) {
|
|
|
10680
10623
|
let parameter = {};
|
|
10681
10624
|
if (params.config.funcParametersCode) {
|
|
10682
10625
|
const makeFunc = eval(params.config.funcParametersCode);
|
|
10683
|
-
parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service
|
|
10684
|
-
params.serviceHolder[params.config.inBuiltFunctionType](
|
|
10685
|
-
parameter,
|
|
10686
|
-
params.service
|
|
10687
|
-
);
|
|
10626
|
+
parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service);
|
|
10627
|
+
params.serviceHolder[params.config.inBuiltFunctionType](parameter, params.service);
|
|
10688
10628
|
} else {
|
|
10689
|
-
params.serviceHolder[params.config.inBuiltFunctionType](params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service
|
|
10629
|
+
params.serviceHolder[params.config.inBuiltFunctionType](params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service);
|
|
10690
10630
|
}
|
|
10691
10631
|
}
|
|
10692
10632
|
function executeCustomHandler(params) {
|
|
@@ -10890,8 +10830,7 @@ var service = (funcParams) => {
|
|
|
10890
10830
|
dynamicData: funcParams.dynamicData,
|
|
10891
10831
|
userValue: funcParams.userValue,
|
|
10892
10832
|
service: funcParams.service,
|
|
10893
|
-
|
|
10894
|
-
serviceHolder: { downloadFile: downloadFile$1, download: downloadFileFromUrl, downloadFileStream, ...funcParams.functionsProvider },
|
|
10833
|
+
serviceHolder: { downloadFile: downloadFile$1, download: downloadFileFromUrl, ...funcParams.functionsProvider },
|
|
10895
10834
|
eventGroups,
|
|
10896
10835
|
functionsProvider: funcParams.functionsProvider,
|
|
10897
10836
|
formDataHolder
|
|
@@ -11153,7 +11092,6 @@ var service = (funcParams) => {
|
|
|
11153
11092
|
},
|
|
11154
11093
|
downloadFile: downloadFile$1,
|
|
11155
11094
|
downloadFileFromUrl,
|
|
11156
|
-
downloadFileStream,
|
|
11157
11095
|
...funcParams.functionsProvider
|
|
11158
11096
|
};
|
|
11159
11097
|
};
|
|
@@ -12665,6 +12603,9 @@ const buildEmptyBox = (config2, componentScope2) => {
|
|
|
12665
12603
|
if (config2.layout) {
|
|
12666
12604
|
EmptyBox.config.layout = createLayoutFormat(config2.layout);
|
|
12667
12605
|
}
|
|
12606
|
+
if (config2.style) {
|
|
12607
|
+
EmptyBox.config.style = JSON.parse(config2.style);
|
|
12608
|
+
}
|
|
12668
12609
|
return EmptyBox;
|
|
12669
12610
|
};
|
|
12670
12611
|
const ArrayUiSchema = {
|