@ezeep/ezeep-js 1.0.266 → 1.0.268
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/app-globals-D7ISNeUi.js +16 -0
- package/dist/cjs/ezeep.cjs.js +43 -12
- package/dist/cjs/ezp-auth_15.cjs.entry.js +27964 -26035
- package/dist/cjs/index-dv_gozsq.js +4694 -0
- package/dist/cjs/loader.cjs.js +7 -17
- package/dist/collection/collection-manifest.json +19 -18
- package/dist/collection/components/ezp-auth/ezp-auth.js +266 -245
- package/dist/collection/components/ezp-backdrop/ezp-backdrop.js +93 -81
- package/dist/collection/components/ezp-dialog/ezp-dialog.js +226 -210
- package/dist/collection/components/ezp-icon/ezp-icon.js +117 -102
- package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +181 -159
- package/dist/collection/components/ezp-input/ezp-input.css +5 -5
- package/dist/collection/components/ezp-input/ezp-input.js +227 -205
- package/dist/collection/components/ezp-label/ezp-label.css +5 -5
- package/dist/collection/components/ezp-label/ezp-label.js +151 -132
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +5 -5
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +1118 -1107
- package/dist/collection/components/ezp-printing/ezp-printing.css +183 -125
- package/dist/collection/components/ezp-printing/ezp-printing.js +872 -807
- package/dist/collection/components/ezp-select/ezp-select.css +4 -4
- package/dist/collection/components/ezp-select/ezp-select.js +376 -351
- package/dist/collection/components/ezp-status/ezp-status.css +5 -5
- package/dist/collection/components/ezp-status/ezp-status.js +238 -223
- package/dist/collection/components/ezp-stepper/ezp-stepper.css +5 -5
- package/dist/collection/components/ezp-stepper/ezp-stepper.js +256 -243
- package/dist/collection/components/ezp-text-button/ezp-text-button.js +196 -174
- package/dist/collection/components/ezp-upload/ezp-upload.css +3 -25
- package/dist/collection/components/ezp-upload/ezp-upload.js +134 -141
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +5 -5
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +180 -185
- package/dist/collection/services/auth.js +133 -133
- package/dist/collection/services/print.js +167 -167
- package/dist/collection/services/user.js +16 -16
- package/dist/collection/shared/global.js +7 -7
- package/dist/collection/utils/utils.js +89 -89
- package/dist/components/auth.js +1 -0
- package/dist/components/ezp-auth.d.ts +11 -0
- package/dist/components/ezp-auth.js +1 -0
- package/dist/components/ezp-auth2.js +1 -0
- package/dist/components/ezp-backdrop.d.ts +11 -0
- package/dist/components/ezp-backdrop.js +1 -0
- package/dist/components/ezp-backdrop2.js +1 -0
- package/dist/components/ezp-dialog.d.ts +11 -0
- package/dist/components/ezp-dialog.js +1 -0
- package/dist/components/ezp-dialog2.js +1 -0
- package/dist/components/ezp-icon-button.d.ts +11 -0
- package/dist/components/ezp-icon-button.js +1 -0
- package/dist/components/ezp-icon-button2.js +1 -0
- package/dist/components/ezp-icon.d.ts +11 -0
- package/dist/components/ezp-icon.js +1 -0
- package/dist/components/ezp-icon2.js +1 -0
- package/dist/components/ezp-input.d.ts +11 -0
- package/dist/components/ezp-input.js +1 -0
- package/dist/components/ezp-input2.js +1 -0
- package/dist/components/ezp-label.d.ts +11 -0
- package/dist/components/ezp-label.js +1 -0
- package/dist/components/ezp-label2.js +1 -0
- package/dist/components/ezp-printer-selection.d.ts +11 -0
- package/dist/components/ezp-printer-selection.js +1 -0
- package/dist/components/ezp-printer-selection2.js +1 -0
- package/dist/components/ezp-printing.d.ts +11 -0
- package/dist/components/ezp-printing.js +1 -0
- package/dist/components/ezp-select.d.ts +11 -0
- package/dist/components/ezp-select.js +1 -0
- package/dist/components/ezp-select2.js +1 -0
- package/dist/components/ezp-status.d.ts +11 -0
- package/dist/components/ezp-status.js +1 -0
- package/dist/components/ezp-status2.js +1 -0
- package/dist/components/ezp-stepper.d.ts +11 -0
- package/dist/components/ezp-stepper.js +1 -0
- package/dist/components/ezp-stepper2.js +1 -0
- package/dist/components/ezp-text-button.d.ts +11 -0
- package/dist/components/ezp-text-button.js +1 -0
- package/dist/components/ezp-text-button2.js +1 -0
- package/dist/components/ezp-upload.d.ts +11 -0
- package/dist/components/ezp-upload.js +1 -0
- package/dist/components/ezp-upload2.js +1 -0
- package/dist/components/ezp-user-menu.d.ts +11 -0
- package/dist/components/ezp-user-menu.js +1 -0
- package/dist/components/ezp-user-menu2.js +1 -0
- package/dist/components/i18next.js +1 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/directives/angular-component-lib/utils.ts +33 -14
- package/dist/directives/proxies.ts +231 -111
- package/dist/esm/app-globals-CpP67t2l.js +14 -0
- package/dist/esm/ezeep.js +41 -12
- package/dist/esm/ezp-auth_15.entry.js +27967 -26036
- package/dist/esm/index-BTfWEHH9.js +4677 -0
- package/dist/esm/loader.js +7 -15
- package/dist/esm-es5/app-globals-CpP67t2l.js +1 -0
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_15.entry.js +2 -2
- package/dist/esm-es5/index-BTfWEHH9.js +13 -0
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/ezeep.js +16 -19
- package/dist/ezeep/p-5ok9OZMg.system.js +1 -0
- package/dist/ezeep/p-BTfWEHH9.js +2 -0
- package/dist/ezeep/p-CfQRcOh8.system.js +1 -0
- package/dist/ezeep/p-CpP67t2l.js +1 -0
- package/dist/ezeep/p-DhXN1yGM.system.js +13 -0
- package/dist/ezeep/p-ba70b358.entry.js +1 -0
- package/dist/ezeep/p-f3ad7583.system.entry.js +7 -0
- package/dist/types/components/ezp-auth/ezp-auth.d.ts +20 -20
- package/dist/types/components/ezp-backdrop/ezp-backdrop.d.ts +7 -7
- package/dist/types/components/ezp-dialog/ezp-dialog.d.ts +38 -38
- package/dist/types/components/ezp-icon/ezp-icon.d.ts +24 -24
- package/dist/types/components/ezp-icon-button/ezp-icon-button.d.ts +23 -23
- package/dist/types/components/ezp-input/ezp-input.d.ts +38 -38
- package/dist/types/components/ezp-label/ezp-label.d.ts +21 -21
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +116 -116
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +83 -83
- package/dist/types/components/ezp-select/ezp-select.d.ts +80 -80
- package/dist/types/components/ezp-status/ezp-status.d.ts +40 -40
- package/dist/types/components/ezp-stepper/ezp-stepper.d.ts +65 -65
- package/dist/types/components/ezp-text-button/ezp-text-button.d.ts +25 -25
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +38 -38
- package/dist/types/components/ezp-user-menu/ezp-user-menu.d.ts +43 -43
- package/dist/types/components.d.ts +493 -50
- package/dist/types/services/auth.d.ts +27 -27
- package/dist/types/services/print.d.ts +32 -32
- package/dist/types/services/user.d.ts +4 -4
- package/dist/types/stencil-public-runtime.d.ts +335 -40
- package/dist/types/utils/utils.d.ts +6 -6
- package/loader/cdn.js +1 -2
- package/loader/index.cjs.js +1 -2
- package/loader/index.d.ts +13 -1
- package/loader/index.es2017.js +1 -2
- package/loader/index.js +1 -2
- package/package.json +10 -10
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/ezeep.js +16 -19
- package/www/build/p-5ok9OZMg.system.js +1 -0
- package/www/build/p-8f4a7bc3.js +1 -0
- package/www/build/p-BTfWEHH9.js +2 -0
- package/www/build/p-CfQRcOh8.system.js +1 -0
- package/www/build/p-CpP67t2l.js +1 -0
- package/www/build/p-DhXN1yGM.system.js +13 -0
- package/www/build/p-ba70b358.entry.js +1 -0
- package/www/build/p-f3ad7583.system.entry.js +7 -0
- package/www/index.html +1 -1
- package/dist/cjs/app-globals-53afb196.js +0 -15
- package/dist/cjs/index-1f953145.js +0 -1482
- package/dist/custom-elements/index.d.ts +0 -129
- package/dist/custom-elements/index.js +0 -34555
- package/dist/esm/app-globals-28960cbc.js +0 -13
- package/dist/esm/index-3ac1b749.js +0 -1450
- package/dist/esm/polyfills/css-shim.js +0 -1
- package/dist/esm-es5/app-globals-28960cbc.js +0 -1
- package/dist/esm-es5/index-3ac1b749.js +0 -1
- package/dist/ezeep/p-0cc2026d.system.js +0 -1
- package/dist/ezeep/p-312f40d7.js +0 -1
- package/dist/ezeep/p-84bd195a.system.js +0 -1
- package/dist/ezeep/p-a4d37138.js +0 -1
- package/dist/ezeep/p-d3570133.system.entry.js +0 -7
- package/dist/ezeep/p-dcf9f118.entry.js +0 -1
- package/dist/ezeep/p-ded04529.system.js +0 -1
- package/loader/package.json +0 -10
- package/www/build/p-0cc2026d.system.js +0 -1
- package/www/build/p-312f40d7.js +0 -1
- package/www/build/p-84bd195a.system.js +0 -1
- package/www/build/p-a4d37138.js +0 -1
- package/www/build/p-d3570133.system.entry.js +0 -7
- package/www/build/p-dcf9f118.entry.js +0 -1
- package/www/build/p-ded04529.system.js +0 -1
- /package/dist/ezeep/{p-50ea2036.system.js → p-YWpyar7R.system.js} +0 -0
- /package/www/build/{p-50ea2036.system.js → p-YWpyar7R.system.js} +0 -0
|
@@ -1,817 +1,882 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import authStore, { EzpAuthorizationService, sendCodeToParentWindow } from
|
|
3
|
-
import printStore, { EzpPrintService } from
|
|
4
|
-
import userStore from
|
|
5
|
-
import config from
|
|
6
|
-
import i18next from
|
|
7
|
-
import { initi18n } from
|
|
1
|
+
import { Host, h, } from "@stencil/core";
|
|
2
|
+
import authStore, { EzpAuthorizationService, sendCodeToParentWindow } from "../../services/auth";
|
|
3
|
+
import printStore, { EzpPrintService } from "../../services/print";
|
|
4
|
+
import userStore from "../../services/user";
|
|
5
|
+
import config from "../../shared/config.json";
|
|
6
|
+
import i18next from "i18next";
|
|
7
|
+
import { initi18n } from "../../utils/utils";
|
|
8
8
|
export class EzpPrinting {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
constructor() {
|
|
10
|
+
this.filename = '';
|
|
11
|
+
this.hidemenu = false;
|
|
12
|
+
this.hideheader = false;
|
|
13
|
+
this.theme = 'cyan';
|
|
14
|
+
this.appearance = 'system';
|
|
15
|
+
this.language = '';
|
|
16
|
+
this.seamless = false;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* States
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
/** Description... */
|
|
23
|
+
this.printOpen = false;
|
|
24
|
+
this.authOpen = false;
|
|
25
|
+
this.onlyGetSasUri = false;
|
|
26
|
+
this.noDocumentOpen = false;
|
|
27
|
+
this.files = [];
|
|
28
|
+
}
|
|
29
|
+
/** Watchers */
|
|
30
|
+
watchFileData(newValue, oldValue) {
|
|
31
|
+
console.log(newValue);
|
|
32
|
+
if (newValue !== oldValue && newValue.length > 0) {
|
|
33
|
+
let array = new Uint8Array(newValue.length);
|
|
34
|
+
for (let i = 0; i < newValue.length; i++) {
|
|
35
|
+
array[i] = newValue.charCodeAt(i);
|
|
36
|
+
}
|
|
37
|
+
this.files = [new File([array], this.filename)];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
watchFilename(newValue, oldValue) {
|
|
41
|
+
if (newValue !== oldValue && newValue.length > 0) {
|
|
42
|
+
this.filename = newValue;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
watchFileUrl(newValue, oldValue) {
|
|
46
|
+
if (newValue !== oldValue && newValue.length > 0) {
|
|
47
|
+
this.fileurl = newValue;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
watchLanguage(newValue, oldValue) {
|
|
51
|
+
if (newValue !== oldValue && newValue.length > 0) {
|
|
52
|
+
this.language = newValue;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
17
55
|
/**
|
|
18
56
|
*
|
|
19
|
-
*
|
|
57
|
+
* Listeners
|
|
20
58
|
*
|
|
21
59
|
*/
|
|
22
60
|
/** Description... */
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
this.files = [];
|
|
65
|
-
this.filename = '';
|
|
66
|
-
// Emit printCancel to reset the upload component
|
|
67
|
-
const printCancelEvent = new CustomEvent('printCancel', {
|
|
68
|
-
bubbles: true,
|
|
69
|
-
detail: {},
|
|
70
|
-
});
|
|
71
|
-
document.dispatchEvent(printCancelEvent);
|
|
72
|
-
this.printFinished.emit();
|
|
73
|
-
}
|
|
74
|
-
/** Description... */
|
|
75
|
-
listenPrintSubmit() {
|
|
76
|
-
this.printOpen = false;
|
|
77
|
-
this.printFinished.emit();
|
|
78
|
-
this.checkAuth();
|
|
79
|
-
}
|
|
80
|
-
/** Description... */
|
|
81
|
-
listenAuthCancel() {
|
|
82
|
-
this.authOpen = false;
|
|
83
|
-
this.checkAuth();
|
|
84
|
-
}
|
|
85
|
-
listenUserCancel() {
|
|
86
|
-
this.authOpen = false;
|
|
87
|
-
// Clear the selected files and reset the upload component
|
|
88
|
-
this.files = [];
|
|
89
|
-
this.filename = '';
|
|
90
|
-
// Emit printCancel to reset the upload component
|
|
91
|
-
const printCancelEvent = new CustomEvent('printCancel', {
|
|
92
|
-
bubbles: true,
|
|
93
|
-
detail: {},
|
|
94
|
-
});
|
|
95
|
-
document.dispatchEvent(printCancelEvent);
|
|
96
|
-
this.checkAuth();
|
|
97
|
-
}
|
|
98
|
-
listenAuthSuccess() {
|
|
99
|
-
if (this.onlyGetSasUri) {
|
|
100
|
-
this.printOpen = false;
|
|
101
|
-
this.onlyGetSasUri = false;
|
|
102
|
-
}
|
|
103
|
-
else if (this.filename != '') {
|
|
104
|
-
this.printOpen = true;
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
this.noDocumentOpen = true;
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
listenUploadFile(event) {
|
|
111
|
-
this.files = event.detail;
|
|
112
|
-
this.filename = this.files.length > 0 ? this.files[0].name : '';
|
|
113
|
-
this.open();
|
|
114
|
-
}
|
|
115
|
-
listenDialogClose(event) {
|
|
116
|
-
if (event.detail === 'no-document-selected') {
|
|
117
|
-
this.noDocumentOpen = false;
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
listenDialogAction(event) {
|
|
121
|
-
if (event.detail === 'no-document-selected') {
|
|
122
|
-
this.noDocumentOpen = false;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
listenLogout() {
|
|
126
|
-
this.logOut();
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
*
|
|
130
|
-
* Public methods
|
|
131
|
-
*
|
|
132
|
-
*/
|
|
133
|
-
async open() {
|
|
134
|
-
// Always show auth dialog when files are uploaded to give users cancel option
|
|
135
|
-
// Even if already authenticated, show the auth component for consistency
|
|
136
|
-
this.authOpen = true;
|
|
137
|
-
}
|
|
138
|
-
async logOut() {
|
|
139
|
-
this.auth.revokeRefreshToken();
|
|
140
|
-
localStorage.removeItem('properties');
|
|
141
|
-
localStorage.removeItem('refreshToken');
|
|
142
|
-
localStorage.removeItem('access_token');
|
|
143
|
-
localStorage.removeItem('printer');
|
|
144
|
-
localStorage.removeItem('isAuthorized');
|
|
145
|
-
this.printOpen = false;
|
|
146
|
-
}
|
|
147
|
-
async getSasUri() {
|
|
148
|
-
this.onlyGetSasUri = true;
|
|
149
|
-
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
150
|
-
let response = await printService.prepareFileUpload(authStore.state.accessToken).catch(() => {
|
|
151
|
-
this.open();
|
|
152
|
-
return null;
|
|
153
|
-
});
|
|
154
|
-
if (response) {
|
|
155
|
-
const sasUri = response.sasUri;
|
|
156
|
-
return sasUri;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
async getAuthUri() {
|
|
160
|
-
this.auth.generateCodeVerifier();
|
|
161
|
-
await this.auth.generateCodeChallenge(authStore.state.codeVerifier);
|
|
162
|
-
this.auth.buildAuthURI();
|
|
163
|
-
return authStore.state.authUri;
|
|
164
|
-
}
|
|
165
|
-
async setAuthRefreshToken(refreshToken) {
|
|
166
|
-
// Store the refresh token in the same way as the component does in self-managed auth
|
|
167
|
-
authStore.state.refreshToken = refreshToken;
|
|
168
|
-
localStorage.setItem('refreshToken', refreshToken);
|
|
169
|
-
// Use the refresh token to obtain a valid access token
|
|
170
|
-
// This ensures the user doesn't see the login dialog
|
|
171
|
-
await this.auth.refreshTokens();
|
|
172
|
-
}
|
|
173
|
-
async checkAuth() {
|
|
174
|
-
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
175
|
-
let accessToken = authStore.state.accessToken;
|
|
176
|
-
if (accessToken === '') {
|
|
177
|
-
accessToken = localStorage.getItem('access_token');
|
|
178
|
-
authStore.state.accessToken = accessToken;
|
|
179
|
-
}
|
|
180
|
-
if (localStorage.getItem('isAuthorized')) {
|
|
181
|
-
authStore.state.isAuthorized = localStorage.getItem('isAuthorized') === 'true';
|
|
182
|
-
}
|
|
183
|
-
await printService
|
|
184
|
-
.getConfig(authStore.state.accessToken)
|
|
185
|
-
.then((response) => {
|
|
186
|
-
if (response.ok) {
|
|
187
|
-
authStore.state.isAuthorized = true;
|
|
188
|
-
}
|
|
189
|
-
if (!response.ok) {
|
|
190
|
-
authStore.state.isAuthorized = false;
|
|
191
|
-
throw new Error('http status ' + response.status);
|
|
192
|
-
}
|
|
193
|
-
})
|
|
194
|
-
.catch(() => {
|
|
195
|
-
authStore.state.isAuthorized = false;
|
|
196
|
-
});
|
|
197
|
-
localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
|
|
198
|
-
return authStore.state.isAuthorized;
|
|
199
|
-
}
|
|
200
|
-
/**
|
|
201
|
-
* Normalizes a URL or hostname to just the hostname without protocol
|
|
202
|
-
* Accepts both "hostname" and "https://hostname" formats
|
|
203
|
-
*/
|
|
204
|
-
normalizeHostUrl(hostUrl) {
|
|
205
|
-
if (!hostUrl) {
|
|
206
|
-
return hostUrl;
|
|
207
|
-
}
|
|
208
|
-
// If it starts with http:// or https://, extract just the hostname
|
|
209
|
-
try {
|
|
210
|
-
if (hostUrl.startsWith('http://') || hostUrl.startsWith('https://')) {
|
|
211
|
-
const url = new URL(hostUrl);
|
|
212
|
-
return url.host;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
catch (e) {
|
|
216
|
-
// If URL parsing fails, return the original value
|
|
217
|
-
console.warn('Failed to parse URL:', hostUrl, e);
|
|
218
|
-
}
|
|
219
|
-
// Return as-is if it's already just a hostname
|
|
220
|
-
return hostUrl;
|
|
221
|
-
}
|
|
222
|
-
refreshTokensPeriodically(seconds) {
|
|
223
|
-
const authService = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
224
|
-
setInterval(() => {
|
|
225
|
-
authService.refreshTokens();
|
|
226
|
-
}, seconds * 1000);
|
|
227
|
-
}
|
|
228
|
-
async componentWillLoad() {
|
|
229
|
-
const systemAppearanceDark = window.matchMedia('(prefers-color-scheme: dark)');
|
|
230
|
-
this.systemAppearance = systemAppearanceDark.matches ? 'dark' : 'light';
|
|
231
|
-
systemAppearanceDark.addEventListener('change', (event) => {
|
|
232
|
-
this.systemAppearance = event.matches ? 'dark' : 'light';
|
|
233
|
-
});
|
|
234
|
-
authStore.state.redirectUri = this.redirecturi;
|
|
235
|
-
userStore.state.theme = this.theme;
|
|
236
|
-
userStore.state.appearance = this.appearance;
|
|
237
|
-
if (this.authapihosturl) {
|
|
238
|
-
authStore.state.authApiHostUrl = this.normalizeHostUrl(this.authapihosturl);
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
authStore.state.authApiHostUrl = config.authApiHostUrl;
|
|
242
|
-
}
|
|
243
|
-
if (this.printapihosturl) {
|
|
244
|
-
printStore.state.printApiHostUrl = this.normalizeHostUrl(this.printapihosturl);
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
printStore.state.printApiHostUrl = config.printingApiHostUrl;
|
|
248
|
-
}
|
|
249
|
-
this.auth = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
250
|
-
sendCodeToParentWindow();
|
|
251
|
-
initi18n(this.language);
|
|
252
|
-
this.checkAuth();
|
|
253
|
-
}
|
|
254
|
-
componentDidLoad() {
|
|
255
|
-
this.refreshTokensPeriodically(1800);
|
|
256
|
-
}
|
|
257
|
-
/**
|
|
258
|
-
*
|
|
259
|
-
* Render method
|
|
260
|
-
*
|
|
261
|
-
*/
|
|
262
|
-
render() {
|
|
263
|
-
return (h(Host, { class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
264
|
-
? this.systemAppearance
|
|
265
|
-
: userStore.state.appearance} ${this.seamless ? 'seamless' : ''}` },
|
|
266
|
-
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() }))),
|
|
267
|
-
this.authOpen ? (h("ezp-auth", { clientID: this.clientid, redirectURI: this.redirecturi, hidelogin: this.hidelogin, trigger: this.trigger, code: this.code })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, files: this.files, hidemenu: this.hidemenu, hideheader: this.hideheader, seamless: this.seamless })) : 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));
|
|
268
|
-
}
|
|
269
|
-
static get is() { return "ezp-printing"; }
|
|
270
|
-
static get encapsulation() { return "shadow"; }
|
|
271
|
-
static get originalStyleUrls() { return {
|
|
272
|
-
"$": ["ezp-printing.scss"]
|
|
273
|
-
}; }
|
|
274
|
-
static get styleUrls() { return {
|
|
275
|
-
"$": ["ezp-printing.css"]
|
|
276
|
-
}; }
|
|
277
|
-
static get properties() { return {
|
|
278
|
-
"clientid": {
|
|
279
|
-
"type": "string",
|
|
280
|
-
"mutable": false,
|
|
281
|
-
"complexType": {
|
|
282
|
-
"original": "string",
|
|
283
|
-
"resolved": "string",
|
|
284
|
-
"references": {}
|
|
285
|
-
},
|
|
286
|
-
"required": false,
|
|
287
|
-
"optional": false,
|
|
288
|
-
"docs": {
|
|
289
|
-
"tags": [],
|
|
290
|
-
"text": ""
|
|
291
|
-
},
|
|
292
|
-
"attribute": "clientid",
|
|
293
|
-
"reflect": false
|
|
294
|
-
},
|
|
295
|
-
"redirecturi": {
|
|
296
|
-
"type": "string",
|
|
297
|
-
"mutable": false,
|
|
298
|
-
"complexType": {
|
|
299
|
-
"original": "string",
|
|
300
|
-
"resolved": "string",
|
|
301
|
-
"references": {}
|
|
302
|
-
},
|
|
303
|
-
"required": false,
|
|
304
|
-
"optional": false,
|
|
305
|
-
"docs": {
|
|
306
|
-
"tags": [],
|
|
307
|
-
"text": ""
|
|
308
|
-
},
|
|
309
|
-
"attribute": "redirecturi",
|
|
310
|
-
"reflect": false
|
|
311
|
-
},
|
|
312
|
-
"filename": {
|
|
313
|
-
"type": "string",
|
|
314
|
-
"mutable": true,
|
|
315
|
-
"complexType": {
|
|
316
|
-
"original": "string",
|
|
317
|
-
"resolved": "string",
|
|
318
|
-
"references": {}
|
|
319
|
-
},
|
|
320
|
-
"required": false,
|
|
321
|
-
"optional": false,
|
|
322
|
-
"docs": {
|
|
323
|
-
"tags": [],
|
|
324
|
-
"text": ""
|
|
325
|
-
},
|
|
326
|
-
"attribute": "filename",
|
|
327
|
-
"reflect": false,
|
|
328
|
-
"defaultValue": "''"
|
|
329
|
-
},
|
|
330
|
-
"fileurl": {
|
|
331
|
-
"type": "string",
|
|
332
|
-
"mutable": false,
|
|
333
|
-
"complexType": {
|
|
334
|
-
"original": "string",
|
|
335
|
-
"resolved": "string",
|
|
336
|
-
"references": {}
|
|
337
|
-
},
|
|
338
|
-
"required": false,
|
|
339
|
-
"optional": false,
|
|
340
|
-
"docs": {
|
|
341
|
-
"tags": [],
|
|
342
|
-
"text": ""
|
|
343
|
-
},
|
|
344
|
-
"attribute": "fileurl",
|
|
345
|
-
"reflect": false
|
|
346
|
-
},
|
|
347
|
-
"filetype": {
|
|
348
|
-
"type": "string",
|
|
349
|
-
"mutable": false,
|
|
350
|
-
"complexType": {
|
|
351
|
-
"original": "string",
|
|
352
|
-
"resolved": "string",
|
|
353
|
-
"references": {}
|
|
354
|
-
},
|
|
355
|
-
"required": false,
|
|
356
|
-
"optional": false,
|
|
357
|
-
"docs": {
|
|
358
|
-
"tags": [],
|
|
359
|
-
"text": ""
|
|
360
|
-
},
|
|
361
|
-
"attribute": "filetype",
|
|
362
|
-
"reflect": false
|
|
363
|
-
},
|
|
364
|
-
"custom": {
|
|
365
|
-
"type": "boolean",
|
|
366
|
-
"mutable": false,
|
|
367
|
-
"complexType": {
|
|
368
|
-
"original": "boolean",
|
|
369
|
-
"resolved": "boolean",
|
|
370
|
-
"references": {}
|
|
371
|
-
},
|
|
372
|
-
"required": false,
|
|
373
|
-
"optional": false,
|
|
374
|
-
"docs": {
|
|
375
|
-
"tags": [],
|
|
376
|
-
"text": ""
|
|
377
|
-
},
|
|
378
|
-
"attribute": "custom",
|
|
379
|
-
"reflect": false
|
|
380
|
-
},
|
|
381
|
-
"hidelogin": {
|
|
382
|
-
"type": "boolean",
|
|
383
|
-
"mutable": false,
|
|
384
|
-
"complexType": {
|
|
385
|
-
"original": "boolean",
|
|
386
|
-
"resolved": "boolean",
|
|
387
|
-
"references": {}
|
|
388
|
-
},
|
|
389
|
-
"required": false,
|
|
390
|
-
"optional": false,
|
|
391
|
-
"docs": {
|
|
392
|
-
"tags": [],
|
|
393
|
-
"text": ""
|
|
394
|
-
},
|
|
395
|
-
"attribute": "hidelogin",
|
|
396
|
-
"reflect": false
|
|
397
|
-
},
|
|
398
|
-
"hidemenu": {
|
|
399
|
-
"type": "boolean",
|
|
400
|
-
"mutable": false,
|
|
401
|
-
"complexType": {
|
|
402
|
-
"original": "boolean",
|
|
403
|
-
"resolved": "boolean",
|
|
404
|
-
"references": {}
|
|
405
|
-
},
|
|
406
|
-
"required": false,
|
|
407
|
-
"optional": false,
|
|
408
|
-
"docs": {
|
|
409
|
-
"tags": [],
|
|
410
|
-
"text": ""
|
|
411
|
-
},
|
|
412
|
-
"attribute": "hidemenu",
|
|
413
|
-
"reflect": false,
|
|
414
|
-
"defaultValue": "false"
|
|
415
|
-
},
|
|
416
|
-
"hideheader": {
|
|
417
|
-
"type": "boolean",
|
|
418
|
-
"mutable": false,
|
|
419
|
-
"complexType": {
|
|
420
|
-
"original": "boolean",
|
|
421
|
-
"resolved": "boolean",
|
|
422
|
-
"references": {}
|
|
423
|
-
},
|
|
424
|
-
"required": false,
|
|
425
|
-
"optional": false,
|
|
426
|
-
"docs": {
|
|
427
|
-
"tags": [],
|
|
428
|
-
"text": ""
|
|
429
|
-
},
|
|
430
|
-
"attribute": "hideheader",
|
|
431
|
-
"reflect": false,
|
|
432
|
-
"defaultValue": "false"
|
|
433
|
-
},
|
|
434
|
-
"authapihosturl": {
|
|
435
|
-
"type": "string",
|
|
436
|
-
"mutable": false,
|
|
437
|
-
"complexType": {
|
|
438
|
-
"original": "string",
|
|
439
|
-
"resolved": "string",
|
|
440
|
-
"references": {}
|
|
441
|
-
},
|
|
442
|
-
"required": false,
|
|
443
|
-
"optional": false,
|
|
444
|
-
"docs": {
|
|
445
|
-
"tags": [],
|
|
446
|
-
"text": ""
|
|
447
|
-
},
|
|
448
|
-
"attribute": "authapihosturl",
|
|
449
|
-
"reflect": false
|
|
450
|
-
},
|
|
451
|
-
"printapihosturl": {
|
|
452
|
-
"type": "string",
|
|
453
|
-
"mutable": false,
|
|
454
|
-
"complexType": {
|
|
455
|
-
"original": "string",
|
|
456
|
-
"resolved": "string",
|
|
457
|
-
"references": {}
|
|
458
|
-
},
|
|
459
|
-
"required": false,
|
|
460
|
-
"optional": false,
|
|
461
|
-
"docs": {
|
|
462
|
-
"tags": [],
|
|
463
|
-
"text": ""
|
|
464
|
-
},
|
|
465
|
-
"attribute": "printapihosturl",
|
|
466
|
-
"reflect": false
|
|
467
|
-
},
|
|
468
|
-
"theme": {
|
|
469
|
-
"type": "string",
|
|
470
|
-
"mutable": false,
|
|
471
|
-
"complexType": {
|
|
472
|
-
"original": "ThemeTypes",
|
|
473
|
-
"resolved": "\"blue\" | \"cyan\" | \"green\" | \"orange\" | \"pink\" | \"red\" | \"teal\" | \"violet\"",
|
|
474
|
-
"references": {
|
|
475
|
-
"ThemeTypes": {
|
|
476
|
-
"location": "import",
|
|
477
|
-
"path": "./../../shared/types"
|
|
478
|
-
}
|
|
61
|
+
listenPrintCancel() {
|
|
62
|
+
this.printOpen = false;
|
|
63
|
+
// Clear the selected files and reset the upload component
|
|
64
|
+
this.files = [];
|
|
65
|
+
this.filename = '';
|
|
66
|
+
// Emit printCancel to reset the upload component
|
|
67
|
+
const printCancelEvent = new CustomEvent('printCancel', {
|
|
68
|
+
bubbles: true,
|
|
69
|
+
detail: {},
|
|
70
|
+
});
|
|
71
|
+
document.dispatchEvent(printCancelEvent);
|
|
72
|
+
this.printFinished.emit();
|
|
73
|
+
}
|
|
74
|
+
/** Description... */
|
|
75
|
+
listenPrintSubmit() {
|
|
76
|
+
this.printOpen = false;
|
|
77
|
+
this.printFinished.emit();
|
|
78
|
+
this.checkAuth();
|
|
79
|
+
}
|
|
80
|
+
/** Description... */
|
|
81
|
+
listenAuthCancel() {
|
|
82
|
+
this.authOpen = false;
|
|
83
|
+
this.checkAuth();
|
|
84
|
+
}
|
|
85
|
+
listenUserCancel() {
|
|
86
|
+
this.authOpen = false;
|
|
87
|
+
// Clear the selected files and reset the upload component
|
|
88
|
+
this.files = [];
|
|
89
|
+
this.filename = '';
|
|
90
|
+
// Emit printCancel to reset the upload component
|
|
91
|
+
const printCancelEvent = new CustomEvent('printCancel', {
|
|
92
|
+
bubbles: true,
|
|
93
|
+
detail: {},
|
|
94
|
+
});
|
|
95
|
+
document.dispatchEvent(printCancelEvent);
|
|
96
|
+
this.checkAuth();
|
|
97
|
+
}
|
|
98
|
+
listenAuthSuccess() {
|
|
99
|
+
if (this.onlyGetSasUri) {
|
|
100
|
+
this.printOpen = false;
|
|
101
|
+
this.onlyGetSasUri = false;
|
|
479
102
|
}
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
"optional": false,
|
|
483
|
-
"docs": {
|
|
484
|
-
"tags": [],
|
|
485
|
-
"text": ""
|
|
486
|
-
},
|
|
487
|
-
"attribute": "theme",
|
|
488
|
-
"reflect": false,
|
|
489
|
-
"defaultValue": "'cyan'"
|
|
490
|
-
},
|
|
491
|
-
"fileid": {
|
|
492
|
-
"type": "string",
|
|
493
|
-
"mutable": false,
|
|
494
|
-
"complexType": {
|
|
495
|
-
"original": "string",
|
|
496
|
-
"resolved": "string",
|
|
497
|
-
"references": {}
|
|
498
|
-
},
|
|
499
|
-
"required": false,
|
|
500
|
-
"optional": false,
|
|
501
|
-
"docs": {
|
|
502
|
-
"tags": [],
|
|
503
|
-
"text": ""
|
|
504
|
-
},
|
|
505
|
-
"attribute": "fileid",
|
|
506
|
-
"reflect": false
|
|
507
|
-
},
|
|
508
|
-
"appearance": {
|
|
509
|
-
"type": "string",
|
|
510
|
-
"mutable": false,
|
|
511
|
-
"complexType": {
|
|
512
|
-
"original": "AppearanceTypes",
|
|
513
|
-
"resolved": "\"dark\" | \"light\" | \"system\"",
|
|
514
|
-
"references": {
|
|
515
|
-
"AppearanceTypes": {
|
|
516
|
-
"location": "import",
|
|
517
|
-
"path": "./../../shared/types"
|
|
518
|
-
}
|
|
103
|
+
else if (this.filename != '') {
|
|
104
|
+
this.printOpen = true;
|
|
519
105
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
"optional": false,
|
|
523
|
-
"docs": {
|
|
524
|
-
"tags": [],
|
|
525
|
-
"text": ""
|
|
526
|
-
},
|
|
527
|
-
"attribute": "appearance",
|
|
528
|
-
"reflect": false,
|
|
529
|
-
"defaultValue": "'system'"
|
|
530
|
-
},
|
|
531
|
-
"trigger": {
|
|
532
|
-
"type": "string",
|
|
533
|
-
"mutable": false,
|
|
534
|
-
"complexType": {
|
|
535
|
-
"original": "TriggerTypes",
|
|
536
|
-
"resolved": "\"button\" | \"custom\" | \"file\"",
|
|
537
|
-
"references": {
|
|
538
|
-
"TriggerTypes": {
|
|
539
|
-
"location": "import",
|
|
540
|
-
"path": "./../../shared/types"
|
|
541
|
-
}
|
|
106
|
+
else {
|
|
107
|
+
this.noDocumentOpen = true;
|
|
542
108
|
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
}
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
109
|
+
}
|
|
110
|
+
listenUploadFile(event) {
|
|
111
|
+
this.files = event.detail;
|
|
112
|
+
this.filename = this.files.length > 0 ? this.files[0].name : '';
|
|
113
|
+
this.open();
|
|
114
|
+
}
|
|
115
|
+
listenDialogClose(event) {
|
|
116
|
+
if (event.detail === 'no-document-selected') {
|
|
117
|
+
this.noDocumentOpen = false;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
listenDialogAction(event) {
|
|
121
|
+
if (event.detail === 'no-document-selected') {
|
|
122
|
+
this.noDocumentOpen = false;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
listenLogout() {
|
|
126
|
+
this.logOut();
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
*
|
|
130
|
+
* Public methods
|
|
131
|
+
*
|
|
132
|
+
*/
|
|
133
|
+
async open() {
|
|
134
|
+
// Always show auth dialog when files are uploaded to give users cancel option
|
|
135
|
+
// Even if already authenticated, show the auth component for consistency
|
|
136
|
+
this.authOpen = true;
|
|
137
|
+
}
|
|
138
|
+
async logOut() {
|
|
139
|
+
this.auth.revokeRefreshToken();
|
|
140
|
+
localStorage.removeItem('properties');
|
|
141
|
+
localStorage.removeItem('refreshToken');
|
|
142
|
+
localStorage.removeItem('access_token');
|
|
143
|
+
localStorage.removeItem('printer');
|
|
144
|
+
localStorage.removeItem('isAuthorized');
|
|
145
|
+
this.printOpen = false;
|
|
146
|
+
}
|
|
147
|
+
async getSasUri() {
|
|
148
|
+
this.onlyGetSasUri = true;
|
|
149
|
+
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
150
|
+
let response = await printService.prepareFileUpload(authStore.state.accessToken).catch(() => {
|
|
151
|
+
this.open();
|
|
152
|
+
return null;
|
|
153
|
+
});
|
|
154
|
+
if (response) {
|
|
155
|
+
const sasUri = response.sasUri;
|
|
156
|
+
return sasUri;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
async getAuthUri() {
|
|
160
|
+
this.auth.generateCodeVerifier();
|
|
161
|
+
await this.auth.generateCodeChallenge(authStore.state.codeVerifier);
|
|
162
|
+
this.auth.buildAuthURI();
|
|
163
|
+
return authStore.state.authUri;
|
|
164
|
+
}
|
|
165
|
+
async setAuthRefreshToken(refreshToken) {
|
|
166
|
+
// Store the refresh token in the same way as the component does in self-managed auth
|
|
167
|
+
authStore.state.refreshToken = refreshToken;
|
|
168
|
+
localStorage.setItem('refreshToken', refreshToken);
|
|
169
|
+
// Use the refresh token to obtain a valid access token
|
|
170
|
+
// This ensures the user doesn't see the login dialog
|
|
171
|
+
await this.auth.refreshTokens();
|
|
172
|
+
}
|
|
173
|
+
async checkAuth() {
|
|
174
|
+
const printService = new EzpPrintService(this.redirecturi, this.clientid);
|
|
175
|
+
let accessToken = authStore.state.accessToken;
|
|
176
|
+
if (accessToken === '') {
|
|
177
|
+
accessToken = localStorage.getItem('access_token');
|
|
178
|
+
authStore.state.accessToken = accessToken;
|
|
179
|
+
}
|
|
180
|
+
if (localStorage.getItem('isAuthorized')) {
|
|
181
|
+
authStore.state.isAuthorized = localStorage.getItem('isAuthorized') === 'true';
|
|
182
|
+
}
|
|
183
|
+
await printService
|
|
184
|
+
.getConfig(authStore.state.accessToken)
|
|
185
|
+
.then((response) => {
|
|
186
|
+
if (response.ok) {
|
|
187
|
+
authStore.state.isAuthorized = true;
|
|
188
|
+
}
|
|
189
|
+
if (!response.ok) {
|
|
190
|
+
authStore.state.isAuthorized = false;
|
|
191
|
+
throw new Error('http status ' + response.status);
|
|
192
|
+
}
|
|
193
|
+
})
|
|
194
|
+
.catch(() => {
|
|
195
|
+
authStore.state.isAuthorized = false;
|
|
196
|
+
});
|
|
197
|
+
localStorage.setItem('isAuthorized', authStore.state.isAuthorized.toString());
|
|
198
|
+
return authStore.state.isAuthorized;
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Normalizes a URL or hostname to just the hostname without protocol
|
|
202
|
+
* Accepts both "hostname" and "https://hostname" formats
|
|
203
|
+
*/
|
|
204
|
+
normalizeHostUrl(hostUrl) {
|
|
205
|
+
if (!hostUrl) {
|
|
206
|
+
return hostUrl;
|
|
207
|
+
}
|
|
208
|
+
// If it starts with http:// or https://, extract just the hostname
|
|
209
|
+
try {
|
|
210
|
+
if (hostUrl.startsWith('http://') || hostUrl.startsWith('https://')) {
|
|
211
|
+
const url = new URL(hostUrl);
|
|
212
|
+
return url.host;
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
catch (e) {
|
|
216
|
+
// If URL parsing fails, return the original value
|
|
217
|
+
console.warn('Failed to parse URL:', hostUrl, e);
|
|
218
|
+
}
|
|
219
|
+
// Return as-is if it's already just a hostname
|
|
220
|
+
return hostUrl;
|
|
221
|
+
}
|
|
222
|
+
refreshTokensPeriodically(seconds) {
|
|
223
|
+
const authService = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
224
|
+
setInterval(() => {
|
|
225
|
+
authService.refreshTokens();
|
|
226
|
+
}, seconds * 1000);
|
|
227
|
+
}
|
|
228
|
+
async componentWillLoad() {
|
|
229
|
+
const systemAppearanceDark = window.matchMedia('(prefers-color-scheme: dark)');
|
|
230
|
+
this.systemAppearance = systemAppearanceDark.matches ? 'dark' : 'light';
|
|
231
|
+
systemAppearanceDark.addEventListener('change', (event) => {
|
|
232
|
+
this.systemAppearance = event.matches ? 'dark' : 'light';
|
|
233
|
+
});
|
|
234
|
+
authStore.state.redirectUri = this.redirecturi;
|
|
235
|
+
userStore.state.theme = this.theme;
|
|
236
|
+
userStore.state.appearance = this.appearance;
|
|
237
|
+
if (this.authapihosturl) {
|
|
238
|
+
authStore.state.authApiHostUrl = this.normalizeHostUrl(this.authapihosturl);
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
authStore.state.authApiHostUrl = config.authApiHostUrl;
|
|
242
|
+
}
|
|
243
|
+
if (this.printapihosturl) {
|
|
244
|
+
printStore.state.printApiHostUrl = this.normalizeHostUrl(this.printapihosturl);
|
|
245
|
+
}
|
|
246
|
+
else {
|
|
247
|
+
printStore.state.printApiHostUrl = config.printingApiHostUrl;
|
|
248
|
+
}
|
|
249
|
+
this.auth = new EzpAuthorizationService(this.redirecturi, this.clientid);
|
|
250
|
+
sendCodeToParentWindow();
|
|
251
|
+
initi18n(this.language);
|
|
252
|
+
this.checkAuth();
|
|
253
|
+
}
|
|
254
|
+
componentDidLoad() {
|
|
255
|
+
this.refreshTokensPeriodically(1800);
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
*
|
|
259
|
+
* Render method
|
|
260
|
+
*
|
|
261
|
+
*/
|
|
262
|
+
render() {
|
|
263
|
+
return (h(Host, { key: 'd18dece1239b7557c5f80198637a828cbb4e820d', class: `${userStore.state.theme} ${userStore.state.appearance === 'system'
|
|
264
|
+
? this.systemAppearance
|
|
265
|
+
: userStore.state.appearance} ${this.seamless ? 'seamless' : ''}` }, 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, code: this.code })) : this.printOpen ? (h("ezp-printer-selection", { clientID: this.clientid, redirectURI: this.redirecturi, filename: this.filename, fileurl: this.fileurl, filetype: this.filetype, fileid: this.fileid, files: this.files, hidemenu: this.hidemenu, hideheader: this.hideheader, seamless: this.seamless })) : 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));
|
|
266
|
+
}
|
|
267
|
+
static get is() { return "ezp-printing"; }
|
|
268
|
+
static get encapsulation() { return "shadow"; }
|
|
269
|
+
static get originalStyleUrls() {
|
|
270
|
+
return {
|
|
271
|
+
"$": ["ezp-printing.scss"]
|
|
272
|
+
};
|
|
273
|
+
}
|
|
274
|
+
static get styleUrls() {
|
|
275
|
+
return {
|
|
276
|
+
"$": ["ezp-printing.css"]
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
static get properties() {
|
|
280
|
+
return {
|
|
281
|
+
"clientid": {
|
|
282
|
+
"type": "string",
|
|
283
|
+
"mutable": false,
|
|
284
|
+
"complexType": {
|
|
285
|
+
"original": "string",
|
|
286
|
+
"resolved": "string",
|
|
287
|
+
"references": {}
|
|
288
|
+
},
|
|
289
|
+
"required": false,
|
|
290
|
+
"optional": false,
|
|
291
|
+
"docs": {
|
|
292
|
+
"tags": [],
|
|
293
|
+
"text": ""
|
|
294
|
+
},
|
|
295
|
+
"getter": false,
|
|
296
|
+
"setter": false,
|
|
297
|
+
"reflect": false,
|
|
298
|
+
"attribute": "clientid"
|
|
299
|
+
},
|
|
300
|
+
"redirecturi": {
|
|
301
|
+
"type": "string",
|
|
302
|
+
"mutable": false,
|
|
303
|
+
"complexType": {
|
|
304
|
+
"original": "string",
|
|
305
|
+
"resolved": "string",
|
|
306
|
+
"references": {}
|
|
307
|
+
},
|
|
308
|
+
"required": false,
|
|
309
|
+
"optional": false,
|
|
310
|
+
"docs": {
|
|
311
|
+
"tags": [],
|
|
312
|
+
"text": ""
|
|
313
|
+
},
|
|
314
|
+
"getter": false,
|
|
315
|
+
"setter": false,
|
|
316
|
+
"reflect": false,
|
|
317
|
+
"attribute": "redirecturi"
|
|
318
|
+
},
|
|
319
|
+
"filename": {
|
|
320
|
+
"type": "string",
|
|
321
|
+
"mutable": true,
|
|
322
|
+
"complexType": {
|
|
323
|
+
"original": "string",
|
|
324
|
+
"resolved": "string",
|
|
325
|
+
"references": {}
|
|
326
|
+
},
|
|
327
|
+
"required": false,
|
|
328
|
+
"optional": false,
|
|
329
|
+
"docs": {
|
|
330
|
+
"tags": [],
|
|
331
|
+
"text": ""
|
|
332
|
+
},
|
|
333
|
+
"getter": false,
|
|
334
|
+
"setter": false,
|
|
335
|
+
"reflect": false,
|
|
336
|
+
"attribute": "filename",
|
|
337
|
+
"defaultValue": "''"
|
|
338
|
+
},
|
|
339
|
+
"fileurl": {
|
|
340
|
+
"type": "string",
|
|
341
|
+
"mutable": false,
|
|
342
|
+
"complexType": {
|
|
343
|
+
"original": "string",
|
|
344
|
+
"resolved": "string",
|
|
345
|
+
"references": {}
|
|
346
|
+
},
|
|
347
|
+
"required": false,
|
|
348
|
+
"optional": false,
|
|
349
|
+
"docs": {
|
|
350
|
+
"tags": [],
|
|
351
|
+
"text": ""
|
|
352
|
+
},
|
|
353
|
+
"getter": false,
|
|
354
|
+
"setter": false,
|
|
355
|
+
"reflect": false,
|
|
356
|
+
"attribute": "fileurl"
|
|
357
|
+
},
|
|
358
|
+
"filetype": {
|
|
359
|
+
"type": "string",
|
|
360
|
+
"mutable": false,
|
|
361
|
+
"complexType": {
|
|
362
|
+
"original": "string",
|
|
363
|
+
"resolved": "string",
|
|
364
|
+
"references": {}
|
|
365
|
+
},
|
|
366
|
+
"required": false,
|
|
367
|
+
"optional": false,
|
|
368
|
+
"docs": {
|
|
369
|
+
"tags": [],
|
|
370
|
+
"text": ""
|
|
371
|
+
},
|
|
372
|
+
"getter": false,
|
|
373
|
+
"setter": false,
|
|
374
|
+
"reflect": false,
|
|
375
|
+
"attribute": "filetype"
|
|
376
|
+
},
|
|
377
|
+
"custom": {
|
|
378
|
+
"type": "boolean",
|
|
379
|
+
"mutable": false,
|
|
380
|
+
"complexType": {
|
|
381
|
+
"original": "boolean",
|
|
382
|
+
"resolved": "boolean",
|
|
383
|
+
"references": {}
|
|
384
|
+
},
|
|
385
|
+
"required": false,
|
|
386
|
+
"optional": false,
|
|
387
|
+
"docs": {
|
|
388
|
+
"tags": [],
|
|
389
|
+
"text": ""
|
|
390
|
+
},
|
|
391
|
+
"getter": false,
|
|
392
|
+
"setter": false,
|
|
393
|
+
"reflect": false,
|
|
394
|
+
"attribute": "custom"
|
|
395
|
+
},
|
|
396
|
+
"hidelogin": {
|
|
397
|
+
"type": "boolean",
|
|
398
|
+
"mutable": false,
|
|
399
|
+
"complexType": {
|
|
400
|
+
"original": "boolean",
|
|
401
|
+
"resolved": "boolean",
|
|
402
|
+
"references": {}
|
|
403
|
+
},
|
|
404
|
+
"required": false,
|
|
405
|
+
"optional": false,
|
|
406
|
+
"docs": {
|
|
407
|
+
"tags": [],
|
|
408
|
+
"text": ""
|
|
409
|
+
},
|
|
410
|
+
"getter": false,
|
|
411
|
+
"setter": false,
|
|
412
|
+
"reflect": false,
|
|
413
|
+
"attribute": "hidelogin"
|
|
414
|
+
},
|
|
415
|
+
"hidemenu": {
|
|
416
|
+
"type": "boolean",
|
|
417
|
+
"mutable": false,
|
|
418
|
+
"complexType": {
|
|
419
|
+
"original": "boolean",
|
|
420
|
+
"resolved": "boolean",
|
|
421
|
+
"references": {}
|
|
422
|
+
},
|
|
423
|
+
"required": false,
|
|
424
|
+
"optional": false,
|
|
425
|
+
"docs": {
|
|
426
|
+
"tags": [],
|
|
427
|
+
"text": ""
|
|
428
|
+
},
|
|
429
|
+
"getter": false,
|
|
430
|
+
"setter": false,
|
|
431
|
+
"reflect": false,
|
|
432
|
+
"attribute": "hidemenu",
|
|
433
|
+
"defaultValue": "false"
|
|
434
|
+
},
|
|
435
|
+
"hideheader": {
|
|
436
|
+
"type": "boolean",
|
|
437
|
+
"mutable": false,
|
|
438
|
+
"complexType": {
|
|
439
|
+
"original": "boolean",
|
|
440
|
+
"resolved": "boolean",
|
|
441
|
+
"references": {}
|
|
442
|
+
},
|
|
443
|
+
"required": false,
|
|
444
|
+
"optional": false,
|
|
445
|
+
"docs": {
|
|
446
|
+
"tags": [],
|
|
447
|
+
"text": ""
|
|
448
|
+
},
|
|
449
|
+
"getter": false,
|
|
450
|
+
"setter": false,
|
|
451
|
+
"reflect": false,
|
|
452
|
+
"attribute": "hideheader",
|
|
453
|
+
"defaultValue": "false"
|
|
454
|
+
},
|
|
455
|
+
"authapihosturl": {
|
|
456
|
+
"type": "string",
|
|
457
|
+
"mutable": false,
|
|
458
|
+
"complexType": {
|
|
459
|
+
"original": "string",
|
|
460
|
+
"resolved": "string",
|
|
461
|
+
"references": {}
|
|
462
|
+
},
|
|
463
|
+
"required": false,
|
|
464
|
+
"optional": false,
|
|
465
|
+
"docs": {
|
|
466
|
+
"tags": [],
|
|
467
|
+
"text": ""
|
|
468
|
+
},
|
|
469
|
+
"getter": false,
|
|
470
|
+
"setter": false,
|
|
471
|
+
"reflect": false,
|
|
472
|
+
"attribute": "authapihosturl"
|
|
473
|
+
},
|
|
474
|
+
"printapihosturl": {
|
|
475
|
+
"type": "string",
|
|
476
|
+
"mutable": false,
|
|
477
|
+
"complexType": {
|
|
478
|
+
"original": "string",
|
|
479
|
+
"resolved": "string",
|
|
480
|
+
"references": {}
|
|
481
|
+
},
|
|
482
|
+
"required": false,
|
|
483
|
+
"optional": false,
|
|
484
|
+
"docs": {
|
|
485
|
+
"tags": [],
|
|
486
|
+
"text": ""
|
|
487
|
+
},
|
|
488
|
+
"getter": false,
|
|
489
|
+
"setter": false,
|
|
490
|
+
"reflect": false,
|
|
491
|
+
"attribute": "printapihosturl"
|
|
492
|
+
},
|
|
493
|
+
"theme": {
|
|
494
|
+
"type": "string",
|
|
495
|
+
"mutable": false,
|
|
496
|
+
"complexType": {
|
|
497
|
+
"original": "ThemeTypes",
|
|
498
|
+
"resolved": "\"blue\" | \"cyan\" | \"green\" | \"orange\" | \"pink\" | \"red\" | \"teal\" | \"violet\"",
|
|
499
|
+
"references": {
|
|
500
|
+
"ThemeTypes": {
|
|
501
|
+
"location": "import",
|
|
502
|
+
"path": "./../../shared/types",
|
|
503
|
+
"id": "src/shared/types.d.ts::ThemeTypes",
|
|
504
|
+
"referenceLocation": "ThemeTypes"
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
},
|
|
508
|
+
"required": false,
|
|
509
|
+
"optional": false,
|
|
510
|
+
"docs": {
|
|
511
|
+
"tags": [],
|
|
512
|
+
"text": ""
|
|
513
|
+
},
|
|
514
|
+
"getter": false,
|
|
515
|
+
"setter": false,
|
|
516
|
+
"reflect": false,
|
|
517
|
+
"attribute": "theme",
|
|
518
|
+
"defaultValue": "'cyan'"
|
|
519
|
+
},
|
|
520
|
+
"fileid": {
|
|
521
|
+
"type": "string",
|
|
522
|
+
"mutable": false,
|
|
523
|
+
"complexType": {
|
|
524
|
+
"original": "string",
|
|
525
|
+
"resolved": "string",
|
|
526
|
+
"references": {}
|
|
527
|
+
},
|
|
528
|
+
"required": false,
|
|
529
|
+
"optional": false,
|
|
530
|
+
"docs": {
|
|
531
|
+
"tags": [],
|
|
532
|
+
"text": ""
|
|
533
|
+
},
|
|
534
|
+
"getter": false,
|
|
535
|
+
"setter": false,
|
|
536
|
+
"reflect": false,
|
|
537
|
+
"attribute": "fileid"
|
|
538
|
+
},
|
|
539
|
+
"appearance": {
|
|
540
|
+
"type": "string",
|
|
541
|
+
"mutable": false,
|
|
542
|
+
"complexType": {
|
|
543
|
+
"original": "AppearanceTypes",
|
|
544
|
+
"resolved": "\"dark\" | \"light\" | \"system\"",
|
|
545
|
+
"references": {
|
|
546
|
+
"AppearanceTypes": {
|
|
547
|
+
"location": "import",
|
|
548
|
+
"path": "./../../shared/types",
|
|
549
|
+
"id": "src/shared/types.d.ts::AppearanceTypes",
|
|
550
|
+
"referenceLocation": "AppearanceTypes"
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
"required": false,
|
|
555
|
+
"optional": false,
|
|
556
|
+
"docs": {
|
|
557
|
+
"tags": [],
|
|
558
|
+
"text": ""
|
|
559
|
+
},
|
|
560
|
+
"getter": false,
|
|
561
|
+
"setter": false,
|
|
562
|
+
"reflect": false,
|
|
563
|
+
"attribute": "appearance",
|
|
564
|
+
"defaultValue": "'system'"
|
|
565
|
+
},
|
|
566
|
+
"trigger": {
|
|
567
|
+
"type": "string",
|
|
568
|
+
"mutable": false,
|
|
569
|
+
"complexType": {
|
|
570
|
+
"original": "TriggerTypes",
|
|
571
|
+
"resolved": "\"button\" | \"custom\" | \"file\"",
|
|
572
|
+
"references": {
|
|
573
|
+
"TriggerTypes": {
|
|
574
|
+
"location": "import",
|
|
575
|
+
"path": "./../../shared/types",
|
|
576
|
+
"id": "src/shared/types.d.ts::TriggerTypes",
|
|
577
|
+
"referenceLocation": "TriggerTypes"
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
},
|
|
581
|
+
"required": false,
|
|
582
|
+
"optional": false,
|
|
583
|
+
"docs": {
|
|
584
|
+
"tags": [],
|
|
585
|
+
"text": ""
|
|
586
|
+
},
|
|
587
|
+
"getter": false,
|
|
588
|
+
"setter": false,
|
|
589
|
+
"reflect": false,
|
|
590
|
+
"attribute": "trigger"
|
|
591
|
+
},
|
|
592
|
+
"language": {
|
|
593
|
+
"type": "string",
|
|
594
|
+
"mutable": false,
|
|
595
|
+
"complexType": {
|
|
596
|
+
"original": "string",
|
|
597
|
+
"resolved": "string",
|
|
598
|
+
"references": {}
|
|
599
|
+
},
|
|
600
|
+
"required": false,
|
|
601
|
+
"optional": false,
|
|
602
|
+
"docs": {
|
|
603
|
+
"tags": [],
|
|
604
|
+
"text": ""
|
|
605
|
+
},
|
|
606
|
+
"getter": false,
|
|
607
|
+
"setter": false,
|
|
608
|
+
"reflect": false,
|
|
609
|
+
"attribute": "language",
|
|
610
|
+
"defaultValue": "''"
|
|
611
|
+
},
|
|
612
|
+
"code": {
|
|
613
|
+
"type": "string",
|
|
614
|
+
"mutable": false,
|
|
615
|
+
"complexType": {
|
|
616
|
+
"original": "string",
|
|
617
|
+
"resolved": "string",
|
|
618
|
+
"references": {}
|
|
619
|
+
},
|
|
620
|
+
"required": false,
|
|
621
|
+
"optional": false,
|
|
622
|
+
"docs": {
|
|
623
|
+
"tags": [],
|
|
624
|
+
"text": ""
|
|
625
|
+
},
|
|
626
|
+
"getter": false,
|
|
627
|
+
"setter": false,
|
|
628
|
+
"reflect": false,
|
|
629
|
+
"attribute": "code"
|
|
630
|
+
},
|
|
631
|
+
"filedata": {
|
|
632
|
+
"type": "string",
|
|
633
|
+
"mutable": false,
|
|
634
|
+
"complexType": {
|
|
635
|
+
"original": "string",
|
|
636
|
+
"resolved": "string",
|
|
637
|
+
"references": {}
|
|
638
|
+
},
|
|
639
|
+
"required": false,
|
|
640
|
+
"optional": false,
|
|
641
|
+
"docs": {
|
|
642
|
+
"tags": [],
|
|
643
|
+
"text": ""
|
|
644
|
+
},
|
|
645
|
+
"getter": false,
|
|
646
|
+
"setter": false,
|
|
647
|
+
"reflect": false,
|
|
648
|
+
"attribute": "filedata"
|
|
649
|
+
},
|
|
650
|
+
"seamless": {
|
|
651
|
+
"type": "boolean",
|
|
652
|
+
"mutable": false,
|
|
653
|
+
"complexType": {
|
|
654
|
+
"original": "boolean",
|
|
655
|
+
"resolved": "boolean",
|
|
656
|
+
"references": {}
|
|
657
|
+
},
|
|
658
|
+
"required": false,
|
|
659
|
+
"optional": false,
|
|
660
|
+
"docs": {
|
|
661
|
+
"tags": [],
|
|
662
|
+
"text": ""
|
|
663
|
+
},
|
|
664
|
+
"getter": false,
|
|
665
|
+
"setter": false,
|
|
666
|
+
"reflect": false,
|
|
667
|
+
"attribute": "seamless",
|
|
668
|
+
"defaultValue": "false"
|
|
669
|
+
}
|
|
670
|
+
};
|
|
671
|
+
}
|
|
672
|
+
static get states() {
|
|
673
|
+
return {
|
|
674
|
+
"printOpen": {},
|
|
675
|
+
"authOpen": {},
|
|
676
|
+
"onlyGetSasUri": {},
|
|
677
|
+
"noDocumentOpen": {},
|
|
678
|
+
"systemAppearance": {},
|
|
679
|
+
"files": {}
|
|
680
|
+
};
|
|
681
|
+
}
|
|
682
|
+
static get events() {
|
|
683
|
+
return [{
|
|
684
|
+
"method": "printFinished",
|
|
685
|
+
"name": "printFinished",
|
|
686
|
+
"bubbles": true,
|
|
687
|
+
"cancelable": true,
|
|
688
|
+
"composed": true,
|
|
689
|
+
"docs": {
|
|
690
|
+
"tags": [],
|
|
691
|
+
"text": "Events"
|
|
692
|
+
},
|
|
693
|
+
"complexType": {
|
|
694
|
+
"original": "any",
|
|
695
|
+
"resolved": "any",
|
|
696
|
+
"references": {}
|
|
697
|
+
}
|
|
698
|
+
}];
|
|
699
|
+
}
|
|
700
|
+
static get methods() {
|
|
701
|
+
return {
|
|
702
|
+
"open": {
|
|
703
|
+
"complexType": {
|
|
704
|
+
"signature": "() => Promise<void>",
|
|
705
|
+
"parameters": [],
|
|
706
|
+
"references": {
|
|
707
|
+
"Promise": {
|
|
708
|
+
"location": "global",
|
|
709
|
+
"id": "global::Promise"
|
|
710
|
+
}
|
|
711
|
+
},
|
|
712
|
+
"return": "Promise<void>"
|
|
713
|
+
},
|
|
714
|
+
"docs": {
|
|
715
|
+
"text": "\nPublic methods",
|
|
716
|
+
"tags": []
|
|
717
|
+
}
|
|
718
|
+
},
|
|
719
|
+
"logOut": {
|
|
720
|
+
"complexType": {
|
|
721
|
+
"signature": "() => Promise<void>",
|
|
722
|
+
"parameters": [],
|
|
723
|
+
"references": {
|
|
724
|
+
"Promise": {
|
|
725
|
+
"location": "global",
|
|
726
|
+
"id": "global::Promise"
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
"return": "Promise<void>"
|
|
730
|
+
},
|
|
731
|
+
"docs": {
|
|
732
|
+
"text": "",
|
|
733
|
+
"tags": []
|
|
734
|
+
}
|
|
735
|
+
},
|
|
736
|
+
"getSasUri": {
|
|
737
|
+
"complexType": {
|
|
738
|
+
"signature": "() => Promise<string>",
|
|
739
|
+
"parameters": [],
|
|
740
|
+
"references": {
|
|
741
|
+
"Promise": {
|
|
742
|
+
"location": "global",
|
|
743
|
+
"id": "global::Promise"
|
|
744
|
+
}
|
|
745
|
+
},
|
|
746
|
+
"return": "Promise<string>"
|
|
747
|
+
},
|
|
748
|
+
"docs": {
|
|
749
|
+
"text": "",
|
|
750
|
+
"tags": []
|
|
751
|
+
}
|
|
752
|
+
},
|
|
753
|
+
"getAuthUri": {
|
|
754
|
+
"complexType": {
|
|
755
|
+
"signature": "() => Promise<string>",
|
|
756
|
+
"parameters": [],
|
|
757
|
+
"references": {
|
|
758
|
+
"Promise": {
|
|
759
|
+
"location": "global",
|
|
760
|
+
"id": "global::Promise"
|
|
761
|
+
}
|
|
762
|
+
},
|
|
763
|
+
"return": "Promise<string>"
|
|
764
|
+
},
|
|
765
|
+
"docs": {
|
|
766
|
+
"text": "",
|
|
767
|
+
"tags": []
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
"setAuthRefreshToken": {
|
|
771
|
+
"complexType": {
|
|
772
|
+
"signature": "(refreshToken: string) => Promise<void>",
|
|
773
|
+
"parameters": [{
|
|
774
|
+
"name": "refreshToken",
|
|
775
|
+
"type": "string",
|
|
776
|
+
"docs": ""
|
|
777
|
+
}],
|
|
778
|
+
"references": {
|
|
779
|
+
"Promise": {
|
|
780
|
+
"location": "global",
|
|
781
|
+
"id": "global::Promise"
|
|
782
|
+
}
|
|
783
|
+
},
|
|
784
|
+
"return": "Promise<void>"
|
|
785
|
+
},
|
|
786
|
+
"docs": {
|
|
787
|
+
"text": "",
|
|
788
|
+
"tags": []
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
"checkAuth": {
|
|
792
|
+
"complexType": {
|
|
793
|
+
"signature": "() => Promise<boolean>",
|
|
794
|
+
"parameters": [],
|
|
795
|
+
"references": {
|
|
796
|
+
"Promise": {
|
|
797
|
+
"location": "global",
|
|
798
|
+
"id": "global::Promise"
|
|
799
|
+
}
|
|
800
|
+
},
|
|
801
|
+
"return": "Promise<boolean>"
|
|
802
|
+
},
|
|
803
|
+
"docs": {
|
|
804
|
+
"text": "",
|
|
805
|
+
"tags": []
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
}
|
|
810
|
+
static get watchers() {
|
|
811
|
+
return [{
|
|
812
|
+
"propName": "filedata",
|
|
813
|
+
"methodName": "watchFileData"
|
|
814
|
+
}, {
|
|
815
|
+
"propName": "filename",
|
|
816
|
+
"methodName": "watchFilename"
|
|
817
|
+
}, {
|
|
818
|
+
"propName": "fileurl",
|
|
819
|
+
"methodName": "watchFileUrl"
|
|
820
|
+
}, {
|
|
821
|
+
"propName": "language",
|
|
822
|
+
"methodName": "watchLanguage"
|
|
823
|
+
}];
|
|
824
|
+
}
|
|
825
|
+
static get listeners() {
|
|
826
|
+
return [{
|
|
827
|
+
"name": "printCancel",
|
|
828
|
+
"method": "listenPrintCancel",
|
|
829
|
+
"target": undefined,
|
|
830
|
+
"capture": false,
|
|
831
|
+
"passive": false
|
|
832
|
+
}, {
|
|
833
|
+
"name": "printSubmit",
|
|
834
|
+
"method": "listenPrintSubmit",
|
|
835
|
+
"target": undefined,
|
|
836
|
+
"capture": false,
|
|
837
|
+
"passive": false
|
|
838
|
+
}, {
|
|
839
|
+
"name": "authCancel",
|
|
840
|
+
"method": "listenAuthCancel",
|
|
841
|
+
"target": undefined,
|
|
842
|
+
"capture": false,
|
|
843
|
+
"passive": false
|
|
844
|
+
}, {
|
|
845
|
+
"name": "userCancel",
|
|
846
|
+
"method": "listenUserCancel",
|
|
847
|
+
"target": undefined,
|
|
848
|
+
"capture": false,
|
|
849
|
+
"passive": false
|
|
850
|
+
}, {
|
|
851
|
+
"name": "authSuccess",
|
|
852
|
+
"method": "listenAuthSuccess",
|
|
853
|
+
"target": undefined,
|
|
854
|
+
"capture": false,
|
|
855
|
+
"passive": false
|
|
856
|
+
}, {
|
|
857
|
+
"name": "uploadFile",
|
|
858
|
+
"method": "listenUploadFile",
|
|
859
|
+
"target": undefined,
|
|
860
|
+
"capture": false,
|
|
861
|
+
"passive": false
|
|
862
|
+
}, {
|
|
863
|
+
"name": "dialogClose",
|
|
864
|
+
"method": "listenDialogClose",
|
|
865
|
+
"target": undefined,
|
|
866
|
+
"capture": false,
|
|
867
|
+
"passive": false
|
|
868
|
+
}, {
|
|
869
|
+
"name": "dialogAction",
|
|
870
|
+
"method": "listenDialogAction",
|
|
871
|
+
"target": undefined,
|
|
872
|
+
"capture": false,
|
|
873
|
+
"passive": false
|
|
874
|
+
}, {
|
|
875
|
+
"name": "logout",
|
|
876
|
+
"method": "listenLogout",
|
|
877
|
+
"target": undefined,
|
|
878
|
+
"capture": false,
|
|
879
|
+
"passive": false
|
|
880
|
+
}];
|
|
881
|
+
}
|
|
817
882
|
}
|