@ezeep/ezeep-js 1.0.235 → 1.0.238
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/cjs/ezeep.cjs.js +1 -1
- package/dist/cjs/ezp-auth_15.cjs.entry.js +225 -107
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +206 -95
- package/dist/collection/components/ezp-printing/ezp-printing.js +6 -5
- package/dist/collection/components/ezp-upload/ezp-upload.js +13 -11
- package/dist/collection/services/print.js +9 -0
- package/dist/custom-elements/index.js +228 -110
- package/dist/directives/proxies.ts +2 -2
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_15.entry.js +225 -107
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_15.entry.js +3 -3
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-9e3d9e95.entry.js → p-0aba6822.entry.js} +2 -2
- package/dist/ezeep/p-84bd195a.system.js +1 -1
- package/dist/ezeep/{p-d89d8671.system.entry.js → p-dba5d7b7.system.entry.js} +3 -3
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +10 -3
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +1 -1
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +1 -1
- package/dist/types/components.d.ts +2 -2
- package/dist/types/services/print.d.ts +2 -0
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-9e3d9e95.entry.js → p-0aba6822.entry.js} +2 -2
- package/www/build/p-84bd195a.system.js +1 -1
- package/www/build/{p-d89d8671.system.entry.js → p-dba5d7b7.system.entry.js} +3 -3
- package/www/data/locales/de.json +3 -3
- package/www/data/locales/en.json +3 -3
|
@@ -7,7 +7,7 @@ export class EzpUpload {
|
|
|
7
7
|
* States
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
this.
|
|
10
|
+
this.selectedFiles = [];
|
|
11
11
|
this.dragging = false;
|
|
12
12
|
/**
|
|
13
13
|
*
|
|
@@ -15,8 +15,9 @@ export class EzpUpload {
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
this.handleInput = () => {
|
|
18
|
-
|
|
19
|
-
this.
|
|
18
|
+
const files = Array.from(this.input.files);
|
|
19
|
+
this.selectedFiles = files;
|
|
20
|
+
this.uploadFile.emit(files);
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
23
|
/**
|
|
@@ -39,12 +40,13 @@ export class EzpUpload {
|
|
|
39
40
|
event.stopPropagation();
|
|
40
41
|
event.preventDefault();
|
|
41
42
|
this.dragging = false;
|
|
42
|
-
|
|
43
|
-
this.
|
|
43
|
+
const files = Array.from(event.dataTransfer.files);
|
|
44
|
+
this.selectedFiles = files;
|
|
45
|
+
this.uploadFile.emit(files);
|
|
44
46
|
}
|
|
45
47
|
listenPrintCancel() {
|
|
46
48
|
this.form.reset();
|
|
47
|
-
this.
|
|
49
|
+
this.selectedFiles = [];
|
|
48
50
|
}
|
|
49
51
|
/**
|
|
50
52
|
*
|
|
@@ -61,11 +63,11 @@ export class EzpUpload {
|
|
|
61
63
|
h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }),
|
|
62
64
|
h("label", { htmlFor: "input", id: "select" },
|
|
63
65
|
h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })),
|
|
64
|
-
h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }),
|
|
66
|
+
h("input", { type: "file", name: "input", id: "input", multiple: true, ref: (input) => (this.input = input), onInput: this.handleInput }),
|
|
65
67
|
h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') })),
|
|
66
|
-
this.
|
|
67
|
-
h("ezp-label", { level: "secondary", text: i18next.t('upload.
|
|
68
|
-
h("ezp-label", { level: "tertiary", text:
|
|
68
|
+
this.selectedFiles.length > 0 && (h(Fragment, null,
|
|
69
|
+
h("ezp-label", { level: "secondary", text: i18next.t('upload.selected_files') }),
|
|
70
|
+
this.selectedFiles.map((file, index) => (h("ezp-label", { key: index, level: "tertiary", text: file.name })))))))));
|
|
69
71
|
}
|
|
70
72
|
static get is() { return "ezp-upload"; }
|
|
71
73
|
static get encapsulation() { return "shadow"; }
|
|
@@ -76,7 +78,7 @@ export class EzpUpload {
|
|
|
76
78
|
"$": ["ezp-upload.css"]
|
|
77
79
|
}; }
|
|
78
80
|
static get states() { return {
|
|
79
|
-
"
|
|
81
|
+
"selectedFiles": {},
|
|
80
82
|
"dragging": {}
|
|
81
83
|
}; }
|
|
82
84
|
static get events() { return [{
|
|
@@ -4,6 +4,7 @@ import fetchIntercept from 'fetch-intercept';
|
|
|
4
4
|
import { AnonymousCredential, BlockBlobClient, newPipeline } from '@azure/storage-blob';
|
|
5
5
|
export class EzpPrintService {
|
|
6
6
|
constructor(redirectURI, clientID) {
|
|
7
|
+
this.abortController = null;
|
|
7
8
|
this.getPrintStatus = () => {
|
|
8
9
|
return fetch(`https://${this.printingApi}/sfapi/Status/?id=${encodeURIComponent(printStore.state.jobID)}`, {
|
|
9
10
|
headers: {
|
|
@@ -92,6 +93,7 @@ export class EzpPrintService {
|
|
|
92
93
|
});
|
|
93
94
|
}
|
|
94
95
|
printFileByUrl(accessToken, fileUrl, fileType, printerID, properties, filename, printAndDelete) {
|
|
96
|
+
this.abortController = new AbortController();
|
|
95
97
|
return fetch(`https://${this.printingApi}/sfapi/Print/`, {
|
|
96
98
|
method: 'POST',
|
|
97
99
|
headers: {
|
|
@@ -99,8 +101,15 @@ export class EzpPrintService {
|
|
|
99
101
|
'Content-Type': 'application/json',
|
|
100
102
|
},
|
|
101
103
|
body: JSON.stringify(Object.assign(Object.assign(Object.assign({ fileurl: fileUrl, type: fileType, printerid: printerID }, (filename && { alias: filename })), (printAndDelete && { printanddelete: printAndDelete })), { properties })),
|
|
104
|
+
signal: this.abortController.signal
|
|
102
105
|
});
|
|
103
106
|
}
|
|
107
|
+
abortPrint() {
|
|
108
|
+
if (this.abortController) {
|
|
109
|
+
this.abortController.abort();
|
|
110
|
+
this.abortController = null;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
104
113
|
printByFileID(accessToken, fileID, fileType, printerID, properties, filename, printAndDelete) {
|
|
105
114
|
return fetch(`https://${this.printingApi}/sfapi/Print/`, {
|
|
106
115
|
method: 'POST',
|