@ezeep/ezeep-js 1.0.290 → 1.0.302
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/ezeep.cjs.js +1 -1
- package/dist/cjs/{ezp-auth_15.cjs.entry.js → ezp-auth_16.cjs.entry.js} +572 -139
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/ezp-file-name/ezp-file-name.css +98 -0
- package/dist/collection/components/ezp-file-name/ezp-file-name.js +280 -0
- package/dist/collection/components/ezp-icon/ezp-icon.js +1 -1
- package/dist/collection/components/ezp-icon-button/ezp-icon-button.js +1 -1
- package/dist/collection/components/ezp-input/ezp-input.css +11 -2
- package/dist/collection/components/ezp-input/ezp-input.js +3 -5
- package/dist/collection/components/ezp-label/ezp-label.js +39 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +45 -17
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +220 -88
- package/dist/collection/components/ezp-printing/ezp-printing.js +1 -1
- package/dist/collection/components/ezp-select/ezp-select.css +9 -12
- package/dist/collection/components/ezp-select/ezp-select.js +1 -1
- package/dist/collection/components/ezp-status/ezp-status.js +2 -2
- package/dist/collection/components/ezp-stepper/ezp-stepper.js +1 -1
- package/dist/collection/components/ezp-text-button/ezp-text-button.css +3 -1
- package/dist/collection/components/ezp-text-button/ezp-text-button.js +1 -1
- package/dist/collection/components/ezp-upload/ezp-upload.css +176 -143
- package/dist/collection/components/ezp-upload/ezp-upload.js +56 -9
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.js +1 -1
- package/dist/collection/shared/storage.js +39 -9
- package/dist/collection/types/shared/types.d.ts +1 -0
- package/dist/collection/utils/printer.js +75 -1
- package/dist/components/auth.js +1 -1
- package/dist/components/ezp-file-name.d.ts +11 -0
- package/dist/components/ezp-file-name.js +1 -0
- package/dist/components/ezp-file-name2.js +1 -0
- 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-label2.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-menu2.js +1 -1
- package/dist/components/utils.js +1 -1
- package/dist/directives/proxies.ts +26 -1
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +572 -140
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +2 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/{p-6a494b7b.system.entry.js → p-636e190f.system.entry.js} +2 -2
- package/dist/ezeep/p-DCznw2Ee.system.js +1 -1
- package/dist/ezeep/p-ff075048.entry.js +1 -0
- package/dist/ezeep/types/shared/types.d.ts +1 -0
- package/dist/types/components/ezp-file-name/ezp-file-name.d.ts +83 -0
- package/dist/types/components/ezp-label/ezp-label.d.ts +10 -0
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +41 -1
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +8 -1
- package/dist/types/components.d.ts +65 -4
- package/dist/types/shared/storage.d.ts +18 -4
- package/dist/types/shared/types.d.ts +1 -0
- package/dist/types/utils/printer.d.ts +18 -0
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/{p-6a494b7b.system.entry.js → p-636e190f.system.entry.js} +2 -2
- package/www/build/p-DCznw2Ee.system.js +1 -1
- package/www/build/p-a2a4f55b.js +1 -0
- package/www/build/p-ff075048.entry.js +1 -0
- package/www/data/locales/de.json +6 -9
- package/www/data/locales/en.json +6 -9
- package/www/index.html +1 -1
- package/dist/ezeep/p-0df147f4.entry.js +0 -1
- package/www/build/p-0df147f4.entry.js +0 -1
- package/www/build/p-67021add.js +0 -1
|
@@ -84,7 +84,7 @@ export class EzpUserMenu {
|
|
|
84
84
|
*
|
|
85
85
|
*/
|
|
86
86
|
render() {
|
|
87
|
-
return (h(Host, { key: '
|
|
87
|
+
return (h(Host, { key: 'cd2505f64646e8f23d534896c01fcd246d974c2f', class: this.open ? 'is-open' : '' }, h("div", { key: '65df837d1eee8b2275f8c0ef72b039c7ae6d08cd', id: "header" }, h("ezp-label", { key: '3ca9bc9d616de1e4efc686f77bcdaa39dab3f18d', ellipsis: true, id: "name", weight: "heavy", text: this.name }), h("ezp-icon-button", { key: '119abe7450937b7cf2e70ff3ed96d01f3f0aff9d', id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })), h("div", { key: '90f40d22672bc65cbf988cf2ab57cbc088218cfd', id: "links" }, this.links.map((link) => (h("a", { class: "link", href: link.href, target: "_blank", rel: "noopener noreferrer" }, h("ezp-icon", { class: "link__icon", name: link.icon }), h("ezp-label", { text: link.title })))), h("a", { key: '94df9033da5697739c690a180ed2df318f803511', class: "link", onClick: this.logOut }, h("ezp-icon", { key: '609044f6d8255e4378aee226e16c29e9242c8259', class: "link__icon", name: "logout" }), h("ezp-label", { key: '20953a49845a8c4e75081c597d8e916c3b159b51', text: i18next.t('user_menu.logout') }))), h("div", { key: '4b96f92ceb1047c4a88f0b33406a297323eded75', id: "theme" }, h("ezp-label", { key: '156893ed3703f63ee826e4887fa711469603b6c8', class: "caption", text: `${i18next.t('user_menu.theme')}:`, weight: "heavy" }), h("div", { key: '2ee3ec8725a98d5dc7d7f792fed969c2dea357f4', id: "swatches" }, this.themes.map((theme) => (h("button", { class: `swatch swatch--${theme} ${theme === userStore.state.theme ? 'selected' : ''}`, onClick: () => this.handleTheme(theme) }, h("span", { class: "dot" })))))), h("div", { key: 'd78d2b935d9cdb15df66d761dd9290a68db09e9c', id: "appearance" }, h("ezp-label", { key: 'f290affaf49bd01a06f576a4d52b3d1936dbdb23', class: "caption", text: `${i18next.t('user_menu.appearance')}:`, weight: "heavy" }), h("div", { key: '8087488313dbd2898280d3abb6244485b97e4ee4', id: "tabs" }, this.appearances.map((appearance) => (h("button", { class: `tab ${appearance.name === userStore.state.appearance ? 'selected' : ''}`, onClick: () => this.handleAppearance(appearance.name) }, h("ezp-icon", { name: appearance.name }), h("ezp-label", { text: appearance.title, level: "tertiary", weight: "strong" }))))))));
|
|
88
88
|
}
|
|
89
89
|
static get is() { return "ezp-user-menu"; }
|
|
90
90
|
static get encapsulation() { return "shadow"; }
|
|
@@ -11,8 +11,10 @@ const KEY = {
|
|
|
11
11
|
accessToken: 'access_token',
|
|
12
12
|
refreshToken: 'refreshToken',
|
|
13
13
|
isAuthorized: 'isAuthorized',
|
|
14
|
+
/** Legacy single-printer settings blob, read once to seed `printerSettings`. */
|
|
14
15
|
properties: 'properties',
|
|
15
16
|
printer: 'printer',
|
|
17
|
+
printerSettings: 'printerSettings',
|
|
16
18
|
};
|
|
17
19
|
function getJSON(key) {
|
|
18
20
|
const raw = localStorage.getItem(key);
|
|
@@ -43,29 +45,57 @@ export const storage = {
|
|
|
43
45
|
hasIsAuthorized() {
|
|
44
46
|
return localStorage.getItem(KEY.isAuthorized) !== null;
|
|
45
47
|
},
|
|
46
|
-
|
|
47
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Settings the user last printed with on `printerId`, or null if that printer
|
|
50
|
+
* has none yet. Kept per printer so switching printers never carries another
|
|
51
|
+
* printer's paper size or tray over to one that may not have it.
|
|
52
|
+
*/
|
|
53
|
+
getPrinterSettings(printerId) {
|
|
54
|
+
var _a;
|
|
55
|
+
return (_a = readPrinterSettings()[printerId]) !== null && _a !== void 0 ? _a : null;
|
|
48
56
|
},
|
|
49
|
-
|
|
50
|
-
|
|
57
|
+
setPrinterSettings(printerId, properties) {
|
|
58
|
+
const all = readPrinterSettings();
|
|
59
|
+
all[printerId] = properties;
|
|
60
|
+
localStorage.setItem(KEY.printerSettings, JSON.stringify(all));
|
|
51
61
|
},
|
|
62
|
+
/** The printer used for the last print, preselected when the dialog reopens. */
|
|
52
63
|
getPrinter() {
|
|
53
64
|
return getJSON(KEY.printer);
|
|
54
65
|
},
|
|
55
66
|
setPrinter(printer) {
|
|
56
67
|
localStorage.setItem(KEY.printer, JSON.stringify(printer));
|
|
57
68
|
},
|
|
58
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Remove everything tied to the current session (used on logout).
|
|
71
|
+
*
|
|
72
|
+
* Print settings and the last printer deliberately survive: they belong to
|
|
73
|
+
* this browser profile rather than to the session, and are validated against
|
|
74
|
+
* the signed-in user's printers on the next load (an unknown printer resets
|
|
75
|
+
* the selection), so the next user never inherits a selection they can't use.
|
|
76
|
+
*/
|
|
59
77
|
clearSession() {
|
|
60
|
-
localStorage.removeItem(KEY.properties);
|
|
61
78
|
localStorage.removeItem(KEY.refreshToken);
|
|
62
79
|
localStorage.removeItem(KEY.accessToken);
|
|
63
|
-
localStorage.removeItem(KEY.printer);
|
|
64
80
|
localStorage.removeItem(KEY.isAuthorized);
|
|
65
81
|
},
|
|
66
|
-
/**
|
|
82
|
+
/** Forget which printer was last used (when it is gone from the user's list).
|
|
83
|
+
* Its settings stay put, ready in case that printer comes back. */
|
|
67
84
|
clearSavedPrinter() {
|
|
68
85
|
localStorage.removeItem(KEY.printer);
|
|
69
|
-
localStorage.removeItem(KEY.properties);
|
|
70
86
|
},
|
|
71
87
|
};
|
|
88
|
+
/**
|
|
89
|
+
* Read the per-printer settings map, seeding it once from the pre-upgrade
|
|
90
|
+
* single-printer blob so a user who already printed keeps those settings.
|
|
91
|
+
*/
|
|
92
|
+
function readPrinterSettings() {
|
|
93
|
+
const stored = getJSON(KEY.printerSettings);
|
|
94
|
+
if (stored)
|
|
95
|
+
return stored;
|
|
96
|
+
const legacy = getJSON(KEY.properties);
|
|
97
|
+
const legacyPrinter = getJSON(KEY.printer);
|
|
98
|
+
if (legacy && (legacyPrinter === null || legacyPrinter === void 0 ? void 0 : legacyPrinter.id))
|
|
99
|
+
return { [legacyPrinter.id]: legacy };
|
|
100
|
+
return {};
|
|
101
|
+
}
|
|
@@ -52,6 +52,7 @@ export type TextButtonLevelTypes = 'primary' | 'secondary' | 'tertiary'
|
|
|
52
52
|
export type TextButtonTypeTypes = 'button'
|
|
53
53
|
export type LabelLevelTypes = 'primary' | 'secondary' | 'tertiary'
|
|
54
54
|
export type WeightTypes = 'soft' | 'strong' | 'heavy'
|
|
55
|
+
export type TooltipPlacementTypes = 'top' | 'bottom'
|
|
55
56
|
export type ThemeTypes = 'pink' | 'red' | 'orange' | 'green' | 'teal' | 'cyan' | 'blue' | 'violet'
|
|
56
57
|
export type AppearanceTypes = 'system' | 'light' | 'dark'
|
|
57
58
|
export type TriggerTypes = 'custom' | 'file' | 'button'
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { JobStatus, PROCESSING_JOB_STATUSES, FAILED_JOB_STATUSES, HUB_DRIVER_ERROR_CODES, } from "../shared/constants";
|
|
1
|
+
import { JobStatus, PROCESSING_JOB_STATUSES, FAILED_JOB_STATUSES, HUB_DRIVER_ERROR_CODES, PAPER_ID, } from "../shared/constants";
|
|
2
|
+
/** Duplex modes the dialog offers: none, long edge, short edge. */
|
|
3
|
+
const DUPLEX_MODES = [1, 2, 3];
|
|
2
4
|
/**
|
|
3
5
|
* Derive the default print properties for a printer from its configuration.
|
|
4
6
|
*
|
|
@@ -41,6 +43,78 @@ export function applyPrinterDefaults(config, properties) {
|
|
|
41
43
|
delete properties.PageRanges;
|
|
42
44
|
return properties;
|
|
43
45
|
}
|
|
46
|
+
/**
|
|
47
|
+
* Carry the settings the user last printed with on this printer over the
|
|
48
|
+
* printer's own defaults, dropping anything the printer can no longer do.
|
|
49
|
+
*
|
|
50
|
+
* Capabilities change between sessions — a printer loses a tray, an admin
|
|
51
|
+
* swaps the paper formats — and a stale value would otherwise be sent to the
|
|
52
|
+
* API or shown as a selection that isn't in the list. Each field is therefore
|
|
53
|
+
* only restored if the current config still offers it; everything else stays
|
|
54
|
+
* on the default `applyPrinterDefaults` just put in place. Copies and page
|
|
55
|
+
* ranges are never part of `saved`, so they are never restored.
|
|
56
|
+
*/
|
|
57
|
+
export function applySavedProperties(config, saved, properties) {
|
|
58
|
+
var _a, _b, _c, _d, _e;
|
|
59
|
+
applyPrinterDefaults(config, properties);
|
|
60
|
+
if (!saved)
|
|
61
|
+
return properties;
|
|
62
|
+
if (config.ColorSupported && typeof saved.color === 'boolean') {
|
|
63
|
+
properties.color = saved.color;
|
|
64
|
+
}
|
|
65
|
+
if (config.DuplexSupported && DUPLEX_MODES.includes(Number(saved.duplexmode))) {
|
|
66
|
+
properties.duplex = true;
|
|
67
|
+
properties.duplexmode = Number(saved.duplexmode);
|
|
68
|
+
}
|
|
69
|
+
const paper = (_a = config.PaperFormats) === null || _a === void 0 ? void 0 : _a.find((format) => format.Id === Number(saved.paperid));
|
|
70
|
+
if (paper) {
|
|
71
|
+
properties.paper = paper.Name;
|
|
72
|
+
properties.paperid = paper.Id;
|
|
73
|
+
// Only meaningful for the custom format, which carries its own dimensions.
|
|
74
|
+
if (paper.Id === PAPER_ID) {
|
|
75
|
+
properties.paperwidth = saved.paperwidth;
|
|
76
|
+
properties.paperlength = saved.paperlength;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
// Orientations are offered as 1-based positions in `OrientationsSupported`.
|
|
80
|
+
const orientation = Number(saved.orientation);
|
|
81
|
+
if (orientation >= 1 && orientation <= ((_c = (_b = config.OrientationsSupported) === null || _b === void 0 ? void 0 : _b.length) !== null && _c !== void 0 ? _c : 0)) {
|
|
82
|
+
properties.orientation = orientation;
|
|
83
|
+
}
|
|
84
|
+
if (typeof saved.resolution === 'string' && ((_d = config.Resolutions) === null || _d === void 0 ? void 0 : _d.includes(saved.resolution))) {
|
|
85
|
+
properties.resolution = saved.resolution;
|
|
86
|
+
}
|
|
87
|
+
if (hasTrays(config)) {
|
|
88
|
+
const tray = (_e = config.Trays) === null || _e === void 0 ? void 0 : _e.find((option) => (option === null || option === void 0 ? void 0 : option.Index) === Number(saved.defaultSource));
|
|
89
|
+
if (tray) {
|
|
90
|
+
properties.trayname = tray.Name;
|
|
91
|
+
properties.defaultSource = tray.Index;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return properties;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The slice of the current selection worth remembering for next time: what the
|
|
98
|
+
* print dialog offers per printer, minus copies and page ranges, which belong
|
|
99
|
+
* to the one document being printed rather than to the printer.
|
|
100
|
+
*/
|
|
101
|
+
export function pickRememberedProperties(properties) {
|
|
102
|
+
const { color, duplex, duplexmode, paper, paperid, paperwidth, paperlength } = properties;
|
|
103
|
+
const { orientation, resolution, trayname, defaultSource } = properties;
|
|
104
|
+
return {
|
|
105
|
+
color,
|
|
106
|
+
duplex,
|
|
107
|
+
duplexmode,
|
|
108
|
+
paper,
|
|
109
|
+
paperid,
|
|
110
|
+
paperwidth,
|
|
111
|
+
paperlength,
|
|
112
|
+
orientation,
|
|
113
|
+
resolution,
|
|
114
|
+
trayname,
|
|
115
|
+
defaultSource,
|
|
116
|
+
};
|
|
117
|
+
}
|
|
44
118
|
/** Does this printer config report an explicit "no usable trays" state? */
|
|
45
119
|
export function hasNoTrays(config) {
|
|
46
120
|
return !!config.Trays && config.Trays.length >= 0 && config.Trays[0] == null;
|
package/dist/components/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
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)}})(),
|
|
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)}})(),n=e.forceUpdate,o=e.getRenderingRef,s=(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},n=r();let o=new Map(Object.entries(n));const i="undefined"!=typeof Proxy,c=i?null:{},a={dispose:[],get:[],set:[],reset:[]},h=new Map,l=()=>{o=new Map(Object.entries(r())),i||S(),a.reset.forEach((e=>e()))},u=e=>(a.get.forEach((t=>t(e))),o.get(e)),d=(e,r)=>{const n=o.get(e);t(r,n,e)&&(o.set(e,r),i||p(e),a.set.forEach((t=>t(e,r,n))))},f=i?new Proxy(n,{get:(e,t)=>u(t),ownKeys:()=>Array.from(o.keys()),getOwnPropertyDescriptor:()=>({enumerable:!0,configurable:!0}),has:(e,t)=>o.has(t),set:(e,t,r)=>(d(t,r),!0)}):(S(),c),g=(e,t)=>(a[e].push(t),()=>{s(a[e],t)});function p(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(o.keys());for(const t of Object.keys(c))e.has(t)||delete c[t];for(const t of e)p(t)}return{state:f,get:u,set:d,on:g,onChange:(e,t)=>{const n=(r,n)=>{r===e&&t(n)},o=()=>{const n=r();t(n[e])},s=g("set",n),i=g("reset",o);return h.set(t,{setHandler:n,resetHandler:o,propName:e}),()=>{s(),i(),h.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:()=>{a.dispose.forEach((e=>e())),l()},reset:l,forceUpdate:e=>{const t=o.get(e);a.set.forEach((r=>r(e,t,t)))},removeListener:(e,t)=>{const r=h.get(t);r&&r.propName===e&&(s(a.set,r.setHandler),s(a.reset,r.resetHandler),h.delete(t))}}})(e,t);return i.use((()=>{if("function"!=typeof o||"function"!=typeof n)return{};const e=n,t=o,s=new Map;return{dispose:()=>s.clear(),get:e=>{const r=t();r&&((e,t,r)=>{let n=e.get(t);n||(n=[],e.set(t,n)),n.some((e=>e.deref()===r))||n.push(new WeakRef(r))})(s,e,r)},set:t=>{const n=s.get(t);if(n){const r=n.filter((t=>{const r=t.deref();return!!r&&e(r)}));s.set(t,r)}r(s)},reset:()=>{s.forEach((t=>{t.forEach((t=>{const r=t.deref();r&&e(r)}))})),r(s)}}})()),i},c="refreshToken",a="isAuthorized",h="printer",l="printerSettings";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),getPrinterSettings(e){var t;return null!==(t=f()[e])&&void 0!==t?t:null},setPrinterSettings(e,t){const r=f();r[e]=t,localStorage.setItem(l,JSON.stringify(r))},getPrinter:()=>u(h),setPrinter(e){localStorage.setItem(h,JSON.stringify(e))},clearSession(){localStorage.removeItem(c),localStorage.removeItem("access_token"),localStorage.removeItem(a)},clearSavedPrinter(){localStorage.removeItem(h)}};function f(){const e=u(l);if(e)return e;const t=u("properties"),r=u(h);return t&&(null==r?void 0:r.id)?{[r.id]:t}:{}}class g{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),n=btoa(String.fromCharCode(...new Uint8Array(r)));this.codeChallenge=n.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 S(){const e=new URLSearchParams(window.location.search).get("code");window.opener&&e&&(window.opener.postMessage(e,p.state.redirectUri),window.close())}export{g as E,p as a,S as b,i as c,d as s}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface EzpFileName extends Components.EzpFileName, HTMLElement {}
|
|
4
|
+
export const EzpFileName: {
|
|
5
|
+
prototype: EzpFileName;
|
|
6
|
+
new (): EzpFileName;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e,d as o}from"./ezp-file-name2.js";const s=e,a=o;export{s as EzpFileName,a as defineCustomElement}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as i,Host as a,transformTag as s}from"@stencil/core/internal/client";import{d as o}from"./ezp-label2.js";const r=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.openGeneration=0,this.name="",this.level="secondary",this.weight="soft",this.placement="top",this.expanded=!1,this.tooltipOpen=!1,this.openTooltip=()=>{if(!this.hasHover||this.expanded)return;clearTimeout(this.openTimeout);const e=++this.openGeneration;this.openTimeout=setTimeout((async()=>{await this.isClipped()&&e===this.openGeneration&&(this.tooltipOpen=!0)}),300)},this.closeTooltip=()=>{this.openGeneration++,clearTimeout(this.openTimeout),clearTimeout(this.closeTimeout),this.tooltipOpen=!1},this.scheduleClose=()=>{clearTimeout(this.openTimeout),clearTimeout(this.closeTimeout),this.closeTimeout=setTimeout(this.closeTooltip,200)},this.cancelScheduledClose=()=>{clearTimeout(this.closeTimeout)},this.toggleExpanded=()=>{this.expanded=!this.expanded,this.expanded&&this.closeTooltip()}}disconnectedCallback(){clearTimeout(this.openTimeout),clearTimeout(this.closeTimeout)}handleKeyDown(e){"Escape"===e.key&&this.tooltipOpen&&(e.stopPropagation(),this.closeTooltip())}get hasHover(){var e,t;return null!==(t=null===(e=window.matchMedia)||void 0===e?void 0:e.call(window,"(hover: hover)").matches)&&void 0!==t&&t}async isClipped(){var e,t;const i=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelector(".head");return!!i&&(await(null===(t=i.componentOnReady)||void 0===t?void 0:t.call(i)),i.isTruncated())}render(){const e=!this.expanded&&this.name.length>8,t=e?this.name.slice(0,-8):this.name,s=e?this.name.slice(-8):"";return i(a,{key:"4e84aca15abf4d1e59f2418fff0fdc13efd2a7b2",class:{expanded:this.expanded,[`place-${this.placement}`]:!0}},i("button",{key:"61de272bffc87cd440cd307ba49bee1f9795f8ae",type:"button",id:"trigger","aria-label":this.name,"aria-expanded":this.expanded?"true":"false",onClick:this.toggleExpanded,onMouseEnter:this.openTooltip,onMouseLeave:this.scheduleClose,onFocus:this.openTooltip,onBlur:this.closeTooltip},i("ezp-label",{key:"d8120b13f24c5921d688431f90f7967b60fe4878",class:"head",ellipsis:e,level:this.level,weight:this.weight,text:t}),e&&i("ezp-label",{key:"9129bedf96a55bd650efca46a3f2e7e599af2776",class:"tail",level:this.level,weight:this.weight,text:s})),this.tooltipOpen&&i("div",{key:"fb710729e9262fca148c342bf99c001fd5a760c3",id:"tooltip","aria-hidden":"true",onMouseEnter:this.cancelScheduledClose,onMouseLeave:this.closeTooltip},this.name))}get host(){return this}static get style(){return'@charset "UTF-8";:host{display:block;min-width:0}#trigger{-ms-flex-align:baseline;align-items:baseline;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:transparent;border:0;border-radius:4px;color:inherit;cursor:pointer;display:-ms-flexbox;display:flex;font-family:inherit;margin:0;max-width:100%;min-width:0;outline-color:var(--ezp-theme-solid);outline-offset:2px;padding:0;text-align:left}.head{-ms-flex:0 1 auto;flex:0 1 auto;min-width:0}.tail{-ms-flex:0 0 auto;flex:0 0 auto}:host(:not(.expanded)) .head,:host(:not(.expanded)) .tail{--ezp-label-whiteSpace:pre}:host(.expanded) .head{--ezp-label-whiteSpace:pre-wrap}:host(.expanded) #trigger{word-break:break-all}#tooltip{background:var(--ezp-core-surface-tertiary);border-radius:8px;-webkit-box-shadow:0 0 0 1px var(--ezp-core-outline), 0 16px 40px -16px var(--ezp-core-backdrop);box-shadow:0 0 0 1px var(--ezp-core-outline), 0 16px 40px -16px var(--ezp-core-backdrop);color:var(--ezp-core-foreground-primary);font-size:12px;font-weight:500;left:0;line-height:18px;padding:var(--ezp-spacing-2) var(--ezp-spacing-3);pointer-events:auto;position:absolute;right:0;word-break:break-all;z-index:10}:host(.place-top) #tooltip{bottom:calc(100% + var(--ezp-spacing-2))}:host(.place-bottom) #tooltip{top:calc(100% + var(--ezp-spacing-2))}'}},[1,"ezp-file-name",{name:[1],level:[1],weight:[1],placement:[1],expanded:[32],tooltipOpen:[32]},[[10,"keydown","handleKeyDown"]]]);function n(){"undefined"!=typeof customElements&&["ezp-file-name","ezp-label"].forEach((e=>{switch(e){case"ezp-file-name":customElements.get(s(e))||customElements.define(s(e),r);break;case"ezp-label":customElements.get(s(e))||o()}}))}export{r as E,n as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as o,HTMLElement as
|
|
1
|
+
import{proxyCustomElement as o,HTMLElement as t,h as e,Host as n,transformTag as r}from"@stencil/core/internal/client";import{d as i}from"./ezp-icon2.js";const a=o(class extends t{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",t=void 0!==this.type?{type:this.type,disabled:this.disabled}:{href:this.href,target:this.blank?"_blank":"_self"},r=this.icon.replace(/[-_]/g," ");return e(n,{key:"d67a43c2b91eaa4fa79dd8559824f3ffc23757b2",class:`${this.level}`},e(o,Object.assign({key:"3b11b4e0c40c8f900496ae03a4eee11f0980cd80",id:"button","aria-label":r},t),e("ezp-icon",{key:"14a35e8f779628197f7dd89219792d7809990631",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 t,transformTag as a}from"@stencil/core/internal/client";const s=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(t,{key:"f1a45d38b75ccf4e0c5e6200d9d04c7e5766bfbc",class:`${this.size} ${this.framed?"framed":""}`,"aria-hidden":"true"},r("div",{key:"70f6963181d31089fefb662079e1e075540d2fe7",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 c(){"undefined"!=typeof customElements&&["ezp-icon"].forEach((e=>{"ezp-icon"===e&&(customElements.get(a(e))||customElements.define(a(e),s))}))}export{s as E,c 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 o,Host as r,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.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(){const e=!!this.icon;return o(r,{key:"f36f5811ba4e86b0aa3f53be916220136a1d2443",class:{focused:this.focused,"has-icon":e},onClick:this.setFocus},e?o("ezp-icon",{id:"icon",name:this.icon}):null,o("ezp-label",{key:"88f93411e1463b23ca4ae88d278a69df5038509d",id:"label",noWrap:!0,level:"secondary",text:this.label}),o("input",{key:"b23ba3c8fea465a559e9c6d7b3da50152b412a1c",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?o("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 1fr);height:56px;padding:var(--ezp-spacing-2) var(--ezp-spacing-3);position:relative;z-index:var(--ezp-input-z-index, 3)}:host(.has-icon){--ezp-input-grid-template:auto / auto auto 1fr}:host([suffix]){--ezp-input-grid-template:auto / auto 1fr auto;--ezp-input-input-padding-right:0}:host([suffix].has-icon){--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;-webkit-font-smoothing:antialiased;font-weight:600;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 u(){"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,u as d}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{proxyCustomElement as e,HTMLElement as t,h as l,Host as a,transformTag as i}from"@stencil/core/internal/client";const
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as l,Host as a,transformTag as i}from"@stencil/core/internal/client";const o=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.ellipsis=!1,this.level="secondary",this.noWrap=!1,this.text="Label",this.weight="soft"}async isTruncated(){var e;const t=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelector("#text");return!!t&&t.scrollWidth>t.clientWidth+1}render(){return l(a,{key:"42139679511e711132912a1f762d345951fd1774",class:`${this.level} ${this.weight} ${this.ellipsis?"ellipsis":""} ${this.noWrap?"no-wrap":""}`},l("div",{key:"5e54e8142d274cacb375cce8d5ef52ccdeaeec84",id:"text"},this.text))}get host(){return this}static get style(){return':host{display:block;min-width:var(--ezp-label-minWidth, auto);padding-bottom:1px;padding-top:1px}:host::before,:host::after{content:"";display:block;height:0}:host::before{margin-top:calc((var(--ezp-label-offset) + 1px) * -1)}:host::after{margin-bottom:calc((var(--ezp-label-offset) + 1px) * -1)}:host(.no-wrap){--ezp-label-whiteSpace:nowrap}:host(.ellipsis){--ezp-label-minWidth:0;--ezp-label-overflow:hidden;--ezp-label-textOverflow:ellipsis;--ezp-label-whiteSpace:nowrap;--ezp-label-width:100%}:host(.primary){--ezp-label-fontSize:17px;--ezp-label-lineHeight:24px;--ezp-label-letterSpacing:-0.0127756105em;--ezp-label-offset:6px}:host(.secondary){--ezp-label-fontSize:14px;--ezp-label-lineHeight:20px;--ezp-label-letterSpacing:-0.0062235443em;--ezp-label-offset:5px}:host(.tertiary){--ezp-label-fontSize:12px;--ezp-label-lineHeight:18px;--ezp-label-letterSpacing:0.0004907745em;--ezp-label-offset:5px}:host(.soft){--ezp-label-fontWeight:400}:host(.strong){--ezp-label-fontWeight:500}:host(.heavy){--ezp-label-fontWeight:600}#text{font-size:var(--ezp-label-fontSize);font-weight:var(--ezp-label-fontWeight);letter-spacing:var(--ezp-label-letterSpacing);line-height:var(--ezp-label-lineHeight);overflow:var(--ezp-label-overflow, visible);text-overflow:var(--ezp-label-textOverflow, clip);white-space:var(--ezp-label-whiteSpace, normal);width:var(--ezp-label-width, auto)}'}},[1,"ezp-label",{ellipsis:[4],level:[1],noWrap:[4,"no-wrap"],text:[1],weight:[1],isTruncated:[64]}]);function p(){"undefined"!=typeof customElements&&["ezp-label"].forEach((e=>{"ezp-label"===e&&(customElements.get(i(e))||customElements.define(i(e),o))}))}export{o as E,p as d}
|