@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.
Files changed (29) hide show
  1. package/dist/cjs/ezeep.cjs.js +1 -1
  2. package/dist/cjs/ezp-auth_15.cjs.entry.js +265 -109
  3. package/dist/cjs/loader.cjs.js +1 -1
  4. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +249 -95
  5. package/dist/collection/components/ezp-printing/ezp-printing.js +6 -5
  6. package/dist/collection/components/ezp-upload/ezp-upload.js +13 -11
  7. package/dist/custom-elements/index.js +268 -112
  8. package/dist/directives/proxies.ts +2 -2
  9. package/dist/esm/ezeep.js +1 -1
  10. package/dist/esm/ezp-auth_15.entry.js +265 -109
  11. package/dist/esm/loader.js +1 -1
  12. package/dist/esm-es5/ezeep.js +1 -1
  13. package/dist/esm-es5/ezp-auth_15.entry.js +3 -3
  14. package/dist/esm-es5/loader.js +1 -1
  15. package/dist/ezeep/ezeep.esm.js +1 -1
  16. package/dist/ezeep/{p-62b9b554.system.entry.js → p-0afb1821.system.entry.js} +3 -3
  17. package/dist/ezeep/{p-7b589922.entry.js → p-69fc0c9c.entry.js} +2 -2
  18. package/dist/ezeep/p-84bd195a.system.js +1 -1
  19. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +11 -3
  20. package/dist/types/components/ezp-printing/ezp-printing.d.ts +1 -1
  21. package/dist/types/components/ezp-upload/ezp-upload.d.ts +1 -1
  22. package/dist/types/components.d.ts +2 -2
  23. package/package.json +1 -1
  24. package/www/build/ezeep.esm.js +1 -1
  25. package/www/build/{p-62b9b554.system.entry.js → p-0afb1821.system.entry.js} +3 -3
  26. package/www/build/{p-7b589922.entry.js → p-69fc0c9c.entry.js} +2 -2
  27. package/www/build/p-84bd195a.system.js +1 -1
  28. package/www/data/locales/de.json +8 -6
  29. package/www/data/locales/en.json +8 -6
@@ -2875,7 +2875,9 @@ const printer_selection$1 = {
2875
2875
  trays: "Papierfach",
2876
2876
  select_trays: "Wähle Papierfach",
2877
2877
  page_ranges: "Druckbereich",
2878
- paper_ranges: "Papier-Ranges"
2878
+ paper_ranges: "Papier-Ranges",
2879
+ files_selected: "{{count}} Dateien ausgewählt",
2880
+ files: "Dateien"
2879
2881
  };
