@ezeep/ezeep-js 1.0.242 → 1.0.243

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.
@@ -33038,9 +33038,32 @@ let EzpPrinterSelection = class {
33038
33038
  clearTimeout(hubTimeout);
33039
33039
  }
33040
33040
  else if (this.files && this.files.length === 1) {
33041
- await this.processSingleFile(this.files[0], cleanPrintProperties);
33041
+ // --- Begin: Consistent single file handling ---
33042
+ this.totalFiles = 1;
33043
+ this.currentFileIndex = 0;
33044
+ this.failedFiles = [];
33045
+ this.successfulFiles = [];
33046
+ try {
33047
+ await this.processSingleFile(this.files[0], cleanPrintProperties);
33048
+ this.successfulFiles.push(this.files[0].name);
33049
+ this.printSuccess = true;
33050
+ this.partialSuccess = false;
33051
+ this.printProcessing = false;
33052
+ }
33053
+ catch (error) {
33054
+ console.error(`Error processing file ${this.files[0].name}:`, error);
33055
+ this.failedFiles.push(this.files[0].name);
33056
+ this.printFailed = true;
33057
+ this.partialSuccess = false;
33058
+ this.printProcessing = false;
33059
+ // Check if this is a hub driver error
33060
+ if (error.message && error.message.includes('Hub printer driver error')) {
33061
+ this.hubDriverError = true;
33062
+ }
33063
+ }
33042
33064
  if (hubTimeout)
33043
33065
  clearTimeout(hubTimeout);
33066
+ // --- End: Consistent single file handling ---
33044
33067
  }
33045
33068
  localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
33046
33069
  localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
@@ -271,9 +271,32 @@ export class EzpPrinterSelection {
271
271
  clearTimeout(hubTimeout);
272
272
  }
273
273
  else if (this.files && this.files.length === 1) {
274
- await this.processSingleFile(this.files[0], cleanPrintProperties);
274
+ // --- Begin: Consistent single file handling ---
275
+ this.totalFiles = 1;
276
+ this.currentFileIndex = 0;
277
+ this.failedFiles = [];
278
+ this.successfulFiles = [];
279
+ try {
280
+ await this.processSingleFile(this.files[0], cleanPrintProperties);
281
+ this.successfulFiles.push(this.files[0].name);
282
+ this.printSuccess = true;
283
+ this.partialSuccess = false;
284
+ this.printProcessing = false;
285
+ }
286
+ catch (error) {
287
+ console.error(`Error processing file ${this.files[0].name}:`, error);
288
+ this.failedFiles.push(this.files[0].name);
289
+ this.printFailed = true;
290
+ this.partialSuccess = false;
291
+ this.printProcessing = false;
292
+ // Check if this is a hub driver error
293
+ if (error.message && error.message.includes('Hub printer driver error')) {
294
+ this.hubDriverError = true;
295
+ }
296
+ }
275
297
  if (hubTimeout)
276
298
  clearTimeout(hubTimeout);
299
+ // --- End: Consistent single file handling ---
277
300
  }
278
301
  localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
279
302
  localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
@@ -33063,9 +33063,32 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33063
33063
  clearTimeout(hubTimeout);
33064
33064
  }
33065
33065
  else if (this.files && this.files.length === 1) {
33066
- await this.processSingleFile(this.files[0], cleanPrintProperties);
33066
+ // --- Begin: Consistent single file handling ---
33067
+ this.totalFiles = 1;
33068
+ this.currentFileIndex = 0;
33069
+ this.failedFiles = [];
33070
+ this.successfulFiles = [];
33071
+ try {
33072
+ await this.processSingleFile(this.files[0], cleanPrintProperties);
33073
+ this.successfulFiles.push(this.files[0].name);
33074
+ this.printSuccess = true;
33075
+ this.partialSuccess = false;
33076
+ this.printProcessing = false;
33077
+ }
33078
+ catch (error) {
33079
+ console.error(`Error processing file ${this.files[0].name}:`, error);
33080
+ this.failedFiles.push(this.files[0].name);
33081
+ this.printFailed = true;
33082
+ this.partialSuccess = false;
33083
+ this.printProcessing = false;
33084
+ // Check if this is a hub driver error
33085
+ if (error.message && error.message.includes('Hub printer driver error')) {
33086
+ this.hubDriverError = true;
33087
+ }
33088
+ }
33067
33089
  if (hubTimeout)
33068
33090
  clearTimeout(hubTimeout);
33091
+ // --- End: Consistent single file handling ---
33069
33092
  }
33070
33093
  localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
33071
33094
  localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
@@ -33034,9 +33034,32 @@ let EzpPrinterSelection = class {
33034
33034
  clearTimeout(hubTimeout);
33035
33035
  }
33036
33036
  else if (this.files && this.files.length === 1) {
33037
- await this.processSingleFile(this.files[0], cleanPrintProperties);
33037
+ // --- Begin: Consistent single file handling ---
33038
+ this.totalFiles = 1;
33039
+ this.currentFileIndex = 0;
33040
+ this.failedFiles = [];
33041
+ this.successfulFiles = [];
33042
+ try {
33043
+ await this.processSingleFile(this.files[0], cleanPrintProperties);
33044
+ this.successfulFiles.push(this.files[0].name);
33045
+ this.printSuccess = true;
33046
+ this.partialSuccess = false;
33047
+ this.printProcessing = false;
33048
+ }
33049
+ catch (error) {
33050
+ console.error(`Error processing file ${this.files[0].name}:`, error);
33051
+ this.failedFiles.push(this.files[0].name);
33052
+ this.printFailed = true;
33053
+ this.partialSuccess = false;
33054
+ this.printProcessing = false;
33055
+ // Check if this is a hub driver error
33056
+ if (error.message && error.message.includes('Hub printer driver error')) {
33057
+ this.hubDriverError = true;
33058
+ }
33059
+ }
33038
33060
  if (hubTimeout)
33039
33061
  clearTimeout(hubTimeout);
33062
+ // --- End: Consistent single file handling ---
33040
33063
  }
33041
33064
  localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
33042
33065
  localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));