@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.
@@ -32777,6 +32777,16 @@ let EzpPrinterSelection = class {
32777
32777
  title: i18next.t('printer_selection.duplex_short'),
32778
32778
  },
32779
32779
  ];
32780
+ this.ColorOptions = [
32781
+ {
32782
+ id: 1,
32783
+ title: i18next.t('printer_selection.color_color'),
32784
+ },
32785
+ {
32786
+ id: 2,
32787
+ title: i18next.t('printer_selection.color_grayscale'),
32788
+ }
32789
+ ];
32780
32790
  this.hidemenu = false;
32781
32791
  this.hideheader = false;
32782
32792
  /**
@@ -33021,37 +33031,47 @@ let EzpPrinterSelection = class {
33021
33031
  await this.printService
33022
33032
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33023
33033
  .then((data) => {
33034
+ var _a, _b, _c, _d, _e, _f, _g;
33024
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;
33025
33054
  });
33026
33055
  // this.setDefaultPaperFormat()
33027
33056
  break;
33028
33057
  case 'color':
33029
- this.selectedProperties.color = !!eventDetails.id;
33030
- // console.log('color selected:')
33031
- // console.log(this.selectedProperties.color)
33058
+ this.selectedProperties.color = eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
33032
33059
  break;
33033
33060
  case 'orientation':
33034
33061
  this.selectedProperties.orientation = eventDetails.id;
33035
- // console.log('orientation selected:')
33036
- // console.log(this.selectedProperties.orientation)
33037
33062
  break;
33038
33063
  case 'format':
33039
33064
  this.selectedProperties.paper = eventDetails.title;
33040
33065
  this.selectedProperties.paperid = eventDetails.id;
33041
- // console.log('paper selected:')
33042
33066
  break;
33043
33067
  case 'quality':
33044
33068
  this.selectedProperties.resolution = eventDetails.title;
33045
- // console.log('quality selected:')
33046
- // console.log(this.selectedProperties.resolution)
33047
33069
  break;
33048
33070
  case 'length':
33049
33071
  this.selectedProperties.paperlength = eventDetails.value;
33050
- // console.log(this.selectedProperties)
33051
33072
  break;
33052
33073
  case 'width':
33053
33074
  this.selectedProperties.paperwidth = eventDetails.value;
33054
- // console.log(this.selectedProperties)
33055
33075
  break;
33056
33076
  case 'tray':
33057
33077
  if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
@@ -33066,22 +33086,19 @@ let EzpPrinterSelection = class {
33066
33086
  case 'paper_ranges':
33067
33087
  this.selectedProperties.PageRanges = eventDetails.value;
33068
33088
  this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
33069
- localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
33070
- // console.log(this.selectedProperties.PageRanges)
33071
33089
  break;
33072
33090
  case 'duplex':
33073
- if (eventDetails.title === 'None') {
33074
- 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;
33075
33095
  }
33076
33096
  else {
33077
- this.selectedProperties.duplex = true;
33097
+ this.selectedProperties.duplex = false;
33078
33098
  }
33079
33099
  this.selectedProperties.duplexmode = eventDetails.id;
33080
- // console.log('duplex selected:')
33081
- // console.log(this.selectedProperties.duplexmode)
33082
33100
  break;
33083
33101
  }
33084
- // setting paper id here to updated the prop for input.
33085
33102
  this.setPaperid();
33086
33103
  }
33087
33104
  async handleFiles(file, printPorperties) {
@@ -33184,7 +33201,28 @@ let EzpPrinterSelection = class {
33184
33201
  if (this.selectedPrinter.id != '') {
33185
33202
  await this.printService
33186
33203
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
33187
- .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
+ });
33188
33226
  if (this.selectedProperties.paper === '') {
33189
33227
  this.setDefaultPaperFormat();
33190
33228
  }
@@ -33212,7 +33250,7 @@ let EzpPrinterSelection = class {
33212
33250
  *
33213
33251
  */
