Commit 14d86c8 1 parent e904a37 commit 14d86c8 Copy full SHA for 14d86c8
File tree 1 file changed +1
-29
lines changed
1 file changed +1
-29
lines changed Original file line number Diff line number Diff line change 1
- import { queryAssignedElements } from 'lit/decorators.js' ;
2
1
import { BaseButton } from '../base-button' ;
3
- import { PropertyValues } from 'lit' ;
4
- import { TapIcon } from '../icon' ;
5
2
6
- export class IconButton extends BaseButton {
7
- @queryAssignedElements ( ) private icon ! : TapIcon [ ] ;
8
-
9
- protected updated ( _changedProperties : PropertyValues ) {
10
- super . updated ( _changedProperties ) ;
11
- const isSizeChanged = ! ! _changedProperties . get ( 'size' ) ;
12
- if ( isSizeChanged ) this . updateIconSize ( ) ;
13
- }
14
-
15
- private updateIconSize = ( ) => {
16
- if ( this . icon [ 0 ] ) {
17
- this . icon [ 0 ] . width = this . getIconSize ( ) ;
18
- this . icon [ 0 ] . height = this . getIconSize ( ) ;
19
- }
20
- } ;
21
-
22
- private getIconSize = ( ) => {
23
- switch ( this . size ) {
24
- case 'small' :
25
- return 20 ;
26
- case 'medium' :
27
- case 'large' :
28
- return 24 ;
29
- }
30
- } ;
31
- }
3
+ export class IconButton extends BaseButton { }
You can’t perform that action at this time.
0 commit comments