@ezeep/ezeep-js 1.0.237 → 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 +214 -107
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +204 -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/custom-elements/index.js +217 -110
- package/dist/directives/proxies.ts +2 -2
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_15.entry.js +214 -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-7b589922.entry.js → p-0aba6822.entry.js} +2 -2
- package/dist/ezeep/p-84bd195a.system.js +1 -1
- package/dist/ezeep/{p-62b9b554.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/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-7b589922.entry.js → p-0aba6822.entry.js} +2 -2
- package/www/build/p-84bd195a.system.js +1 -1
- package/www/build/{p-62b9b554.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
package/dist/esm/ezeep.js
CHANGED
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
|
|
16
16
|
patchBrowser().then(options => {
|
|
17
17
|
globalScripts();
|
|
18
|
-
return bootstrapLazy([["ezp-auth_15",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"
|
|
18
|
+
return bootstrapLazy([["ezp-auth_15",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"hideheader":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"code":[1],"filedata":[1],"seamless":[4],"printOpen":[32],"authOpen":[32],"onlyGetSasUri":[32],"noDocumentOpen":[32],"systemAppearance":[32],"files":[32],"open":[64],"logOut":[64],"getSasUri":[64],"getAuthUri":[64],"checkAuth":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"files":[16],"hidemenu":[4],"hideheader":[4],"seamless":[4],"loading":[32],"printProcessing":[32],"pageRangeInvalid":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32],"paperid":[32],"currentFileIndex":[32],"totalFiles":[32],"failedFiles":[32],"successfulFiles":[32],"partialSuccess":[32]},[[0,"inputValueChanged","listenInputValueChanged"],[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"trigger":[1],"code":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
19
19
|
});
|
|
@@ -2886,11 +2886,11 @@ const button_actions$1 = {
|
|
|
2886
2886
|
select_printer: "Wähle Drucker"
|
|
2887
2887
|
};
|
|
2888
2888
|
const upload$1 = {
|
|
2889
|
-
description: "Ziehe
|
|
2889
|
+
description: "Ziehe Dateien hier in den Browser ",
|
|
2890
2890
|
meta_leading: "oder",
|
|
2891
|
-
meta_select: "wähle
|
|
2891
|
+
meta_select: "wähle Dateien aus",
|
|
2892
2892
|
meta_trailing: "um mit ezeep Blue zu drucken.",
|
|
2893
|
-
|
|
2893
|
+
selected_files: "Ausgewählte Dateien:"
|
|
2894
2894
|
};
|
|
2895
2895
|
const user_menu$1 = {
|
|
2896
2896
|
theme: "Farbschema",
|
|
@@ -2969,11 +2969,11 @@ const button_actions = {
|
|
|
2969
2969
|
select_printer: "Select Printer"
|
|
2970
2970
|
};
|
|
2971
2971
|
const upload = {
|
|
2972
|
-
description: "Drop
|
|
2972
|
+
description: "Drop files here into the browser ",
|
|
2973
2973
|
meta_leading: "or",
|
|
2974
|
-
meta_select: "select
|
|
2974
|
+
meta_select: "select files",
|
|
2975
2975
|
meta_trailing: "to print with ezeep Blue.",
|
|
2976
|
-
|
|
2976
|
+
selected_files: "Selected Files:"
|
|
2977
2977
|
};
|
|
2978
2978
|
const user_menu = {
|
|
2979
2979
|
theme: "Color theme",
|
|
@@ -32766,7 +32766,6 @@ let EzpPrinterSelection = class {
|
|
|
32766
32766
|
this.printCancel = createEvent(this, "printCancel", 7);
|
|
32767
32767
|
this.printSubmit = createEvent(this, "printSubmit", 7);
|
|
32768
32768
|
this.logout = createEvent(this, "logout", 7);
|
|
32769
|
-
this.sasUri = '';
|
|
32770
32769
|
this.fileExtension = '';
|
|
32771
32770
|
this.duplexOptions = [
|
|
32772
32771
|
{
|
|
@@ -32790,7 +32789,7 @@ let EzpPrinterSelection = class {
|
|
|
32790
32789
|
{
|
|
32791
32790
|
id: 2,
|
|
32792
32791
|
title: i18next.t('printer_selection.color_grayscale'),
|
|
32793
|
-
}
|
|
32792
|
+
},
|
|
32794
32793
|
];
|
|
32795
32794
|
this.hidemenu = false;
|
|
32796
32795
|
this.hideheader = false;
|
|
@@ -32817,14 +32816,14 @@ let EzpPrinterSelection = class {
|
|
|
32817
32816
|
Paper: '',
|
|
32818
32817
|
Orientation: '',
|
|
32819
32818
|
Resolution: '',
|
|
32820
|
-
Tray: ''
|
|
32819
|
+
Tray: '',
|
|
32821
32820
|
},
|
|
32822
32821
|
OrientationsSupported: [],
|
|
32823
32822
|
PaperFormats: [],
|
|
32824
32823
|
Resolutions: [],
|
|
32825
32824
|
DuplexSupported: false,
|
|
32826
32825
|
Color: false,
|
|
32827
|
-
Trays: []
|
|
32826
|
+
Trays: [],
|
|
32828
32827
|
};
|
|
32829
32828
|
// needs to be initialised with empty strings
|
|
32830
32829
|
this.selectedProperties = {
|
|
@@ -32842,6 +32841,11 @@ let EzpPrinterSelection = class {
|
|
|
32842
32841
|
trayname: '',
|
|
32843
32842
|
PageRanges: '',
|
|
32844
32843
|
};
|
|
32844
|
+
this.currentFileIndex = 0;
|
|
32845
|
+
this.totalFiles = 0;
|
|
32846
|
+
this.failedFiles = [];
|
|
32847
|
+
this.successfulFiles = [];
|
|
32848
|
+
this.partialSuccess = false;
|
|
32845
32849
|
/**
|
|
32846
32850
|
*
|
|
32847
32851
|
* Private methods
|
|
@@ -32849,6 +32853,9 @@ let EzpPrinterSelection = class {
|
|
|
32849
32853
|
*/
|
|
32850
32854
|
/** Description... */
|
|
32851
32855
|
this.handleCancel = () => {
|
|
32856
|
+
this.failedFiles = [];
|
|
32857
|
+
this.successfulFiles = [];
|
|
32858
|
+
this.partialSuccess = false;
|
|
32852
32859
|
this.printCancel.emit();
|
|
32853
32860
|
};
|
|
32854
32861
|
this.validateData = (data) => {
|
|
@@ -32865,9 +32872,14 @@ let EzpPrinterSelection = class {
|
|
|
32865
32872
|
this.handlePrint = async () => {
|
|
32866
32873
|
this.printButton.blur();
|
|
32867
32874
|
this.printProcessing = true;
|
|
32875
|
+
this.failedFiles = [];
|
|
32876
|
+
this.successfulFiles = [];
|
|
32877
|
+
this.partialSuccess = false;
|
|
32868
32878
|
// we have to initialse this obj with empty strings to display the select component
|
|
32869
32879
|
// but don't want to send any attributes with empty strings to the API
|
|
32870
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
32880
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
32881
|
+
this.selectedPrinterConfig.Trays.length >= 0 &&
|
|
32882
|
+
this.selectedPrinterConfig.Trays[0] == null) {
|
|
32871
32883
|
delete this.selectedProperties.trayname;
|
|
32872
32884
|
delete this.selectedProperties.defaultSource;
|
|
32873
32885
|
}
|
|
@@ -32927,8 +32939,8 @@ let EzpPrinterSelection = class {
|
|
|
32927
32939
|
this.printProcessing = false;
|
|
32928
32940
|
});
|
|
32929
32941
|
}
|
|
32930
|
-
if (this.
|
|
32931
|
-
await this.handleFiles(this.
|
|
32942
|
+
if (this.files && this.files.length > 0) {
|
|
32943
|
+
await this.handleFiles(this.files, cleanPrintProperties);
|
|
32932
32944
|
}
|
|
32933
32945
|
localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
|
|
32934
32946
|
localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
|
|
@@ -32976,11 +32988,16 @@ let EzpPrinterSelection = class {
|
|
|
32976
32988
|
switch (event.detail) {
|
|
32977
32989
|
case 'print-success':
|
|
32978
32990
|
this.printSuccess = false;
|
|
32991
|
+
this.partialSuccess = false;
|
|
32992
|
+
this.failedFiles = [];
|
|
32993
|
+
this.successfulFiles = [];
|
|
32979
32994
|
this.printCancel.emit();
|
|
32980
32995
|
break;
|
|
32981
32996
|
case 'print-failed':
|
|
32982
32997
|
this.printProcessing = false;
|
|
32983
32998
|
this.printFailed = false;
|
|
32999
|
+
this.failedFiles = [];
|
|
33000
|
+
this.successfulFiles = [];
|
|
32984
33001
|
break;
|
|
32985
33002
|
case 'no-printers':
|
|
32986
33003
|
this.noPrinters = false;
|
|
@@ -33040,18 +33057,23 @@ let EzpPrinterSelection = class {
|
|
|
33040
33057
|
.then((data) => {
|
|
33041
33058
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
33042
33059
|
this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
|
|
33043
|
-
this.selectedProperties.color =
|
|
33060
|
+
this.selectedProperties.color =
|
|
33061
|
+
((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
|
|
33044
33062
|
this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
|
|
33045
33063
|
this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
|
|
33046
|
-
let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
|
|
33064
|
+
let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
|
|
33047
33065
|
this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
|
|
33048
33066
|
this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
|
|
33049
|
-
let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
|
|
33050
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33067
|
+
let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
|
|
33068
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33069
|
+
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
33070
|
+
this.selectedPrinterConfig.Trays[0] != null) {
|
|
33051
33071
|
this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
|
|
33052
33072
|
this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
|
|
33053
33073
|
}
|
|
33054
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33074
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33075
|
+
this.selectedPrinterConfig.Trays.length >= 0 &&
|
|
33076
|
+
this.selectedPrinterConfig.Trays[0] == null) {
|
|
33055
33077
|
delete this.selectedProperties.trayname;
|
|
33056
33078
|
delete this.selectedProperties.defaultSource;
|
|
33057
33079
|
}
|
|
@@ -33062,7 +33084,8 @@ let EzpPrinterSelection = class {
|
|
|
33062
33084
|
// this.setDefaultPaperFormat()
|
|
33063
33085
|
break;
|
|
33064
33086
|
case 'color':
|
|
33065
|
-
this.selectedProperties.color =
|
|
33087
|
+
this.selectedProperties.color =
|
|
33088
|
+
eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
|
|
33066
33089
|
break;
|
|
33067
33090
|
case 'orientation':
|
|
33068
33091
|
this.selectedProperties.orientation = eventDetails.id;
|
|
@@ -33081,11 +33104,15 @@ let EzpPrinterSelection = class {
|
|
|
33081
33104
|
this.selectedProperties.paperwidth = eventDetails.value;
|
|
33082
33105
|
break;
|
|
33083
33106
|
case 'tray':
|
|
33084
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33107
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33108
|
+
this.selectedPrinterConfig.Trays.length >= 0 &&
|
|
33109
|
+
this.selectedPrinterConfig.Trays[0] == null) {
|
|
33085
33110
|
delete this.selectedProperties.trayname;
|
|
33086
33111
|
delete this.selectedProperties.defaultSource;
|
|
33087
33112
|
}
|
|
33088
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33113
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33114
|
+
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
33115
|
+
this.selectedPrinterConfig.Trays[0] != null) {
|
|
33089
33116
|
this.selectedProperties.trayname = eventDetails.title;
|
|
33090
33117
|
this.selectedProperties.defaultSource = eventDetails.id;
|
|
33091
33118
|
}
|
|
@@ -33095,9 +33122,9 @@ let EzpPrinterSelection = class {
|
|
|
33095
33122
|
this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
|
|
33096
33123
|
break;
|
|
33097
33124
|
case 'duplex':
|
|
33098
|
-
if (eventDetails.title == i18next.t('printer_selection.duplex_none')
|
|
33099
|
-
|
|
33100
|
-
|
|
33125
|
+
if (eventDetails.title == i18next.t('printer_selection.duplex_none') ||
|
|
33126
|
+
eventDetails.title == i18next.t('printer_selection.duplex_long') ||
|
|
33127
|
+
eventDetails.title == i18next.t('printer_selection.duplex_short')) {
|
|
33101
33128
|
this.selectedProperties.duplex = true;
|
|
33102
33129
|
}
|
|
33103
33130
|
else {
|
|
@@ -33108,59 +33135,107 @@ let EzpPrinterSelection = class {
|
|
|
33108
33135
|
}
|
|
33109
33136
|
this.setPaperid();
|
|
33110
33137
|
}
|
|
33111
|
-
async handleFiles(
|
|
33138
|
+
async handleFiles(files, printPorperties) {
|
|
33139
|
+
this.totalFiles = files.length;
|
|
33140
|
+
this.currentFileIndex = 0;
|
|
33141
|
+
this.failedFiles = [];
|
|
33142
|
+
this.successfulFiles = [];
|
|
33143
|
+
// Process each file individually
|
|
33144
|
+
for (let i = 0; i < files.length; i++) {
|
|
33145
|
+
this.currentFileIndex = i;
|
|
33146
|
+
const file = files[i];
|
|
33147
|
+
try {
|
|
33148
|
+
await this.processSingleFile(file, printPorperties);
|
|
33149
|
+
this.successfulFiles.push(file.name);
|
|
33150
|
+
}
|
|
33151
|
+
catch (error) {
|
|
33152
|
+
console.error(`Error processing file ${file.name}:`, error);
|
|
33153
|
+
this.failedFiles.push(file.name);
|
|
33154
|
+
// Continue with the next file instead of stopping
|
|
33155
|
+
}
|
|
33156
|
+
}
|
|
33157
|
+
// Determine final status based on results
|
|
33158
|
+
if (this.failedFiles.length === 0) {
|
|
33159
|
+
// All files processed successfully
|
|
33160
|
+
this.printSuccess = true;
|
|
33161
|
+
this.partialSuccess = false;
|
|
33162
|
+
this.printProcessing = false;
|
|
33163
|
+
}
|
|
33164
|
+
else if (this.successfulFiles.length === 0) {
|
|
33165
|
+
// All files failed
|
|
33166
|
+
this.printFailed = true;
|
|
33167
|
+
this.partialSuccess = false;
|
|
33168
|
+
this.printProcessing = false;
|
|
33169
|
+
}
|
|
33170
|
+
else {
|
|
33171
|
+
// Some files succeeded, some failed - show partial success
|
|
33172
|
+
this.printSuccess = true;
|
|
33173
|
+
this.partialSuccess = true;
|
|
33174
|
+
this.printProcessing = false;
|
|
33175
|
+
}
|
|
33176
|
+
}
|
|
33177
|
+
async processSingleFile(file, printProperties) {
|
|
33112
33178
|
this.preparingUpload = true;
|
|
33113
33179
|
const response = await this.printService.prepareFileUpload(authStore.state.accessToken);
|
|
33114
33180
|
this.preparingUpload = false;
|
|
33115
|
-
|
|
33116
|
-
|
|
33117
|
-
|
|
33118
|
-
let res;
|
|
33181
|
+
const fileid = response.fileid;
|
|
33182
|
+
const sasUri = response.sasUri;
|
|
33183
|
+
const filetype = this.getFileExtension(file.name);
|
|
33119
33184
|
this.uploading = true;
|
|
33120
33185
|
try {
|
|
33121
|
-
|
|
33122
|
-
|
|
33123
|
-
|
|
33124
|
-
|
|
33125
|
-
|
|
33126
|
-
}
|
|
33127
|
-
this.uploading = false;
|
|
33128
|
-
if (res._response.status === 201) {
|
|
33129
|
-
this.printService
|
|
33130
|
-
.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, printPorperties, this.filename)
|
|
33131
|
-
.then((data) => {
|
|
33186
|
+
// Upload the file
|
|
33187
|
+
const res = await this.printService.uploadBlobFiles(sasUri, file);
|
|
33188
|
+
if (res._response.status === 201) {
|
|
33189
|
+
// Print the file
|
|
33190
|
+
const data = await this.printService.printByFileID(authStore.state.accessToken, fileid, filetype, this.selectedPrinter.id, printProperties, file.name);
|
|
33132
33191
|
if (data.code === 804) {
|
|
33133
|
-
|
|
33134
|
-
this.printProcessing = false;
|
|
33192
|
+
throw new Error(`Print failed for file: ${file.name}`);
|
|
33135
33193
|
}
|
|
33136
33194
|
if (data.jobid) {
|
|
33137
33195
|
printStore.state.jobID = data.jobid;
|
|
33138
|
-
|
|
33139
|
-
|
|
33140
|
-
validate: this.validateData,
|
|
33141
|
-
interval: this.POLL_INTERVAL,
|
|
33142
|
-
maxAttempts: this.MAX_POLL_ATTEMPTS,
|
|
33143
|
-
}).catch((err) => {
|
|
33144
|
-
console.log(err);
|
|
33145
|
-
this.printFailed = true;
|
|
33146
|
-
this.printProcessing = false;
|
|
33147
|
-
});
|
|
33196
|
+
// Wait for this print job to complete before processing the next file
|
|
33197
|
+
await this.waitForPrintCompletion();
|
|
33148
33198
|
}
|
|
33149
33199
|
else {
|
|
33150
|
-
|
|
33151
|
-
this.printProcessing = false;
|
|
33200
|
+
throw new Error(`No job ID returned for file: ${file.name}`);
|
|
33152
33201
|
}
|
|
33153
|
-
}
|
|
33154
|
-
|
|
33155
|
-
|
|
33156
|
-
|
|
33157
|
-
this.printProcessing = false;
|
|
33158
|
-
});
|
|
33202
|
+
}
|
|
33203
|
+
else {
|
|
33204
|
+
throw new Error(`Upload failed for file: ${file.name}`);
|
|
33205
|
+
}
|
|
33159
33206
|
}
|
|
33160
|
-
|
|
33161
|
-
this.
|
|
33162
|
-
|
|
33207
|
+
catch (error) {
|
|
33208
|
+
this.uploading = false;
|
|
33209
|
+
throw error;
|
|
33163
33210
|
}
|
|
33211
|
+
this.uploading = false;
|
|
33212
|
+
}
|
|
33213
|
+
async waitForPrintCompletion() {
|
|
33214
|
+
return new Promise((resolve, reject) => {
|
|
33215
|
+
const poll = async () => {
|
|
33216
|
+
try {
|
|
33217
|
+
const data = await this.printService.getPrintStatus();
|
|
33218
|
+
if (data.jobstatus === 0) {
|
|
33219
|
+
resolve();
|
|
33220
|
+
}
|
|
33221
|
+
else if (data.jobstatus === 1) {
|
|
33222
|
+
// Still processing, continue polling
|
|
33223
|
+
setTimeout(poll, this.POLL_INTERVAL);
|
|
33224
|
+
}
|
|
33225
|
+
else {
|
|
33226
|
+
reject(new Error('Print job failed'));
|
|
33227
|
+
}
|
|
33228
|
+
}
|
|
33229
|
+
catch (error) {
|
|
33230
|
+
reject(error);
|
|
33231
|
+
}
|
|
33232
|
+
};
|
|
33233
|
+
poll();
|
|
33234
|
+
});
|
|
33235
|
+
}
|
|
33236
|
+
getFileExtension(filename) {
|
|
33237
|
+
const extension = filename.split('.').pop();
|
|
33238
|
+
return extension ? extension.toLowerCase() : '';
|
|
33164
33239
|
}
|
|
33165
33240
|
setDefaultPaperFormat() {
|
|
33166
33241
|
var _a, _b, _c, _d, _e;
|
|
@@ -33211,18 +33286,23 @@ let EzpPrinterSelection = class {
|
|
|
33211
33286
|
.then((data) => {
|
|
33212
33287
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
33213
33288
|
this.selectedPrinterConfig = data[0];
|
|
33214
|
-
this.selectedProperties.color =
|
|
33289
|
+
this.selectedProperties.color =
|
|
33290
|
+
((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
|
|
33215
33291
|
this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
|
|
33216
33292
|
this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
|
|
33217
|
-
let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
|
|
33293
|
+
let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
|
|
33218
33294
|
this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
|
|
33219
33295
|
this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
|
|
33220
|
-
let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
|
|
33221
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33296
|
+
let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
|
|
33297
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33298
|
+
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
33299
|
+
this.selectedPrinterConfig.Trays[0] != null) {
|
|
33222
33300
|
this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
|
|
33223
33301
|
this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
|
|
33224
33302
|
}
|
|
33225
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33303
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33304
|
+
this.selectedPrinterConfig.Trays.length >= 0 &&
|
|
33305
|
+
this.selectedPrinterConfig.Trays[0] == null) {
|
|
33226
33306
|
delete this.selectedProperties.trayname;
|
|
33227
33307
|
delete this.selectedProperties.defaultSource;
|
|
33228
33308
|
}
|
|
@@ -33244,10 +33324,12 @@ let EzpPrinterSelection = class {
|
|
|
33244
33324
|
.then((printerConfig) => {
|
|
33245
33325
|
this.printerConfig = printerConfig;
|
|
33246
33326
|
});
|
|
33247
|
-
if (this.
|
|
33248
|
-
|
|
33249
|
-
|
|
33250
|
-
|
|
33327
|
+
if (this.files && this.files.length > 0) {
|
|
33328
|
+
// Validate all files
|
|
33329
|
+
const validationPromises = this.files.map((file) => this.validateFileType(file.name));
|
|
33330
|
+
const validationResults = await Promise.all(validationPromises);
|
|
33331
|
+
const allValid = validationResults.every((valid) => valid);
|
|
33332
|
+
this.notSupported = !allValid;
|
|
33251
33333
|
}
|
|
33252
33334
|
this.loading = false;
|
|
33253
33335
|
}
|
|
@@ -33258,11 +33340,25 @@ let EzpPrinterSelection = class {
|
|
|
33258
33340
|
*/
|
|
33259
33341
|
render() {
|
|
33260
33342
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
33261
|
-
return this.loading ? (h("ezp-status", { processing: true, description: i18next.t('printer_selection.loading'), instance: "loading" })) : (h(Host, { class: { seamless: this.seamless } }, h("div", { id: "box", "data-backdrop-surface": true }, !this.printStopped && (h(Fragment, null, this.printProcessing ? (h("ezp-status", { processing: true, description: this.
|
|
33262
|
-
? i18next.t('printer_selection.
|
|
33263
|
-
: this.
|
|
33264
|
-
? i18next.t('printer_selection.
|
|
33265
|
-
:
|
|
33343
|
+
return this.loading ? (h("ezp-status", { processing: true, description: i18next.t('printer_selection.loading'), instance: "loading" })) : (h(Host, { class: { seamless: this.seamless } }, h("div", { id: "box", "data-backdrop-surface": true }, !this.printStopped && (h(Fragment, null, this.printProcessing ? (h("ezp-status", { processing: true, description: this.totalFiles > 1
|
|
33344
|
+
? `${i18next.t('printer_selection.print_processing')} (${this.currentFileIndex + 1}/${this.totalFiles})`
|
|
33345
|
+
: this.preparingUpload
|
|
33346
|
+
? i18next.t('printer_selection.prepare_upload')
|
|
33347
|
+
: this.uploading
|
|
33348
|
+
? i18next.t('printer_selection.uploading')
|
|
33349
|
+
: i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.selectedPrinter.is_queue && this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: this.totalFiles > 1
|
|
33350
|
+
? this.failedFiles.length > 0
|
|
33351
|
+
? `${i18next.t('printer_selection.pull_print_success')} (${this.successfulFiles.length}/${this.totalFiles} files)`
|
|
33352
|
+
: `${i18next.t('printer_selection.pull_print_success')} (${this.totalFiles} files)`
|
|
33353
|
+
: i18next.t('printer_selection.pull_print_success'), instance: "print-success", close: true })) : this.printSuccess ? (h("ezp-status", { icon: this.partialSuccess ? 'exclamation-mark' : 'checkmark-alt', description: this.totalFiles > 1
|
|
33354
|
+
? this.partialSuccess
|
|
33355
|
+
? `${i18next.t('printer_selection.print_success')} (${this.successfulFiles.length}/${this.totalFiles} files) - ${this.failedFiles.length} failed`
|
|
33356
|
+
: `${i18next.t('printer_selection.print_success')} (${this.totalFiles} files)`
|
|
33357
|
+
: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)), !this.hideheader && (h("div", { id: "header" }, h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }), h("ezp-label", { text: !this.notSupported
|
|
33358
|
+
? this.files && this.files.length > 1
|
|
33359
|
+
? `${this.files.length} files selected`
|
|
33360
|
+
: this.filename
|
|
33361
|
+
: '', ellipsis: true }), !this.hidemenu && (h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu })))), h("div", { id: "body" }, h("div", { id: "printer" }, h("ezp-select", { label: i18next.t('printer_selection.printer'), icon: "printer", placeholder: this.printers.length > 0
|
|
33266
33362
|
? i18next.t('printer_selection.select_printer')
|
|
33267
33363
|
: i18next.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
|
|
33268
33364
|
id: printer.id,
|
|
@@ -33274,27 +33370,29 @@ let EzpPrinterSelection = class {
|
|
|
33274
33370
|
id: option.id,
|
|
33275
33371
|
title: option.title,
|
|
33276
33372
|
meta: '',
|
|
33277
|
-
type: 'color'
|
|
33278
|
-
})), preSelected: this.selectedPrinter.id
|
|
33279
|
-
&& ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == "color"
|
|
33373
|
+
type: 'color',
|
|
33374
|
+
})), preSelected: this.selectedPrinter.id && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == 'color'
|
|
33280
33375
|
? i18next.t('printer_selection.color_color')
|
|
33281
33376
|
: i18next.t('printer_selection.color_grayscale'), disabled: !this.selectedPrinterConfig.ColorSupported }), h("ezp-select", { label: i18next.t('printer_selection.duplex'), icon: "duplex", placeholder: i18next.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: (_c = this.duplexOptions) === null || _c === void 0 ? void 0 : _c.map((option) => ({
|
|
33282
33377
|
id: option.id,
|
|
33283
33378
|
title: option.title,
|
|
33284
33379
|
meta: '',
|
|
33285
33380
|
type: 'duplex',
|
|
33286
|
-
})), preSelected: this.selectedPrinter.id &&
|
|
33381
|
+
})), preSelected: this.selectedPrinter.id &&
|
|
33382
|
+
((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == 'duplex_simplex'
|
|
33287
33383
|
? i18next.t('printer_selection.duplex_none')
|
|
33288
|
-
: ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) ==
|
|
33384
|
+
: ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == 'duplex_vertical'
|
|
33289
33385
|
? i18next.t('printer_selection.duplex_long')
|
|
33290
|
-
: ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) ==
|
|
33386
|
+
: ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == 'duplex_horizontal'
|
|
33291
33387
|
? i18next.t('printer_selection.duplex_short')
|
|
33292
|
-
: null, disabled: !this.selectedPrinterConfig.DuplexSupported }), h("ezp-select", { label: i18next.t('printer_selection.size'), icon: "size", placeholder: i18next.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
|
|
33293
|
-
|
|
33294
|
-
|
|
33295
|
-
|
|
33296
|
-
|
|
33297
|
-
|
|
33388
|
+
: null, disabled: !this.selectedPrinterConfig.DuplexSupported }), h("ezp-select", { label: i18next.t('printer_selection.size'), icon: "size", placeholder: i18next.t('printer_selection.select_size'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.PaperFormats &&
|
|
33389
|
+
this.selectedPrinterConfig.PaperFormats.map((format) => ({
|
|
33390
|
+
id: format.Id,
|
|
33391
|
+
title: format.Name,
|
|
33392
|
+
meta: `${format.XRes} x ${format.YRes}`,
|
|
33393
|
+
type: 'format',
|
|
33394
|
+
})), preSelected: this.selectedPrinter.id &&
|
|
33395
|
+
((_g = this.selectedPrinterConfig.PaperFormats) === null || _g === void 0 ? void 0 : _g.find((el) => { var _a; return el.Name.includes((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Paper); }))
|
|
33298
33396
|
? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
|
|
33299
33397
|
: null, disabled: !(((_j = this.selectedPrinterConfig.PaperFormats) === null || _j === void 0 ? void 0 : _j.length) > 0) }), this.paperid == PAPER_ID ? (h(Fragment, null, h("ezp-input", { icon: "width", suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: i18next.t('printer_selection.width') }), h("ezp-input", { icon: "height", suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: i18next.t('printer_selection.length') }))) : null, h("ezp-select", { label: i18next.t('printer_selection.orientation'), icon: "orientation", placeholder: i18next.t('printer_selection.select_orientation'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.OrientationsSupported.map((orientation, index) => ({
|
|
33300
33398
|
id: index + 1,
|
|
@@ -33306,14 +33404,20 @@ let EzpPrinterSelection = class {
|
|
|
33306
33404
|
title: option,
|
|
33307
33405
|
meta: '',
|
|
33308
33406
|
type: 'quality',
|
|
33309
|
-
})), preSelected: this.selectedPrinter.id &&
|
|
33407
|
+
})), preSelected: this.selectedPrinter.id &&
|
|
33408
|
+
((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.includes(this.selectedPrinterConfig.Default.Resolution))
|
|
33310
33409
|
? this.selectedPrinterConfig.Default.Resolution
|
|
33311
|
-
: null, disabled: !(((_m = this.selectedPrinterConfig.Resolutions) === null || _m === void 0 ? void 0 : _m.length) > 0) }), this.selectedPrinterConfig.Trays &&
|
|
33312
|
-
|
|
33313
|
-
|
|
33314
|
-
|
|
33315
|
-
|
|
33316
|
-
|
|
33410
|
+
: null, disabled: !(((_m = this.selectedPrinterConfig.Resolutions) === null || _m === void 0 ? void 0 : _m.length) > 0) }), this.selectedPrinterConfig.Trays &&
|
|
33411
|
+
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
33412
|
+
this.selectedPrinterConfig.Trays[0] != null ? (h("ezp-select", { label: i18next.t('printer_selection.trays'), icon: "trays", placeholder: i18next.t('printer_selection.select_trays'), toggleFlow: "horizontal", optionFlow: "horizontal", options: this.selectedPrinterConfig.Trays &&
|
|
33413
|
+
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
33414
|
+
this.selectedPrinterConfig.Trays.map((trays) => ({
|
|
33415
|
+
title: trays.Name,
|
|
33416
|
+
id: trays.Index,
|
|
33417
|
+
meta: '',
|
|
33418
|
+
type: 'tray',
|
|
33419
|
+
})), preSelected: this.selectedPrinter.id &&
|
|
33420
|
+
((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
|
|
33317
33421
|
? this.selectedPrinterConfig.Default.Tray
|
|
33318
33422
|
: null })) : null, h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: this.selectedProperties.PageRanges, eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })), h("ezp-stepper", { label: i18next.t('printer_selection.copies'), max: 10, icon: "copies" })), h("div", { id: "footer" }, h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }), h("ezp-text-button", { disabled: this.selectedPrinter.id === '' || this.printProcessing || this.pageRangeInvalid, type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print'), ref: (button) => (this.printButton = button), class: "action", id: "print" })), !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
|
|
33319
33423
|
}
|
|
@@ -33350,6 +33454,7 @@ let EzpPrinting = class {
|
|
|
33350
33454
|
this.authOpen = false;
|
|
33351
33455
|
this.onlyGetSasUri = false;
|
|
33352
33456
|
this.noDocumentOpen = false;
|
|
33457
|
+
this.files = [];
|
|
33353
33458
|
}
|
|
33354
33459
|
/** Watchers */
|
|
33355
33460
|
watchFileData(newValue, oldValue) {
|
|
@@ -33359,7 +33464,7 @@ let EzpPrinting = class {
|
|
|
33359
33464
|
for (let i = 0; i < newValue.length; i++) {
|
|
33360
33465
|
array[i] = newValue.charCodeAt(i);
|
|
33361
33466
|
}
|
|
33362
|
-
this.
|
|
33467
|
+
this.files = [new File([array], this.filename)];
|
|
33363
33468
|
}
|
|
33364
33469
|
}
|
|
33365
33470
|
watchFilename(newValue, oldValue) {
|
|
@@ -33411,8 +33516,8 @@ let EzpPrinting = class {
|
|
|
33411
33516
|
}
|
|
33412
33517
|
}
|
|
33413
33518
|
listenUploadFile(event) {
|
|
33414
|
-
this.
|
|
33415
|
-
this.
|
|
33519
|
+
this.files = event.detail;
|
|
33520
|
+
this.filename = this.files.length > 0 ? this.files[0].name : '';
|
|
33416
33521
|
this.open();
|
|
33417
33522
|
}
|
|
33418
33523
|
listenDialogClose(event) {
|
|
@@ -33543,7 +33648,7 @@ let EzpPrinting = class {
|
|
|
33543
33648
|
render() {
|
|
33544
33649
|
return (h(Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
33545
33650
|
? this.systemAppearance
|
|
33546
|
-
: userStore.state.appearance} ${this.seamless ? 'seamless' : ''}` }, this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))), this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger, code: this.code })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid,
|
|
33651
|
+
: userStore.state.appearance} ${this.seamless ? 'seamless' : ''}` }, this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))), this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger, code: this.code })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, files: this.files, hidemenu: this.hidemenu, hideheader: this.hideheader, seamless: this.seamless })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
|
|
33547
33652
|
}
|
|
33548
33653
|
static get watchers() { return {
|
|
33549
33654
|
"filedata": ["watchFileData"],
|
|
@@ -33891,7 +33996,7 @@ let EzpUpload = class {
|
|
|
33891
33996
|
* States
|
|
33892
33997
|
*
|
|
33893
33998
|
*/
|
|
33894
|
-
this.
|
|
33999
|
+
this.selectedFiles = [];
|
|
33895
34000
|
this.dragging = false;
|
|
33896
34001
|
/**
|
|
33897
34002
|
*
|
|
@@ -33899,8 +34004,9 @@ let EzpUpload = class {
|
|
|
33899
34004
|
*
|
|
33900
34005
|
*/
|
|
33901
34006
|
this.handleInput = () => {
|
|
33902
|
-
|
|
33903
|
-
this.
|
|
34007
|
+
const files = Array.from(this.input.files);
|
|
34008
|
+
this.selectedFiles = files;
|
|
34009
|
+
this.uploadFile.emit(files);
|
|
33904
34010
|
};
|
|
33905
34011
|
}
|
|
33906
34012
|
/**
|
|
@@ -33923,12 +34029,13 @@ let EzpUpload = class {
|
|
|
33923
34029
|
event.stopPropagation();
|
|
33924
34030
|
event.preventDefault();
|
|
33925
34031
|
this.dragging = false;
|
|
33926
|
-
|
|
33927
|
-
this.
|
|
34032
|
+
const files = Array.from(event.dataTransfer.files);
|
|
34033
|
+
this.selectedFiles = files;
|
|
34034
|
+
this.uploadFile.emit(files);
|
|
33928
34035
|
}
|
|
33929
34036
|
listenPrintCancel() {
|
|
33930
34037
|
this.form.reset();
|
|
33931
|
-
this.
|
|
34038
|
+
this.selectedFiles = [];
|
|
33932
34039
|
}
|
|
33933
34040
|
/**
|
|
33934
34041
|
*
|
|
@@ -33936,7 +34043,7 @@ let EzpUpload = class {
|
|
|
33936
34043
|
*
|
|
33937
34044
|
*/
|
|
33938
34045
|
render() {
|
|
33939
|
-
return (h(Host, { class: { dragging: this.dragging } }, h("form", { id: "form", ref: (form) => (this.form = form) }, h("div", { id: "header" }, h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), h("div", { id: "meta" }, h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), h("label", { htmlFor: "input", id: "select" }, h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }), h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') })), this.
|
|
34046
|
+
return (h(Host, { class: { dragging: this.dragging } }, h("form", { id: "form", ref: (form) => (this.form = form) }, h("div", { id: "header" }, h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), h("div", { id: "meta" }, h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), h("label", { htmlFor: "input", id: "select" }, h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), h("input", { type: "file", name: "input", id: "input", multiple: true, ref: (input) => (this.input = input), onInput: this.handleInput }), h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') })), this.selectedFiles.length > 0 && (h(Fragment, null, h("ezp-label", { level: "secondary", text: i18next.t('upload.selected_files') }), this.selectedFiles.map((file, index) => (h("ezp-label", { key: index, level: "tertiary", text: file.name })))))))));
|
|
33940
34047
|
}
|
|
33941
34048
|
};
|
|
33942
34049
|
EzpUpload.style = ezpUploadCss;
|