33214
33252
  render() {
33215
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
33253
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
33216
33254
  return this.loading ? (index.h("ezp-status", { processing: true, description: i18next.t('printer_selection.loading'), instance: "loading" })) : (index.h(index.Host, { class: { seamless: this.seamless } }, index.h("div", { id: "box", "data-backdrop-surface": true }, !this.printStopped && (index.h(index.Fragment, null, this.printProcessing ? (index.h("ezp-status", { processing: true, description: this.preparingUpload
33217
33255
  ? i18next.t('printer_selection.prepare_upload')
33218
33256
  : this.uploading
@@ -33225,70 +33263,52 @@ let EzpPrinterSelection = class {
33225
33263
  meta: printer.location !== '' ? printer.location : '',
33226
33264
  type: 'printer',
33227
33265
  is_queue: printer.is_queue,
33228
- })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })), index.h("div", { id: "options" }, index.h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.Color
33229
- ? [
33230
- {
33231
- id: 1,
33232
- title: i18next.t('printer_selection.color_color'),
33233
- meta: '',
33234
- type: 'color',
33235
- },
33236
- {
33237
- id: 0,
33238
- title: i18next.t('printer_selection.color_grayscale'),
33239
- meta: '',
33240
- type: 'color',
33241
- },
33242
- ]
33243
- : [
33244
- {
33245
- id: 0,
33246
- title: i18next.t('printer_selection.color_grayscale'),
33247
- meta: '',
33248
- type: 'color',
33249
- },
33250
- ], preSelected: this.selectedPrinter.id
33251
- ? ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color"
33252
- ? i18next.t('printer_selection.color_color')
33253
- : i18next.t('printer_selection.color_grayscale')
33254
- : null, disabled: !this.selectedPrinterConfig.ColorSupported }), index.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) => ({
33266
+ })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })), index.h("div", { id: "options" }, index.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) => ({
33267
+ id: option.id,
33268
+ title: option.title,
33269
+ meta: '',
33270
+ type: 'color'
33271
+ })), preSelected: this.selectedPrinter.id
33272
+ && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == "color"
33273
+ ? i18next.t('printer_selection.color_color')
33274
+ : i18next.t('printer_selection.color_grayscale'), disabled: !this.selectedPrinterConfig.ColorSupported }), index.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) => ({
33255
33275
  id: option.id,
33256
33276
  title: option.title,
33257
33277
  meta: '',
33258
33278
  type: 'duplex',
33259
- })), preSelected: this.selectedPrinter.id && ((_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Duplex) == "duplex_simplex"
33279
+ })), preSelected: this.selectedPrinter.id && ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_simplex"
33260
33280
  ? i18next.t('printer_selection.duplex_none')
33261
- : ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_vertical"
33281
+ : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_vertical"
33262
33282
  ? i18next.t('printer_selection.duplex_long')
33263
- : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_horizontal"
33283
+ : ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == "duplex_horizontal"
33264
33284
  ? i18next.t('printer_selection.duplex_short')
