@ezeep/ezeep-js 1.0.231 → 1.0.233

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.
@@ -32821,6 +32821,14 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
32821
32821
  this.userMenuOpen = false;
32822
32822
  this.printStopped = false;
32823
32823
  this.selectedPrinterConfig = {
32824
+ Default: {
32825
+ Color: '',
32826
+ Duplex: '',
32827
+ Paper: '',
32828
+ Orientation: '',
32829
+ Resolution: '',
32830
+ Tray: ''
32831
+ },
32824
32832
  OrientationsSupported: [],
32825
32833
  PaperFormats: [],
32826
32834
  Resolutions: [],
@@ -33037,8 +33045,10 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33037
33045
  this.selectedPrinter.is_queue = eventDetails.is_queue;
33038
33046
  await this.printService
33039
33047
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33040
- .then((data) => (this.selectedPrinterConfig = data[0]));
33041
- this.setDefaultPaperFormat();
33048
+ .then((data) => {
33049
+ this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
33050
+ });
33051
+ // this.setDefaultPaperFormat()
33042
33052
  break;
33043
33053
  case 'color':
33044
33054
  this.selectedProperties.color = !!eventDetails.id;
@@ -33081,6 +33091,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33081
33091
  case 'paper_ranges':
33082
33092
  this.selectedProperties.PageRanges = eventDetails.value;
33083
33093
  this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
33094
+ localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
33084
33095
  // console.log(this.selectedProperties.PageRanges)
33085
33096
  break;
33086
33097
  case 'duplex':
@@ -33153,6 +33164,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33153
33164
  }
33154
33165
  }
33155
33166
  setDefaultPaperFormat() {
33167
+ var _a, _b, _c, _d, _e;
33156
33168
  let format;
33157
33169
  const language = navigator.language;
33158
33170
  if (language === 'en-US') {
@@ -33164,13 +33176,13 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33164
33176
  else {
33165
33177
  format = 'A4';
33166
33178
  }
33167
- if (this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format))) {
33168
- this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Name;
33169
- this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Id;
33179
+ if ((_a = this.selectedPrinterConfig.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((el) => el.Name.includes(format))) {
33180
+ this.selectedProperties.paper = (_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.find((el) => el.Name.includes(format)).Name;
33181
+ this.selectedProperties.paperid = (_c = this.selectedPrinterConfig.PaperFormats) === null || _c === void 0 ? void 0 : _c.find((el) => el.Name.includes(format)).Id;
33170
33182
  }
33171
33183
  else {
33172
- this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats[0].Name;
33173
- this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats[0].Id;
33184
+ this.selectedProperties.paper = (_d = this.selectedPrinterConfig.PaperFormats[0]) === null || _d === void 0 ? void 0 : _d.Name;
33185
+ this.selectedProperties.paperid = (_e = this.selectedPrinterConfig.PaperFormats[0]) === null || _e === void 0 ? void 0 : _e.Id;
33174
33186
  }
33175
33187
  this.setPaperid();
33176
33188
  }
@@ -33225,6 +33237,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33225
33237
  *
33226
33238
  */
33227
33239
  render() {
33240
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
33228
33241
  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
33229
33242
  ? i18next.t('printer_selection.prepare_upload')
33230
33243
  : this.uploading
@@ -33260,37 +33273,47 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
33260
33273
  type: 'color',
33261
33274
  },
33262
33275
  ], preSelected: this.selectedPrinter.id
33263
- ? this.selectedProperties.color
33276
+ ? ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color"
33264
33277
  ? i18next.t('printer_selection.color_color')
33265
33278
  : i18next.t('printer_selection.color_grayscale')
33266
- : null, disabled: !this.selectedPrinterConfig.Color }), h("ezp-select", { label: i18next.t('printer_selection.duplex'), icon: "duplex", placeholder: i18next.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: this.duplexOptions.map((option) => ({
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) => ({
33267
33280
  id: option.id,
33268
33281
  title: option.title,
33269
33282
  meta: '',
33270
33283
  type: 'duplex',
33271
- })), preSelected: this.selectedPrinter.id && this.selectedProperties.duplex
33272
- ? this.duplexOptions.find((option) => option.id === this.selectedProperties.duplexmode).id
33273
- : 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.map((format) => ({
33284
+ })), preSelected: this.selectedPrinter.id && ((_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Duplex) == "duplex_simplex"
33285
+ ? i18next.t('printer_selection.duplex_none')
33286
+ : ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_vertical"
33287
+ ? i18next.t('printer_selection.duplex_long')
33288
+ : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_horizontal"
33289
+ ? i18next.t('printer_selection.duplex_short')
33290
+ : 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) => ({
33274
33291
  id: format.Id,
33275
33292
  title: format.Name,
33276
33293
  meta: `${format.XRes} x ${format.YRes}`,
33277
33294
  type: 'format',
33278
- })), preSelected: this.selectedPrinter.id ? this.selectedProperties.paper : null, disabled: !(this.selectedPrinterConfig.PaperFormats.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) => ({
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) => ({
33279
33298
  id: index + 1,
33280
33299
  title: i18next.t(`printer_selection.orientation_${orientation}`),
33281
33300
  meta: '',
33282
33301
  type: 'orientation',
33283
- })), 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: this.selectedPrinterConfig.Resolutions.map((option, index) => ({
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) => ({
33284
33303
  id: index,
33285
33304
  title: option,
33286
33305
  meta: '',
33287
33306
  type: 'quality',
33288
- })), preSelected: this.selectedPrinter.id ? this.selectedProperties.resolution : null, disabled: !(this.selectedPrinterConfig.Resolutions.length > 0) }), 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.length >= 1 && this.selectedPrinterConfig.Trays.map((trays) => ({
33307
+ })), preSelected: this.selectedPrinter.id && ((_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.includes(this.selectedPrinterConfig.Default.Resolution))
33308
+ ? 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) => ({
33289
33310
  title: trays.Name,
33290
33311
  id: trays.Index,
33291
33312
  meta: '',
33292
33313
  type: 'tray',
33293
- })) })) : 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 }))));
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)))
33315
+ ? 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 }))));
33294
33317
  }
