@ezeep/ezeep-js 1.0.287 → 1.0.294
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 +84 -48
- package/dist/cjs/loader.cjs.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 +1 -1
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.css +41 -15
- package/dist/collection/components/ezp-printer-selection/ezp-printer-selection.js +12 -8
- 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 +173 -144
- package/dist/collection/components/ezp-upload/ezp-upload.js +58 -9
- package/dist/collection/components/ezp-user-menu/ezp-user-menu.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/esm/ezeep.js +1 -1
- package/dist/esm/ezp-auth_15.entry.js +84 -48
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/ezeep.js +1 -1
- package/dist/esm-es5/ezp-auth_15.entry.js +2 -2
- package/dist/esm-es5/loader.js +1 -1
- package/dist/ezeep/ezeep.esm.js +1 -1
- package/dist/ezeep/p-3ab5a223.entry.js +1 -0
- package/dist/ezeep/p-DCznw2Ee.system.js +1 -1
- package/dist/ezeep/{p-0aae0597.system.entry.js → p-fe700ca4.system.entry.js} +2 -2
- package/dist/types/components/ezp-printer-selection/ezp-printer-selection.d.ts +2 -0
- package/dist/types/components/ezp-upload/ezp-upload.d.ts +8 -1
- package/dist/types/components.d.ts +0 -2
- package/package.json +1 -1
- package/www/build/ezeep.esm.js +1 -1
- package/www/build/p-3ab5a223.entry.js +1 -0
- package/www/build/{p-879553e9.js → p-65242d5e.js} +1 -1
- package/www/build/p-DCznw2Ee.system.js +1 -1
- package/www/build/{p-0aae0597.system.entry.js → p-fe700ca4.system.entry.js} +2 -2
- package/www/data/locales/de.json +6 -8
- package/www/data/locales/en.json +6 -8
- package/www/index.html +1 -1
- package/dist/ezeep/p-7b19a21a.entry.js +0 -1
- package/www/build/p-7b19a21a.entry.js +0 -1
|
@@ -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,195 @@
|
|
|
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
|
-
justify-content: center;
|
|
153
|
-
max-height: 40vh;
|
|
154
|
-
overflow-y: auto;
|
|
155
|
-
padding: var(--ezp-spacing-1);
|
|
156
|
-
scrollbar-width: thin;
|
|
157
|
-
width: 100%;
|
|
180
|
+
#files {
|
|
181
|
+
border: 1px solid var(--ezp-core-outline);
|
|
182
|
+
border-radius: 12px;
|
|
183
|
+
overflow: hidden;
|
|
158
184
|
}
|
|
159
185
|
|
|
160
|
-
.
|
|
186
|
+
.file {
|
|
161
187
|
align-items: center;
|
|
162
|
-
display:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
width: 88px;
|
|
188
|
+
display: grid;
|
|
189
|
+
gap: var(--ezp-spacing-3);
|
|
190
|
+
grid-template-columns: auto minmax(0, 1fr) auto;
|
|
191
|
+
padding: var(--ezp-spacing-3) var(--ezp-spacing-4);
|
|
167
192
|
}
|
|
168
193
|
|
|
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;
|
|
194
|
+
.file + .file {
|
|
195
|
+
border-top: 1px solid var(--ezp-core-outline);
|
|
178
196
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
--ezp-
|
|
197
|
+
|
|
198
|
+
.file-type {
|
|
199
|
+
background: var(--ezp-theme-translucent);
|
|
200
|
+
border-radius: 6px;
|
|
201
|
+
color: var(--ezp-theme-solid);
|
|
202
|
+
font-size: 11px;
|
|
203
|
+
font-weight: 600;
|
|
204
|
+
letter-spacing: 0.02em;
|
|
205
|
+
line-height: 1;
|
|
206
|
+
overflow: hidden;
|
|
207
|
+
padding: 8px 6px;
|
|
208
|
+
text-align: center;
|
|
209
|
+
text-overflow: ellipsis;
|
|
210
|
+
white-space: nowrap;
|
|
211
|
+
/* Fixed rather than content-sized, so file names line up across rows. */
|
|
212
|
+
width: 56px;
|
|
182
213
|
}
|
|
183
214
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
215
|
+
/* ezp-label trims its own half-leading, so the gap is measured cap-box to
|
|
216
|
+
cap-box — spacing-2 is what ezp-select uses for the same title/meta pair. */
|
|
217
|
+
.file-details {
|
|
218
|
+
display: flex;
|
|
219
|
+
flex-direction: column;
|
|
220
|
+
gap: var(--ezp-spacing-2);
|
|
221
|
+
min-width: 0;
|
|
187
222
|
}
|
|
188
223
|
|
|
189
|
-
.
|
|
190
|
-
|
|
224
|
+
.file-size {
|
|
225
|
+
color: var(--ezp-core-foreground-secondary);
|
|
191
226
|
}
|
|
192
227
|
|
|
193
|
-
.
|
|
228
|
+
.file-remove {
|
|
194
229
|
align-items: center;
|
|
195
230
|
appearance: none;
|
|
196
|
-
background:
|
|
197
|
-
border:
|
|
198
|
-
border-radius:
|
|
199
|
-
color: var(--ezp-core-foreground-
|
|
231
|
+
background: transparent;
|
|
232
|
+
border: 0;
|
|
233
|
+
border-radius: 6px;
|
|
234
|
+
color: var(--ezp-core-foreground-tertiary);
|
|
200
235
|
cursor: pointer;
|
|
201
236
|
display: flex;
|
|
202
|
-
height:
|
|
237
|
+
height: 28px;
|
|
203
238
|
justify-content: center;
|
|
204
239
|
padding: 0;
|
|
205
|
-
position: absolute;
|
|
206
|
-
right: 8px;
|
|
207
|
-
top: -4px;
|
|
208
240
|
transition: color var(--ezp-duration-2) var(--ezp-easing-out-quart);
|
|
209
|
-
width:
|
|
210
|
-
z-index: 1;
|
|
241
|
+
width: 28px;
|
|
211
242
|
}
|
|
212
|
-
.
|
|
213
|
-
--ezp-icon-size:
|
|
214
|
-
--ezp-icon-gridTemplate:
|
|
243
|
+
.file-remove ezp-icon {
|
|
244
|
+
--ezp-icon-size: 16px;
|
|
245
|
+
--ezp-icon-gridTemplate: 16px;
|
|
215
246
|
}
|
|
216
247
|
@media (hover: hover) {
|
|
217
|
-
.
|
|
248
|
+
.file-remove:hover {
|
|
218
249
|
color: var(--ezp-core-foreground-primary);
|
|
219
250
|
}
|
|
220
251
|
}
|
|
221
252
|
|
|
222
|
-
|
|
223
|
-
cursor: pointer;
|
|
224
|
-
}
|
|
225
|
-
.thumb-add .thumb-add-icon {
|
|
253
|
+
#add-more {
|
|
226
254
|
align-items: center;
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
255
|
+
appearance: none;
|
|
256
|
+
background: var(--ezp-upload-addMore-background, transparent);
|
|
257
|
+
border: 0;
|
|
258
|
+
border-top: 1px solid var(--ezp-core-outline);
|
|
259
|
+
color: var(--ezp-theme-solid);
|
|
260
|
+
cursor: pointer;
|
|
230
261
|
display: flex;
|
|
231
|
-
|
|
262
|
+
font-family: inherit;
|
|
263
|
+
gap: 4px;
|
|
232
264
|
justify-content: center;
|
|
233
|
-
|
|
234
|
-
|
|
265
|
+
padding: var(--ezp-spacing-3);
|
|
266
|
+
transition: background-color var(--ezp-duration-2) var(--ezp-easing-out-quart);
|
|
267
|
+
width: 100%;
|
|
235
268
|
}
|
|
236
|
-
|
|
237
|
-
--ezp-icon-size:
|
|
238
|
-
--ezp-icon-gridTemplate:
|
|
269
|
+
#add-more ezp-icon {
|
|
270
|
+
--ezp-icon-size: 18px;
|
|
271
|
+
--ezp-icon-gridTemplate: 18px;
|
|
239
272
|
}
|
|
240
273
|
@media (hover: hover) {
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
color: var(--ezp-theme-solid);
|
|
274
|
+
#add-more:hover {
|
|
275
|
+
--ezp-upload-addMore-background: var(--ezp-core-shade-primary);
|
|
244
276
|
}
|
|
245
277
|
}
|
|
246
278
|
|
|
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
279
|
/**
|
|
260
280
|
*
|
|
261
281
|
* Footer
|
|
262
282
|
*
|
|
263
283
|
*/
|
|
264
284
|
#footer {
|
|
285
|
+
border-top: 1px solid var(--ezp-core-outline);
|
|
265
286
|
display: grid;
|
|
266
287
|
gap: var(--ezp-spacing-3);
|
|
267
288
|
grid-template-columns: 1fr 1.4fr;
|
|
289
|
+
padding: var(--ezp-spacing-4);
|
|
268
290
|
}
|
|
269
291
|
|
|
270
292
|
.action {
|
|
271
|
-
--ezp-textButton-borderRadius:
|
|
272
|
-
--ezp-textButton-padding: var(--ezp-spacing-
|
|
293
|
+
--ezp-textButton-borderRadius: 8px;
|
|
294
|
+
--ezp-textButton-padding: 13px var(--ezp-spacing-3);
|
|
295
|
+
--ezp-textButton-whiteSpace: normal;
|
|
296
|
+
text-align: center;
|
|
273
297
|
}
|
|
274
298
|
|
|
275
|
-
|
|
276
|
-
|
|
299
|
+
/* Outlined rather than filled, so the primary action stays the only solid one. */
|
|
300
|
+
#clear {
|
|
301
|
+
--ezp-textButton-background-active: var(--ezp-core-shade-secondary);
|
|
302
|
+
--ezp-textButton-background-hover: var(--ezp-core-shade-primary);
|
|
303
|
+
--ezp-textButton-background-init: transparent;
|
|
304
|
+
--ezp-textButton-boxShadow: inset 0 0 0 1px var(--ezp-core-outline);
|
|
305
|
+
--ezp-textButton-color-init: var(--ezp-core-foreground-primary);
|
|
277
306
|
}
|
|
@@ -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 : []);
|
|
@@ -39,6 +60,8 @@ export class EzpUpload {
|
|
|
39
60
|
}
|
|
40
61
|
};
|
|
41
62
|
this.handleCancel = () => {
|
|
63
|
+
if (this.selectedFiles.length === 0)
|
|
64
|
+
return;
|
|
42
65
|
// Closing is the host's call: the event bubbles to `ezp-printing`, which
|
|
43
66
|
// ends the print flow. It also reaches the document, where our own
|
|
44
67
|
// `printCancel` listener resets the form and the selection.
|
|
@@ -57,12 +80,11 @@ export class EzpUpload {
|
|
|
57
80
|
var _a;
|
|
58
81
|
(_a = this.unsubscribeLanguage) === null || _a === void 0 ? void 0 : _a.call(this);
|
|
59
82
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
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++;
|
|
66
88
|
this.dragging = true;
|
|
67
89
|
}
|
|
68
90
|
handleDragOver(event) {
|
|
@@ -73,22 +95,37 @@ export class EzpUpload {
|
|
|
73
95
|
}
|
|
74
96
|
}
|
|
75
97
|
handleDragLeave() {
|
|
76
|
-
this.
|
|
98
|
+
this.dragDepth = Math.max(0, this.dragDepth - 1);
|
|
99
|
+
this.dragging = this.dragDepth > 0;
|
|
77
100
|
}
|
|
78
101
|
handleDrop(event) {
|
|
79
102
|
var _a, _b;
|
|
80
103
|
event.stopPropagation();
|
|
81
104
|
event.preventDefault();
|
|
105
|
+
this.dragDepth = 0;
|
|
82
106
|
this.dragging = false;
|
|
83
107
|
const files = Array.from((_b = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) !== null && _b !== void 0 ? _b : []);
|
|
84
108
|
// Add new files to existing selection instead of replacing
|
|
85
109
|
this.selectedFiles = [...this.selectedFiles, ...files];
|
|
86
110
|
this.uploadFile.emit(this.selectedFiles);
|
|
87
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
|
+
}
|
|
88
118
|
listenPrintCancel() {
|
|
89
119
|
var _a;
|
|
90
120
|
(_a = this.form) === null || _a === void 0 ? void 0 : _a.reset();
|
|
91
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);
|
|
92
129
|
}
|
|
93
130
|
/** Extract a short, upper-cased file-type label from the file name. */
|
|
94
131
|
fileType(name) {
|
|
@@ -115,7 +152,7 @@ export class EzpUpload {
|
|
|
115
152
|
*/
|
|
116
153
|
render() {
|
|
117
154
|
const hasFiles = this.selectedFiles.length > 0;
|
|
118
|
-
return (h(Host, { key: '
|
|
155
|
+
return (h(Host, { key: '4230fcbee5d8a20d79c05035a1783f16696a66fa', class: { dragging: this.dragging } }, h("form", { key: '5dcae80d94508ebe05e3dc8df463b0a1b79563ff', id: "form", ref: (form) => (this.form = form) }, h("input", { key: '480307c4fdbe7a39ba3872bce7cf905888f7946b', 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: '95a58113221f2337323f0b6df3d58e459fdece2c', id: "modal" }, h("div", { key: '876b5ebe74d685b2ec7196df3deb8a9fd5437305', id: "body-frame" }, h("div", { key: '15465aeb4e939ce26b09d1a1c4f9b9b5d8901762', id: "body" }, !hasFiles && (h("div", { key: '912e27683e12d3d8ca999b4c3dbe1f528677aafd', id: "dropzone" }, h("ezp-icon", { key: '8cb1edf6b5c14a7815e52f7bc91d674047045e57', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '678ea4205fbe81d3621dc205303533eb8c12ce23', id: "dropzone-title", level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') }), h("div", { key: '0fcd25bb9f12c1cd0c056d88cf94a20946b44f2a', id: "dropzone-prompt" }, h("ezp-text-button", { key: '5cc5ff7a98f87ae1eb2db4009435b926924be2e9', id: "choose", type: "button", onClick: this.openPicker, label: i18next.t('upload.choose_files') }), h("ezp-label", { key: 'b64fe2cadd1639c5ef0b10da0084d420abd8232f', id: "drag-hint", level: "secondary", weight: "strong", text: i18next.t('upload.drag_hint') }), h("ezp-label", { key: '5bf5178e691d35a58e988bacff656bd790f4c6ea', id: "formats", level: "tertiary", text: SUPPORTED_FORMATS.join(', ') })))), hasFiles && (h("div", { key: '289ce054d8987ba1d2a5c6481171dce341dd1e5c', 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-label", { class: "file-name", ellipsis: true, weight: "heavy", text: file.name }), 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: 'd0b397071945aadecde0a92b9a9e36a40a612197', type: "button", id: "add-more", onClick: this.openPicker }, h("ezp-icon", { key: 'cd89350e28759f3d2b4553367ff6c6f4eaf07dfc', name: "plus" }), h("ezp-label", { key: '0f959da4e971ad6520563d892afb086b1a3df5a4', level: "secondary", weight: "heavy", text: i18next.t('upload.add_more') }))))), hasFiles && this.dragging && (h("div", { key: 'd767d3dc25ce56b85dd0b3dcacf88a6fa4e420e1', id: "drop-overlay", "aria-hidden": "true" }, h("ezp-icon", { key: 'fefa5a29b5bd2df98b5d9fedfce2e6800418544f', id: "dropzone-icon", name: "cloud-upload" }), h("ezp-label", { key: '7ef3bba07de86ecefa094617f6262f47875db36a', level: "primary", weight: "heavy", text: i18next.t('upload.dropzone_title') })))), h("div", { key: 'd7b1f67053bd4e0eef8d271eb7c3e547d4d40af3', id: "footer" }, h("ezp-text-button", { key: 'c0195d9ba0012a5297254eae8d60dc90337eb7a1', id: "clear", type: "button", level: "secondary", disabled: !hasFiles, onClick: this.handleCancel, label: i18next.t('upload.remove_files'), class: "action" }), h("ezp-text-button", { key: '154a5770c232fadd7befd1af09c26cbe5d143f36', id: "continue", type: "button", disabled: !hasFiles, onClick: this.handleContinue, label: i18next.t('upload.continue'), class: "action" }))))));
|
|
119
156
|
}
|
|
120
157
|
static get is() { return "ezp-upload"; }
|
|
121
158
|
static get encapsulation() { return "shadow"; }
|
|
@@ -204,7 +241,7 @@ export class EzpUpload {
|
|
|
204
241
|
"method": "handleDragEnter",
|
|
205
242
|
"target": undefined,
|
|
206
243
|
"capture": false,
|
|
207
|
-
"passive":
|
|
244
|
+
"passive": false
|
|
208
245
|
}, {
|
|
209
246
|
"name": "dragover",
|
|
210
247
|
"method": "handleDragOver",
|
|
@@ -223,6 +260,18 @@ export class EzpUpload {
|
|
|
223
260
|
"target": undefined,
|
|
224
261
|
"capture": false,
|
|
225
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
|
|
226
275
|
}, {
|
|
227
276
|
"name": "printCancel",
|
|
228
277
|
"method": "listenPrintCancel",
|
|
@@ -84,7 +84,7 @@ export class EzpUserMenu {
|
|
|
84
84
|
*
|
|
85
85
|
*/
|
|
86
86
|
render() {
|
|
87
|
-
return (h(Host, { key: '
|
|
87
|
+
return (h(Host, { key: '3d13f203651146743cf8ac7754764e37d5cead30', class: this.open ? 'is-open' : '' }, h("div", { key: '28c08e6068d25a96d385553491edfcec25e516d3', id: "header" }, h("ezp-label", { key: '45881a8cff5d1efbbae133cd13206120c2ae17da', ellipsis: true, id: "name", weight: "heavy", text: this.name }), h("ezp-icon-button", { key: '92205d9008c0d3a68989ea8bca24c481b1542716', id: "close", level: "tertiary", icon: "close", onClick: this.handleClose })), h("div", { key: '4ef631425b38ed208f5e55446525c45943e6dfee', 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: '85e8603a60e7150458e31cc20bbaa99a0f024636', class: "link", onClick: this.logOut }, h("ezp-icon", { key: 'c96a13aeb65e645e7180c469d9168550d6bfaee2', class: "link__icon", name: "logout" }), h("ezp-label", { key: '1aa825d659ffedd8318016540716c88a27f4f75b', text: i18next.t('user_menu.logout') }))), h("div", { key: 'c7d2c25bebb2601c34215766b2e85359834e16f7', id: "theme" }, h("ezp-label", { key: 'e39f708172868841fd5d043dc6d8466a4db71405', class: "caption", text: `${i18next.t('user_menu.theme')}:`, weight: "heavy" }), h("div", { key: '26dc2c26d4408c0cb03d0e2fbd4954744eb2ada4', 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: 'ed62f9a441fd9eb464699c8cfdc277148b471bf8', id: "appearance" }, h("ezp-label", { key: '6b21204284c739cc00d79caca622f892d44a6889', class: "caption", text: `${i18next.t('user_menu.appearance')}:`, weight: "heavy" }), h("div", { key: 'fcd9dcf68b857b6b22b7617dd999c7137ab04c9e', 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"; }
|
|
@@ -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:"47a8f8b4f1dd6a8cb2b67ffc21e8770e555a52e3",class:{focused:this.focused,"has-icon":e},onClick:this.setFocus},e?o("ezp-icon",{id:"icon",name:this.icon}):null,o("ezp-label",{key:"7d9401d2ab927cb52cd2fcfbdcf8790c5a6d0228",id:"label",noWrap:!0,level:"secondary",text:this.label}),o("input",{key:"f0422183a1677ba90e8fe74d6ccf3abdaeb3d645",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 p=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"}render(){return l(a,{key:"
|
|
1
|
+
import{proxyCustomElement as e,HTMLElement as t,h as l,Host as a,transformTag as i}from"@stencil/core/internal/client";const p=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"}render(){return l(a,{key:"941746aaf861bd3ffe8dc65c1c5dbc52866be923",class:`${this.level} ${this.weight} ${this.ellipsis?"ellipsis":""} ${this.noWrap?"no-wrap":""}`},l("div",{key:"36ee30f53e0209f569129ce1c1ca8e1ccf5d0803",id:"text"},this.text))}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]}]);function o(){"undefined"!=typeof customElements&&["ezp-label"].forEach((e=>{"ezp-label"===e&&(customElements.get(i(e))||customElements.define(i(e),p))}))}export{p as E,o as d}
|