@ezeep/ezeep-js 1.0.242 → 1.0.244

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));
@@ -34165,8 +34188,9 @@ let EzpUpload = class {
34165
34188
  */
34166
34189
  this.handleInput = () => {
34167
34190
  const files = Array.from(this.input.files);
34168
- this.selectedFiles = files;
34169
- this.uploadFile.emit(files);
34191
+ // Add new files to existing selection instead of replacing
34192
+ this.selectedFiles = [...this.selectedFiles, ...files];
34193
+ this.uploadFile.emit(this.selectedFiles);
34170
34194
  };
34171
34195
  }
34172
34196
  /**
@@ -34190,8 +34214,9 @@ let EzpUpload = class {
34190
34214
  event.preventDefault();
34191
34215
  this.dragging = false;
34192
34216
  const files = Array.from(event.dataTransfer.files);
34193
- this.selectedFiles = files;
34194
- this.uploadFile.emit(files);
34217
+ // Add new files to existing selection instead of replacing
34218
+ this.selectedFiles = [...this.selectedFiles, ...files];
34219
+ this.uploadFile.emit(this.selectedFiles);
34195
34220
  }
34196
34221
  listenPrintCancel() {
34197
34222
  this.form.reset();
@@ -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));
@@ -16,8 +16,9 @@ export class EzpUpload {
16
16
  */
17
17
  this.handleInput = () => {
18
18
  const files = Array.from(this.input.files);
19
- this.selectedFiles = files;
20
- this.uploadFile.emit(files);
19
+ // Add new files to existing selection instead of replacing
20
+ this.selectedFiles = [...this.selectedFiles, ...files];
21
+ this.uploadFile.emit(this.selectedFiles);
21
22
  };
22
23
  }
23
24
  /**
@@ -41,8 +42,9 @@ export class EzpUpload {
41
42
  event.preventDefault();
42
43
  this.dragging = false;
43
44
  const files = Array.from(event.dataTransfer.files);
44
- this.selectedFiles = files;
45
- this.uploadFile.emit(files);
45
+ // Add new files to existing selection instead of replacing
46
+ this.selectedFiles = [...this.selectedFiles, ...files];
47
+ this.uploadFile.emit(this.selectedFiles);
46
48
  }
47
49
  listenPrintCancel() {
48
50
  this.form.reset();
@@ -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));
@@ -34202,8 +34225,9 @@ let EzpUpload$1 = class extends HTMLElement {
34202
34225
  */
34203
34226
  this.handleInput = () => {
34204
34227
  const files = Array.from(this.input.files);
34205
- this.selectedFiles = files;
34206
- this.uploadFile.emit(files);
34228
+ // Add new files to existing selection instead of replacing
34229
+ this.selectedFiles = [...this.selectedFiles, ...files];
34230
+ this.uploadFile.emit(this.selectedFiles);
34207
34231
  };
34208
34232
  }
34209
34233
  /**
@@ -34227,8 +34251,9 @@ let EzpUpload$1 = class extends HTMLElement {
34227
34251
  event.preventDefault();
34228
34252
  this.dragging = false;
34229
34253
  const files = Array.from(event.dataTransfer.files);
34230
- this.selectedFiles = files;
34231
- this.uploadFile.emit(files);
34254
+ // Add new files to existing selection instead of replacing
34255
+ this.selectedFiles = [...this.selectedFiles, ...files];
34256
+ this.uploadFile.emit(this.selectedFiles);
34232
34257
  }
34233
34258
  listenPrintCancel() {
34234
34259
  this.form.reset();
@@ -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));
@@ -34161,8 +34184,9 @@ let EzpUpload = class {
34161
34184
  */
34162
34185
  this.handleInput = () => {
34163
34186
  const files = Array.from(this.input.files);
34164
- this.selectedFiles = files;
34165
- this.uploadFile.emit(files);
34187
+ // Add new files to existing selection instead of replacing
34188
+ this.selectedFiles = [...this.selectedFiles, ...files];
34189
+ this.uploadFile.emit(this.selectedFiles);
34166
34190
  };
34167
34191
  }
34168
34192
  /**
@@ -34186,8 +34210,9 @@ let EzpUpload = class {
34186
34210
  event.preventDefault();
34187
34211
  this.dragging = false;
34188
34212
  const files = Array.from(event.dataTransfer.files);
34189
- this.selectedFiles = files;
34190
- this.uploadFile.emit(files);
34213
+ // Add new files to existing selection instead of replacing
34214
+ this.selectedFiles = [...this.selectedFiles, ...files];
34215
+ this.uploadFile.emit(this.selectedFiles);
34191
34216
  }
34192
34217
  listenPrintCancel() {
34193
34218
  this.form.reset();