@ezeep/ezeep-js 1.0.161 → 1.0.165
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/ezeep.cjs.js +1 -1
- package/dist/cjs/ezp-auth_14.cjs.entry.js +61 -139
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ezp-auth/ezp-auth.js +3 -3
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +35 -56
- package/dist/collection/components/ezp-printing/ezp-printing.js +33 -1
- package/dist/collection/components/ezp-select/ezp-select.js +2 -0
- package/dist/collection/services/auth.js +5 -3
- package/dist/collection/services/print.js +0 -1
- package/dist/custom-elements/index.js +62 -140
- package/dist/directives/proxies.ts +1 -1
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_14.entry.js +61 -139
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_14.entry.js +2 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-e762ca0f.system.entry.js → p-246f65df.system.entry.js} +2 -2
- package/dist/ezeep/{p-9ff19f99.entry.js → p-3b6f9be6.entry.js} +2 -2
- package/dist/ezeep/p-80d5c308.system.js +1 -1
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +2 -16
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +3 -0
- package/dist/types/components.d.ts +1 -0
- package/dist/types/services/print.d.ts +1 -1
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-e762ca0f.system.entry.js → p-246f65df.system.entry.js} +2 -2
- package/www/build/{p-9ff19f99.entry.js → p-3b6f9be6.entry.js} +2 -2
- package/www/build/p-80d5c308.system.js +1 -1
- package/www/index.html +5 -6
|
@@ -3163,9 +3163,11 @@ function sendCodeToParentWindow() {
|
|
|
3163
3163
|
const params = new URLSearchParams(window.location.search);
|
|
3164
3164
|
const code = params.get('code');
|
|
3165
3165
|
if (window.opener) {
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3166
|
+
if (code) {
|
|
3167
|
+
// send them to the opening window
|
|
3168
|
+
window.opener.postMessage(code, authStore.state.redirectUri);
|
|
3169
|
+
window.close();
|
|
3170
|
+
}
|
|
3169
3171
|
}
|
|
3170
3172
|
}
|
|
3171
3173
|
|
|
@@ -3194,17 +3196,17 @@ let EzpAuth$1 = class extends HTMLElement {
|
|
|
3194
3196
|
// remove any existing event listeners
|
|
3195
3197
|
window.removeEventListener('message', this.receiveMessage);
|
|
3196
3198
|
// window features
|
|
3197
|
-
const
|
|
3199
|
+
const windowFeatures = 'toolbar=no, menubar=no, width=600, height=7000, top=100, left=100';
|
|
3198
3200
|
if (this.oauthPopupWindow === null || this.oauthPopupWindow.closed) {
|
|
3199
3201
|
/* if the pointer to the window object in memory does not exist
|
|
3200
3202
|
or if such pointer exists but the window was closed */
|
|
3201
|
-
this.oauthPopupWindow = window.open(url, name,
|
|
3203
|
+
this.oauthPopupWindow = window.open(url, name, windowFeatures);
|
|
3202
3204
|
}
|
|
3203
3205
|
else if (this.previousUrl !== this.auth.authURI.toString()) {
|
|
3204
3206
|
/* if the resource to load is different,
|
|
3205
3207
|
then we load it in the already opened secondary window and then
|
|
3206
3208
|
we bring such window back on top/in front of its parent window. */
|
|
3207
|
-
this.oauthPopupWindow = window.open(url, name,
|
|
3209
|
+
this.oauthPopupWindow = window.open(url, name, windowFeatures);
|
|
3208
3210
|
this.oauthPopupWindow.focus();
|
|
3209
3211
|
}
|
|
3210
3212
|
else {
|
|
@@ -32451,7 +32453,6 @@ class EzpPrintService {
|
|
|
32451
32453
|
this.clientID = clientID;
|
|
32452
32454
|
this.printingApi = printStore.state.printApiHostUrl;
|
|
32453
32455
|
this.checkStoredRefreshToken();
|
|
32454
|
-
this.registerFetchInterceptor();
|
|
32455
32456
|
}
|
|
32456
32457
|
checkStoredRefreshToken() {
|
|
32457
32458
|
if (authStore.state.refreshToken !== '') {
|
|
@@ -32628,84 +32629,6 @@ const userStore = createStore({
|
|
|
32628
32629
|
appearance: '',
|
|
32629
32630
|
});
|
|
32630
32631
|
|
|
32631
|
-
const colors = [
|
|
32632
|
-
{
|
|
32633
|
-
id: 1,
|
|
32634
|
-
name: "Grayscale"
|
|
32635
|
-
},
|
|
32636
|
-
{
|
|
32637
|
-
id: 2,
|
|
32638
|
-
name: "Color"
|
|
32639
|
-
}
|
|
32640
|
-
];
|
|
32641
|
-
const orientations = [
|
|
32642
|
-
{
|
|
32643
|
-
id: 1,
|
|
32644
|
-
name: "Portrait"
|
|
32645
|
-
},
|
|
32646
|
-
{
|
|
32647
|
-
id: 2,
|
|
32648
|
-
name: "Landscape"
|
|
32649
|
-
}
|
|
32650
|
-
];
|
|
32651
|
-
const sizes = [
|
|
32652
|
-
{
|
|
32653
|
-
id: 1,
|
|
32654
|
-
name: "Auto",
|
|
32655
|
-
description: "Document size"
|
|
32656
|
-
},
|
|
32657
|
-
{
|
|
32658
|
-
id: 2,
|
|
32659
|
-
name: "Letter",
|
|
32660
|
-
description: "8.5 x 11 in"
|
|
32661
|
-
},
|
|
32662
|
-
{
|
|
32663
|
-
id: 3,
|
|
32664
|
-
name: "Ledger",
|
|
32665
|
-
description: "11 x 17 in"
|
|
32666
|
-
},
|
|
32667
|
-
{
|
|
32668
|
-
id: 4,
|
|
32669
|
-
name: "Legal",
|
|
32670
|
-
description: "8.5 x 14 in"
|
|
32671
|
-
},
|
|
32672
|
-
{
|
|
32673
|
-
id: 5,
|
|
32674
|
-
name: "Executive",
|
|
32675
|
-
description: "7.25 x 10.5 in"
|
|
32676
|
-
},
|
|
32677
|
-
{
|
|
32678
|
-
id: 6,
|
|
32679
|
-
name: "A3",
|
|
32680
|
-
description: "11.7 x 16.5 in"
|
|
32681
|
-
},
|
|
32682
|
-
{
|
|
32683
|
-
id: 7,
|
|
32684
|
-
name: "A4",
|
|
32685
|
-
description: "8.3 x 11.7 in"
|
|
32686
|
-
},
|
|
32687
|
-
{
|
|
32688
|
-
id: 8,
|
|
32689
|
-
name: "A5",
|
|
32690
|
-
description: "5.8 x 8.3 in"
|
|
32691
|
-
},
|
|
32692
|
-
{
|
|
32693
|
-
id: 9,
|
|
32694
|
-
name: "Folio",
|
|
32695
|
-
description: "8.5 x 13 in"
|
|
32696
|
-
},
|
|
32697
|
-
{
|
|
32698
|
-
id: 10,
|
|
32699
|
-
name: "Com-10",
|
|
32700
|
-
description: "4.125 x 9.5 in"
|
|
32701
|
-
}
|
|
32702
|
-
];
|
|
32703
|
-
const options = {
|
|
32704
|
-
colors: colors,
|
|
32705
|
-
orientations: orientations,
|
|
32706
|
-
sizes: sizes
|
|
32707
|
-
};
|
|
32708
|
-
|
|
32709
32632
|
const ezpPrinterSelectionCss = ":host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-color-overlay-primary);display:grid;grid-template:auto/320px;height:100vh;-ms-flex-pack:center;justify-content:center;left:0;position:fixed;top:0;width:100vw}#box{background:var(--ezp-color-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-color-overlay-secondary));box-shadow:var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-color-overlay-secondary));position:relative}#header{border-radius:6px 6px 0 0;-webkit-box-shadow:var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-color-outline);box-shadow:var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-color-outline);color:var(--ezp-color-foreground-primary);display:grid;grid-column-gap:var(--ezp-spacing-1);grid-template-columns:auto 1fr auto;padding:var(--ezp-spacing-4) var(--ezp-spacing-3) var(--ezp-spacing-4) var(--ezp-spacing-4);position:relative;z-index:3}#toggle-menu{margin:calc(var(--ezp-spacing-3) * -1) 0;position:relative;z-index:2}#body{background:var(--ezp-color-surface-secondary);-webkit-box-shadow:var(--ezp-printerSelection-body-boxShadow, none);box-shadow:var(--ezp-printerSelection-body-boxShadow, none);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-2);padding:var(--ezp-spacing-2)}#footer{border-radius:0 0 6px 6px;-webkit-box-shadow:var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-color-outline);box-shadow:var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-color-outline);display:grid;grid-column-gap:var(--ezp-spacing-2);grid-template-columns:repeat(2, 1fr);padding:var(--ezp-spacing-2);position:relative;z-index:3}";
|
|
32710
32633
|
|
|
32711
32634
|
let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
@@ -32738,7 +32661,6 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32738
32661
|
*
|
|
32739
32662
|
*/
|
|
32740
32663
|
this.loading = true;
|
|
32741
|
-
this.options = options;
|
|
32742
32664
|
this.printProcessing = false;
|
|
32743
32665
|
this.uploading = false;
|
|
32744
32666
|
this.preparingUpload = false;
|
|
@@ -32784,12 +32706,13 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32784
32706
|
return false;
|
|
32785
32707
|
};
|
|
32786
32708
|
this.POLL_INTERVAL = 2000;
|
|
32709
|
+
this.MAX_POLL_ATTEMPTS = Infinity;
|
|
32787
32710
|
/** Description... */
|
|
32788
32711
|
this.handlePrint = async () => {
|
|
32789
32712
|
this.printProcessing = true;
|
|
32790
32713
|
// we have to initialse this obj with empty strings to display the select component
|
|
32791
32714
|
// but don't want to send any attributes with empty strings to the API
|
|
32792
|
-
|
|
32715
|
+
const cleanPrintProperties = removeEmptyStrings(this.selectedProperties);
|
|
32793
32716
|
// put it in store for further use
|
|
32794
32717
|
printStore.state.fileUrl = this.fileurl;
|
|
32795
32718
|
printStore.state.fileID = this.fileid;
|
|
@@ -32799,11 +32722,11 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32799
32722
|
printStore.state.fileName = this.filename;
|
|
32800
32723
|
if (this.fileurl) {
|
|
32801
32724
|
this.printService
|
|
32802
|
-
.printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id,
|
|
32725
|
+
.printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename)
|
|
32803
32726
|
.then((response) => {
|
|
32804
32727
|
if (response.status === 412) {
|
|
32805
32728
|
response.json().then((data) => (this.fileid = data.fileid));
|
|
32806
|
-
this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id,
|
|
32729
|
+
this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename);
|
|
32807
32730
|
}
|
|
32808
32731
|
else {
|
|
32809
32732
|
return response.json();
|
|
@@ -32820,7 +32743,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32820
32743
|
fn: this.printService.getPrintStatus,
|
|
32821
32744
|
validate: this.validateData,
|
|
32822
32745
|
interval: this.POLL_INTERVAL,
|
|
32823
|
-
maxAttempts:
|
|
32746
|
+
maxAttempts: this.MAX_POLL_ATTEMPTS,
|
|
32824
32747
|
}).catch((err) => {
|
|
32825
32748
|
console.warn(err);
|
|
32826
32749
|
this.printFailed = true;
|
|
@@ -32839,7 +32762,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32839
32762
|
});
|
|
32840
32763
|
}
|
|
32841
32764
|
if (this.file) {
|
|
32842
|
-
await this.handleFiles(this.file);
|
|
32765
|
+
await this.handleFiles(this.file, cleanPrintProperties);
|
|
32843
32766
|
}
|
|
32844
32767
|
localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
|
|
32845
32768
|
localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
|
|
@@ -32850,8 +32773,8 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32850
32773
|
};
|
|
32851
32774
|
this.validateFileType = async (name) => {
|
|
32852
32775
|
const extension = name.split('.').pop();
|
|
32853
|
-
this.fileExtension = extension;
|
|
32854
|
-
return printStore.state.supportedFileExtensions.includes(`${
|
|
32776
|
+
this.fileExtension = extension.toLowerCase();
|
|
32777
|
+
return printStore.state.supportedFileExtensions.includes(`${this.fileExtension}`);
|
|
32855
32778
|
};
|
|
32856
32779
|
}
|
|
32857
32780
|
/**
|
|
@@ -32934,16 +32857,24 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32934
32857
|
break;
|
|
32935
32858
|
case 'color':
|
|
32936
32859
|
this.selectedProperties.color = !!eventDetails.id;
|
|
32860
|
+
// console.log('color selected:')
|
|
32861
|
+
// console.log(this.selectedProperties.color)
|
|
32937
32862
|
break;
|
|
32938
32863
|
case 'orientation':
|
|
32939
32864
|
this.selectedProperties.orientation = eventDetails.id;
|
|
32865
|
+
// console.log('orientation selected:')
|
|
32866
|
+
// console.log(this.selectedProperties.orientation)
|
|
32940
32867
|
break;
|
|
32941
32868
|
case 'format':
|
|
32942
32869
|
this.selectedProperties.paper = eventDetails.title;
|
|
32943
32870
|
this.selectedProperties.paperid = eventDetails.id;
|
|
32871
|
+
// console.log('paper selected:')
|
|
32872
|
+
// console.log(this.selectedProperties.paper)
|
|
32944
32873
|
break;
|
|
32945
32874
|
case 'quality':
|
|
32946
32875
|
this.selectedProperties.resolution = eventDetails.title;
|
|
32876
|
+
// console.log('quality selected:')
|
|
32877
|
+
// console.log(this.selectedProperties.resolution)
|
|
32947
32878
|
break;
|
|
32948
32879
|
case 'duplex':
|
|
32949
32880
|
if (eventDetails.title === 'None') {
|
|
@@ -32953,10 +32884,12 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32953
32884
|
this.selectedProperties.duplex = true;
|
|
32954
32885
|
}
|
|
32955
32886
|
this.selectedProperties.duplexmode = eventDetails.id;
|
|
32887
|
+
// console.log('duplex selected:')
|
|
32888
|
+
// console.log(this.selectedProperties.duplexmode)
|
|
32956
32889
|
break;
|
|
32957
32890
|
}
|
|
32958
32891
|
}
|
|
32959
|
-
async handleFiles(file) {
|
|
32892
|
+
async handleFiles(file, printPorperties) {
|
|
32960
32893
|
this.preparingUpload = true;
|
|
32961
32894
|
const response = await this.printService.prepareFileUpload(authStore.state.accessToken);
|
|
32962
32895
|
this.preparingUpload = false;
|
|
@@ -32975,7 +32908,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32975
32908
|
this.uploading = false;
|
|
32976
32909
|
if (res._response.status === 201) {
|
|
32977
32910
|
this.printService
|
|
32978
|
-
.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id,
|
|
32911
|
+
.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, printPorperties, this.filename)
|
|
32979
32912
|
.then((data) => {
|
|
32980
32913
|
if (data.code === 804) {
|
|
32981
32914
|
this.printFailed = true;
|
|
@@ -32987,7 +32920,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32987
32920
|
fn: this.printService.getPrintStatus,
|
|
32988
32921
|
validate: this.validateData,
|
|
32989
32922
|
interval: this.POLL_INTERVAL,
|
|
32990
|
-
maxAttempts:
|
|
32923
|
+
maxAttempts: this.MAX_POLL_ATTEMPTS,
|
|
32991
32924
|
}).catch((err) => {
|
|
32992
32925
|
console.log(err);
|
|
32993
32926
|
this.printFailed = true;
|
|
@@ -33033,8 +32966,9 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33033
32966
|
/** Description... */
|
|
33034
32967
|
async connectedCallback() {
|
|
33035
32968
|
this.getPropertiesFromLocalStorage();
|
|
33036
|
-
this.getUserInfo();
|
|
33037
32969
|
this.printService = new EzpPrintService(this.redirectURI, this.clientID);
|
|
32970
|
+
this.printService.registerFetchInterceptor();
|
|
32971
|
+
await this.getUserInfo();
|
|
33038
32972
|
// if printer is stored from previous print, get the config to enable property selection
|
|
33039
32973
|
if (this.selectedPrinter.id != '') {
|
|
33040
32974
|
await this.printService
|
|
@@ -33086,7 +33020,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33086
33020
|
title: printer.name,
|
|
33087
33021
|
meta: printer.location !== ''
|
|
33088
33022
|
? printer.location
|
|
33089
|
-
:
|
|
33023
|
+
: '',
|
|
33090
33024
|
type: 'printer',
|
|
33091
33025
|
})),
|
|
33092
33026
|
// preSelected={this.selectedPrinter ? this.selectedPrinter.name : null}
|
|
@@ -33114,25 +33048,9 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33114
33048
|
},
|
|
33115
33049
|
],
|
|
33116
33050
|
// preSelected={
|
|
33117
|
-
// this.selectedProperties.color
|
|
33118
|
-
//
|
|
33119
|
-
//
|
|
33120
|
-
// id: 1,
|
|
33121
|
-
// title: i18next.t('printer_selection.color'),
|
|
33122
|
-
// meta: '',
|
|
33123
|
-
// type: 'color',
|
|
33124
|
-
// },
|
|
33125
|
-
// ]
|
|
33126
|
-
// : !this.selectedProperties.color ?
|
|
33127
|
-
// [
|
|
33128
|
-
// {
|
|
33129
|
-
// id: 0,
|
|
33130
|
-
// title: i18next.t('printer_selection.color_grayscale'),
|
|
33131
|
-
// meta: '',
|
|
33132
|
-
// type: 'color',
|
|
33133
|
-
// },
|
|
33134
|
-
// ]
|
|
33135
|
-
// : null
|
|
33051
|
+
// this.selectedProperties.color
|
|
33052
|
+
// ? i18next.t('printer_selection.color_color')
|
|
33053
|
+
// : i18next.t('printer_selection.color_grayscale')
|
|
33136
33054
|
// }
|
|
33137
33055
|
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) => ({
|
|
33138
33056
|
id: option.id,
|
|
@@ -33142,9 +33060,9 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33142
33060
|
})),
|
|
33143
33061
|
// preSelected={
|
|
33144
33062
|
// this.selectedProperties.duplex
|
|
33145
|
-
// ? this.
|
|
33146
|
-
//
|
|
33147
|
-
//
|
|
33063
|
+
// ? this.duplexOptions.find(
|
|
33064
|
+
// (option) => option.id === this.selectedProperties.duplexmode
|
|
33065
|
+
// ).id
|
|
33148
33066
|
// : null
|
|
33149
33067
|
// }
|
|
33150
33068
|
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) => ({
|
|
@@ -33153,27 +33071,17 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33153
33071
|
meta: `${format.XRes} x ${format.YRes}`,
|
|
33154
33072
|
type: 'format',
|
|
33155
33073
|
})),
|
|
33156
|
-
// preSelected={
|
|
33157
|
-
// this.selectedProperties.paper
|
|
33158
|
-
// ? this.selectedProperties.paper
|
|
33159
|
-
// // : this.selectedPrinterConfig.PaperFormats.length > 0
|
|
33160
|
-
// // ? this.selectedPrinterConfig.PaperFormats[0].Name
|
|
33161
|
-
// : null
|
|
33162
|
-
// }
|
|
33074
|
+
// preSelected={this.selectedProperties.paper ? this.selectedProperties.paper : null}
|
|
33163
33075
|
disabled: !(this.selectedPrinterConfig.PaperFormats.length > 0) }), 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) => ({
|
|
33164
|
-
id: index,
|
|
33076
|
+
id: index + 1,
|
|
33165
33077
|
title: i18next.t(`printer_selection.orientation_${orientation}`),
|
|
33166
33078
|
meta: '',
|
|
33167
33079
|
type: 'orientation',
|
|
33168
33080
|
})),
|
|
33169
33081
|
// preSelected={
|
|
33170
33082
|
// this.selectedProperties.orientation
|
|
33171
|
-
//
|
|
33172
|
-
//
|
|
33173
|
-
// // ? i18next.t(
|
|
33174
|
-
// // `printer_selection.orientation_${this.selectedPrinterConfig.OrientationsSupported[0]}`
|
|
33175
|
-
// // )
|
|
33176
|
-
// : null
|
|
33083
|
+
// ? this.selectedProperties.orientation
|
|
33084
|
+
// : null
|
|
33177
33085
|
// }
|
|
33178
33086
|
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) => ({
|
|
33179
33087
|
id: index,
|
|
@@ -33182,11 +33090,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33182
33090
|
type: 'quality',
|
|
33183
33091
|
})),
|
|
33184
33092
|
// preSelected={
|
|
33185
|
-
// this.selectedProperties.resolution
|
|
33186
|
-
// ? this.selectedProperties.resolution
|
|
33187
|
-
// // : this.selectedPrinterConfig.Resolutions.length > 0
|
|
33188
|
-
// // ? this.selectedPrinterConfig.Resolutions[0]
|
|
33189
|
-
// : null
|
|
33093
|
+
// this.selectedProperties.resolution ? this.selectedProperties.resolution : null
|
|
33190
33094
|
// }
|
|
33191
33095
|
disabled: !(this.selectedPrinterConfig.Resolutions.length > 0) })), 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') }), h("ezp-text-button", { disabled: this.selectedPrinter.id === '', type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print') })), !this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
|
|
33192
33096
|
}
|
|
@@ -33288,6 +33192,13 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33288
33192
|
localStorage.removeItem('isAuthorized');
|
|
33289
33193
|
this.printOpen = false;
|
|
33290
33194
|
}
|
|
33195
|
+
async getSasUri() {
|
|
33196
|
+
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
33197
|
+
const response = await printService.prepareFileUpload(authStore.state.accessToken)
|
|
33198
|
+
.catch(() => this.open());
|
|
33199
|
+
const sasUri = response.sasUri;
|
|
33200
|
+
return sasUri;
|
|
33201
|
+
}
|
|
33291
33202
|
checkAuth() {
|
|
33292
33203
|
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
33293
33204
|
let accessToken = authStore.state.accessToken;
|
|
@@ -33313,6 +33224,12 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33313
33224
|
authStore.state.isAuthorized = false;
|
|
33314
33225
|
});
|
|
33315
33226
|
}
|
|
33227
|
+
refreshTokensPeriodically(seconds) {
|
|
33228
|
+
const authService = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
33229
|
+
setInterval(() => {
|
|
33230
|
+
authService.refreshTokens();
|
|
33231
|
+
}, seconds * 1000);
|
|
33232
|
+
}
|
|
33316
33233
|
componentWillLoad() {
|
|
33317
33234
|
const systemAppearanceDark = window.matchMedia('(prefers-color-scheme: dark)');
|
|
33318
33235
|
this.systemAppearance = systemAppearanceDark.matches ? 'dark' : 'light';
|
|
@@ -33338,6 +33255,9 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33338
33255
|
sendCodeToParentWindow();
|
|
33339
33256
|
this.checkAuth();
|
|
33340
33257
|
}
|
|
33258
|
+
componentDidLoad() {
|
|
33259
|
+
this.refreshTokensPeriodically(1800);
|
|
33260
|
+
}
|
|
33341
33261
|
/**
|
|
33342
33262
|
*
|
|
33343
33263
|
* Render method
|
|
@@ -33408,6 +33328,8 @@ let EzpSelect$1 = class extends HTMLElement {
|
|
|
33408
33328
|
const delay = this.selected.id === id ? 0 : this.duration * 1000;
|
|
33409
33329
|
this.selected = this.options.find((option) => option.id === id);
|
|
33410
33330
|
this.selectSelection.emit(this.selected);
|
|
33331
|
+
// console.log('ezp-select:')
|
|
33332
|
+
// console.log(this.selected)
|
|
33411
33333
|
window.setTimeout(() => {
|
|
33412
33334
|
this.toggle();
|
|
33413
33335
|
}, delay);
|
|
@@ -33840,7 +33762,7 @@ const EzpDialog = /*@__PURE__*/proxyCustomElement(EzpDialog$1, [1,"ezp-dialog",{
|
|
|
33840
33762
|
const EzpIcon = /*@__PURE__*/proxyCustomElement(EzpIcon$1, [1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}]);
|
|
33841
33763
|
const EzpIconButton = /*@__PURE__*/proxyCustomElement(EzpIconButton$1, [1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}]);
|
|
33842
33764
|
const EzpLabel = /*@__PURE__*/proxyCustomElement(EzpLabel$1, [1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]);
|
|
33843
|
-
const EzpPrinterSelection = /*@__PURE__*/proxyCustomElement(EzpPrinterSelection$1, [1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"file":[16],"hidemenu":[4],"loading":[32],"
|
|
33765
|
+
const EzpPrinterSelection = /*@__PURE__*/proxyCustomElement(EzpPrinterSelection$1, [1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"file":[16],"hidemenu":[4],"loading":[32],"printProcessing":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32]},[[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]]);
|
|
33844
33766
|
const EzpPrinting = /*@__PURE__*/proxyCustomElement(EzpPrinting$1, [1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"printOpen":[32],"authOpen":[32],"noDocumentOpen":[32],"systemAppearance":[32]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"]]]);
|
|
33845
33767
|
const EzpSelect = /*@__PURE__*/proxyCustomElement(EzpSelect$1, [1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}]);
|
|
33846
33768
|
const EzpStatus = /*@__PURE__*/proxyCustomElement(EzpStatus$1, [1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}]);
|
|
@@ -167,7 +167,7 @@ export class EzpPrinterSelection {
|
|
|
167
167
|
export declare interface EzpPrinting extends Components.EzpPrinting {}
|
|
168
168
|
@ProxyCmp({
|
|
169
169
|
inputs: ['appearance', 'authapihosturl', 'clientid', 'custom', 'fileid', 'filename', 'filetype', 'fileurl', 'hidelogin', 'hidemenu', 'language', 'printapihosturl', 'redirecturi', 'theme', 'trigger'],
|
|
170
|
-
methods: ['open', 'logOut']
|
|
170
|
+
methods: ['open', 'logOut', 'getSasUri']
|
|
171
171
|
})
|
|
172
172
|
@Component({
|
|
173
173
|
selector: 'ezp-printing',
|
package/dist/esm/ezeep.js
CHANGED
|
@@ -15,5 +15,5 @@ const patchBrowser = () => {
|
|
|
15
15
|
|
|
16
16
|
patchBrowser().then(options => {
|
|
17
17
|
globalScripts();
|
|
18
|
-
return bootstrapLazy([["ezp-auth_14",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"printOpen":[32],"authOpen":[32],"noDocumentOpen":[32],"systemAppearance":[32],"open":[64],"logOut":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"file":[16],"hidemenu":[4],"loading":[32],"
|
|
18
|
+
return bootstrapLazy([["ezp-auth_14",[[1,"ezp-printing",{"clientid":[1],"redirecturi":[1],"filename":[1025],"fileurl":[1],"filetype":[1],"custom":[4],"hidelogin":[4],"hidemenu":[4],"authapihosturl":[1],"printapihosturl":[1],"theme":[1],"fileid":[1],"appearance":[1],"trigger":[1],"language":[1],"printOpen":[32],"authOpen":[32],"noDocumentOpen":[32],"systemAppearance":[32],"open":[64],"logOut":[64],"getSasUri":[64]},[[0,"printCancel","listenPrintCancel"],[0,"printSubmit","listenPrintSubmit"],[0,"authCancel","listenAuthCancel"],[0,"authSuccess","listenAuthSuccess"],[0,"uploadFile","listenUploadFile"],[0,"dialogClose","listenDialogClose"],[0,"dialogAction","listenDialogAction"]]],[1,"ezp-printer-selection",{"clientID":[1,"client-i-d"],"redirectURI":[1,"redirect-u-r-i"],"filename":[1025],"fileurl":[1],"filetype":[1025],"fileid":[1025],"file":[16],"hidemenu":[4],"loading":[32],"printProcessing":[32],"uploading":[32],"preparingUpload":[32],"printSuccess":[32],"printFailed":[32],"notSupported":[32],"noPrinters":[32],"userMenuOpen":[32],"printStopped":[32],"userName":[32],"printers":[32],"selectedPrinter":[32],"printerConfig":[32],"selectedPrinterConfig":[32],"selectedProperties":[32]},[[0,"selectSelection","listenSelectSelection"],[0,"stepperChanged","listenStepperChanged"],[0,"userMenuClosure","listenUserMenuClosure"],[0,"logoutEmitter","listenLogout"],[0,"statusCancel","listenStatusCancel"],[0,"statusClose","listenStatusClose"],[0,"statusRetry","listenStatusRetry"]]],[1,"ezp-auth",{"clientID":[1025,"client-i-d"],"redirectURI":[1025,"redirect-u-r-i"],"hidelogin":[4],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"]]],[1,"ezp-dialog",{"heading":[1],"description":[1],"action":[1],"iconName":[1,"icon-name"],"iconSize":[1,"icon-size"],"iconFramed":[4,"icon-framed"],"instance":[1]}],[1,"ezp-user-menu",{"name":[1],"open":[1028]}],[1,"ezp-select",{"icon":[1],"label":[1],"optionFlow":[1,"option-flow"],"options":[16],"placeholder":[1],"preSelected":[8,"pre-selected"],"toggleFlow":[1,"toggle-flow"],"disabled":[4],"expanded":[32],"selected":[32]}],[1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}],[1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}],[1,"ezp-backdrop",{"visible":[1028]},[[0,"animationend","listenAnimationEnd"]]],[1,"ezp-icon-button",{"blank":[4],"disabled":[4],"href":[1],"icon":[1],"level":[1],"type":[1]}],[1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}],[1,"ezp-icon",{"name":[1],"size":[1],"framed":[4]}],[1,"ezp-label",{"ellipsis":[4],"level":[1],"noWrap":[4,"no-wrap"],"text":[1],"weight":[1]}]]]], options);
|
|
19
19
|
});
|