@ezeep/ezeep-js 1.0.160 → 1.0.164
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 +60 -138
- 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 +34 -55
- 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 +61 -139
- package/dist/directives/proxies.ts +1 -1
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_14.entry.js +60 -138
- 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-9ff19f99.entry.js → p-2bac1003.entry.js} +2 -2
- package/dist/ezeep/p-80d5c308.system.js +1 -1
- package/dist/ezeep/{p-e762ca0f.system.entry.js → p-a78a89f7.system.entry.js} +3 -3
- 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/readme.md +6 -6
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-9ff19f99.entry.js → p-2bac1003.entry.js} +2 -2
- package/www/build/p-80d5c308.system.js +1 -1
- package/www/build/{p-e762ca0f.system.entry.js → p-a78a89f7.system.entry.js} +3 -3
- package/www/index.html +5 -6
package/dist/cjs/ezeep.cjs.js
CHANGED
|
@@ -17,5 +17,5 @@ const patchBrowser = () => {
|
|
|
17
17
|
|
|
18
18
|
patchBrowser().then(options => {
|
|
19
19
|
appGlobals.globalScripts();
|
|
20
|
-
return index.bootstrapLazy([["ezp-auth_14.cjs",[[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],"
|
|
20
|
+
return index.bootstrapLazy([["ezp-auth_14.cjs",[[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);
|
|
21
21
|
});
|
|
@@ -3154,9 +3154,11 @@ function sendCodeToParentWindow() {
|
|
|
3154
3154
|
const params = new URLSearchParams(window.location.search);
|
|
3155
3155
|
const code = params.get('code');
|
|
3156
3156
|
if (window.opener) {
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3157
|
+
if (code) {
|
|
3158
|
+
// send them to the opening window
|
|
3159
|
+
window.opener.postMessage(code, authStore.state.redirectUri);
|
|
3160
|
+
window.close();
|
|
3161
|
+
}
|
|
3160
3162
|
}
|
|
3161
3163
|
}
|
|
3162
3164
|
|
|
@@ -3183,17 +3185,17 @@ let EzpAuth = class {
|
|
|
3183
3185
|
// remove any existing event listeners
|
|
3184
3186
|
window.removeEventListener('message', this.receiveMessage);
|
|
3185
3187
|
// window features
|
|
3186
|
-
const
|
|
3188
|
+
const windowFeatures = 'toolbar=no, menubar=no, width=600, height=7000, top=100, left=100';
|
|
3187
3189
|
if (this.oauthPopupWindow === null || this.oauthPopupWindow.closed) {
|
|
3188
3190
|
/* if the pointer to the window object in memory does not exist
|
|
3189
3191
|
or if such pointer exists but the window was closed */
|
|
3190
|
-
this.oauthPopupWindow = window.open(url, name,
|
|
3192
|
+
this.oauthPopupWindow = window.open(url, name, windowFeatures);
|
|
3191
3193
|
}
|
|
3192
3194
|
else if (this.previousUrl !== this.auth.authURI.toString()) {
|
|
3193
3195
|
/* if the resource to load is different,
|
|
3194
3196
|
then we load it in the already opened secondary window and then
|
|
3195
3197
|
we bring such window back on top/in front of its parent window. */
|
|
3196
|
-
this.oauthPopupWindow = window.open(url, name,
|
|
3198
|
+
this.oauthPopupWindow = window.open(url, name, windowFeatures);
|
|
3197
3199
|
this.oauthPopupWindow.focus();
|
|
3198
3200
|
}
|
|
3199
3201
|
else {
|
|
@@ -32430,7 +32432,6 @@ class EzpPrintService {
|
|
|
32430
32432
|
this.clientID = clientID;
|
|
32431
32433
|
this.printingApi = printStore.state.printApiHostUrl;
|
|
32432
32434
|
this.checkStoredRefreshToken();
|
|
32433
|
-
this.registerFetchInterceptor();
|
|
32434
32435
|
}
|
|
32435
32436
|
checkStoredRefreshToken() {
|
|
32436
32437
|
if (authStore.state.refreshToken !== '') {
|
|
@@ -32607,84 +32608,6 @@ const userStore = createStore({
|
|
|
32607
32608
|
appearance: '',
|
|
32608
32609
|
});
|
|
32609
32610
|
|
|
32610
|
-
const colors = [
|
|
32611
|
-
{
|
|
32612
|
-
id: 1,
|
|
32613
|
-
name: "Grayscale"
|
|
32614
|
-
},
|
|
32615
|
-
{
|
|
32616
|
-
id: 2,
|
|
32617
|
-
name: "Color"
|
|
32618
|
-
}
|
|
32619
|
-
];
|
|
32620
|
-
const orientations = [
|
|
32621
|
-
{
|
|
32622
|
-
id: 1,
|
|
32623
|
-
name: "Portrait"
|
|
32624
|
-
},
|
|
32625
|
-
{
|
|
32626
|
-
id: 2,
|
|
32627
|
-
name: "Landscape"
|
|
32628
|
-
}
|
|
32629
|
-
];
|
|
32630
|
-
const sizes = [
|
|
32631
|
-
{
|
|
32632
|
-
id: 1,
|
|
32633
|
-
name: "Auto",
|
|
32634
|
-
description: "Document size"
|
|
32635
|
-
},
|
|
32636
|
-
{
|
|
32637
|
-
id: 2,
|
|
32638
|
-
name: "Letter",
|
|
32639
|
-
description: "8.5 x 11 in"
|
|
32640
|
-
},
|
|
32641
|
-
{
|
|
32642
|
-
id: 3,
|
|
32643
|
-
name: "Ledger",
|
|
32644
|
-
description: "11 x 17 in"
|
|
32645
|
-
},
|
|
32646
|
-
{
|
|
32647
|
-
id: 4,
|
|
32648
|
-
name: "Legal",
|
|
32649
|
-
description: "8.5 x 14 in"
|
|
32650
|
-
},
|
|
32651
|
-
{
|
|
32652
|
-
id: 5,
|
|
32653
|
-
name: "Executive",
|
|
32654
|
-
description: "7.25 x 10.5 in"
|
|
32655
|
-
},
|
|
32656
|
-
{
|
|
32657
|
-
id: 6,
|
|
32658
|
-
name: "A3",
|
|
32659
|
-
description: "11.7 x 16.5 in"
|
|
32660
|
-
},
|
|
32661
|
-
{
|
|
32662
|
-
id: 7,
|
|
32663
|
-
name: "A4",
|
|
32664
|
-
description: "8.3 x 11.7 in"
|
|
32665
|
-
},
|
|
32666
|
-
{
|
|
32667
|
-
id: 8,
|
|
32668
|
-
name: "A5",
|
|
32669
|
-
description: "5.8 x 8.3 in"
|
|
32670
|
-
},
|
|
32671
|
-
{
|
|
32672
|
-
id: 9,
|
|
32673
|
-
name: "Folio",
|
|
32674
|
-
description: "8.5 x 13 in"
|
|
32675
|
-
},
|
|
32676
|
-
{
|
|
32677
|
-
id: 10,
|
|
32678
|
-
name: "Com-10",
|
|
32679
|
-
description: "4.125 x 9.5 in"
|
|
32680
|
-
}
|
|
32681
|
-
];
|
|
32682
|
-
const options = {
|
|
32683
|
-
colors: colors,
|
|
32684
|
-
orientations: orientations,
|
|
32685
|
-
sizes: sizes
|
|
32686
|
-
};
|
|
32687
|
-
|
|
32688
32611
|
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}";
|
|
32689
32612
|
|
|
32690
32613
|
let EzpPrinterSelection = class {
|
|
@@ -32715,7 +32638,6 @@ let EzpPrinterSelection = class {
|
|
|
32715
32638
|
*
|
|
32716
32639
|
*/
|
|
32717
32640
|
this.loading = true;
|
|
32718
|
-
this.options = options;
|
|
32719
32641
|
this.printProcessing = false;
|
|
32720
32642
|
this.uploading = false;
|
|
32721
32643
|
this.preparingUpload = false;
|
|
@@ -32761,12 +32683,13 @@ let EzpPrinterSelection = class {
|
|
|
32761
32683
|
return false;
|
|
32762
32684
|
};
|
|
32763
32685
|
this.POLL_INTERVAL = 2000;
|
|
32686
|
+
this.MAX_POLL_ATTEMPTS = 1000;
|
|
32764
32687
|
/** Description... */
|
|
32765
32688
|
this.handlePrint = async () => {
|
|
32766
32689
|
this.printProcessing = true;
|
|
32767
32690
|
// we have to initialse this obj with empty strings to display the select component
|
|
32768
32691
|
// but don't want to send any attributes with empty strings to the API
|
|
32769
|
-
|
|
32692
|
+
const cleanPrintProperties = removeEmptyStrings(this.selectedProperties);
|
|
32770
32693
|
// put it in store for further use
|
|
32771
32694
|
printStore.state.fileUrl = this.fileurl;
|
|
32772
32695
|
printStore.state.fileID = this.fileid;
|
|
@@ -32776,11 +32699,11 @@ let EzpPrinterSelection = class {
|
|
|
32776
32699
|
printStore.state.fileName = this.filename;
|
|
32777
32700
|
if (this.fileurl) {
|
|
32778
32701
|
this.printService
|
|
32779
|
-
.printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id,
|
|
32702
|
+
.printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename)
|
|
32780
32703
|
.then((response) => {
|
|
32781
32704
|
if (response.status === 412) {
|
|
32782
32705
|
response.json().then((data) => (this.fileid = data.fileid));
|
|
32783
|
-
this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id,
|
|
32706
|
+
this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename);
|
|
32784
32707
|
}
|
|
32785
32708
|
else {
|
|
32786
32709
|
return response.json();
|
|
@@ -32797,7 +32720,7 @@ let EzpPrinterSelection = class {
|
|
|
32797
32720
|
fn: this.printService.getPrintStatus,
|
|
32798
32721
|
validate: this.validateData,
|
|
32799
32722
|
interval: this.POLL_INTERVAL,
|
|
32800
|
-
maxAttempts:
|
|
32723
|
+
maxAttempts: this.MAX_POLL_ATTEMPTS,
|
|
32801
32724
|
}).catch((err) => {
|
|
32802
32725
|
console.warn(err);
|
|
32803
32726
|
this.printFailed = true;
|
|
@@ -32816,7 +32739,7 @@ let EzpPrinterSelection = class {
|
|
|
32816
32739
|
});
|
|
32817
32740
|
}
|
|
32818
32741
|
if (this.file) {
|
|
32819
|
-
await this.handleFiles(this.file);
|
|
32742
|
+
await this.handleFiles(this.file, cleanPrintProperties);
|
|
32820
32743
|
}
|
|
32821
32744
|
localStorage.setItem('properties', JSON.stringify(this.selectedProperties));
|
|
32822
32745
|
localStorage.setItem('printer', JSON.stringify(this.selectedPrinter));
|
|
@@ -32827,8 +32750,8 @@ let EzpPrinterSelection = class {
|
|
|
32827
32750
|
};
|
|
32828
32751
|
this.validateFileType = async (name) => {
|
|
32829
32752
|
const extension = name.split('.').pop();
|
|
32830
|
-
this.fileExtension = extension;
|
|
32831
|
-
return printStore.state.supportedFileExtensions.includes(`${
|
|
32753
|
+
this.fileExtension = extension.toLowerCase();
|
|
32754
|
+
return printStore.state.supportedFileExtensions.includes(`${this.fileExtension}`);
|
|
32832
32755
|
};
|
|
32833
32756
|
}
|
|
32834
32757
|
/**
|
|
@@ -32911,16 +32834,24 @@ let EzpPrinterSelection = class {
|
|
|
32911
32834
|
break;
|
|
32912
32835
|
case 'color':
|
|
32913
32836
|
this.selectedProperties.color = !!eventDetails.id;
|
|
32837
|
+
// console.log('color selected:')
|
|
32838
|
+
// console.log(this.selectedProperties.color)
|
|
32914
32839
|
break;
|
|
32915
32840
|
case 'orientation':
|
|
32916
32841
|
this.selectedProperties.orientation = eventDetails.id;
|
|
32842
|
+
// console.log('orientation selected:')
|
|
32843
|
+
// console.log(this.selectedProperties.orientation)
|
|
32917
32844
|
break;
|
|
32918
32845
|
case 'format':
|
|
32919
32846
|
this.selectedProperties.paper = eventDetails.title;
|
|
32920
32847
|
this.selectedProperties.paperid = eventDetails.id;
|
|
32848
|
+
// console.log('paper selected:')
|
|
32849
|
+
// console.log(this.selectedProperties.paper)
|
|
32921
32850
|
break;
|
|
32922
32851
|
case 'quality':
|
|
32923
32852
|
this.selectedProperties.resolution = eventDetails.title;
|
|
32853
|
+
// console.log('quality selected:')
|
|
32854
|
+
// console.log(this.selectedProperties.resolution)
|
|
32924
32855
|
break;
|
|
32925
32856
|
case 'duplex':
|
|
32926
32857
|
if (eventDetails.title === 'None') {
|
|
@@ -32930,10 +32861,12 @@ let EzpPrinterSelection = class {
|
|
|
32930
32861
|
this.selectedProperties.duplex = true;
|
|
32931
32862
|
}
|
|
32932
32863
|
this.selectedProperties.duplexmode = eventDetails.id;
|
|
32864
|
+
// console.log('duplex selected:')
|
|
32865
|
+
// console.log(this.selectedProperties.duplexmode)
|
|
32933
32866
|
break;
|
|
32934
32867
|
}
|
|
32935
32868
|
}
|
|
32936
|
-
async handleFiles(file) {
|
|
32869
|
+
async handleFiles(file, printPorperties) {
|
|
32937
32870
|
this.preparingUpload = true;
|
|
32938
32871
|
const response = await this.printService.prepareFileUpload(authStore.state.accessToken);
|
|
32939
32872
|
this.preparingUpload = false;
|
|
@@ -32952,7 +32885,7 @@ let EzpPrinterSelection = class {
|
|
|
32952
32885
|
this.uploading = false;
|
|
32953
32886
|
if (res._response.status === 201) {
|
|
32954
32887
|
this.printService
|
|
32955
|
-
.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id,
|
|
32888
|
+
.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, printPorperties, this.filename)
|
|
32956
32889
|
.then((data) => {
|
|
32957
32890
|
if (data.code === 804) {
|
|
32958
32891
|
this.printFailed = true;
|
|
@@ -32964,7 +32897,7 @@ let EzpPrinterSelection = class {
|
|
|
32964
32897
|
fn: this.printService.getPrintStatus,
|
|
32965
32898
|
validate: this.validateData,
|
|
32966
32899
|
interval: this.POLL_INTERVAL,
|
|
32967
|
-
maxAttempts:
|
|
32900
|
+
maxAttempts: this.MAX_POLL_ATTEMPTS,
|
|
32968
32901
|
}).catch((err) => {
|
|
32969
32902
|
console.log(err);
|
|
32970
32903
|
this.printFailed = true;
|
|
@@ -33010,8 +32943,9 @@ let EzpPrinterSelection = class {
|
|
|
33010
32943
|
/** Description... */
|
|
33011
32944
|
async connectedCallback() {
|
|
33012
32945
|
this.getPropertiesFromLocalStorage();
|
|
33013
|
-
this.getUserInfo();
|
|
33014
32946
|
this.printService = new EzpPrintService(this.redirectURI, this.clientID);
|
|
32947
|
+
this.printService.registerFetchInterceptor();
|
|
32948
|
+
await this.getUserInfo();
|
|
33015
32949
|
// if printer is stored from previous print, get the config to enable property selection
|
|
33016
32950
|
if (this.selectedPrinter.id != '') {
|
|
33017
32951
|
await this.printService
|
|
@@ -33091,25 +33025,9 @@ let EzpPrinterSelection = class {
|
|
|
33091
33025
|
},
|
|
33092
33026
|
],
|
|
33093
33027
|
// preSelected={
|
|
33094
|
-
// this.selectedProperties.color
|
|
33095
|
-
//
|
|
33096
|
-
//
|
|
33097
|
-
// id: 1,
|
|
33098
|
-
// title: i18next.t('printer_selection.color'),
|
|
33099
|
-
// meta: '',
|
|
33100
|
-
// type: 'color',
|
|
33101
|
-
// },
|
|
33102
|
-
// ]
|
|
33103
|
-
// : !this.selectedProperties.color ?
|
|
33104
|
-
// [
|
|
33105
|
-
// {
|
|
33106
|
-
// id: 0,
|
|
33107
|
-
// title: i18next.t('printer_selection.color_grayscale'),
|
|
33108
|
-
// meta: '',
|
|
33109
|
-
// type: 'color',
|
|
33110
|
-
// },
|
|
33111
|
-
// ]
|
|
33112
|
-
// : null
|
|
33028
|
+
// this.selectedProperties.color
|
|
33029
|
+
// ? i18next.t('printer_selection.color_color')
|
|
33030
|
+
// : i18next.t('printer_selection.color_grayscale')
|
|
33113
33031
|
// }
|
|
33114
33032
|
disabled: !this.selectedPrinterConfig.Color }), index.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) => ({
|
|
33115
33033
|
id: option.id,
|
|
@@ -33119,9 +33037,9 @@ let EzpPrinterSelection = class {
|
|
|
33119
33037
|
})),
|
|
33120
33038
|
// preSelected={
|
|
33121
33039
|
// this.selectedProperties.duplex
|
|
33122
|
-
// ? this.
|
|
33123
|
-
//
|
|
33124
|
-
//
|
|
33040
|
+
// ? this.duplexOptions.find(
|
|
33041
|
+
// (option) => option.id === this.selectedProperties.duplexmode
|
|
33042
|
+
// ).id
|
|
33125
33043
|
// : null
|
|
33126
33044
|
// }
|
|
33127
33045
|
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.map((format) => ({
|
|
@@ -33130,27 +33048,17 @@ let EzpPrinterSelection = class {
|
|
|
33130
33048
|
meta: `${format.XRes} x ${format.YRes}`,
|
|
33131
33049
|
type: 'format',
|
|
33132
33050
|
})),
|
|
33133
|
-
// preSelected={
|
|
33134
|
-
// this.selectedProperties.paper
|
|
33135
|
-
// ? this.selectedProperties.paper
|
|
33136
|
-
// // : this.selectedPrinterConfig.PaperFormats.length > 0
|
|
33137
|
-
// // ? this.selectedPrinterConfig.PaperFormats[0].Name
|
|
33138
|
-
// : null
|
|
33139
|
-
// }
|
|
33051
|
+
// preSelected={this.selectedProperties.paper ? this.selectedProperties.paper : null}
|
|
33140
33052
|
disabled: !(this.selectedPrinterConfig.PaperFormats.length > 0) }), 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) => ({
|
|
33141
|
-
id: index,
|
|
33053
|
+
id: index + 1,
|
|
33142
33054
|
title: i18next.t(`printer_selection.orientation_${orientation}`),
|
|
33143
33055
|
meta: '',
|
|
33144
33056
|
type: 'orientation',
|
|
33145
33057
|
})),
|
|
33146
33058
|
// preSelected={
|
|
33147
33059
|
// this.selectedProperties.orientation
|
|
33148
|
-
//
|
|
33149
|
-
//
|
|
33150
|
-
// // ? i18next.t(
|
|
33151
|
-
// // `printer_selection.orientation_${this.selectedPrinterConfig.OrientationsSupported[0]}`
|
|
33152
|
-
// // )
|
|
33153
|
-
// : null
|
|
33060
|
+
// ? this.selectedProperties.orientation
|
|
33061
|
+
// : null
|
|
33154
33062
|
// }
|
|
33155
33063
|
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) => ({
|
|
33156
33064
|
id: index,
|
|
@@ -33159,11 +33067,7 @@ let EzpPrinterSelection = class {
|
|
|
33159
33067
|
type: 'quality',
|
|
33160
33068
|
})),
|
|
33161
33069
|
// preSelected={
|
|
33162
|
-
// this.selectedProperties.resolution
|
|
33163
|
-
// ? this.selectedProperties.resolution
|
|
33164
|
-
// // : this.selectedPrinterConfig.Resolutions.length > 0
|
|
33165
|
-
// // ? this.selectedPrinterConfig.Resolutions[0]
|
|
33166
|
-
// : null
|
|
33070
|
+
// this.selectedProperties.resolution ? this.selectedProperties.resolution : null
|
|
33167
33071
|
// }
|
|
33168
33072
|
disabled: !(this.selectedPrinterConfig.Resolutions.length > 0) })), 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') }), index.h("ezp-text-button", { disabled: this.selectedPrinter.id === '', type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print') })), !this.hidemenu && index.h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
|
|
33169
33073
|
}
|
|
@@ -33263,6 +33167,13 @@ let EzpPrinting = class {
|
|
|
33263
33167
|
localStorage.removeItem('isAuthorized');
|
|
33264
33168
|
this.printOpen = false;
|
|
33265
33169
|
}
|
|
33170
|
+
async getSasUri() {
|
|
33171
|
+
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
33172
|
+
const response = await printService.prepareFileUpload(authStore.state.accessToken)
|
|
33173
|
+
.catch(() => this.open());
|
|
33174
|
+
const sasUri = response.sasUri;
|
|
33175
|
+
return sasUri;
|
|
33176
|
+
}
|
|
33266
33177
|
checkAuth() {
|
|
33267
33178
|
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
33268
33179
|
let accessToken = authStore.state.accessToken;
|
|
@@ -33288,6 +33199,12 @@ let EzpPrinting = class {
|
|
|
33288
33199
|
authStore.state.isAuthorized = false;
|
|
33289
33200
|
});
|
|
33290
33201
|
}
|
|
33202
|
+
refreshTokensPeriodically(seconds) {
|
|
33203
|
+
const authService = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
33204
|
+
setInterval(() => {
|
|
33205
|
+
authService.refreshTokens();
|
|
33206
|
+
}, seconds * 1000);
|
|
33207
|
+
}
|
|
33291
33208
|
componentWillLoad() {
|
|
33292
33209
|
const systemAppearanceDark = window.matchMedia('(prefers-color-scheme: dark)');
|
|
33293
33210
|
this.systemAppearance = systemAppearanceDark.matches ? 'dark' : 'light';
|
|
@@ -33313,6 +33230,9 @@ let EzpPrinting = class {
|
|
|
33313
33230
|
sendCodeToParentWindow();
|
|
33314
33231
|
this.checkAuth();
|
|
33315
33232
|
}
|
|
33233
|
+
componentDidLoad() {
|
|
33234
|
+
this.refreshTokensPeriodically(1800);
|
|
33235
|
+
}
|
|
33316
33236
|
/**
|
|
33317
33237
|
*
|
|
33318
33238
|
* Render method
|
|
@@ -33381,6 +33301,8 @@ let EzpSelect = class {
|
|
|
33381
33301
|
const delay = this.selected.id === id ? 0 : this.duration * 1000;
|
|
33382
33302
|
this.selected = this.options.find((option) => option.id === id);
|
|
33383
33303
|
this.selectSelection.emit(this.selected);
|
|
33304
|
+
// console.log('ezp-select:')
|
|
33305
|
+
// console.log(this.selected)
|
|
33384
33306
|
window.setTimeout(() => {
|
|
33385
33307
|
this.toggle();
|
|
33386
33308
|
}, delay);
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -16,7 +16,7 @@ const defineCustomElements = (win, options) => {
|
|
|
16
16
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
17
17
|
return patchEsm().then(() => {
|
|
18
18
|
appGlobals.globalScripts();
|
|
19
|
-
return index.bootstrapLazy([["ezp-auth_14.cjs",[[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],"
|
|
19
|
+
return index.bootstrapLazy([["ezp-auth_14.cjs",[[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);
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -20,17 +20,17 @@ export class EzpAuth {
|
|
|
20
20
|
// remove any existing event listeners
|
|
21
21
|
window.removeEventListener('message', this.receiveMessage);
|
|
22
22
|
// window features
|
|
23
|
-
const
|
|
23
|
+
const windowFeatures = 'toolbar=no, menubar=no, width=600, height=7000, top=100, left=100';
|
|
24
24
|
if (this.oauthPopupWindow === null || this.oauthPopupWindow.closed) {
|
|
25
25
|
/* if the pointer to the window object in memory does not exist
|
|
26
26
|
or if such pointer exists but the window was closed */
|
|
27
|
-
this.oauthPopupWindow = window.open(url, name,
|
|
27
|
+
this.oauthPopupWindow = window.open(url, name, windowFeatures);
|
|
28
28
|
}
|
|
29
29
|
else if (this.previousUrl !== this.auth.authURI.toString()) {
|
|
30
30
|
/* if the resource to load is different,
|
|
31
31
|
then we load it in the already opened secondary window and then
|
|
32
32
|
we bring such window back on top/in front of its parent window. */
|
|
33
|
-
this.oauthPopupWindow = window.open(url, name,
|
|
33
|
+
this.oauthPopupWindow = window.open(url, name, windowFeatures);
|
|
34
34
|
this.oauthPopupWindow.focus();
|
|
35
35
|
}
|
|
36
36
|
else {
|