@vaadin/upload 24.8.4 → 25.0.0-alpha10
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 +14 -15
- 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-core-styles.d.ts +8 -0
- package/src/styles/vaadin-upload-core-styles.js +22 -0
- package/src/styles/vaadin-upload-file-base-styles.js +137 -0
- package/src/styles/vaadin-upload-file-core-styles.d.ts +8 -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-file-list-core-styles.d.ts +8 -0
- package/src/styles/vaadin-upload-file-list-core-styles.js +22 -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/styles/vaadin-upload-icon-core-styles.d.ts +8 -0
- package/src/styles/vaadin-upload-icon-core-styles.js +16 -0
- package/src/vaadin-upload-file-list.js +11 -18
- package/src/vaadin-upload-file.d.ts +1 -2
- package/src/vaadin-upload-file.js +32 -29
- package/src/vaadin-upload-icon.js +16 -13
- package/src/vaadin-upload.d.ts +2 -3
- package/src/vaadin-upload.js +21 -30
- package/web-types.json +2 -2
- package/web-types.lit.json +2 -2
- 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.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/src/{vaadin-upload-file-styles.d.ts → styles/vaadin-upload-file-base-styles.d.ts} +0 -0
- /package/src/{vaadin-upload-file-styles.js → styles/vaadin-upload-file-core-styles.js} +0 -0
|
@@ -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 { html,
|
|
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-core-styles.js';
|
|
9
11
|
|
|
10
12
|
/**
|
|
11
13
|
* An element used internally by `<vaadin-upload>`. Not intended to be used separately.
|
|
@@ -14,23 +16,24 @@ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mix
|
|
|
14
16
|
* @extends HTMLElement
|
|
15
17
|
* @private
|
|
16
18
|
*/
|
|
17
|
-
class UploadIcon extends ThemableMixin(
|
|
19
|
+
class UploadIcon extends ThemableMixin(LumoInjectionMixin(LitElement)) {
|
|
18
20
|
static get is() {
|
|
19
21
|
return 'vaadin-upload-icon';
|
|
20
22
|
}
|
|
21
23
|
|
|
22
|
-
static get
|
|
23
|
-
return
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
static get styles() {
|
|
25
|
+
return uploadIconStyles;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
static get lumoInjector() {
|
|
29
|
+
return {
|
|
30
|
+
includeBaseStyles: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
28
33
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</style>
|
|
33
|
-
`;
|
|
34
|
+
/** @protected */
|
|
35
|
+
render() {
|
|
36
|
+
return html``;
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
|
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';
|
|
@@ -119,7 +118,7 @@ export interface UploadEventMap extends HTMLElementEventMap, UploadCustomEventMa
|
|
|
119
118
|
*
|
|
120
119
|
* Example:
|
|
121
120
|
*
|
|
122
|
-
* ```
|
|
121
|
+
* ```html
|
|
123
122
|
* <vaadin-upload></vaadin-upload>
|
|
124
123
|
* ```
|
|
125
124
|
*
|
|
@@ -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,11 +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 { html,
|
|
11
|
-
import {
|
|
10
|
+
import { 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';
|
|
15
|
+
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
14
16
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
17
|
+
import { uploadStyles } from './styles/vaadin-upload-core-styles.js';
|
|
15
18
|
import { UploadMixin } from './vaadin-upload-mixin.js';
|
|
16
19
|
|
|
17
20
|
/**
|
|
@@ -19,7 +22,7 @@ import { UploadMixin } from './vaadin-upload-mixin.js';
|
|
|
19
22
|
*
|
|
20
23
|
* Example:
|
|
21
24
|
*
|
|
22
|
-
* ```
|
|
25
|
+
* ```html
|
|
23
26
|
* <vaadin-upload></vaadin-upload>
|
|
24
27
|
* ```
|
|
25
28
|
*
|
|
@@ -59,33 +62,25 @@ import { UploadMixin } from './vaadin-upload-mixin.js';
|
|
|
59
62
|
*
|
|
60
63
|
* @customElement
|
|
61
64
|
* @extends HTMLElement
|
|
62
|
-
* @mixes ControllerMixin
|
|
63
65
|
* @mixes ThemableMixin
|
|
64
66
|
* @mixes ElementMixin
|
|
65
67
|
* @mixes UploadMixin
|
|
66
68
|
*/
|
|
67
|
-
class Upload extends UploadMixin(ElementMixin(ThemableMixin(
|
|
68
|
-
static get
|
|
69
|
-
return
|
|
70
|
-
|
|
71
|
-
:host {
|
|
72
|
-
display: block;
|
|
73
|
-
position: relative;
|
|
74
|
-
box-sizing: border-box;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
:host([hidden]) {
|
|
78
|
-
display: none !important;
|
|
79
|
-
}
|
|
69
|
+
class Upload extends UploadMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
70
|
+
static get is() {
|
|
71
|
+
return 'vaadin-upload';
|
|
72
|
+
}
|
|
80
73
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
</style>
|
|
74
|
+
static get styles() {
|
|
75
|
+
return uploadStyles;
|
|
76
|
+
}
|
|
85
77
|
|
|
78
|
+
/** @protected */
|
|
79
|
+
render() {
|
|
80
|
+
return html`
|
|
86
81
|
<div part="primary-buttons">
|
|
87
82
|
<slot name="add-button"></slot>
|
|
88
|
-
<div part="drop-label" hidden
|
|
83
|
+
<div part="drop-label" ?hidden="${this.nodrop}" id="dropLabelContainer" aria-hidden="true">
|
|
89
84
|
<slot name="drop-label-icon"></slot>
|
|
90
85
|
<slot name="drop-label"></slot>
|
|
91
86
|
</div>
|
|
@@ -96,18 +91,14 @@ class Upload extends UploadMixin(ElementMixin(ThemableMixin(ControllerMixin(Poly
|
|
|
96
91
|
type="file"
|
|
97
92
|
id="fileInput"
|
|
98
93
|
hidden
|
|
99
|
-
|
|
100
|
-
accept
|
|
101
|
-
multiple
|
|
102
|
-
capture
|
|
94
|
+
@change="${this._onFileInputChange}"
|
|
95
|
+
accept="${this.accept}"
|
|
96
|
+
?multiple="${this._isMultiple(this.maxFiles)}"
|
|
97
|
+
capture="${ifDefined(this.capture)}"
|
|
103
98
|
/>
|
|
104
99
|
`;
|
|
105
100
|
}
|
|
106
101
|
|
|
107
|
-
static get is() {
|
|
108
|
-
return 'vaadin-upload';
|
|
109
|
-
}
|
|
110
|
-
|
|
111
102
|
/**
|
|
112
103
|
* Fired when a file cannot be added to the queue due to a constrain:
|
|
113
104
|
* file-size, file-type or maxFiles
|
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": "
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
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": "
|
|
4
|
+
"version": "25.0.0-alpha10",
|
|
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,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';
|