2880
2882
  const button_actions$1 = {
2881
2883
  login: "Anmelden",
@@ -2886,11 +2888,11 @@ const button_actions$1 = {
2886
2888
  select_printer: "Wähle Drucker"
2887
2889
  };
2888
2890
  const upload$1 = {
2889
- description: "Ziehe eine Datei hier in den Browser ",
2891
+ description: "Ziehe Dateien hier in den Browser ",
2890
2892
  meta_leading: "oder",
2891
- meta_select: "wähle eine Datei aus",
2893
+ meta_select: "wähle Dateien aus",
2892
2894
  meta_trailing: "um mit ezeep Blue zu drucken.",
2893
- selected_file: "Ausgewählte Datei:"
2895
+ selected_files: "Ausgewählte Dateien:"
2894
2896
  };
2895
2897
  const user_menu$1 = {
2896
2898
  theme: "Farbschema",
@@ -2958,7 +2960,9 @@ const printer_selection = {
2958
2960
  trays: "Tray",
2959
2961
  select_trays: "Select Tray",
2960
2962
  page_ranges: "Page Ranges",
2961
- paper_ranges: "Paper Ranges"
2963
+ paper_ranges: "Paper Ranges",
2964
+ files_selected: "{{count}} files selected",
2965
+ files: "files"
2962
2966
  };
2963
2967
  const button_actions = {
2964
2968
  login: "Sign In",
@@ -2969,11 +2973,11 @@ const button_actions = {
2969
2973
  select_printer: "Select Printer"
2970
2974
  };
2971
2975
  const upload = {
2972
- description: "Drop a file here into the browser ",
2976
+ description: "Drop files here into the browser ",
2973
2977
  meta_leading: "or",
2974
- meta_select: "select a file",
2978
+ meta_select: "select files",
2975
2979
  meta_trailing: "to print with ezeep Blue.",
2976
- selected_file: "Selected File:"
2980
+ selected_files: "Selected Files:"
2977
2981
  };
2978
2982
  const user_menu = {
2979
2983
  theme: "Color theme",
@@ -32766,7 +32770,6 @@ let EzpPrinterSelection = class {
32766
32770
  this.printCancel = createEvent(this, "printCancel", 7);
32767
32771
  this.printSubmit = createEvent(this, "printSubmit", 7);
32768
32772
  this.logout = createEvent(this, "logout", 7);
32769
- this.sasUri = '';
32770
32773
  this.fileExtension = '';
32771
32774
  this.duplexOptions = [
32772
32775
  {
@@ -32790,7 +32793,7 @@ let EzpPrinterSelection = class {
32790
32793
  {
32791
32794
  id: 2,
32792
32795
  title: i18next.t('printer_selection.color_grayscale'),
32793
- }
32796
+ },
32794
32797
  ];
32795
32798
  this.hidemenu = false;
32796
32799
  this.hideheader = false;
@@ -32817,14 +32820,14 @@ let EzpPrinterSelection = class {
32817
32820
  Paper: '',
32818
32821
  Orientation: '',
32819
32822
  Resolution: '',
32820
- Tray: ''
32823
+ Tray: '',
32821
32824
  },
32822
32825
  OrientationsSupported: [],
32823
32826
  PaperFormats: [],
32824
32827
  Resolutions: [],
32825
32828
  DuplexSupported: false,
32826
32829
  Color: false,
32827
- Trays: []
32830
+ Trays: [],
32828
32831
  };
32829
32832
  // needs to be initialised with empty strings
32830
32833
  this.selectedProperties = {
@@ -32842,6 +32845,11 @@ let EzpPrinterSelection = class {
32842
32845
  trayname: '',
32843
32846
  PageRanges: '',
32844
32847
  };
32848
+ this.currentFileIndex = 0;
32849
+ this.totalFiles = 0;
32850
+ this.failedFiles = [];
32851
+ this.successfulFiles = [];
32852
+ this.partialSuccess = false;
32845
32853
  /**
32846
32854
  *
32847
32855
  * Private methods
@@ -32849,6 +32857,9 @@ let EzpPrinterSelection = class {
32849
32857
  */
32850
32858
  /** Description... */
32851
32859
  this.handleCancel = () => {
32860
+ this.failedFiles = [];
32861
+ this.successfulFiles = [];
32862
+ this.partialSuccess = false;
32852
32863
  this.printCancel.emit();
32853
32864
  };
32854
32865
  this.validateData = (data) => {
@@ -32865,9 +32876,14 @@ let EzpPrinterSelection = class {
32865
32876
  this.handlePrint = async () => {
32866
32877
  this.printButton.blur();
32867
32878
  this.printProcessing = true;
32879
+ this.failedFiles = [];
32880
+ this.successfulFiles = [];
32881
+ this.partialSuccess = false;
32868
32882
  // we have to initialse this obj with empty strings to display the select component
32869
32883
  // but don't want to send any attributes with empty strings to the API
32870
- if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
32884
+ if (this.selectedPrinterConfig.Trays &&
32885
+ this.selectedPrinterConfig.Trays.length >= 0 &&
32886
+ this.selectedPrinterConfig.Trays[0] == null) {
32871
32887
  delete this.selectedProperties.trayname;
32872
32888
  delete this.selectedProperties.defaultSource;
32873
32889
  }
@@ -32927,8 +32943,11 @@ let EzpPrinterSelection = class {
32927
32943
  this.printProcessing = false;
32928
32944
  });
32929
32945
  }
32930
- if (this.file) {
32931
- await this.handleFiles(this.file, cleanPrintProperties);
32946
+ if (this.files && this.files.length > 1) {
32947
+ await this.processMultipleFiles(this.files, cleanPrintProperties);
32948
+ }
32949
+ else if (this.files && this.files.length === 1) {
32950
+ await this.processSingleFile(this.files[0], cleanPrintProperties);
32932
32951
  }
32933
32952
  localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
32934
32953
  localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
@@ -32976,11 +32995,16 @@ let EzpPrinterSelection = class {
32976
32995
  switch (event.detail) {
32977
32996
  case 'print-success':
32978
32997
  this.printSuccess = false;
32998
+ this.partialSuccess = false;
32999
+ this.failedFiles = [];
33000
+ this.successfulFiles = [];
32979
33001
  this.printCancel.emit();
32980
33002
  break;
32981
33003
  case 'print-failed':
32982
33004
  this.printProcessing = false;
32983
33005
  this.printFailed = false;
33006
+ this.failedFiles = [];
33007
+ this.successfulFiles = [];
32984
33008
  break;
32985
33009
  case 'no-printers':
32986
33010
  this.noPrinters = false;
@@ -33040,18 +33064,23 @@ let EzpPrinterSelection = class {
33040
33064
  .then((data) => {
33041
33065
  var _a, _b, _c, _d, _e, _f, _g;
33042
33066
  this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
33043
- this.selectedProperties.color = ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color" ? true : false;
33067
+ this.selectedProperties.color =
33068
+ ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
33044
33069
  this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
33045
33070
  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);
33071
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
33047
33072
  this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
33048
33073
  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 && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays[0] != null) {
33074
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
33075
+ if (this.selectedPrinterConfig.Trays &&
33076
+ this.selectedPrinterConfig.Trays.length >= 1 &&
33077
+ this.selectedPrinterConfig.Trays[0] != null) {
33051
33078
  this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
33052
33079
  this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
33053
33080
  }
33054
- if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
33081
+ if (this.selectedPrinterConfig.Trays &&
33082
+ this.selectedPrinterConfig.Trays.length >= 0 &&
33083
+ this.selectedPrinterConfig.Trays[0] == null) {
33055
33084
  delete this.selectedProperties.trayname;
33056
33085
  delete this.selectedProperties.defaultSource;
33057
33086
  }
@@ -33062,7 +33091,8 @@ let EzpPrinterSelection = class {
33062
33091
  // this.setDefaultPaperFormat()
33063
33092
  break;
33064
33093
  case 'color':
33065
- this.selectedProperties.color = eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
33094
+ this.selectedProperties.color =
33095
+ eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
33066
33096
  break;
33067
33097
  case 'orientation':
33068
33098
  this.selectedProperties.orientation = eventDetails.id;
@@ -33081,11 +33111,15 @@ let EzpPrinterSelection = class {
33081
33111
  this.selectedProperties.paperwidth = eventDetails.value;
33082
33112
  break;
33083
33113
  case 'tray':
33084
- if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
33114
+ if (this.selectedPrinterConfig.Trays &&
33115
+ this.selectedPrinterConfig.Trays.length >= 0 &&
33116
+ this.selectedPrinterConfig.Trays[0] == null) {
33085
33117
  delete this.selectedProperties.trayname;
33086
33118
  delete this.selectedProperties.defaultSource;
33087
33119
  }
33088
- if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays[0] != null) {
33120
+ if (this.selectedPrinterConfig.Trays &&
33121
+ this.selectedPrinterConfig.Trays.length >= 1 &&
33122
+ this.selectedPrinterConfig.Trays[0] != null) {
33089
33123
  this.selectedProperties.trayname = eventDetails.title;
33090
33124
  this.selectedProperties.defaultSource = eventDetails.id;
33091
33125
  }
@@ -33095,9 +33129,9 @@ let EzpPrinterSelection = class {
33095
33129
  this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
33096
33130
  break;
33097
33131
  case 'duplex':
33098
- if (eventDetails.title == i18next.t('printer_selection.duplex_none')
33099
- || eventDetails.title == i18next.t('printer_selection.duplex_long')
33100
- || eventDetails.title == i18next.t('printer_selection.duplex_short')) {
33132
+ if (eventDetails.title == i18next.t('printer_selection.duplex_none') ||
33133
+ eventDetails.title == i18next.t('printer_selection.duplex_long') ||
33134
+ eventDetails.title == i18next.t('printer_selection.duplex_short')) {
33101
33135
  this.selectedProperties.duplex = true;
33102
33136
  }
33103
33137
  else {
@@ -33108,59 +33142,114 @@ let EzpPrinterSelection = class {
33108
33142
  }
33109
33143
  this.setPaperid();
33110
33144
  }
33111
- async handleFiles(file, printPorperties) {
33145
+ async handleFiles(files, printPorperties) {
33146
+ this.totalFiles = files.length;
33147
+ this.currentFileIndex = 0;
33148
+ this.failedFiles = [];
33149
+ this.successfulFiles = [];
33150
+ // Process each file individually
33151
+ for (let i = 0; i < files.length; i++) {
33152
+ this.currentFileIndex = i;
33153
+ const file = files[i];
33154
+ try {
33155
+ await this.processSingleFile(file, printPorperties);
33156
+ this.successfulFiles.push(file.name);
33157
+ }
33158
+ catch (error) {
33159
+ console.error(`Error processing file ${file.name}:`, error);
33160
+ this.failedFiles.push(file.name);
33161
+ // Continue with the next file instead of stopping
33162
+ }
33163
+ }
33164
+ // Determine final status based on results
33165
+ if (this.failedFiles.length === 0) {
33166
+ // All files processed successfully
33167
+ this.printSuccess = true;
33168
+ this.partialSuccess = false;
33169
+ this.printProcessing = false;
33170
+ }
33171
+ else if (this.successfulFiles.length === 0) {
33172
+ // All files failed
33173
+ this.printFailed = true;
33174
+ this.partialSuccess = false;
33175
+ this.printProcessing = false;
33176
+ }
33177
+ else {
33178
+ // Some files succeeded, some failed - show partial success
33179
+ this.printSuccess = true;
33180
+ this.partialSuccess = true;
33181
+ this.printProcessing = false;
33182
+ }
33183
+ }
33184
+ async processSingleFile(file, printProperties) {
33112
33185
  this.preparingUpload = true;
33113
33186
  const response = await this.printService.prepareFileUpload(authStore.state.accessToken);
33114
33187
  this.preparingUpload = false;
33115
- this.fileid = response.fileid;
33116
- this.sasUri = response.sasUri;
33117
- this.filetype = this.fileExtension;
33118
- let res;
33188
+ const fileid = response.fileid;
33189
+ const sasUri = response.sasUri;
33190
+ const filetype = this.getFileExtension(file.name);
33119
33191
  this.uploading = true;
33120
33192
  try {
33121
- res = await this.printService.uploadBlobFiles(this.sasUri, file);
33122
- }
33123
- catch (error) {
33124
- this.printProcessing = false;
33125
- this.printFailed = true;
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) => {
33193
+ // Upload the file
33194
+ const res = await this.printService.uploadBlobFiles(sasUri, file);
33195
+ if (res._response.status === 201) {
33196
+ // Print the file
33197
+ const data = await this.printService.printByFileID(authStore.state.accessToken, fileid, filetype, this.selectedPrinter.id, printProperties, file.name);
33132
33198
  if (data.code === 804) {
33133
- this.printFailed = true;
33134
- this.printProcessing = false;
33199
+ throw new Error(`Print failed for file: ${file.name}`);
33135
33200
  }
33136
33201
  if (data.jobid) {
33137
33202
  printStore.state.jobID = data.jobid;
33138
- poll({
33139
- fn: this.printService.getPrintStatus,
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
- });
33203
+ // Wait for this print job to complete before processing the next file
33204
+ await this.waitForPrintCompletion();
33148
33205
  }
33149
33206
  else {
33150
- this.printFailed = true;
33151
- this.printProcessing = false;
33207
+ throw new Error(`No job ID returned for file: ${file.name}`);
33152
33208
  }
33153
- })
33154
- .catch((error) => {
33155
- console.log(error);
33156
- this.printFailed = true;
33157
- this.printProcessing = false;
33158
- });
33209
+ }
33210
+ else {
33211
+ throw new Error(`Upload failed for file: ${file.name}`);
33212
+ }
33159
33213
  }
33160
- else {
33161
- this.printFailed = true;
33162
- this.printProcessing = false;
33214
+ catch (error) {
33215
+ this.uploading = false;
33216
+ throw error;
33163
33217
  }
33218
+ this.uploading = false;
33219
+ }
33220
+ async waitForPrintCompletion() {
33221
+ return new Promise((resolve, reject) => {
33222
+ const poll = async () => {
33223
+ try {
33224
+ const data = await this.printService.getPrintStatus();
33225
+ console.log('[waitForPrintCompletion] Poll response:', data);
33226
+ if (data.jobstatus === 0) {
33227
+ // Success
33228
+ resolve();
33229
+ }
33230
+ else if (data.jobstatus === 1246 || data.jobstatus === 129) {
33231
+ // Still processing, keep polling
33232
+ setTimeout(poll, this.POLL_INTERVAL);
33233
+ }
33234
+ else if (data.jobstatus === 3011 || data.jobstatus === 2) {
33235
+ // Failure
33236
+ reject(new Error('Print job failed: ' + (data.jobstatusstring || data.jobstatus)));
33237
+ }
33238
+ else {
33239
+ // Unknown status, treat as failure for safety
33240
+ reject(new Error('Unknown print job status: ' + data.jobstatus));
33241
+ }
33242
+ }
33243
+ catch (error) {
33244
+ reject(error);
33245
+ }
33246
+ };
33247
+ poll();
33248
+ });
33249
+ }
33250
+ getFileExtension(filename) {
33251
+ const extension = filename.split('.').pop();
33252
+ return extension ? extension.toLowerCase() : '';
33164
33253
  }
33165
33254
  setDefaultPaperFormat() {
33166
33255
  var _a, _b, _c, _d, _e;
@@ -33185,6 +33274,41 @@ let EzpPrinterSelection = class {
33185
33274
  }
33186
33275
  this.setPaperid();
33187
33276
  }
33277
+ async processMultipleFiles(files, printProperties) {
33278
+ this.totalFiles = files.length;
33279
+ this.currentFileIndex = 0;
33280
+ this.failedFiles = [];
33281
+ this.successfulFiles = [];
33282
+ for (let i = 0; i < files.length; i++) {
33283
+ this.currentFileIndex = i;
33284
+ const file = files[i];
33285
+ try {
33286
+ await this.processSingleFile(file, printProperties);
33287
+ this.successfulFiles.push(file.name);
33288
+ }
33289
+ catch (error) {
33290
+ console.error(`Error processing file ${file.name}:`, error);
33291
+ this.failedFiles.push(file.name);
33292
+ // Continue with the next file
33293
+ }
33294
+ }
33295
+ // Set UI state
33296
+ if (this.failedFiles.length === 0) {
33297
+ this.printSuccess = true;
33298
+ this.partialSuccess = false;
33299
+ this.printProcessing = false;
33300
+ }
33301
+ else if (this.successfulFiles.length === 0) {
33302
+ this.printFailed = true;
33303
+ this.partialSuccess = false;
33304
+ this.printProcessing = false;
33305
+ }
33306
+ else {
33307
+ this.printSuccess = true;
33308
+ this.partialSuccess = true;
33309
+ this.printProcessing = false;
33310
+ }
33311
+ }
33188
33312
  /**
33189
33313
  *
33190
33314
  * Lifecycle methods
@@ -33211,18 +33335,23 @@ let EzpPrinterSelection = class {
33211
33335
  .then((data) => {
33212
33336
  var _a, _b, _c, _d, _e, _f, _g;
33213
33337
  this.selectedPrinterConfig = data[0];
33214
- this.selectedProperties.color = ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color" ? true : false;
33338
+ this.selectedProperties.color =
33339
+ ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
33215
33340
  this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
33216
33341
  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);
33342
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
33218
33343
  this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
33219
33344
  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 && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays[0] != null) {
33345
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
33346
+ if (this.selectedPrinterConfig.Trays &&
33347
+ this.selectedPrinterConfig.Trays.length >= 1 &&
33348
+ this.selectedPrinterConfig.Trays[0] != null) {
33222
33349
  this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
33223
33350
  this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
33224
33351
  }
33225
- if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
33352
+ if (this.selectedPrinterConfig.Trays &&
33353
+ this.selectedPrinterConfig.Trays.length >= 0 &&
33354
+ this.selectedPrinterConfig.Trays[0] == null) {
33226
33355
  delete this.selectedProperties.trayname;
33227
33356
  delete this.selectedProperties.defaultSource;
33228
33357
  }
@@ -33244,10 +33373,12 @@ let EzpPrinterSelection = class {
33244
33373
  .then((printerConfig) => {
33245
33374
  this.printerConfig = printerConfig;
33246
33375
  });
33247
- if (this.file) {
33248
- await this.validateFileType(this.filename).then((valid) => {
33249
- this.notSupported = !valid ? true : false;
33250
- });
33376
+ if (this.files && this.files.length > 0) {
33377
+ // Validate all files
33378
+ const validationPromises = this.files.map((file) => this.validateFileType(file.name));
33379
+ const validationResults = await Promise.all(validationPromises);
33380
+ const allValid = validationResults.every((valid) => valid);
33381
+ this.notSupported = !allValid;
33251
33382
  }
33252
33383
  this.loading = false;
33253
33384
  }
@@ -33258,11 +33389,25 @@ let EzpPrinterSelection = class {
33258
33389
  */
33259
33390
  render() {
33260
33391
  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.preparingUpload
33262
- ? i18next.t('printer_selection.prepare_upload')
33263
- : this.uploading
33264
- ? i18next.t('printer_selection.uploading')
33265
- : i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.selectedPrinter.is_queue && this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.pull_print_success'), instance: "print-success", close: true })) : this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: 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 ? this.filename : '', 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
33392
+ 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
33393
+ ? `${i18next.t('printer_selection.print_processing')} (${this.currentFileIndex + 1}/${this.totalFiles})`
33394
+ : this.preparingUpload
33395
+ ? i18next.t('printer_selection.prepare_upload')
33396
+ : this.uploading
33397
+ ? i18next.t('printer_selection.uploading')
33398
+ : 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
33399
+ ? this.failedFiles.length > 0
33400
+ ? `${i18next.t('printer_selection.pull_print_success')} (${this.successfulFiles.length}/${this.totalFiles} files)`
33401
+ : `${i18next.t('printer_selection.pull_print_success')} (${this.totalFiles} files)`
33402
+ : 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
33403
+ ? this.partialSuccess
33404
+ ? `${i18next.t('printer_selection.print_success')} (${this.successfulFiles.length}/${this.totalFiles} ${i18next.t('printer_selection.files')} - ${this.failedFiles.length} failed`
33405
+ : `${i18next.t('printer_selection.print_success')} (${this.totalFiles} ${i18next.t('printer_selection.files')})`
33406
+ : 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
33407
+ ? this.files && this.files.length > 1
33408
+ ? i18next.t('printer_selection.files_selected', { count: this.files.length })
33409
+ : this.filename
33410
+ : '', 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
33411
  ? i18next.t('printer_selection.select_printer')
33267
33412
  : i18next.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
33268
33413
  id: printer.id,
@@ -33274,27 +33419,29 @@ let EzpPrinterSelection = class {
33274
33419
  id: option.id,
33275
33420
  title: option.title,
33276
33421
  meta: '',
33277
- type: 'color'
33278
- })), preSelected: this.selectedPrinter.id
33279
- && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == "color"
33422
+ type: 'color',
33423
+ })), preSelected: this.selectedPrinter.id && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == 'color'
33280
33424
  ? i18next.t('printer_selection.color_color')
33281
33425
  : 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
33426
  id: option.id,
33283
33427
  title: option.title,
33284
33428
  meta: '',
33285
33429
  type: 'duplex',
33286
- })), preSelected: this.selectedPrinter.id && ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_simplex"
33430
+ })), preSelected: this.selectedPrinter.id &&
33431
+ ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == 'duplex_simplex'
33287
33432
  ? i18next.t('printer_selection.duplex_none')
33288
- : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_vertical"
33433
+ : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == 'duplex_vertical'
33289
33434
  ? i18next.t('printer_selection.duplex_long')
33290
- : ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == "duplex_horizontal"
33435
+ : ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == 'duplex_horizontal'
33291
33436
  ? 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 && this.selectedPrinterConfig.PaperFormats.map((format) => ({
33293
- id: format.Id,
33294
- title: format.Name,
33295
- meta: `${format.XRes} x ${format.YRes}`,
33296
- type: 'format',
33297
- })), preSelected: this.selectedPrinter.id && ((_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); }))
33437
+ : 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 &&
33438
+ this.selectedPrinterConfig.PaperFormats.map((format) => ({
33439
+ id: format.Id,
33440
+ title: format.Name,
33441
+ meta: `${format.XRes} x ${format.YRes}`,
33442
+ type: 'format',
33443
+ })), preSelected: this.selectedPrinter.id &&
33444
+ ((_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
33445
  ? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
33299
33446
  : 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
33447
  id: index + 1,
@@ -33306,14 +33453,20 @@ let EzpPrinterSelection = class {
33306
33453
  title: option,
33307
33454
  meta: '',
33308
33455
  type: 'quality',
33309
- })), preSelected: this.selectedPrinter.id && ((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.includes(this.selectedPrinterConfig.Default.Resolution))
33456
+ })), preSelected: this.selectedPrinter.id &&
33457
+ ((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.includes(this.selectedPrinterConfig.Default.Resolution))
33310
33458
  ? this.selectedPrinterConfig.Default.Resolution
33311
- : null, disabled: !(((_m = this.selectedPrinterConfig.Resolutions) === null || _m === void 0 ? void 0 : _m.length) > 0) }), this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1 && 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 && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays.map((trays) => ({
33312
- title: trays.Name,
33313
- id: trays.Index,
33314
- meta: '',
33315
- type: 'tray',
33316
- })), preSelected: this.selectedPrinter.id && ((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
33459
+ : null, disabled: !(((_m = this.selectedPrinterConfig.Resolutions) === null || _m === void 0 ? void 0 : _m.length) > 0) }), this.selectedPrinterConfig.Trays &&
33460
+ this.selectedPrinterConfig.Trays.length >= 1 &&
33461
+ 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 &&
33462
+ this.selectedPrinterConfig.Trays.length >= 1 &&
33463
+ this.selectedPrinterConfig.Trays.map((trays) => ({
33464
+ title: trays.Name,
33465
+ id: trays.Index,
33466
+ meta: '',
33467
+ type: 'tray',
33468
+ })), preSelected: this.selectedPrinter.id &&
33469
+ ((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
33317
33470
  ? this.selectedPrinterConfig.Default.Tray
33318
33471
  : 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
33472
  }
@@ -33350,6 +33503,7 @@ let EzpPrinting = class {
33350
33503
  this.authOpen = false;
33351
33504
  this.onlyGetSasUri = false;
33352
33505
  this.noDocumentOpen = false;
33506
+ this.files = [];
33353
33507
  }
33354
33508
  /** Watchers */
33355
33509
  watchFileData(newValue, oldValue) {
@@ -33359,7 +33513,7 @@ let EzpPrinting = class {
33359
33513
  for (let i = 0; i < newValue.length; i++) {
33360
33514
  array[i] = newValue.charCodeAt(i);
33361
33515
  }
33362
- this.file = new File([array], this.filename);
33516
+ this.files = [new File([array], this.filename)];
33363
33517
  }
33364
33518
  }
33365
33519
  watchFilename(newValue, oldValue) {
@@ -33411,8 +33565,8 @@ let EzpPrinting = class {
33411
33565
  }
33412
33566
  }
33413
33567
  listenUploadFile(event) {
33414
- this.filename = event.detail[0].name;
33415
- this.file = event.detail[0];
33568
+ this.files = event.detail;
33569
+ this.filename = this.files.length > 0 ? this.files[0].name : '';
33416
33570
  this.open();
33417
33571
  }
33418
33572
  listenDialogClose(event) {
@@ -33543,7 +33697,7 @@ let EzpPrinting = class {
33543
33697
  render() {
33544
33698
  return (h(Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
33545
33699
  ? 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, file: this.file, 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));
33700
+ : 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
33701
  }
33548
33702
  static get watchers() { return {
33549
33703
  "filedata": ["watchFileData"],
@@ -33891,7 +34045,7 @@ let EzpUpload = class {
33891
34045
  * States
33892
34046
  *
33893
34047
  */
33894
- this.filename = '';
34048
+ this.selectedFiles = [];
33895
34049
  this.dragging = false;
33896
34050
  /**
33897
34051
  *
@@ -33899,8 +34053,9 @@ let EzpUpload = class {
33899
34053
  *
33900
34054
  */
33901
34055
  this.handleInput = () => {
33902
- this.filename = this.input.files[0].name;
33903
- this.uploadFile.emit(this.input.files);
34056
+ const files = Array.from(this.input.files);
34057
+ this.selectedFiles = files;
34058
+ this.uploadFile.emit(files);
33904
34059
  };
33905
34060
  }
33906
34061
  /**
@@ -33923,12 +34078,13 @@ let EzpUpload = class {
33923
34078
  event.stopPropagation();
33924
34079
  event.preventDefault();
33925
34080
  this.dragging = false;
33926
- this.filename = event.dataTransfer.files[0].name;
33927
- this.uploadFile.emit(event.dataTransfer.files);
34081
+ const files = Array.from(event.dataTransfer.files);
34082
+ this.selectedFiles = files;
34083
+ this.uploadFile.emit(files);
33928
34084
  }
33929
34085
  listenPrintCancel() {
33930
34086
  this.form.reset();
33931
- this.filename = '';
34087
+ this.selectedFiles = [];
33932
34088
  }
33933
34089
  /**
33934
34090
  *
@@ -33936,7 +34092,7 @@ let EzpUpload = class {
33936
34092
  *
33937
34093
  */
33938
34094
  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.filename != '' && (h(Fragment, null, h("ezp-label", { level: "secondary", text: i18next.t('upload.selected_file') }), h("ezp-label", { level: "tertiary", text: this.filename })))))));
34095
+ 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
34096
  }
33941
34097
  };
33942
34098
  EzpUpload.style = ezpUploadCss;