@ezeep/ezeep-js 1.0.234 → 1.0.235

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.
@@ -33031,37 +33031,47 @@ let EzpPrinterSelection = class {
33031
33031
  await this.printService
33032
33032
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33033
33033
  .then((data) => {
33034
+ var _a, _b, _c, _d, _e, _f, _g;
33034
33035
  this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
33036
+ this.selectedProperties.color = ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color" ? true : false;
33037
+ this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
33038
+ this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
33039
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
33040
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
33041
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
33042
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
33043
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays[0] != null) {
33044
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
33045
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
33046
+ }
33047
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
33048
+ delete this.selectedProperties.trayname;
33049
+ delete this.selectedProperties.defaultSource;
33050
+ }
33051
+ this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
33052
+ this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
33053
+ delete this.selectedProperties.PageRanges;
33035
33054
  });
33036
33055
  // this.setDefaultPaperFormat()
33037
33056
  break;
33038
33057
  case 'color':
33039
- this.selectedProperties.color = !!eventDetails.id;
33040
- // console.log('color selected:')
33041
- // console.log(this.selectedProperties.color)
33058
+ this.selectedProperties.color = eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
33042
33059
  break;
33043
33060
  case 'orientation':
33044
33061
  this.selectedProperties.orientation = eventDetails.id;
33045
- // console.log('orientation selected:')
33046
- // console.log(this.selectedProperties.orientation)
33047
33062
  break;
33048
33063
  case 'format':
33049
33064
  this.selectedProperties.paper = eventDetails.title;
33050
33065
  this.selectedProperties.paperid = eventDetails.id;
33051
- // console.log('paper selected:')
33052
33066
  break;
33053
33067
  case 'quality':
33054
33068
  this.selectedProperties.resolution = eventDetails.title;
33055
- // console.log('quality selected:')
33056
- // console.log(this.selectedProperties.resolution)
33057
33069
  break;
33058
33070
  case 'length':
33059
33071
  this.selectedProperties.paperlength = eventDetails.value;
33060
- // console.log(this.selectedProperties)
33061
33072
  break;
33062
33073
  case 'width':
33063
33074
  this.selectedProperties.paperwidth = eventDetails.value;
33064
- // console.log(this.selectedProperties)
33065
33075
  break;
33066
33076
  case 'tray':
33067
33077
  if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
@@ -33076,22 +33086,19 @@ let EzpPrinterSelection = class {
33076
33086
  case 'paper_ranges':
33077
33087
  this.selectedProperties.PageRanges = eventDetails.value;
33078
33088
  this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
33079
- localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
33080
- // console.log(this.selectedProperties.PageRanges)
33081
33089
  break;
33082
33090
  case 'duplex':
33083
- if (eventDetails.title === 'None') {
33084
- this.selectedProperties.duplex = false;
33091
+ if (eventDetails.title == i18next.t('printer_selection.duplex_none')
33092
+ || eventDetails.title == i18next.t('printer_selection.duplex_long')
33093
+ || eventDetails.title == i18next.t('printer_selection.duplex_short')) {
33094
+ this.selectedProperties.duplex = true;
33085
33095
  }
33086
33096
  else {
33087
- this.selectedProperties.duplex = true;
33097
+ this.selectedProperties.duplex = false;
33088
33098
  }
33089
33099
  this.selectedProperties.duplexmode = eventDetails.id;
33090
- // console.log('duplex selected:')
33091
- // console.log(this.selectedProperties.duplexmode)
33092
33100
  break;
33093
33101
  }
33094
- // setting paper id here to updated the prop for input.
33095
33102
  this.setPaperid();
33096
33103
  }
