@ezeep/ezeep-js 1.0.272 → 1.0.284
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 → app-globals-L_3XPZxT.js} +7 -1
- package/dist/cjs/ezeep.cjs.js +4 -4
- package/dist/cjs/ezp-auth_15.cjs.entry.js +7338 -3700
- package/dist/cjs/{index-dv_gozsq.js → index-DM5v_sge.js} +3 -2
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/collection/components/ezp-auth/ezp-auth.css +0 -12
- package/dist/collection/components/ezp-auth/ezp-auth.js +78 -18
- package/dist/collection/components/ezp-backdrop/ezp-backdrop.js +5 -5
- package/dist/collection/components/ezp-dialog/ezp-dialog.js +85 -13
- package/dist/collection/components/ezp-icon/assets/glyph-cloud-upload.svg +4 -0
- package/dist/collection/components/ezp-icon/assets/glyph-file.svg +3 -0
- package/dist/collection/components/ezp-icon/ezp-icon.js +8 -3
- package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +5 -2
- package/dist/collection/components/ezp-input/ezp-input.css +19 -38
- package/dist/collection/components/ezp-input/ezp-input.js +16 -14
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +175 -48
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +215 -329
- package/dist/collection/components/ezp-printing/ezp-printing.css +23 -23
- package/dist/collection/components/ezp-printing/ezp-printing.js +119 -35
- package/dist/collection/components/ezp-select/ezp-select.css +56 -38
- package/dist/collection/components/ezp-select/ezp-select.js +93 -14
- package/dist/collection/components/ezp-status/ezp-status.css +94 -9
- package/dist/collection/components/ezp-status/ezp-status.js +42 -13
- package/dist/collection/components/ezp-stepper/ezp-stepper.css +37 -35
- package/dist/collection/components/ezp-stepper/ezp-stepper.js +14 -7
- package/dist/collection/components/ezp-text-button/ezp-text-button.css +3 -3
- package/dist/collection/components/ezp-text-button/ezp-text-button.js +1 -1
- package/dist/collection/components/ezp-upload/ezp-upload.css +243 -77
- package/dist/collection/components/ezp-upload/ezp-upload.js +80 -10
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.css +2 -1
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +15 -15
- package/dist/collection/services/auth.js +37 -36
- package/dist/collection/services/http.js +11 -0
- package/dist/collection/services/print-job.js +72 -0
- package/dist/collection/services/print.js +21 -69
- package/dist/collection/services/user.js +2 -9
- package/dist/collection/shared/constants.js +55 -0
- package/dist/collection/shared/global.js +7 -1
- package/dist/collection/shared/storage.js +71 -0
- package/dist/collection/types/shared/types.d.ts +42 -9
- package/dist/collection/utils/printer.js +68 -0
- package/dist/collection/utils/utils.js +24 -9
- package/dist/components/auth.js +1 -1
- package/dist/components/ezp-auth2.js +1 -1
- package/dist/components/ezp-backdrop2.js +1 -1
- package/dist/components/ezp-dialog2.js +1 -1
- package/dist/components/ezp-icon-button2.js +1 -1
- package/dist/components/ezp-icon2.js +1 -1
- package/dist/components/ezp-input2.js +1 -1
- package/dist/components/ezp-printer-selection2.js +1 -1
- package/dist/components/ezp-printing.js +1 -1
- package/dist/components/ezp-select2.js +1 -1
- package/dist/components/ezp-status2.js +1 -1
- package/dist/components/ezp-stepper2.js +1 -1
- package/dist/components/ezp-text-button2.js +1 -1
- package/dist/components/ezp-upload2.js +1 -1
- package/dist/components/ezp-user-menu.js +1 -1
- package/dist/components/ezp-user-menu2.js +1 -1
- package/dist/components/index.js +1 -1
- package/dist/components/utils.js +1 -0
- package/dist/directives/proxies.ts +74 -47
- package/dist/esm/{app-globals-CpP67t2l.js → app-globals-C0WTlb31.js} +7 -1
- package/dist/esm/ezeep.js +5 -5
- package/dist/esm/ezp-auth_15.entry.js +7338 -3700
- package/dist/esm/{index-BTfWEHH9.js → index-BButrLnB.js} +3 -3
- package/dist/esm/loader.js +4 -4
- package/dist/esm-es5/{app-globals-CpP67t2l.js → app-globals-C0WTlb31.js} +1 -1
- 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 → index-BButrLnB.js} +3 -3
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/assets/glyph-cloud-upload.svg +4 -0
- package/dist/ezeep/assets/glyph-file.svg +3 -0
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/ezeep.js +1 -1
- package/dist/ezeep/p-1e286bd1.system.entry.js +7 -0
- package/dist/ezeep/{p-BTfWEHH9.js → p-BButrLnB.js} +2 -2
- package/dist/ezeep/{p-CpP67t2l.js → p-C0WTlb31.js} +1 -1
- package/{www/build/p-DhXN1yGM.system.js → dist/ezeep/p-CYpousxy.system.js} +2 -2
- package/dist/ezeep/{p-5ok9OZMg.system.js → p-D4aCr1OK.system.js} +1 -1
- package/dist/ezeep/p-DCznw2Ee.system.js +1 -0
- package/dist/ezeep/p-a2b688f0.entry.js +1 -0
- package/dist/ezeep/types/shared/types.d.ts +42 -9
- package/dist/types/components/ezp-auth/ezp-auth.d.ts +8 -5
- package/dist/types/components/ezp-backdrop/ezp-backdrop.d.ts +2 -2
- package/dist/types/components/ezp-dialog/ezp-dialog.d.ts +14 -3
- package/dist/types/components/ezp-input/ezp-input.d.ts +17 -14
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +23 -7
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +26 -2
- package/dist/types/components/ezp-select/ezp-select.d.ts +10 -4
- package/dist/types/components/ezp-status/ezp-status.d.ts +7 -4
- package/dist/types/components/ezp-stepper/ezp-stepper.d.ts +1 -1
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +13 -1
- package/dist/types/components/ezp-user-menu/ezp-user-menu.d.ts +5 -2
- package/dist/types/components.d.ts +47 -39
- package/dist/types/services/auth.d.ts +10 -0
- package/dist/types/services/http.d.ts +4 -0
- package/dist/types/services/print-job.d.ts +48 -0
- package/dist/types/services/print.d.ts +10 -9
- package/dist/types/services/user.d.ts +13 -2
- package/dist/types/shared/constants.d.ts +51 -0
- package/dist/types/shared/storage.d.ts +24 -0
- package/dist/types/shared/types.d.ts +42 -9
- package/dist/types/stencil-public-runtime.d.ts +1 -0
- package/dist/types/utils/printer.d.ts +22 -0
- package/dist/types/utils/utils.d.ts +22 -10
- package/package.json +30 -18
- package/readme.md +1 -0
- package/www/build/assets/glyph-cloud-upload.svg +4 -0
- package/www/build/assets/glyph-file.svg +3 -0
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/ezeep.js +1 -1
- package/www/build/p-1e286bd1.system.entry.js +7 -0
- package/www/build/p-544b7033.js +1 -0
- package/www/build/{p-BTfWEHH9.js → p-BButrLnB.js} +2 -2
- package/www/build/{p-CpP67t2l.js → p-C0WTlb31.js} +1 -1
- package/{dist/ezeep/p-DhXN1yGM.system.js → www/build/p-CYpousxy.system.js} +2 -2
- package/www/build/{p-5ok9OZMg.system.js → p-D4aCr1OK.system.js} +1 -1
- package/www/build/p-DCznw2Ee.system.js +1 -0
- package/www/build/p-a2b688f0.entry.js +1 -0
- package/www/data/locales/de.json +14 -5
- package/www/data/locales/en.json +14 -5
- package/www/index.html +2 -5
- package/dist/components/i18next.js +0 -1
- package/dist/ezeep/p-2177b8f4.system.entry.js +0 -7
- package/dist/ezeep/p-CfQRcOh8.system.js +0 -1
- package/dist/ezeep/p-de8f6583.entry.js +0 -1
- package/www/build/p-2177b8f4.system.entry.js +0 -7
- package/www/build/p-256870db.js +0 -1
- package/www/build/p-CfQRcOh8.system.js +0 -1
- package/www/build/p-de8f6583.entry.js +0 -1
|
@@ -5,7 +5,9 @@ export type IconNameTypes =
|
|
|
5
5
|
| 'checkmark-alt'
|
|
6
6
|
| 'checkmark'
|
|
7
7
|
| 'close'
|
|
8
|
+
| 'cloud-upload'
|
|
8
9
|
| 'color'
|
|
10
|
+
| 'file'
|
|
9
11
|
| 'copies'
|
|
10
12
|
| 'dark'
|
|
11
13
|
| 'drag-drop'
|
|
@@ -55,6 +57,37 @@ export type AppearanceTypes = 'system' | 'light' | 'dark'
|
|
|
55
57
|
export type TriggerTypes = 'custom' | 'file' | 'button'
|
|
56
58
|
export type AlertType = { open: boolean; heading: string; description: string }
|
|
57
59
|
export type SystemAppearanceTypes = 'light' | 'dark'
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Payload emitted by selection-style components (`ezp-select`, `ezp-input`,
|
|
63
|
+
* `ezp-stepper`) and consumed by `ezp-printer-selection.setSelectedProperties`.
|
|
64
|
+
*/
|
|
65
|
+
export interface PropertyChangeDetail {
|
|
66
|
+
type: string
|
|
67
|
+
id?: string | number | boolean
|
|
68
|
+
title?: string
|
|
69
|
+
is_queue?: boolean
|
|
70
|
+
value?: string | number
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** Response of `sfapi/Print` (POST). */
|
|
74
|
+
export interface PrintResponse {
|
|
75
|
+
code?: number
|
|
76
|
+
jobid?: string
|
|
77
|
+
fileid?: string
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Response of `sfapi/Status`. */
|
|
81
|
+
export interface JobStatusResponse {
|
|
82
|
+
jobstatus: number
|
|
83
|
+
jobstatusstring?: string
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Response of `sfapi/PrepareUpload`. */
|
|
87
|
+
export interface PrepareUploadResponse {
|
|
88
|
+
fileid: string
|
|
89
|
+
sasUri: string
|
|
90
|
+
}
|
|
58
91
|
export interface PrinterProperties {
|
|
59
92
|
paper?: string
|
|
60
93
|
paperid?: number | string
|
|
@@ -64,11 +97,11 @@ export interface PrinterProperties {
|
|
|
64
97
|
orientation?: number | string
|
|
65
98
|
copies?: number | string
|
|
66
99
|
resolution?: string | number
|
|
67
|
-
paperlength
|
|
68
|
-
paperwidth
|
|
100
|
+
paperlength?: string | number
|
|
101
|
+
paperwidth?: string | number
|
|
69
102
|
defaultSource?: number | string
|
|
70
|
-
trayname?: string
|
|
71
|
-
PageRanges
|
|
103
|
+
trayname?: string
|
|
104
|
+
PageRanges?: string
|
|
72
105
|
}
|
|
73
106
|
|
|
74
107
|
export interface Printer {
|
|
@@ -87,8 +120,8 @@ export interface PaperFormat {
|
|
|
87
120
|
}
|
|
88
121
|
|
|
89
122
|
export interface Trays {
|
|
90
|
-
Default
|
|
91
|
-
Index:
|
|
123
|
+
Default: boolean
|
|
124
|
+
Index: number
|
|
92
125
|
Name: string
|
|
93
126
|
}
|
|
94
127
|
|
|
@@ -101,7 +134,7 @@ export interface PrinterConfig {
|
|
|
101
134
|
Resolution?: string
|
|
102
135
|
Paper?: string
|
|
103
136
|
Tray?: string
|
|
104
|
-
}
|
|
137
|
+
}
|
|
105
138
|
Collate?: boolean
|
|
106
139
|
Color?: boolean
|
|
107
140
|
ColorSupported?: boolean
|
|
@@ -123,7 +156,7 @@ export interface PrinterConfig {
|
|
|
123
156
|
}
|
|
124
157
|
|
|
125
158
|
export interface User {
|
|
126
|
-
azureProfile:
|
|
159
|
+
azureProfile: unknown
|
|
127
160
|
dateJoined: string
|
|
128
161
|
displayName: string
|
|
129
162
|
email: string
|
|
@@ -137,5 +170,5 @@ export interface User {
|
|
|
137
170
|
isVerfified: boolean
|
|
138
171
|
lastName: string
|
|
139
172
|
roles: Array<string>
|
|
140
|
-
userInvitations:
|
|
173
|
+
userInvitations: unknown
|
|
141
174
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { JobStatus, PROCESSING_JOB_STATUSES, FAILED_JOB_STATUSES, HUB_DRIVER_ERROR_CODES, } from "../shared/constants";
|
|
2
|
+
/**
|
|
3
|
+
* Derive the default print properties for a printer from its configuration.
|
|
4
|
+
*
|
|
5
|
+
* This logic previously lived inline and **duplicated verbatim** in
|
|
6
|
+
* `ezp-printer-selection` (in `setSelectedProperties` and `connectedCallback`).
|
|
7
|
+
* It mutates `properties` in place — matching the original behaviour exactly —
|
|
8
|
+
* and returns it for convenience.
|
|
9
|
+
*/
|
|
10
|
+
export function applyPrinterDefaults(config, properties) {
|
|
11
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
12
|
+
properties.color = ((_a = config.Default) === null || _a === void 0 ? void 0 : _a.Color) == 'color' ? true : false;
|
|
13
|
+
const defaultOrientation = (_b = config.Default) === null || _b === void 0 ? void 0 : _b.Orientation;
|
|
14
|
+
const defaultOrientationIndex = (_c = config.Default) === null || _c === void 0 ? void 0 : _c.OrientationIndex;
|
|
15
|
+
let orientationFallback;
|
|
16
|
+
if (defaultOrientation) {
|
|
17
|
+
const idx = (_d = config.OrientationsSupported) === null || _d === void 0 ? void 0 : _d.indexOf(defaultOrientation);
|
|
18
|
+
if (typeof idx === 'number' && idx >= 0)
|
|
19
|
+
orientationFallback = idx + 1;
|
|
20
|
+
}
|
|
21
|
+
properties.orientation = defaultOrientationIndex !== null && defaultOrientationIndex !== void 0 ? defaultOrientationIndex : orientationFallback;
|
|
22
|
+
properties.resolution = (_e = config.Default) === null || _e === void 0 ? void 0 : _e.Resolution;
|
|
23
|
+
const defaultPaper = (_f = config.PaperFormats) === null || _f === void 0 ? void 0 : _f.find((obj) => obj.Default === true);
|
|
24
|
+
properties.paper = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Name;
|
|
25
|
+
properties.paperid = defaultPaper === null || defaultPaper === void 0 ? void 0 : defaultPaper.Id;
|
|
26
|
+
// `obj?.` guards against an explicit "no trays" report of `[null]`, which the
|
|
27
|
+
// original inline code would crash on before reaching the guards below.
|
|
28
|
+
const defaultSource = (_g = config.Trays) === null || _g === void 0 ? void 0 : _g.find((obj) => (obj === null || obj === void 0 ? void 0 : obj.Default) === true);
|
|
29
|
+
if (config.Trays && config.Trays.length >= 1 && config.Trays[0] != null) {
|
|
30
|
+
properties.trayname = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Name;
|
|
31
|
+
properties.defaultSource = defaultSource === null || defaultSource === void 0 ? void 0 : defaultSource.Index;
|
|
32
|
+
}
|
|
33
|
+
// When the printer reports an explicit "no trays" ([null]) we must not send
|
|
34
|
+
// tray attributes at all.
|
|
35
|
+
if (config.Trays && config.Trays.length >= 0 && config.Trays[0] == null) {
|
|
36
|
+
delete properties.trayname;
|
|
37
|
+
delete properties.defaultSource;
|
|
38
|
+
}
|
|
39
|
+
properties.duplex = config.DuplexSupported;
|
|
40
|
+
properties.duplexmode = config.DuplexMode;
|
|
41
|
+
delete properties.PageRanges;
|
|
42
|
+
return properties;
|
|
43
|
+
}
|
|
44
|
+
/** Does this printer config report an explicit "no usable trays" state? */
|
|
45
|
+
export function hasNoTrays(config) {
|
|
46
|
+
return !!config.Trays && config.Trays.length >= 0 && config.Trays[0] == null;
|
|
47
|
+
}
|
|
48
|
+
/** Does this printer config expose at least one selectable tray? */
|
|
49
|
+
export function hasTrays(config) {
|
|
50
|
+
return !!config.Trays && config.Trays.length >= 1 && config.Trays[0] != null;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Classify a print-job status code into a single outcome. Centralises the
|
|
54
|
+
* status logic that was previously duplicated (with slightly inconsistent code
|
|
55
|
+
* sets) across `validateData`, `waitForPrintCompletion` and the inline checks
|
|
56
|
+
* in `handlePrint`. Unknown codes are treated as failures for safety.
|
|
57
|
+
*/
|
|
58
|
+
export function classifyJobStatus(jobstatus, isQueue) {
|
|
59
|
+
if (jobstatus === JobStatus.Success)
|
|
60
|
+
return 'success';
|
|
61
|
+
if (PROCESSING_JOB_STATUSES.includes(jobstatus))
|
|
62
|
+
return 'processing';
|
|
63
|
+
if (isQueue && HUB_DRIVER_ERROR_CODES.includes(jobstatus))
|
|
64
|
+
return 'hub-error';
|
|
65
|
+
if (FAILED_JOB_STATUSES.includes(jobstatus))
|
|
66
|
+
return 'failed';
|
|
67
|
+
return 'failed';
|
|
68
|
+
}
|
|
@@ -1,6 +1,22 @@
|
|
|
1
|
+
import { forceUpdate } from "@stencil/core";
|
|
1
2
|
import i18next from "i18next";
|
|
2
3
|
import translationsDE from "../data/locales/de.json";
|
|
3
4
|
import translationsEN from "../data/locales/en.json";
|
|
5
|
+
import { PAPER_ID } from "../shared/constants";
|
|
6
|
+
export { PAPER_ID } from '../shared/constants';
|
|
7
|
+
/**
|
|
8
|
+
* Re-render a Stencil component whenever the i18next language changes.
|
|
9
|
+
* i18next fires `languageChanged` but has no hook into Stencil's render cycle,
|
|
10
|
+
* so any component that calls `i18next.t()` in render() must force an update —
|
|
11
|
+
* otherwise a runtime language switch leaves already-mounted text stale.
|
|
12
|
+
* Call from connectedCallback and invoke the returned disposer in
|
|
13
|
+
* disconnectedCallback.
|
|
14
|
+
*/
|
|
15
|
+
export function subscribeToLanguageChange(component) {
|
|
16
|
+
const rerender = () => forceUpdate(component);
|
|
17
|
+
i18next.on('languageChanged', rerender);
|
|
18
|
+
return () => i18next.off('languageChanged', rerender);
|
|
19
|
+
}
|
|
4
20
|
export function encodeFormData(data) {
|
|
5
21
|
return Object.keys(data)
|
|
6
22
|
.map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(data[key]))
|
|
@@ -38,7 +54,7 @@ export function initi18n(language) {
|
|
|
38
54
|
});
|
|
39
55
|
}
|
|
40
56
|
}
|
|
41
|
-
export const poll = async ({ fn, validate, interval, maxAttempts }) => {
|
|
57
|
+
export const poll = async ({ fn, validate, interval, maxAttempts, }) => {
|
|
42
58
|
let attempts = 0;
|
|
43
59
|
const executePoll = async (resolve, reject) => {
|
|
44
60
|
const result = await fn();
|
|
@@ -56,7 +72,7 @@ export const poll = async ({ fn, validate, interval, maxAttempts }) => {
|
|
|
56
72
|
return new Promise(executePoll);
|
|
57
73
|
};
|
|
58
74
|
export const removeEmptyStrings = (obj) => {
|
|
59
|
-
|
|
75
|
+
const newObj = {};
|
|
60
76
|
Object.keys(obj).forEach((prop) => {
|
|
61
77
|
if (obj[prop] !== '') {
|
|
62
78
|
newObj[prop] = obj[prop];
|
|
@@ -87,19 +103,19 @@ export const validatePageRange = (pageRange) => {
|
|
|
87
103
|
if (!isValid) {
|
|
88
104
|
return false;
|
|
89
105
|
}
|
|
90
|
-
|
|
106
|
+
const ranges = pageRange.split(',');
|
|
91
107
|
for (let i = 0; i < ranges.length; i++) {
|
|
92
|
-
|
|
108
|
+
const rng = ranges[i].trim();
|
|
93
109
|
if (rng.includes('-')) {
|
|
94
|
-
|
|
95
|
-
start = parseInt(
|
|
96
|
-
end = parseInt(
|
|
110
|
+
const [startStr, endStr] = rng.split('-');
|
|
111
|
+
const start = parseInt(startStr);
|
|
112
|
+
const end = parseInt(endStr);
|
|
97
113
|
if (isNaN(start) || isNaN(end) || start > end || start <= 0) {
|
|
98
114
|
return false;
|
|
99
115
|
}
|
|
100
116
|
}
|
|
101
117
|
else {
|
|
102
|
-
|
|
118
|
+
const page = parseInt(rng);
|
|
103
119
|
if (isNaN(page) || page <= 0) {
|
|
104
120
|
return false;
|
|
105
121
|
}
|
|
@@ -107,4 +123,3 @@ export const validatePageRange = (pageRange) => {
|
|
|
107
123
|
}
|
|
108
124
|
return true;
|
|
109
125
|
};
|
|
110
|
-
export const PAPER_ID = 256;
|
package/dist/components/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"@stencil/core/internal/client";import{i as t}from"./i18next.js";const n=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys()){const n=e.get(t).filter((e=>{const t=e.deref();return t&&(!("isConnected"in(n=t))||n.isConnected);var n}));e.set(t,n)}})(...t)}),2e3)}})(),r=e.forceUpdate,i=e.getRenderingRef,o=(e,t)=>{const n=e.indexOf(t);n>=0&&(e[n]=e[e.length-1],e.length--)},s=(e,t)=>{const s=((e,t=(e,t)=>e!==t)=>{const n=()=>{return("function"==typeof(t=e)?t():t)??{};var t},r=n();let i=new Map(Object.entries(r));const s="undefined"!=typeof Proxy,a=s?null:{},c={dispose:[],get:[],set:[],reset:[]},l=new Map,u=()=>{i=new Map(Object.entries(n())),s||f(),c.reset.forEach((e=>e()))},d=e=>(c.get.forEach((t=>t(e))),i.get(e)),p=(e,n)=>{const r=i.get(e);t(n,r,e)&&(i.set(e,n),s||_(e),c.set.forEach((t=>t(e,n,r))))},h=s?new Proxy(r,{get:(e,t)=>d(t),ownKeys:()=>Array.from(i.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>i.has(t),set:(e,t,n)=>(p(t,n),!0)}):(f(),a),g=(e,t)=>(c[e].push(t),()=>{o(c[e],t)});function _(e){!s&&a&&(Object.prototype.hasOwnProperty.call(a,e)||Object.defineProperty(a,e,{configurable:!0,enumerable:!0,get:()=>d(e),set(t){p(e,t)}}))}function f(){if(s||!a)return;const e=new Set(i.keys());for(const t of Object.keys(a))e.has(t)||delete a[t];for(const t of e)_(t)}return{state:h,get:d,set:p,on:g,onChange:(e,t)=>{const r=(n,r)=>{n===e&&t(r)},i=()=>{const r=n();t(r[e])},o=g("set",r),s=g("reset",i);return l.set(t,{setHandler:r,resetHandler:i,propName:e}),()=>{o(),s(),l.delete(t)}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(g("set",t.set)),t.get&&e.push(g("get",t.get)),t.reset&&e.push(g("reset",t.reset)),t.dispose&&e.push(g("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{c.dispose.forEach((e=>e())),u()},reset:u,forceUpdate:e=>{const t=i.get(e);c.set.forEach((n=>n(e,t,t)))},removeListener:(e,t)=>{const n=l.get(t);n&&n.propName===e&&(o(c.set,n.setHandler),o(c.reset,n.resetHandler),l.delete(t))}}})(e,t);return s.use((()=>{if("function"!=typeof i||"function"!=typeof r)return{};const e=r,t=i,o=new Map;return{dispose:()=>o.clear(),get:e=>{const n=t();n&&((e,t,n)=>{let r=e.get(t);r||(r=[],e.set(t,r)),r.some((e=>e.deref()===n))||r.push(new WeakRef(n))})(o,e,n)},set:t=>{const r=o.get(t);if(r){const n=r.filter((t=>{const n=t.deref();return!!n&&e(n)}));o.set(t,n)}n(o)},reset:()=>{o.forEach((t=>{t.forEach((t=>{const n=t.deref();n&&e(n)}))})),n(o)}}})()),s};var a={login_dialog:{heading:"Drucke mit ezeep Blue",description:"Melde dich mit deinem ezeep Blue-Konto an, um zu drucken.",action:"Anmelden"},no_document_dialog:{heading:"Keine Datei ausgewählt",description:"Wähle zunächst eine Datei zum Drucken aus.",action:"OK"},printer_selection:{loading:"Lade meine Drucker…",print:"Drucken",printer:"Drucker",print_processing:"Drucken…",print_success:"Erfolgreich gedruckt.",print_failed:"Druck fehlgeschlagen",not_supported:"Der ausgewählte Dateityp wird nicht unterstützt.",color:"Farbe",orientation:"Ausrichtung",size:"Papierformat",duplex:"Beidseitig",quality:"Druckqualität",select_printer:"Wähle einen Drucker",select_color:"Wähle Farbe/Graustufen",select_size:"Wähle Papierformat",select_orientation:"Wähle Ausrichtung",select_quality:"Wähle Druckqualität",select_duplex:"Wähle Beidseitig",color_color:"Farbe",color_grayscale:"Graustufen",orientation_portrait:"Hochformat",orientation_landscape:"Querformat",unknown_location:"Unbekannter Standort",no_printers:"Keine Drucker gefunden.",prepare_upload:"Vorbereiten…",uploading:"Hochladen…",duplex_none:"Keine",copies:"Kopien",duplex_long:"auf der langen Seite umdrehen",duplex_short:"auf der kurzen Seite umdrehen",pull_print_success:"Bereit zum Auslösen.",width:"Breite",length:"Länge",trays:"Papierfach",select_trays:"Wähle Papierfach",page_ranges:"Druckbereich",paper_ranges:"Papier-Ranges",files_selected:"{{count}} Dateien ausgewählt",files:"Dateien"},button_actions:{login:"Anmelden",print:"Drucken",cancel:"Abbrechen",close:"Schließen",retry:"Wiederholen",select_printer:"Wähle Drucker"},upload:{description:"Ziehe Dateien hier in den Browser ",meta_leading:"oder",meta_select:"wähle Dateien aus",meta_trailing:"um mit ezeep Blue zu drucken.",selected_files:"Ausgewählte Dateien:"},user_menu:{theme:"Farbschema",appearance:"Darstellung",system:"System",light:"Hell",dark:"Dunkel",account:"Konto verwalten",help:"Hilfe & Unterstützung",logout:"Ausloggen"}},c={login_dialog:{heading:"Print with ezeep Blue",description:"Sign in with your ezeep Blue account to print.",action:"Sign in"},no_document_dialog:{heading:"No file selected",description:"Select a file first to print.",action:"OK"},printer_selection:{loading:"Loading My Printers…",print_processing:"Printing…",print_success:"Successfully printed.",pull_print_success:"Ready to be released.",print_failed:"Print failed",not_supported:"The selected file type is not supported.",prepare_upload:"Preparing…",uploading:"Uploading…",print:"Print",printer:"Printer",color:"Color",orientation:"Orientation",size:"Paper Size",duplex:"Double-sided",duplex_none:"None",duplex_long:"flip on long side",duplex_short:"flip on short side",quality:"Print Quality",select_printer:"Select a printer",select_color:"Select Color/Grayscale",select_orientation:"Select Orientation",select_size:"Select Paper Size",select_quality:"Select Print Quality",select_duplex:"Select Double-sided",color_color:"Color",color_grayscale:"Grayscale",orientation_portrait:"Portrait",orientation_landscape:"Landscape",unknown_location:"Unknown location",no_printers:"No printers found.",copies:"Copies",width:"Width",length:"Length",trays:"Tray",select_trays:"Select Tray",page_ranges:"Page Ranges",paper_ranges:"Paper Ranges",files_selected:"{{count}} files selected",files:"files"},button_actions:{login:"Sign In",print:"Print",cancel:"Cancel",close:"Close",retry:"Retry",select_printer:"Select Printer"},upload:{description:"Drop files here into the browser ",meta_leading:"or",meta_select:"select files",meta_trailing:"to print with ezeep Blue.",selected_files:"Selected Files:"},user_menu:{theme:"Color theme",appearance:"Appearance",system:"System",light:"Light",dark:"Dark",account:"Manage Account",help:"Help & Support",logout:"Logout"}};function l(e){return Object.keys(e).map((t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t]))).join("&")}function u(e){const n={en:{translation:c},de:{translation:a}};t.init(""!=e?{resources:n,lng:e,nsSeparator:!1,fallbackLng:"en"}:{resources:n,lng:navigator.language,nsSeparator:!1,fallbackLng:"en"})}const d=async({fn:e,validate:t,interval:n,maxAttempts:r})=>{let i=0;const o=async(s,a)=>{const c=await e();return i++,t(c)?s(c):r&&i===r?a(new Error("Exceeded max attempts.")):void setTimeout(o,n,s,a)};return new Promise(o)},p=e=>{let t={};return Object.keys(e).forEach((n=>{""!==e[n]&&(t[n]=e[n])})),t},h=e=>(e.paperid!=f&&(delete e.paperlength,delete e.paperwidth),e.paperlength&&e.paperwidth&&(e.paperlength=10*+e.paperlength,e.paperwidth=10*+e.paperwidth),e),g=e=>e.replace(/,/g,";"),_=e=>{if(!e)return!0;if(!/^(\d+(-\d+)?(,\d+(-\d+)?)*|(\d+,\d+(-\d+)?(,\d+(-\d+)?)*)+)$/.test(e))return!1;let t=e.split(",");for(let e=0;e<t.length;e++){let n=t[e].trim();if(n.includes("-")){let[e,t]=n.split("-");if(e=parseInt(e),t=parseInt(t),isNaN(e)||isNaN(t)||e>t||e<=0)return!1}else{let e=parseInt(n);if(isNaN(e)||e<=0)return!1}}return!0},f=256;class m{constructor(e,t){this.urlParams=new URLSearchParams,this.isAuthorized=!1,this.redirectURI=e,this.clientID=t,this.oauthUrl=y.state.authApiHostUrl,this.authURI=new URL(`https://${this.oauthUrl}/oauth/authorize/`),this.accessTokenURL=`https://${this.oauthUrl}/oauth/access_token/`}generateCodeVerifier(){if(""!==y.state.codeVerifier)this.codeVerifier=y.state.codeVerifier;else{const e=new Uint8Array(128),t=crypto.getRandomValues(e),n=btoa(t.toString()).substr(0,128);this.codeVerifier=n,y.state.codeVerifier=this.codeVerifier}}async generateCodeChallenge(e){const t=(new TextEncoder).encode(e),n=await crypto.subtle.digest("SHA-256",t),r=btoa(String.fromCharCode.apply(null,new Uint8Array(n)));this.codeChallenge=r.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}buildAuthURI(){this.urlParams.append("response_type","code"),this.urlParams.append("client_id",this.clientID),this.urlParams.append("redirect_uri",this.redirectURI),this.urlParams.append("code_challenge",this.codeChallenge),this.urlParams.append("code_challenge_method","S256"),this.authURI.search=this.urlParams.toString(),y.state.authUri=this.authURI.toString()}getAccessToken(){return fetch(this.accessTokenURL,{credentials:"include",headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:l({grant_type:"authorization_code",scope:"printing",code:y.state.code,redirect_uri:this.redirectURI,code_verifier:y.state.codeVerifier})}).then((e=>e.json())).then((e=>{e.access_token&&(y.state.isAuthorized=!0,this.isAuthorized=y.state.isAuthorized,localStorage.setItem("isAuthorized",this.isAuthorized.toString()),this.accessToken=e.access_token,localStorage.setItem("access_token",this.accessToken),y.state.accessToken=this.accessToken,this.refreshToken=e.refresh_token,localStorage.setItem("refreshToken",this.refreshToken),y.state.refreshToken=this.refreshToken)}))}refreshTokens(){return fetch(this.accessTokenURL,{credentials:"include",headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:l({grant_type:"refresh_token",scope:"printing",refresh_token:y.state.refreshToken})}).then((e=>e.json())).then((e=>{e.access_token&&(this.accessToken=e.access_token,localStorage.setItem("access_token",this.accessToken),y.state.accessToken=this.accessToken,this.refreshToken=e.refresh_token,localStorage.setItem("refreshToken",this.refreshToken),y.state.refreshToken=this.refreshToken,y.state.isAuthorized=!0,localStorage.setItem("isAuthorized","true"))}))}revokeRefreshToken(){y.state.refreshToken&&fetch(`https://${this.oauthUrl}/oauth/revoke/`,{credentials:"include",headers:{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"},method:"POST",body:l({token:y.state.refreshToken})}).catch((e=>{console.log(e)}))}}const y=s({code:"",codeVerifier:"",accessToken:"",refreshToken:"",isAuthorized:!1,devApi:!1,authApiHostUrl:"",redirectUri:"",authUri:""});function w(){const e=new URLSearchParams(window.location.search).get("code");window.opener&&e&&(window.opener.postMessage(e,y.state.redirectUri),window.close())}export{m as E,f as P,y as a,s as c,g as f,u as i,h as m,d as p,p as r,w as s,_ as v}
|
|
1
|
+
import*as e from"@stencil/core/internal/client";import{h as t}from"./utils.js";const r=(()=>{let e;return(...t)=>{e&&clearTimeout(e),e=setTimeout((()=>{e=0,(e=>{for(let t of e.keys()){const r=e.get(t).filter((e=>{const t=e.deref();return t&&(!("isConnected"in(r=t))||r.isConnected);var r}));e.set(t,r)}})(...t)}),2e3)}})(),o=e.forceUpdate,s=e.getRenderingRef,n=(e,t)=>{const r=e.indexOf(t);r>=0&&(e[r]=e[e.length-1],e.length--)},i=(e,t)=>{const i=((e,t=(e,t)=>e!==t)=>{const r=()=>{return("function"==typeof(t=e)?t():t)??{};var t},o=r();let s=new Map(Object.entries(o));const i="undefined"!=typeof Proxy,c=i?null:{},a={dispose:[],get:[],set:[],reset:[]},h=new Map,l=()=>{s=new Map(Object.entries(r())),i||S(),a.reset.forEach((e=>e()))},u=e=>(a.get.forEach((t=>t(e))),s.get(e)),d=(e,r)=>{const o=s.get(e);t(r,o,e)&&(s.set(e,r),i||g(e),a.set.forEach((t=>t(e,r,o))))},f=i?new Proxy(o,{get:(e,t)=>u(t),ownKeys:()=>Array.from(s.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>s.has(t),set:(e,t,r)=>(d(t,r),!0)}):(S(),c),p=(e,t)=>(a[e].push(t),()=>{n(a[e],t)});function g(e){!i&&c&&(Object.prototype.hasOwnProperty.call(c,e)||Object.defineProperty(c,e,{configurable:!0,enumerable:!0,get:()=>u(e),set(t){d(e,t)}}))}function S(){if(i||!c)return;const e=new Set(s.keys());for(const t of Object.keys(c))e.has(t)||delete c[t];for(const t of e)g(t)}return{state:f,get:u,set:d,on:p,onChange:(e,t)=>{const o=(r,o)=>{r===e&&t(o)},s=()=>{const o=r();t(o[e])},n=p("set",o),i=p("reset",s);return h.set(t,{setHandler:o,resetHandler:s,propName:e}),()=>{n(),i(),h.delete(t)}},use:(...e)=>{const t=e.reduce(((e,t)=>(t.set&&e.push(p("set",t.set)),t.get&&e.push(p("get",t.get)),t.reset&&e.push(p("reset",t.reset)),t.dispose&&e.push(p("dispose",t.dispose)),e)),[]);return()=>t.forEach((e=>e()))},dispose:()=>{a.dispose.forEach((e=>e())),l()},reset:l,forceUpdate:e=>{const t=s.get(e);a.set.forEach((r=>r(e,t,t)))},removeListener:(e,t)=>{const r=h.get(t);r&&r.propName===e&&(n(a.set,r.setHandler),n(a.reset,r.resetHandler),h.delete(t))}}})(e,t);return i.use((()=>{if("function"!=typeof s||"function"!=typeof o)return{};const e=o,t=s,n=new Map;return{dispose:()=>n.clear(),get:e=>{const r=t();r&&((e,t,r)=>{let o=e.get(t);o||(o=[],e.set(t,o)),o.some((e=>e.deref()===r))||o.push(new WeakRef(r))})(n,e,r)},set:t=>{const o=n.get(t);if(o){const r=o.filter((t=>{const r=t.deref();return!!r&&e(r)}));n.set(t,r)}r(n)},reset:()=>{n.forEach((t=>{t.forEach((t=>{const r=t.deref();r&&e(r)}))})),r(n)}}})()),i},c="refreshToken",a="isAuthorized",h="properties",l="printer";function u(e){const t=localStorage.getItem(e);if(null===t)return null;try{return JSON.parse(t)}catch(e){return null}}const d={getRefreshToken:()=>localStorage.getItem(c),setRefreshToken(e){localStorage.setItem(c,e)},getIsAuthorized:()=>"true"===localStorage.getItem(a),setIsAuthorized(e){localStorage.setItem(a,e.toString())},hasIsAuthorized:()=>null!==localStorage.getItem(a),getProperties:()=>u(h),setProperties(e){localStorage.setItem(h,JSON.stringify(e))},getPrinter:()=>u(l),setPrinter(e){localStorage.setItem(l,JSON.stringify(e))},clearSession(){localStorage.removeItem(h),localStorage.removeItem(c),localStorage.removeItem("access_token"),localStorage.removeItem(l),localStorage.removeItem(a)},clearSavedPrinter(){localStorage.removeItem(l),localStorage.removeItem(h)}};class f{constructor(e,t){this.urlParams=new URLSearchParams,this.isAuthorized=!1,this.redirectURI=e,this.clientID=t,p.state.clientID=t,this.oauthUrl=p.state.authApiHostUrl,this.authURI=new URL(`https://${this.oauthUrl}/oauth/authorize/`),this.accessTokenURL=`https://${this.oauthUrl}/oauth/access_token/`}generateCodeVerifier(){if(""!==p.state.codeVerifier)this.codeVerifier=p.state.codeVerifier;else{const e=new Uint8Array(128),t=crypto.getRandomValues(e),r=btoa(t.toString()).substr(0,128);this.codeVerifier=r,p.state.codeVerifier=this.codeVerifier}}async generateCodeChallenge(e){const t=(new TextEncoder).encode(e),r=await crypto.subtle.digest("SHA-256",t),o=btoa(String.fromCharCode(...new Uint8Array(r)));this.codeChallenge=o.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}buildAuthURI(){this.urlParams.append("response_type","code"),this.urlParams.append("client_id",this.clientID),this.urlParams.append("redirect_uri",this.redirectURI),this.urlParams.append("code_challenge",this.codeChallenge),this.urlParams.append("code_challenge_method","S256"),this.authURI.search=this.urlParams.toString(),p.state.authUri=this.authURI.toString()}oauthHeaders(){return{Authorization:"Basic "+btoa(this.clientID+":"),"Content-Type":"application/x-www-form-urlencoded"}}persistTokens(e,t){this.accessToken=e,p.state.accessToken=e,this.refreshToken=t,p.state.refreshToken=t,d.setRefreshToken(t),this.isAuthorized=!0,p.state.isAuthorized=!0,d.setIsAuthorized(!0)}getAccessToken(){return fetch(this.accessTokenURL,{credentials:"include",headers:this.oauthHeaders(),method:"POST",body:t({grant_type:"authorization_code",scope:"printing",code:p.state.code,redirect_uri:this.redirectURI,code_verifier:p.state.codeVerifier})}).then((e=>e.json())).then((e=>{e.access_token&&this.persistTokens(e.access_token,e.refresh_token)}))}refreshTokens(){return fetch(this.accessTokenURL,{credentials:"include",headers:this.oauthHeaders(),method:"POST",body:t({grant_type:"refresh_token",scope:"printing",refresh_token:p.state.refreshToken})}).then((e=>e.json())).then((e=>{e.access_token&&this.persistTokens(e.access_token,e.refresh_token)}))}revokeRefreshToken(){p.state.refreshToken&&fetch(`https://${this.oauthUrl}/oauth/revoke/`,{credentials:"include",headers:this.oauthHeaders(),method:"POST",body:t({token:p.state.refreshToken})}).catch((()=>{}))}}const p=i({code:"",codeVerifier:"",accessToken:"",refreshToken:"",isAuthorized:!1,devApi:!1,authApiHostUrl:"",redirectUri:"",authUri:"",clientID:""});function g(){const e=new URLSearchParams(window.location.search).get("code");window.opener&&e&&(window.opener.postMessage(e,p.state.redirectUri),window.close())}export{f as E,p as a,g as b,i as c,d as s}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,createEvent as
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as s,h as i,Host as o,transformTag as n}from"@stencil/core/internal/client";import{a,E as l}from"./auth.js";import{s as c,i as h}from"./utils.js";import{d as r}from"./ezp-dialog2.js";import{d}from"./ezp-icon2.js";import{d as u}from"./ezp-icon-button2.js";import{d as p}from"./ezp-label2.js";import{d as m}from"./ezp-status2.js";import{d as g}from"./ezp-text-button2.js";const z=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.authCancel=s(this,"authCancel",7),this.authSuccess=s(this,"authSuccess",7),this.userCancel=s(this,"userCancel",7),this.oauthPopupWindow=null,this.previousUrl=null,this.receiveMessage=t=>{if(this.oauthPopupWindow&&t.source&&t.source!==this.oauthPopupWindow)return void console.warn("[ezeep] Ignored auth message from an unexpected source window.");let e=null;try{e=new URL(this.redirectURI).origin}catch(t){e=null}e&&t.origin!==e?console.warn(`[ezeep] Ignored auth message from unexpected origin "${t.origin}" (expected "${e}").`):(a.state.code=t.data,this.auth.getAccessToken().then((()=>{this.authCancel.emit(),this.authSuccess.emit()})))}}listenDialogAction(){this.openSignInWindow(this.auth.authURI.toString(),"ezeep Login")}listenDialogClose(){this.authCancel.emit()}listenStatusCancel(){"file"===this.trigger?this.userCancel.emit():this.authCancel.emit()}connectedCallback(){this.unsubscribeLanguage=c(this)}disconnectedCallback(){var t;null===(t=this.unsubscribeLanguage)||void 0===t||t.call(this),window.removeEventListener("message",this.receiveMessage)}openSignInWindow(t,e){var s;if(a.state.isAuthorized)return this.authCancel.emit(),void this.authSuccess.emit();window.removeEventListener("message",this.receiveMessage);const i="toolbar=no, menubar=no, width=600, height=7000, top=100, left=100";null===this.oauthPopupWindow||this.oauthPopupWindow.closed?this.oauthPopupWindow=window.open(t,e,i):this.previousUrl!==this.auth.authURI.toString()?(this.oauthPopupWindow=window.open(t,e,i),this.oauthPopupWindow&&!this.oauthPopupWindow.closed&&void 0!==this.oauthPopupWindow.closed||alert("popup blocked"),null===(s=this.oauthPopupWindow)||void 0===s||s.focus()):this.oauthPopupWindow.focus(),window.addEventListener("message",this.receiveMessage,!1),this.previousUrl=this.auth.authURI}async componentWillLoad(){this.auth=new l(this.redirectURI,this.clientID),this.code&&(a.state.code=this.code,await this.auth.getAccessToken(),this.authCancel.emit(),this.authSuccess.emit()),!1===a.state.isAuthorized&&(this.auth.generateCodeVerifier(),await this.auth.generateCodeChallenge(a.state.codeVerifier),this.auth.buildAuthURI()),!this.hidelogin||"button"!==this.trigger&&"file"!==this.trigger||(a.state.isAuthorized?(this.authCancel.emit(),this.authSuccess.emit()):this.openSignInWindow(this.auth.authURI.toString(),"ezeep Login"))}render(){return i(o,{key:"c00096b96d6d21508d1a78d5ae5a7f552516d01f"},!this.hidelogin||"button"!==this.trigger&&"file"!==this.trigger?i("ezp-dialog",{heading:h.t("login_dialog.heading"),description:h.t("login_dialog.description"),action:h.t("login_dialog.action"),iconName:"logo",iconSize:"huge",iconFramed:!1,instance:"login"}):i("ezp-status",{description:h.t("login_dialog.action"),processing:!0,cancel:!0}))}static get style(){return":host{--ezp-theme-solid:var(--ezp-accent-cyan-solid);--ezp-theme-translucent:var(--ezp-accent-cyan-translucent);display:block}"}},[1,"ezp-auth",{clientID:[1025,"client-i-d"],redirectURI:[1025,"redirect-u-r-i"],hidelogin:[4],trigger:[1],code:[1],auth:[32],authURI:[32],accessToken:[32]},[[0,"dialogAction","listenDialogAction"],[0,"dialogClose","listenDialogClose"],[0,"statusCancel","listenStatusCancel"]]]);function b(){"undefined"!=typeof customElements&&["ezp-auth","ezp-dialog","ezp-icon","ezp-icon-button","ezp-label","ezp-status","ezp-text-button"].forEach((t=>{switch(t){case"ezp-auth":customElements.get(n(t))||customElements.define(n(t),z);break;case"ezp-dialog":customElements.get(n(t))||r();break;case"ezp-icon":customElements.get(n(t))||d();break;case"ezp-icon-button":customElements.get(n(t))||u();break;case"ezp-label":customElements.get(n(t))||p();break;case"ezp-status":customElements.get(n(t))||m();break;case"ezp-text-button":customElements.get(n(t))||g()}}))}export{z as E,b as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as a,Host as o,transformTag as n}from"@stencil/core/internal/client";const s=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.backdropHideStart=i(this,"backdropHideStart",7),this.backdropHideEnd=i(this,"backdropHideEnd",7),this.visible=!0}handleClick(){this.visible=!1,this.backdropHideStart.emit()}listenAnimationEnd(){this.visible||this.backdropHideEnd.emit()}render(){return a(o,{key:"
|
|
1
|
+
import{proxyCustomElement as t,HTMLElement as e,createEvent as i,h as a,Host as o,transformTag as n}from"@stencil/core/internal/client";const s=t(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.backdropHideStart=i(this,"backdropHideStart",7),this.backdropHideEnd=i(this,"backdropHideEnd",7),this.visible=!0}handleClick(){this.visible=!1,this.backdropHideStart.emit()}listenAnimationEnd(){this.visible||this.backdropHideEnd.emit()}render(){return a(o,{key:"723bc1fc67fbe5a491e80094ec2444f4d6f9ce32",class:{hide:!this.visible},onClick:()=>this.handleClick()})}get component(){return this}static get style(){return":host{-webkit-animation:var(--ezp-backdrop-animation-name, host-in) var(--ezp-duration-3) forwards var(--ezp-easing-out-quart);animation:var(--ezp-backdrop-animation-name, host-in) var(--ezp-duration-3) forwards var(--ezp-easing-out-quart);background:var(--ezp-core-backdrop);border-radius:var(--ezp-backdrop-border-radius, 6px);display:block;height:100%;left:0;opacity:0;position:absolute;top:0;width:100%;z-index:4}:host(.hide){--ezp-backdrop-animation-name:host-out}@-webkit-keyframes host-in{0%{opacity:0}100%{opacity:1}}@keyframes host-in{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes host-out{0%{opacity:1}100%{opacity:0}}@keyframes host-out{0%{opacity:1}100%{opacity:0}}"}},[1,"ezp-backdrop",{visible:[1028]},[[0,"animationend","listenAnimationEnd"]]]);function r(){"undefined"!=typeof customElements&&["ezp-backdrop"].forEach((t=>{"ezp-backdrop"===t&&(customElements.get(n(t))||customElements.define(n(t),s))}))}export{s as E,r as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as a,Host as o,transformTag as c}from"@stencil/core/internal/client";import{i as n,s}from"./utils.js";import{d}from"./ezp-icon2.js";import{d as l}from"./ezp-icon-button2.js";import{d as r}from"./ezp-label2.js";import{d as p}from"./ezp-text-button2.js";const b=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.dialogClose=i(this,"dialogClose",7),this.dialogAction=i(this,"dialogAction",7),this.action=n.t("button_actions.close"),this.iconSize="large",this.iconFramed=!0,this.handleClose=()=>{this.dialogClose.emit(this.instance)},this.handleAction=()=>{this.dialogAction.emit(this.instance)}}connectedCallback(){this.unsubscribeLanguage=s(this)}componentDidLoad(){var e;null===(e=this.box)||void 0===e||e.focus()}disconnectedCallback(){var e;null===(e=this.unsubscribeLanguage)||void 0===e||e.call(this)}handleKeydown(e){"Escape"!==e.key?"Tab"===e.key&&this.trapFocus(e):this.handleClose()}trapFocus(e){if(!this.box)return;const t=this.collectFocusable(this.box);if(0===t.length)return;const i=t[0],a=t[t.length-1],o=this.deepActiveElement();o&&t.includes(o)?e.shiftKey&&o===i?(e.preventDefault(),a.focus()):e.shiftKey||o!==a||(e.preventDefault(),i.focus()):(e.preventDefault(),i.focus())}collectFocusable(e){const t=[],i=e=>{e.querySelectorAll("*").forEach((e=>{e.tabIndex>=0&&!e.disabled&&t.push(e),e.shadowRoot&&i(e.shadowRoot)}))};return i(e),t}deepActiveElement(){var e;let t=document.activeElement;for(;null===(e=null==t?void 0:t.shadowRoot)||void 0===e?void 0:e.activeElement;)t=t.shadowRoot.activeElement;return t}render(){return a(o,{key:"4f86872972538970ab0d3e6e15055ae558537f4d"},a("div",{key:"fd78a41cf3f37ecc2481e6fb11c9031dcb45a063",id:"box",role:"dialog","aria-modal":"true","aria-label":this.heading,tabindex:-1,ref:e=>this.box=e},a("div",{key:"defd711c745edc2fd0be5349f67f6795659c4c80",id:"header"},a("ezp-icon-button",{key:"7da94b33c02de9acca8e5a77bb74757d36e607fd",level:"tertiary",icon:"close",type:"button",onClick:this.handleClose})),a("div",{key:"092387310d14f01aea60d0e7750de470a5184fe4",id:"body"},this.iconName&&a("ezp-icon",{key:"a933e2cb2e686544d9fbb31e3b7ee1eee2766deb",name:this.iconName,size:this.iconSize,framed:this.iconFramed}),a("div",{key:"45cafccc90a14bc5993c0696eed9567e01ab62e7",id:"text"},a("ezp-label",{key:"ffbd56a50d2fb7f6d62309eadeeb0f1da7fc93b6",text:this.heading,weight:"heavy"}),a("ezp-label",{key:"7563c3d9085eee67361c4ff8220da5c9a5de9d5c",text:this.description}))),a("div",{key:"999423e06a1b5721cc8c3788471235759e50b14a",id:"footer"},a("ezp-text-button",{key:"16c8a33207a06d3e1a436e08098bfd9b6587306e",type:"button",level:"primary",onClick:this.handleAction,label:this.action}))))}static get style(){return":host{--ezp-icon-fill:var(--ezp-theme-solid);-ms-flex-line-pack:center;align-content:center;background:var(--ezp-core-backdrop);display:grid;grid-template:auto/minmax(auto, 280px);height:100%;-ms-flex-pack:center;justify-content:center;left:0;position:fixed;top:0;width:100%}#box{background:var(--ezp-core-surface-tertiary);border-radius:6px;-webkit-box-shadow:var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-black-10));box-shadow:var(--ezp-dialog-box-boxShadow, 0 0 0 1px var(--ezp-black-10))}#header{display:-ms-flexbox;display:flex;-ms-flex-pack:end;justify-content:flex-end;padding:var(--ezp-spacing-2) var(--ezp-spacing-3)}#body{-ms-flex-align:center;align-items:center;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-5);padding:0 var(--ezp-spacing-5);text-align:center}#text{color:var(--ezp-core-foreground-primary);display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;gap:var(--ezp-spacing-4)}#footer{display:grid;grid-template:auto/minmax(144px, auto);-ms-flex-pack:center;justify-content:center;padding:var(--ezp-spacing-5)}"}},[1,"ezp-dialog",{heading:[1],description:[1],action:[1],iconName:[1,"icon-name"],iconSize:[1,"icon-size"],iconFramed:[4,"icon-framed"],instance:[1]},[[8,"keydown","handleKeydown"]]]);function f(){"undefined"!=typeof customElements&&["ezp-dialog","ezp-icon","ezp-icon-button","ezp-label","ezp-text-button"].forEach((e=>{switch(e){case"ezp-dialog":customElements.get(c(e))||customElements.define(c(e),b);break;case"ezp-icon":customElements.get(c(e))||d();break;case"ezp-icon-button":customElements.get(c(e))||l();break;case"ezp-label":customElements.get(c(e))||r();break;case"ezp-text-button":customElements.get(c(e))||p()}}))}export{b as E,f as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as o,HTMLElement as e,h as t,Host as n,transformTag as r}from"@stencil/core/internal/client";import{d as i}from"./ezp-icon2.js";const
|
|
1
|
+
import{proxyCustomElement as o,HTMLElement as e,h as t,Host as n,transformTag as r}from"@stencil/core/internal/client";import{d as i}from"./ezp-icon2.js";const a=o(class extends e{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.blank=!1,this.disabled=!1,this.level="primary"}render(){const o=void 0!==this.type?"button":"a",e=void 0!==this.type?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"},r=this.icon.replace(/[-_]/g," ");return t(n,{key:"7d3d43ec31503ff7ecc87e9f498ee5b2d09d5d96",class:`${this.level}`},t(o,Object.assign({key:"b7d5c646bb66ebff92d661574c647f8a2773a908",id:"button","aria-label":r},e),t("ezp-icon",{key:"bc4c322b7c9389a8aaa27feac7084ae9e1befaa4",name:this.icon})))}static get style(){return":host{display:block}:host(.primary){--ezp-iconButton-background-disabled:var(--ezp-core-shade-primary);--ezp-iconButton-background-init:var(--ezp-theme-solid);--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-white-100);--ezp-iconButton-opacity-active:0.74;--ezp-iconButton-opacity-hover:0.84}:host(.secondary){--ezp-iconButton-background-active:var(--ezp-core-shade-tertiary);--ezp-iconButton-background-disabled:var(--ezp-core-shade-primary);--ezp-iconButton-background-hover:var(--ezp-core-shade-secondary);--ezp-iconButton-background-init:var(--ezp-core-shade-primary);--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid)}:host(.tertiary){--ezp-iconButton-background-active:var(--ezp-core-shade-secondary);--ezp-iconButton-background-hover:var(--ezp-core-shade-primary);--ezp-iconButton-background-init:transparent;--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid)}:host(.quaternary){--ezp-iconButton-background-init:transparent;--ezp-iconButton-color-disabled:var(--ezp-core-foreground-tertiary);--ezp-iconButton-color-init:var(--ezp-theme-solid);--ezp-iconButton-opacity-active:0.58;--ezp-iconButton-opacity-hover:0.74}#button{-ms-flex-align:center;align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:var(--ezp-iconButton-background, var(--ezp-iconButton-background-init));border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:var(--ezp-iconButton-color, var(--ezp-iconButton-color-init));cursor:var(--ezp-iconButton-cursor, pointer);display:-ms-flexbox;display:flex;-ms-flex-pack:center;justify-content:center;margin:0;opacity:var(--ezp-iconButton-opacity, 1);outline:none;padding:var(--ezp-spacing-2)}@media (hover: hover){#button:not(:disabled):hover{--ezp-iconButton-background:var( --ezp-iconButton-background-hover, var(--ezp-iconButton-background-init) );--ezp-iconButton-opacity:var(--ezp-iconButton-opacity-hover, 1)}#button:not(:disabled):active{--ezp-iconButton-background:var( --ezp-iconButton-background-active, var(--ezp-iconButton-background-init) );--ezp-iconButton-opacity:var(--ezp-iconButton-opacity-active, 1)}}#button:disabled{--ezp-iconButton-background:var( --ezp-iconButton-background-disabled, var(--ezp-iconButton-background-init) );--ezp-iconButton-color:var(--ezp-iconButton-color-disabled);--ezp-iconButton-cursor:default}"}},[1,"ezp-icon-button",{blank:[4],disabled:[4],href:[1],icon:[1],level:[1],type:[1]}]);function c(){"undefined"!=typeof customElements&&["ezp-icon-button","ezp-icon"].forEach((o=>{switch(o){case"ezp-icon-button":customElements.get(r(o))||customElements.define(r(o),a);break;case"ezp-icon":customElements.get(r(o))||i()}}))}export{a as E,c as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as i,getAssetPath as n,h as r,Host as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as i,getAssetPath as n,h as r,Host as a,transformTag as t}from"@stencil/core/internal/client";const c=e(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.size="normal",this.framed=!1}async componentWillLoad(){await fetch(n(`./assets/glyph-${this.name}.svg`)).then((e=>e.text())).then((e=>{this.glyph=e})).catch((()=>{}))}render(){return r(a,{key:"e1b22ece00f1260a34561c8d1efd44c2d5f37c73",class:`${this.size} ${this.framed?"framed":""}`,"aria-hidden":"true"},r("div",{key:"0734d4b5fdc363303d69b7e5dc138f8caeaa316c",id:"glyph",innerHTML:this.glyph}))}static get assetsDirs(){return["assets"]}static get style(){return":host{-ms-flex-line-pack:center;align-content:center;background:var(--ezp-icon-background, transparent);border-radius:var(--ezp-icon-borderRadius, 0);display:grid;grid-template:var(--ezp-icon-gridTemplate)/var(--ezp-icon-gridTemplate);height:var(--ezp-icon-height, var(--ezp-icon-size));-ms-flex-pack:center;justify-content:center;padding:var(--ezp-icon-padding, 0);width:var(--ezp-icon-width, var(--ezp-icon-size))}:host(.framed){--ezp-icon-background:var(--ezp-core-shade-primary);--ezp-icon-borderRadius:50%;--ezp-icon-padding:var(--ezp-icon-frame)}:host(.normal){--ezp-icon-size:18px;--ezp-icon-gridTemplate:24px;--ezp-icon-frame:var(--ezp-spacing-3)}:host(.large){--ezp-icon-size:36px;--ezp-icon-gridTemplate:48px;--ezp-icon-frame:var(--ezp-spacing-4)}:host(.huge){--ezp-icon-size:54px;--ezp-icon-gridTemplate:72px;--ezp-icon-frame:var(--ezp-spacing-5)}svg{display:block;fill:var(--ezp-icon-fill, currentColor);height:100%;width:100%}"}},[1,"ezp-icon",{name:[1],size:[1],framed:[4]}]);function s(){"undefined"!=typeof customElements&&["ezp-icon"].forEach((e=>{"ezp-icon"===e&&(customElements.get(t(e))||customElements.define(t(e),c))}))}export{c as E,s as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,createEvent as i,h as r,Host as o,transformTag as n}from"@stencil/core/internal/client";import{d as a}from"./ezp-icon2.js";import{d as p}from"./ezp-label2.js";const s=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.inputValueChanged=i(this,"inputValueChanged",7),this.timeout=null,this.label="Label",this.type="text",this.icon="color",this.placeholder="",this.focused=!1,this.setFocus=()=>{var e;null===(e=this.input)||void 0===e||e.focus()},this.handleBlur=()=>{this.focused=!1},this.handleFocus=()=>{this.focused=!0}}handleChange(e){this.timeout&&clearTimeout(this.timeout);const t=e.target;this.value=t.value?t.value:"number"===this.type?0:"",this.timeout=setTimeout((()=>{this.inputValueChanged.emit({type:this.eventType.toLowerCase(),value:this.value})}),500)}render(){return r(o,{key:"ba8958137bce0592dbe4ec23c03284885f570e27",class:{focused:this.focused},onClick:this.setFocus},r("ezp-icon",{key:"9d3b108841ffdabec9b9a98d6d6b2ea19fba37fc",id:"icon",name:this.icon}),r("ezp-label",{key:"5fee00202e9c6407bddf8a1b7090d983d79e42b3",id:"label",noWrap:!0,level:"secondary",text:this.label}),r("input",{key:"99c71e9c6d29193046bd0b6094efbac828ffab15",id:"input",type:this.type,value:this.value,placeholder:this.placeholder,"aria-label":this.label,onInput:e=>this.handleChange(e),ref:e=>this.input=e,onFocus:this.handleFocus,onBlur:this.handleBlur}),this.suffix?r("ezp-label",{id:"suffix",level:"secondary",text:this.suffix}):null)}static get style(){return':host{-ms-flex-align:center;align-items:center;background:transparent;cursor:text;display:grid;gap:var(--ezp-spacing-3);grid-template:var(--ezp-input-grid-template, auto/auto auto 1fr);height:56px;padding:var(--ezp-spacing-2) var(--ezp-spacing-3);position:relative;z-index:var(--ezp-input-z-index, 3)}:host([suffix]){--ezp-input-grid-template:auto / auto auto 1fr auto;--ezp-input-input-padding-right:0}:host(.focused){--ezp-input-label-color:var(--ezp-core-foreground-primary)}#label{color:var(--ezp-input-label-color, var(--ezp-core-foreground-primary))}#icon{--ezp-icon-background:var(--ezp-theme-translucent);--ezp-icon-borderRadius:50%;--ezp-icon-height:40px;--ezp-icon-width:40px;color:var(--ezp-input-icon-color, var(--ezp-theme-solid))}#input{-webkit-appearance:textfield;-moz-appearance:textfield;appearance:textfield;background:transparent;border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;-webkit-box-sizing:border-box;box-sizing:border-box;color:var(--ezp-core-foreground-primary);cursor:text;font-family:inherit;-webkit-font-feature-settings:"tnum";font-feature-settings:"tnum";font-size:14px;font-weight:600;-webkit-font-smoothing:antialiased;height:30px;letter-spacing:-0.0062235443em;margin:0;outline:none;padding:0 var(--ezp-input-input-padding-right, var(--ezp-spacing-1)) 0 0;text-align:right;width:100%}#input::-webkit-input-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input::-moz-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input:-ms-input-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input::-ms-input-placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input::placeholder{color:var(--ezp-core-foreground-tertiary);font-weight:400}#input[type=number]::-webkit-inner-spin-button,#input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}#suffix{color:var(--ezp-core-foreground-tertiary)}'}},[1,"ezp-input",{label:[1],value:[1032],type:[1],icon:[1],suffix:[513],eventType:[1,"event-type"],placeholder:[1],focused:[32]}]);function l(){"undefined"!=typeof customElements&&["ezp-input","ezp-icon","ezp-label"].forEach((e=>{switch(e){case"ezp-input":customElements.get(n(e))||customElements.define(n(e),s);break;case"ezp-icon":customElements.get(n(e))||a();break;case"ezp-label":customElements.get(n(e))||p()}}))}export{s as E,l as d}
|