@ezeep/ezeep-js 1.0.233 → 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.
@@ -32802,6 +32802,16 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
32802
32802
  title: i18next.t('printer_selection.duplex_short'),
32803
32803
  },
32804
32804
  ];
32805
+ this.ColorOptions = [
32806
+ {
32807
+ id: 1,
32808
+ title: i18next.t('printer_selection.color_color'),
32809
+ },
32810
+ {
32811
+ id: 2,
32812
+ title: i18next.t('printer_selection.color_grayscale'),
32813
+ }
32814
+ ];
32805
32815
  this.hidemenu = false;
32806
32816
  this.hideheader = false;
32807
32817
  /**
@@ -33046,37 +33056,47 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33046
33056
  await this.printService
33047
33057
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33048
33058
  .then((data) => {
33059
+ var _a, _b, _c, _d, _e, _f, _g;
33049
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;
33050
33079
  });
33051
33080
  // this.setDefaultPaperFormat()
33052
33081
  break;
33053
33082
  case 'color':
33054
- this.selectedProperties.color = !!eventDetails.id;
33055
- // console.log('color selected:')
33056
- // console.log(this.selectedProperties.color)
33083
+ this.selectedProperties.color = eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
33057
33084
  break;
33058
33085
  case 'orientation':
33059
33086
  this.selectedProperties.orientation = eventDetails.id;
33060
- // console.log('orientation selected:')
33061
- // console.log(this.selectedProperties.orientation)
33062
33087
  break;
33063
33088
  case 'format':
33064
33089
  this.selectedProperties.paper = eventDetails.title;
33065
33090
  this.selectedProperties.paperid = eventDetails.id;
33066
- // console.log('paper selected:')
33067
33091
  break;
33068
33092
  case 'quality':
33069
33093
  this.selectedProperties.resolution = eventDetails.title;
33070
- // console.log('quality selected:')
33071
- // console.log(this.selectedProperties.resolution)
33072
33094
  break;
33073
33095
  case 'length':
33074
33096
  this.selectedProperties.paperlength = eventDetails.value;
33075
- // console.log(this.selectedProperties)
33076
33097
  break;
33077
33098
  case 'width':
33078
33099
  this.selectedProperties.paperwidth = eventDetails.value;
33079
- // console.log(this.selectedProperties)
33080
33100
  break;
33081
33101
  case 'tray':
33082
33102
  if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
@@ -33091,22 +33111,19 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33091
33111
  case 'paper_ranges':
33092
33112
  this.selectedProperties.PageRanges = eventDetails.value;
33093
33113
  this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
33094
- localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
33095
- // console.log(this.selectedProperties.PageRanges)
33096
33114
  break;
33097
33115
  case 'duplex':
33098
- if (eventDetails.title === 'None') {
33099
- 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;
33100
33120
  }
33101
33121
  else {
33102
- this.selectedProperties.duplex = true;
33122
+ this.selectedProperties.duplex = false;
33103
33123
  }
33104
33124
  this.selectedProperties.duplexmode = eventDetails.id;
33105
- // console.log('duplex selected:')
33106
- // console.log(this.selectedProperties.duplexmode)
33107
33125
  break;
33108
33126
  }
33109
- // setting paper id here to updated the prop for input.
33110
33127
  this.setPaperid();
33111
33128
  }
33112
33129
  async handleFiles(file, printPorperties) {
@@ -33209,7 +33226,28 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33209
33226
  if (this.selectedPrinter.id != '') {
33210
33227
  await this.printService
33211
33228
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33212
- .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
+ });
33213
33251
  if (this.selectedProperties.paper === '') {
33214
33252
  this.setDefaultPaperFormat();
33215
33253
  }
@@ -33237,7 +33275,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33237
33275
  *
33238
33276
  */
