@@ -3,7 +3,7 @@ import { Component, Element, h, Host, Listen, Prop, State, Watch } from '@stenci
33
44import type { LabelPropType , ToolbarAPI , ToolbarStates , ToolbarItemsPropType , ToolbarItemPropType } from '../../schema' ;
55import { validateLabel , validateToolbarItems } from '../../schema' ;
6- import { KolLinkTag , KolButtonTag } from '../../core/component-names' ;
6+ import { KolButtonWcTag , KolLinkButtonTag } from '../../core/component-names' ;
77
88const TOOLBAR_ITEM_TAG_NAME = 'kol-toolbar-item' ;
99
@@ -24,23 +24,22 @@ export class KolToolbar implements ToolbarAPI {
2424
2525 @State ( ) private currentIndex : number = 0 ;
2626
27- private indexToElement = new Map < number , HTMLKolLinkElement | HTMLKolButtonElement > ( ) ;
27+ private indexToElement = new Map < number , HTMLKolLinkButtonElement | HTMLKolButtonWcElement > ( ) ;
2828
2929 private renderItem = ( element : ToolbarItemPropType , index : number ) : JSX . Element => {
3030 const tabIndex = index === this . currentIndex && ! element ?. _disabled ? 0 : - 1 ;
3131 const props = {
3232 key : index ,
33- class : TOOLBAR_ITEM_TAG_NAME ,
3433 _tabIndex : tabIndex ,
3534 } ;
36- const catchRef = ( element ?: HTMLKolLinkElement | HTMLKolButtonElement ) => {
35+ const catchRef = ( element ?: HTMLKolLinkButtonElement | HTMLKolButtonWcElement ) => {
3736 element && this . indexToElement . set ( index , element ) ;
3837 } ;
3938
4039 return '_href' in element ? (
41- < KolLinkTag { ...element } { ...props } ref = { catchRef } > </ KolLinkTag >
40+ < KolLinkButtonTag { ...element } { ...props } class = { TOOLBAR_ITEM_TAG_NAME } ref = { catchRef } > </ KolLinkButtonTag >
4241 ) : (
43- < KolButtonTag { ...element } { ...props } ref = { catchRef } > </ KolButtonTag >
42+ < KolButtonWcTag { ...element } { ...props } class = { { button : true , normal : true , TOOLBAR_ITEM_TAG_NAME : true } } ref = { catchRef } > </ KolButtonWcTag >
4443 ) ;
4544 } ;
4645
0 commit comments