@ezeep/ezeep-js 1.0.230 → 1.0.232
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.
- package/dist/cjs/ezp-auth_15.cjs.entry.js +55 -22
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +43 -20
- package/dist/collection/components/ezp-select/ezp-select.js +17 -6
- package/dist/collection/components/ezp-upload/ezp-upload.js +1 -0
- package/dist/custom-elements/index.js +55 -22
- package/dist/esm/ezp-auth_15.entry.js +55 -22
- package/dist/esm-es5/ezp-auth_15.entry.js +3 -3
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-c3d1c3e5.system.entry.js → p-3ceb1074.system.entry.js} +1 -1
- package/dist/ezeep/{p-017d4f6a.entry.js → p-6174466d.entry.js} +2 -2
- package/dist/ezeep/p-84bd195a.system.js +1 -1
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +4 -1
- package/dist/types/components/ezp-select/ezp-select.d.ts +1 -0
- package/dist/types/shared/types.d.ts +11 -0
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-c3d1c3e5.system.entry.js → p-3ceb1074.system.entry.js} +1 -1
- package/www/build/{p-017d4f6a.entry.js → p-6174466d.entry.js} +2 -2
- package/www/build/p-84bd195a.system.js +1 -1
|
@@ -32796,6 +32796,14 @@ let EzpPrinterSelection = class {
|
|
|
32796
32796
|
this.userMenuOpen = false;
|
|
32797
32797
|
this.printStopped = false;
|
|
32798
32798
|
this.selectedPrinterConfig = {
|
|
32799
|
+
Profile: {
|
|
32800
|
+
Color: '',
|
|
32801
|
+
Duplex: '',
|
|
32802
|
+
Paper: '',
|
|
32803
|
+
Orientation: '',
|
|
32804
|
+
Resolution: '',
|
|
32805
|
+
Tray: ''
|
|
32806
|
+
},
|
|
32799
32807
|
OrientationsSupported: [],
|
|
32800
32808
|
PaperFormats: [],
|
|
32801
32809
|
Resolutions: [],
|
|
@@ -33012,8 +33020,10 @@ let EzpPrinterSelection = class {
|
|
|
33012
33020
|
this.selectedPrinter.is_queue = eventDetails.is_queue;
|
|
33013
33021
|
await this.printService
|
|
33014
33022
|
.getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
|
|
33015
|
-
.then((data) =>
|
|
33016
|
-
|
|
33023
|
+
.then((data) => {
|
|
33024
|
+
this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
|
|
33025
|
+
});
|
|
33026
|
+
// this.setDefaultPaperFormat()
|
|
33017
33027
|
break;
|
|
33018
33028
|
case 'color':
|
|
33019
33029
|
this.selectedProperties.color = !!eventDetails.id;
|
|
@@ -33056,6 +33066,7 @@ let EzpPrinterSelection = class {
|
|
|
33056
33066
|
case 'paper_ranges':
|
|
33057
33067
|
this.selectedProperties.PageRanges = eventDetails.value;
|
|
33058
33068
|
this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
|
|
33069
|
+
localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
|
|
33059
33070
|
// console.log(this.selectedProperties.PageRanges)
|
|
33060
33071
|
break;
|
|
33061
33072
|
case 'duplex':
|
|
@@ -33128,6 +33139,7 @@ let EzpPrinterSelection = class {
|
|
|
33128
33139
|
}
|
|
33129
33140
|
}
|
|
33130
33141
|
setDefaultPaperFormat() {
|
|
33142
|
+
var _a, _b, _c, _d, _e;
|
|
33131
33143
|
let format;
|
|
33132
33144
|
const language = navigator.language;
|
|
33133
33145
|
if (language === 'en-US') {
|
|
@@ -33139,13 +33151,13 @@ let EzpPrinterSelection = class {
|
|
|
33139
33151
|
else {
|
|
33140
33152
|
format = 'A4';
|
|
33141
33153
|
}
|
|
33142
|
-
if (this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format))) {
|
|
33143
|
-
this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Name;
|
|
33144
|
-
this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Id;
|
|
33154
|
+
if ((_a = this.selectedPrinterConfig.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((el) => el.Name.includes(format))) {
|
|
33155
|
+
this.selectedProperties.paper = (_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.find((el) => el.Name.includes(format)).Name;
|
|
33156
|
+
this.selectedProperties.paperid = (_c = this.selectedPrinterConfig.PaperFormats) === null || _c === void 0 ? void 0 : _c.find((el) => el.Name.includes(format)).Id;
|
|
33145
33157
|
}
|
|
33146
33158
|
else {
|
|
33147
|
-
this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats[0].Name;
|
|
33148
|
-
this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats[0].Id;
|
|
33159
|
+
this.selectedProperties.paper = (_d = this.selectedPrinterConfig.PaperFormats[0]) === null || _d === void 0 ? void 0 : _d.Name;
|
|
33160
|
+
this.selectedProperties.paperid = (_e = this.selectedPrinterConfig.PaperFormats[0]) === null || _e === void 0 ? void 0 : _e.Id;
|
|
33149
33161
|
}
|
|
33150
33162
|
this.setPaperid();
|
|
33151
33163
|
}
|
|
@@ -33200,6 +33212,7 @@ let EzpPrinterSelection = class {
|
|
|
33200
33212
|
*
|
|
33201
33213
|
*/
|
|
33202
33214
|
render() {
|
|
33215
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
33203
33216
|
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
|
|
33204
33217
|
? i18next.t('printer_selection.prepare_upload')
|
|
33205
33218
|
: this.uploading
|
|
@@ -33235,37 +33248,47 @@ let EzpPrinterSelection = class {
|
|
|
33235
33248
|
type: 'color',
|
|
33236
33249
|
},
|
|
33237
33250
|
], preSelected: this.selectedPrinter.id
|
|
33238
|
-
? this.
|
|
33251
|
+
? ((_a = this.selectedPrinterConfig.Profile) === null || _a === void 0 ? void 0 : _a.Color) == "color"
|
|
33239
33252
|
? i18next.t('printer_selection.color_color')
|
|
33240
33253
|
: i18next.t('printer_selection.color_grayscale')
|
|
33241
|
-
: null, disabled: !this.selectedPrinterConfig.
|
|
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) => ({
|
|
33242
33255
|
id: option.id,
|
|
33243
33256
|
title: option.title,
|
|
33244
33257
|
meta: '',
|
|
33245
33258
|
type: 'duplex',
|
|
33246
|
-
})), preSelected: this.selectedPrinter.id && this.
|
|
33247
|
-
?
|
|
33248
|
-
:
|
|
33259
|
+
})), preSelected: this.selectedPrinter.id && ((_c = this.selectedPrinterConfig.Profile) === null || _c === void 0 ? void 0 : _c.Duplex) == "duplex_simplex"
|
|
33260
|
+
? i18next.t('printer_selection.duplex_none')
|
|
33261
|
+
: ((_d = this.selectedPrinterConfig.Profile) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_vertical"
|
|
33262
|
+
? i18next.t('printer_selection.duplex_long')
|
|
33263
|
+
: ((_e = this.selectedPrinterConfig.Profile) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_horizontal"
|
|
33264
|
+
? i18next.t('printer_selection.duplex_short')
|
|
33265
|
+
: 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) => ({
|
|
33249
33266
|
id: format.Id,
|
|
33250
33267
|
title: format.Name,
|
|
33251
33268
|
meta: `${format.XRes} x ${format.YRes}`,
|
|
33252
33269
|
type: 'format',
|
|
33253
|
-
})), preSelected: this.selectedPrinter.id
|
|
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.Profile) === null || _a === void 0 ? void 0 : _a.Paper); }))
|
|
33271
|
+
? (_g = this.selectedPrinterConfig.Profile) === 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) => ({
|
|
33254
33273
|
id: index + 1,
|
|
33255
33274
|
title: i18next.t(`printer_selection.orientation_${orientation}`),
|
|
33256
33275
|
meta: '',
|
|
33257
33276
|
type: 'orientation',
|
|
33258
|
-
})), 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: this.selectedPrinterConfig.Resolutions.map((option, index) => ({
|
|
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) => ({
|
|
33259
33278
|
id: index,
|
|
33260
33279
|
title: option,
|
|
33261
33280
|
meta: '',
|
|
33262
33281
|
type: 'quality',
|
|
33263
|
-
})), preSelected: this.selectedPrinter.id
|
|
33282
|
+
})), preSelected: this.selectedPrinter.id && ((_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.includes(this.selectedPrinterConfig.Profile.Resolution))
|
|
33283
|
+
? this.selectedPrinterConfig.Profile.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) => ({
|
|
33264
33285
|
title: trays.Name,
|
|
33265
33286
|
id: trays.Index,
|
|
33266
33287
|
meta: '',
|
|
33267
33288
|
type: 'tray',
|
|
33268
|
-
}))
|
|
33289
|
+
})), preSelected: this.selectedPrinter.id && ((_m = this.selectedPrinterConfig.Trays) === null || _m === void 0 ? void 0 : _m.find((el) => el.Name.includes(this.selectedPrinterConfig.Profile.Tray)))
|
|
33290
|
+
? this.selectedPrinterConfig.Profile.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 }))));
|
|
33269
33292
|
}
|
|
33270
33293
|
};
|
|
33271
33294
|
EzpPrinterSelection.style = ezpPrinterSelectionCss;
|
|
@@ -33556,7 +33579,8 @@ let EzpSelect = class {
|
|
|
33556
33579
|
this.selectToggle.emit(this.expanded);
|
|
33557
33580
|
};
|
|
33558
33581
|
this.select = (id) => {
|
|
33559
|
-
|
|
33582
|
+
var _a;
|
|
33583
|
+
const delay = ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) === id ? 0 : this.duration * 1000;
|
|
33560
33584
|
this.selected = this.options.find((option) => option.id === id);
|
|
33561
33585
|
this.selectSelection.emit(this.selected);
|
|
33562
33586
|
window.setTimeout(() => {
|
|
@@ -33564,7 +33588,8 @@ let EzpSelect = class {
|
|
|
33564
33588
|
}, delay);
|
|
33565
33589
|
};
|
|
33566
33590
|
this.preSelect = () => {
|
|
33567
|
-
|
|
33591
|
+
var _a;
|
|
33592
|
+
this.selected = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((option) => typeof this.preSelected === 'number'
|
|
33568
33593
|
? option.id === this.preSelected
|
|
33569
33594
|
: typeof this.preSelected === 'string'
|
|
33570
33595
|
? option.title === this.preSelected
|
|
@@ -33596,6 +33621,9 @@ let EzpSelect = class {
|
|
|
33596
33621
|
this.backdrop.visible = false;
|
|
33597
33622
|
}
|
|
33598
33623
|
}
|
|
33624
|
+
preSelectedChanged() {
|
|
33625
|
+
this.preSelect();
|
|
33626
|
+
}
|
|
33599
33627
|
/**
|
|
33600
33628
|
*
|
|
33601
33629
|
* Lifecycle methods
|
|
@@ -33619,7 +33647,8 @@ let EzpSelect = class {
|
|
|
33619
33647
|
this.duration = parseFloat(styles.getPropertyValue('--ezp-select-duration'));
|
|
33620
33648
|
}
|
|
33621
33649
|
componentWillUpdate() {
|
|
33622
|
-
|
|
33650
|
+
var _a;
|
|
33651
|
+
if (((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) === false &&
|
|
33623
33652
|
this.preSelected !== undefined &&
|
|
33624
33653
|
this.preSelected !== '' &&
|
|
33625
33654
|
this.preSelected !== null) {
|
|
@@ -33632,6 +33661,7 @@ let EzpSelect = class {
|
|
|
33632
33661
|
*
|
|
33633
33662
|
*/
|
|
33634
33663
|
render() {
|
|
33664
|
+
var _a, _b, _c;
|
|
33635
33665
|
const hostClasses = [
|
|
33636
33666
|
this.expanded ? 'is-expanded' : '',
|
|
33637
33667
|
this.icon ? 'has-icon' : '',
|
|
@@ -33640,15 +33670,17 @@ let EzpSelect = class {
|
|
|
33640
33670
|
this.disabled ? 'disabled' : '',
|
|
33641
33671
|
];
|
|
33642
33672
|
const labelLevel = this.toggleFlow === 'horizontal' ? 'secondary' : 'tertiary';
|
|
33643
|
-
return (index.h(index.Host, { class: hostClasses.join(' ') }, index.h("div", { id: "wrap" }, index.h("div", { id: "toggle", onClick: () => !this.disabled && this.toggle() }, this.icon ? index.h("ezp-icon", { id: "icon", name: this.icon }) : null, index.h("ezp-label", { id: "label", noWrap: true, level: labelLevel, text: this.label }), index.h("ezp-label", { id: "value", ellipsis: true, text: this.selected.title !== '' ? this.selected.title : this.placeholder }), index.h("ezp-icon", { id: "accessory", name: "expand" })), index.h("div", { id: "list", ref: (element) => (this.list = element) }, this.options.map((option) => {
|
|
33673
|
+
return (index.h(index.Host, { class: hostClasses.join(' ') }, index.h("div", { id: "wrap" }, index.h("div", { id: "toggle", onClick: () => !this.disabled && this.toggle() }, this.icon ? index.h("ezp-icon", { id: "icon", name: this.icon }) : null, index.h("ezp-label", { id: "label", noWrap: true, level: labelLevel, text: this.label }), index.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 }), index.h("ezp-icon", { id: "accessory", name: "expand" })), index.h("div", { id: "list", ref: (element) => (this.list = element) }, (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => {
|
|
33674
|
+
var _a;
|
|
33644
33675
|
if (option.title !== '') {
|
|
33645
|
-
return (index.h("div", { class: `option ${option.id === this.selected.id ? 'is-selected' : ''} ${option.meta !== '' ? 'has-meta' : ''} `, onClick: () => this.select(option.id) }, index.h("ezp-icon", { name: "checkmark", class: "indicator" }), index.h("div", { class: "details" }, index.h("ezp-label", { class: "title", ellipsis: true, text: option.title }), option.meta !== '' ? (index.h("ezp-label", { level: "tertiary", class: "meta", text: option.meta, ellipsis: true })) : null)));
|
|
33676
|
+
return (index.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) }, index.h("ezp-icon", { name: "checkmark", class: "indicator" }), index.h("div", { class: "details" }, index.h("ezp-label", { class: "title", ellipsis: true, text: option.title }), option.meta !== '' ? (index.h("ezp-label", { level: "tertiary", class: "meta", text: option.meta, ellipsis: true })) : null)));
|
|
33646
33677
|
}
|
|
33647
33678
|
})))));
|
|
33648
33679
|
}
|
|
33649
33680
|
get component() { return index.getElement(this); }
|
|
33650
33681
|
static get watchers() { return {
|
|
33651
|
-
"expanded": ["watchExpanded"]
|
|
33682
|
+
"expanded": ["watchExpanded"],
|
|
33683
|
+
"preSelected": ["preSelectedChanged"]
|
|
33652
33684
|
}; }
|
|
33653
33685
|
};
|
|
33654
33686
|
EzpSelect.style = ezpSelectCss;
|
|
@@ -33842,6 +33874,7 @@ let EzpUpload = class {
|
|
|
33842
33874
|
this.handleInput = () => {
|
|
33843
33875
|
this.filename = this.input.files[0].name;
|
|
33844
33876
|
this.uploadFile.emit(this.input.files);
|
|
33877
|
+
localStorage.removeItem('pageRanges');
|
|
33845
33878
|
};
|
|
33846
33879
|
}
|
|
33847
33880
|
/**
|
|
@@ -42,6 +42,14 @@ export class EzpPrinterSelection {
|
|
|
42
42
|
this.userMenuOpen = false;
|
|
43
43
|
this.printStopped = false;
|
|
44
44
|
this.selectedPrinterConfig = {
|
|
45
|
+
Profile: {
|
|
46
|
+
Color: '',
|
|
47
|
+
Duplex: '',
|
|
48
|
+
Paper: '',
|
|
49
|
+
Orientation: '',
|
|
50
|
+
Resolution: '',
|
|
51
|
+
Tray: ''
|
|
52
|
+
},
|
|
45
53
|
OrientationsSupported: [],
|
|
46
54
|
PaperFormats: [],
|
|
47
55
|
Resolutions: [],
|
|
@@ -258,8 +266,10 @@ export class EzpPrinterSelection {
|
|
|
258
266
|
this.selectedPrinter.is_queue = eventDetails.is_queue;
|
|
259
267
|
await this.printService
|
|
260
268
|
.getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
|
|
261
|
-
.then((data) =>
|
|
262
|
-
|
|
269
|
+
.then((data) => {
|
|
270
|
+
this.selectedPrinterConfig = Object.assign(Object.assign({}, this.selectedPrinterConfig), data[0]);
|
|
271
|
+
});
|
|
272
|
+
// this.setDefaultPaperFormat()
|
|
263
273
|
break;
|
|
264
274
|
case 'color':
|
|
265
275
|
this.selectedProperties.color = !!eventDetails.id;
|
|
@@ -302,6 +312,7 @@ export class EzpPrinterSelection {
|
|
|
302
312
|
case 'paper_ranges':
|
|
303
313
|
this.selectedProperties.PageRanges = eventDetails.value;
|
|
304
314
|
this.pageRangeInvalid = !validatePageRange(this.selectedProperties.PageRanges);
|
|
315
|
+
localStorage.setItem('pageRanges', JSON.stringify(this.selectedProperties.PageRanges));
|
|
305
316
|
// console.log(this.selectedProperties.PageRanges)
|
|
306
317
|
break;
|
|
307
318
|
case 'duplex':
|
|
@@ -376,6 +387,7 @@ export class EzpPrinterSelection {
|
|
|
376
387
|
}
|
|
377
388
|
}
|
|
378
389
|
setDefaultPaperFormat() {
|
|
390
|
+
var _a, _b, _c, _d, _e;
|
|
379
391
|
let format;
|
|
380
392
|
const language = navigator.language;
|
|
381
393
|
if (language === 'en-US') {
|
|
@@ -387,13 +399,13 @@ export class EzpPrinterSelection {
|
|
|
387
399
|
else {
|
|
388
400
|
format = 'A4';
|
|
389
401
|
}
|
|
390
|
-
if (this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format))) {
|
|
391
|
-
this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Name;
|
|
392
|
-
this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Id;
|
|
402
|
+
if ((_a = this.selectedPrinterConfig.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((el) => el.Name.includes(format))) {
|
|
403
|
+
this.selectedProperties.paper = (_b = this.selectedPrinterConfig.PaperFormats) === null || _b === void 0 ? void 0 : _b.find((el) => el.Name.includes(format)).Name;
|
|
404
|
+
this.selectedProperties.paperid = (_c = this.selectedPrinterConfig.PaperFormats) === null || _c === void 0 ? void 0 : _c.find((el) => el.Name.includes(format)).Id;
|
|
393
405
|
}
|
|
394
406
|
else {
|
|
395
|
-
this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats[0].Name;
|
|
396
|
-
this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats[0].Id;
|
|
407
|
+
this.selectedProperties.paper = (_d = this.selectedPrinterConfig.PaperFormats[0]) === null || _d === void 0 ? void 0 : _d.Name;
|
|
408
|
+
this.selectedProperties.paperid = (_e = this.selectedPrinterConfig.PaperFormats[0]) === null || _e === void 0 ? void 0 : _e.Id;
|
|
397
409
|
}
|
|
398
410
|
this.setPaperid();
|
|
399
411
|
}
|
|
@@ -448,6 +460,7 @@ export class EzpPrinterSelection {
|
|
|
448
460
|
*
|
|
449
461
|
*/
|
|
450
462
|
render() {
|
|
463
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
451
464
|
return this.loading ? (h("ezp-status", { processing: true, description: i18next.t('printer_selection.loading'), instance: "loading" })) : (h(Host, { class: { seamless: this.seamless } },
|
|
452
465
|
h("div", { id: "box", "data-backdrop-surface": true },
|
|
453
466
|
!this.printStopped && (h(Fragment, null, this.printProcessing ? (h("ezp-status", { processing: true, description: this.preparingUpload
|
|
@@ -494,24 +507,30 @@ export class EzpPrinterSelection {
|
|
|
494
507
|
type: 'color',
|
|
495
508
|
},
|
|
496
509
|
], preSelected: this.selectedPrinter.id
|
|
497
|
-
? this.
|
|
510
|
+
? ((_a = this.selectedPrinterConfig.Profile) === null || _a === void 0 ? void 0 : _a.Color) == "color"
|
|
498
511
|
? i18next.t('printer_selection.color_color')
|
|
499
512
|
: i18next.t('printer_selection.color_grayscale')
|
|
500
|
-
: null, disabled: !this.selectedPrinterConfig.
|
|
501
|
-
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) => ({
|
|
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) => ({
|
|
502
515
|
id: option.id,
|
|
503
516
|
title: option.title,
|
|
504
517
|
meta: '',
|
|
505
518
|
type: 'duplex',
|
|
506
|
-
})), preSelected: this.selectedPrinter.id && this.
|
|
507
|
-
?
|
|
508
|
-
:
|
|
509
|
-
|
|
519
|
+
})), preSelected: this.selectedPrinter.id && ((_c = this.selectedPrinterConfig.Profile) === null || _c === void 0 ? void 0 : _c.Duplex) == "duplex_simplex"
|
|
520
|
+
? i18next.t('printer_selection.duplex_none')
|
|
521
|
+
: ((_d = this.selectedPrinterConfig.Profile) === null || _d === void 0 ? void 0 : _d.Duplex) == "duplex_vertical"
|
|
522
|
+
? i18next.t('printer_selection.duplex_long')
|
|
523
|
+
: ((_e = this.selectedPrinterConfig.Profile) === null || _e === void 0 ? void 0 : _e.Duplex) == "duplex_horizontal"
|
|
524
|
+
? i18next.t('printer_selection.duplex_short')
|
|
525
|
+
: null, disabled: !this.selectedPrinterConfig.DuplexSupported }),
|
|
526
|
+
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) => ({
|
|
510
527
|
id: format.Id,
|
|
511
528
|
title: format.Name,
|
|
512
529
|
meta: `${format.XRes} x ${format.YRes}`,
|
|
513
530
|
type: 'format',
|
|
514
|
-
})), preSelected: this.selectedPrinter.id
|
|
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.Profile) === null || _a === void 0 ? void 0 : _a.Paper); }))
|
|
532
|
+
? (_g = this.selectedPrinterConfig.Profile) === null || _g === void 0 ? void 0 : _g.Paper
|
|
533
|
+
: null, disabled: !(((_h = this.selectedPrinterConfig.PaperFormats) === null || _h === void 0 ? void 0 : _h.length) > 0) }),
|
|
515
534
|
this.paperid == PAPER_ID ? (h(Fragment, null,
|
|
516
535
|
h("ezp-input", { icon: "width", suffix: "mm", value: this.selectedProperties.paperwidth, eventType: "width", type: "number", label: i18next.t('printer_selection.width') }),
|
|
517
536
|
h("ezp-input", { icon: "height", suffix: "mm", value: this.selectedProperties.paperlength, eventType: "length", type: "number", label: i18next.t('printer_selection.length') }))) : null,
|
|
@@ -521,19 +540,23 @@ export class EzpPrinterSelection {
|
|
|
521
540
|
meta: '',
|
|
522
541
|
type: 'orientation',
|
|
523
542
|
})), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }),
|
|
524
|
-
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) => ({
|
|
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) => ({
|
|
525
544
|
id: index,
|
|
526
545
|
title: option,
|
|
527
546
|
meta: '',
|
|
528
547
|
type: 'quality',
|
|
529
|
-
})), preSelected: this.selectedPrinter.id
|
|
530
|
-
|
|
548
|
+
})), preSelected: this.selectedPrinter.id && ((_k = this.selectedPrinterConfig.Resolutions) === null || _k === void 0 ? void 0 : _k.includes(this.selectedPrinterConfig.Profile.Resolution))
|
|
549
|
+
? this.selectedPrinterConfig.Profile.Resolution
|
|
550
|
+
: null, disabled: !(((_l = this.selectedPrinterConfig.Resolutions) === null || _l === void 0 ? void 0 : _l.length) > 0) }),
|
|
551
|
+
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) => ({
|
|
531
552
|
title: trays.Name,
|
|
532
553
|
id: trays.Index,
|
|
533
554
|
meta: '',
|
|
534
555
|
type: 'tray',
|
|
535
|
-
}))
|
|
536
|
-
|
|
556
|
+
})), preSelected: this.selectedPrinter.id && ((_m = this.selectedPrinterConfig.Trays) === null || _m === void 0 ? void 0 : _m.find((el) => el.Name.includes(this.selectedPrinterConfig.Profile.Tray)))
|
|
557
|
+
? this.selectedPrinterConfig.Profile.Tray
|
|
558
|
+
: 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') })),
|
|
537
560
|
h("ezp-stepper", { label: i18next.t('printer_selection.copies'), max: 10, icon: "copies" })),
|
|
538
561
|
h("div", { id: "footer" },
|
|
539
562
|
h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel'), class: "action", id: "cancel" }),
|
|
@@ -46,7 +46,8 @@ export class EzpSelect {
|
|
|
46
46
|
this.selectToggle.emit(this.expanded);
|
|
47
47
|
};
|
|
48
48
|
this.select = (id) => {
|
|
49
|
-
|
|
49
|
+
var _a;
|
|
50
|
+
const delay = ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) === id ? 0 : this.duration * 1000;
|
|
50
51
|
this.selected = this.options.find((option) => option.id === id);
|
|
51
52
|
this.selectSelection.emit(this.selected);
|
|
52
53
|
window.setTimeout(() => {
|
|
@@ -54,7 +55,8 @@ export class EzpSelect {
|
|
|
54
55
|
}, delay);
|
|
55
56
|
};
|
|
56
57
|
this.preSelect = () => {
|
|
57
|
-
|
|
58
|
+
var _a;
|
|
59
|
+
this.selected = (_a = this.options) === null || _a === void 0 ? void 0 : _a.find((option) => typeof this.preSelected === 'number'
|
|
58
60
|
? option.id === this.preSelected
|
|
59
61
|
: typeof this.preSelected === 'string'
|
|
60
62
|
? option.title === this.preSelected
|
|
@@ -86,6 +88,9 @@ export class EzpSelect {
|
|
|
86
88
|
this.backdrop.visible = false;
|
|
87
89
|
}
|
|
88
90
|
}
|
|
91
|
+
preSelectedChanged() {
|
|
92
|
+
this.preSelect();
|
|
93
|
+
}
|
|
89
94
|
/**
|
|
90
95
|
*
|
|
91
96
|
* Lifecycle methods
|
|
@@ -109,7 +114,8 @@ export class EzpSelect {
|
|
|
109
114
|
this.duration = parseFloat(styles.getPropertyValue('--ezp-select-duration'));
|
|
110
115
|
}
|
|
111
116
|
componentWillUpdate() {
|
|
112
|
-
|
|
117
|
+
var _a;
|
|
118
|
+
if (((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) === false &&
|
|
113
119
|
this.preSelected !== undefined &&
|
|
114
120
|
this.preSelected !== '' &&
|
|
115
121
|
this.preSelected !== null) {
|
|
@@ -122,6 +128,7 @@ export class EzpSelect {
|
|
|
122
128
|
*
|
|
123
129
|
*/
|
|
124
130
|
render() {
|
|
131
|
+
var _a, _b, _c;
|
|
125
132
|
const hostClasses = [
|
|
126
133
|
this.expanded ? 'is-expanded' : '',
|
|
127
134
|
this.icon ? 'has-icon' : '',
|
|
@@ -135,11 +142,12 @@ export class EzpSelect {
|
|
|
135
142
|
h("div", { id: "toggle", onClick: () => !this.disabled && this.toggle() },
|
|
136
143
|
this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null,
|
|
137
144
|
h("ezp-label", { id: "label", noWrap: true, level: labelLevel, text: this.label }),
|
|
138
|
-
h("ezp-label", { id: "value", ellipsis: true, text: this.selected.title !== '' ? this.selected.title : this.placeholder }),
|
|
145
|
+
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 }),
|
|
139
146
|
h("ezp-icon", { id: "accessory", name: "expand" })),
|
|
140
|
-
h("div", { id: "list", ref: (element) => (this.list = element) }, this.options.map((option) => {
|
|
147
|
+
h("div", { id: "list", ref: (element) => (this.list = element) }, (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => {
|
|
148
|
+
var _a;
|
|
141
149
|
if (option.title !== '') {
|
|
142
|
-
return (h("div", { class: `option ${option.id === this.selected.id ? 'is-selected' : ''} ${option.meta !== '' ? 'has-meta' : ''} `, onClick: () => this.select(option.id) },
|
|
150
|
+
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) },
|
|
143
151
|
h("ezp-icon", { name: "checkmark", class: "indicator" }),
|
|
144
152
|
h("div", { class: "details" },
|
|
145
153
|
h("ezp-label", { class: "title", ellipsis: true, text: option.title }),
|
|
@@ -354,5 +362,8 @@ export class EzpSelect {
|
|
|
354
362
|
static get watchers() { return [{
|
|
355
363
|
"propName": "expanded",
|
|
356
364
|
"methodName": "watchExpanded"
|
|
365
|
+
}, {
|
|
366
|
+
"propName": "preSelected",
|
|
367
|
+
"methodName": "preSelectedChanged"
|
|
357
368
|
}]; }
|
|
358
369
|
}
|