33265
33285
  : null, disabled: !this.selectedPrinterConfig.DuplexSupported }), index.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) => ({
33266
33286
  id: format.Id,
33267
33287
  title: format.Name,
33268
33288
  meta: `${format.XRes} x ${format.YRes}`,
33269
33289
  type: 'format',
33270
- })), 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); }))
33271
- ? (_g = this.selectedPrinterConfig.Default) === null || _g === void 0 ? void 0 : _g.Paper
33272
- : null, disabled: !(((_h = this.selectedPrinterConfig.PaperFormats) === null || _h === void 0 ? void 0 : _h.length) > 0) }), this.paperid == PAPER_ID ? (index.h(index.Fragment, null, index.h("ezp-input", { icon: "width", suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: i18next.t('printer_selection.width') }), index.h("ezp-input", { icon: "height", suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: i18next.t('printer_selection.length') }))) : null, index.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) => ({
33290
+ })), 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); }))
33291
+ ? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
33292
+ : null, disabled: !(((_j = this.selectedPrinterConfig.PaperFormats) === null || _j === void 0 ? void 0 : _j.length) > 0) }), this.paperid == PAPER_ID ? (index.h(index.Fragment, null, index.h("ezp-input", { icon: "width", suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: i18next.t('printer_selection.width') }), index.h("ezp-input", { icon: "height", suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: i18next.t('printer_selection.length') }))) : null, index.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) => ({
33273
33293
  id: index + 1,
33274
33294
  title: i18next.t(`printer_selection.orientation_${orientation}`),
33275
33295
  meta: '',
33276
33296
  type: 'orientation',
33277
- })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }), index.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) => ({
33297
+ })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }), index.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) => ({
33278
33298
  id: index,
33279
33299
  title: option,
33280
33300
  meta: '',
33281
33301
  type: 'quality',
33282
- })), preSelected: this.selectedPrinter.id && ((_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.includes(this.selectedPrinterConfig.Default.Resolution))
33302
+ })), preSelected: this.selectedPrinter.id && ((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.includes(this.selectedPrinterConfig.Default.Resolution))
33283
33303
  ? this.selectedPrinterConfig.Default.Resolution
33284
- : 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 ? (index.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) => ({
33304
+ : 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 ? (index.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) => ({
33285
33305
  title: trays.Name,
33286
33306
  id: trays.Index,
33287
33307
  meta: '',
33288
33308
  type: 'tray',
33289
- })), preSelected: this.selectedPrinter.id && ((_m = this.selectedPrinterConfig.Trays) === null || _m === void 0 ? void 0 : _m.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
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)))
33290
33310
  ? this.selectedPrinterConfig.Default.Tray
33291
- : 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 }))));
33292
33312
  }
33293
33313
  };
33294
33314
  EzpPrinterSelection.style = ezpPrinterSelectionCss;
@@ -33874,7 +33894,6 @@ let EzpUpload = class {
33874
33894
  this.handleInput = () => {
33875
33895
  this.filename = this.input.files[0].name;
33876
33896
  this.uploadFile.emit(this.input.files);
33877
- localStorage.removeItem('pageRanges');
33878
33897
  };
33879
33898
  }