33295
33318
  static get style() { return ezpPrinterSelectionCss; }
33296
33319
  };
@@ -33585,7 +33608,8 @@ let EzpSelect$1 = class extends HTMLElement {
33585
33608
  this.selectToggle.emit(this.expanded);
33586
33609
  };
33587
33610
  this.select = (id) => {
33588
- const delay = this.selected.id === id ? 0 : this.duration * 1000;
33611
+ var _a;
33612
+ const delay = ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) === id ? 0 : this.duration * 1000;
33589
33613
  this.selected = this.options.find((option) => option.id === id);
33590
33614
  this.selectSelection.emit(this.selected);
33591
33615
  window.setTimeout(() => {
@@ -33593,7 +33617,8 @@ let EzpSelect$1 = class extends HTMLElement {
33593
33617
  }, delay);
33594
33618
  };
33595
33619
  this.preSelect = () => {
33596
- this.selected = this.options.find((option) => typeof this.preSelected === 'number'
33620
+ var _a;
33621
+ this.selected = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((option) => typeof this.preSelected === 'number'
33597
33622
  ? option.id === this.preSelected
33598
33623
  : typeof this.preSelected === 'string'
33599
33624
  ? option.title === this.preSelected
@@ -33625,6 +33650,9 @@ let EzpSelect$1 = class extends HTMLElement {
33625
33650
  this.backdrop.visible = false;
33626
33651
  }
33627
33652
  }
33653
+ preSelectedChanged() {
33654
+ this.preSelect();
33655
+ }
33628
33656
  /**
33629
33657
  *
33630
33658
  * Lifecycle methods
@@ -33648,7 +33676,8 @@ let EzpSelect$1 = class extends HTMLElement {
33648
33676
  this.duration = parseFloat(styles.getPropertyValue('--ezp-select-duration'));
33649
33677
  }
33650
33678
  componentWillUpdate() {
33651
- if (this.selected.id === false &&
33679
+ var _a;
33680
+ if (((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) === false &&
33652
33681
  this.preSelected !== undefined &&
33653
33682
  this.preSelected !== '' &&
33654
33683
  this.preSelected !== null) {
@@ -33661,6 +33690,7 @@ let EzpSelect$1 = class extends HTMLElement {
33661
33690
  *
33662
33691
  */
33663
33692
  render() {
33693
+ var _a, _b, _c;
33664
33694
  const hostClasses = [
33665
33695
  this.expanded ? 'is-expanded' : '',
33666
33696
  this.icon ? 'has-icon' : '',
@@ -33669,15 +33699,17 @@ let EzpSelect$1 = class extends HTMLElement {
33669
33699
  this.disabled ? 'disabled' : '',
33670
33700
  ];
33671
33701
  const labelLevel = this.toggleFlow === 'horizontal' ? 'secondary' : 'tertiary';
33672
- return (h(Host, { class: hostClasses.join(' ') }, h("div", { id: "wrap" }, h("div", { id: "toggle", onClick: () => !this.disabled && this.toggle() }, this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { id: "label", noWrap: true, level: labelLevel, text: this.label }), h("ezp-label", { id: "value", ellipsis: true, text: this.selected.title !== '' ? this.selected.title : this.placeholder }), h("ezp-icon", { id: "accessory", name: "expand" })), h("div", { id: "list", ref: (element) => (this.list = element) }, this.options.map((option) => {
33702
+ return (h(Host, { class: hostClasses.join(' ') }, h("div", { id: "wrap" }, h("div", { id: "toggle", onClick: () => !this.disabled && this.toggle() }, this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { id: "label", noWrap: true, level: labelLevel, text: this.label }), h("ezp-label", { id: "value", ellipsis: true, text: ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.title) !== '' ? (_b = this.selected) === null || _b === void 0 ? void 0 : _b.title : this.placeholder }), h("ezp-icon", { id: "accessory", name: "expand" })), h("div", { id: "list", ref: (element) => (this.list = element) }, (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => {
33703
+ var _a;
33673
33704
  if (option.title !== '') {
33674
- return (h("div", { class: `option ${option.id === this.selected.id ? 'is-selected' : ''} ${option.meta !== '' ? 'has-meta' : ''} `, onClick: () => this.select(option.id) }, h("ezp-icon", { name: "checkmark", class: "indicator" }), h("div", { class: "details" }, h("ezp-label", { class: "title", ellipsis: true, text: option.title }), option.meta !== '' ? (h("ezp-label", { level: "tertiary", class: "meta", text: option.meta, ellipsis: true })) : null)));
33705
+ return (h("div", { class: `option ${option.id === ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) ? 'is-selected' : ''} ${option.meta !== '' ? 'has-meta' : ''} `, onClick: () => this.select(option.id) }, h("ezp-icon", { name: "checkmark", class: "indicator" }), h("div", { class: "details" }, h("ezp-label", { class: "title", ellipsis: true, text: option.title }), option.meta !== '' ? (h("ezp-label", { level: "tertiary", class: "meta", text: option.meta, ellipsis: true })) : null)));
33675
33706
  }
33676
33707
  })))));
33677
33708
  }
33678
33709
  get component() { return this; }
33679
33710
  static get watchers() { return {
33680
- "expanded": ["watchExpanded"]
33711
+ "expanded": ["watchExpanded"],
33712
+ "preSelected": ["preSelectedChanged"]
33681
33713
  }; }
33682
33714
  static get style() { return ezpSelectCss; }
33683
33715
  };
@@ -33879,6 +33911,7 @@ let EzpUpload$1 = class extends HTMLElement {
33879
33911
  this.handleInput = () => {
33880
33912
  this.filename = this.input.files[0].name;
33881
33913
  this.uploadFile.emit(this.input.files);
33914
+ localStorage.removeItem('pageRanges');
33882
33915
  };
33883
33916
  }
33884
33917
  /**
@@ -32792,6 +32792,14 @@ let EzpPrinterSelection = class {
32792
32792
  this.userMenuOpen = false;
32793
32793
  this.printStopped = false;
32794
32794
  this.selectedPrinterConfig = {
32795
+ Default: {
32796
+ Color: '',
32797
+ Duplex: '',
32798
+ Paper: '',
32799
+ Orientation: '',
32800
+ Resolution: '',
32801
+ Tray: ''
32802
+ },
32795
32803
  OrientationsSupported: [],
32796
32804
  PaperFormats: [],
32797
32805
  Resolutions: [],
@@ -33008,8 +33016,10 @@ let EzpPrinterSelection = class {
33008
33016
  this.selectedPrinter.is_queue = eventDetails.is_queue;
33009
33017
  await this.printService
33010
33018
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33011
- .then((data) => (this.selectedPrinterConfig = data[0]));
33012
- this.setDefaultPaperFormat();
33019
+ .then((data) => {
33020
+ this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
33021
+ });
33022
+ // this.setDefaultPaperFormat()
33013
33023
  break;
33014
33024
  case 'color':
33015
33025
  this.selectedProperties.color = !!eventDetails.id;
@@ -33052,6 +33062,7 @@ let EzpPrinterSelection = class {
33052
33062
  case 'paper_ranges':
33053
33063
  this.selectedProperties.PageRanges = eventDetails.value;
33054
33064
  this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
33065
+ localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
33055
33066
  // console.log(this.selectedProperties.PageRanges)
33056
33067
  break;
33057
33068
  case 'duplex':
@@ -33124,6 +33135,7 @@ let EzpPrinterSelection = class {
33124
33135
  }
33125
33136
  }
33126
33137
  setDefaultPaperFormat() {
33138
+ var _a, _b, _c, _d, _e;
33127
33139
  let format;
33128
33140
  const language = navigator.language;
33129
33141
  if (language === 'en-US') {
@@ -33135,13 +33147,13 @@ let EzpPrinterSelection = class {
33135
33147
  else {
33136
33148
  format = 'A4';
33137
33149
  }
33138
- if (this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format))) {
33139
- this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Name;
33140
- this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Id;
33150
+ if ((_a = this.selectedPrinterConfig.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((el) => el.Name.includes(format))) {
33151
+ this.selectedProperties.paper = (_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.find((el) => el.Name.includes(format)).Name;
33152
+ this.selectedProperties.paperid = (_c = this.selectedPrinterConfig.PaperFormats) === null || _c === void 0 ? void 0 : _c.find((el) => el.Name.includes(format)).Id;
33141
33153
  }
33142
33154
  else {
33143
- this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats[0].Name;
33144
- this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats[0].Id;
33155
+ this.selectedProperties.paper = (_d = this.selectedPrinterConfig.PaperFormats[0]) === null || _d === void 0 ? void 0 : _d.Name;
33156
+ this.selectedProperties.paperid = (_e = this.selectedPrinterConfig.PaperFormats[0]) === null || _e === void 0 ? void 0 : _e.Id;
33145
33157
  }
33146
33158
  this.setPaperid();
33147
33159
  }
@@ -33196,6 +33208,7 @@ let EzpPrinterSelection = class {
33196
33208
  *
33197
33209
  */
33198
33210
  render() {
33211
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
33199
33212
  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
33200
33213
  ? i18next.t('printer_selection.prepare_upload')
33201
33214
  : this.uploading
@@ -33231,37 +33244,47 @@ let EzpPrinterSelection = class {
33231
33244
  type: 'color',
33232
33245
  },
33233
33246
  ], preSelected: this.selectedPrinter.id
33234
- ? this.selectedProperties.color
33247
+ ? ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color"
33235
33248
  ? i18next.t('printer_selection.color_color')
33236
33249
  : i18next.t('printer_selection.color_grayscale')
33237
- : null, disabled: !this.selectedPrinterConfig.Color }), h("ezp-select", { label: i18next.t('printer_selection.duplex'), icon: "duplex", placeholder: i18next.t('printer_selection.select_duplex'), toggleFlow: "horizontal", options: this.duplexOptions.map((option) => ({
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) => ({
33238
33251
  id: option.id,
33239
33252
  title: option.title,
33240
33253
  meta: '',
33241
33254
  type: 'duplex',
33242
- })), preSelected: this.selectedPrinter.id && this.selectedProperties.duplex
33243
- ? this.duplexOptions.find((option) => option.id === this.selectedProperties.duplexmode).id
33244
- : 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.map((format) => ({
33255
+ })), preSelected: this.selectedPrinter.id && ((_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Duplex) == "duplex_simplex"
33256
+ ? i18next.t('printer_selection.duplex_none')
33257
+ : ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_vertical"
33258
+ ? i18next.t('printer_selection.duplex_long')
33259
+ : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_horizontal"
33260
+ ? i18next.t('printer_selection.duplex_short')
33261
+ : 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) => ({
33245
33262
  id: format.Id,
33246
33263
  title: format.Name,
33247
33264
  meta: `${format.XRes} x ${format.YRes}`,
33248
33265
  type: 'format',
33249
- })), preSelected: this.selectedPrinter.id ? this.selectedProperties.paper : null, disabled: !(this.selectedPrinterConfig.PaperFormats.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) => ({
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) => ({
33250
33269
  id: index + 1,
33251
33270
  title: i18next.t(`printer_selection.orientation_${orientation}`),
33252
33271
  meta: '',
33253
33272
  type: 'orientation',
33254
- })), 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: this.selectedPrinterConfig.Resolutions.map((option, index) => ({
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) => ({
33255
33274
  id: index,
33256
33275
  title: option,
33257
33276
  meta: '',
33258
33277
  type: 'quality',
33259
- })), preSelected: this.selectedPrinter.id ? this.selectedProperties.resolution : null, disabled: !(this.selectedPrinterConfig.Resolutions.length > 0) }), 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.length >= 1 && this.selectedPrinterConfig.Trays.map((trays) => ({
33278
+ })), preSelected: this.selectedPrinter.id && ((_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.includes(this.selectedPrinterConfig.Default.Resolution))
33279
+ ? 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) => ({
33260
33281
  title: trays.Name,
33261
33282
  id: trays.Index,
33262
33283
  meta: '',
33263
33284
  type: 'tray',
33264
- })) })) : 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 }))));
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)))
33286
+ ? 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 }))));
33265
33288
  }
