@vaadin/upload 24.8.0-alpha9 → 25.0.0-alpha2
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/README.md +0 -23
- package/package.json +12 -15
- package/src/vaadin-upload-file-list.js +22 -17
- package/src/vaadin-upload-file.d.ts +1 -2
- package/src/vaadin-upload-file.js +30 -28
- package/src/vaadin-upload-icon.js +15 -12
- package/src/vaadin-upload-mixin.js +14 -1
- package/src/vaadin-upload.d.ts +1 -2
- package/src/vaadin-upload.js +33 -30
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
- package/src/vaadin-lit-upload-file-list.js +0 -56
- package/src/vaadin-lit-upload-file.js +0 -87
- package/src/vaadin-lit-upload-icon.js +0 -41
- package/src/vaadin-lit-upload.d.ts +0 -6
- package/src/vaadin-lit-upload.js +0 -77
- package/theme/lumo/vaadin-lit-upload.d.ts +0 -2
- package/theme/lumo/vaadin-lit-upload.js +0 -2
- package/theme/material/vaadin-lit-upload.d.ts +0 -2
- package/theme/material/vaadin-lit-upload.js +0 -2
- package/theme/material/vaadin-upload-styles.d.ts +0 -5
- package/theme/material/vaadin-upload-styles.js +0 -253
- package/theme/material/vaadin-upload.d.ts +0 -2
- package/theme/material/vaadin-upload.js +0 -2
- package/vaadin-lit-upload.d.ts +0 -1
- package/vaadin-lit-upload.js +0 -2
package/README.md
CHANGED
|
@@ -28,29 +28,6 @@ Once installed, import the component in your application:
|
|
|
28
28
|
import '@vaadin/upload';
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
## Themes
|
|
32
|
-
|
|
33
|
-
Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
|
|
34
|
-
The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/upload/vaadin-upload.js) of the package uses the Lumo theme.
|
|
35
|
-
|
|
36
|
-
To use the Material theme, import the component from the `theme/material` folder:
|
|
37
|
-
|
|
38
|
-
```js
|
|
39
|
-
import '@vaadin/upload/theme/material/vaadin-upload.js';
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
You can also import the Lumo version of the component explicitly:
|
|
43
|
-
|
|
44
|
-
```js
|
|
45
|
-
import '@vaadin/upload/theme/lumo/vaadin-upload.js';
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
|
|
49
|
-
|
|
50
|
-
```js
|
|
51
|
-
import '@vaadin/upload/src/vaadin-upload.js';
|
|
52
|
-
```
|
|
53
|
-
|
|
54
31
|
## Contributing
|
|
55
32
|
|
|
56
33
|
Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/upload",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0-alpha2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -31,30 +31,27 @@
|
|
|
31
31
|
"Vaadin",
|
|
32
32
|
"upload",
|
|
33
33
|
"web-components",
|
|
34
|
-
"web-component"
|
|
35
|
-
"polymer"
|
|
34
|
+
"web-component"
|
|
36
35
|
],
|
|
37
36
|
"dependencies": {
|
|
38
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
39
|
-
"@
|
|
40
|
-
"@vaadin/
|
|
41
|
-
"@vaadin/
|
|
42
|
-
"@vaadin/
|
|
43
|
-
"@vaadin/
|
|
44
|
-
"@vaadin/vaadin-
|
|
45
|
-
"@vaadin/vaadin-material-styles": "24.8.0-alpha9",
|
|
46
|
-
"@vaadin/vaadin-themable-mixin": "24.8.0-alpha9",
|
|
38
|
+
"@vaadin/a11y-base": "25.0.0-alpha2",
|
|
39
|
+
"@vaadin/button": "25.0.0-alpha2",
|
|
40
|
+
"@vaadin/component-base": "25.0.0-alpha2",
|
|
41
|
+
"@vaadin/progress-bar": "25.0.0-alpha2",
|
|
42
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
|
|
43
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
|
|
47
44
|
"lit": "^3.0.0"
|
|
48
45
|
},
|
|
49
46
|
"devDependencies": {
|
|
50
|
-
"@vaadin/chai-plugins": "
|
|
51
|
-
"@vaadin/test-runner-commands": "
|
|
52
|
-
"@vaadin/testing-helpers": "^
|
|
47
|
+
"@vaadin/chai-plugins": "25.0.0-alpha2",
|
|
48
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha2",
|
|
49
|
+
"@vaadin/testing-helpers": "^2.0.0",
|
|
53
50
|
"sinon": "^18.0.0"
|
|
54
51
|
},
|
|
55
52
|
"web-types": [
|
|
56
53
|
"web-types.json",
|
|
57
54
|
"web-types.lit.json"
|
|
58
55
|
],
|
|
59
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
|
|
60
57
|
}
|
|
@@ -4,8 +4,9 @@
|
|
|
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 { html,
|
|
7
|
+
import { css, html, LitElement } from 'lit';
|
|
8
8
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
9
10
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
10
11
|
import { UploadFileListMixin } from './vaadin-upload-file-list-mixin.js';
|
|
11
12
|
|
|
@@ -18,28 +19,32 @@ import { UploadFileListMixin } from './vaadin-upload-file-list-mixin.js';
|
|
|
18
19
|
* @mixes UploadFileListMixin
|
|
19
20
|
* @private
|
|
20
21
|
*/
|
|
21
|
-
class UploadFileList extends UploadFileListMixin(ThemableMixin(
|
|
22
|
+
class UploadFileList extends UploadFileListMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
22
23
|
static get is() {
|
|
23
24
|
return 'vaadin-upload-file-list';
|
|
24
25
|
}
|
|
25
26
|
|
|
26
|
-
static get
|
|
27
|
-
return
|
|
28
|
-
|
|
29
|
-
:
|
|
30
|
-
|
|
31
|
-
}
|
|
27
|
+
static get styles() {
|
|
28
|
+
return css`
|
|
29
|
+
:host {
|
|
30
|
+
display: block;
|
|
31
|
+
}
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
:host([hidden]) {
|
|
34
|
+
display: none !important;
|
|
35
|
+
}
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
[part='list'] {
|
|
38
|
+
padding: 0;
|
|
39
|
+
margin: 0;
|
|
40
|
+
list-style-type: none;
|
|
41
|
+
}
|
|
42
|
+
`;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** @protected */
|
|
46
|
+
render() {
|
|
47
|
+
return html`
|
|
43
48
|
<ul part="list">
|
|
44
49
|
<slot></slot>
|
|
45
50
|
</ul>
|
|
@@ -3,7 +3,6 @@
|
|
|
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 { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
7
6
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
8
7
|
import { UploadFileMixin } from './vaadin-upload-file-mixin.js';
|
|
9
8
|
|
|
@@ -70,7 +69,7 @@ export interface UploadFileEventMap extends HTMLElementEventMap, UploadFileCusto
|
|
|
70
69
|
*
|
|
71
70
|
* See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
|
|
72
71
|
*/
|
|
73
|
-
declare class UploadFile extends UploadFileMixin(ThemableMixin(
|
|
72
|
+
declare class UploadFile extends UploadFileMixin(ThemableMixin(HTMLElement)) {
|
|
74
73
|
addEventListener<K extends keyof UploadFileEventMap>(
|
|
75
74
|
type: K,
|
|
76
75
|
listener: (this: UploadFile, ev: UploadFileEventMap[K]) => void,
|
|
@@ -5,15 +5,13 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import '@vaadin/progress-bar/src/vaadin-progress-bar.js';
|
|
7
7
|
import './vaadin-upload-icons.js';
|
|
8
|
-
import { html,
|
|
9
|
-
import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
8
|
+
import { html, LitElement, nothing } from 'lit';
|
|
10
9
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
11
|
-
import {
|
|
10
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
+
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
12
|
import { UploadFileMixin } from './vaadin-upload-file-mixin.js';
|
|
13
13
|
import { uploadFileStyles } from './vaadin-upload-file-styles.js';
|
|
14
14
|
|
|
15
|
-
registerStyles('vaadin-upload-file', uploadFileStyles, { moduleId: 'vaadin-upload-file-styles' });
|
|
16
|
-
|
|
17
15
|
/**
|
|
18
16
|
* `<vaadin-upload-file>` element represents a file in the file list of `<vaadin-upload>`.
|
|
19
17
|
*
|
|
@@ -52,22 +50,30 @@ registerStyles('vaadin-upload-file', uploadFileStyles, { moduleId: 'vaadin-uploa
|
|
|
52
50
|
*
|
|
53
51
|
* @customElement
|
|
54
52
|
* @extends HTMLElement
|
|
55
|
-
* @mixes ControllerMixin
|
|
56
53
|
* @mixes UploadFileMixin
|
|
57
54
|
* @mixes ThemableMixin
|
|
58
55
|
*/
|
|
59
|
-
class UploadFile extends UploadFileMixin(ThemableMixin(
|
|
60
|
-
static get
|
|
56
|
+
class UploadFile extends UploadFileMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
57
|
+
static get is() {
|
|
58
|
+
return 'vaadin-upload-file';
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
static get styles() {
|
|
62
|
+
return uploadFileStyles;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** @protected */
|
|
66
|
+
render() {
|
|
61
67
|
return html`
|
|
62
68
|
<div part="row">
|
|
63
69
|
<div part="info">
|
|
64
|
-
<div part="done-icon" hidden
|
|
65
|
-
<div part="warning-icon" hidden
|
|
70
|
+
<div part="done-icon" ?hidden="${!this.complete}" aria-hidden="true"></div>
|
|
71
|
+
<div part="warning-icon" ?hidden="${!this.errorMessage}" aria-hidden="true"></div>
|
|
66
72
|
|
|
67
73
|
<div part="meta">
|
|
68
|
-
<div part="name" id="name"
|
|
69
|
-
<div part="status" hidden
|
|
70
|
-
<div part="error" id="error" hidden
|
|
74
|
+
<div part="name" id="name">${this.fileName}</div>
|
|
75
|
+
<div part="status" ?hidden="${!this.status}" id="status">${this.status}</div>
|
|
76
|
+
<div part="error" id="error" ?hidden="${!this.errorMessage}">${this.errorMessage}</div>
|
|
71
77
|
</div>
|
|
72
78
|
</div>
|
|
73
79
|
<div part="commands">
|
|
@@ -75,29 +81,29 @@ class UploadFile extends UploadFileMixin(ThemableMixin(ControllerMixin(PolymerEl
|
|
|
75
81
|
type="button"
|
|
76
82
|
part="start-button"
|
|
77
83
|
file-event="file-start"
|
|
78
|
-
|
|
79
|
-
hidden
|
|
80
|
-
disabled
|
|
81
|
-
aria-label
|
|
84
|
+
@click="${this._fireFileEvent}"
|
|
85
|
+
?hidden="${!this.held}"
|
|
86
|
+
?disabled="${this.disabled}"
|
|
87
|
+
aria-label="${this.i18n ? this.i18n.file.start : nothing}"
|
|
82
88
|
aria-describedby="name"
|
|
83
89
|
></button>
|
|
84
90
|
<button
|
|
85
91
|
type="button"
|
|
86
92
|
part="retry-button"
|
|
87
93
|
file-event="file-retry"
|
|
88
|
-
|
|
89
|
-
hidden
|
|
90
|
-
disabled
|
|
91
|
-
aria-label
|
|
94
|
+
@click="${this._fireFileEvent}"
|
|
95
|
+
?hidden="${!this.errorMessage}"
|
|
96
|
+
?disabled="${this.disabled}"
|
|
97
|
+
aria-label="${this.i18n ? this.i18n.file.retry : nothing}"
|
|
92
98
|
aria-describedby="name"
|
|
93
99
|
></button>
|
|
94
100
|
<button
|
|
95
101
|
type="button"
|
|
96
102
|
part="remove-button"
|
|
97
103
|
file-event="file-abort"
|
|
98
|
-
|
|
99
|
-
disabled
|
|
100
|
-
aria-label
|
|
104
|
+
@click="${this._fireFileEvent}"
|
|
105
|
+
?disabled="${this.disabled}"
|
|
106
|
+
aria-label="${this.i18n ? this.i18n.file.remove : nothing}"
|
|
101
107
|
aria-describedby="name"
|
|
102
108
|
></button>
|
|
103
109
|
</div>
|
|
@@ -107,10 +113,6 @@ class UploadFile extends UploadFileMixin(ThemableMixin(ControllerMixin(PolymerEl
|
|
|
107
113
|
`;
|
|
108
114
|
}
|
|
109
115
|
|
|
110
|
-
static get is() {
|
|
111
|
-
return 'vaadin-upload-file';
|
|
112
|
-
}
|
|
113
|
-
|
|
114
116
|
/**
|
|
115
117
|
* Fired when the retry button is pressed. It is listened by `vaadin-upload`
|
|
116
118
|
* which will start a new upload process of this file.
|
|
@@ -3,7 +3,7 @@
|
|
|
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 { html,
|
|
6
|
+
import { css, html, LitElement } from 'lit';
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
9
|
|
|
@@ -14,24 +14,27 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
14
14
|
* @extends HTMLElement
|
|
15
15
|
* @private
|
|
16
16
|
*/
|
|
17
|
-
class UploadIcon extends ThemableMixin(
|
|
17
|
+
class UploadIcon extends ThemableMixin(LitElement) {
|
|
18
18
|
static get is() {
|
|
19
19
|
return 'vaadin-upload-icon';
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
static get
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
:
|
|
26
|
-
|
|
27
|
-
}
|
|
22
|
+
static get styles() {
|
|
23
|
+
return css`
|
|
24
|
+
:host {
|
|
25
|
+
display: inline-block;
|
|
26
|
+
}
|
|
28
27
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</style>
|
|
28
|
+
:host([hidden]) {
|
|
29
|
+
display: none !important;
|
|
30
|
+
}
|
|
33
31
|
`;
|
|
34
32
|
}
|
|
33
|
+
|
|
34
|
+
/** @protected */
|
|
35
|
+
render() {
|
|
36
|
+
return html``;
|
|
37
|
+
}
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
defineCustomElement(UploadIcon);
|
|
@@ -608,6 +608,19 @@ export const UploadMixin = (superClass) =>
|
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
610
|
|
|
611
|
+
// In some cases (like dragging attachments from Outlook on Windows), "webkitGetAsEntry"
|
|
612
|
+
// can return null for "dataTransfer" items. Also, there is no reason to check for
|
|
613
|
+
// "webkitGetAsEntry" when there are no folders. Therefore, "dataTransfer.files" is used
|
|
614
|
+
// to handle such cases.
|
|
615
|
+
const containsFolders = Array.from(dropEvent.dataTransfer.items)
|
|
616
|
+
.filter((item) => !!item)
|
|
617
|
+
.filter((item) => typeof item.webkitGetAsEntry === 'function')
|
|
618
|
+
.map((item) => item.webkitGetAsEntry())
|
|
619
|
+
.some((entry) => !!entry && entry.isDirectory);
|
|
620
|
+
if (!containsFolders) {
|
|
621
|
+
return Promise.resolve(dropEvent.dataTransfer.files ? Array.from(dropEvent.dataTransfer.files) : []);
|
|
622
|
+
}
|
|
623
|
+
|
|
611
624
|
const filePromises = Array.from(dropEvent.dataTransfer.items)
|
|
612
625
|
.map((item) => item.webkitGetAsEntry())
|
|
613
626
|
.filter((entry) => !!entry)
|
|
@@ -826,7 +839,7 @@ export const UploadMixin = (superClass) =>
|
|
|
826
839
|
|
|
827
840
|
/** @private */
|
|
828
841
|
_renderFileList() {
|
|
829
|
-
if (this._fileList) {
|
|
842
|
+
if (this._fileList && typeof this._fileList.requestContentUpdate === 'function') {
|
|
830
843
|
this._fileList.requestContentUpdate();
|
|
831
844
|
}
|
|
832
845
|
}
|
package/src/vaadin-upload.d.ts
CHANGED
|
@@ -3,7 +3,6 @@
|
|
|
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 { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
|
|
7
6
|
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
8
7
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
8
|
import { type UploadFile, UploadMixin } from './vaadin-upload-mixin.js';
|
|
@@ -157,7 +156,7 @@ export interface UploadEventMap extends HTMLElementEventMap, UploadCustomEventMa
|
|
|
157
156
|
* @fires {CustomEvent} upload-retry - Fired when retry upload is requested.
|
|
158
157
|
* @fires {CustomEvent} upload-abort - Fired when upload abort is requested.
|
|
159
158
|
*/
|
|
160
|
-
declare class Upload extends UploadMixin(ThemableMixin(ElementMixin(
|
|
159
|
+
declare class Upload extends UploadMixin(ThemableMixin(ElementMixin(HTMLElement))) {
|
|
161
160
|
addEventListener<K extends keyof UploadEventMap>(
|
|
162
161
|
type: K,
|
|
163
162
|
listener: (this: Upload, ev: UploadEventMap[K]) => void,
|
package/src/vaadin-upload.js
CHANGED
|
@@ -7,10 +7,11 @@ 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 { html,
|
|
11
|
-
import {
|
|
10
|
+
import { css, html, LitElement } from 'lit';
|
|
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
|
+
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
14
15
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
15
16
|
import { UploadMixin } from './vaadin-upload-mixin.js';
|
|
16
17
|
|
|
@@ -59,33 +60,39 @@ import { UploadMixin } from './vaadin-upload-mixin.js';
|
|
|
59
60
|
*
|
|
60
61
|
* @customElement
|
|
61
62
|
* @extends HTMLElement
|
|
62
|
-
* @mixes ControllerMixin
|
|
63
63
|
* @mixes ThemableMixin
|
|
64
64
|
* @mixes ElementMixin
|
|
65
65
|
* @mixes UploadMixin
|
|
66
66
|
*/
|
|
67
|
-
class Upload extends UploadMixin(ElementMixin(ThemableMixin(
|
|
68
|
-
static get
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
:
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
67
|
+
class Upload extends UploadMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
68
|
+
static get is() {
|
|
69
|
+
return 'vaadin-upload';
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static get styles() {
|
|
73
|
+
return css`
|
|
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
|
+
`;
|
|
88
|
+
}
|
|
85
89
|
|
|
90
|
+
/** @protected */
|
|
91
|
+
render() {
|
|
92
|
+
return html`
|
|
86
93
|
<div part="primary-buttons">
|
|
87
94
|
<slot name="add-button"></slot>
|
|
88
|
-
<div part="drop-label" hidden
|
|
95
|
+
<div part="drop-label" ?hidden="${this.nodrop}" id="dropLabelContainer" aria-hidden="true">
|
|
89
96
|
<slot name="drop-label-icon"></slot>
|
|
90
97
|
<slot name="drop-label"></slot>
|
|
91
98
|
</div>
|
|
@@ -96,18 +103,14 @@ class Upload extends UploadMixin(ElementMixin(ThemableMixin(ControllerMixin(Poly
|
|
|
96
103
|
type="file"
|
|
97
104
|
id="fileInput"
|
|
98
105
|
hidden
|
|
99
|
-
|
|
100
|
-
accept
|
|
101
|
-
multiple
|
|
102
|
-
capture
|
|
106
|
+
@change="${this._onFileInputChange}"
|
|
107
|
+
accept="${this.accept}"
|
|
108
|
+
?multiple="${this._isMultiple(this.maxFiles)}"
|
|
109
|
+
capture="${ifDefined(this.capture)}"
|
|
103
110
|
/>
|
|
104
111
|
`;
|
|
105
112
|
}
|
|
106
113
|
|
|
107
|
-
static get is() {
|
|
108
|
-
return 'vaadin-upload';
|
|
109
|
-
}
|
|
110
|
-
|
|
111
114
|
/**
|
|
112
115
|
* Fired when a file cannot be added to the queue due to a constrain:
|
|
113
116
|
* file-size, file-type or maxFiles
|
package/web-types.json
CHANGED
package/web-types.lit.json
CHANGED
|
@@ -1,56 +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 './vaadin-lit-upload-file.js';
|
|
7
|
-
import { css, html, LitElement } from 'lit';
|
|
8
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
9
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
11
|
-
import { UploadFileListMixin } from './vaadin-upload-file-list-mixin.js';
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* An element used internally by `<vaadin-upload>`. Not intended to be used separately.
|
|
15
|
-
*
|
|
16
|
-
* @extends HTMLElement
|
|
17
|
-
* @mixes ThemableMixin
|
|
18
|
-
* @mixes UploadFileListMixin
|
|
19
|
-
* @private
|
|
20
|
-
*/
|
|
21
|
-
class UploadFileList extends UploadFileListMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
22
|
-
static get is() {
|
|
23
|
-
return 'vaadin-upload-file-list';
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
static get styles() {
|
|
27
|
-
return css`
|
|
28
|
-
:host {
|
|
29
|
-
display: block;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
:host([hidden]) {
|
|
33
|
-
display: none !important;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
[part='list'] {
|
|
37
|
-
padding: 0;
|
|
38
|
-
margin: 0;
|
|
39
|
-
list-style-type: none;
|
|
40
|
-
}
|
|
41
|
-
`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/** @protected */
|
|
45
|
-
render() {
|
|
46
|
-
return html`
|
|
47
|
-
<ul part="list">
|
|
48
|
-
<slot></slot>
|
|
49
|
-
</ul>
|
|
50
|
-
`;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
defineCustomElement(UploadFileList);
|
|
55
|
-
|
|
56
|
-
export { UploadFileList };
|
|
@@ -1,87 +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 '@vaadin/progress-bar/src/vaadin-lit-progress-bar.js';
|
|
7
|
-
import './vaadin-upload-icons.js';
|
|
8
|
-
import { html, LitElement, nothing } from 'lit';
|
|
9
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
10
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
12
|
-
import { UploadFileMixin } from './vaadin-upload-file-mixin.js';
|
|
13
|
-
import { uploadFileStyles } from './vaadin-upload-file-styles.js';
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* LitElement based version of `<vaadin-upload-file>` web component.
|
|
17
|
-
*
|
|
18
|
-
* ## Disclaimer
|
|
19
|
-
*
|
|
20
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
21
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
22
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
23
|
-
*/
|
|
24
|
-
class UploadFile extends UploadFileMixin(ThemableMixin(PolylitMixin(LitElement))) {
|
|
25
|
-
static get is() {
|
|
26
|
-
return 'vaadin-upload-file';
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
static get styles() {
|
|
30
|
-
return uploadFileStyles;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** @protected */
|
|
34
|
-
render() {
|
|
35
|
-
return html`
|
|
36
|
-
<div part="row">
|
|
37
|
-
<div part="info">
|
|
38
|
-
<div part="done-icon" ?hidden="${!this.complete}" aria-hidden="true"></div>
|
|
39
|
-
<div part="warning-icon" ?hidden="${!this.errorMessage}" aria-hidden="true"></div>
|
|
40
|
-
|
|
41
|
-
<div part="meta">
|
|
42
|
-
<div part="name" id="name">${this.fileName}</div>
|
|
43
|
-
<div part="status" ?hidden="${!this.status}" id="status">${this.status}</div>
|
|
44
|
-
<div part="error" id="error" ?hidden="${!this.errorMessage}">${this.errorMessage}</div>
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
<div part="commands">
|
|
48
|
-
<button
|
|
49
|
-
type="button"
|
|
50
|
-
part="start-button"
|
|
51
|
-
file-event="file-start"
|
|
52
|
-
@click="${this._fireFileEvent}"
|
|
53
|
-
?hidden="${!this.held}"
|
|
54
|
-
?disabled="${this.disabled}"
|
|
55
|
-
aria-label="${this.i18n ? this.i18n.file.start : nothing}"
|
|
56
|
-
aria-describedby="name"
|
|
57
|
-
></button>
|
|
58
|
-
<button
|
|
59
|
-
type="button"
|
|
60
|
-
part="retry-button"
|
|
61
|
-
file-event="file-retry"
|
|
62
|
-
@click="${this._fireFileEvent}"
|
|
63
|
-
?hidden="${!this.errorMessage}"
|
|
64
|
-
?disabled="${this.disabled}"
|
|
65
|
-
aria-label="${this.i18n ? this.i18n.file.retry : nothing}"
|
|
66
|
-
aria-describedby="name"
|
|
67
|
-
></button>
|
|
68
|
-
<button
|
|
69
|
-
type="button"
|
|
70
|
-
part="remove-button"
|
|
71
|
-
file-event="file-abort"
|
|
72
|
-
@click="${this._fireFileEvent}"
|
|
73
|
-
?disabled="${this.disabled}"
|
|
74
|
-
aria-label="${this.i18n ? this.i18n.file.remove : nothing}"
|
|
75
|
-
aria-describedby="name"
|
|
76
|
-
></button>
|
|
77
|
-
</div>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<slot name="progress"></slot>
|
|
81
|
-
`;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
defineCustomElement(UploadFile);
|
|
86
|
-
|
|
87
|
-
export { UploadFile };
|
|
@@ -1,41 +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, html, LitElement } from 'lit';
|
|
7
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* An element used internally by `<vaadin-upload>`. Not intended to be used separately.
|
|
12
|
-
*
|
|
13
|
-
* @extends HTMLElement
|
|
14
|
-
* @private
|
|
15
|
-
*/
|
|
16
|
-
class UploadIcon extends ThemableMixin(LitElement) {
|
|
17
|
-
static get is() {
|
|
18
|
-
return 'vaadin-upload-icon';
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
static get styles() {
|
|
22
|
-
return css`
|
|
23
|
-
:host {
|
|
24
|
-
display: inline-block;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
:host([hidden]) {
|
|
28
|
-
display: none !important;
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/** @protected */
|
|
34
|
-
render() {
|
|
35
|
-
return html``;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
defineCustomElement(UploadIcon);
|
|
40
|
-
|
|
41
|
-
export { UploadIcon };
|
package/src/vaadin-lit-upload.js
DELETED
|
@@ -1,77 +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 '@vaadin/button/src/vaadin-lit-button.js';
|
|
7
|
-
import './vaadin-lit-upload-icon.js';
|
|
8
|
-
import './vaadin-upload-icons.js';
|
|
9
|
-
import './vaadin-lit-upload-file-list.js';
|
|
10
|
-
import { css, html, LitElement } from 'lit';
|
|
11
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
12
|
-
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
13
|
-
import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
14
|
-
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
15
|
-
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
16
|
-
import { UploadMixin } from './vaadin-upload-mixin.js';
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* LitElement based version of `<vaadin-upload>` web component.
|
|
20
|
-
*
|
|
21
|
-
* ## Disclaimer
|
|
22
|
-
*
|
|
23
|
-
* This component is an experiment and not yet a part of Vaadin platform.
|
|
24
|
-
* There is no ETA regarding specific Vaadin version where it'll land.
|
|
25
|
-
* Feel free to try this code in your apps as per Apache 2.0 license.
|
|
26
|
-
*/
|
|
27
|
-
class Upload extends UploadMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
|
|
28
|
-
static get is() {
|
|
29
|
-
return 'vaadin-upload';
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
static get styles() {
|
|
33
|
-
return css`
|
|
34
|
-
:host {
|
|
35
|
-
display: block;
|
|
36
|
-
position: relative;
|
|
37
|
-
box-sizing: border-box;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
:host([hidden]) {
|
|
41
|
-
display: none !important;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
[hidden] {
|
|
45
|
-
display: none !important;
|
|
46
|
-
}
|
|
47
|
-
`;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/** @protected */
|
|
51
|
-
render() {
|
|
52
|
-
return html`
|
|
53
|
-
<div part="primary-buttons">
|
|
54
|
-
<slot name="add-button"></slot>
|
|
55
|
-
<div part="drop-label" ?hidden="${this.nodrop}" id="dropLabelContainer" aria-hidden="true">
|
|
56
|
-
<slot name="drop-label-icon"></slot>
|
|
57
|
-
<slot name="drop-label"></slot>
|
|
58
|
-
</div>
|
|
59
|
-
</div>
|
|
60
|
-
<slot name="file-list"></slot>
|
|
61
|
-
<slot></slot>
|
|
62
|
-
<input
|
|
63
|
-
type="file"
|
|
64
|
-
id="fileInput"
|
|
65
|
-
hidden
|
|
66
|
-
@change="${this._onFileInputChange}"
|
|
67
|
-
accept="${this.accept}"
|
|
68
|
-
?multiple="${this._isMultiple(this.maxFiles)}"
|
|
69
|
-
capture="${ifDefined(this.capture)}"
|
|
70
|
-
/>
|
|
71
|
-
`;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
defineCustomElement(Upload);
|
|
76
|
-
|
|
77
|
-
export { Upload };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-material-styles/font-icons.js';
|
|
3
|
-
import '@vaadin/vaadin-material-styles/typography.js';
|
|
4
|
-
import '@vaadin/button/theme/material/vaadin-button-styles.js';
|
|
5
|
-
import '@vaadin/progress-bar/theme/material/vaadin-progress-bar-styles.js';
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import '@vaadin/vaadin-material-styles/color.js';
|
|
2
|
-
import '@vaadin/vaadin-material-styles/font-icons.js';
|
|
3
|
-
import '@vaadin/vaadin-material-styles/typography.js';
|
|
4
|
-
import '@vaadin/button/theme/material/vaadin-button-styles.js';
|
|
5
|
-
import '@vaadin/progress-bar/theme/material/vaadin-progress-bar-styles.js';
|
|
6
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
7
|
-
|
|
8
|
-
registerStyles(
|
|
9
|
-
'vaadin-upload',
|
|
10
|
-
css`
|
|
11
|
-
:host(:not([nodrop])) {
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
border: 1px dashed var(--material-divider-color);
|
|
14
|
-
border-radius: 4px;
|
|
15
|
-
padding: 8px 16px;
|
|
16
|
-
transition: border-color 0.6s;
|
|
17
|
-
position: relative;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
[part='primary-buttons'] {
|
|
21
|
-
display: inline-flex;
|
|
22
|
-
flex-wrap: wrap;
|
|
23
|
-
align-items: baseline;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
::slotted([slot='add-button']) {
|
|
27
|
-
margin: 0 -8px;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
[part='drop-label'] {
|
|
31
|
-
text-align: center;
|
|
32
|
-
white-space: normal;
|
|
33
|
-
padding: 0 24px;
|
|
34
|
-
color: var(--material-secondary-text-color);
|
|
35
|
-
font-family: var(--material-font-family);
|
|
36
|
-
font-size: var(--material-small-font-size);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
:host([dragover-valid]) {
|
|
40
|
-
border-color: var(--material-primary-color);
|
|
41
|
-
transition: border-color 0.1s;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
:host([dragover-valid]) [part='drop-label'] {
|
|
45
|
-
color: var(--material-primary-text-color);
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
:host([disabled]) [part='drop-label'],
|
|
49
|
-
:host([max-files-reached]) [part='drop-label'] {
|
|
50
|
-
color: var(--material-disabled-text-color);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/* Ripple */
|
|
54
|
-
|
|
55
|
-
:host::before {
|
|
56
|
-
content: '';
|
|
57
|
-
position: absolute;
|
|
58
|
-
width: 100px;
|
|
59
|
-
height: 100px;
|
|
60
|
-
border-radius: 50%;
|
|
61
|
-
top: 50%;
|
|
62
|
-
left: 50%;
|
|
63
|
-
pointer-events: none;
|
|
64
|
-
background-color: var(--material-primary-color);
|
|
65
|
-
opacity: 0;
|
|
66
|
-
transform: translate(-50%, -50%) scale(0);
|
|
67
|
-
transition:
|
|
68
|
-
transform 0s cubic-bezier(0.075, 0.82, 0.165, 1),
|
|
69
|
-
opacity 0.4s linear;
|
|
70
|
-
transition-delay: 0.4s, 0s;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
:host([dragover-valid])::before {
|
|
74
|
-
transform: translate(-50%, -50%) scale(10);
|
|
75
|
-
opacity: 0.1;
|
|
76
|
-
transition-duration: 2s, 0.1s;
|
|
77
|
-
transition-delay: 0s, 0s;
|
|
78
|
-
}
|
|
79
|
-
`,
|
|
80
|
-
{ moduleId: 'material-upload' },
|
|
81
|
-
);
|
|
82
|
-
|
|
83
|
-
registerStyles(
|
|
84
|
-
'vaadin-upload-icon',
|
|
85
|
-
css`
|
|
86
|
-
:host {
|
|
87
|
-
margin-right: 8px;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
:host::before {
|
|
91
|
-
content: var(--material-icons-upload);
|
|
92
|
-
font-family: material-icons;
|
|
93
|
-
font-size: var(--material-icon-font-size);
|
|
94
|
-
line-height: 1;
|
|
95
|
-
}
|
|
96
|
-
`,
|
|
97
|
-
{ moduleId: 'material-upload-icon' },
|
|
98
|
-
);
|
|
99
|
-
|
|
100
|
-
registerStyles(
|
|
101
|
-
'vaadin-upload-file',
|
|
102
|
-
css`
|
|
103
|
-
:host {
|
|
104
|
-
outline: none;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
[part='row'] {
|
|
108
|
-
display: flex;
|
|
109
|
-
align-items: flex-start;
|
|
110
|
-
justify-content: space-between;
|
|
111
|
-
padding: 8px;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
:host([focus-ring]) [part='row'] {
|
|
115
|
-
background-color: var(--material-divider-color);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
[part='status'],
|
|
119
|
-
[part='error'] {
|
|
120
|
-
color: var(--material-secondary-text-color);
|
|
121
|
-
font-size: var(--material-caption-font-size);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
[part='info'] {
|
|
125
|
-
display: flex;
|
|
126
|
-
align-items: baseline;
|
|
127
|
-
flex: auto;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
[part='meta'] {
|
|
131
|
-
width: 0.001px;
|
|
132
|
-
flex: 1 1 auto;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
[part='name'] {
|
|
136
|
-
white-space: nowrap;
|
|
137
|
-
overflow: hidden;
|
|
138
|
-
text-overflow: ellipsis;
|
|
139
|
-
font-size: var(--material-small-font-size);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
[part='commands'] {
|
|
143
|
-
display: flex;
|
|
144
|
-
flex: none;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
[part$='icon'] {
|
|
148
|
-
padding: 8px;
|
|
149
|
-
margin: -8px 0 -8px -8px;
|
|
150
|
-
font-family: material-icons;
|
|
151
|
-
font-size: var(--material-icon-font-size);
|
|
152
|
-
line-height: 1;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
/* When both icons are hidden, let us keep space for one */
|
|
156
|
-
[part='done-icon'][hidden] + [part='warning-icon'][hidden] {
|
|
157
|
-
display: block !important;
|
|
158
|
-
visibility: hidden;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
[part$='button'] {
|
|
162
|
-
position: relative;
|
|
163
|
-
width: 40px;
|
|
164
|
-
height: 40px;
|
|
165
|
-
flex: none;
|
|
166
|
-
font-family: material-icons;
|
|
167
|
-
font-size: var(--material-icon-font-size);
|
|
168
|
-
color: var(--material-secondary-text-color);
|
|
169
|
-
line-height: 1;
|
|
170
|
-
padding: 8px;
|
|
171
|
-
margin: -8px 0;
|
|
172
|
-
outline: none;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
[part='remove-button'] {
|
|
176
|
-
margin-right: -8px;
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
[part$='button']:hover {
|
|
180
|
-
color: inherit;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
[part$='button'][disabled] {
|
|
184
|
-
color: var(--material-disabled-text-color);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
[part='done-icon']::before {
|
|
188
|
-
content: var(--material-icons-check);
|
|
189
|
-
color: var(--material-primary-text-color);
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
[part='warning-icon']::before {
|
|
193
|
-
content: var(--material-icons-error);
|
|
194
|
-
color: var(--material-error-text-color);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
[part='start-button']::before {
|
|
198
|
-
content: var(--material-icons-play);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
[part='retry-button']::before {
|
|
202
|
-
content: var(--material-icons-reload);
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
[part='remove-button']::before {
|
|
206
|
-
content: var(--material-icons-clear);
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
[part$='button']:not([disabled])::after {
|
|
210
|
-
position: absolute;
|
|
211
|
-
content: '';
|
|
212
|
-
top: 0;
|
|
213
|
-
left: 0;
|
|
214
|
-
width: 40px;
|
|
215
|
-
height: 40px;
|
|
216
|
-
border-radius: 50%;
|
|
217
|
-
background-color: var(--material-body-text-color);
|
|
218
|
-
transform: scale(0);
|
|
219
|
-
opacity: 0;
|
|
220
|
-
transition:
|
|
221
|
-
transform 0.08s,
|
|
222
|
-
opacity 0.01s;
|
|
223
|
-
will-change: transform, opacity;
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
[part$='button']:hover::after {
|
|
227
|
-
opacity: 0.08;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
[part$='button']:focus::after {
|
|
231
|
-
opacity: 0.12;
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
[part$='button']:active::after {
|
|
235
|
-
opacity: 0.16;
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
[part$='button']:focus::after,
|
|
239
|
-
[part$='button']:active::after {
|
|
240
|
-
transform: scale(1.2);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
[part='error'] {
|
|
244
|
-
color: var(--material-error-text-color);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
::slotted([slot='progress']) {
|
|
248
|
-
width: auto;
|
|
249
|
-
margin-left: 28px;
|
|
250
|
-
}
|
|
251
|
-
`,
|
|
252
|
-
{ moduleId: 'material-upload-file' },
|
|
253
|
-
);
|
package/vaadin-lit-upload.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './src/vaadin-upload.js';
|
package/vaadin-lit-upload.js
DELETED