11import { getThemeByName } from "./themes" ;
2- import { Badge , BadgeAlign , Theme } from "./types" ;
2+ import { Badge , BadgeAlign , FontWeight , Theme } from "./types" ;
33
44export default class Card {
55 private title : string ;
@@ -8,6 +8,7 @@ export default class Card {
88 private badgeAlign : BadgeAlign ;
99 private showBorder : boolean ;
1010 private borderRadius : number ;
11+ private fontWeight : FontWeight ;
1112
1213 private lines : Map < number , Badge [ ] > ;
1314
@@ -17,6 +18,7 @@ export default class Card {
1718 this . badgeAlign = "left" ;
1819 this . showBorder = true ;
1920 this . borderRadius = 4.5 ;
21+ this . fontWeight = FontWeight . SEMIBOLD ;
2022
2123 this . lineCount = 1 ;
2224 this . lines = new Map < number , Badge [ ] > ( ) ;
@@ -76,4 +78,20 @@ export default class Card {
7678 public setBorderRadius = ( borderRadius : number ) : void => {
7779 this . borderRadius = borderRadius ;
7880 } ;
81+
82+ public getFontWeight = ( ) : FontWeight => this . fontWeight ;
83+
84+ public setFontWeight = ( weight : string ) : void => {
85+ switch ( weight . toLowerCase ( ) . trim ( ) ) {
86+ case "thin" :
87+ this . fontWeight = FontWeight . THIN ;
88+ break ;
89+ case "bold" :
90+ this . fontWeight = FontWeight . BOLD ;
91+ break ;
92+ case "normal" :
93+ this . fontWeight = FontWeight . NORMAL ;
94+ break ;
95+ }
96+ } ;
7997}
0 commit comments