@ezeep/ezeep-js 1.0.167 → 1.0.171
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 +26 -9
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/ezp-auth/ezp-auth.js +6 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +5 -2
- package/dist/collection/components/ezp-printing/ezp-printing.js +8 -4
- package/dist/collection/components/ezp-upload/ezp-upload.js +10 -2
- package/dist/custom-elements/index.js +27 -10
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_14.entry.js +26 -9
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_14.entry.js +3 -3
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/p-16c7584d.system.js +1 -1
- package/dist/ezeep/{p-9ac499ef.system.entry.js → p-370b0d9a.system.entry.js} +3 -3
- package/dist/ezeep/{p-a84d0e34.entry.js → p-e1769616.entry.js} +2 -2
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +1 -0
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/p-16c7584d.system.js +1 -1
- package/www/build/{p-9ac499ef.system.entry.js → p-370b0d9a.system.entry.js} +3 -3
- package/www/build/{p-a84d0e34.entry.js → p-e1769616.entry.js} +2 -2
- package/www/data/locales/en.json +3 -2
- package/www/index.html +2 -4
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],"onlyGetSasUri":[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],"trigger":[1],"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"],[4,"printCancel","listenPrintCancel"]]],[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
|
+
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],"onlyGetSasUri":[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],"trigger":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"filename":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[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
|
});
|
|
@@ -2955,13 +2955,14 @@ const button_actions = {
|
|
|
2955
2955
|
cancel: "Cancel",
|
|
2956
2956
|
close: "Close",
|
|
2957
2957
|
retry: "Retry",
|
|
2958
|
-
|
|
2958
|
+
select_printer: "Select Printer"
|
|
2959
2959
|
};
|
|
2960
2960
|
const upload = {
|
|
2961
2961
|
description: "Drop a file here into the browser ",
|
|
2962
2962
|
meta_leading: "or",
|
|
2963
2963
|
meta_select: "select a file",
|
|
2964
|
-
meta_trailing: "to print with ezeep Blue."
|
|
2964
|
+
meta_trailing: "to print with ezeep Blue.",
|
|
2965
|
+
selected_file: "Selected File:"
|
|
2965
2966
|
};
|
|
2966
2967
|
const user_menu = {
|
|
2967
2968
|
theme: "Color theme",
|
|
@@ -3184,6 +3185,11 @@ let EzpAuth = class {
|
|
|
3184
3185
|
this.authCancel.emit();
|
|
3185
3186
|
}
|
|
3186
3187
|
openSignInWindow(url, name) {
|
|
3188
|
+
if (authStore.state.isAuthorized) {
|
|
3189
|
+
this.authCancel.emit();
|
|
3190
|
+
this.authSuccess.emit();
|
|
3191
|
+
return;
|
|
3192
|
+
}
|
|
3187
3193
|
// remove any existing event listeners
|
|
3188
3194
|
window.removeEventListener('message', this.receiveMessage);
|
|
3189
3195
|
// window features
|
|
@@ -3235,7 +3241,7 @@ let EzpAuth = class {
|
|
|
3235
3241
|
}
|
|
3236
3242
|
}
|
|
3237
3243
|
render() {
|
|
3238
|
-
return (index.h(index.Host, null, this.hidelogin && this.trigger === 'button' ? (index.h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : this.hidelogin && this.trigger === 'file' ? (index.h("ezp-text-button", { type: "button", level: "primary", onClick: () => this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login'), label: i18next.t('button_actions.
|
|
3244
|
+
return (index.h(index.Host, null, this.hidelogin && this.trigger === 'button' ? (index.h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : this.hidelogin && this.trigger === 'file' ? (index.h("ezp-text-button", { type: "button", level: "primary", onClick: () => this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login'), label: i18next.t('button_actions.select_printer') })) : (index.h("ezp-dialog", { heading: i18next.t('login_dialog.heading'), description: i18next.t('login_dialog.description'), action: i18next.t('login_dialog.action'), iconName: "logo", iconSize: "huge", iconFramed: false, instance: "login" }))));
|
|
3239
3245
|
}
|
|
3240
3246
|
};
|
|
3241
3247
|
EzpAuth.style = ezpAuthCss;
|
|
@@ -32709,6 +32715,10 @@ let EzpPrinterSelection = class {
|
|
|
32709
32715
|
this.printService
|
|
32710
32716
|
.printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename)
|
|
32711
32717
|
.then((response) => {
|
|
32718
|
+
if (response.status === 200 && this.selectedPrinter.is_queue) {
|
|
32719
|
+
this.printProcessing = false;
|
|
32720
|
+
this.printSuccess = true;
|
|
32721
|
+
}
|
|
32712
32722
|
if (response.status === 412) {
|
|
32713
32723
|
response.json().then((data) => (this.fileid = data.fileid));
|
|
32714
32724
|
this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename);
|
|
@@ -32839,7 +32849,6 @@ let EzpPrinterSelection = class {
|
|
|
32839
32849
|
await this.printService
|
|
32840
32850
|
.getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
|
|
32841
32851
|
.then((data) => (this.selectedPrinterConfig = data[0]));
|
|
32842
|
-
console.log(this.selectedPrinterConfig);
|
|
32843
32852
|
this.setDefaultPaperFormat();
|
|
32844
32853
|
break;
|
|
32845
32854
|
case 'color':
|
|
@@ -33002,7 +33011,7 @@ let EzpPrinterSelection = class {
|
|
|
33002
33011
|
? i18next.t('printer_selection.prepare_upload')
|
|
33003
33012
|
: this.uploading
|
|
33004
33013
|
? i18next.t('printer_selection.uploading')
|
|
33005
|
-
: i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.printSuccess ? (index.h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.
|
|
33014
|
+
: i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.selectedPrinter.is_queue && this.printSuccess ? (index.h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.pull_print_success'), instance: "print-success", close: true })) : this.printSuccess ? (index.h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.noPrinters ? (index.h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)), index.h("div", { id: "header" }, index.h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }), index.h("ezp-label", { text: !this.notSupported ? this.filename : '', ellipsis: true }), !this.hidemenu && (index.h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu }))), index.h("div", { id: "body" }, index.h("div", { id: "printer" }, index.h("ezp-select", { label: i18next.t('printer_selection.printer'), icon: "printer", placeholder: this.printers.length > 0
|
|
33006
33015
|
? i18next.t('printer_selection.select_printer')
|
|
33007
33016
|
: i18next.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
|
|
33008
33017
|
id: printer.id,
|
|
@@ -33099,14 +33108,17 @@ let EzpPrinting = class {
|
|
|
33099
33108
|
/** Description... */
|
|
33100
33109
|
listenPrintCancel() {
|
|
33101
33110
|
this.printOpen = false;
|
|
33111
|
+
this.checkAuth();
|
|
33102
33112
|
}
|
|
33103
33113
|
/** Description... */
|
|
33104
33114
|
listenPrintSubmit() {
|
|
33105
33115
|
this.printOpen = false;
|
|
33116
|
+
this.checkAuth();
|
|
33106
33117
|
}
|
|
33107
33118
|
/** Description... */
|
|
33108
33119
|
listenAuthCancel() {
|
|
33109
33120
|
this.authOpen = false;
|
|
33121
|
+
this.checkAuth();
|
|
33110
33122
|
}
|
|
33111
33123
|
listenAuthSuccess() {
|
|
33112
33124
|
if (this.onlyGetSasUri) {
|
|
@@ -33141,7 +33153,8 @@ let EzpPrinting = class {
|
|
|
33141
33153
|
*
|
|
33142
33154
|
*/
|
|
33143
33155
|
async open() {
|
|
33144
|
-
if (authStore.state.isAuthorized) {
|
|
33156
|
+
if (authStore.state.isAuthorized && this.trigger === 'file') {
|
|
33157
|
+
this.authOpen = true;
|
|
33145
33158
|
if (this.filename) {
|
|
33146
33159
|
this.printOpen = true;
|
|
33147
33160
|
}
|
|
@@ -33225,8 +33238,8 @@ let EzpPrinting = class {
|
|
|
33225
33238
|
else {
|
|
33226
33239
|
printStore.state.printApiHostUrl = config.printingApiHostUrl;
|
|
33227
33240
|
}
|
|
33228
|
-
initi18n(this.language);
|
|
33229
33241
|
sendCodeToParentWindow();
|
|
33242
|
+
initi18n(this.language);
|
|
33230
33243
|
this.checkAuth();
|
|
33231
33244
|
}
|
|
33232
33245
|
componentDidLoad() {
|
|
@@ -33240,7 +33253,7 @@ let EzpPrinting = class {
|
|
|
33240
33253
|
render() {
|
|
33241
33254
|
return (index.h(index.Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
33242
33255
|
? this.systemAppearance
|
|
33243
|
-
: userStore.state.appearance}` }, this.authOpen ? (index.h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (index.h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (index.h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null
|
|
33256
|
+
: userStore.state.appearance}` }, this.trigger === 'custom' ? (index.h("slot", null)) : this.trigger === 'file' ? (index.h("ezp-upload", null)) : (this.trigger === 'button' && (index.h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))), this.authOpen ? (index.h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (index.h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (index.h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
|
|
33244
33257
|
}
|
|
33245
33258
|
};
|
|
33246
33259
|
EzpPrinting.style = ezpPrintingCss;
|
|
@@ -33572,6 +33585,7 @@ let EzpUpload = class {
|
|
|
33572
33585
|
* States
|
|
33573
33586
|
*
|
|
33574
33587
|
*/
|
|
33588
|
+
this.filename = '';
|
|
33575
33589
|
this.dragging = false;
|
|
33576
33590
|
/**
|
|
33577
33591
|
*
|
|
@@ -33579,6 +33593,7 @@ let EzpUpload = class {
|
|
|
33579
33593
|
*
|
|
33580
33594
|
*/
|
|
33581
33595
|
this.handleInput = () => {
|
|
33596
|
+
this.filename = this.input.files[0].name;
|
|
33582
33597
|
this.uploadFile.emit(this.input.files);
|
|
33583
33598
|
};
|
|
33584
33599
|
}
|
|
@@ -33602,10 +33617,12 @@ let EzpUpload = class {
|
|
|
33602
33617
|
event.stopPropagation();
|
|
33603
33618
|
event.preventDefault();
|
|
33604
33619
|
this.dragging = false;
|
|
33620
|
+
this.filename = event.dataTransfer.files[0].name;
|
|
33605
33621
|
this.uploadFile.emit(event.dataTransfer.files);
|
|
33606
33622
|
}
|
|
33607
33623
|
listenPrintCancel() {
|
|
33608
33624
|
this.form.reset();
|
|
33625
|
+
this.filename = '';
|
|
33609
33626
|
}
|
|
33610
33627
|
/**
|
|
33611
33628
|
*
|
|
@@ -33613,7 +33630,7 @@ let EzpUpload = class {
|
|
|
33613
33630
|
*
|
|
33614
33631
|
*/
|
|
33615
33632
|
render() {
|
|
33616
|
-
return (index.h(index.Host, { class: { dragging: this.dragging } }, index.h("form", { id: "form", ref: (form) => (this.form = form) }, index.h("div", { id: "header" }, index.h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), index.h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), index.h("div", { id: "meta" }, index.h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), index.h("label", { htmlFor: "input", id: "select" }, index.h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), index.h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }), index.h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') }))))));
|
|
33633
|
+
return (index.h(index.Host, { class: { dragging: this.dragging } }, index.h("form", { id: "form", ref: (form) => (this.form = form) }, index.h("div", { id: "header" }, index.h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), index.h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), index.h("div", { id: "meta" }, index.h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), index.h("label", { htmlFor: "input", id: "select" }, index.h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), index.h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }), index.h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') })), this.filename != '' && (index.h(index.Fragment, null, index.h("ezp-label", { level: "secondary", text: i18next.t('upload.selected_file') }), index.h("ezp-label", { level: "tertiary", text: this.filename })))))));
|
|
33617
33634
|
}
|
|
33618
33635
|
};
|
|
33619
33636
|
EzpUpload.style = ezpUploadCss;
|
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],"onlyGetSasUri":[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],"trigger":[1],"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"],[4,"printCancel","listenPrintCancel"]]],[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
|
+
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],"onlyGetSasUri":[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],"trigger":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"filename":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[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
|
|
|
@@ -17,6 +17,11 @@ export class EzpAuth {
|
|
|
17
17
|
this.authCancel.emit();
|
|
18
18
|
}
|
|
19
19
|
openSignInWindow(url, name) {
|
|
20
|
+
if (authStore.state.isAuthorized) {
|
|
21
|
+
this.authCancel.emit();
|
|
22
|
+
this.authSuccess.emit();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
20
25
|
// remove any existing event listeners
|
|
21
26
|
window.removeEventListener('message', this.receiveMessage);
|
|
22
27
|
// window features
|
|
@@ -68,7 +73,7 @@ export class EzpAuth {
|
|
|
68
73
|
}
|
|
69
74
|
}
|
|
70
75
|
render() {
|
|
71
|
-
return (h(Host, null, this.hidelogin && this.trigger === 'button' ? (h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : this.hidelogin && this.trigger === 'file' ? (h("ezp-text-button", { type: "button", level: "primary", onClick: () => this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login'), label: i18next.t('button_actions.
|
|
76
|
+
return (h(Host, null, this.hidelogin && this.trigger === 'button' ? (h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : this.hidelogin && this.trigger === 'file' ? (h("ezp-text-button", { type: "button", level: "primary", onClick: () => this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login'), label: i18next.t('button_actions.select_printer') })) : (h("ezp-dialog", { heading: i18next.t('login_dialog.heading'), description: i18next.t('login_dialog.description'), action: i18next.t('login_dialog.action'), iconName: "logo", iconSize: "huge", iconFramed: false, instance: "login" }))));
|
|
72
77
|
}
|
|
73
78
|
static get is() { return "ezp-auth"; }
|
|
74
79
|
static get encapsulation() { return "shadow"; }
|
|
@@ -93,6 +93,10 @@ export class EzpPrinterSelection {
|
|
|
93
93
|
this.printService
|
|
94
94
|
.printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename)
|
|
95
95
|
.then((response) => {
|
|
96
|
+
if (response.status === 200 && this.selectedPrinter.is_queue) {
|
|
97
|
+
this.printProcessing = false;
|
|
98
|
+
this.printSuccess = true;
|
|
99
|
+
}
|
|
96
100
|
if (response.status === 412) {
|
|
97
101
|
response.json().then((data) => (this.fileid = data.fileid));
|
|
98
102
|
this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename);
|
|
@@ -223,7 +227,6 @@ export class EzpPrinterSelection {
|
|
|
223
227
|
await this.printService
|
|
224
228
|
.getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
|
|
225
229
|
.then((data) => (this.selectedPrinterConfig = data[0]));
|
|
226
|
-
console.log(this.selectedPrinterConfig);
|
|
227
230
|
this.setDefaultPaperFormat();
|
|
228
231
|
break;
|
|
229
232
|
case 'color':
|
|
@@ -390,7 +393,7 @@ export class EzpPrinterSelection {
|
|
|
390
393
|
? i18next.t('printer_selection.prepare_upload')
|
|
391
394
|
: this.uploading
|
|
392
395
|
? i18next.t('printer_selection.uploading')
|
|
393
|
-
: i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.
|
|
396
|
+
: i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.selectedPrinter.is_queue && this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.pull_print_success'), instance: "print-success", close: true })) : this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)),
|
|
394
397
|
h("div", { id: "header" },
|
|
395
398
|
h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }),
|
|
396
399
|
h("ezp-label", { text: !this.notSupported ? this.filename : '', ellipsis: true }),
|
|
@@ -31,14 +31,17 @@ export class EzpPrinting {
|
|
|
31
31
|
/** Description... */
|
|
32
32
|
listenPrintCancel() {
|
|
33
33
|
this.printOpen = false;
|
|
34
|
+
this.checkAuth();
|
|
34
35
|
}
|
|
35
36
|
/** Description... */
|
|
36
37
|
listenPrintSubmit() {
|
|
37
38
|
this.printOpen = false;
|
|
39
|
+
this.checkAuth();
|
|
38
40
|
}
|
|
39
41
|
/** Description... */
|
|
40
42
|
listenAuthCancel() {
|
|
41
43
|
this.authOpen = false;
|
|
44
|
+
this.checkAuth();
|
|
42
45
|
}
|
|
43
46
|
listenAuthSuccess() {
|
|
44
47
|
if (this.onlyGetSasUri) {
|
|
@@ -73,7 +76,8 @@ export class EzpPrinting {
|
|
|
73
76
|
*
|
|
74
77
|
*/
|
|
75
78
|
async open() {
|
|
76
|
-
if (authStore.state.isAuthorized) {
|
|
79
|
+
if (authStore.state.isAuthorized && this.trigger === 'file') {
|
|
80
|
+
this.authOpen = true;
|
|
77
81
|
if (this.filename) {
|
|
78
82
|
this.printOpen = true;
|
|
79
83
|
}
|
|
@@ -157,8 +161,8 @@ export class EzpPrinting {
|
|
|
157
161
|
else {
|
|
158
162
|
printStore.state.printApiHostUrl = config.printingApiHostUrl;
|
|
159
163
|
}
|
|
160
|
-
initi18n(this.language);
|
|
161
164
|
sendCodeToParentWindow();
|
|
165
|
+
initi18n(this.language);
|
|
162
166
|
this.checkAuth();
|
|
163
167
|
}
|
|
164
168
|
componentDidLoad() {
|
|
@@ -173,8 +177,8 @@ export class EzpPrinting {
|
|
|
173
177
|
return (h(Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
174
178
|
? this.systemAppearance
|
|
175
179
|
: userStore.state.appearance}` },
|
|
176
|
-
this.
|
|
177
|
-
this.
|
|
180
|
+
this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))),
|
|
181
|
+
this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
|
|
178
182
|
}
|
|
179
183
|
static get is() { return "ezp-printing"; }
|
|
180
184
|
static get encapsulation() { return "shadow"; }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Host, Listen, Event, State, h } from '@stencil/core';
|
|
1
|
+
import { Component, Host, Listen, Event, State, h, Fragment } from '@stencil/core';
|
|
2
2
|
import i18next from 'i18next';
|
|
3
3
|
export class EzpUpload {
|
|
4
4
|
constructor() {
|
|
@@ -7,6 +7,7 @@ export class EzpUpload {
|
|
|
7
7
|
* States
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
+
this.filename = '';
|
|
10
11
|
this.dragging = false;
|
|
11
12
|
/**
|
|
12
13
|
*
|
|
@@ -14,6 +15,7 @@ export class EzpUpload {
|
|
|
14
15
|
*
|
|
15
16
|
*/
|
|
16
17
|
this.handleInput = () => {
|
|
18
|
+
this.filename = this.input.files[0].name;
|
|
17
19
|
this.uploadFile.emit(this.input.files);
|
|
18
20
|
};
|
|
19
21
|
}
|
|
@@ -37,10 +39,12 @@ export class EzpUpload {
|
|
|
37
39
|
event.stopPropagation();
|
|
38
40
|
event.preventDefault();
|
|
39
41
|
this.dragging = false;
|
|
42
|
+
this.filename = event.dataTransfer.files[0].name;
|
|
40
43
|
this.uploadFile.emit(event.dataTransfer.files);
|
|
41
44
|
}
|
|
42
45
|
listenPrintCancel() {
|
|
43
46
|
this.form.reset();
|
|
47
|
+
this.filename = '';
|
|
44
48
|
}
|
|
45
49
|
/**
|
|
46
50
|
*
|
|
@@ -58,7 +62,10 @@ export class EzpUpload {
|
|
|
58
62
|
h("label", { htmlFor: "input", id: "select" },
|
|
59
63
|
h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })),
|
|
60
64
|
h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }),
|
|
61
|
-
h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') }))
|
|
65
|
+
h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') })),
|
|
66
|
+
this.filename != '' && (h(Fragment, null,
|
|
67
|
+
h("ezp-label", { level: "secondary", text: i18next.t('upload.selected_file') }),
|
|
68
|
+
h("ezp-label", { level: "tertiary", text: this.filename })))))));
|
|
62
69
|
}
|
|
63
70
|
static get is() { return "ezp-upload"; }
|
|
64
71
|
static get encapsulation() { return "shadow"; }
|
|
@@ -69,6 +76,7 @@ export class EzpUpload {
|
|
|
69
76
|
"$": ["ezp-upload.css"]
|
|
70
77
|
}; }
|
|
71
78
|
static get states() { return {
|
|
79
|
+
"filename": {},
|
|
72
80
|
"dragging": {}
|
|
73
81
|
}; }
|
|
74
82
|
static get events() { return [{
|
|
@@ -2964,13 +2964,14 @@ const button_actions = {
|
|
|
2964
2964
|
cancel: "Cancel",
|
|
2965
2965
|
close: "Close",
|
|
2966
2966
|
retry: "Retry",
|
|
2967
|
-
|
|
2967
|
+
select_printer: "Select Printer"
|
|
2968
2968
|
};
|
|
2969
2969
|
const upload = {
|
|
2970
2970
|
description: "Drop a file here into the browser ",
|
|
2971
2971
|
meta_leading: "or",
|
|
2972
2972
|
meta_select: "select a file",
|
|
2973
|
-
meta_trailing: "to print with ezeep Blue."
|
|
2973
|
+
meta_trailing: "to print with ezeep Blue.",
|
|
2974
|
+
selected_file: "Selected File:"
|
|
2974
2975
|
};
|
|
2975
2976
|
const user_menu = {
|
|
2976
2977
|
theme: "Color theme",
|
|
@@ -3195,6 +3196,11 @@ let EzpAuth$1 = class extends HTMLElement {
|
|
|
3195
3196
|
this.authCancel.emit();
|
|
3196
3197
|
}
|
|
3197
3198
|
openSignInWindow(url, name) {
|
|
3199
|
+
if (authStore.state.isAuthorized) {
|
|
3200
|
+
this.authCancel.emit();
|
|
3201
|
+
this.authSuccess.emit();
|
|
3202
|
+
return;
|
|
3203
|
+
}
|
|
3198
3204
|
// remove any existing event listeners
|
|
3199
3205
|
window.removeEventListener('message', this.receiveMessage);
|
|
3200
3206
|
// window features
|
|
@@ -3246,7 +3252,7 @@ let EzpAuth$1 = class extends HTMLElement {
|
|
|
3246
3252
|
}
|
|
3247
3253
|
}
|
|
3248
3254
|
render() {
|
|
3249
|
-
return (h(Host, null, this.hidelogin && this.trigger === 'button' ? (h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : this.hidelogin && this.trigger === 'file' ? (h("ezp-text-button", { type: "button", level: "primary", onClick: () => this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login'), label: i18next.t('button_actions.
|
|
3255
|
+
return (h(Host, null, this.hidelogin && this.trigger === 'button' ? (h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : this.hidelogin && this.trigger === 'file' ? (h("ezp-text-button", { type: "button", level: "primary", onClick: () => this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login'), label: i18next.t('button_actions.select_printer') })) : (h("ezp-dialog", { heading: i18next.t('login_dialog.heading'), description: i18next.t('login_dialog.description'), action: i18next.t('login_dialog.action'), iconName: "logo", iconSize: "huge", iconFramed: false, instance: "login" }))));
|
|
3250
3256
|
}
|
|
3251
3257
|
static get style() { return ezpAuthCss; }
|
|
3252
3258
|
};
|
|
@@ -32732,6 +32738,10 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32732
32738
|
this.printService
|
|
32733
32739
|
.printFileByUrl(authStore.state.accessToken, this.fileurl, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename)
|
|
32734
32740
|
.then((response) => {
|
|
32741
|
+
if (response.status === 200 && this.selectedPrinter.is_queue) {
|
|
32742
|
+
this.printProcessing = false;
|
|
32743
|
+
this.printSuccess = true;
|
|
32744
|
+
}
|
|
32735
32745
|
if (response.status === 412) {
|
|
32736
32746
|
response.json().then((data) => (this.fileid = data.fileid));
|
|
32737
32747
|
this.printService.printByFileID(authStore.state.accessToken, this.fileid, this.filetype, this.selectedPrinter.id, cleanPrintProperties, this.filename);
|
|
@@ -32862,7 +32872,6 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
32862
32872
|
await this.printService
|
|
32863
32873
|
.getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
|
|
32864
32874
|
.then((data) => (this.selectedPrinterConfig = data[0]));
|
|
32865
|
-
console.log(this.selectedPrinterConfig);
|
|
32866
32875
|
this.setDefaultPaperFormat();
|
|
32867
32876
|
break;
|
|
32868
32877
|
case 'color':
|
|
@@ -33025,7 +33034,7 @@ let EzpPrinterSelection$1 = class extends HTMLElement {
|
|
|
33025
33034
|
? i18next.t('printer_selection.prepare_upload')
|
|
33026
33035
|
: this.uploading
|
|
33027
33036
|
? i18next.t('printer_selection.uploading')
|
|
33028
|
-
: i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.
|
|
33037
|
+
: i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: true })) : this.selectedPrinter.is_queue && this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.pull_print_success'), instance: "print-success", close: true })) : this.printSuccess ? (h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.print_success'), instance: "print-success", close: true })) : this.printFailed ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.print_failed'), instance: "print-failed", close: true, retry: true })) : this.notSupported ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.not_supported'), instance: "not-supported", retry: true })) : this.noPrinters ? (h("ezp-status", { icon: "exclamation-mark", description: i18next.t('printer_selection.no_printers'), instance: "no-printers", close: true })) : null)), h("div", { id: "header" }, h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }), h("ezp-label", { text: !this.notSupported ? this.filename : '', ellipsis: true }), !this.hidemenu && (h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu }))), h("div", { id: "body" }, h("div", { id: "printer" }, h("ezp-select", { label: i18next.t('printer_selection.printer'), icon: "printer", placeholder: this.printers.length > 0
|
|
33029
33038
|
? i18next.t('printer_selection.select_printer')
|
|
33030
33039
|
: i18next.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
|
|
33031
33040
|
id: printer.id,
|
|
@@ -33124,14 +33133,17 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33124
33133
|
/** Description... */
|
|
33125
33134
|
listenPrintCancel() {
|
|
33126
33135
|
this.printOpen = false;
|
|
33136
|
+
this.checkAuth();
|
|
33127
33137
|
}
|
|
33128
33138
|
/** Description... */
|
|
33129
33139
|
listenPrintSubmit() {
|
|
33130
33140
|
this.printOpen = false;
|
|
33141
|
+
this.checkAuth();
|
|
33131
33142
|
}
|
|
33132
33143
|
/** Description... */
|
|
33133
33144
|
listenAuthCancel() {
|
|
33134
33145
|
this.authOpen = false;
|
|
33146
|
+
this.checkAuth();
|
|
33135
33147
|
}
|
|
33136
33148
|
listenAuthSuccess() {
|
|
33137
33149
|
if (this.onlyGetSasUri) {
|
|
@@ -33166,7 +33178,8 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33166
33178
|
*
|
|
33167
33179
|
*/
|
|
33168
33180
|
async open() {
|
|
33169
|
-
if (authStore.state.isAuthorized) {
|
|
33181
|
+
if (authStore.state.isAuthorized && this.trigger === 'file') {
|
|
33182
|
+
this.authOpen = true;
|
|
33170
33183
|
if (this.filename) {
|
|
33171
33184
|
this.printOpen = true;
|
|
33172
33185
|
}
|
|
@@ -33250,8 +33263,8 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33250
33263
|
else {
|
|
33251
33264
|
printStore.state.printApiHostUrl = config.printingApiHostUrl;
|
|
33252
33265
|
}
|
|
33253
|
-
initi18n(this.language);
|
|
33254
33266
|
sendCodeToParentWindow();
|
|
33267
|
+
initi18n(this.language);
|
|
33255
33268
|
this.checkAuth();
|
|
33256
33269
|
}
|
|
33257
33270
|
componentDidLoad() {
|
|
@@ -33265,7 +33278,7 @@ let EzpPrinting$1 = class extends HTMLElement {
|
|
|
33265
33278
|
render() {
|
|
33266
33279
|
return (h(Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
33267
33280
|
? this.systemAppearance
|
|
33268
|
-
: userStore.state.appearance}` }, this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null
|
|
33281
|
+
: userStore.state.appearance}` }, this.trigger === 'custom' ? (h("slot", null)) : this.trigger === 'file' ? (h("ezp-upload", null)) : (this.trigger === 'button' && (h("ezp-icon-button", { id: "print-trigger", icon: "printer", slot: "trigger", type: "button", onClick: () => this.open() }))), this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, file: this.file, hidemenu: this.hidemenu })) : this.noDocumentOpen ? (h("ezp-dialog", { heading: i18next.t('no_document_dialog.heading'), description: i18next.t('no_document_dialog.description'), action: i18next.t('no_document_dialog.action'), iconName: "question-mark", instance: "no-document-selected" })) : null));
|
|
33269
33282
|
}
|
|
33270
33283
|
static get style() { return ezpPrintingCss; }
|
|
33271
33284
|
};
|
|
@@ -33607,6 +33620,7 @@ let EzpUpload$1 = class extends HTMLElement {
|
|
|
33607
33620
|
* States
|
|
33608
33621
|
*
|
|
33609
33622
|
*/
|
|
33623
|
+
this.filename = '';
|
|
33610
33624
|
this.dragging = false;
|
|
33611
33625
|
/**
|
|
33612
33626
|
*
|
|
@@ -33614,6 +33628,7 @@ let EzpUpload$1 = class extends HTMLElement {
|
|
|
33614
33628
|
*
|
|
33615
33629
|
*/
|
|
33616
33630
|
this.handleInput = () => {
|
|
33631
|
+
this.filename = this.input.files[0].name;
|
|
33617
33632
|
this.uploadFile.emit(this.input.files);
|
|
33618
33633
|
};
|
|
33619
33634
|
}
|
|
@@ -33637,10 +33652,12 @@ let EzpUpload$1 = class extends HTMLElement {
|
|
|
33637
33652
|
event.stopPropagation();
|
|
33638
33653
|
event.preventDefault();
|
|
33639
33654
|
this.dragging = false;
|
|
33655
|
+
this.filename = event.dataTransfer.files[0].name;
|
|
33640
33656
|
this.uploadFile.emit(event.dataTransfer.files);
|
|
33641
33657
|
}
|
|
33642
33658
|
listenPrintCancel() {
|
|
33643
33659
|
this.form.reset();
|
|
33660
|
+
this.filename = '';
|
|
33644
33661
|
}
|
|
33645
33662
|
/**
|
|
33646
33663
|
*
|
|
@@ -33648,7 +33665,7 @@ let EzpUpload$1 = class extends HTMLElement {
|
|
|
33648
33665
|
*
|
|
33649
33666
|
*/
|
|
33650
33667
|
render() {
|
|
33651
|
-
return (h(Host, { class: { dragging: this.dragging } }, h("form", { id: "form", ref: (form) => (this.form = form) }, h("div", { id: "header" }, h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), h("div", { id: "meta" }, h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), h("label", { htmlFor: "input", id: "select" }, h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }), h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') }))))));
|
|
33668
|
+
return (h(Host, { class: { dragging: this.dragging } }, h("form", { id: "form", ref: (form) => (this.form = form) }, h("div", { id: "header" }, h("ezp-icon", { name: "drag-drop", size: "huge", framed: true }), h("ezp-label", { weight: "strong", text: i18next.t('upload.description') }), h("div", { id: "meta" }, h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_leading') }), h("label", { htmlFor: "input", id: "select" }, h("ezp-label", { level: "tertiary", weight: "strong", text: i18next.t('upload.meta_select') })), h("input", { type: "file", name: "input", id: "input", ref: (input) => (this.input = input), onInput: this.handleInput }), h("ezp-label", { level: "tertiary", text: i18next.t('upload.meta_trailing') })), this.filename != '' && (h(Fragment, null, h("ezp-label", { level: "secondary", text: i18next.t('upload.selected_file') }), h("ezp-label", { level: "tertiary", text: this.filename })))))));
|
|
33652
33669
|
}
|
|
33653
33670
|
static get style() { return ezpUploadCss; }
|
|
33654
33671
|
};
|
|
@@ -33764,7 +33781,7 @@ const EzpSelect = /*@__PURE__*/proxyCustomElement(EzpSelect$1, [1,"ezp-select",{
|
|
|
33764
33781
|
const EzpStatus = /*@__PURE__*/proxyCustomElement(EzpStatus$1, [1,"ezp-status",{"description":[1],"processing":[4],"instance":[1],"icon":[1],"cancel":[8],"close":[8],"retry":[8]}]);
|
|
33765
33782
|
const EzpStepper = /*@__PURE__*/proxyCustomElement(EzpStepper$1, [1,"ezp-stepper",{"icon":[1],"label":[1],"max":[2],"min":[2],"canDecrease":[32],"canIncrease":[32],"focused":[32],"value":[32]}]);
|
|
33766
33783
|
const EzpTextButton = /*@__PURE__*/proxyCustomElement(EzpTextButton$1, [1,"ezp-text-button",{"blank":[4],"disabled":[4],"href":[1],"level":[1],"label":[1],"type":[1],"small":[4]}]);
|
|
33767
|
-
const EzpUpload = /*@__PURE__*/proxyCustomElement(EzpUpload$1, [1,"ezp-upload",{"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]]);
|
|
33784
|
+
const EzpUpload = /*@__PURE__*/proxyCustomElement(EzpUpload$1, [1,"ezp-upload",{"filename":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]]);
|
|
33768
33785
|
const EzpUserMenu = /*@__PURE__*/proxyCustomElement(EzpUserMenu$1, [1,"ezp-user-menu",{"name":[1],"open":[1028]}]);
|
|
33769
33786
|
const defineCustomElements = (opts) => {
|
|
33770
33787
|
if (typeof customElements !== 'undefined') {
|
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],"onlyGetSasUri":[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],"trigger":[1],"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"],[4,"printCancel","listenPrintCancel"]]],[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);
|
|
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],"onlyGetSasUri":[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],"trigger":[1],"auth":[32],"authURI":[32],"accessToken":[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]],[1,"ezp-upload",{"filename":[32],"dragging":[32]},[[1,"dragenter","handleDragEnter"],[0,"dragover","handleDragOver"],[1,"dragleave","handleDragLeave"],[0,"drop","handleDrop"],[4,"printCancel","listenPrintCancel"]]],[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
|
});
|