@ezeep/ezeep-js 1.0.164 → 1.0.167
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 +2 -2
- package/dist/cjs/ezp-auth_14.cjs.entry.js +78 -82
- package/dist/cjs/{index-baa7689a.js → index-0b159f85.js} +6 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/collection/components/ezp-auth/ezp-auth.css +2 -2
- package/dist/collection/components/ezp-auth/ezp-auth.js +25 -4
- package/dist/collection/components/ezp-backdrop/ezp-backdrop.css +1 -1
- package/dist/collection/components/ezp-dialog/ezp-dialog.css +5 -5
- package/dist/collection/components/ezp-icon/ezp-icon.css +1 -1
- package/dist/collection/components/ezp-icon-button/ezp-icon-button.css +16 -16
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +10 -9
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +30 -48
- package/dist/collection/components/ezp-printing/ezp-printing.css +203 -133
- package/dist/collection/components/ezp-printing/ezp-printing.js +20 -7
- package/dist/collection/components/ezp-select/ezp-select.css +21 -21
- package/dist/collection/components/ezp-select/ezp-select.js +5 -4
- package/dist/collection/components/ezp-status/ezp-status.css +7 -7
- package/dist/collection/components/ezp-status/ezp-status.js +2 -3
- package/dist/collection/components/ezp-stepper/ezp-stepper.css +12 -12
- package/dist/collection/components/ezp-text-button/ezp-text-button.css +14 -14
- package/dist/collection/components/ezp-upload/ezp-upload.css +6 -6
- package/dist/collection/components/ezp-upload/ezp-upload.js +9 -7
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +33 -29
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +1 -1
- package/dist/custom-elements/index.js +80 -84
- package/dist/directives/proxies.ts +2 -2
- package/dist/esm/ezeep.js +2 -2
- package/dist/esm/ezp-auth_14.entry.js +78 -82
- package/dist/esm/{index-18d4bf15.js → index-13f75d28.js} +6 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_14.entry.js +3 -3
- package/dist/esm-es5/index-13f75d28.js +1 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/ezeep.js +1 -1
- package/dist/ezeep/p-16c7584d.system.js +1 -0
- package/dist/ezeep/p-17f25f95.js +1 -0
- package/dist/ezeep/{p-a78a89f7.system.entry.js → p-9ac499ef.system.entry.js} +3 -3
- package/{www/build/p-2bac1003.entry.js → dist/ezeep/p-a84d0e34.entry.js} +2 -2
- package/dist/ezeep/p-c04b764e.system.js +1 -0
- package/dist/types/components/ezp-auth/ezp-auth.d.ts +1 -0
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +1 -0
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +1 -0
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +2 -6
- package/dist/types/components.d.ts +2 -0
- package/dist/types/shared/types.d.ts +3 -2
- package/package.json +3 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/ezeep.js +1 -1
- package/www/build/p-16c7584d.system.js +1 -0
- package/www/build/p-17f25f95.js +1 -0
- package/www/build/{p-a78a89f7.system.entry.js → p-9ac499ef.system.entry.js} +3 -3
- package/{dist/ezeep/p-2bac1003.entry.js → www/build/p-a84d0e34.entry.js} +2 -2
- package/www/build/p-c04b764e.system.js +1 -0
- package/www/data/locales/en.json +3 -1
- package/www/index.html +8 -1
- package/dist/esm-es5/index-18d4bf15.js +0 -1
- package/dist/ezeep/p-80d5c308.system.js +0 -1
- package/dist/ezeep/p-d9b69b53.js +0 -1
- package/dist/ezeep/p-f96ca6a7.system.js +0 -1
- package/www/build/p-80d5c308.system.js +0 -1
- package/www/build/p-d9b69b53.js +0 -1
- package/www/build/p-f96ca6a7.system.js +0 -1
|
@@ -51,7 +51,7 @@ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
|
|
|
51
51
|
const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
52
52
|
if (listeners) {
|
|
53
53
|
listeners.map(([flags, name, method]) => {
|
|
54
|
-
const target = elm;
|
|
54
|
+
const target = getHostListenerTarget(elm, flags) ;
|
|
55
55
|
const handler = hostListenerProxy(hostRef, method);
|
|
56
56
|
const opts = hostListenerOpts(flags);
|
|
57
57
|
plt.ael(target, name, handler, opts);
|
|
@@ -75,6 +75,11 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
75
75
|
consoleError(e);
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
+
const getHostListenerTarget = (elm, flags) => {
|
|
79
|
+
if (flags & 4 /* TargetDocument */)
|
|
80
|
+
return doc;
|
|
81
|
+
return elm;
|
|
82
|
+
};
|
|
78
83
|
// prettier-ignore
|
|
79
84
|
const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
|
|
80
85
|
const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-0b159f85.js');
|
|
6
6
|
const appGlobals = require('./app-globals-53afb196.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
@@ -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],"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
|
+
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
20
|
});
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*
|
|
5
5
|
*/
|
|
6
6
|
:host {
|
|
7
|
-
--ezp-
|
|
8
|
-
--ezp-
|
|
7
|
+
--ezp-theme-solid: var(--ezp-accent-cyan-solid);
|
|
8
|
+
--ezp-theme-translucent: var(--ezp-accent-cyan-translucent);
|
|
9
9
|
display: block;
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, Host, h, Prop, State, Event, Listen } from '@stencil/core';
|
|
1
|
+
import { Component, Host, h, Prop, State, Event, Listen, } from '@stencil/core';
|
|
2
2
|
import { EzpAuthorizationService } from '../../services/auth';
|
|
3
3
|
import authStore from '../../services/auth';
|
|
4
4
|
import i18next from 'i18next';
|
|
@@ -31,6 +31,11 @@ export class EzpAuth {
|
|
|
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
33
|
this.oauthPopupWindow = window.open(url, name, windowFeatures);
|
|
34
|
+
if (!this.oauthPopupWindow ||
|
|
35
|
+
this.oauthPopupWindow.closed ||
|
|
36
|
+
typeof this.oauthPopupWindow.closed == 'undefined') {
|
|
37
|
+
alert('popup blocked');
|
|
38
|
+
}
|
|
34
39
|
this.oauthPopupWindow.focus();
|
|
35
40
|
}
|
|
36
41
|
else {
|
|
@@ -58,13 +63,12 @@ export class EzpAuth {
|
|
|
58
63
|
await this.auth.generateCodeChallenge(authStore.state.codeVerifier);
|
|
59
64
|
this.auth.buildAuthURI();
|
|
60
65
|
}
|
|
61
|
-
if (this.hidelogin) {
|
|
66
|
+
if (this.hidelogin && this.trigger === 'button') {
|
|
62
67
|
this.openSignInWindow(this.auth.authURI.toString(), 'ezeep Login');
|
|
63
68
|
}
|
|
64
69
|
}
|
|
65
70
|
render() {
|
|
66
|
-
return this.hidelogin ? (h("ezp-status", { description: i18next.t('login_dialog.action'), processing: true, cancel: true })) : (h(
|
|
67
|
-
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" })));
|
|
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.next') })) : (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" }))));
|
|
68
72
|
}
|
|
69
73
|
static get is() { return "ezp-auth"; }
|
|
70
74
|
static get encapsulation() { return "shadow"; }
|
|
@@ -125,6 +129,23 @@ export class EzpAuth {
|
|
|
125
129
|
},
|
|
126
130
|
"attribute": "hidelogin",
|
|
127
131
|
"reflect": false
|
|
132
|
+
},
|
|
133
|
+
"trigger": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"mutable": false,
|
|
136
|
+
"complexType": {
|
|
137
|
+
"original": "string",
|
|
138
|
+
"resolved": "string",
|
|
139
|
+
"references": {}
|
|
140
|
+
},
|
|
141
|
+
"required": false,
|
|
142
|
+
"optional": false,
|
|
143
|
+
"docs": {
|
|
144
|
+
"tags": [],
|
|
145
|
+
"text": ""
|
|
146
|
+
},
|
|
147
|
+
"attribute": "trigger",
|
|
148
|
+
"reflect": false
|
|
128
149
|
}
|
|
129
150
|
}; }
|
|
130
151
|
static get states() { return {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
:host {
|
|
7
7
|
animation: var(--ezp-backdrop-animation-name, host-in) var(--ezp-duration-3) forwards var(--ezp-easing-out-quart);
|
|
8
|
-
background: var(--ezp-
|
|
8
|
+
background: var(--ezp-core-backdrop);
|
|
9
9
|
border-radius: 6px;
|
|
10
10
|
display: block;
|
|
11
11
|
height: 100%;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
:host {
|
|
2
|
-
--ezp-icon-fill: var(--ezp-
|
|
2
|
+
--ezp-icon-fill: var(--ezp-theme-solid);
|
|
3
3
|
align-content: center;
|
|
4
|
-
background: var(--ezp-
|
|
4
|
+
background: var(--ezp-core-backdrop);
|
|
5
5
|
display: grid;
|
|
6
6
|
grid-template: auto/minmax(auto, 280px);
|
|
7
7
|
height: 100%;
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
#box {
|
|
16
|
-
background: var(--ezp-
|
|
16
|
+
background: var(--ezp-core-surface-tertiary);
|
|
17
17
|
border-radius: 6px;
|
|
18
|
-
box-shadow: var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-
|
|
18
|
+
box-shadow: var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-black-10));
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
#header {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
#text {
|
|
37
|
-
color: var(--ezp-
|
|
37
|
+
color: var(--ezp-core-foreground-primary);
|
|
38
38
|
display: flex;
|
|
39
39
|
flex-direction: column;
|
|
40
40
|
gap: var(--ezp-spacing-4);
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
width: var(--ezp-icon-width, var(--ezp-icon-size));
|
|
16
16
|
}
|
|
17
17
|
:host(.framed) {
|
|
18
|
-
--ezp-icon-background: var(--ezp-
|
|
18
|
+
--ezp-icon-background: var(--ezp-core-shade-primary);
|
|
19
19
|
--ezp-icon-borderRadius: 50%;
|
|
20
20
|
--ezp-icon-padding: var(--ezp-icon-frame);
|
|
21
21
|
}
|
|
@@ -7,35 +7,35 @@
|
|
|
7
7
|
display: block;
|
|
8
8
|
}
|
|
9
9
|
:host(.primary) {
|
|
10
|
-
--ezp-iconButton-background-disabled: var(--ezp-
|
|
11
|
-
--ezp-iconButton-background-init: var(--ezp-
|
|
12
|
-
--ezp-iconButton-color-disabled: var(--ezp-
|
|
13
|
-
--ezp-iconButton-color-init: var(--ezp-
|
|
10
|
+
--ezp-iconButton-background-disabled: var(--ezp-core-shade-primary);
|
|
11
|
+
--ezp-iconButton-background-init: var(--ezp-theme-solid);
|
|
12
|
+
--ezp-iconButton-color-disabled: var(--ezp-core-foreground-tertiary);
|
|
13
|
+
--ezp-iconButton-color-init: var(--ezp-white-100);
|
|
14
14
|
--ezp-iconButton-opacity-active: 0.74;
|
|
15
15
|
--ezp-iconButton-opacity-hover: 0.84;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
:host(.secondary) {
|
|
19
|
-
--ezp-iconButton-background-active: var(--ezp-
|
|
20
|
-
--ezp-iconButton-background-disabled: var(--ezp-
|
|
21
|
-
--ezp-iconButton-background-hover: var(--ezp-
|
|
22
|
-
--ezp-iconButton-background-init: var(--ezp-
|
|
23
|
-
--ezp-iconButton-color-disabled: var(--ezp-
|
|
24
|
-
--ezp-iconButton-color-init: var(--ezp-
|
|
19
|
+
--ezp-iconButton-background-active: var(--ezp-core-shade-tertiary);
|
|
20
|
+
--ezp-iconButton-background-disabled: var(--ezp-core-shade-primary);
|
|
21
|
+
--ezp-iconButton-background-hover: var(--ezp-core-shade-secondary);
|
|
22
|
+
--ezp-iconButton-background-init: var(--ezp-core-shade-primary);
|
|
23
|
+
--ezp-iconButton-color-disabled: var(--ezp-core-foreground-tertiary);
|
|
24
|
+
--ezp-iconButton-color-init: var(--ezp-theme-solid);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
:host(.tertiary) {
|
|
28
|
-
--ezp-iconButton-background-active: var(--ezp-
|
|
29
|
-
--ezp-iconButton-background-hover: var(--ezp-
|
|
28
|
+
--ezp-iconButton-background-active: var(--ezp-core-shade-secondary);
|
|
29
|
+
--ezp-iconButton-background-hover: var(--ezp-core-shade-primary);
|
|
30
30
|
--ezp-iconButton-background-init: transparent;
|
|
31
|
-
--ezp-iconButton-color-disabled: var(--ezp-
|
|
32
|
-
--ezp-iconButton-color-init: var(--ezp-
|
|
31
|
+
--ezp-iconButton-color-disabled: var(--ezp-core-foreground-tertiary);
|
|
32
|
+
--ezp-iconButton-color-init: var(--ezp-theme-solid);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
:host(.quaternary) {
|
|
36
36
|
--ezp-iconButton-background-init: transparent;
|
|
37
|
-
--ezp-iconButton-color-disabled: var(--ezp-
|
|
38
|
-
--ezp-iconButton-color-init: var(--ezp-
|
|
37
|
+
--ezp-iconButton-color-disabled: var(--ezp-core-foreground-tertiary);
|
|
38
|
+
--ezp-iconButton-color-init: var(--ezp-theme-solid);
|
|
39
39
|
--ezp-iconButton-opacity-active: 0.58;
|
|
40
40
|
--ezp-iconButton-opacity-hover: 0.74;
|
|
41
41
|
}
|
|
@@ -30,30 +30,31 @@
|
|
|
30
30
|
*/
|
|
31
31
|
:host {
|
|
32
32
|
align-content: center;
|
|
33
|
-
background: var(--ezp-
|
|
33
|
+
background: var(--ezp-core-backdrop);
|
|
34
34
|
display: grid;
|
|
35
|
-
grid-template: auto/320px;
|
|
35
|
+
grid-template: auto/var(--ezp-printerSelection-width, 320px);
|
|
36
36
|
height: 100vh;
|
|
37
37
|
justify-content: center;
|
|
38
38
|
left: 0;
|
|
39
39
|
position: fixed;
|
|
40
40
|
top: 0;
|
|
41
41
|
width: 100vw;
|
|
42
|
+
z-index: 1;
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
#box {
|
|
45
|
-
background: var(--ezp-
|
|
46
|
+
background: var(--ezp-core-surface-tertiary);
|
|
46
47
|
border-radius: 6px;
|
|
47
|
-
box-shadow: var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-
|
|
48
|
+
box-shadow: var(--ezp-printerSelection-box-boxShadow, 0 0 0 1px var(--ezp-black-10));
|
|
48
49
|
position: relative;
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
#header {
|
|
52
53
|
border-radius: 6px 6px 0 0;
|
|
53
|
-
box-shadow: var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-
|
|
54
|
-
color: var(--ezp-
|
|
54
|
+
box-shadow: var(--ezp-printerSelection-header-boxShadowPosition, 0 1px 0 0) var(--ezp-core-outline);
|
|
55
|
+
color: var(--ezp-core-foreground-primary);
|
|
55
56
|
display: grid;
|
|
56
|
-
grid-column-gap: var(--ezp-spacing-
|
|
57
|
+
grid-column-gap: var(--ezp-spacing-2);
|
|
57
58
|
grid-template-columns: auto 1fr auto;
|
|
58
59
|
padding: var(--ezp-spacing-4) var(--ezp-spacing-3) var(--ezp-spacing-4) var(--ezp-spacing-4);
|
|
59
60
|
position: relative;
|
|
@@ -67,7 +68,7 @@
|
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
#body {
|
|
70
|
-
background: var(--ezp-
|
|
71
|
+
background: var(--ezp-core-surface-secondary);
|
|
71
72
|
box-shadow: var(--ezp-printerSelection-body-boxShadow, none);
|
|
72
73
|
display: flex;
|
|
73
74
|
flex-direction: column;
|
|
@@ -77,7 +78,7 @@
|
|
|
77
78
|
|
|
78
79
|
#footer {
|
|
79
80
|
border-radius: 0 0 6px 6px;
|
|
80
|
-
box-shadow: var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-
|
|
81
|
+
box-shadow: var(--ezp-printerSelection-footer-boxShadowPosition, 0 -1px 0 0) var(--ezp-core-outline);
|
|
81
82
|
display: grid;
|
|
82
83
|
grid-column-gap: var(--ezp-spacing-2);
|
|
83
84
|
grid-template-columns: repeat(2, 1fr);
|
|
@@ -50,11 +50,11 @@ export class EzpPrinterSelection {
|
|
|
50
50
|
paper: '',
|
|
51
51
|
paperid: '',
|
|
52
52
|
color: false,
|
|
53
|
-
duplex:
|
|
54
|
-
duplexmode:
|
|
55
|
-
orientation:
|
|
53
|
+
duplex: true,
|
|
54
|
+
duplexmode: 1,
|
|
55
|
+
orientation: 1,
|
|
56
56
|
copies: '',
|
|
57
|
-
resolution:
|
|
57
|
+
resolution: 0,
|
|
58
58
|
};
|
|
59
59
|
/**
|
|
60
60
|
*
|
|
@@ -74,9 +74,10 @@ export class EzpPrinterSelection {
|
|
|
74
74
|
return false;
|
|
75
75
|
};
|
|
76
76
|
this.POLL_INTERVAL = 2000;
|
|
77
|
-
this.MAX_POLL_ATTEMPTS =
|
|
77
|
+
this.MAX_POLL_ATTEMPTS = Infinity;
|
|
78
78
|
/** Description... */
|
|
79
79
|
this.handlePrint = async () => {
|
|
80
|
+
this.printButton.blur();
|
|
80
81
|
this.printProcessing = true;
|
|
81
82
|
// we have to initialse this obj with empty strings to display the select component
|
|
82
83
|
// but don't want to send any attributes with empty strings to the API
|
|
@@ -203,7 +204,7 @@ export class EzpPrinterSelection {
|
|
|
203
204
|
this.selectedPrinter = JSON.parse(localStorage.getItem('printer'));
|
|
204
205
|
}
|
|
205
206
|
else {
|
|
206
|
-
this.selectedPrinter = { id: '', location: '', name: '' };
|
|
207
|
+
this.selectedPrinter = { id: '', location: '', name: '', is_queue: false };
|
|
207
208
|
}
|
|
208
209
|
}
|
|
209
210
|
getUserInfo() {
|
|
@@ -218,9 +219,11 @@ export class EzpPrinterSelection {
|
|
|
218
219
|
case 'printer':
|
|
219
220
|
this.selectedPrinter.id = eventDetails.id;
|
|
220
221
|
this.selectedPrinter.name = eventDetails.title;
|
|
222
|
+
this.selectedPrinter.is_queue = eventDetails.is_queue;
|
|
221
223
|
await this.printService
|
|
222
224
|
.getPrinterProperties(authStore.state.accessToken, this.selectedPrinter.id)
|
|
223
225
|
.then((data) => (this.selectedPrinterConfig = data[0]));
|
|
226
|
+
console.log(this.selectedPrinterConfig);
|
|
224
227
|
this.setDefaultPaperFormat();
|
|
225
228
|
break;
|
|
226
229
|
case 'color':
|
|
@@ -325,8 +328,10 @@ export class EzpPrinterSelection {
|
|
|
325
328
|
else {
|
|
326
329
|
format = 'A4';
|
|
327
330
|
}
|
|
328
|
-
|
|
329
|
-
|
|
331
|
+
if (this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format))) {
|
|
332
|
+
this.selectedProperties.paper = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Name;
|
|
333
|
+
this.selectedProperties.paperid = this.selectedPrinterConfig.PaperFormats.find((el) => el.Name.includes(format)).Id;
|
|
334
|
+
}
|
|
330
335
|
}
|
|
331
336
|
/**
|
|
332
337
|
*
|
|
@@ -385,10 +390,10 @@ export class EzpPrinterSelection {
|
|
|
385
390
|
? i18next.t('printer_selection.prepare_upload')
|
|
386
391
|
: this.uploading
|
|
387
392
|
? i18next.t('printer_selection.uploading')
|
|
388
|
-
: i18next.t('printer_selection.print_processing'), instance: "print-processing", cancel: 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)),
|
|
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.print_success'), instance: "print-success", close: true })) : this.printSuccess && this.selectedPrinter.is_queue ? (h("ezp-status", { icon: "checkmark-alt", description: i18next.t('printer_selection.pull_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)),
|
|
389
394
|
h("div", { id: "header" },
|
|
390
395
|
h("ezp-label", { weight: "heavy", text: i18next.t('printer_selection.print') + `${!this.notSupported ? ':' : ''}` }),
|
|
391
|
-
h("ezp-label", { text: !this.notSupported ? this.filename : '' }),
|
|
396
|
+
h("ezp-label", { text: !this.notSupported ? this.filename : '', ellipsis: true }),
|
|
392
397
|
!this.hidemenu && (h("ezp-icon-button", { level: "tertiary", icon: "menu", id: "toggle-menu", type: "button", onClick: this.handleUserMenu }))),
|
|
393
398
|
h("div", { id: "body" },
|
|
394
399
|
h("div", { id: "printer" },
|
|
@@ -397,13 +402,10 @@ export class EzpPrinterSelection {
|
|
|
397
402
|
: i18next.t('printer_selection.no_printers'), toggleFlow: "vertical", optionFlow: "vertical", options: this.printers.map((printer) => ({
|
|
398
403
|
id: printer.id,
|
|
399
404
|
title: printer.name,
|
|
400
|
-
meta: printer.location !== ''
|
|
401
|
-
? printer.location
|
|
402
|
-
: i18next.t('printer_selection.unknown_location'),
|
|
405
|
+
meta: printer.location !== '' ? printer.location : '',
|
|
403
406
|
type: 'printer',
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
disabled: !(this.printers.length > 0) })),
|
|
407
|
+
is_queue: printer.is_queue,
|
|
408
|
+
})), preSelected: this.selectedPrinter.id ? this.selectedPrinter.name : null, disabled: !(this.printers.length > 0) })),
|
|
407
409
|
h("div", { id: "options" },
|
|
408
410
|
h("ezp-select", { label: i18next.t('printer_selection.color'), icon: "color", placeholder: i18next.t('printer_selection.select_color'), toggleFlow: "horizontal", options: this.selectedPrinterConfig.Color
|
|
409
411
|
? [
|
|
@@ -427,61 +429,41 @@ export class EzpPrinterSelection {
|
|
|
427
429
|
meta: '',
|
|
428
430
|
type: 'color',
|
|
429
431
|
},
|
|
430
|
-
],
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
// }
|
|
436
|
-
disabled: !this.selectedPrinterConfig.Color }),
|
|
432
|
+
], preSelected: this.selectedPrinter.id
|
|
433
|
+
? this.selectedProperties.color
|
|
434
|
+
? i18next.t('printer_selection.color_color')
|
|
435
|
+
: i18next.t('printer_selection.color_grayscale')
|
|
436
|
+
: null, disabled: !this.selectedPrinterConfig.Color }),
|
|
437
437
|
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) => ({
|
|
438
438
|
id: option.id,
|
|
439
439
|
title: option.title,
|
|
440
440
|
meta: '',
|
|
441
441
|
type: 'duplex',
|
|
442
|
-
})),
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
// ? this.duplexOptions.find(
|
|
446
|
-
// (option) => option.id === this.selectedProperties.duplexmode
|
|
447
|
-
// ).id
|
|
448
|
-
// : null
|
|
449
|
-
// }
|
|
450
|
-
disabled: !this.selectedPrinterConfig.DuplexSupported }),
|
|
442
|
+
})), preSelected: this.selectedPrinter.id && this.selectedProperties.duplex
|
|
443
|
+
? this.duplexOptions.find((option) => option.id === this.selectedProperties.duplexmode).id
|
|
444
|
+
: null, disabled: !this.selectedPrinterConfig.DuplexSupported }),
|
|
451
445
|
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) => ({
|
|
452
446
|
id: format.Id,
|
|
453
447
|
title: format.Name,
|
|
454
448
|
meta: `${format.XRes} x ${format.YRes}`,
|
|
455
449
|
type: 'format',
|
|
456
|
-
})),
|
|
457
|
-
// preSelected={this.selectedProperties.paper ? this.selectedProperties.paper : null}
|
|
458
|
-
disabled: !(this.selectedPrinterConfig.PaperFormats.length > 0) }),
|
|
450
|
+
})), preSelected: this.selectedPrinter.id ? this.selectedProperties.paper : null, disabled: !(this.selectedPrinterConfig.PaperFormats.length > 0) }),
|
|
459
451
|
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) => ({
|
|
460
452
|
id: index + 1,
|
|
461
453
|
title: i18next.t(`printer_selection.orientation_${orientation}`),
|
|
462
454
|
meta: '',
|
|
463
455
|
type: 'orientation',
|
|
464
|
-
})),
|
|
465
|
-
// preSelected={
|
|
466
|
-
// this.selectedProperties.orientation
|
|
467
|
-
// ? this.selectedProperties.orientation
|
|
468
|
-
// : null
|
|
469
|
-
// }
|
|
470
|
-
disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }),
|
|
456
|
+
})), preSelected: this.selectedPrinter.id ? this.selectedProperties.orientation : null, disabled: !(this.selectedPrinterConfig.OrientationsSupported.length > 0) }),
|
|
471
457
|
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) => ({
|
|
472
458
|
id: index,
|
|
473
459
|
title: option,
|
|
474
460
|
meta: '',
|
|
475
461
|
type: 'quality',
|
|
476
|
-
})),
|
|
477
|
-
// preSelected={
|
|
478
|
-
// this.selectedProperties.resolution ? this.selectedProperties.resolution : null
|
|
479
|
-
// }
|
|
480
|
-
disabled: !(this.selectedPrinterConfig.Resolutions.length > 0) })),
|
|
462
|
+
})), preSelected: this.selectedPrinter.id ? this.selectedProperties.resolution : null, disabled: !(this.selectedPrinterConfig.Resolutions.length > 0) })),
|
|
481
463
|
h("ezp-stepper", { label: i18next.t('printer_selection.copies'), max: 10, icon: "copies" })),
|
|
482
464
|
h("div", { id: "footer" },
|
|
483
465
|
h("ezp-text-button", { type: "button", level: "secondary", onClick: this.handleCancel, label: i18next.t('button_actions.cancel') }),
|
|
484
|
-
h("ezp-text-button", { disabled: this.selectedPrinter.id === '', type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print') })),
|
|
466
|
+
h("ezp-text-button", { disabled: this.selectedPrinter.id === '' || this.printProcessing, type: "button", onClick: this.handlePrint, label: i18next.t('button_actions.print'), ref: (button) => (this.printButton = button) })),
|
|
485
467
|
!this.hidemenu && h("ezp-user-menu", { open: this.userMenuOpen, name: this.userName }))));
|
|
486
468
|
}
|
|
487
469
|
static get is() { return "ezp-printer-selection"; }
|