@@ -4,26 +4,26 @@ import { Custom } from "./Custom.ts";
44import { PlainText } from "./PlainText.ts" ;
55
66export const Symbol = ( icon : string , ...classList : string [ ] ) : Component => {
7- const webgenIcon : string = ( globalThis as ( typeof globalThis & { WEBGEN_ICON : string } ) ) . WEBGEN_ICON ;
7+ const webgenIcon : string = ( globalThis as ( typeof globalThis & { WEBGEN_ICON : string ; } ) ) . WEBGEN_ICON ;
88 switch ( webgenIcon ) {
99 case "material" :
10- return Custom ( custom ( "span" , icon , "material-symbols-rounded" , "webgen-icon" , ...classList ) )
10+ return Custom ( custom ( "span" , icon , "material-symbols-rounded" , "webgen-icon" , ...classList ) ) ;
1111 case "bootstrap" :
12- return Custom ( custom ( "span" , undefined , "bi" , `bi-${ icon } ` , "webgen-icon" , ...classList ) )
12+ return Custom ( custom ( "span" , undefined , "bi" , `bi-${ icon } ` , "webgen-icon" , ...classList ) ) ;
1313 default :
14- return PlainText ( "" )
14+ return PlainText ( "" ) ;
1515 }
1616} ;
1717
1818export const Icon = ( icon : string , ...classList : string [ ] ) : Component => {
19- const webgenIcon : string = ( globalThis as ( typeof globalThis & { WEBGEN_ICON : string } ) ) . WEBGEN_ICON ;
19+ const webgenIcon : string = ( globalThis as ( typeof globalThis & { WEBGEN_ICON : string ; } ) ) . WEBGEN_ICON ;
2020 switch ( webgenIcon ) {
2121 case "material" :
22- return Custom ( custom ( "span" , icon , "material-icons-round" , "webgen-icon" , ...classList ) )
22+ return Custom ( custom ( "span" , icon , "material-icons-round" , "webgen-icon" , ...classList ) ) ;
2323 case "bootstrap" :
24- return Custom ( custom ( "span" , undefined , "bi" , `bi-${ icon } ` , "webgen-icon" , ...classList ) )
24+ return Custom ( custom ( "span" , undefined , "bi" , `bi-${ icon } ` , "webgen-icon" , ...classList ) ) ;
2525 default :
26- return PlainText ( "" )
26+ return PlainText ( "" ) ;
2727 }
2828} ;
2929
@@ -33,19 +33,21 @@ export const enum CommonIconType {
3333 Close ,
3434 Download ,
3535 Edit ,
36- Delete
36+ Delete ,
37+ Check
3738}
3839
3940export const CommonIcon = ( icon : CommonIconType ) : string => {
40- const webgenIcon : string = ( globalThis as ( typeof globalThis & { WEBGEN_ICON : string } ) ) . WEBGEN_ICON ;
41+ const webgenIcon : string = ( globalThis as ( typeof globalThis & { WEBGEN_ICON : string ; } ) ) . WEBGEN_ICON ;
4142 const mapping : { [ type in CommonIconType ] : [ material : string , bootstrap : string ] } = {
4243 [ CommonIconType . ArrowDown ] : [ "expand_more" , "chevron-down" ] ,
4344 [ CommonIconType . Done ] : [ "done" , "check2" ] ,
4445 [ CommonIconType . Close ] : [ "close" , "x-lg" ] ,
4546 [ CommonIconType . Download ] : [ "get_app" , "cloud-download" ] ,
4647 [ CommonIconType . Edit ] : [ "edit" , "pencil" ] ,
47- [ CommonIconType . Delete ] : [ "delete" , "trash" ]
48+ [ CommonIconType . Delete ] : [ "delete" , "trash" ] ,
49+ [ CommonIconType . Check ] : [ "check" , "check2" ] ,
4850 } ;
4951
50- return mapping ! [ icon ] [ webgenIcon == "material" ? 0 : 1 ]
51- }
52+ return mapping ! [ icon ] [ webgenIcon == "material" ? 0 : 1 ] ;
53+ } ;
0 commit comments