33097
33104
  async handleFiles(file, printPorperties) {
@@ -33194,7 +33201,28 @@ let EzpPrinterSelection = class {
33194
33201
  if (this.selectedPrinter.id != '') {
33195
33202
  await this.printService
33196
33203
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33197
- .then((data) => (this.selectedPrinterConfig = data[0]));
33204
+ .then((data) => {
33205
+ var _a, _b, _c, _d, _e, _f, _g;
33206
+ this.selectedPrinterConfig = data[0];
33207
+ this.selectedProperties.color = ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color" ? true : false;
33208
+ this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
33209
+ this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
33210
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
33211
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
33212
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
33213
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
33214
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays[0] != null) {
33215
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
33216
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
33217
+ }
33218
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
33219
+ delete this.selectedProperties.trayname;
33220
+ delete this.selectedProperties.defaultSource;
33221
+ }
33222
+ this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
33223
+ this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
33224
+ delete this.selectedProperties.PageRanges;
33225
+ });
33198
33226
  if (this.selectedProperties.paper === '') {
33199
33227
  this.setDefaultPaperFormat();
33200
33228
  }
@@ -33280,7 +33308,7 @@ let EzpPrinterSelection = class {
33280
33308
  type: 'tray',
33281
33309
  })), preSelected: this.selectedPrinter.id && ((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
33282
33310
  ? this.selectedPrinterConfig.Default.Tray
33283
- : null })) : null, index.h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: localStorage.getItem('pageRanges') ? this.selectedProperties.PageRanges : '', eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })), index.h("ezp-stepper", { label: i18next.t('printer_selection.copies'), max: 10, icon: "copies" })), index.h("div", { id: "footer" }, index.h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }), index.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 && index.h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
33311
+ : null })) : null, index.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') })), index.h("ezp-stepper", { label: i18next.t('printer_selection.copies'), max: 10, icon: "copies" })), index.h("div", { id: "footer" }, index.h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }), index.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 && index.h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
33284
33312
  }
33285
33313
  };
33286
33314
  EzpPrinterSelection.style = ezpPrinterSelectionCss;
@@ -33866,7 +33894,6 @@ let EzpUpload = class {
33866
33894
  this.handleInput = () => {
33867
33895
  this.filename = this.input.files[0].name;
33868
33896
  this.uploadFile.emit(this.input.files);
33869
- localStorage.removeItem('pageRanges');
33870
33897
  };
33871
33898
  }
