impaktapps-ui-builder 1.0.182 → 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 -70
- package/dist/impaktapps-ui-builder.es.js.map +1 -1
- package/dist/impaktapps-ui-builder.umd.js +6 -6
- 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 -80
- 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,66 +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
|
-
params2.store.setNotify({
|
|
10529
|
-
SuccessMessage: "File Download Started Successfully",
|
|
10530
|
-
Success: true
|
|
10531
|
-
});
|
|
10532
|
-
const fileName = response.headers.get("filename") || "downloaded_file";
|
|
10533
|
-
const extension = fileName.includes(".") ? fileName.substring(fileName.lastIndexOf(".")) : "";
|
|
10534
|
-
const reader = response.body.getReader();
|
|
10535
|
-
const fileHandle = await window.showSaveFilePicker({
|
|
10536
|
-
suggestedName: fileName,
|
|
10537
|
-
types: extension ? [
|
|
10538
|
-
{
|
|
10539
|
-
description: "File",
|
|
10540
|
-
accept: {
|
|
10541
|
-
"application/octet-stream": [extension]
|
|
10542
|
-
}
|
|
10543
|
-
}
|
|
10544
|
-
] : void 0
|
|
10545
|
-
});
|
|
10546
|
-
const writable = await fileHandle.createWritable();
|
|
10547
|
-
while (true) {
|
|
10548
|
-
const { done, value } = await reader.read();
|
|
10549
|
-
if (done)
|
|
10550
|
-
break;
|
|
10551
|
-
await writable.write(value);
|
|
10552
|
-
}
|
|
10553
|
-
await writable.close();
|
|
10554
|
-
params2.store.setNotify({
|
|
10555
|
-
SuccessMessage: `File "${fileHandle.name}" downloaded successfully.`,
|
|
10556
|
-
Success: true
|
|
10557
|
-
});
|
|
10558
|
-
} catch (e) {
|
|
10559
|
-
params2.store.setNotify({
|
|
10560
|
-
FailMessage: "File Download Failed",
|
|
10561
|
-
Fail: true
|
|
10562
|
-
});
|
|
10563
|
-
console.error(e);
|
|
10564
|
-
}
|
|
10565
|
-
};
|
|
10566
10505
|
const executeEvents = (params2) => {
|
|
10567
10506
|
var _a, _b, _c;
|
|
10568
10507
|
let nextEvent = [];
|
|
@@ -10684,13 +10623,10 @@ function executeInBuiltFunctionHandler(params) {
|
|
|
10684
10623
|
let parameter = {};
|
|
10685
10624
|
if (params.config.funcParametersCode) {
|
|
10686
10625
|
const makeFunc = eval(params.config.funcParametersCode);
|
|
10687
|
-
parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service
|
|
10688
|
-
params.serviceHolder[params.config.inBuiltFunctionType](
|
|
10689
|
-
parameter,
|
|
10690
|
-
params.service
|
|
10691
|
-
);
|
|
10626
|
+
parameter = makeFunc(params.store, params.dynamicData, params.userValue, params.parentEventOutput, params.service);
|
|
10627
|
+
params.serviceHolder[params.config.inBuiltFunctionType](parameter, params.service);
|
|
10692
10628
|
} else {
|
|
10693
|
-
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);
|
|
10694
10630
|
}
|
|
10695
10631
|
}
|
|
10696
10632
|
function executeCustomHandler(params) {
|
|
@@ -10894,8 +10830,7 @@ var service = (funcParams) => {
|
|
|
10894
10830
|
dynamicData: funcParams.dynamicData,
|
|
10895
10831
|
userValue: funcParams.userValue,
|
|
10896
10832
|
service: funcParams.service,
|
|
10897
|
-
|
|
10898
|
-
serviceHolder: { downloadFile: downloadFile$1, download: downloadFileFromUrl, downloadFileStream, ...funcParams.functionsProvider },
|
|
10833
|
+
serviceHolder: { downloadFile: downloadFile$1, download: downloadFileFromUrl, ...funcParams.functionsProvider },
|
|
10899
10834
|
eventGroups,
|
|
10900
10835
|
functionsProvider: funcParams.functionsProvider,
|
|
10901
10836
|
formDataHolder
|
|
@@ -11157,7 +11092,6 @@ var service = (funcParams) => {
|
|
|
11157
11092
|
},
|
|
11158
11093
|
downloadFile: downloadFile$1,
|
|
11159
11094
|
downloadFileFromUrl,
|
|
11160
|
-
downloadFileStream,
|
|
11161
11095
|
...funcParams.functionsProvider
|
|
11162
11096
|
};
|
|
11163
11097
|
};
|
|
@@ -12669,6 +12603,9 @@ const buildEmptyBox = (config2, componentScope2) => {
|
|
|
12669
12603
|
if (config2.layout) {
|
|
12670
12604
|
EmptyBox.config.layout = createLayoutFormat(config2.layout);
|
|
12671
12605
|
}
|
|
12606
|
+
if (config2.style) {
|
|
12607
|
+
EmptyBox.config.style = JSON.parse(config2.style);
|
|
12608
|
+
}
|
|
12672
12609
|
return EmptyBox;
|
|
12673
12610
|
};
|
|
12674
12611
|
const ArrayUiSchema = {
|