@ezeep/ezeep-js 1.0.267 → 1.0.269

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.
Files changed (170) hide show
  1. package/dist/cjs/app-globals-D7ISNeUi.js +16 -0
  2. package/dist/cjs/ezeep.cjs.js +43 -12
  3. package/dist/cjs/ezp-auth_15.cjs.entry.js +27992 -26047
  4. package/dist/cjs/index-dv_gozsq.js +4694 -0
  5. package/dist/cjs/loader.cjs.js +7 -17
  6. package/dist/collection/collection-manifest.json +19 -18
  7. package/dist/collection/components/ezp-auth/ezp-auth.js +266 -245
  8. package/dist/collection/components/ezp-backdrop/ezp-backdrop.js +93 -81
  9. package/dist/collection/components/ezp-dialog/ezp-dialog.js +226 -210
  10. package/dist/collection/components/ezp-icon/ezp-icon.js +117 -102
  11. package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +181 -159
  12. package/dist/collection/components/ezp-input/ezp-input.css +5 -5
  13. package/dist/collection/components/ezp-input/ezp-input.js +227 -205
  14. package/dist/collection/components/ezp-label/ezp-label.css +5 -5
  15. package/dist/collection/components/ezp-label/ezp-label.js +151 -132
  16. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +5 -5
  17. package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +1134 -1107
  18. package/dist/collection/components/ezp-printing/ezp-printing.css +183 -125
  19. package/dist/collection/components/ezp-printing/ezp-printing.js +872 -807
  20. package/dist/collection/components/ezp-select/ezp-select.css +4 -4
  21. package/dist/collection/components/ezp-select/ezp-select.js +376 -351
  22. package/dist/collection/components/ezp-status/ezp-status.css +5 -5
  23. package/dist/collection/components/ezp-status/ezp-status.js +238 -223
  24. package/dist/collection/components/ezp-stepper/ezp-stepper.css +5 -5
  25. package/dist/collection/components/ezp-stepper/ezp-stepper.js +256 -243
  26. package/dist/collection/components/ezp-text-button/ezp-text-button.js +196 -174
  27. package/dist/collection/components/ezp-upload/ezp-upload.js +134 -141
  28. package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +5 -5
  29. package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +180 -185
  30. package/dist/collection/services/auth.js +133 -133
  31. package/dist/collection/services/print.js +167 -167
  32. package/dist/collection/services/user.js +16 -16
  33. package/dist/collection/shared/global.js +7 -7
  34. package/dist/collection/types/shared/types.d.ts +1 -0
  35. package/dist/collection/utils/utils.js +89 -89
  36. package/dist/components/auth.js +1 -0
  37. package/dist/components/ezp-auth.d.ts +11 -0
  38. package/dist/components/ezp-auth.js +1 -0
  39. package/dist/components/ezp-auth2.js +1 -0
  40. package/dist/components/ezp-backdrop.d.ts +11 -0
  41. package/dist/components/ezp-backdrop.js +1 -0
  42. package/dist/components/ezp-backdrop2.js +1 -0
  43. package/dist/components/ezp-dialog.d.ts +11 -0
  44. package/dist/components/ezp-dialog.js +1 -0
  45. package/dist/components/ezp-dialog2.js +1 -0
  46. package/dist/components/ezp-icon-button.d.ts +11 -0
  47. package/dist/components/ezp-icon-button.js +1 -0
  48. package/dist/components/ezp-icon-button2.js +1 -0
  49. package/dist/components/ezp-icon.d.ts +11 -0
  50. package/dist/components/ezp-icon.js +1 -0
  51. package/dist/components/ezp-icon2.js +1 -0
  52. package/dist/components/ezp-input.d.ts +11 -0
  53. package/dist/components/ezp-input.js +1 -0
  54. package/dist/components/ezp-input2.js +1 -0
  55. package/dist/components/ezp-label.d.ts +11 -0
  56. package/dist/components/ezp-label.js +1 -0
  57. package/dist/components/ezp-label2.js +1 -0
  58. package/dist/components/ezp-printer-selection.d.ts +11 -0
  59. package/dist/components/ezp-printer-selection.js +1 -0
  60. package/dist/components/ezp-printer-selection2.js +1 -0
  61. package/dist/components/ezp-printing.d.ts +11 -0
  62. package/dist/components/ezp-printing.js +1 -0
  63. package/dist/components/ezp-select.d.ts +11 -0
  64. package/dist/components/ezp-select.js +1 -0
  65. package/dist/components/ezp-select2.js +1 -0
  66. package/dist/components/ezp-status.d.ts +11 -0
  67. package/dist/components/ezp-status.js +1 -0
  68. package/dist/components/ezp-status2.js +1 -0
  69. package/dist/components/ezp-stepper.d.ts +11 -0
  70. package/dist/components/ezp-stepper.js +1 -0
  71. package/dist/components/ezp-stepper2.js +1 -0
  72. package/dist/components/ezp-text-button.d.ts +11 -0
  73. package/dist/components/ezp-text-button.js +1 -0
  74. package/dist/components/ezp-text-button2.js +1 -0
  75. package/dist/components/ezp-upload.d.ts +11 -0
  76. package/dist/components/ezp-upload.js +1 -0
  77. package/dist/components/ezp-upload2.js +1 -0
  78. package/dist/components/ezp-user-menu.d.ts +11 -0
  79. package/dist/components/ezp-user-menu.js +1 -0
  80. package/dist/components/ezp-user-menu2.js +1 -0
  81. package/dist/components/i18next.js +1 -0
  82. package/dist/components/index.d.ts +35 -0
  83. package/dist/components/index.js +1 -0
  84. package/dist/directives/angular-component-lib/utils.ts +33 -14
  85. package/dist/directives/proxies.ts +231 -111
  86. package/dist/esm/app-globals-CpP67t2l.js +14 -0
  87. package/dist/esm/ezeep.js +41 -12
  88. package/dist/esm/ezp-auth_15.entry.js +27996 -26049
  89. package/dist/esm/index-BTfWEHH9.js +4677 -0
  90. package/dist/esm/loader.js +7 -15
  91. package/dist/esm-es5/app-globals-CpP67t2l.js +1 -0
  92. package/dist/esm-es5/ezeep.js +1 -1
  93. package/dist/esm-es5/ezp-auth_15.entry.js +2 -2
  94. package/dist/esm-es5/index-BTfWEHH9.js +13 -0
  95. package/dist/esm-es5/loader.js +1 -1
  96. package/dist/ezeep/ezeep.esm.js +1 -1
  97. package/dist/ezeep/ezeep.js +16 -19
  98. package/dist/ezeep/p-2177b8f4.system.entry.js +7 -0
  99. package/dist/ezeep/p-5ok9OZMg.system.js +1 -0
  100. package/dist/ezeep/p-BTfWEHH9.js +2 -0
  101. package/dist/ezeep/p-CfQRcOh8.system.js +1 -0
  102. package/dist/ezeep/p-CpP67t2l.js +1 -0
  103. package/dist/ezeep/p-DhXN1yGM.system.js +13 -0
  104. package/dist/ezeep/p-de8f6583.entry.js +1 -0
  105. package/dist/ezeep/types/shared/types.d.ts +1 -0
  106. package/dist/types/components/ezp-auth/ezp-auth.d.ts +20 -20
  107. package/dist/types/components/ezp-backdrop/ezp-backdrop.d.ts +7 -7
  108. package/dist/types/components/ezp-dialog/ezp-dialog.d.ts +38 -38
  109. package/dist/types/components/ezp-icon/ezp-icon.d.ts +24 -24
  110. package/dist/types/components/ezp-icon-button/ezp-icon-button.d.ts +23 -23
  111. package/dist/types/components/ezp-input/ezp-input.d.ts +38 -38
  112. package/dist/types/components/ezp-label/ezp-label.d.ts +21 -21
  113. package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +116 -116
  114. package/dist/types/components/ezp-printing/ezp-printing.d.ts +83 -83
  115. package/dist/types/components/ezp-select/ezp-select.d.ts +80 -80
  116. package/dist/types/components/ezp-status/ezp-status.d.ts +40 -40
  117. package/dist/types/components/ezp-stepper/ezp-stepper.d.ts +65 -65
  118. package/dist/types/components/ezp-text-button/ezp-text-button.d.ts +25 -25
  119. package/dist/types/components/ezp-upload/ezp-upload.d.ts +38 -38
  120. package/dist/types/components/ezp-user-menu/ezp-user-menu.d.ts +43 -43
  121. package/dist/types/components.d.ts +493 -50
  122. package/dist/types/services/auth.d.ts +27 -27
  123. package/dist/types/services/print.d.ts +32 -32
  124. package/dist/types/services/user.d.ts +4 -4
  125. package/dist/types/shared/types.d.ts +1 -0
  126. package/dist/types/stencil-public-runtime.d.ts +335 -40
  127. package/dist/types/utils/utils.d.ts +6 -6
  128. package/loader/cdn.js +1 -2
  129. package/loader/index.cjs.js +1 -2
  130. package/loader/index.d.ts +13 -1
  131. package/loader/index.es2017.js +1 -2
  132. package/loader/index.js +1 -2
  133. package/package.json +10 -10
  134. package/www/build/ezeep.esm.js +1 -1
  135. package/www/build/ezeep.js +16 -19
  136. package/www/build/p-2177b8f4.system.entry.js +7 -0
  137. package/www/build/p-256870db.js +1 -0
  138. package/www/build/p-5ok9OZMg.system.js +1 -0
  139. package/www/build/p-BTfWEHH9.js +2 -0
  140. package/www/build/p-CfQRcOh8.system.js +1 -0
  141. package/www/build/p-CpP67t2l.js +1 -0
  142. package/www/build/p-DhXN1yGM.system.js +13 -0
  143. package/www/build/p-de8f6583.entry.js +1 -0
  144. package/www/index.html +1 -1
  145. package/dist/cjs/app-globals-53afb196.js +0 -15
  146. package/dist/cjs/index-1f953145.js +0 -1482
  147. package/dist/custom-elements/index.d.ts +0 -129
  148. package/dist/custom-elements/index.js +0 -34555
  149. package/dist/esm/app-globals-28960cbc.js +0 -13
  150. package/dist/esm/index-3ac1b749.js +0 -1450
  151. package/dist/esm/polyfills/css-shim.js +0 -1
  152. package/dist/esm-es5/app-globals-28960cbc.js +0 -1
  153. package/dist/esm-es5/index-3ac1b749.js +0 -1
  154. package/dist/ezeep/p-0cc2026d.system.js +0 -1
  155. package/dist/ezeep/p-312f40d7.js +0 -1
  156. package/dist/ezeep/p-4a7d6c3a.system.entry.js +0 -7
  157. package/dist/ezeep/p-84bd195a.system.js +0 -1
  158. package/dist/ezeep/p-a4d37138.js +0 -1
  159. package/dist/ezeep/p-ded04529.system.js +0 -1
  160. package/dist/ezeep/p-e20ee337.entry.js +0 -1
  161. package/loader/package.json +0 -10
  162. package/www/build/p-0cc2026d.system.js +0 -1
  163. package/www/build/p-312f40d7.js +0 -1
  164. package/www/build/p-4a7d6c3a.system.entry.js +0 -7
  165. package/www/build/p-84bd195a.system.js +0 -1
  166. package/www/build/p-a4d37138.js +0 -1
  167. package/www/build/p-ded04529.system.js +0 -1
  168. package/www/build/p-e20ee337.entry.js +0 -1
  169. /package/dist/ezeep/{p-50ea2036.system.js → p-YWpyar7R.system.js} +0 -0
  170. /package/www/build/{p-50ea2036.system.js → p-YWpyar7R.system.js} +0 -0
