Skip to content

Commit c3c4caa

Browse files
authored
refactor!: remove no longer used upload file shadow parts (#10060)
1 parent ef69e7e commit c3c4caa

File tree

4 files changed

+92
-111
lines changed

4 files changed

+92
-111
lines changed

packages/upload/src/styles/vaadin-upload-file-base-styles.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ export const uploadFileStyles = css`
2424
display: none;
2525
}
2626
27-
[part='row'] {
28-
display: contents;
29-
}
30-
31-
[part='info'] {
32-
display: contents;
33-
}
34-
3527
[part='done-icon']:not([hidden]),
3628
[part='warning-icon']:not([hidden]) {
3729
display: flex;

packages/upload/src/vaadin-upload-file.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ export interface UploadFileEventMap extends HTMLElementEventMap, UploadFileCusto
4242
*
4343
* Part name | Description
4444
* -----------------|-------------
45-
* `row` | File container
46-
* `info` | Container for file status icon, file name, status and error messages
4745
* `done-icon` | File done status icon
4846
* `warning-icon` | File warning status icon
4947
* `meta` | Container for file name, status and error messages

packages/upload/src/vaadin-upload-file.js

Lines changed: 38 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ import { UploadFileMixin } from './vaadin-upload-file-mixin.js';
2222
*
2323
* Part name | Description
2424
* -----------------|-------------
25-
* `row` | File container
26-
* `info` | Container for file status icon, file name, status and error messages
2725
* `done-icon` | File done status icon
2826
* `warning-icon` | File warning status icon
2927
* `meta` | Container for file name, status and error messages
@@ -72,48 +70,45 @@ class UploadFile extends UploadFileMixin(ThemableMixin(PolylitMixin(LumoInjectio
7270
/** @protected */
7371
render() {
7472
return html`
75-
<div part="row">
76-
<div part="info">
77-
<div part="done-icon" ?hidden="${!this.complete}" aria-hidden="true"></div>
78-
<div part="warning-icon" ?hidden="${!this.errorMessage}" aria-hidden="true"></div>
73+
<div part="done-icon" ?hidden="${!this.complete}" aria-hidden="true"></div>
74+
<div part="warning-icon" ?hidden="${!this.errorMessage}" aria-hidden="true"></div>
7975
80-
<div part="meta">
81-
<div part="name" id="name">${this.fileName}</div>
82-
<div part="status" ?hidden="${!this.status}" id="status">${this.status}</div>
83-
<div part="error" id="error" ?hidden="${!this.errorMessage}">${this.errorMessage}</div>
84-
</div>
85-
</div>
86-
<div part="commands">
87-
<button
88-
type="button"
89-
part="start-button"
90-
file-event="file-start"
91-
@click="${this._fireFileEvent}"
92-
?hidden="${!this.held}"
93-
?disabled="${this.disabled}"
94-
aria-label="${this.i18n ? this.i18n.file.start : nothing}"
95-
aria-describedby="name"
96-
></button>
97-
<button
98-
type="button"
99-
part="retry-button"
100-
file-event="file-retry"
101-
@click="${this._fireFileEvent}"
102-
?hidden="${!this.errorMessage}"
103-
?disabled="${this.disabled}"
104-
aria-label="${this.i18n ? this.i18n.file.retry : nothing}"
105-
aria-describedby="name"
106-
></button>
107-
<button
108-
type="button"
109-
part="remove-button"
110-
file-event="file-abort"
111-
@click="${this._fireFileEvent}"
112-
?disabled="${this.disabled}"
113-
aria-label="${this.i18n ? this.i18n.file.remove : nothing}"
114-
aria-describedby="name"
115-
></button>
116-
</div>
76+
<div part="meta">
77+
<div part="name" id="name">${this.fileName}</div>
78+
<div part="status" ?hidden="${!this.status}" id="status">${this.status}</div>
79+
<div part="error" id="error" ?hidden="${!this.errorMessage}">${this.errorMessage}</div>
80+
</div>
81+
82+
<div part="commands">
83+
<button
84+
type="button"
85+
part="start-button"
86+
file-event="file-start"
87+
@click="${this._fireFileEvent}"
88+
?hidden="${!this.held}"
89+
?disabled="${this.disabled}"
90+
aria-label="${this.i18n ? this.i18n.file.start : nothing}"
91+
aria-describedby="name"
92+
></button>
93+
<button
94+
type="button"
95+
part="retry-button"
96+
file-event="file-retry"
97+
@click="${this._fireFileEvent}"
98+
?hidden="${!this.errorMessage}"
99+
?disabled="${this.disabled}"
100+
aria-label="${this.i18n ? this.i18n.file.retry : nothing}"
101+
aria-describedby="name"
102+
></button>
103+
<button
104+
type="button"
105+
part="remove-button"
106+
file-event="file-abort"
107+
@click="${this._fireFileEvent}"
108+
?disabled="${this.disabled}"
109+
aria-label="${this.i18n ? this.i18n.file.remove : nothing}"
110+
aria-describedby="name"
111+
></button>
117112
</div>
118113
119114
<slot name="progress"></slot>

packages/upload/test/dom/__snapshots__/vaadin-upload-file.test.snap.js

Lines changed: 54 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,62 @@
22
export const snapshots = {};
33

44
snapshots["vaadin-upload-file shadow default"] =
5-
`<div part="row">
6-
<div part="info">
7-
<div
8-
aria-hidden="true"
9-
hidden=""
10-
part="done-icon"
11-
>
12-
</div>
13-
<div
14-
aria-hidden="true"
15-
hidden=""
16-
part="warning-icon"
17-
>
18-
</div>
19-
<div part="meta">
20-
<div
21-
id="name"
22-
part="name"
23-
>
24-
Workflow.pdf
25-
</div>
26-
<div
27-
id="status"
28-
part="status"
29-
>
30-
19.7 MB: 60% (remaining time: 00:12:34)
31-
</div>
32-
<div
33-
hidden=""
34-
id="error"
35-
part="error"
36-
>
37-
</div>
38-
</div>
5+
`<div
6+
aria-hidden="true"
7+
hidden=""
8+
part="done-icon"
9+
>
10+
</div>
11+
<div
12+
aria-hidden="true"
13+
hidden=""
14+
part="warning-icon"
15+
>
16+
</div>
17+
<div part="meta">
18+
<div
19+
id="name"
20+
part="name"
21+
>
22+
Workflow.pdf
3923
</div>
40-
<div part="commands">
41-
<button
42-
aria-describedby="name"
43-
file-event="file-start"
44-
hidden=""
45-
part="start-button"
46-
type="button"
47-
>
48-
</button>
49-
<button
50-
aria-describedby="name"
51-
file-event="file-retry"
52-
hidden=""
53-
part="retry-button"
54-
type="button"
55-
>
56-
</button>
57-
<button
58-
aria-describedby="name"
59-
file-event="file-abort"
60-
part="remove-button"
61-
type="button"
62-
>
63-
</button>
24+
<div
25+
id="status"
26+
part="status"
27+
>
28+
19.7 MB: 60% (remaining time: 00:12:34)
6429
</div>
30+
<div
31+
hidden=""
32+
id="error"
33+
part="error"
34+
>
35+
</div>
36+
</div>
37+
<div part="commands">
38+
<button
39+
aria-describedby="name"
40+
file-event="file-start"
41+
hidden=""
42+
part="start-button"
43+
type="button"
44+
>
45+
</button>
46+
<button
47+
aria-describedby="name"
48+
file-event="file-retry"
49+
hidden=""
50+
part="retry-button"
51+
type="button"
52+
>
53+
</button>
54+
<button
55+
aria-describedby="name"
56+
file-event="file-abort"
57+
part="remove-button"
58+
type="button"
59+
>
60+
</button>
6561
</div>
6662
<slot name="progress">
6763
</slot>

0 commit comments

Comments
 (0)