33880
33899
  /**
@@ -23,6 +23,16 @@ export class EzpPrinterSelection {
23
23
  title: i18next.t('printer_selection.duplex_short'),
24
24
  },
25
25
  ];
26
+ this.ColorOptions = [
27
+ {
28
+ id: 1,
29
+ title: i18next.t('printer_selection.color_color'),
30
+ },
31
+ {
32
+ id: 2,
33
+ title: i18next.t('printer_selection.color_grayscale'),
34
+ }
35
+ ];
26
36
  this.hidemenu = false;
27
37
  this.hideheader = false;
28
38
  /**
@@ -267,37 +277,47 @@ export class EzpPrinterSelection {
267
277
  await this.printService
268
278
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
269
279
  .then((data) => {
280
+ var _a, _b, _c, _d, _e, _f, _g;
270
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;
271
300
  });
272
301
  // this.setDefaultPaperFormat()
273
302
  break;
274
303
  case 'color':
275
- this.selectedProperties.color = !!eventDetails.id;
276
- // console.log('color selected:')
277
- // console.log(this.selectedProperties.color)
304
+ this.selectedProperties.color = eventDetails.title == i18next.t('printer_selection.color_color') ? true : false;
278
305
  break;
279
306
  case 'orientation':
280
307
  this.selectedProperties.orientation = eventDetails.id;
281
- // console.log('orientation selected:')
282
- // console.log(this.selectedProperties.orientation)
283
308
  break;
284
309
  case 'format':
285
310
  this.selectedProperties.paper = eventDetails.title;
286
311
  this.selectedProperties.paperid = eventDetails.id;
287
- // console.log('paper selected:')
288
312
  break;
289
313
  case 'quality':
290
314
  this.selectedProperties.resolution = eventDetails.title;
291
- // console.log('quality selected:')
292
- // console.log(this.selectedProperties.resolution)
293
315
  break;
294
316
  case 'length':
295
317
  this.selectedProperties.paperlength = eventDetails.value;
296
- // console.log(this.selectedProperties)
297
318
  break;
298
319
  case 'width':
299
320
  this.selectedProperties.paperwidth = eventDetails.value;
300
- // console.log(this.selectedProperties)
301
321
  break;
302
322
  case 'tray':
303
323
  if (this.selectedPrinterConfig.Trays && this.selectedPrinterConfig.Trays.length >= 0 && this.selectedPrinterConfig.Trays[0] == null) {
@@ -312,24 +332,21 @@ export class EzpPrinterSelection {
312
332
  case 'paper_ranges':
313
333
  this.selectedProperties.PageRanges = eventDetails.value;
314
334
  this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
315
- localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
316
- // console.log(this.selectedProperties.PageRanges)
317
335
  break;
318
336
  case 'duplex':
319
- if (eventDetails.title === 'None') {
320
- 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;
321
341
  }
322
342
  else {
323
- this.selectedProperties.duplex = true;
343
+ this.selectedProperties.duplex = false;
324
344
  }
325
345
  this.selectedProperties.duplexmode = eventDetails.id;
326
- // console.log('duplex selected:')
327
- // console.log(this.selectedProperties.duplexmode)
328
346
  break;
329
347
  default:
330
348
  break;
331
349
  }
332
- // setting paper id here to updated the prop for input.
333
350
  this.setPaperid();
334
351
  }
335
352
  async handleFiles(file, printPorperties) {
@@ -432,7 +449,28 @@ export class EzpPrinterSelection {
432
449
  if (this.selectedPrinter.id != '') {
433
450
  await this.printService
434
451
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
435
- .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
+ });
436
474
  if (this.selectedProperties.paper === '') {
437
475
  this.setDefaultPaperFormat();
438
476
  }
@@ -460,7 +498,7 @@ export class EzpPrinterSelection {
460
498
  *
461
499
  */
462
500
  render() {
463
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
501
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
464
502
  return this.loading ? (h("ezp-status", { processing: true, description: i18next.t('printer_selection.loading'), instance: "loading" })) : (h(Host, { class: { seamless: this.seamless } },
465
503
  h("div", { id: "box", "data-backdrop-surface": true },
466
504
  !this.printStopped && (h(Fragment, null, this.printProcessing ? (h("ezp-status", { processing: true, description: this.preparingUpload
@@ -484,43 +522,25 @@ export class EzpPrinterSelection {
484
522
  is_queue: printer.is_queue,
485
523
  })), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })),
486
524
  h("div", { id: "options" },
487
- h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.Color
488
- ? [
489
- {
490
- id: 1,
491
- title: i18next.t('printer_selection.color_color'),
492
- meta: '',
493
- type: 'color',
494
- },
495
- {
496
- id: 0,
497
- title: i18next.t('printer_selection.color_grayscale'),
498
- meta: '',
499
- type: 'color',
500
- },
501
- ]
502
- : [
503
- {
504
- id: 0,
505
- title: i18next.t('printer_selection.color_grayscale'),
506
- meta: '',
507
- type: 'color',
508
- },
509
- ], preSelected: this.selectedPrinter.id
510
- ? ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == "color"
511
- ? i18next.t('printer_selection.color_color')
512
- : i18next.t('printer_selection.color_grayscale')
513
- : null, disabled: !this.selectedPrinterConfig.ColorSupported }),
514
- 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) => ({
525
+ 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) => ({
526
+ id: option.id,
527
+ title: option.title,
528
+ meta: '',
529
+ type: 'color'
530
+ })), preSelected: this.selectedPrinter.id
531
+ && ((_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Color) == "color"
532
+ ? i18next.t('printer_selection.color_color')
533
+ : i18next.t('printer_selection.color_grayscale'), disabled: !this.selectedPrinterConfig.ColorSupported }),
534
+ 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) => ({
515
535
  id: option.id,
516
536
  title: option.title,
517
537
  meta: '',
518
538
  type: 'duplex',
519
- })), preSelected: this.selectedPrinter.id && ((_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Duplex) == "duplex_simplex"
539
+ })), preSelected: this.selectedPrinter.id && ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_simplex"
520
540
  ? i18next.t('printer_selection.duplex_none')
