@ezeep/ezeep-js 1.0.237 → 1.0.239
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 +265 -109
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +249 -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 +268 -112
- package/dist/directives/proxies.ts +2 -2
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_15.entry.js +265 -109
- 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-62b9b554.system.entry.js → p-0afb1821.system.entry.js} +3 -3
- package/dist/ezeep/{p-7b589922.entry.js → p-69fc0c9c.entry.js} +2 -2
- package/dist/ezeep/p-84bd195a.system.js +1 -1
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +11 -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-62b9b554.system.entry.js → p-0afb1821.system.entry.js} +3 -3
- package/www/build/{p-7b589922.entry.js → p-69fc0c9c.entry.js} +2 -2
- package/www/build/p-84bd195a.system.js +1 -1
- package/www/data/locales/de.json +8 -6
- package/www/data/locales/en.json +8 -6
|
@@ -2888,7 +2888,9 @@ const printer_selection$1 = {
|
|
|
2888
2888
|
trays: "Papierfach",
|
|
2889
2889
|
select_trays: "Wähle Papierfach",
|
|
2890
2890
|
page_ranges: "Druckbereich",
|
|
2891
|
-
paper_ranges: "Papier-Ranges"
|
|
2891
|
+
paper_ranges: "Papier-Ranges",
|
|
2892
|
+
files_selected: "{{count}} Dateien ausgewählt",
|
|
2893
|
+
files: "Dateien"
|
|
2892
2894
|
};
|
|
2893
2895
|
const button_actions$1 = {
|
|
2894
2896
|
login: "Anmelden",
|
|
@@ -2899,11 +2901,11 @@ const button_actions$1 = {
|
|
|
2899
2901
|
select_printer: "Wähle Drucker"
|
|
2900
2902
|
};
|
|
2901
2903
|
const upload$1 = {
|
|
2902
|
-
description: "Ziehe
|
|
2904
|
+
description: "Ziehe Dateien hier in den Browser ",
|
|
2903
2905
|
meta_leading: "oder",
|
|
2904
|
-
meta_select: "wähle
|
|
2906
|
+
meta_select: "wähle Dateien aus",
|
|
2905
2907
|
meta_trailing: "um mit ezeep Blue zu drucken.",
|
|
2906
|
-
|
|
2908
|
+
selected_files: "Ausgewählte Dateien:"
|
|
2907
2909
|
};
|
|
2908
2910
|
const user_menu$1 = {
|
|
2909
2911
|
theme: "Farbschema",
|
|
@@ -2971,7 +2973,9 @@ const printer_selection = {
|
|
|
2971
2973
|
trays: "Tray",
|
|
2972
2974
|
select_trays: "Select Tray",
|
|
2973
2975
|
page_ranges: "Page Ranges",
|
|
2974
|
-
paper_ranges: "Paper Ranges"
|
|
2976
|
+
paper_ranges: "Paper Ranges",
|
|
2977
|
+
files_selected: "{{count}} files selected",
|
|
2978
|
+
files: "files"
|
|
2975
2979
|
};
|
|
2976
2980
|
const button_actions = {
|
|
2977
2981
|
login: "Sign In",
|
|
@@ -2982,11 +2986,11 @@ const button_actions = {
|
|
|
2982
2986
|
select_printer: "Select Printer"
|
|
2983
2987
|
};
|
|
2984
2988
|
const upload = {
|
|
2985
|
-
description: "Drop
|
|
2989
|
+
description: "Drop files here into the browser ",
|
|
2986
2990
|
meta_leading: "or",
|
|
2987
|
-
meta_select: "select
|
|
2991
|
+
meta_select: "select files",
|
|
2988
2992
|
meta_trailing: "to print with ezeep Blue.",
|
|
2989
|
-
|
|
2993
|
+
selected_files: "Selected Files:"
|
|
2990
2994
|
};
|
|
2991
2995
|
const user_menu = {
|
|
2992
2996
|
theme: "Color theme",
|
|
@@ -32795,7 +32799,6 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32795
32799
|
this.printCancel = createEvent(this, "printCancel", 7);
|
|
32796
32800
|
this.printSubmit = createEvent(this, "printSubmit", 7);
|
|
32797
32801
|
this.logout = createEvent(this, "logout", 7);
|
|
32798
|
-
this.sasUri = '';
|
|
32799
32802
|
this.fileExtension = '';
|
|
32800
32803
|
this.duplexOptions = [
|
|
32801
32804
|
{
|
|
@@ -32819,7 +32822,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32819
32822
|
{
|
|
32820
32823
|
id: 2,
|
|
32821
32824
|
title: i18next.t('printer_selection.color_grayscale'),
|
|
32822
|
-
}
|
|
32825
|
+
},
|
|
32823
32826
|
];
|
|
32824
32827
|
this.hidemenu = false;
|
|
32825
32828
|
this.hideheader = false;
|
|
@@ -32846,14 +32849,14 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32846
32849
|
Paper: '',
|
|
32847
32850
|
Orientation: '',
|
|
32848
32851
|
Resolution: '',
|
|
32849
|
-
Tray: ''
|
|
32852
|
+
Tray: '',
|
|
32850
32853
|
},
|
|
32851
32854
|
OrientationsSupported: [],
|
|
32852
32855
|
PaperFormats: [],
|
|
32853
32856
|
Resolutions: [],
|
|
32854
32857
|
DuplexSupported: false,
|
|
32855
32858
|
Color: false,
|
|
32856
|
-
Trays: []
|
|
32859
|
+
Trays: [],
|
|
32857
32860
|
};
|
|
32858
32861
|
// needs to be initialised with empty strings
|
|
32859
32862
|
this.selectedProperties = {
|
|
@@ -32871,6 +32874,11 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32871
32874
|
trayname: '',
|
|
32872
32875
|
PageRanges: '',
|
|
32873
32876
|
};
|
|
32877
|
+
this.currentFileIndex = 0;
|
|
32878
|
+
this.totalFiles = 0;
|
|
32879
|
+
this.failedFiles = [];
|
|
32880
|
+
this.successfulFiles = [];
|
|
32881
|
+
this.partialSuccess = false;
|
|
32874
32882
|
/**
|
|
32875
32883
|
*
|
|
32876
32884
|
* Private methods
|
|
@@ -32878,6 +32886,9 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32878
32886
|
*/
|
|
32879
32887
|
/** Description... */
|
|
32880
32888
|
this.handleCancel = () => {
|
|
32889
|
+
this.failedFiles = [];
|
|
32890
|
+
this.successfulFiles = [];
|
|
32891
|
+
this.partialSuccess = false;
|
|
32881
32892
|
this.printCancel.emit();
|
|
32882
32893
|
};
|
|
32883
32894
|
this.validateData = (data) => {
|
|
@@ -32894,9 +32905,14 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32894
32905
|
this.handlePrint = async () => {
|
|
32895
32906
|
this.printButton.blur();
|
|
32896
32907
|
this.printProcessing = true;
|
|
32908
|
+
this.failedFiles = [];
|
|
32909
|
+
this.successfulFiles = [];
|
|
32910
|
+
this.partialSuccess = false;
|
|
32897
32911
|
// we have to initialse this obj with empty strings to display the select component
|
|
32898
32912
|
// but don't want to send any attributes with empty strings to the API
|
|
32899
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
32913
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
32914
|
+
this.selectedPrinterConfig.Trays.length >= 0 &&
|
|
32915
|
+
this.selectedPrinterConfig.Trays[0] == null) {
|
|
32900
32916
|
delete this.selectedProperties.trayname;
|
|
32901
32917
|
delete this.selectedProperties.defaultSource;
|
|
32902
32918
|
}
|
|
@@ -32956,8 +32972,11 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32956
32972
|
this.printProcessing = false;
|
|
32957
32973
|
});
|
|
32958
32974
|
}
|
|
32959
|
-
if (this.
|
|
32960
|
-
await this.
|
|
32975
|
+
if (this.files && this.files.length > 1) {
|
|
32976
|
+
await this.processMultipleFiles(this.files, cleanPrintProperties);
|
|
32977
|
+
}
|
|
32978
|
+
else if (this.files && this.files.length === 1) {
|
|
32979
|
+
await this.processSingleFile(this.files[0], cleanPrintProperties);
|
|
32961
32980
|
}
|
|
32962
32981
|
localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
|
|
32963
32982
|
localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
|
|
@@ -33005,11 +33024,16 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33005
33024
|
switch (event.detail) {
|
|
33006
33025
|
case 'print-success':
|
|
33007
33026
|
this.printSuccess = false;
|
|
33027
|
+
this.partialSuccess = false;
|
|
33028
|
+
this.failedFiles = [];
|
|
33029
|
+
this.successfulFiles = [];
|
|
33008
33030
|
this.printCancel.emit();
|
|
33009
33031
|
break;
|
|
33010
33032
|
case 'print-failed':
|
|
33011
33033
|
this.printProcessing = false;
|
|
33012
33034
|
this.printFailed = false;
|
|
33035
|
+
this.failedFiles = [];
|
|
33036
|
+
this.successfulFiles = [];
|
|
33013
33037
|
break;
|
|
33014
33038
|
case 'no-printers':
|
|
33015
33039
|
this.noPrinters = false;
|
|
@@ -33069,18 +33093,23 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33069
33093
|
.then((data) => {
|
|
33070
33094
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
33071
33095
|
this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
|
|
33072
|
-
this.selectedProperties.color =
|
|
33096
|
+
this.selectedProperties.color =
|
|
33097
|
+
((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
|
|
33073
33098
|
this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
|
|
33074
33099
|
this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
|
|
33075
|
-
let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
|
|
33100
|
+
let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
|
|
33076
33101
|
this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
|
|
33077
33102
|
this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
|
|
33078
|
-
let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
|
|
33079
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33103
|
+
let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
|
|
33104
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33105
|
+
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
33106
|
+
this.selectedPrinterConfig.Trays[0] != null) {
|
|
33080
33107
|
this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
|
|
33081
33108
|
this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
|
|
33082
33109
|
}
|
|
33083
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33110
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33111
|
+
this.selectedPrinterConfig.Trays.length >= 0 &&
|
|
33112
|
+
this.selectedPrinterConfig.Trays[0] == null) {
|
|
33084
33113
|
delete this.selectedProperties.trayname;
|
|
33085
33114
|
delete this.selectedProperties.defaultSource;
|
|
33086
33115
|
}
|
|
@@ -33091,7 +33120,8 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33091
33120
|
// this.setDefaultPaperFormat()
|
|
33092
33121
|
break;
|
|
33093
33122
|
case 'color':
|
|
33094
|
-
this.selectedProperties.color =
|
|
33123
|
+
this.selectedProperties.color =
|
|
33124
|
+
eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
|
|
33095
33125
|
break;
|
|
33096
33126
|
case 'orientation':
|
|
33097
33127
|
this.selectedProperties.orientation = eventDetails.id;
|
|
@@ -33110,11 +33140,15 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33110
33140
|
this.selectedProperties.paperwidth = eventDetails.value;
|
|
33111
33141
|
break;
|
|
33112
33142
|
case 'tray':
|
|
33113
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33143
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33144
|
+
this.selectedPrinterConfig.Trays.length >= 0 &&
|
|
33145
|
+
this.selectedPrinterConfig.Trays[0] == null) {
|
|
33114
33146
|
delete this.selectedProperties.trayname;
|
|
33115
33147
|
delete this.selectedProperties.defaultSource;
|
|
33116
33148
|
}
|
|
33117
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33149
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33150
|
+
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
33151
|
+
this.selectedPrinterConfig.Trays[0] != null) {
|
|
33118
33152
|
this.selectedProperties.trayname = eventDetails.title;
|
|
33119
33153
|
this.selectedProperties.defaultSource = eventDetails.id;
|
|
33120
33154
|
}
|
|
@@ -33124,9 +33158,9 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33124
33158
|
this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
|
|
33125
33159
|
break;
|
|
33126
33160
|
case 'duplex':
|
|
33127
|
-
if (eventDetails.title == i18next.t('printer_selection.duplex_none')
|
|
33128
|
-
|
|
33129
|
-
|
|
33161
|
+
if (eventDetails.title == i18next.t('printer_selection.duplex_none') ||
|
|
33162
|
+
eventDetails.title == i18next.t('printer_selection.duplex_long') ||
|
|
33163
|
+
eventDetails.title == i18next.t('printer_selection.duplex_short')) {
|
|
33130
33164
|
this.selectedProperties.duplex = true;
|
|
33131
33165
|
}
|
|
33132
33166
|
else {
|
|
@@ -33137,59 +33171,114 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33137
33171
|
}
|
|
33138
33172
|
this.setPaperid();
|
|
33139
33173
|
}
|
|
33140
|
-
async handleFiles(
|
|
33174
|
+
async handleFiles(files, printPorperties) {
|
|
33175
|
+
this.totalFiles = files.length;
|
|
33176
|
+
this.currentFileIndex = 0;
|
|
33177
|
+
this.failedFiles = [];
|
|
33178
|
+
this.successfulFiles = [];
|
|
33179
|
+
// Process each file individually
|
|
33180
|
+
for (let i = 0; i < files.length; i++) {
|
|
33181
|
+
this.currentFileIndex = i;
|
|
33182
|
+
const file = files[i];
|
|
33183
|
+
try {
|
|
33184
|
+
await this.processSingleFile(file, printPorperties);
|
|
33185
|
+
this.successfulFiles.push(file.name);
|
|
33186
|
+
}
|
|
33187
|
+
catch (error) {
|
|
33188
|
+
console.error(`Error processing file ${file.name}:`, error);
|
|
33189
|
+
this.failedFiles.push(file.name);
|
|
33190
|
+
// Continue with the next file instead of stopping
|
|
33191
|
+
}
|
|
33192
|
+
}
|
|
33193
|
+
// Determine final status based on results
|
|
33194
|
+
if (this.failedFiles.length === 0) {
|
|
33195
|
+
// All files processed successfully
|
|
33196
|
+
this.printSuccess = true;
|
|
33197
|
+
this.partialSuccess = false;
|
|
33198
|
+
this.printProcessing = false;
|
|
33199
|
+
}
|
|
33200
|
+
else if (this.successfulFiles.length === 0) {
|
|
33201
|
+
// All files failed
|
|
33202
|
+
this.printFailed = true;
|
|
33203
|
+
this.partialSuccess = false;
|
|
33204
|
+
this.printProcessing = false;
|
|
33205
|
+
}
|
|
33206
|
+
else {
|
|
33207
|
+
// Some files succeeded, some failed - show partial success
|
|
33208
|
+
this.printSuccess = true;
|
|
33209
|
+
this.partialSuccess = true;
|
|
33210
|
+
this.printProcessing = false;
|
|
33211
|
+
}
|
|
33212
|
+
}
|
|
33213
|
+
async processSingleFile(file, printProperties) {
|
|
33141
33214
|
this.preparingUpload = true;
|
|
33142
33215
|
const response = await this.printService.prepareFileUpload(authStore.state.accessToken);
|
|
33143
33216
|
this.preparingUpload = false;
|
|
33144
|
-
|
|
33145
|
-
|
|
33146
|
-
|
|
33147
|
-
let res;
|
|
33217
|
+
const fileid = response.fileid;
|
|
33218
|
+
const sasUri = response.sasUri;
|
|
33219
|
+
const filetype = this.getFileExtension(file.name);
|
|
33148
33220
|
this.uploading = true;
|
|
33149
33221
|
try {
|
|
33150
|
-
|
|
33151
|
-
|
|
33152
|
-
|
|
33153
|
-
|
|
33154
|
-
|
|
33155
|
-
}
|
|
33156
|
-
this.uploading = false;
|
|
33157
|
-
if (res._response.status === 201) {
|
|
33158
|
-
this.printService
|
|
33159
|
-
.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, printPorperties, this.filename)
|
|
33160
|
-
.then((data) => {
|
|
33222
|
+
// Upload the file
|
|
33223
|
+
const res = await this.printService.uploadBlobFiles(sasUri, file);
|
|
33224
|
+
if (res._response.status === 201) {
|
|
33225
|
+
// Print the file
|
|
33226
|
+
const data = await this.printService.printByFileID(authStore.state.accessToken, fileid, filetype, this.selectedPrinter.id, printProperties, file.name);
|
|
33161
33227
|
if (data.code === 804) {
|
|
33162
|
-
|
|
33163
|
-
this.printProcessing = false;
|
|
33228
|
+
throw new Error(`Print failed for file: ${file.name}`);
|
|
33164
33229
|
}
|
|
33165
33230
|
if (data.jobid) {
|
|
33166
33231
|
printStore.state.jobID = data.jobid;
|
|
33167
|
-
|
|
33168
|
-
|
|
33169
|
-
validate: this.validateData,
|
|
33170
|
-
interval: this.POLL_INTERVAL,
|
|
33171
|
-
maxAttempts: this.MAX_POLL_ATTEMPTS,
|
|
33172
|
-
}).catch((err) => {
|
|
33173
|
-
console.log(err);
|
|
33174
|
-
this.printFailed = true;
|
|
33175
|
-
this.printProcessing = false;
|
|
33176
|
-
});
|
|
33232
|
+
// Wait for this print job to complete before processing the next file
|
|
33233
|
+
await this.waitForPrintCompletion();
|
|
33177
33234
|
}
|
|
33178
33235
|
else {
|
|
33179
|
-
|
|
33180
|
-
this.printProcessing = false;
|
|
33236
|
+
throw new Error(`No job ID returned for file: ${file.name}`);
|
|
33181
33237
|
}
|
|
33182
|
-
}
|
|
33183
|
-
|
|
33184
|
-
|
|
33185
|
-
|
|
33186
|
-
this.printProcessing = false;
|
|
33187
|
-
});
|
|
33238
|
+
}
|
|
33239
|
+
else {
|
|
33240
|
+
throw new Error(`Upload failed for file: ${file.name}`);
|
|
33241
|
+
}
|
|
33188
33242
|
}
|
|
33189
|
-
|
|
33190
|
-
this.
|
|
33191
|
-
|
|
33243
|
+
catch (error) {
|
|
33244
|
+
this.uploading = false;
|
|
33245
|
+
throw error;
|
|
33192
33246
|
}
|
|
33247
|
+
this.uploading = false;
|
|
33248
|
+
}
|
|
33249
|
+
async waitForPrintCompletion() {
|
|
33250
|
+
return new Promise((resolve, reject) => {
|
|
33251
|
+
const poll = async () => {
|
|
33252
|
+
try {
|
|
33253
|
+
const data = await this.printService.getPrintStatus();
|
|
33254
|
+
console.log('[waitForPrintCompletion] Poll response:', data);
|
|
33255
|
+
if (data.jobstatus === 0) {
|
|
33256
|
+
// Success
|
|
33257
|
+
resolve();
|
|
33258
|
+
}
|
|
33259
|
+
else if (data.jobstatus === 1246 || data.jobstatus === 129) {
|
|
33260
|
+
// Still processing, keep polling
|
|
33261
|
+
setTimeout(poll, this.POLL_INTERVAL);
|
|
33262
|
+
}
|
|
33263
|
+
else if (data.jobstatus === 3011 || data.jobstatus === 2) {
|
|
33264
|
+
// Failure
|
|
33265
|
+
reject(new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus)));
|
|
33266
|
+
}
|
|
33267
|
+
else {
|
|
33268
|
+
// Unknown status, treat as failure for safety
|
|
33269
|
+
reject(new Error('Unknown print job status: ' + data.jobstatus));
|
|
33270
|
+
}
|
|
33271
|
+
}
|
|
33272
|
+
catch (error) {
|
|
33273
|
+
reject(error);
|
|
33274
|
+
}
|
|
33275
|
+
};
|
|
33276
|
+
poll();
|
|
33277
|
+
});
|
|
33278
|
+
}
|
|
33279
|
+
getFileExtension(filename) {
|
|
33280
|
+
const extension = filename.split('.').pop();
|
|
33281
|
+
return extension ? extension.toLowerCase() : '';
|
|
33193
33282
|
}
|
|
33194
33283
|
setDefaultPaperFormat() {
|
|
33195
33284
|
var _a, _b, _c, _d, _e;
|
|
@@ -33214,6 +33303,41 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33214
33303
|
}
|
|
33215
33304
|
this.setPaperid();
|
|
33216
33305
|
}
|
|
33306
|
+
async processMultipleFiles(files, printProperties) {
|
|
33307
|
+
this.totalFiles = files.length;
|
|
33308
|
+
this.currentFileIndex = 0;
|
|
33309
|
+
this.failedFiles = [];
|
|
33310
|
+
this.successfulFiles = [];
|
|
33311
|
+
for (let i = 0; i < files.length; i++) {
|
|
33312
|
+
this.currentFileIndex = i;
|
|
33313
|
+
const file = files[i];
|
|
33314
|
+
try {
|
|
33315
|
+
await this.processSingleFile(file, printProperties);
|
|
33316
|
+
this.successfulFiles.push(file.name);
|
|
33317
|
+
}
|
|
33318
|
+
catch (error) {
|
|
33319
|
+
console.error(`Error processing file ${file.name}:`, error);
|
|
33320
|
+
this.failedFiles.push(file.name);
|
|
33321
|
+
// Continue with the next file
|
|
33322
|
+
}
|
|
33323
|
+
}
|
|
33324
|
+
// Set UI state
|
|
33325
|
+
if (this.failedFiles.length === 0) {
|
|
33326
|
+
this.printSuccess = true;
|
|
33327
|
+
this.partialSuccess = false;
|
|
33328
|
+
this.printProcessing = false;
|
|
33329
|
+
}
|
|
33330
|
+
else if (this.successfulFiles.length === 0) {
|
|
33331
|
+
this.printFailed = true;
|
|
33332
|
+
this.partialSuccess = false;
|
|
33333
|
+
this.printProcessing = false;
|
|
33334
|
+
}
|
|
33335
|
+
else {
|
|
33336
|
+
this.printSuccess = true;
|
|
33337
|
+
this.partialSuccess = true;
|
|
33338
|
+
this.printProcessing = false;
|
|
33339
|
+
}
|
|
33340
|
+
}
|
|
33217
33341
|
/**
|
|
33218
33342
|
*
|
|
33219
33343
|
* Lifecycle methods
|
|
@@ -33240,18 +33364,23 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33240
33364
|
.then((data) => {
|
|
33241
33365
|
var _a, _b, _c, _d, _e, _f, _g;
|
|
33242
33366
|
this.selectedPrinterConfig = data[0];
|
|
33243
|
-
this.selectedProperties.color =
|
|
33367
|
+
this.selectedProperties.color =
|
|
33368
|
+
((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
|
|
33244
33369
|
this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
|
|
33245
33370
|
this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
|
|
33246
|
-
let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
|
|
33371
|
+
let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
|
|
33247
33372
|
this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
|
|
33248
33373
|
this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
|
|
33249
|
-
let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
|
|
33250
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33374
|
+
let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
|
|
33375
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33376
|
+
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
33377
|
+
this.selectedPrinterConfig.Trays[0] != null) {
|
|
33251
33378
|
this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
|
|
33252
33379
|
this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
|
|
33253
33380
|
}
|
|
33254
|
-
if (this.selectedPrinterConfig.Trays &&
|
|
33381
|
+
if (this.selectedPrinterConfig.Trays &&
|
|
33382
|
+
this.selectedPrinterConfig.Trays.length >= 0 &&
|
|
33383
|
+
this.selectedPrinterConfig.Trays[0] == null) {
|
|
33255
33384
|
delete this.selectedProperties.trayname;
|
|
33256
33385
|
delete this.selectedProperties.defaultSource;
|
|
33257
33386
|
}
|
|
@@ -33273,10 +33402,12 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33273
33402
|
.then((printerConfig) => {
|
|
33274
33403
|
this.printerConfig = printerConfig;
|
|
33275
33404
|
});
|
|
33276
|
-
if (this.
|
|
33277
|
-
|
|
33278
|
-
|
|
33279
|
-
|
|
33405
|
+
if (this.files && this.files.length > 0) {
|
|
33406
|
+
// Validate all files
|
|
33407
|
+
const validationPromises = this.files.map((file) => this.validateFileType(file.name));
|
|
33408
|
+
const validationResults = await Promise.all(validationPromises);
|
|
33409
|
+
const allValid = validationResults.every((valid) => valid);
|
|
33410
|
+
this.notSupported = !allValid;
|
|
33280
33411
|
}
|
|
33281
33412
|
this.loading = false;
|
|
33282
33413
|
}
|
|
@@ -33287,11 +33418,25 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33287
33418
|
*/
|
|
33288
33419
|
render() {
|
|
33289
33420
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
|
|
33290
|
-
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.
|
|
33291
|
-
? i18next.t('printer_selection.
|
|
33292
|
-
: this.
|
|
33293
|
-
? i18next.t('printer_selection.
|
|
33294
|
-
:
|
|
33421
|
+
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
|
|
33422
|
+
? `${i18next.t('printer_selection.print_processing')} (${this.currentFileIndex + 1}/${this.totalFiles})`
|
|
33423
|
+
: this.preparingUpload
|
|
33424
|
+
? i18next.t('printer_selection.prepare_upload')
|
|
33425
|
+
: this.uploading
|
|
33426
|
+
? i18next.t('printer_selection.uploading')
|
|
33427
|
+
: 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
|
|
33428
|
+
? this.failedFiles.length > 0
|
|
33429
|
+
? `${i18next.t('printer_selection.pull_print_success')} (${this.successfulFiles.length}/${this.totalFiles} files)`
|
|
33430
|
+
: `${i18next.t('printer_selection.pull_print_success')} (${this.totalFiles} files)`
|
|
33431
|
+
: 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
|
|
33432
|
+
? this.partialSuccess
|
|
33433
|
+
? `${i18next.t('printer_selection.print_success')} (${this.successfulFiles.length}/${this.totalFiles} ${i18next.t('printer_selection.files')} - ${this.failedFiles.length} failed`
|
|
33434
|
+
: `${i18next.t('printer_selection.print_success')} (${this.totalFiles} ${i18next.t('printer_selection.files')})`
|
|
33435
|
+
: 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
|
|
33436
|
+
? this.files && this.files.length > 1
|
|
33437
|
+
? i18next.t('printer_selection.files_selected', { count: this.files.length })
|
|
33438
|
+
: this.filename
|
|
33439
|
+
: '', 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
|
|
33295
33440
|
? i18next.t('printer_selection.select_printer')
|
|
33296
33441
|
: i18next.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
|
|
33297
33442
|
id: printer.id,
|
|
@@ -33303,27 +33448,29 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33303
33448
|
id: option.id,
|
|
33304
33449
|
title: option.title,
|
|
33305
33450
|
meta: '',
|
|
33306
|
-
type: 'color'
|
|
33307
|
-
})), preSelected: this.selectedPrinter.id
|
|
33308
|
-
&& ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == "color"
|
|
33451
|
+
type: 'color',
|
|
33452
|
+
})), preSelected: this.selectedPrinter.id && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == 'color'
|
|
33309
33453
|
? i18next.t('printer_selection.color_color')
|
|
33310
33454
|
: 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) => ({
|
|
33311
33455
|
id: option.id,
|
|
33312
33456
|
title: option.title,
|
|
33313
33457
|
meta: '',
|
|
33314
33458
|
type: 'duplex',
|
|
33315
|
-
})), preSelected: this.selectedPrinter.id &&
|
|
33459
|
+
})), preSelected: this.selectedPrinter.id &&
|
|
33460
|
+
((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == 'duplex_simplex'
|
|
33316
33461
|
? i18next.t('printer_selection.duplex_none')
|
|
33317
|
-
: ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) ==
|
|
33462
|
+
: ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == 'duplex_vertical'
|
|
33318
33463
|
? i18next.t('printer_selection.duplex_long')
|
|
33319
|
-
: ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) ==
|
|
33464
|
+
: ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == 'duplex_horizontal'
|
|
33320
33465
|
? i18next.t('printer_selection.duplex_short')
|
|
33321
|
-
: 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 &&
|
|
33322
|
-
|
|
33323
|
-
|
|
33324
|
-
|
|
33325
|
-
|
|
33326
|
-
|
|
33466
|
+
: 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 &&
|
|
33467
|
+
this.selectedPrinterConfig.PaperFormats.map((format) => ({
|
|
33468
|
+
id: format.Id,
|
|
33469
|
+
title: format.Name,
|
|
33470
|
+
meta: `${format.XRes} x ${format.YRes}`,
|
|
33471
|
+
type: 'format',
|
|
33472
|
+
})), preSelected: this.selectedPrinter.id &&
|
|
33473
|
+
((_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); }))
|
|
33327
33474
|
? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
|
|
33328
33475
|
: 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) => ({
|
|
33329
33476
|
id: index + 1,
|
|
@@ -33335,14 +33482,20 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33335
33482
|
title: option,
|
|
33336
33483
|
meta: '',
|
|
33337
33484
|
type: 'quality',
|
|
33338
|
-
})), preSelected: this.selectedPrinter.id &&
|
|
33485
|
+
})), preSelected: this.selectedPrinter.id &&
|
|
33486
|
+
((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.includes(this.selectedPrinterConfig.Default.Resolution))
|
|
33339
33487
|
? this.selectedPrinterConfig.Default.Resolution
|
|
33340
|
-
: null, disabled: !(((_m = this.selectedPrinterConfig.Resolutions) === null || _m === void 0 ? void 0 : _m.length) > 0) }), this.selectedPrinterConfig.Trays &&
|
|
33341
|
-
|
|
33342
|
-
|
|
33343
|
-
|
|
33344
|
-
|
|
33345
|
-
|
|
33488
|
+
: null, disabled: !(((_m = this.selectedPrinterConfig.Resolutions) === null || _m === void 0 ? void 0 : _m.length) > 0) }), this.selectedPrinterConfig.Trays &&
|
|
33489
|
+
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
33490
|
+
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 &&
|
|
33491
|
+
this.selectedPrinterConfig.Trays.length >= 1 &&
|
|
33492
|
+
this.selectedPrinterConfig.Trays.map((trays) => ({
|
|
33493
|
+
title: trays.Name,
|
|
33494
|
+
id: trays.Index,
|
|
33495
|
+
meta: '',
|
|
33496
|
+
type: 'tray',
|
|
33497
|
+
})), preSelected: this.selectedPrinter.id &&
|
|
33498
|
+
((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
|
|
33346
33499
|
? this.selectedPrinterConfig.Default.Tray
|
|
33347
33500
|
: 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 }))));
|
|
33348
33501
|
}
|
|
@@ -33381,6 +33534,7 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33381
33534
|
this.authOpen = false;
|
|
33382
33535
|
this.onlyGetSasUri = false;
|
|
33383
33536
|
this.noDocumentOpen = false;
|
|
33537
|
+
this.files = [];
|
|
33384
33538
|
}
|
|
33385
33539
|
/** Watchers */
|
|
33386
33540
|
watchFileData(newValue, oldValue) {
|
|
@@ -33390,7 +33544,7 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33390
33544
|
for (let i = 0; i < newValue.length; i++) {
|
|
33391
33545
|
array[i] = newValue.charCodeAt(i);
|
|
33392
33546
|
}
|
|
33393
|
-
this.
|
|
33547
|
+
this.files = [new File([array], this.filename)];
|
|
33394
33548
|
}
|
|
33395
33549
|
}
|
|
33396
33550
|
watchFilename(newValue, oldValue) {
|
|
@@ -33442,8 +33596,8 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33442
33596
|
}
|
|
33443
33597
|
}
|
|
33444
33598
|
listenUploadFile(event) {
|
|
33445
|
-
this.
|
|
33446
|
-
this.
|
|
33599
|
+
this.files = event.detail;
|
|
33600
|
+
this.filename = this.files.length > 0 ? this.files[0].name : '';
|
|
33447
33601
|
this.open();
|
|
33448
33602
|
}
|
|
33449
33603
|
listenDialogClose(event) {
|
|
@@ -33574,7 +33728,7 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33574
33728
|
render() {
|
|
33575
33729
|
return (h(Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
33576
33730
|
? this.systemAppearance
|
|
33577
|
-
: 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,
|
|
33731
|
+
: 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));
|
|
33578
33732
|
}
|
|
33579
33733
|
static get watchers() { return {
|
|
33580
33734
|
"filedata": ["watchFileData"],
|
|
@@ -33932,7 +34086,7 @@ let EzpUpload$1 = class extends HTMLElement {
|
|
|
33932
34086
|
* States
|
|
33933
34087
|
*
|
|
33934
34088
|
*/
|
|
33935
|
-
this.
|
|
34089
|
+
this.selectedFiles = [];
|
|
33936
34090
|
this.dragging = false;
|
|
33937
34091
|
/**
|
|
33938
34092
|
*
|
|
@@ -33940,8 +34094,9 @@ let EzpUpload$1 = class extends HTMLElement {
|
|
|
33940
34094
|
*
|
|
33941
34095
|
*/
|
|
33942
34096
|
this.handleInput = () => {
|
|
33943
|
-
|
|
33944
|
-
this.
|
|
34097
|
+
const files = Array.from(this.input.files);
|
|
34098
|
+
this.selectedFiles = files;
|
|
34099
|
+
this.uploadFile.emit(files);
|
|
33945
34100
|
};
|
|
33946
34101
|
}
|
|
33947
34102
|
/**
|
|
@@ -33964,12 +34119,13 @@ let EzpUpload$1 = class extends HTMLElement {
|
|
|
33964
34119
|
event.stopPropagation();
|
|
33965
34120
|
event.preventDefault();
|
|
33966
34121
|
this.dragging = false;
|
|
33967
|
-
|
|
33968
|
-
this.
|
|
34122
|
+
const files = Array.from(event.dataTransfer.files);
|
|
34123
|
+
this.selectedFiles = files;
|
|
34124
|
+
this.uploadFile.emit(files);
|
|
33969
34125
|
}
|
|
33970
34126
|
listenPrintCancel() {
|
|
33971
34127
|
this.form.reset();
|
|
33972
|
-
this.
|
|
34128
|
+
this.selectedFiles = [];
|
|
33973
34129
|
}
|
|
33974
34130
|
/**
|
|
33975
34131
|
*
|
|
@@ -33977,7 +34133,7 @@ let EzpUpload$1 = class extends HTMLElement {
|
|
|
33977
34133
|
*
|
|
33978
34134
|
*/
|
|
33979
34135
|
render() {
|
|
33980
|
-
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.
|
|
34136
|
+
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 })))))))));
|
|
33981
34137
|
}
|
|
33982
34138
|
static get style() { return ezpUploadCss; }
|
|
33983
34139
|
};
|
|
@@ -34088,13 +34244,13 @@ const EzpIcon = /*@__PURE__*/proxyCustomElement(EzpIcon$1, [1,"ezp-icon",{"name"
|
|
|
34088
34244
|
const EzpIconButton = /*@__PURE__*/proxyCustomElement(EzpIconButton$1, [1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}]);
|
|
34089
34245
|
const EzpInput = /*@__PURE__*/proxyCustomElement(EzpInput$1, [1,"ezp-input",{"label":[1],"value":[1032],"type":[1],"icon":[1],"suffix":[513],"eventType":[1,"event-type"],"placeholder":[1],"focused":[32]}]);
|
|
34090
34246
|
const EzpLabel = /*@__PURE__*/proxyCustomElement(EzpLabel$1, [1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]);
|
|
34091
|
-
const EzpPrinterSelection = /*@__PURE__*/proxyCustomElement(EzpPrinterSelection$1, [1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"
|
|
34092
|
-
const EzpPrinting = /*@__PURE__*/proxyCustomElement(EzpPrinting$1, [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],"
|
|
34247
|
+
const EzpPrinterSelection = /*@__PURE__*/proxyCustomElement(EzpPrinterSelection$1, [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"]]]);
|
|
34248
|
+
const EzpPrinting = /*@__PURE__*/proxyCustomElement(EzpPrinting$1, [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]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"],[0,"logout","listenLogout"]]]);
|
|
34093
34249
|
const EzpSelect = /*@__PURE__*/proxyCustomElement(EzpSelect$1, [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]}]);
|
|
34094
34250
|
const EzpStatus = /*@__PURE__*/proxyCustomElement(EzpStatus$1, [1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}]);
|
|
34095
34251
|
const EzpStepper = /*@__PURE__*/proxyCustomElement(EzpStepper$1, [1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}]);
|
|
34096
34252
|
const EzpTextButton = /*@__PURE__*/proxyCustomElement(EzpTextButton$1, [1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}]);
|
|
34097
|
-
const EzpUpload = /*@__PURE__*/proxyCustomElement(EzpUpload$1, [1,"ezp-upload",{"
|
|
34253
|
+
const EzpUpload = /*@__PURE__*/proxyCustomElement(EzpUpload$1, [1,"ezp-upload",{"selectedFiles":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]]);
|
|
34098
34254
|
const EzpUserMenu = /*@__PURE__*/proxyCustomElement(EzpUserMenu$1, [1,"ezp-user-menu",{"name":[1],"open":[1028]}]);
|
|
34099
34255
|
const defineCustomElements = (opts) => {
|
|
34100
34256
|
if (typeof customElements !== 'undefined') {
|