@ezeep/ezeep-js 1.0.294 → 1.0.306
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} +674 -110
- 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 +411 -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.js +1 -1
- package/dist/collection/components/ezp-label/ezp-label.js +39 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +31 -3
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +243 -90
- package/dist/collection/components/ezp-printing/ezp-printing.js +20 -2
- 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.js +1 -1
- package/dist/collection/components/ezp-upload/ezp-upload.css +26 -1
- package/dist/collection/components/ezp-upload/ezp-upload.js +14 -3
- 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 +2 -0
- package/dist/collection/utils/printer.js +75 -1
- package/dist/collection/utils/utils.js +29 -0
- 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 +38 -4
- package/dist/esm/ezeep.js +1 -1
- package/dist/esm/{ezp-auth_15.entry.js → ezp-auth_16.entry.js} +674 -111
- 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-646c1d42.entry.js +1 -0
- package/dist/ezeep/p-8e2d88a9.system.entry.js +7 -0
- package/dist/ezeep/p-DCznw2Ee.system.js +1 -1
- package/dist/ezeep/types/shared/types.d.ts +2 -0
- package/dist/types/components/ezp-file-name/ezp-file-name.d.ts +125 -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 +48 -2
- package/dist/types/components/ezp-printing/ezp-printing.d.ts +9 -2
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +4 -0
- package/dist/types/components.d.ts +82 -3
- package/dist/types/shared/storage.d.ts +18 -4
- package/dist/types/shared/types.d.ts +2 -0
- package/dist/types/utils/printer.d.ts +18 -0
- package/dist/types/utils/utils.d.ts +20 -1
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/p-646c1d42.entry.js +1 -0
- package/www/build/p-70951744.js +1 -0
- package/www/build/p-8e2d88a9.system.entry.js +7 -0
- package/www/build/p-DCznw2Ee.system.js +1 -1
- package/www/index.html +1 -1
- package/dist/ezeep/p-3ab5a223.entry.js +0 -1
- package/dist/ezeep/p-fe700ca4.system.entry.js +0 -7
- package/www/build/p-3ab5a223.entry.js +0 -1
- package/www/build/p-65242d5e.js +0 -1
- package/www/build/p-fe700ca4.system.entry.js +0 -7
|
@@ -127,7 +127,7 @@ export class EzpStepper {
|
|
|
127
127
|
*
|
|
128
128
|
*/
|
|
129
129
|
render() {
|
|
130
|
-
return (h(Host, { key: '
|
|
130
|
+
return (h(Host, { key: 'cbf3ded61537359ed280a204bb71240d0a34473a', class: `${this.focused ? 'focused' : ''} ${this.icon ? 'has-icon' : ''}` }, h("div", { key: '1c7a265f60d06dbea4a80e19ecdaa4a10aed694c', id: "toggle", onClick: this.setFocus }), this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { key: '9fd0e1128480dd9b288cb266542fd4e6b83ceebd', id: "label", noWrap: true, text: this.label }), h("div", { key: '975fc0539e76750d7457c71d40f228cb5ebcaad8', class: "buttons" }, h("button", { key: 'db01d05fdcbc4eda2810751ace0194d9a1ec9eb7', class: "button", type: "button", "aria-label": `Decrease ${this.label}`, disabled: !this.canDecrease, onClick: this.handleDecrease }, h("ezp-icon", { key: '7d938efa8426caf292403e94e3565d20dc40d121', name: "minus" })), h("input", { key: 'dbff518a5d1f28b3b23d597947c250bef71fd68a', id: "input", type: "number", ref: (input) => (this.input = input), min: this.min.toString(), max: this.max !== undefined ? this.max.toString() : undefined, value: this.value.toString(), "aria-label": this.label, onInput: this.handleInput, onKeyDown: this.handleKeyDown, onFocus: this.handleFocus, onBlur: this.handleBlur }), h("button", { key: 'b3001bb27f94f65fce51d3a69d7713e5da9ccdcc', class: "button", type: "button", "aria-label": `Increase ${this.label}`, disabled: !this.canIncrease, onClick: this.handleIncrease }, h("ezp-icon", { key: '534bb499fa2ced2591ccbc137186e59d22aa2f5f', name: "plus" })))));
|
|
131
131
|
}
|
|
132
132
|
static get is() { return "ezp-stepper"; }
|
|
133
133
|
static get encapsulation() { return "shadow"; }
|
|
@@ -31,7 +31,7 @@ export class EzpTextButton {
|
|
|
31
31
|
href: this.href,
|
|
32
32
|
target: this.blank ? '_blank' : '_self',
|
|
33
33
|
};
|
|
34
|
-
return (h(Host, { key: '
|
|
34
|
+
return (h(Host, { key: '31c3726d82b340fad817eec01f597b58702ff292', class: `${this.level}` }, h(TagType, Object.assign({ key: '5e26c8e81ab49575b1a29c309f7792a2286ee455', id: "button", "aria-label": this.label }, attributes), h("ezp-label", { key: 'b21b121c9da908b6cba286a528f8e6772c179a36', id: "label", weight: "heavy", text: this.label, level: this.small ? 'tertiary' : 'secondary' }))));
|
|
35
35
|
}
|
|
36
36
|
static get is() { return "ezp-text-button"; }
|
|
37
37
|
static get encapsulation() { return "shadow"; }
|
|
@@ -177,10 +177,33 @@
|
|
|
177
177
|
* File list
|
|
178
178
|
*
|
|
179
179
|
*/
|
|
180
|
+
/* The tallest thing in a row is its remove button (`.file-remove`). */
|
|
181
|
+
/* Deliberately not `overflow: hidden` — that would clip a row's tooltip. Only
|
|
182
|
+
`#add-more` paints to the edge, so it rounds its own corners instead.
|
|
183
|
+
|
|
184
|
+
Anchors the file names' tooltips, so they can span the row. It sits outside
|
|
185
|
+
the scrolling list on purpose: a scroll container clips the absolutely
|
|
186
|
+
positioned boxes anchored inside it, but not those anchored beyond it. The
|
|
187
|
+
names measure where their row is when the tooltip opens (`anchor="parent"`). */
|
|
180
188
|
#files {
|
|
181
189
|
border: 1px solid var(--ezp-core-outline);
|
|
182
190
|
border-radius: 12px;
|
|
183
|
-
|
|
191
|
+
position: relative;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/* Scrolls on its own, so loading more files never makes the card — or the
|
|
195
|
+
window around it — taller. "Add more files" stays below it, in reach. Half
|
|
196
|
+
of a fifth row shows at the bottom, which tells the list goes on, and each
|
|
197
|
+
row after the first adds its 1px divider. `max-height` rather than
|
|
198
|
+
`height`, so a short list looks the same as before. */
|
|
199
|
+
#file-list {
|
|
200
|
+
/* Rounds its own top corners, which the scrollbar would otherwise cover. */
|
|
201
|
+
border-radius: 11px 11px 0 0;
|
|
202
|
+
max-height: var(--ezp-upload-fileList-maxHeight, calc(4.5 * calc(28px + 2 * var(--ezp-spacing-3)) + 4px));
|
|
203
|
+
/* Long names are truncated by `ezp-file-name`; nothing scrolls sideways. */
|
|
204
|
+
overflow-x: hidden;
|
|
205
|
+
overflow-y: auto;
|
|
206
|
+
scrollbar-width: thin;
|
|
184
207
|
}
|
|
185
208
|
|
|
186
209
|
.file {
|
|
@@ -188,6 +211,7 @@
|
|
|
188
211
|
display: grid;
|
|
189
212
|
gap: var(--ezp-spacing-3);
|
|
190
213
|
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
214
|
+
min-height: calc(28px + 2 * var(--ezp-spacing-3));
|
|
191
215
|
padding: var(--ezp-spacing-3) var(--ezp-spacing-4);
|
|
192
216
|
}
|
|
193
217
|
|
|
@@ -255,6 +279,7 @@
|
|
|
255
279
|
appearance: none;
|
|
256
280
|
background: var(--ezp-upload-addMore-background, transparent);
|
|
257
281
|
border: 0;
|
|
282
|
+
border-radius: 0 0 11px 11px;
|
|
258
283
|
border-top: 1px solid var(--ezp-core-outline);
|
|
259
284
|
color: var(--ezp-theme-solid);
|
|
260
285
|
cursor: pointer;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Host, h } from "@stencil/core";
|
|
2
|
-
import { subscribeToLanguageChange } from "../../utils/utils";
|
|
2
|
+
import { firstVisibleChild, subscribeToLanguageChange } from "../../utils/utils";
|
|
3
3
|
import i18next from "i18next";
|
|
4
4
|
/** File formats advertised to the user as supported for printing. */
|
|
5
5
|
const SUPPORTED_FORMATS = ['PDF', 'DOCX', 'PNG', 'JPG', 'XLSX'];
|
|
@@ -12,6 +12,9 @@ export class EzpUpload {
|
|
|
12
12
|
*/
|
|
13
13
|
this.selectedFiles = [];
|
|
14
14
|
this.dragging = false;
|
|
15
|
+
/** First row of the file list that is at least partly in view. Its tooltip
|
|
16
|
+
* opens downwards, as there is no list left above it to cover. */
|
|
17
|
+
this.firstVisibleFile = 0;
|
|
15
18
|
/**
|
|
16
19
|
*
|
|
17
20
|
* Listeners
|
|
@@ -67,6 +70,12 @@ export class EzpUpload {
|
|
|
67
70
|
// `printCancel` listener resets the form and the selection.
|
|
68
71
|
this.printCancel.emit();
|
|
69
72
|
};
|
|
73
|
+
this.handleFilesScroll = (event) => {
|
|
74
|
+
const first = firstVisibleChild(event.currentTarget);
|
|
75
|
+
// Scroll fires every frame; only a change of row is worth a render.
|
|
76
|
+
if (first >= 0 && first !== this.firstVisibleFile)
|
|
77
|
+
this.firstVisibleFile = first;
|
|
78
|
+
};
|
|
70
79
|
this.handleContinue = () => {
|
|
71
80
|
if (this.selectedFiles.length === 0)
|
|
72
81
|
return;
|
|
@@ -119,6 +128,7 @@ export class EzpUpload {
|
|
|
119
128
|
var _a;
|
|
120
129
|
(_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
|
|
121
130
|
this.selectedFiles = [];
|
|
131
|
+
this.firstVisibleFile = 0;
|
|
122
132
|
this.resetDrag();
|
|
123
133
|
}
|
|
124
134
|
fileKey(file) {
|
|
@@ -152,7 +162,7 @@ export class EzpUpload {
|
|
|
152
162
|
*/
|
|
153
163
|
render() {
|
|
154
164
|
const hasFiles = this.selectedFiles.length > 0;
|
|
155
|
-
return (h(Host, { key: '
|
|
165
|
+
return (h(Host, { key: '647c38e3dd42274be594a2fd5eb668943cd37256', class: { dragging: this.dragging } }, h("form", { key: 'a0af9e0bb32e8460b0b86bd897913a1c434747a8', id: "form", ref: (form) => (this.form = form) }, h("input", { key: 'd687034216a6e03a484fdd4462a7e2817675237c', type: "file", name: "input", id: "input", multiple: true, "aria-label": i18next.t('upload.choose_files'), ref: (input) => (this.input = input), onInput: this.handleInput }), h("div", { key: '82a76ba0258746bc552afc03c500a563c698e821', id: "modal" }, h("div", { key: 'a6113ba410cf3985ad64fa9300cf4e9ef2182e4f', id: "body-frame" }, h("div", { key: 'd9af36800ce744146c43a7e99f289413e13b9ae3', id: "body" }, !hasFiles && (h("div", { key: 'df98d670f9c0498597f414158108c38265b59b90', id: "dropzone" }, h("ezp-icon", { key: '0202221de58ae709f5823501cfce1bc9d1087136', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '9cbb60bc48f9e74af2c613d8c83a973e984ce824', id: "dropzone-title", level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') }), h("div", { key: 'ccaef599519bf24af543f4727fb4c1a62338b9df', id: "dropzone-prompt" }, h("ezp-text-button", { key: 'f084bb66ff63e9448cb6e7aea1782d8d2c9914b3', id: "choose", type: "button", onClick: this.openPicker, label: i18next.t('upload.choose_files') }), h("ezp-label", { key: 'f5e7bd5219637c13cc0f9ad97ab42a14d35aa601', id: "drag-hint", level: "secondary", weight: "strong", text: i18next.t('upload.drag_hint') }), h("ezp-label", { key: 'd5334e1e3aaaaaf9a7abb4be38a27226f73a162a', id: "formats", level: "tertiary", text: SUPPORTED_FORMATS.join(', ') })))), hasFiles && (h("div", { key: '9eaec0f2ddb0f2ca4679e4a314afb2b42c211a17', id: "files" }, h("div", { key: 'bc990a270c2432c8237b75eebc9d4881a6bb856e', id: "file-list", onScroll: this.handleFilesScroll }, this.selectedFiles.map((file, index) => (h("div", { key: this.fileKey(file), class: "file", "data-tooltip-row": true }, h("span", { class: "file-type", "aria-hidden": "true" }, this.fileType(file.name)), h("div", { class: "file-details" }, h("ezp-file-name", { class: "file-name", weight: "heavy", name: file.name, anchor: "parent", placement: index === this.firstVisibleFile ? 'bottom' : 'top' }), h("ezp-label", { class: "file-size", level: "tertiary", text: this.formatSize(file.size) })), h("button", { type: "button", class: "file-remove", "aria-label": i18next.t('upload.remove_file'), onClick: (event) => this.removeFile(event, index) }, h("ezp-icon", { name: "close" })))))), h("button", { key: 'd22584a56b417545260c5b8c2210a6c62b59426e', type: "button", id: "add-more", onClick: this.openPicker }, h("ezp-icon", { key: '1313f4255c6a58e58d04b0188153ec815ce6b938', name: "plus" }), h("ezp-label", { key: 'deadcecb7b733c33a3990802a4ebf6b84726b48e', level: "secondary", weight: "heavy", text: i18next.t('upload.add_more') }))))), hasFiles && this.dragging && (h("div", { key: '20bf6c68fd28c8de0b63b88aad24f1ab63d25ac3', id: "drop-overlay", "aria-hidden": "true" }, h("ezp-icon", { key: '135896652629a8eba574c21af1af20ba6722ad5d', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '03921a166561ce06af4fce3abcd1f812738844f5', level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') })))), h("div", { key: '2d1e16e9e8ca950e1e968ca12939a245f7618adc', id: "footer" }, h("ezp-text-button", { key: '6a776b09c068982932225a4903df003e8a89b20a', id: "clear", type: "button", level: "secondary", disabled: !hasFiles, onClick: this.handleCancel, label: i18next.t('upload.remove_files'), class: "action" }), h("ezp-text-button", { key: 'ca872a7d7834191001faef1140dbd344566ed79d', id: "continue", type: "button", disabled: !hasFiles, onClick: this.handleContinue, label: i18next.t('upload.continue'), class: "action" }))))));
|
|
156
166
|
}
|
|
157
167
|
static get is() { return "ezp-upload"; }
|
|
158
168
|
static get encapsulation() { return "shadow"; }
|
|
@@ -169,7 +179,8 @@ export class EzpUpload {
|
|
|
169
179
|
static get states() {
|
|
170
180
|
return {
|
|
171
181
|
"selectedFiles": {},
|
|
172
|
-
"dragging": {}
|
|
182
|
+
"dragging": {},
|
|
183
|
+
"firstVisibleFile": {}
|
|
173
184
|
};
|
|
174
185
|
}
|
|
175
186
|
static get events() {
|
|
@@ -84,7 +84,7 @@ export class EzpUserMenu {
|
|
|
84
84
|
*
|
|
85
85
|
*/
|
|
86
86
|
render() {
|
|
87
|
-
return (h(Host, { key: '
|
|
87
|
+
return (h(Host, { key: 'a6967dc3eb3b13630dbf652681c6c5c1f769f584', class: this.open ? 'is-open' : '' }, h("div", { key: '5cbf232927f4b26c1c05b01a6025b5f33fe3bfaa', id: "header" }, h("ezp-label", { key: '83987303c029d9d01f42d5d817edaf6c72629513', ellipsis: true, id: "name", weight: "heavy", text: this.name }), h("ezp-icon-button", { key: '45a64f18578adf35aeb824e393a359368e32e35a', id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })), h("div", { key: '8bd44e5b32662baad24ee9a39abca4e772b0ef4b', 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: '64f041741f7760f85dd5090d0c9feebd7dec3289', class: "link", onClick: this.logOut }, h("ezp-icon", { key: 'bd0beefa519acb37328d9c3fd33c4286ff7e1ddc', class: "link__icon", name: "logout" }), h("ezp-label", { key: 'a37c8e9ffc43d0d89fe4d5dadf1dde5e36155074', text: i18next.t('user_menu.logout') }))), h("div", { key: 'ad74827637906199b94f61d5f617fcaa9044c553', id: "theme" }, h("ezp-label", { key: 'c420ad169436c96acd4add9951e02f2d6fd43240', class: "caption", text: `${i18next.t('user_menu.theme')}:`, weight: "heavy" }), h("div", { key: '04d383554f2cdfd6b7864c3e23295e2bc6f244b8', 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: '4e40758f22b322cbcd3d26054c6c4801c555430a', id: "appearance" }, h("ezp-label", { key: '3034f9eaa028ce4928c8bf2c36dc223b98eba45d', class: "caption", text: `${i18next.t('user_menu.appearance')}:`, weight: "heavy" }), h("div", { key: 'dfa6a115e24db557891295f3a8e1ab1cfa4332f0', 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,8 @@ 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'
|
|
56
|
+
export type TooltipAnchorTypes = 'container' | 'parent'
|
|
55
57
|
export type ThemeTypes = 'pink' | 'red' | 'orange' | 'green' | 'teal' | 'cyan' | 'blue' | 'violet'
|
|
56
58
|
export type AppearanceTypes = 'system' | 'light' | 'dark'
|
|
57
59
|
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;
|
|
@@ -17,6 +17,35 @@ export function subscribeToLanguageChange(component) {
|
|
|
17
17
|
i18next.on('languageChanged', rerender);
|
|
18
18
|
return () => i18next.off('languageChanged', rerender);
|
|
19
19
|
}
|
|
20
|
+
/** Index of the first child of a scroll container that is at least half in
|
|
21
|
+
* view, or -1 when it has none. Lists use it to open the topmost visible row's
|
|
22
|
+
* tooltip downwards, as nothing in the list is left above that row to cover.
|
|
23
|
+
* A row showing only a sliver doesn't count: the row below it is the one the
|
|
24
|
+
* user reads first, and that one should open downwards. */
|
|
25
|
+
export function firstVisibleChild(container) {
|
|
26
|
+
const top = container.getBoundingClientRect().top;
|
|
27
|
+
return Array.from(container.children).findIndex((child) => {
|
|
28
|
+
const rect = child.getBoundingClientRect();
|
|
29
|
+
return (rect.top + rect.bottom) / 2 > top;
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Side a tooltip should open on, given where it was asked to open and the room
|
|
34
|
+
* there is. The requested side wins whenever the bubble fits there; otherwise
|
|
35
|
+
* it flips to the other side if that fits, or if that simply has more room.
|
|
36
|
+
* All values are in the same (screen) pixels.
|
|
37
|
+
*/
|
|
38
|
+
export function pickTooltipSide(requested, row, needed, visible) {
|
|
39
|
+
const above = row.top - visible.top;
|
|
40
|
+
const below = visible.bottom - row.bottom;
|
|
41
|
+
const room = { top: above, bottom: below };
|
|
42
|
+
const other = requested === 'top' ? 'bottom' : 'top';
|
|
43
|
+
if (room[requested] >= needed)
|
|
44
|
+
return requested;
|
|
45
|
+
if (room[other] >= needed || room[other] > room[requested])
|
|
46
|
+
return other;
|
|
47
|
+
return requested;
|
|
48
|
+
}
|
|
20
49
|
export function encodeFormData(data) {
|
|
21
50
|
return Object.keys(data)
|
|
22
51
|
.map((key) => encodeURIComponent(key) + '=' + encodeURIComponent(data[key]))
|
package/dist/components/auth.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import*as e from"@stencil/core/internal/client";import{
|
|
1
|
+
import*as e from"@stencil/core/internal/client";import{k 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 s,transformTag as o}from"@stencil/core/internal/client";import{j as a}from"./utils.js";import{d as n}from"./ezp-label2.js";const l=e(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.openGeneration=0,this.scrollTargets=[],this.name="",this.level="secondary",this.weight="soft",this.placement="top",this.anchor="container",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(){this.closeTooltip(),this.stopWatchingScroll()}componentDidRender(){this.tooltipOpen&&"parent"===this.anchor&&this.placeTooltip()}watchTooltipOpen(e){e&&"parent"===this.anchor?this.watchScroll():this.stopWatchingScroll()}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())}placeTooltip(){var e,t;const i=null===(e=this.host.shadowRoot)||void 0===e?void 0:e.querySelector("#tooltip"),s=null!==(t=this.host.closest("[data-tooltip-row]"))&&void 0!==t?t:this.host.parentElement;if(!i||!s)return;i.style.bottom="auto",i.style.top="0px";const o=i.getBoundingClientRect(),n=i.offsetHeight>0?o.height/i.offsetHeight:1,l=s.getBoundingClientRect(),r=(parseFloat(getComputedStyle(i).getPropertyValue("--ezp-spacing-2"))||6)*n,h=a(this.placement,l,o.height+r,this.visibleArea(i));i.style.top=(("top"===h?l.top-r-o.height:l.bottom+r)-o.top)/(n||1)+"px"}visibleArea(e){var t;let i=0,s=window.innerHeight,o=e.offsetParent;for(;o;){if("visible"!==getComputedStyle(o).overflowY){const e=o.getBoundingClientRect();i=Math.max(i,e.top),s=Math.min(s,e.bottom)}o=null!==(t=o.parentElement)&&void 0!==t?t:o.getRootNode().host||null}return{top:i,bottom:s}}watchScroll(){this.stopWatchingScroll();const e=[window];let t=this.host.parentNode;for(;t;)t.nodeType===Node.ELEMENT_NODE&&e.push(t),t=t instanceof ShadowRoot?t.host:t.parentNode;e.forEach((e=>e.addEventListener("scroll",this.closeTooltip,{passive:!0}))),window.addEventListener("resize",this.closeTooltip,{passive:!0}),this.scrollTargets=e}stopWatchingScroll(){this.scrollTargets.forEach((e=>e.removeEventListener("scroll",this.closeTooltip))),this.scrollTargets=[],window.removeEventListener("resize",this.closeTooltip)}render(){const e=!this.expanded&&this.name.length>8,t=e?this.name.slice(0,-8):this.name,o=e?this.name.slice(-8):"";return i(s,{key:"6fa83e22c07a31d2a56df34f2f12edf20e1eba15",class:{expanded:this.expanded,[`place-${this.placement}`]:!0}},i("button",{key:"07c2f0afc897be0ef1bd1622a486d7ff7ec73953",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:"7a8711a0ac21e2b7bf84a40492b0b193dd3dd29f",class:"head",ellipsis:e,level:this.level,weight:this.weight,text:t}),e&&i("ezp-label",{key:"be08c7a34cff7db6e5328627de26ff272415e27d",class:"tail",level:this.level,weight:this.weight,text:o})),this.tooltipOpen&&i("div",{key:"fe79f1aeced27b5ebf68e8a6cd3fcdd26e19c5eb",id:"tooltip","aria-hidden":"true",onMouseEnter:this.cancelScheduledClose,onMouseLeave:this.closeTooltip},this.name))}get host(){return this}static get watchers(){return{tooltipOpen:[{watchTooltipOpen:0}]}}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],anchor:[1],expanded:[32],tooltipOpen:[32]},[[10,"keydown","handleKeyDown"]],{tooltipOpen:[{watchTooltipOpen:0}]}]);function r(){"undefined"!=typeof customElements&&["ezp-file-name","ezp-label"].forEach((e=>{switch(e){case"ezp-file-name":customElements.get(o(e))||customElements.define(o(e),l);break;case"ezp-label":customElements.get(o(e))||n()}}))}export{l as E,r 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 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:"
|
|
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}
|