33872
33899
  /**
@@ -277,37 +277,47 @@ export class EzpPrinterSelection {
277
277
  await this.printService
278
278
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
279
279
  .then((data) => {
280
+ var _a, _b, _c, _d, _e, _f, _g;
280
281
  this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
282
+ this.selectedProperties.color = ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color" ? true : false;
283
+ this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
284
+ this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
285
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
286
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
287
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
288
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
289
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays[0] != null) {
290
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
291
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
292
+ }
293
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
294
+ delete this.selectedProperties.trayname;
295
+ delete this.selectedProperties.defaultSource;
296
+ }
297
+ this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
298
+ this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
299
+ delete this.selectedProperties.PageRanges;
281
300
  });
282
301
  // this.setDefaultPaperFormat()
283
302
  break;
284
303
  case 'color':
285
- this.selectedProperties.color = !!eventDetails.id;
286
- // console.log('color selected:')
287
- // console.log(this.selectedProperties.color)
304
+ this.selectedProperties.color = eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
288
305
  break;
289
306
  case 'orientation':
290
307
  this.selectedProperties.orientation = eventDetails.id;
291
- // console.log('orientation selected:')
292
- // console.log(this.selectedProperties.orientation)
293
308
  break;
294
309
  case 'format':
295
310
  this.selectedProperties.paper = eventDetails.title;
296
311
  this.selectedProperties.paperid = eventDetails.id;
297
- // console.log('paper selected:')
298
312
  break;
299
313
  case 'quality':
300
314
  this.selectedProperties.resolution = eventDetails.title;
301
- // console.log('quality selected:')
302
- // console.log(this.selectedProperties.resolution)
303
315
  break;
304
316
  case 'length':
305
317
  this.selectedProperties.paperlength = eventDetails.value;
306
- // console.log(this.selectedProperties)
307
318
  break;
308
319
  case 'width':
309
320
  this.selectedProperties.paperwidth = eventDetails.value;
310
- // console.log(this.selectedProperties)
311
321
  break;
312
322
  case 'tray':
313
323
  if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
@@ -322,24 +332,21 @@ export class EzpPrinterSelection {
322
332
  case 'paper_ranges':
323
333
  this.selectedProperties.PageRanges = eventDetails.value;
324
334
  this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
325
- localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
326
- // console.log(this.selectedProperties.PageRanges)
327
335
  break;
328
336
  case 'duplex':
329
- if (eventDetails.title === 'None') {
330
- this.selectedProperties.duplex = false;
337
+ if (eventDetails.title == i18next.t('printer_selection.duplex_none')
338
+ || eventDetails.title == i18next.t('printer_selection.duplex_long')
339
+ || eventDetails.title == i18next.t('printer_selection.duplex_short')) {
340
+ this.selectedProperties.duplex = true;
331
341
  }
332
342
  else {
333
- this.selectedProperties.duplex = true;
343
+ this.selectedProperties.duplex = false;
334
344
  }
335
345
  this.selectedProperties.duplexmode = eventDetails.id;
336
- // console.log('duplex selected:')
337
- // console.log(this.selectedProperties.duplexmode)
338
346
  break;
339
347
  default:
340
348
  break;
341
349
  }
342
- // setting paper id here to updated the prop for input.
343
350
  this.setPaperid();
344
351
  }
345
352
  async handleFiles(file, printPorperties) {
@@ -442,7 +449,28 @@ export class EzpPrinterSelection {
442
449
  if (this.selectedPrinter.id != '') {
443
450
  await this.printService
444
451
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
445
- .then((data) => (this.selectedPrinterConfig = data[0]));
452
+ .then((data) => {
453
+ var _a, _b, _c, _d, _e, _f, _g;
454
+ this.selectedPrinterConfig = data[0];
455
+ this.selectedProperties.color = ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color" ? true : false;
456
+ this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
457
+ this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
458
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
459
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
460
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
461
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
462
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays[0] != null) {
463
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
464
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
465
+ }
466
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
467
+ delete this.selectedProperties.trayname;
468
+ delete this.selectedProperties.defaultSource;
469
+ }
470
+ this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
471
+ this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
472
+ delete this.selectedProperties.PageRanges;
473
+ });
446
474
  if (this.selectedProperties.paper === '') {
447
475
  this.setDefaultPaperFormat();
448
476
  }
@@ -548,7 +576,7 @@ export class EzpPrinterSelection {
548
576
  })), preSelected: this.selectedPrinter.id && ((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
549
577
  ? this.selectedPrinterConfig.Default.Tray
550
578
  : null })) : null,
551
- h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: localStorage.getItem('pageRanges') ? this.selectedProperties.PageRanges : '', eventType: "paper_ranges", type: "text", label: i18next.t('printer_selection.page_ranges') })),
579
+ 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') })),
552
580
  h("ezp-stepper", { label: i18next.t('printer_selection.copies'), max: 10, icon: "copies" })),
553
581
  h("div", { id: "footer" },
554
582
  h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }),
@@ -17,7 +17,6 @@ export class EzpUpload {
17
17
  this.handleInput = () => {
18
18
  this.filename = this.input.files[0].name;
19
19
  this.uploadFile.emit(this.input.files);
20
- localStorage.removeItem('pageRanges');
21
20
  };
22
21
  }
23
22
  /**
@@ -33056,37 +33056,47 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33056
33056
  await this.printService
33057
33057
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33058
33058
  .then((data) => {
33059
+ var _a, _b, _c, _d, _e, _f, _g;
33059
33060
  this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
33061
+ this.selectedProperties.color = ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color" ? true : false;
33062
+ this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
33063
+ this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
33064
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
33065
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
33066
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
33067
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
33068
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays[0] != null) {
33069
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
33070
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
33071
+ }
33072
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
33073
+ delete this.selectedProperties.trayname;
33074
+ delete this.selectedProperties.defaultSource;
33075
+ }
33076
+ this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
33077
+ this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
33078
+ delete this.selectedProperties.PageRanges;
33060
33079
  });
33061
33080
  // this.setDefaultPaperFormat()
33062
33081
  break;
33063
33082
  case 'color':
33064
- this.selectedProperties.color = !!eventDetails.id;
33065
- // console.log('color selected:')
33066
- // console.log(this.selectedProperties.color)
33083
+ this.selectedProperties.color = eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
33067
33084
  break;
33068
33085
  case 'orientation':
33069
33086
  this.selectedProperties.orientation = eventDetails.id;
33070
- // console.log('orientation selected:')
33071
- // console.log(this.selectedProperties.orientation)
33072
33087
  break;
33073
33088
  case 'format':
33074
33089
  this.selectedProperties.paper = eventDetails.title;
33075
33090
  this.selectedProperties.paperid = eventDetails.id;
33076
- // console.log('paper selected:')
33077
33091
  break;
33078
33092
  case 'quality':
33079
33093
  this.selectedProperties.resolution = eventDetails.title;
33080
- // console.log('quality selected:')
33081
- // console.log(this.selectedProperties.resolution)
33082
33094
  break;
33083
33095
  case 'length':
33084
33096
  this.selectedProperties.paperlength = eventDetails.value;
33085
- // console.log(this.selectedProperties)
33086
33097
  break;
33087
33098
  case 'width':
33088
33099
  this.selectedProperties.paperwidth = eventDetails.value;
33089
- // console.log(this.selectedProperties)
33090
33100
  break;
33091
33101
  case 'tray':
33092
33102
  if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
@@ -33101,22 +33111,19 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33101
33111
  case 'paper_ranges':
33102
33112
  this.selectedProperties.PageRanges = eventDetails.value;
33103
33113
  this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
33104
- localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
33105
- // console.log(this.selectedProperties.PageRanges)
33106
33114
  break;
33107
33115
  case 'duplex':
33108
- if (eventDetails.title === 'None') {
33109
- this.selectedProperties.duplex = false;
33116
+ if (eventDetails.title == i18next.t('printer_selection.duplex_none')
33117
+ || eventDetails.title == i18next.t('printer_selection.duplex_long')
33118
+ || eventDetails.title == i18next.t('printer_selection.duplex_short')) {
33119
+ this.selectedProperties.duplex = true;
33110
33120
  }
33111
33121
  else {
33112
- this.selectedProperties.duplex = true;
33122
+ this.selectedProperties.duplex = false;
33113
33123
  }
33114
33124
  this.selectedProperties.duplexmode = eventDetails.id;
33115
- // console.log('duplex selected:')
33116
- // console.log(this.selectedProperties.duplexmode)
33117
33125
  break;
33118
33126
  }
33119
- // setting paper id here to updated the prop for input.
33120
33127
  this.setPaperid();
33121
33128
  }
33122
33129
  async handleFiles(file, printPorperties) {
@@ -33219,7 +33226,28 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33219
33226
  if (this.selectedPrinter.id != '') {
33220
33227
  await this.printService
33221
33228
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33222
- .then((data) => (this.selectedPrinterConfig = data[0]));
33229
+ .then((data) => {
33230
+ var _a, _b, _c, _d, _e, _f, _g;
33231
+ this.selectedPrinterConfig = data[0];
33232
+ this.selectedProperties.color = ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color" ? true : false;
33233
+ this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
33234
+ this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
33235
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
33236
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
33237
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
33238
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
33239
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays[0] != null) {
33240
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
33241
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
33242
+ }
33243
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
33244
+ delete this.selectedProperties.trayname;
33245
+ delete this.selectedProperties.defaultSource;
33246
+ }
33247
+ this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
33248
+ this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
33249
+ delete this.selectedProperties.PageRanges;
33250
+ });
33223
33251
  if (this.selectedProperties.paper === '') {
33224
33252
  this.setDefaultPaperFormat();
33225
33253
  }
@@ -33305,7 +33333,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33305
33333
  type: 'tray',
33306
33334
  })), preSelected: this.selectedPrinter.id && ((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
33307
33335
  ? this.selectedPrinterConfig.Default.Tray
33308
- : null })) : null, h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: localStorage.getItem('pageRanges') ? 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 }))));
33336
+ : 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 }))));
33309
33337
  }
33310
33338
  static get style() { return ezpPrinterSelectionCss; }
33311
33339
  };
@@ -33903,7 +33931,6 @@ let EzpUpload$1 = class extends HTMLElement {
33903
33931
  this.handleInput = () => {
33904
33932
  this.filename = this.input.files[0].name;
33905
33933
  this.uploadFile.emit(this.input.files);
33906
- localStorage.removeItem('pageRanges');
33907
33934
  };
33908
33935
  }
33909
33936
  /**
@@ -33027,37 +33027,47 @@ let EzpPrinterSelection = class {
33027
33027
  await this.printService
33028
33028
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33029
33029
  .then((data) => {
33030
+ var _a, _b, _c, _d, _e, _f, _g;
33030
33031
  this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
33032
+ this.selectedProperties.color = ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color" ? true : false;
33033
+ this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
33034
+ this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
33035
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
33036
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
33037
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
33038
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
33039
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays[0] != null) {
33040
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
33041
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
33042
+ }
33043
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
33044
+ delete this.selectedProperties.trayname;
33045
+ delete this.selectedProperties.defaultSource;
33046
+ }
33047
+ this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
33048
+ this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
33049
+ delete this.selectedProperties.PageRanges;
33031
33050
  });
33032
33051
  // this.setDefaultPaperFormat()
33033
33052
  break;
33034
33053
  case 'color':
33035
- this.selectedProperties.color = !!eventDetails.id;
33036
- // console.log('color selected:')
33037
- // console.log(this.selectedProperties.color)
33054
+ this.selectedProperties.color = eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
33038
33055
  break;
33039
33056
  case 'orientation':
33040
33057
  this.selectedProperties.orientation = eventDetails.id;
33041
- // console.log('orientation selected:')
33042
- // console.log(this.selectedProperties.orientation)
33043
33058
  break;
33044
33059
  case 'format':
33045
33060
  this.selectedProperties.paper = eventDetails.title;
33046
33061
  this.selectedProperties.paperid = eventDetails.id;
33047
- // console.log('paper selected:')
33048
33062
  break;
33049
33063
  case 'quality':
33050
33064
  this.selectedProperties.resolution = eventDetails.title;
33051
- // console.log('quality selected:')
33052
- // console.log(this.selectedProperties.resolution)
33053
33065
  break;
33054
33066
  case 'length':
33055
33067
  this.selectedProperties.paperlength = eventDetails.value;
33056
- // console.log(this.selectedProperties)
33057
33068
  break;
33058
33069
  case 'width':
33059
33070
  this.selectedProperties.paperwidth = eventDetails.value;
33060
- // console.log(this.selectedProperties)
33061
33071
  break;
33062
33072
  case 'tray':
33063
33073
  if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
@@ -33072,22 +33082,19 @@ let EzpPrinterSelection = class {
33072
33082
  case 'paper_ranges':
33073
33083
  this.selectedProperties.PageRanges = eventDetails.value;
33074
33084
  this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
33075
- localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
33076
- // console.log(this.selectedProperties.PageRanges)
33077
33085
  break;
33078
33086
  case 'duplex':
33079
- if (eventDetails.title === 'None') {
33080
- this.selectedProperties.duplex = false;
33087
+ if (eventDetails.title == i18next.t('printer_selection.duplex_none')
33088
+ || eventDetails.title == i18next.t('printer_selection.duplex_long')
33089
+ || eventDetails.title == i18next.t('printer_selection.duplex_short')) {
33090
+ this.selectedProperties.duplex = true;
33081
33091
  }
33082
33092
  else {
33083
- this.selectedProperties.duplex = true;
33093
+ this.selectedProperties.duplex = false;
33084
33094
  }
33085
33095
  this.selectedProperties.duplexmode = eventDetails.id;
33086
- // console.log('duplex selected:')
33087
- // console.log(this.selectedProperties.duplexmode)
33088
33096
  break;
33089
33097
  }
33090
- // setting paper id here to updated the prop for input.
33091
33098
  this.setPaperid();
33092
33099
  }
33093
33100
  async handleFiles(file, printPorperties) {
@@ -33190,7 +33197,28 @@ let EzpPrinterSelection = class {
33190
33197
  if (this.selectedPrinter.id != '') {
33191
33198
  await this.printService
33192
33199
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33193
- .then((data) => (this.selectedPrinterConfig = data[0]));
33200
+ .then((data) => {
33201
+ var _a, _b, _c, _d, _e, _f, _g;
33202
+ this.selectedPrinterConfig = data[0];
33203
+ this.selectedProperties.color = ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color" ? true : false;
33204
+ this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
33205
+ this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
33206
+ let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find(obj => obj.Default === true);
33207
+ this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
33208
+ this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
33209
+ let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find(obj => obj.Default === true);
33210
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 1 && this.selectedPrinterConfig.Trays[0] != null) {
33211
+ this.selectedProperties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
33212
+ this.selectedProperties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
33213
+ }
33214
+ if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
33215
+ delete this.selectedProperties.trayname;
33216
+ delete this.selectedProperties.defaultSource;
33217
+ }
33218
+ this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
33219
+ this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
33220
+ delete this.selectedProperties.PageRanges;
33221
+ });
33194
33222
  if (this.selectedProperties.paper === '') {
33195
33223
  this.setDefaultPaperFormat();
33196
33224
  }
@@ -33276,7 +33304,7 @@ let EzpPrinterSelection = class {
33276
33304
  type: 'tray',
33277
33305
  })), preSelected: this.selectedPrinter.id && ((_o = this.selectedPrinterConfig.Trays) === null || _o === void 0 ? void 0 : _o.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
33278
33306
  ? this.selectedPrinterConfig.Default.Tray
33279
- : null })) : null, h("ezp-input", { icon: "paper_range", suffix: "", placeholder: "1-2,4-5,8", value: localStorage.getItem('pageRanges') ? 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 }))));
33307
+ : 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 }))));
33280
33308
  }
33281
33309
  };
33282
33310
  EzpPrinterSelection.style = ezpPrinterSelectionCss;
@@ -33862,7 +33890,6 @@ let EzpUpload = class {
33862
33890
  this.handleInput = () => {
33863
33891
  this.filename = this.input.files[0].name;
33864
33892
  this.uploadFile.emit(this.input.files);
33865
- localStorage.removeItem('pageRanges');
33866
33893
  };
33867
33894
  }
33868
33895
  /**