@ezeep/ezeep-js 1.0.268 → 1.0.270

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.
@@ -35112,16 +35112,24 @@ const EzpPrinterSelection = class {
35112
35112
  await this.printService
35113
35113
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
35114
35114
  .then((data) => {
35115
- var _a, _b, _c, _d, _e, _f, _g;
35115
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
35116
35116
  this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
35117
35117
  this.selectedProperties.color =
35118
35118
  ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
35119
- this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
35120
- this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
35121
- let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
35119
+ const defaultOrientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
35120
+ const defaultOrientationIndex = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.OrientationIndex;
35121
+ let orientationFallback;
35122
+ if (defaultOrientation) {
35123
+ const idx = (_d = this.selectedPrinterConfig.OrientationsSupported) === null || _d === void 0 ? void 0 : _d.indexOf(defaultOrientation);
35124
+ if (typeof idx === 'number' && idx >= 0)
35125
+ orientationFallback = idx + 1;
35126
+ }
35127
+ this.selectedProperties.orientation = defaultOrientationIndex !== null && defaultOrientationIndex !== void 0 ? defaultOrientationIndex : orientationFallback;
35128
+ this.selectedProperties.resolution = (_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Resolution;
35129
+ let defaultPaper = (_f = this.selectedPrinterConfig.PaperFormats) === null || _f === void 0 ? void 0 : _f.find((obj) => obj.Default === true);
35122
35130
  this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
35123
35131
  this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
35124
- let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
35132
+ let defaultSource = (_g = this.selectedPrinterConfig.Trays) === null || _g === void 0 ? void 0 : _g.find((obj) => obj.Default === true);
35125
35133
  if (this.selectedPrinterConfig.Trays &&
35126
35134
  this.selectedPrinterConfig.Trays.length >= 1 &&
35127
35135
  this.selectedPrinterConfig.Trays[0] != null) {
@@ -35134,8 +35142,8 @@ const EzpPrinterSelection = class {
35134
35142
  delete this.selectedProperties.trayname;
35135
35143
  delete this.selectedProperties.defaultSource;
35136
35144
  }
35137
- this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
35138
- this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
35145
+ this.selectedProperties.duplex = (_h = this.selectedPrinterConfig) === null || _h === void 0 ? void 0 : _h.DuplexSupported;
35146
+ this.selectedProperties.duplexmode = (_j = this.selectedPrinterConfig) === null || _j === void 0 ? void 0 : _j.DuplexMode;
35139
35147
  delete this.selectedProperties.PageRanges;
35140
35148
  });
35141
35149
  // this.setDefaultPaperFormat()
@@ -35396,16 +35404,24 @@ const EzpPrinterSelection = class {
35396
35404
  await this.printService
35397
35405
  .getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
35398
35406
  .then((data) => {
35399
- var _a, _b, _c, _d, _e, _f, _g;
35407
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
35400
35408
  this.selectedPrinterConfig = data[0];
35401
35409
  this.selectedProperties.color =
35402
35410
  ((_a = this.selectedPrinterConfig.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
35403
- this.selectedProperties.orientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
35404
- this.selectedProperties.resolution = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.Resolution;
35405
- let defaultPaper = (_d = this.selectedPrinterConfig.PaperFormats) === null || _d === void 0 ? void 0 : _d.find((obj) => obj.Default === true);
35411
+ const defaultOrientation = (_b = this.selectedPrinterConfig.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
35412
+ const defaultOrientationIndex = (_c = this.selectedPrinterConfig.Default) === null || _c === void 0 ? void 0 : _c.OrientationIndex;
35413
+ let orientationFallback;
35414
+ if (defaultOrientation) {
35415
+ const idx = (_d = this.selectedPrinterConfig.OrientationsSupported) === null || _d === void 0 ? void 0 : _d.indexOf(defaultOrientation);
35416
+ if (typeof idx === 'number' && idx >= 0)
35417
+ orientationFallback = idx + 1;
35418
+ }
35419
+ this.selectedProperties.orientation = defaultOrientationIndex !== null && defaultOrientationIndex !== void 0 ? defaultOrientationIndex : orientationFallback;
35420
+ this.selectedProperties.resolution = (_e = this.selectedPrinterConfig.Default) === null || _e === void 0 ? void 0 : _e.Resolution;
35421
+ let defaultPaper = (_f = this.selectedPrinterConfig.PaperFormats) === null || _f === void 0 ? void 0 : _f.find((obj) => obj.Default === true);
35406
35422
  this.selectedProperties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
35407
35423
  this.selectedProperties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
35408
- let defaultSource = (_e = this.selectedPrinterConfig.Trays) === null || _e === void 0 ? void 0 : _e.find((obj) => obj.Default === true);
35424
+ let defaultSource = (_g = this.selectedPrinterConfig.Trays) === null || _g === void 0 ? void 0 : _g.find((obj) => obj.Default === true);
35409
35425
  if (this.selectedPrinterConfig.Trays &&
35410
35426
  this.selectedPrinterConfig.Trays.length >= 1 &&
35411
35427
  this.selectedPrinterConfig.Trays[0] != null) {
@@ -35418,8 +35434,8 @@ const EzpPrinterSelection = class {
35418
35434
  delete this.selectedProperties.trayname;
35419
35435
  delete this.selectedProperties.defaultSource;
35420
35436
  }
35421
- this.selectedProperties.duplex = (_f = this.selectedPrinterConfig) === null || _f === void 0 ? void 0 : _f.DuplexSupported;
35422
- this.selectedProperties.duplexmode = (_g = this.selectedPrinterConfig) === null || _g === void 0 ? void 0 : _g.DuplexMode;
35437
+ this.selectedProperties.duplex = (_h = this.selectedPrinterConfig) === null || _h === void 0 ? void 0 : _h.DuplexSupported;
35438
+ this.selectedProperties.duplexmode = (_j = this.selectedPrinterConfig) === null || _j === void 0 ? void 0 : _j.DuplexMode;
35423
35439
  delete this.selectedProperties.PageRanges;
35424
35440
  });
35425
35441
  if (this.selectedProperties.paper === '') {