File tree 3 files changed +23
-0
lines changed
3 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,13 @@ export abstract class Button extends buttonBaseClass implements FormSubmitter {
67
67
*/
68
68
@property ( ) href = '' ;
69
69
70
+ /**
71
+ * The filename to use when downloading the linked resource.
72
+ * If not specified, the browser will determine a filename.
73
+ * This is only applicable when the button is used as a link (`href` is set).
74
+ */
75
+ @property ( ) download = '' ;
76
+
70
77
/**
71
78
* Where to display the linked `href` URL for a link button. Common options
72
79
* include `_blank` to open in a new tab.
@@ -184,6 +191,7 @@ export abstract class Button extends buttonBaseClass implements FormSubmitter {
184
191
aria-haspopup ="${ ariaHasPopup || nothing } "
185
192
aria-expanded ="${ ariaExpanded || nothing } "
186
193
href =${ this . href }
194
+ download =${ this . download || nothing }
187
195
target=${ this . target || nothing }
188
196
> ${ this . renderContent ( ) }
189
197
</ a > ` ;
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ import {Chip} from './chip.js';
19
19
export class AssistChip extends Chip {
20
20
@property ( { type : Boolean } ) elevated = false ;
21
21
@property ( ) href = '' ;
22
+ /**
23
+ * The filename to use when downloading the linked resource.
24
+ * If not specified, the browser will determine a filename.
25
+ * This is only applicable when the chip is used as a link (`href` is set).
26
+ */
27
+ @property ( ) download = '' ;
22
28
@property ( ) target : '_blank' | '_parent' | '_self' | '_top' | '' = '' ;
23
29
24
30
protected get primaryId ( ) {
@@ -49,6 +55,7 @@ export class AssistChip extends Chip {
49
55
id ="link "
50
56
aria-label =${ ariaLabel || nothing }
51
57
href =${ this . href }
58
+ download=${ this . download || nothing }
52
59
target=${ this . target || nothing }
53
60
> ${ content } </ a
54
61
>
Original file line number Diff line number Diff line change @@ -79,6 +79,13 @@ export class IconButton extends iconButtonBaseClass implements FormSubmitter {
79
79
*/
80
80
@property ( ) href = '' ;
81
81
82
+ /**
83
+ * The filename to use when downloading the linked resource.
84
+ * If not specified, the browser will determine a filename.
85
+ * This is only applicable when the icon button is used as a link (`href` is set).
86
+ */
87
+ @property ( ) download = '' ;
88
+
82
89
/**
83
90
* Sets the underlying `HTMLAnchorElement`'s `target` attribute.
84
91
*/
@@ -191,6 +198,7 @@ export class IconButton extends iconButtonBaseClass implements FormSubmitter {
191
198
class ="link "
192
199
id ="link "
193
200
href ="${ this . href } "
201
+ download ="${ this . download || nothing } "
194
202
target ="${ this . target || nothing } "
195
203
aria-label ="${ ariaLabel || nothing } ">
196
204
${ this . renderTouchTarget ( ) }
You can’t perform that action at this time.
0 commit comments