521
- : ((_d = this.selectedPrinterConfig.Default) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_vertical"
541
+ : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_vertical"
522
542
  ? i18next.t('printer_selection.duplex_long')
523
- : ((_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_horizontal"
543
+ : ((_f = this.selectedPrinterConfig.Default) === null || _f === void 0 ? void 0 : _f.Duplex) == "duplex_horizontal"
524
544
  ? i18next.t('printer_selection.duplex_short')
525
545
  : null, disabled: !this.selectedPrinterConfig.DuplexSupported }),
526
546
  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) => ({
@@ -528,9 +548,9 @@ export class EzpPrinterSelection {
528
548
  title: format.Name,
529
549
  meta: `${format.XRes} x ${format.YRes}`,
530
550
  type: 'format',
531
- })), 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); }))
532
- ? (_g = this.selectedPrinterConfig.Default) === null || _g === void 0 ? void 0 : _g.Paper
533
- : null, disabled: !(((_h = this.selectedPrinterConfig.PaperFormats) === null || _h === void 0 ? void 0 : _h.length) > 0) }),
551
+ })), 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); }))
552
+ ? (_h = this.selectedPrinterConfig.Default) === null || _h === void 0 ? void 0 : _h.Paper
553
+ : null, disabled: !(((_j = this.selectedPrinterConfig.PaperFormats) === null || _j === void 0 ? void 0 : _j.length) > 0) }),
534
554
  this.paperid == PAPER_ID ? (h(Fragment, null,
535
555
  h("ezp-input", { icon: "width", suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: i18next.t('printer_selection.width') }),
536
556
  h("ezp-input", { icon: "height", suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: i18next.t('printer_selection.length') }))) : null,
@@ -540,23 +560,23 @@ export class EzpPrinterSelection {
540
560
  meta: '',
541
561
  type: 'orientation',
542
562
  })), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }),
543
- 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) => ({
563
+ 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) => ({
544
564
  id: index,
545
565
  title: option,
546
566
  meta: '',
547
567
  type: 'quality',
548
- })), preSelected: this.selectedPrinter.id && ((_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.includes(this.selectedPrinterConfig.Default.Resolution))
568
+ })), preSelected: this.selectedPrinter.id && ((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.includes(this.selectedPrinterConfig.Default.Resolution))
549
569
  ? this.selectedPrinterConfig.Default.Resolution
550
- : null, disabled: !(((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.length) > 0) }),
570
+ : null, disabled: !(((_m = this.selectedPrinterConfig.Resolutions) === null || _m === void 0 ? void 0 : _m.length) > 0) }),
551
571
  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) => ({
552
572
  title: trays.Name,
553
573
  id: trays.Index,
554
574
  meta: '',
555
575
  type: 'tray',
556
- })), preSelected: this.selectedPrinter.id && ((_m = this.selectedPrinterConfig.Trays) === null || _m === void 0 ? void 0 : _m.find((el) => el.Name.includes(this.selectedPrinterConfig.Default.Tray)))
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)))
557
577
  ? this.selectedPrinterConfig.Default.Tray
558
578
  : null })) : null,
559
- 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') })),
560
580
  h("ezp-stepper", { label: i18next.t('printer_selection.copies'), max: 10, icon: "copies" })),
561
581
  h("div", { id: "footer" },
562
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
  /**