33239
33277
  render() {
33240
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
33278
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
33241
33279
  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
33242
33280
  ? i18next.t('printer_selection.prepare_upload')
33243
33281
  : this.uploading
@@ -33250,70 +33288,52 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33250
33288
  meta: printer.location !== '' ? printer.location : '',
33251
33289
  type: 'printer',
33252
33290
  is_queue: printer.is_queue,
33253
- })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })), h("div", { id: "options" }, h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.Color
33254
- ? [
33255
- {
33256
- id: 1,
33257
- title: i18next.t('printer_selection.color_color'),
33258
- meta: '',
33259
- type: 'color',
33260
- },
33261
- {
33262
- id: 0,
33263
- title: i18next.t('printer_selection.color_grayscale'),
33264
- meta: '',
33265
- type: 'color',
33266
- },
33267
- ]
33268
- : [
33269
- {
33270
- id: 0,
33271
- title: i18next.t('printer_selection.color_grayscale'),
33272
- meta: '',
33273
- type: 'color',
33274
- },
33275
- ], preSelected: this.selectedPrinter.id
33276
- ? ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color"
33277
- ? i18next.t('printer_selection.color_color')
33278
- : i18next.t('printer_selection.color_grayscale')
33279
- : null, 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: (_b = this.duplexOptions) === null || _b === void 0 ? void 0 : _b.map((option) => ({
33291
+ })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })), h("div", { id: "options" }, h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: (_a = this.ColorOptions) === null || _a === void 0 ? void 0 : _a.map((option) => ({
33292
+ id: option.id,
33293
+ title: option.title,
33294
+ meta: '',
33295
+ type: 'color'
33296
+ })), preSelected: this.selectedPrinter.id
33297
+ && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == "color"
33298
+ ? i18next.t('printer_selection.color_color')
33299
+ : 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) => ({
33280
33300
  id: option.id,
33281
33301
  title: option.title,
33282
33302
  meta: '',
33283
33303
  type: 'duplex',
33284
- })), preSelected: this.selectedPrinter.id && ((_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Duplex) == "duplex_simplex"
33304
+ })), preSelected: this.selectedPrinter.id && ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_simplex"
33285
33305
  ? i18next.t('printer_selection.duplex_none')
33286
- : ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_vertical"
33306
+ : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_vertical"
33287
33307
  ? i18next.t('printer_selection.duplex_long')
33288
- : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_horizontal"
33308
+ : ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == "duplex_horizontal"
33289
33309
  ? i18next.t('printer_selection.duplex_short')
33290
33310
  : 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) => ({
33291
33311
  id: format.Id,
33292
33312
  title: format.Name,
33293
33313
  meta: `${format.XRes} x ${format.YRes}`,
33294
33314
  type: 'format',
33295
- })), preSelected: this.selectedPrinter.id && ((_f = this.selectedPrinterConfig.PaperFormats) === null || _f === void 0 ? void 0 : _f.find((el) => { var _a; return el.Name.includes((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Paper); }))
33296
- ? (_g = this.selectedPrinterConfig.Default) === null || _g === void 0 ? void 0 : _g.Paper
33297
- : null, disabled: !(((_h = this.selectedPrinterConfig.PaperFormats) === null || _h === void 0 ? void 0 : _h.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) => ({
33315
+ })), 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); }))
33316
+ ? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
33317
+ : 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) => ({
33298
33318
  id: index + 1,
33299
33319
  title: i18next.t(`printer_selection.orientation_${orientation}`),
33300
33320
  meta: '',
33301
33321
  type: 'orientation',
33302
- })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }), h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", placeholder: i18next.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_j = this.selectedPrinterConfig.Resolutions) === null || _j === void 0 ? void 0 : _j.map((option, index) => ({
33322
+ })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }), h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", placeholder: i18next.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.map((option, index) => ({
33303
33323
  id: index,
33304
33324
  title: option,
33305
33325
  meta: '',
33306
33326
  type: 'quality',
33307
- })), preSelected: this.selectedPrinter.id && ((_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.includes(this.selectedPrinterConfig.Default.Resolution))
33327
+ })), preSelected: this.selectedPrinter.id && ((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.includes(this.selectedPrinterConfig.Default.Resolution))
33308
33328
  ? this.selectedPrinterConfig.Default.Resolution
33309
- : null, disabled: !(((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.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) => ({
33329
+ : 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) => ({
33310
33330
  title: trays.Name,
33311
33331
  id: trays.Index,
33312
33332
  meta: '',
33313
33333
  type: 'tray',
33314
- })), preSelected: this.selectedPrinter.id && ((_m = this.selectedPrinterConfig.Trays) === null || _m === void 0 ? void 0 : _m.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
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)))
33315
33335
  ? this.selectedPrinterConfig.Default.Tray
33316
- : 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 }))));
33317
33337
  }
33318
33338
  static get style() { return ezpPrinterSelectionCss; }
33319
33339
  };
@@ -33911,7 +33931,6 @@ let EzpUpload$1 = class extends HTMLElement {
33911
33931
  this.handleInput = () => {
33912
33932
  this.filename = this.input.files[0].name;
33913
33933
  this.uploadFile.emit(this.input.files);
33914
- localStorage.removeItem('pageRanges');
33915
33934
  };
33916
33935
  }
