@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
|
@@ -209,7 +209,7 @@ export class EzpSelect {
|
|
|
209
209
|
this.disabled ? 'disabled' : '',
|
|
210
210
|
];
|
|
211
211
|
const labelLevel = this.toggleFlow === 'horizontal' ? 'secondary' : 'tertiary';
|
|
212
|
-
return (h(Host, { key: '
|
|
212
|
+
return (h(Host, { key: '7dd328df209e8906917c97b8002bdcd9e2fafa0b', class: hostClasses.join(' ') }, h("div", { key: '522bbbfea1ef111af7bd7317cc6054138eca020d', id: "wrap" }, h("div", { key: 'd1c2c06a33f629d589e2247342467ebbd7283d1b', id: "toggle", role: "combobox", "aria-haspopup": "listbox", "aria-controls": "list", "aria-expanded": this.expanded ? 'true' : 'false', "aria-label": this.label, "aria-disabled": this.disabled ? 'true' : 'false', tabindex: this.disabled ? -1 : 0, ref: (el) => (this.toggleEl = el), onClick: () => !this.disabled && this.toggle(), onKeyDown: this.handleToggleKeydown }, this.icon ? h("ezp-icon", { id: "icon", name: this.icon }) : null, h("ezp-label", { key: 'c60d6dd802424b2502d1b9c9066732ef02909779', id: "label", noWrap: true, level: labelLevel, text: this.label }), h("ezp-label", { key: 'c92c91c848aec5b6ff386f32beb41bdaf4407613', id: "value", ellipsis: true, text: ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.title) !== '' ? (_b = this.selected) === null || _b === void 0 ? void 0 : _b.title : this.placeholder }), h("ezp-icon", { key: '7c653c97c7da8471e7db51c1ba04718842a9991b', id: "accessory", name: "expand" })), h("div", { key: '5c1aeeb45f4cbf1c4e26653312d6cc0a7e7084ce', id: "list", role: "listbox", "aria-label": this.label, ref: (element) => (this.list = element) }, (_c = this.options) === null || _c === void 0 ? void 0 : _c.map((option) => {
|
|
213
213
|
var _a, _b;
|
|
214
214
|
if (option.title !== '') {
|
|
215
215
|
return (h("div", { class: `option ${option.id === ((_a = this.selected) === null || _a === void 0 ? void 0 : _a.id) ? 'is-selected' : ''} ${option.meta !== '' ? 'has-meta' : ''} `, role: "option", "aria-selected": option.id === ((_b = this.selected) === null || _b === void 0 ? void 0 : _b.id) ? 'true' : 'false', tabindex: this.expanded ? 0 : -1, onClick: () => this.select(option.id), onKeyDown: (event) => this.handleOptionKeydown(event, option.id) }, h("ezp-icon", { name: "checkmark", class: "indicator" }), h("div", { class: "details" }, h("ezp-label", { class: "title", ellipsis: true, text: option.title }), option.meta !== '' ? (h("ezp-label", { level: "tertiary", class: "meta", text: option.meta, ellipsis: true })) : null)));
|
|
@@ -46,9 +46,9 @@ export class EzpStatus {
|
|
|
46
46
|
return (
|
|
47
47
|
// Live region so screen readers announce status changes (loading,
|
|
48
48
|
// processing, success, error) as they render.
|
|
49
|
-
h(Host, { key: '
|
|
49
|
+
h(Host, { key: 'db32e5667bf9438a6d3d80807519ad2c158549ff', role: "status", "aria-live": "polite" }, h("div", { key: '815ecfbd3b272f206764ca852b8d865d7bc3cb8d', id: "box" }, this.processing ? (h("svg", { id: "indicator", viewBox: "0 0 42 42", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" }, h("circle", { id: "track", cx: "21", cy: "21", r: "18" }), h("circle", { id: "value", cx: "21", cy: "21", r: "18" }))) : this.icon ? (h("div", { id: "icon" }, h("div", { id: "icon-inner" }, h("ezp-icon", { name: this.icon })))) : null, h("ezp-label", { key: '385d4fbbd7ed1b7a4aa2334d6d2145c2f5207508', id: "description", weight: "heavy", text: this.description }), this.subtext && (h("ezp-label", { key: 'c6a243dd4ddc428f3e34021430d6b935f0a9e1a6', id: "subtext", level: "secondary", text: this.subtext })), (this.cancel || this.close || this.retry) && (h("div", { key: '0dfc5f86b6366b3631ac74c15e9d467a884feb52', id: "footer" }, this.cancel && (h("ezp-text-button", { key: 'a89289163ac7d630d35e887deead462c6dc29af4', class: "action secondary", level: "secondary", onClick: this.handleCancel, label: typeof this.cancel === 'string'
|
|
50
50
|
? this.cancel
|
|
51
|
-
: i18next.t('button_actions.cancel') })), this.close && (h("ezp-text-button", { key: '
|
|
51
|
+
: i18next.t('button_actions.cancel') })), this.close && (h("ezp-text-button", { key: 'd2e3814f2a81ce03f4e0f4bbcf7cc734ade37aa9', class: `action ${this.retry ? 'secondary' : 'primary'}`, level: this.retry ? 'secondary' : 'primary', onClick: this.handleClose, label: typeof this.close === 'string' ? this.close : i18next.t('button_actions.close') })), this.retry && (h("ezp-text-button", { key: '6e53e77afc6c3954435b08c6daaa65dd829ce9ad', class: "action primary", level: "primary", onClick: this.handleRetry, label: typeof this.retry === 'string' ? this.retry : i18next.t('button_actions.retry') })))))));
|
|
52
52
|
}
|
|
53
53
|
static get is() { return "ezp-status"; }
|
|
54
54
|
static get encapsulation() { return "shadow"; }
|
|
@@ -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"; }
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
opacity: var(--ezp-textButton-opacity, 1);
|
|
50
50
|
outline: none;
|
|
51
51
|
padding: var(--ezp-textButton-padding, var(--ezp-spacing-3));
|
|
52
|
-
white-space: nowrap;
|
|
52
|
+
white-space: var(--ezp-textButton-whiteSpace, nowrap);
|
|
53
53
|
width: 100%;
|
|
54
54
|
}
|
|
55
55
|
@media (hover: hover) {
|
|
@@ -70,6 +70,8 @@
|
|
|
70
70
|
}
|
|
71
71
|
#button:disabled {
|
|
72
72
|
--ezp-textButton-background: var(--ezp-textButton-background-disabled);
|
|
73
|
+
/* An outlined button reads as filled-and-flat once disabled. */
|
|
74
|
+
--ezp-textButton-boxShadow: none;
|
|
73
75
|
--ezp-textButton-color: var(--ezp-textButton-color-disabled);
|
|
74
76
|
--ezp-textButton-cursor: default;
|
|
75
77
|
}
|
|
@@ -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"; }
|
|
@@ -1,19 +1,40 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* Modules
|
|
5
|
+
*
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
*
|
|
9
|
+
* Modules
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* Variables
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* Functions
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* Mixins
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
1
27
|
/**
|
|
2
28
|
*
|
|
3
29
|
* Rules
|
|
4
30
|
*
|
|
5
31
|
*/
|
|
6
32
|
:host {
|
|
7
|
-
--ezp-upload-gradient: linear-gradient(
|
|
8
|
-
135deg,
|
|
9
|
-
color-mix(in srgb, var(--ezp-theme-solid), white 14%) 0%,
|
|
10
|
-
color-mix(in srgb, var(--ezp-theme-solid), black 22%) 100%
|
|
11
|
-
);
|
|
12
33
|
box-sizing: border-box;
|
|
13
34
|
color: var(--ezp-core-foreground-primary);
|
|
14
35
|
display: block;
|
|
15
|
-
width: var(--ezp-upload-width, auto);
|
|
16
36
|
height: var(--ezp-upload-height, auto);
|
|
37
|
+
width: var(--ezp-upload-width, auto);
|
|
17
38
|
}
|
|
18
39
|
|
|
19
40
|
*,
|
|
@@ -42,9 +63,35 @@
|
|
|
42
63
|
box-shadow: 0 0 0 1px var(--ezp-core-outline), 0 24px 60px -20px var(--ezp-core-backdrop);
|
|
43
64
|
display: flex;
|
|
44
65
|
flex-direction: column;
|
|
45
|
-
gap: var(--ezp-spacing-4);
|
|
46
66
|
height: 100%;
|
|
47
|
-
|
|
67
|
+
overflow: hidden;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* While a drag is in progress only the modal itself is a drag target. Its
|
|
71
|
+
children stop taking part in hit testing, so crossing rows, labels or
|
|
72
|
+
buttons fires no enter/leave pairs that could fall out of balance. */
|
|
73
|
+
:host(.dragging) #modal * {
|
|
74
|
+
pointer-events: none;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Positioning context for the drop overlay; stays put while #body scrolls. */
|
|
78
|
+
#body-frame {
|
|
79
|
+
display: flex;
|
|
80
|
+
flex: 1 1 auto;
|
|
81
|
+
flex-direction: column;
|
|
82
|
+
min-height: 0;
|
|
83
|
+
position: relative;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/* Scrolls internally so the footer stays pinned inside a constrained modal. */
|
|
87
|
+
#body {
|
|
88
|
+
display: flex;
|
|
89
|
+
flex: 1 1 auto;
|
|
90
|
+
flex-direction: column;
|
|
91
|
+
min-height: 0;
|
|
92
|
+
overflow-y: auto;
|
|
93
|
+
padding: var(--ezp-spacing-4);
|
|
94
|
+
scrollbar-width: thin;
|
|
48
95
|
}
|
|
49
96
|
|
|
50
97
|
/**
|
|
@@ -54,9 +101,10 @@
|
|
|
54
101
|
*/
|
|
55
102
|
#dropzone {
|
|
56
103
|
align-items: center;
|
|
57
|
-
background: var(--ezp-
|
|
58
|
-
border: 1.5px dashed var(--ezp-
|
|
104
|
+
background: var(--ezp-theme-translucent);
|
|
105
|
+
border: 1.5px dashed var(--ezp-theme-solid);
|
|
59
106
|
border-radius: 12px;
|
|
107
|
+
box-shadow: var(--ezp-upload-dropzone-boxShadow, none);
|
|
60
108
|
display: flex;
|
|
61
109
|
/* Grow to fill the modal body so the dashed box spans the available height,
|
|
62
110
|
and keep the contents centered vertically within it. */
|
|
@@ -64,214 +112,199 @@
|
|
|
64
112
|
flex-direction: column;
|
|
65
113
|
gap: var(--ezp-spacing-4);
|
|
66
114
|
justify-content: center;
|
|
67
|
-
min-height:
|
|
68
|
-
padding: var(--ezp-spacing-6) var(--ezp-spacing-
|
|
115
|
+
min-height: 160px;
|
|
116
|
+
padding: var(--ezp-spacing-6) var(--ezp-spacing-4);
|
|
69
117
|
text-align: center;
|
|
70
|
-
transition:
|
|
118
|
+
transition: box-shadow var(--ezp-duration-3) var(--ezp-easing-out-quart);
|
|
71
119
|
}
|
|
72
120
|
|
|
73
121
|
:host(.dragging) {
|
|
74
|
-
--ezp-upload-
|
|
75
|
-
|
|
122
|
+
--ezp-upload-dropzone-boxShadow: 0 0 0 4px var(--ezp-theme-translucent);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* The title and the prompt are both always rendered; show one per state. */
|
|
126
|
+
:host(:not(.dragging)) #dropzone-title,
|
|
127
|
+
:host(.dragging) #dropzone-prompt {
|
|
128
|
+
display: none;
|
|
76
129
|
}
|
|
77
130
|
|
|
78
|
-
|
|
131
|
+
/* Same look as the empty dropzone, laid over the file list during a drag. */
|
|
132
|
+
#drop-overlay {
|
|
79
133
|
align-items: center;
|
|
80
|
-
background: var(--ezp-
|
|
81
|
-
border
|
|
82
|
-
|
|
83
|
-
|
|
134
|
+
background: linear-gradient(var(--ezp-theme-translucent), var(--ezp-theme-translucent)), var(--ezp-core-surface-tertiary);
|
|
135
|
+
border: 1.5px dashed var(--ezp-theme-solid);
|
|
136
|
+
border-radius: 12px;
|
|
137
|
+
box-shadow: 0 0 0 4px var(--ezp-theme-translucent);
|
|
84
138
|
display: flex;
|
|
85
|
-
|
|
139
|
+
flex-direction: column;
|
|
140
|
+
gap: var(--ezp-spacing-4);
|
|
141
|
+
inset: var(--ezp-spacing-4);
|
|
86
142
|
justify-content: center;
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
--ezp-icon-gridTemplate: 40px;
|
|
143
|
+
pointer-events: none;
|
|
144
|
+
position: absolute;
|
|
145
|
+
text-align: center;
|
|
146
|
+
z-index: 1;
|
|
92
147
|
}
|
|
93
148
|
|
|
94
|
-
#dropzone-
|
|
95
|
-
--ezp-
|
|
96
|
-
--ezp-
|
|
149
|
+
#dropzone-icon {
|
|
150
|
+
--ezp-icon-size: 32px;
|
|
151
|
+
--ezp-icon-gridTemplate: 32px;
|
|
152
|
+
color: var(--ezp-theme-solid);
|
|
97
153
|
}
|
|
98
154
|
|
|
99
|
-
#
|
|
100
|
-
align-items:
|
|
101
|
-
color: var(--ezp-core-foreground-secondary);
|
|
155
|
+
#dropzone-prompt {
|
|
156
|
+
align-items: center;
|
|
102
157
|
display: flex;
|
|
103
|
-
flex-
|
|
104
|
-
gap:
|
|
105
|
-
justify-content: center;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
gap: var(--ezp-spacing-3);
|
|
106
160
|
}
|
|
107
161
|
|
|
108
|
-
#
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
opacity: var(--ezp-upload-browse-opacity, 1);
|
|
112
|
-
}
|
|
113
|
-
@media (hover: hover) {
|
|
114
|
-
#browse:hover {
|
|
115
|
-
--ezp-upload-browse-opacity: 0.6;
|
|
116
|
-
}
|
|
162
|
+
#choose {
|
|
163
|
+
--ezp-textButton-borderRadius: 8px;
|
|
164
|
+
--ezp-textButton-padding: 13px var(--ezp-spacing-5);
|
|
117
165
|
}
|
|
118
166
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
* Format chips
|
|
122
|
-
*
|
|
123
|
-
*/
|
|
124
|
-
#formats {
|
|
125
|
-
display: flex;
|
|
126
|
-
flex-wrap: wrap;
|
|
127
|
-
gap: var(--ezp-spacing-2);
|
|
128
|
-
justify-content: center;
|
|
167
|
+
#drag-hint {
|
|
168
|
+
color: var(--ezp-core-foreground-primary);
|
|
129
169
|
}
|
|
130
170
|
|
|
131
|
-
|
|
132
|
-
background: transparent;
|
|
133
|
-
border: 1px solid var(--ezp-core-outline);
|
|
134
|
-
border-radius: 999px;
|
|
171
|
+
#formats {
|
|
135
172
|
color: var(--ezp-core-foreground-secondary);
|
|
136
|
-
font-size: 12px;
|
|
137
|
-
font-weight: 600;
|
|
138
|
-
letter-spacing: 0.02em;
|
|
139
|
-
line-height: 1;
|
|
140
|
-
padding: 7px 14px;
|
|
141
173
|
}
|
|
142
174
|
|
|
143
175
|
/**
|
|
144
176
|
*
|
|
145
|
-
* File
|
|
177
|
+
* File list
|
|
146
178
|
*
|
|
147
179
|
*/
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
max-height: 40vh;
|
|
154
|
-
overflow-y: auto;
|
|
155
|
-
padding: var(--ezp-spacing-1);
|
|
156
|
-
scrollbar-width: thin;
|
|
157
|
-
width: 100%;
|
|
180
|
+
/* Deliberately not `overflow: hidden` — that would clip a row's tooltip. Only
|
|
181
|
+
`#add-more` paints to the edge, so it rounds its own corners instead. */
|
|
182
|
+
#files {
|
|
183
|
+
border: 1px solid var(--ezp-core-outline);
|
|
184
|
+
border-radius: 12px;
|
|
158
185
|
}
|
|
159
186
|
|
|
160
|
-
.
|
|
187
|
+
.file {
|
|
161
188
|
align-items: center;
|
|
162
|
-
display:
|
|
163
|
-
|
|
164
|
-
|
|
189
|
+
display: grid;
|
|
190
|
+
gap: var(--ezp-spacing-3);
|
|
191
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
192
|
+
padding: var(--ezp-spacing-3) var(--ezp-spacing-4);
|
|
193
|
+
/* Anchors the file name's tooltip, so it can span the row. */
|
|
165
194
|
position: relative;
|
|
166
|
-
width: 88px;
|
|
167
195
|
}
|
|
168
196
|
|
|
169
|
-
.
|
|
170
|
-
|
|
171
|
-
background: var(--ezp-upload-gradient);
|
|
172
|
-
border-radius: 50%;
|
|
173
|
-
color: var(--ezp-white-100);
|
|
174
|
-
display: flex;
|
|
175
|
-
height: 56px;
|
|
176
|
-
justify-content: center;
|
|
177
|
-
width: 56px;
|
|
197
|
+
.file + .file {
|
|
198
|
+
border-top: 1px solid var(--ezp-core-outline);
|
|
178
199
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
--ezp-
|
|
200
|
+
|
|
201
|
+
.file-type {
|
|
202
|
+
background: var(--ezp-theme-translucent);
|
|
203
|
+
border-radius: 6px;
|
|
204
|
+
color: var(--ezp-theme-solid);
|
|
205
|
+
font-size: 11px;
|
|
206
|
+
font-weight: 600;
|
|
207
|
+
letter-spacing: 0.02em;
|
|
208
|
+
line-height: 1;
|
|
209
|
+
overflow: hidden;
|
|
210
|
+
padding: 8px 6px;
|
|
211
|
+
text-align: center;
|
|
212
|
+
text-overflow: ellipsis;
|
|
213
|
+
white-space: nowrap;
|
|
214
|
+
/* Fixed rather than content-sized, so file names line up across rows. */
|
|
215
|
+
width: 56px;
|
|
182
216
|
}
|
|
183
217
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
218
|
+
/* ezp-label trims its own half-leading, so the gap is measured cap-box to
|
|
219
|
+
cap-box — spacing-2 is what ezp-select uses for the same title/meta pair. */
|
|
220
|
+
.file-details {
|
|
221
|
+
display: flex;
|
|
222
|
+
flex-direction: column;
|
|
223
|
+
gap: var(--ezp-spacing-2);
|
|
224
|
+
min-width: 0;
|
|
187
225
|
}
|
|
188
226
|
|
|
189
|
-
.
|
|
190
|
-
|
|
227
|
+
.file-size {
|
|
228
|
+
color: var(--ezp-core-foreground-secondary);
|
|
191
229
|
}
|
|
192
230
|
|
|
193
|
-
.
|
|
231
|
+
.file-remove {
|
|
194
232
|
align-items: center;
|
|
195
233
|
appearance: none;
|
|
196
|
-
background:
|
|
197
|
-
border:
|
|
198
|
-
border-radius:
|
|
199
|
-
color: var(--ezp-core-foreground-
|
|
234
|
+
background: transparent;
|
|
235
|
+
border: 0;
|
|
236
|
+
border-radius: 6px;
|
|
237
|
+
color: var(--ezp-core-foreground-tertiary);
|
|
200
238
|
cursor: pointer;
|
|
201
239
|
display: flex;
|
|
202
|
-
height:
|
|
240
|
+
height: 28px;
|
|
203
241
|
justify-content: center;
|
|
204
242
|
padding: 0;
|
|
205
|
-
position: absolute;
|
|
206
|
-
right: 8px;
|
|
207
|
-
top: -4px;
|
|
208
243
|
transition: color var(--ezp-duration-2) var(--ezp-easing-out-quart);
|
|
209
|
-
width:
|
|
210
|
-
z-index: 1;
|
|
244
|
+
width: 28px;
|
|
211
245
|
}
|
|
212
|
-
.
|
|
213
|
-
--ezp-icon-size:
|
|
214
|
-
--ezp-icon-gridTemplate:
|
|
246
|
+
.file-remove ezp-icon {
|
|
247
|
+
--ezp-icon-size: 16px;
|
|
248
|
+
--ezp-icon-gridTemplate: 16px;
|
|
215
249
|
}
|
|
216
250
|
@media (hover: hover) {
|
|
217
|
-
.
|
|
251
|
+
.file-remove:hover {
|
|
218
252
|
color: var(--ezp-core-foreground-primary);
|
|
219
253
|
}
|
|
220
254
|
}
|
|
221
255
|
|
|
222
|
-
|
|
223
|
-
cursor: pointer;
|
|
224
|
-
}
|
|
225
|
-
.thumb-add .thumb-add-icon {
|
|
256
|
+
#add-more {
|
|
226
257
|
align-items: center;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
258
|
+
appearance: none;
|
|
259
|
+
background: var(--ezp-upload-addMore-background, transparent);
|
|
260
|
+
border: 0;
|
|
261
|
+
border-radius: 0 0 11px 11px;
|
|
262
|
+
border-top: 1px solid var(--ezp-core-outline);
|
|
263
|
+
color: var(--ezp-theme-solid);
|
|
264
|
+
cursor: pointer;
|
|
230
265
|
display: flex;
|
|
231
|
-
|
|
266
|
+
font-family: inherit;
|
|
267
|
+
gap: 4px;
|
|
232
268
|
justify-content: center;
|
|
233
|
-
|
|
234
|
-
|
|
269
|
+
padding: var(--ezp-spacing-3);
|
|
270
|
+
transition: background-color var(--ezp-duration-2) var(--ezp-easing-out-quart);
|
|
271
|
+
width: 100%;
|
|
235
272
|
}
|
|
236
|
-
|
|
237
|
-
--ezp-icon-size:
|
|
238
|
-
--ezp-icon-gridTemplate:
|
|
273
|
+
#add-more ezp-icon {
|
|
274
|
+
--ezp-icon-size: 18px;
|
|
275
|
+
--ezp-icon-gridTemplate: 18px;
|
|
239
276
|
}
|
|
240
277
|
@media (hover: hover) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
color: var(--ezp-theme-solid);
|
|
278
|
+
#add-more:hover {
|
|
279
|
+
--ezp-upload-addMore-background: var(--ezp-core-shade-primary);
|
|
244
280
|
}
|
|
245
281
|
}
|
|
246
282
|
|
|
247
|
-
/**
|
|
248
|
-
*
|
|
249
|
-
* Ready counter
|
|
250
|
-
*
|
|
251
|
-
*/
|
|
252
|
-
#ready {
|
|
253
|
-
color: var(--ezp-core-foreground-secondary);
|
|
254
|
-
letter-spacing: 0.08em;
|
|
255
|
-
text-align: center;
|
|
256
|
-
text-transform: uppercase;
|
|
257
|
-
}
|
|
258
|
-
|
|
259
283
|
/**
|
|
260
284
|
*
|
|
261
285
|
* Footer
|
|
262
286
|
*
|
|
263
287
|
*/
|
|
264
288
|
#footer {
|
|
289
|
+
border-top: 1px solid var(--ezp-core-outline);
|
|
265
290
|
display: grid;
|
|
266
291
|
gap: var(--ezp-spacing-3);
|
|
267
292
|
grid-template-columns: 1fr 1.4fr;
|
|
293
|
+
padding: var(--ezp-spacing-4);
|
|
268
294
|
}
|
|
269
295
|
|
|
270
296
|
.action {
|
|
271
|
-
--ezp-textButton-borderRadius:
|
|
272
|
-
--ezp-textButton-padding: var(--ezp-spacing-
|
|
297
|
+
--ezp-textButton-borderRadius: 8px;
|
|
298
|
+
--ezp-textButton-padding: 13px var(--ezp-spacing-3);
|
|
299
|
+
--ezp-textButton-whiteSpace: normal;
|
|
300
|
+
text-align: center;
|
|
273
301
|
}
|
|
274
302
|
|
|
275
|
-
|
|
276
|
-
|
|
303
|
+
/* Outlined rather than filled, so the primary action stays the only solid one. */
|
|
304
|
+
#clear {
|
|
305
|
+
--ezp-textButton-background-active: var(--ezp-core-shade-secondary);
|
|
306
|
+
--ezp-textButton-background-hover: var(--ezp-core-shade-primary);
|
|
307
|
+
--ezp-textButton-background-init: transparent;
|
|
308
|
+
--ezp-textButton-boxShadow: inset 0 0 0 1px var(--ezp-core-outline);
|
|
309
|
+
--ezp-textButton-color-init: var(--ezp-core-foreground-primary);
|
|
277
310
|
}
|
|
@@ -12,11 +12,32 @@ export class EzpUpload {
|
|
|
12
12
|
*/
|
|
13
13
|
this.selectedFiles = [];
|
|
14
14
|
this.dragging = false;
|
|
15
|
+
/**
|
|
16
|
+
*
|
|
17
|
+
* Listeners
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
// dragenter/dragleave bubble from every child the pointer crosses, and the
|
|
21
|
+
// next child's enter fires before the previous one's leave, so count depth
|
|
22
|
+
// instead of toggling. This only balances if every entered element stays
|
|
23
|
+
// connected until its dragleave fires, so the render never removes anything
|
|
24
|
+
// while `dragging` flips (see the drop overlay below).
|
|
25
|
+
this.dragDepth = 0;
|
|
15
26
|
/**
|
|
16
27
|
*
|
|
17
28
|
* Private methods
|
|
18
29
|
*
|
|
19
30
|
*/
|
|
31
|
+
// Stable per-File keys, so removing a row doesn't make Stencil reuse the
|
|
32
|
+
// following rows' DOM. Keyed by identity: the same file picked twice still
|
|
33
|
+
// gets two distinct rows.
|
|
34
|
+
this.fileKeys = new WeakMap();
|
|
35
|
+
this.nextFileKey = 0;
|
|
36
|
+
/** Opens the native file picker from our own buttons. */
|
|
37
|
+
this.openPicker = () => {
|
|
38
|
+
var _a;
|
|
39
|
+
(_a = this.input) === null || _a === void 0 ? void 0 : _a.click();
|
|
40
|
+
};
|
|
20
41
|
this.handleInput = () => {
|
|
21
42
|
var _a, _b;
|
|
22
43
|
const files = Array.from((_b = (_a = this.input) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : []);
|
|
@@ -59,12 +80,11 @@ export class EzpUpload {
|
|
|
59
80
|
var _a;
|
|
60
81
|
(_a = this.unsubscribeLanguage) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
61
82
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
handleDragEnter() {
|
|
83
|
+
handleDragEnter(event) {
|
|
84
|
+
// Accept here as well as on dragover: when the element under the pointer
|
|
85
|
+
// changes, the browser takes the drop effect from dragenter alone.
|
|
86
|
+
event === null || event === void 0 ? void 0 : event.preventDefault();
|
|
87
|
+
this.dragDepth++;
|
|
68
88
|
this.dragging = true;
|
|
69
89
|
}
|
|
70
90
|
handleDragOver(event) {
|
|
@@ -75,22 +95,37 @@ export class EzpUpload {
|
|
|
75
95
|
}
|
|
76
96
|
}
|
|
77
97
|
handleDragLeave() {
|
|
78
|
-
this.
|
|
98
|
+
this.dragDepth = Math.max(0, this.dragDepth - 1);
|
|
99
|
+
this.dragging = this.dragDepth > 0;
|
|
79
100
|
}
|
|
80
101
|
handleDrop(event) {
|
|
81
102
|
var _a, _b;
|
|
82
103
|
event.stopPropagation();
|
|
83
104
|
event.preventDefault();
|
|
105
|
+
this.dragDepth = 0;
|
|
84
106
|
this.dragging = false;
|
|
85
107
|
const files = Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : []);
|
|
86
108
|
// Add new files to existing selection instead of replacing
|
|
87
109
|
this.selectedFiles = [...this.selectedFiles, ...files];
|
|
88
110
|
this.uploadFile.emit(this.selectedFiles);
|
|
89
111
|
}
|
|
112
|
+
// A drag that ends anywhere else (dropped elsewhere on the page, or
|
|
113
|
+
// cancelled) must not leave the card stuck in its drop state.
|
|
114
|
+
resetDrag() {
|
|
115
|
+
this.dragDepth = 0;
|
|
116
|
+
this.dragging = false;
|
|
117
|
+
}
|
|
90
118
|
listenPrintCancel() {
|
|
91
119
|
var _a;
|
|
92
120
|
(_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
|
|
93
121
|
this.selectedFiles = [];
|
|
122
|
+
this.resetDrag();
|
|
123
|
+
}
|
|
124
|
+
fileKey(file) {
|
|
125
|
+
if (!this.fileKeys.has(file)) {
|
|
126
|
+
this.fileKeys.set(file, this.nextFileKey++);
|
|
127
|
+
}
|
|
128
|
+
return this.fileKeys.get(file);
|
|
94
129
|
}
|
|
95
130
|
/** Extract a short, upper-cased file-type label from the file name. */
|
|
96
131
|
fileType(name) {
|
|
@@ -117,7 +152,7 @@ export class EzpUpload {
|
|
|
117
152
|
*/
|
|
118
153
|
render() {
|
|
119
154
|
const hasFiles = this.selectedFiles.length > 0;
|
|
120
|
-
return (h(Host, { key: '
|
|
155
|
+
return (h(Host, { key: 'f20f756ca7522ab7d27e5c9fff743db9ba26b101', class: { dragging: this.dragging } }, h("form", { key: 'abafb9a19d3dff7da26c8250ea94bbc7876cbc3a', id: "form", ref: (form) => (this.form = form) }, h("input", { key: '09397ebf4641190fdd1af13af537cde9f87257d2', 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: '0365f750bc55d98a95008bcf404f77b247480d81', id: "modal" }, h("div", { key: '82d8d8ff21977d36a3f18c704002d1a8cdad9016', id: "body-frame" }, h("div", { key: 'ef05d508f0341f92d5e987deb469b2759ee28f1b', id: "body" }, !hasFiles && (h("div", { key: '7885aad8082bedf42ef824ad06a388ed3a083987', id: "dropzone" }, h("ezp-icon", { key: '25707aa1f7018c7942ca5c82a35c4a74f73f5e70', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '2dfb59ce766671396164fcd63d25ef9b04981d01', id: "dropzone-title", level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') }), h("div", { key: 'b831d79aab06973e47666e129e89ba23d3e8a3a4', id: "dropzone-prompt" }, h("ezp-text-button", { key: '2ade7d526019a71b493e00e6737ca13769cccd29', id: "choose", type: "button", onClick: this.openPicker, label: i18next.t('upload.choose_files') }), h("ezp-label", { key: '79903c44e2a82b39c97606aa1ccbe9cb28a42c48', id: "drag-hint", level: "secondary", weight: "strong", text: i18next.t('upload.drag_hint') }), h("ezp-label", { key: '895d43cada83fade39b8d67e70782b9b9fea747c', id: "formats", level: "tertiary", text: SUPPORTED_FORMATS.join(', ') })))), hasFiles && (h("div", { key: '6c825ac2791e82271669a7824ed720b127290242', id: "files" }, this.selectedFiles.map((file, index) => (h("div", { key: this.fileKey(file), class: "file" }, 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, placement: index === 0 ? '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: 'da8562e56c4006952efa239e8076f333ae27b1be', type: "button", id: "add-more", onClick: this.openPicker }, h("ezp-icon", { key: '6b2565bb3a9d4eca02079923ffdee36d5184d10f', name: "plus" }), h("ezp-label", { key: '59ecc6b13ca9fa66b8f04944c57ba680e3bab0f8', level: "secondary", weight: "heavy", text: i18next.t('upload.add_more') }))))), hasFiles && this.dragging && (h("div", { key: '26e2552f69637448b3663f9342c421ec29abcca8', id: "drop-overlay", "aria-hidden": "true" }, h("ezp-icon", { key: '0f409daf2c6fc5f3f103f4d4450970aea7edb0c7', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '1e19c3e44aac998ad35671435cfe96a27633b170', level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') })))), h("div", { key: '31d0106aea747008bf2c2760e4cd8ab0e637144b', id: "footer" }, h("ezp-text-button", { key: '24c6c9f25de785443402ac3aa08975c58779faea', id: "clear", type: "button", level: "secondary", disabled: !hasFiles, onClick: this.handleCancel, label: i18next.t('upload.remove_files'), class: "action" }), h("ezp-text-button", { key: 'cd0fb877a2a7a756cfbe6aa2fdbacaedbe4c8efb', id: "continue", type: "button", disabled: !hasFiles, onClick: this.handleContinue, label: i18next.t('upload.continue'), class: "action" }))))));
|
|
121
156
|
}
|
|
122
157
|
static get is() { return "ezp-upload"; }
|
|
123
158
|
static get encapsulation() { return "shadow"; }
|
|
@@ -206,7 +241,7 @@ export class EzpUpload {
|
|
|
206
241
|
"method": "handleDragEnter",
|
|
207
242
|
"target": undefined,
|
|
208
243
|
"capture": false,
|
|
209
|
-
"passive":
|
|
244
|
+
"passive": false
|
|
210
245
|
}, {
|
|
211
246
|
"name": "dragover",
|
|
212
247
|
"method": "handleDragOver",
|
|
@@ -225,6 +260,18 @@ export class EzpUpload {
|
|
|
225
260
|
"target": undefined,
|
|
226
261
|
"capture": false,
|
|
227
262
|
"passive": false
|
|
263
|
+
}, {
|
|
264
|
+
"name": "drop",
|
|
265
|
+
"method": "resetDrag",
|
|
266
|
+
"target": "window",
|
|
267
|
+
"capture": false,
|
|
268
|
+
"passive": true
|
|
269
|
+
}, {
|
|
270
|
+
"name": "dragend",
|
|
271
|
+
"method": "resetDrag",
|
|
272
|
+
"target": "window",
|
|
273
|
+
"capture": false,
|
|
274
|
+
"passive": true
|
|
228
275
|
}, {
|
|
229
276
|
"name": "printCancel",
|
|
230
277
|
"method": "listenPrintCancel",
|