@@ -1,817 +1,882 @@
1
- import { Component, Host, State, Listen, Method, h, Prop, Watch, Event, } 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';
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
- 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;
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
- * States
57
+ * Listeners
20
58
  *
21
59
  */
22
60
  /** 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
- }
55
- /**
56
- *
57
- * Listeners
58
- *
59
- */
60
- /** Description... */
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;
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
- "required": false,
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
- "required": false,
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
- "required": false,
545
- "optional": false,
546
- "docs": {
547
- "tags": [],
548
- "text": ""
549
- },
550
- "attribute": "trigger",
551
- "reflect": false
552
- },
553
- "language": {
554
- "type": "string",
555
- "mutable": false,
556
- "complexType": {
557
- "original": "string",
558
- "resolved": "string",
559
- "references": {}
560
- },
561
- "required": false,
562
- "optional": false,
563
- "docs": {
564
- "tags": [],
565
- "text": ""
566
- },
567
- "attribute": "language",
568
- "reflect": false,
569
- "defaultValue": "''"
570
- },
571
- "code": {
572
- "type": "string",
573
- "mutable": false,
574
- "complexType": {
575
- "original": "string",
576
- "resolved": "string",
577
- "references": {}
578
- },
579
- "required": false,
580
- "optional": false,
581
- "docs": {
582
- "tags": [],
583
- "text": ""
584
- },
585
- "attribute": "code",
586
- "reflect": false
587
- },
588
- "filedata": {
589
- "type": "string",
590
- "mutable": false,
591
- "complexType": {
592
- "original": "string",
593
- "resolved": "string",
594
- "references": {}
595
- },
596
- "required": false,
597
- "optional": false,
598
- "docs": {
599
- "tags": [],
600
- "text": ""
601
- },
602
- "attribute": "filedata",
603
- "reflect": false
604
- },
605
- "seamless": {
606
- "type": "boolean",
607
- "mutable": false,
608
- "complexType": {
609
- "original": "boolean",
610
- "resolved": "boolean",
611
- "references": {}
612
- },
613
- "required": false,
614
- "optional": false,
615
- "docs": {
616
- "tags": [],
617
- "text": ""
618
- },
619
- "attribute": "seamless",
620
- "reflect": false,
621
- "defaultValue": "false"
622
- }
623
- }; }
624
- static get states() { return {
625
- "printOpen": {},
626
- "authOpen": {},
627
- "onlyGetSasUri": {},
628
- "noDocumentOpen": {},
629
- "systemAppearance": {},
630
- "files": {}
631
- }; }
632
- static get events() { return [{
633
- "method": "printFinished",
634
- "name": "printFinished",
635
- "bubbles": true,
636
- "cancelable": true,
637
- "composed": true,
638
- "docs": {
639
- "tags": [],
640
- "text": "Events"
641
- },
642
- "complexType": {
643
- "original": "any",
644
- "resolved": "any",
645
- "references": {}
646
- }
647
- }]; }
648
- static get methods() { return {
649
- "open": {
650
- "complexType": {
651
- "signature": "() => Promise<void>",
652
- "parameters": [],
653
- "references": {
654
- "Promise": {
655
- "location": "global"
656
- }
657
- },
658
- "return": "Promise<void>"
659
- },
660
- "docs": {
661
- "text": "\nPublic methods",
662
- "tags": []
663
- }
664
- },
665
- "logOut": {
666
- "complexType": {
667
- "signature": "() => Promise<void>",
668
- "parameters": [],
669
- "references": {
670
- "Promise": {
671
- "location": "global"
672
- }
673
- },
674
- "return": "Promise<void>"
675
- },
676
- "docs": {
677
- "text": "",
678
- "tags": []
679
- }
680
- },
681
- "getSasUri": {
682
- "complexType": {
683
- "signature": "() => Promise<string>",
684
- "parameters": [],
685
- "references": {
686
- "Promise": {
687
- "location": "global"
688
- }
689
- },
690
- "return": "Promise<string>"
691
- },
692
- "docs": {
693
- "text": "",
694
- "tags": []
695
- }
696
- },
697
- "getAuthUri": {
698
- "complexType": {
699
- "signature": "() => Promise<string>",
700
- "parameters": [],
701
- "references": {
702
- "Promise": {
703
- "location": "global"
704
- }
705
- },
706
- "return": "Promise<string>"
707
- },
708
- "docs": {
709
- "text": "",
710
- "tags": []
711
- }
712
- },
713
- "setAuthRefreshToken": {
714
- "complexType": {
715
- "signature": "(refreshToken: string) => Promise<void>",
716
- "parameters": [{
717
- "tags": [],
718
- "text": ""
719
- }],
720
- "references": {
721
- "Promise": {
722
- "location": "global"
723
- }
724
- },
725
- "return": "Promise<void>"
726
- },
727
- "docs": {
728
- "text": "",
729
- "tags": []
730
- }
731
- },
732
- "checkAuth": {
733
- "complexType": {
734
- "signature": "() => Promise<boolean>",
735
- "parameters": [],
736
- "references": {
737
- "Promise": {
738
- "location": "global"
739
- }
740
- },
741
- "return": "Promise<boolean>"
742
- },
743
- "docs": {
744
- "text": "",
745
- "tags": []
746
- }
747
- }
748
- }; }
749
- static get watchers() { return [{
750
- "propName": "filedata",
751
- "methodName": "watchFileData"
752
- }, {
753
- "propName": "filename",
754
- "methodName": "watchFilename"
755
- }, {
756
- "propName": "fileurl",
757
- "methodName": "watchFileUrl"
758
- }, {
759
- "propName": "language",
760
- "methodName": "watchLanguage"
761
- }]; }
762
- static get listeners() { return [{
763
- "name": "printCancel",
764
- "method": "listenPrintCancel",
765
- "target": undefined,
766
- "capture": false,
767
- "passive": false
768
- }, {
769
- "name": "printSubmit",
770
- "method": "listenPrintSubmit",
771
- "target": undefined,
772
- "capture": false,
773
- "passive": false
774
- }, {
775
- "name": "authCancel",
776
- "method": "listenAuthCancel",
777
- "target": undefined,
778
- "capture": false,
779
- "passive": false
780
- }, {
781
- "name": "userCancel",
782
- "method": "listenUserCancel",
783
- "target": undefined,
784
- "capture": false,
785
- "passive": false
786
- }, {
787
- "name": "authSuccess",
788
- "method": "listenAuthSuccess",
789
- "target": undefined,
790
- "capture": false,
791
- "passive": false
792
- }, {
793
- "name": "uploadFile",
794
- "method": "listenUploadFile",
795
- "target": undefined,
796
- "capture": false,
797
- "passive": false
798
- }, {
799
- "name": "dialogClose",
800
- "method": "listenDialogClose",
801
- "target": undefined,
802
- "capture": false,
803
- "passive": false
804
- }, {
805
- "name": "dialogAction",
806
- "method": "listenDialogAction",
807
- "target": undefined,
808
- "capture": false,
809
- "passive": false
810
- }, {
811
- "name": "logout",
812
- "method": "listenLogout",
813
- "target": undefined,
814
- "capture": false,
815
- "passive": false
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
  }