@vaadin/upload 25.0.0-alpha1 → 25.0.0-alpha11
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/package.json +11 -12
- package/src/styles/vaadin-upload-base-styles.d.ts +8 -0
- package/src/styles/vaadin-upload-base-styles.js +58 -0
- package/src/styles/vaadin-upload-file-base-styles.js +137 -0
- package/src/styles/vaadin-upload-file-list-base-styles.d.ts +8 -0
- package/src/styles/vaadin-upload-file-list-base-styles.js +35 -0
- package/src/styles/vaadin-upload-icon-base-styles.d.ts +8 -0
- package/src/styles/vaadin-upload-icon-base-styles.js +33 -0
- package/src/vaadin-upload-file-list.js +5 -17
- package/src/vaadin-upload-file.js +3 -2
- package/src/vaadin-upload-icon.js +10 -10
- package/src/vaadin-upload.d.ts +1 -1
- package/src/vaadin-upload.js +6 -18
- package/vaadin-upload.js +1 -1
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
- package/src/vaadin-upload-file-styles.js +0 -32
- package/theme/lumo/vaadin-upload-styles.d.ts +0 -8
- package/theme/lumo/vaadin-upload-styles.js +0 -192
- package/theme/lumo/vaadin-upload.d.ts +0 -2
- package/theme/lumo/vaadin-upload.js +0 -2
- /package/src/{vaadin-upload-file-styles.d.ts → styles/vaadin-upload-file-base-styles.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/upload",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha11",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"theme",
|
|
25
24
|
"vaadin-*.d.ts",
|
|
26
25
|
"vaadin-*.js",
|
|
27
26
|
"web-types.json",
|
|
@@ -35,23 +34,23 @@
|
|
|
35
34
|
],
|
|
36
35
|
"dependencies": {
|
|
37
36
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
38
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
39
|
-
"@vaadin/button": "25.0.0-
|
|
40
|
-
"@vaadin/component-base": "25.0.0-
|
|
41
|
-
"@vaadin/progress-bar": "25.0.0-
|
|
42
|
-
"@vaadin/vaadin-
|
|
43
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha1",
|
|
37
|
+
"@vaadin/a11y-base": "25.0.0-alpha11",
|
|
38
|
+
"@vaadin/button": "25.0.0-alpha11",
|
|
39
|
+
"@vaadin/component-base": "25.0.0-alpha11",
|
|
40
|
+
"@vaadin/progress-bar": "25.0.0-alpha11",
|
|
41
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha11",
|
|
44
42
|
"lit": "^3.0.0"
|
|
45
43
|
},
|
|
46
44
|
"devDependencies": {
|
|
47
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
48
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
49
|
-
"@vaadin/testing-helpers": "^
|
|
45
|
+
"@vaadin/chai-plugins": "25.0.0-alpha11",
|
|
46
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha11",
|
|
47
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
48
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha11",
|
|
50
49
|
"sinon": "^18.0.0"
|
|
51
50
|
},
|
|
52
51
|
"web-types": [
|
|
53
52
|
"web-types.json",
|
|
54
53
|
"web-types.lit.json"
|
|
55
54
|
],
|
|
56
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "abfd315ba5a7484a613e0768635a4e8fe945a44b"
|
|
57
56
|
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const uploadStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
background: var(--vaadin-upload-background, transparent);
|
|
12
|
+
border: var(
|
|
13
|
+
--vaadin-upload-border,
|
|
14
|
+
var(--vaadin-upload-border-width, 1px) solid var(--vaadin-upload-border-color, var(--vaadin-border-color))
|
|
15
|
+
);
|
|
16
|
+
border-radius: var(--vaadin-upload-border-radius, var(--vaadin-radius-m));
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
padding: var(--vaadin-upload-padding, var(--vaadin-padding));
|
|
21
|
+
position: relative;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([dragover-valid]) {
|
|
25
|
+
--vaadin-upload-background: var(--vaadin-background-container);
|
|
26
|
+
--vaadin-upload-border: 1px dashed var(--vaadin-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
:host([hidden]) {
|
|
30
|
+
display: none !important;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
[hidden] {
|
|
34
|
+
display: none !important;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
[part='primary-buttons'] {
|
|
38
|
+
align-items: center;
|
|
39
|
+
display: flex;
|
|
40
|
+
gap: var(--vaadin-gap-container-inline);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
[part='drop-label'] {
|
|
44
|
+
align-items: center;
|
|
45
|
+
color: var(--vaadin-upload-drop-label-color, var(--vaadin-color));
|
|
46
|
+
display: flex;
|
|
47
|
+
font-size: var(--vaadin-upload-drop-label-font-size, inherit);
|
|
48
|
+
font-weight: var(--vaadin-upload-drop-label-font-weight, inherit);
|
|
49
|
+
gap: var(--vaadin-upload-drop-label-gap, var(--vaadin-gap-container-inline));
|
|
50
|
+
line-height: var(--vaadin-upload-drop-label-line-height, inherit);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
:host([nodrop]) {
|
|
54
|
+
--vaadin-upload-border: none;
|
|
55
|
+
--vaadin-upload-border-radius: 0;
|
|
56
|
+
--vaadin-upload-padding: 0;
|
|
57
|
+
}
|
|
58
|
+
`;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const uploadFileStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
align-items: center;
|
|
12
|
+
display: grid;
|
|
13
|
+
gap: var(--vaadin-upload-file-gap, var(--vaadin-gap-container-block));
|
|
14
|
+
grid-template-columns: var(--vaadin-icon-size, 1lh) minmax(0, 1fr) auto;
|
|
15
|
+
padding: var(--vaadin-upload-file-padding, var(--vaadin-padding));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[hidden] {
|
|
19
|
+
display: none;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
[part='row'] {
|
|
23
|
+
display: contents;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
[part='info'] {
|
|
27
|
+
display: contents;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
[part='done-icon']:not([hidden]),
|
|
31
|
+
[part='warning-icon']:not([hidden]) {
|
|
32
|
+
display: flex;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
[part='done-icon']::before,
|
|
36
|
+
[part='warning-icon']::before {
|
|
37
|
+
content: '';
|
|
38
|
+
display: inline-block;
|
|
39
|
+
flex: none;
|
|
40
|
+
height: var(--vaadin-icon-size, 1lh);
|
|
41
|
+
width: var(--vaadin-icon-size, 1lh);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
[part='done-icon']::before {
|
|
45
|
+
background: var(--vaadin-upload-file-done-color, currentColor);
|
|
46
|
+
mask-image: var(--_vaadin-icon-checkmark);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
[part='warning-icon']::before {
|
|
50
|
+
background: var(--vaadin-upload-file-warning-color, currentColor);
|
|
51
|
+
mask-image: var(--_vaadin-icon-warn);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
[part='meta'] {
|
|
55
|
+
grid-column: 2;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
[part='name'] {
|
|
59
|
+
color: var(--vaadin-upload-file-name-color, var(--vaadin-color));
|
|
60
|
+
font-size: var(--vaadin-upload-file-name-font-size, inherit);
|
|
61
|
+
font-weight: var(--vaadin-upload-file-name-font-weight, inherit);
|
|
62
|
+
line-height: var(--vaadin-upload-file-name-line-height, inherit);
|
|
63
|
+
overflow: hidden;
|
|
64
|
+
text-overflow: ellipsis;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
[part='status'] {
|
|
68
|
+
color: var(--vaadin-upload-file-status-color, var(--vaadin-color-subtle));
|
|
69
|
+
font-size: var(--vaadin-upload-file-status-font-size, inherit);
|
|
70
|
+
font-weight: var(--vaadin-upload-file-status-font-weight, inherit);
|
|
71
|
+
line-height: var(--vaadin-upload-file-status-line-height, inherit);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
[part='error'] {
|
|
75
|
+
color: var(--vaadin-upload-file-error-color, var(--vaadin-color));
|
|
76
|
+
font-size: var(--vaadin-upload-file-error-font-size, inherit);
|
|
77
|
+
font-weight: var(--vaadin-upload-file-error-font-weight, inherit);
|
|
78
|
+
line-height: var(--vaadin-upload-file-error-line-height, inherit);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
button {
|
|
82
|
+
background: var(--vaadin-upload-file-button-background, transparent);
|
|
83
|
+
border: var(
|
|
84
|
+
--vaadin-upload-file-button-border,
|
|
85
|
+
var(--vaadin-upload-file-button-border-width, 1px) solid
|
|
86
|
+
var(--vaadin-upload-file-button-border-color, transparent)
|
|
87
|
+
);
|
|
88
|
+
border-radius: var(--vaadin-upload-file-button-border-radius, var(--vaadin-radius-m));
|
|
89
|
+
color: var(--vaadin-upload-file-button-text-color, var(--vaadin-color));
|
|
90
|
+
cursor: var(--vaadin-clickable-cursor);
|
|
91
|
+
flex-shrink: 0;
|
|
92
|
+
font-family: var(--vaadin-upload-file-button-font-family, inherit);
|
|
93
|
+
font-size: var(--vaadin-upload-file-button-font-size, inherit);
|
|
94
|
+
font-weight: var(--vaadin-upload-file-button-font-weight, 500);
|
|
95
|
+
height: var(--vaadin-upload-file-button-height, auto);
|
|
96
|
+
line-height: var(--vaadin-upload-file-button-line-height, inherit);
|
|
97
|
+
padding: var(--vaadin-upload-file-button-padding, var(--vaadin-padding-container));
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
[part='start-button']::before,
|
|
101
|
+
[part='retry-button']::before,
|
|
102
|
+
[part='remove-button']::before {
|
|
103
|
+
background: currentColor;
|
|
104
|
+
content: '';
|
|
105
|
+
display: block;
|
|
106
|
+
height: var(--vaadin-icon-size, 1lh);
|
|
107
|
+
width: var(--vaadin-icon-size, 1lh);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
[part='start-button']::before {
|
|
111
|
+
mask-image: var(--_vaadin-icon-play);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
[part='retry-button']::before {
|
|
115
|
+
mask-image: var(--_vaadin-icon-refresh);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
[part='remove-button']::before {
|
|
119
|
+
mask-image: var(--_vaadin-icon-cross);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
::slotted([slot='progress']) {
|
|
123
|
+
grid-column: 2 / -1;
|
|
124
|
+
width: auto;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
:host([complete]) ::slotted([slot='progress']),
|
|
128
|
+
:host([error]) ::slotted([slot='progress']) {
|
|
129
|
+
display: none;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
@media (forced-colors: active) {
|
|
133
|
+
:is([part$='icon'], [part$='button'])::before {
|
|
134
|
+
background: CanvasText;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const uploadFileListStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
display: block;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host([hidden]) {
|
|
15
|
+
display: none !important;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
[part='list'] {
|
|
19
|
+
list-style-type: none;
|
|
20
|
+
margin: 0;
|
|
21
|
+
padding: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
::slotted(:first-child) {
|
|
25
|
+
margin-top: var(--vaadin-upload-gap, var(--vaadin-gap-container-block));
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
::slotted(li:not(:last-of-type)) {
|
|
29
|
+
border-bottom: var(
|
|
30
|
+
--vaadin-upload-file-list-border,
|
|
31
|
+
var(--vaadin-upload-file-list-border-width, 1px) solid
|
|
32
|
+
var(--vaadin-upload-file-list-border-color, var(--vaadin-border-color))
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
+
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
+
*/
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
|
+
import { css } from 'lit';
|
|
8
|
+
|
|
9
|
+
export const uploadIconStyles = css`
|
|
10
|
+
:host {
|
|
11
|
+
display: inline-flex;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
:host::before {
|
|
15
|
+
background: var(--vaadin-upload-icon-color, currentColor);
|
|
16
|
+
content: '';
|
|
17
|
+
display: inline-block;
|
|
18
|
+
flex: none;
|
|
19
|
+
height: var(--vaadin-icon-size, 1lh);
|
|
20
|
+
mask-image: var(--_vaadin-icon-upload);
|
|
21
|
+
width: var(--vaadin-icon-size, 1lh);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
:host([hidden]) {
|
|
25
|
+
display: none !important;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@media (forced-colors: active) {
|
|
29
|
+
:host::before {
|
|
30
|
+
background: CanvasText;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
6
|
import './vaadin-upload-file.js';
|
|
7
|
-
import {
|
|
7
|
+
import { html, LitElement } from 'lit';
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
10
11
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
+
import { uploadFileListStyles } from './styles/vaadin-upload-file-list-base-styles.js';
|
|
11
13
|
import { UploadFileListMixin } from './vaadin-upload-file-list-mixin.js';
|
|
12
14
|
|
|
13
15
|
/**
|
|
@@ -19,27 +21,13 @@ import { UploadFileListMixin } from './vaadin-upload-file-list-mixin.js';
|
|
|
19
21
|
* @mixes UploadFileListMixin
|
|
20
22
|
* @private
|
|
21
23
|
*/
|
|
22
|
-
class UploadFileList extends UploadFileListMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
24
|
+
class UploadFileList extends UploadFileListMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))) {
|
|
23
25
|
static get is() {
|
|
24
26
|
return 'vaadin-upload-file-list';
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
static get styles() {
|
|
28
|
-
return
|
|
29
|
-
:host {
|
|
30
|
-
display: block;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
:host([hidden]) {
|
|
34
|
-
display: none !important;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
[part='list'] {
|
|
38
|
-
padding: 0;
|
|
39
|
-
margin: 0;
|
|
40
|
-
list-style-type: none;
|
|
41
|
-
}
|
|
42
|
-
`;
|
|
30
|
+
return uploadFileListStyles;
|
|
43
31
|
}
|
|
44
32
|
|
|
45
33
|
/** @protected */
|
|
@@ -8,9 +8,10 @@ import './vaadin-upload-icons.js';
|
|
|
8
8
|
import { html, LitElement, nothing } from 'lit';
|
|
9
9
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
10
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
11
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
+
import { uploadFileStyles } from './styles/vaadin-upload-file-base-styles.js';
|
|
12
14
|
import { UploadFileMixin } from './vaadin-upload-file-mixin.js';
|
|
13
|
-
import { uploadFileStyles } from './vaadin-upload-file-styles.js';
|
|
14
15
|
|
|
15
16
|
/**
|
|
16
17
|
* `<vaadin-upload-file>` element represents a file in the file list of `<vaadin-upload>`.
|
|
@@ -53,7 +54,7 @@ import { uploadFileStyles } from './vaadin-upload-file-styles.js';
|
|
|
53
54
|
* @mixes UploadFileMixin
|
|
54
55
|
* @mixes ThemableMixin
|
|
55
56
|
*/
|
|
56
|
-
class UploadFile extends UploadFileMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
57
|
+
class UploadFile extends UploadFileMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement)))) {
|
|
57
58
|
static get is() {
|
|
58
59
|
return 'vaadin-upload-file';
|
|
59
60
|
}
|
|
@@ -3,9 +3,11 @@
|
|
|
3
3
|
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
4
|
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
6
|
+
import { html, LitElement } from 'lit';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
8
9
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
|
+
import { uploadIconStyles } from './styles/vaadin-upload-icon-base-styles.js';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* An element used internally by `<vaadin-upload>`. Not intended to be used separately.
|
|
@@ -14,21 +16,19 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
14
16
|
* @extends HTMLElement
|
|
15
17
|
* @private
|
|
16
18
|
*/
|
|
17
|
-
class UploadIcon extends ThemableMixin(LitElement) {
|
|
19
|
+
class UploadIcon extends ThemableMixin(LumoInjectionMixin(LitElement)) {
|
|
18
20
|
static get is() {
|
|
19
21
|
return 'vaadin-upload-icon';
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
static get styles() {
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
display: inline-block;
|
|
26
|
-
}
|
|
25
|
+
return uploadIconStyles;
|
|
26
|
+
}
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
static get lumoInjector() {
|
|
29
|
+
return {
|
|
30
|
+
includeBaseStyles: true,
|
|
31
|
+
};
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
/** @protected */
|
package/src/vaadin-upload.d.ts
CHANGED
package/src/vaadin-upload.js
CHANGED
|
@@ -7,12 +7,14 @@ import '@vaadin/button/src/vaadin-button.js';
|
|
|
7
7
|
import './vaadin-upload-icon.js';
|
|
8
8
|
import './vaadin-upload-icons.js';
|
|
9
9
|
import './vaadin-upload-file-list.js';
|
|
10
|
-
import {
|
|
10
|
+
import { html, LitElement } from 'lit';
|
|
11
11
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
12
12
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
13
13
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
14
14
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
15
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
15
16
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
17
|
+
import { uploadStyles } from './styles/vaadin-upload-base-styles.js';
|
|
16
18
|
import { UploadMixin } from './vaadin-upload-mixin.js';
|
|
17
19
|
|
|
18
20
|
/**
|
|
@@ -20,7 +22,7 @@ import { UploadMixin } from './vaadin-upload-mixin.js';
|
|
|
20
22
|
*
|
|
21
23
|
* Example:
|
|
22
24
|
*
|
|
23
|
-
* ```
|
|
25
|
+
* ```html
|
|
24
26
|
* <vaadin-upload></vaadin-upload>
|
|
25
27
|
* ```
|
|
26
28
|
*
|
|
@@ -64,27 +66,13 @@ import { UploadMixin } from './vaadin-upload-mixin.js';
|
|
|
64
66
|
* @mixes ElementMixin
|
|
65
67
|
* @mixes UploadMixin
|
|
66
68
|
*/
|
|
67
|
-
class Upload extends UploadMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
69
|
+
class Upload extends UploadMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
68
70
|
static get is() {
|
|
69
71
|
return 'vaadin-upload';
|
|
70
72
|
}
|
|
71
73
|
|
|
72
74
|
static get styles() {
|
|
73
|
-
return
|
|
74
|
-
:host {
|
|
75
|
-
display: block;
|
|
76
|
-
position: relative;
|
|
77
|
-
box-sizing: border-box;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
:host([hidden]) {
|
|
81
|
-
display: none !important;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
[hidden] {
|
|
85
|
-
display: none !important;
|
|
86
|
-
}
|
|
87
|
-
`;
|
|
75
|
+
return uploadStyles;
|
|
88
76
|
}
|
|
89
77
|
|
|
90
78
|
/** @protected */
|
package/vaadin-upload.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './src/vaadin-upload.js';
|
|
2
2
|
export * from './src/vaadin-upload.js';
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/upload",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -263,7 +263,7 @@
|
|
|
263
263
|
},
|
|
264
264
|
{
|
|
265
265
|
"name": "vaadin-upload",
|
|
266
|
-
"description": "`<vaadin-upload>` is a Web Component for uploading multiple files with drag and drop support.\n\nExample:\n\n
|
|
266
|
+
"description": "`<vaadin-upload>` is a Web Component for uploading multiple files with drag and drop support.\n\nExample:\n\n```html\n<vaadin-upload></vaadin-upload>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-------------------|-------------------------------------\n`primary-buttons` | Upload container\n`drop-label` | Element wrapping drop label and icon\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n---|---|---\n`disabled` | Set when the element is disabled | `:host`\n`nodrop` | Set when drag and drop is disabled (e. g., on touch devices) | `:host`\n`dragover` | A file is being dragged over the element | `:host`\n`dragover-valid` | A dragged file is valid with `maxFiles` and `accept` criteria | `:host`\n`max-files-reached` | The maximum number of files that the user is allowed to add to the upload has been reached | `:host`\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
267
267
|
"attributes": [
|
|
268
268
|
{
|
|
269
269
|
"name": "disabled",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/upload",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-alpha11",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
"name": "vaadin-upload",
|
|
124
|
-
"description": "`<vaadin-upload>` is a Web Component for uploading multiple files with drag and drop support.\n\nExample:\n\n
|
|
124
|
+
"description": "`<vaadin-upload>` is a Web Component for uploading multiple files with drag and drop support.\n\nExample:\n\n```html\n<vaadin-upload></vaadin-upload>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-------------------|-------------------------------------\n`primary-buttons` | Upload container\n`drop-label` | Element wrapping drop label and icon\n\nThe following state attributes are available for styling:\n\nAttribute | Description | Part name\n---|---|---\n`disabled` | Set when the element is disabled | `:host`\n`nodrop` | Set when drag and drop is disabled (e. g., on touch devices) | `:host`\n`dragover` | A file is being dragged over the element | `:host`\n`dragover-valid` | A dragged file is valid with `maxFiles` and `accept` criteria | `:host`\n`max-files-reached` | The maximum number of files that the user is allowed to add to the upload has been reached | `:host`\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
|
|
125
125
|
"extension": true,
|
|
126
126
|
"attributes": [
|
|
127
127
|
{
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright (c) 2016 - 2025 Vaadin Ltd.
|
|
4
|
-
* This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
|
|
5
|
-
*/
|
|
6
|
-
import { css } from 'lit';
|
|
7
|
-
|
|
8
|
-
export const uploadFileStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: block;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
[hidden] {
|
|
14
|
-
display: none;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
[part='row'] {
|
|
18
|
-
list-style-type: none;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
button {
|
|
22
|
-
background: transparent;
|
|
23
|
-
padding: 0;
|
|
24
|
-
border: none;
|
|
25
|
-
box-shadow: none;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
:host([complete]) ::slotted([slot='progress']),
|
|
29
|
-
:host([error]) ::slotted([slot='progress']) {
|
|
30
|
-
display: none !important;
|
|
31
|
-
}
|
|
32
|
-
`;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/font-icons.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
4
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
5
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
6
|
-
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
7
|
-
import '@vaadin/button/theme/lumo/vaadin-button-styles.js';
|
|
8
|
-
import '@vaadin/progress-bar/theme/lumo/vaadin-progress-bar-styles.js';
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-lumo-styles/font-icons.js';
|
|
2
|
-
import '@vaadin/vaadin-lumo-styles/color.js';
|
|
3
|
-
import '@vaadin/vaadin-lumo-styles/sizing.js';
|
|
4
|
-
import '@vaadin/vaadin-lumo-styles/spacing.js';
|
|
5
|
-
import '@vaadin/vaadin-lumo-styles/style.js';
|
|
6
|
-
import '@vaadin/vaadin-lumo-styles/typography.js';
|
|
7
|
-
import '@vaadin/button/theme/lumo/vaadin-button-styles.js';
|
|
8
|
-
import '@vaadin/progress-bar/theme/lumo/vaadin-progress-bar-styles.js';
|
|
9
|
-
import { fieldButton } from '@vaadin/vaadin-lumo-styles/mixins/field-button.js';
|
|
10
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
|
-
|
|
12
|
-
registerStyles(
|
|
13
|
-
'vaadin-upload',
|
|
14
|
-
css`
|
|
15
|
-
:host {
|
|
16
|
-
line-height: var(--lumo-line-height-m);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
:host(:not([nodrop])) {
|
|
20
|
-
overflow: hidden;
|
|
21
|
-
border: 1px dashed var(--lumo-contrast-20pct);
|
|
22
|
-
border-radius: var(--lumo-border-radius-l);
|
|
23
|
-
padding: var(--lumo-space-m);
|
|
24
|
-
transition:
|
|
25
|
-
background-color 0.6s,
|
|
26
|
-
border-color 0.6s;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
[part='drop-label'] {
|
|
30
|
-
display: inline-block;
|
|
31
|
-
white-space: normal;
|
|
32
|
-
padding: 0 var(--lumo-space-s);
|
|
33
|
-
color: var(--lumo-secondary-text-color);
|
|
34
|
-
font-family: var(--lumo-font-family);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
:host([dragover-valid]) {
|
|
38
|
-
border-color: var(--lumo-primary-color-50pct);
|
|
39
|
-
background: var(--lumo-primary-color-10pct);
|
|
40
|
-
transition:
|
|
41
|
-
background-color 0.1s,
|
|
42
|
-
border-color 0.1s;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
:host([dragover-valid]) [part='drop-label'] {
|
|
46
|
-
color: var(--lumo-primary-text-color);
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
:host([disabled]) [part='drop-label'],
|
|
50
|
-
:host([max-files-reached]) [part='drop-label'] {
|
|
51
|
-
color: var(--lumo-disabled-text-color);
|
|
52
|
-
}
|
|
53
|
-
`,
|
|
54
|
-
{ moduleId: 'lumo-upload' },
|
|
55
|
-
);
|
|
56
|
-
|
|
57
|
-
registerStyles(
|
|
58
|
-
'vaadin-upload-icon',
|
|
59
|
-
css`
|
|
60
|
-
:host::before {
|
|
61
|
-
content: var(--lumo-icons-upload);
|
|
62
|
-
font-family: lumo-icons;
|
|
63
|
-
font-size: var(--lumo-icon-size-m);
|
|
64
|
-
line-height: 1;
|
|
65
|
-
vertical-align: -0.25em;
|
|
66
|
-
}
|
|
67
|
-
`,
|
|
68
|
-
{ moduleId: 'lumo-upload-icon' },
|
|
69
|
-
);
|
|
70
|
-
|
|
71
|
-
registerStyles(
|
|
72
|
-
'vaadin-upload-file-list',
|
|
73
|
-
css`
|
|
74
|
-
::slotted(li:not(:first-of-type)) {
|
|
75
|
-
border-top: 1px solid var(--lumo-contrast-10pct);
|
|
76
|
-
}
|
|
77
|
-
`,
|
|
78
|
-
{ moduleId: 'lumo-upload-file-list' },
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
const uploadFile = css`
|
|
82
|
-
:host {
|
|
83
|
-
padding: var(--lumo-space-s) 0;
|
|
84
|
-
outline: none;
|
|
85
|
-
--_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
|
|
86
|
-
--_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
:host([focus-ring]) [part='row'] {
|
|
90
|
-
border-radius: var(--lumo-border-radius-s);
|
|
91
|
-
box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
[part='row'] {
|
|
95
|
-
display: flex;
|
|
96
|
-
align-items: baseline;
|
|
97
|
-
justify-content: space-between;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
[part='status'],
|
|
101
|
-
[part='error'] {
|
|
102
|
-
color: var(--lumo-secondary-text-color);
|
|
103
|
-
font-size: var(--lumo-font-size-s);
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
[part='info'] {
|
|
107
|
-
display: flex;
|
|
108
|
-
align-items: baseline;
|
|
109
|
-
flex: auto;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
[part='meta'] {
|
|
113
|
-
width: 0.001px;
|
|
114
|
-
flex: 1 1 auto;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
[part='name'] {
|
|
118
|
-
white-space: nowrap;
|
|
119
|
-
overflow: hidden;
|
|
120
|
-
text-overflow: ellipsis;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
[part='commands'] {
|
|
124
|
-
display: flex;
|
|
125
|
-
align-items: baseline;
|
|
126
|
-
flex: none;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
[part$='icon'] {
|
|
130
|
-
margin-right: var(--lumo-space-xs);
|
|
131
|
-
font-size: var(--lumo-icon-size-m);
|
|
132
|
-
font-family: 'lumo-icons';
|
|
133
|
-
line-height: 1;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
/* When both icons are hidden, let us keep space for one */
|
|
137
|
-
[part='done-icon'][hidden] + [part='warning-icon'][hidden] {
|
|
138
|
-
display: block !important;
|
|
139
|
-
visibility: hidden;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
[part$='button'] {
|
|
143
|
-
flex: none;
|
|
144
|
-
margin-left: var(--lumo-space-xs);
|
|
145
|
-
cursor: var(--lumo-clickable-cursor);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
[part$='button']:focus {
|
|
149
|
-
outline: none;
|
|
150
|
-
border-radius: var(--lumo-border-radius-s);
|
|
151
|
-
box-shadow: 0 0 0 var(--_focus-ring-width) var(--_focus-ring-color);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
[part$='icon']::before,
|
|
155
|
-
[part$='button']::before {
|
|
156
|
-
vertical-align: -0.25em;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
[part='done-icon']::before {
|
|
160
|
-
content: var(--lumo-icons-checkmark);
|
|
161
|
-
color: var(--lumo-primary-text-color);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
[part='warning-icon']::before {
|
|
165
|
-
content: var(--lumo-icons-error);
|
|
166
|
-
color: var(--lumo-error-text-color);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
[part='start-button']::before {
|
|
170
|
-
content: var(--lumo-icons-play);
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
[part='retry-button']::before {
|
|
174
|
-
content: var(--lumo-icons-reload);
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
[part='remove-button']::before {
|
|
178
|
-
content: var(--lumo-icons-cross);
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
[part='error'] {
|
|
182
|
-
color: var(--lumo-error-text-color);
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
::slotted([slot='progress']) {
|
|
186
|
-
width: auto;
|
|
187
|
-
margin-left: calc(var(--lumo-icon-size-m) + var(--lumo-space-xs));
|
|
188
|
-
margin-right: calc(var(--lumo-icon-size-m) + var(--lumo-space-xs));
|
|
189
|
-
}
|
|
190
|
-
`;
|
|
191
|
-
|
|
192
|
-
registerStyles('vaadin-upload-file', [fieldButton, uploadFile], { moduleId: 'lumo-upload-file' });
|
|
File without changes
|