33266
33289
  };
33267
33290
  EzpPrinterSelection.style = ezpPrinterSelectionCss;
@@ -33552,7 +33575,8 @@ let EzpSelect = class {
33552
33575
  this.selectToggle.emit(this.expanded);
33553
33576
  };
33554
33577
  this.select = (id) => {
33555
- const delay = this.selected.id === id ? 0 : this.duration * 1000;
33578
+ var _a;
33579
+ const delay = ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) === id ? 0 : this.duration * 1000;
33556
33580
  this.selected = this.options.find((option) => option.id === id);
33557
33581
  this.selectSelection.emit(this.selected);
33558
33582
  window.setTimeout(() => {
@@ -33560,7 +33584,8 @@ let EzpSelect = class {
33560
33584
  }, delay);
33561
33585
  };
33562
33586
  this.preSelect = () => {
33563
- this.selected = this.options.find((option) => typeof this.preSelected === 'number'
33587
+ var _a;
33588
+ this.selected = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((option) => typeof this.preSelected === 'number'
33564
33589
  ? option.id === this.preSelected
33565
33590
  : typeof this.preSelected === 'string'
33566
33591
  ? option.title === this.preSelected
@@ -33592,6 +33617,9 @@ let EzpSelect = class {
33592
33617
  this.backdrop.visible = false;
33593
33618
  }
33594
33619
  }
33620
+ preSelectedChanged() {
33621
+ this.preSelect();
33622
+ }
33595
33623
  /**
33596
33624
  *
33597
33625
  * Lifecycle methods
@@ -33615,7 +33643,8 @@ let EzpSelect = class {
33615
33643
  this.duration = parseFloat(styles.getPropertyValue('--ezp-select-duration'));
33616
33644
  }
33617
33645
  componentWillUpdate() {
33618
- if (this.selected.id === false &&
33646
+ var _a;
33647
+ if (((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) === false &&
33619
33648
  this.preSelected !== undefined &&
33620
33649
  this.preSelected !== '' &&
33621
33650
  this.preSelected !== null) {
@@ -33628,6 +33657,7 @@ let EzpSelect = class {
33628
33657
  *
33629
33658
  */
33630
33659
  render() {
33660
+ var _a, _b, _c;
33631
33661
  const hostClasses = [
33632
33662
  this.expanded ? 'is-expanded' : '',
33633
33663
  this.icon ? 'has-icon' : '',
@@ -33636,15 +33666,17 @@ let EzpSelect = class {
33636
33666
  this.disabled ? 'disabled' : '',
33637
33667
  ];
33638
33668
  const labelLevel = this.toggleFlow === 'horizontal' ? 'secondary' : 'tertiary';
33639
- return (h(Host, { class: hostClasses.join(' ') }, h("div", { id: "wrap" }, h("div", { id: "toggle", onClick: () => !this.disabled && this.toggle() }, this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { id: "label", noWrap: true, level: labelLevel, text: this.label }), h("ezp-label", { id: "value", ellipsis: true, text: this.selected.title !== '' ? this.selected.title : this.placeholder }), h("ezp-icon", { id: "accessory", name: "expand" })), h("div", { id: "list", ref: (element) => (this.list = element) }, this.options.map((option) => {
33669
+ return (h(Host, { class: hostClasses.join(' ') }, h("div", { id: "wrap" }, h("div", { id: "toggle", onClick: () => !this.disabled && this.toggle() }, this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { id: "label", noWrap: true, level: labelLevel, text: this.label }), h("ezp-label", { id: "value", ellipsis: true, text: ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.title) !== '' ? (_b = this.selected) === null || _b === void 0 ? void 0 : _b.title : this.placeholder }), h("ezp-icon", { id: "accessory", name: "expand" })), h("div", { id: "list", ref: (element) => (this.list = element) }, (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => {
33670
+ var _a;
33640
33671
  if (option.title !== '') {
33641
- return (h("div", { class: `option ${option.id === this.selected.id ? 'is-selected' : ''} ${option.meta !== '' ? 'has-meta' : ''} `, onClick: () => this.select(option.id) }, h("ezp-icon", { name: "checkmark", class: "indicator" }), h("div", { class: "details" }, h("ezp-label", { class: "title", ellipsis: true, text: option.title }), option.meta !== '' ? (h("ezp-label", { level: "tertiary", class: "meta", text: option.meta, ellipsis: true })) : null)));
33672
+ return (h("div", { class: `option ${option.id === ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) ? 'is-selected' : ''} ${option.meta !== '' ? 'has-meta' : ''} `, onClick: () => this.select(option.id) }, h("ezp-icon", { name: "checkmark", class: "indicator" }), h("div", { class: "details" }, h("ezp-label", { class: "title", ellipsis: true, text: option.title }), option.meta !== '' ? (h("ezp-label", { level: "tertiary", class: "meta", text: option.meta, ellipsis: true })) : null)));
33642
33673
  }
33643
33674
  })))));
33644
33675
  }
33645
33676
  get component() { return getElement(this); }
33646
33677
  static get watchers() { return {
33647
- "expanded": ["watchExpanded"]
33678
+ "expanded": ["watchExpanded"],
33679
+ "preSelected": ["preSelectedChanged"]
33648
33680
  }; }
33649
33681
  };
33650
33682
  EzpSelect.style = ezpSelectCss;
@@ -33838,6 +33870,7 @@ let EzpUpload = class {
33838
33870
  this.handleInput = () => {
33839
33871
  this.filename = this.input.files[0].name;
33840
33872
  this.uploadFile.emit(this.input.files);
33873
+ localStorage.removeItem('pageRanges');
33841
33874
  };
33842
33875
  }
33843
33876
  /**