33917
33936
  /**
@@ -32773,6 +32773,16 @@ let EzpPrinterSelection = class {
32773
32773
  title: i18next.t('printer_selection.duplex_short'),
32774
32774
  },
32775
32775
  ];
32776
+ this.ColorOptions = [
32777
+ {
32778
+ id: 1,
32779
+ title: i18next.t('printer_selection.color_color'),
32780
+ },
32781
+ {
32782
+ id: 2,
32783
+ title: i18next.t('printer_selection.color_grayscale'),
32784
+ }
32785
+ ];
32776
32786
  this.hidemenu = false;
32777
32787
  this.hideheader = false;
32778
32788
  /**
@@ -33017,37 +33027,47 @@ let EzpPrinterSelection = class {
33017
33027
  await this.printService
33018
33028
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33019
33029
  .then((data) => {
33030
+ var _a, _b, _c, _d, _e, _f, _g;
33020
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;
33021
33050
  });
33022
33051
  // this.setDefaultPaperFormat()
33023
33052
  break;
33024
33053
  case 'color':
33025
- this.selectedProperties.color = !!eventDetails.id;
33026
- // console.log('color selected:')
33027
- // console.log(this.selectedProperties.color)
33054
+ this.selectedProperties.color = eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
33028
33055
  break;
33029
33056
  case 'orientation':
33030
33057
  this.selectedProperties.orientation = eventDetails.id;
33031
- // console.log('orientation selected:')
33032
- // console.log(this.selectedProperties.orientation)
33033
33058
  break;
33034
33059
  case 'format':
33035
33060
  this.selectedProperties.paper = eventDetails.title;
33036
33061
  this.selectedProperties.paperid = eventDetails.id;
33037
- // console.log('paper selected:')
33038
33062
  break;
33039
33063
  case 'quality':
33040
33064
  this.selectedProperties.resolution = eventDetails.title;
33041
- // console.log('quality selected:')
33042
- // console.log(this.selectedProperties.resolution)
33043
33065
  break;
33044
33066
  case 'length':
33045
33067
  this.selectedProperties.paperlength = eventDetails.value;
33046
- // console.log(this.selectedProperties)
33047
33068
  break;
33048
33069
  case 'width':
33049
33070
  this.selectedProperties.paperwidth = eventDetails.value;
33050
- // console.log(this.selectedProperties)
33051
33071
  break;
33052
33072
  case 'tray':
33053
33073
  if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
@@ -33062,22 +33082,19 @@ let EzpPrinterSelection = class {
33062
33082
  case 'paper_ranges':
33063
33083
  this.selectedProperties.PageRanges = eventDetails.value;
33064
33084
  this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
33065
- localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
33066
- // console.log(this.selectedProperties.PageRanges)
33067
33085
  break;
33068
33086
  case 'duplex':
33069
- if (eventDetails.title === 'None') {
33070
- 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;
33071
33091
  }
33072
33092
  else {
33073
- this.selectedProperties.duplex = true;
33093
+ this.selectedProperties.duplex = false;
33074
33094
  }
33075
33095
  this.selectedProperties.duplexmode = eventDetails.id;
33076
- // console.log('duplex selected:')
33077
- // console.log(this.selectedProperties.duplexmode)
33078
33096
  break;
33079
33097
  }
33080
- // setting paper id here to updated the prop for input.
33081
33098
  this.setPaperid();
33082
33099
  }
33083
33100
  async handleFiles(file, printPorperties) {
@@ -33180,7 +33197,28 @@ let EzpPrinterSelection = class {
33180
33197
  if (this.selectedPrinter.id != '') {
33181
33198
  await this.printService
33182
33199
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33183
- .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
+ });
33184
33222
  if (this.selectedProperties.paper === '') {
33185
33223
  this.setDefaultPaperFormat();
33186
33224
  }
@@ -33208,7 +33246,7 @@ let EzpPrinterSelection = class {
33208
33246
  *
33209
33247
  */
