@vaadin/upload 24.8.0-alpha8 → 25.0.0-alpha1

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.
@@ -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 };
@@ -1,6 +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
- export * from './vaadin-upload.js';
@@ -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,2 +0,0 @@
1
- import './vaadin-upload-styles.js';
2
- import '../../src/vaadin-lit-upload.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-upload-styles.js';
2
- import '../../src/vaadin-lit-upload.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-upload-styles.js';
2
- import '../../src/vaadin-lit-upload.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-upload-styles.js';
2
- import '../../src/vaadin-lit-upload.js';
@@ -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
- );
@@ -1,2 +0,0 @@
1
- import './vaadin-upload-styles.js';
2
- import '../../src/vaadin-upload.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-upload-styles.js';
2
- import '../../src/vaadin-upload.js';
@@ -1 +0,0 @@
1
- export * from './src/vaadin-upload.js';
@@ -1,2 +0,0 @@
1
- import './theme/lumo/vaadin-lit-upload.js';
2
- export * from './src/vaadin-lit-upload.js';