33210
33248
  render() {
33211
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
33249
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
33212
33250
  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
33213
33251
  ? i18next.t('printer_selection.prepare_upload')
33214
33252
  : this.uploading
@@ -33221,70 +33259,52 @@ let EzpPrinterSelection = class {
33221
33259
  meta: printer.location !== '' ? printer.location : '',
33222
33260
  type: 'printer',
33223
33261
  is_queue: printer.is_queue,
33224
- })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })), h("div", { id: "options" }, h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.Color
33225
- ? [
33226
- {
33227
- id: 1,
33228
- title: i18next.t('printer_selection.color_color'),
33229
- meta: '',
33230
- type: 'color',
33231
- },
33232
- {
33233
- id: 0,
33234
- title: i18next.t('printer_selection.color_grayscale'),
33235
- meta: '',
33236
- type: 'color',
33237
- },
33238
- ]
33239
- : [
33240
- {
33241
- id: 0,
33242
- title: i18next.t('printer_selection.color_grayscale'),
33243
- meta: '',
33244
- type: 'color',
33245
- },
33246
- ], preSelected: this.selectedPrinter.id
33247
- ? ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color"
33248
- ? i18next.t('printer_selection.color_color')
33249
- : i18next.t('printer_selection.color_grayscale')
33250
- : null, 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: (_b = this.duplexOptions) === null || _b === void 0 ? void 0 : _b.map((option) => ({
33262
+ })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })), h("div", { id: "options" }, h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: (_a = this.ColorOptions) === null || _a === void 0 ? void 0 : _a.map((option) => ({
33263
+ id: option.id,
33264
+ title: option.title,
33265
+ meta: '',
33266
+ type: 'color'
33267
+ })), preSelected: this.selectedPrinter.id
33268
+ && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == "color"
33269
+ ? i18next.t('printer_selection.color_color')
33270
+ : 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) => ({
33251
33271
  id: option.id,
33252
33272
  title: option.title,
33253
33273
  meta: '',
33254
33274
  type: 'duplex',
33255
- })), preSelected: this.selectedPrinter.id && ((_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Duplex) == "duplex_simplex"
33275
+ })), preSelected: this.selectedPrinter.id && ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_simplex"
33256
33276
  ? i18next.t('printer_selection.duplex_none')
33257
- : ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_vertical"
33277
+ : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_vertical"
33258
33278
  ? i18next.t('printer_selection.duplex_long')
33259
- : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_horizontal"
33279
+ : ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == "duplex_horizontal"
33260
33280
  ? i18next.t('printer_selection.duplex_short')
33261
33281
  : 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) => ({
33262
33282
  id: format.Id,
33263
33283
  title: format.Name,
33264
33284
  meta: `${format.XRes} x ${format.YRes}`,
33265
33285
  type: 'format',
33266
- })), preSelected: this.selectedPrinter.id && ((_f = this.selectedPrinterConfig.PaperFormats) === null || _f === void 0 ? void 0 : _f.find((el) => { var _a; return el.Name.includes((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Paper); }))
33267
- ? (_g = this.selectedPrinterConfig.Default) === null || _g === void 0 ? void 0 : _g.Paper
33268
- : null, disabled: !(((_h = this.selectedPrinterConfig.PaperFormats) === null || _h === void 0 ? void 0 : _h.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) => ({
33286
+ })), 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); }))
33287
+ ? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
33288
+ : 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) => ({
33269
33289
  id: index + 1,
33270
33290
  title: i18next.t(`printer_selection.orientation_${orientation}`),
33271
33291
  meta: '',
33272
33292
  type: 'orientation',
33273
- })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }), h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", placeholder: i18next.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_j = this.selectedPrinterConfig.Resolutions) === null || _j === void 0 ? void 0 : _j.map((option, index) => ({
33293
+ })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }), h("ezp-select", { label: i18next.t('printer_selection.quality'), icon: "quality", placeholder: i18next.t('printer_selection.select_quality'), toggleFlow: "horizontal", options: (_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.map((option, index) => ({
33274
33294
  id: index,
33275
33295
  title: option,
33276
33296
  meta: '',
33277
33297
  type: 'quality',
33278
- })), preSelected: this.selectedPrinter.id && ((_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.includes(this.selectedPrinterConfig.Default.Resolution))
33298
+ })), preSelected: this.selectedPrinter.id && ((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.includes(this.selectedPrinterConfig.Default.Resolution))
33279
33299
  ? this.selectedPrinterConfig.Default.Resolution
33280
- : null, disabled: !(((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.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) => ({
33300
+ : 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) => ({
33281
33301
  title: trays.Name,
33282
33302
  id: trays.Index,
33283
33303
  meta: '',
33284
33304
  type: 'tray',
33285
- })), preSelected: this.selectedPrinter.id && ((_m = this.selectedPrinterConfig.Trays) === null || _m === void 0 ? void 0 : _m.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
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)))
33286
33306
  ? this.selectedPrinterConfig.Default.Tray
33287
- : 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 }))));
33288
33308
  }
33289
33309
  };
33290
33310
  EzpPrinterSelection.style = ezpPrinterSelectionCss;
@@ -33870,7 +33890,6 @@ let EzpUpload = class {
33870
33890
  this.handleInput = () => {
33871
33891
  this.filename = this.input.files[0].name;
33872
33892
  this.uploadFile.emit(this.input.files);
33873
- localStorage.removeItem('pageRanges');
33874
33893
  };
33875
33894
  }
33876
33895
  /**