1- import { booleanAttribute , computed , Directive , effect , input } from '@angular/core' ;
1+ import { booleanAttribute , computed , Directive , effect , input , numberAttribute } from '@angular/core' ;
2+ import { BooleanInput } from '../coreui.types' ;
23
34@Directive ( {
45selector :'[cNavLink]' ,
@@ -12,6 +13,8 @@ import { booleanAttribute, computed, Directive, effect, input } from '@angular/c
1213}
1314} )
1415export class NavLinkDirective {
16+ static ngAcceptInputType_disabled :BooleanInput ;
17+
1518/**
1619 * Sets .nav-link class to the host. [docs]
1720 *@default true
@@ -30,20 +33,25 @@ export class NavLinkDirective {
3033 */
3134readonly disabled = input ( false , { transform :booleanAttribute } ) ;
3235
36+ /**
37+ * The tabindex attribute specifies the tab order of an element (when the "tab" button is used for navigating).
38+ */
39+ readonly tabindex = input ( undefined , { transform :numberAttribute } ) ;
40+
3341readonly ariaCurrent = computed ( ( ) => {
3442return this . active ( ) ?'page' :null ;
3543} ) ;
3644
3745ariaDisabled :boolean | null = null ;
3846attrDisabled :boolean | string | null = null ;
39- attrTabindex :'-1' | null = null ;
47+ attrTabindex :number | null = null ;
4048styleCursor :'pointer' | null = null ;
4149
4250readonly #disabledEffect= effect ( ( ) => {
4351const disabled = this . disabled ( ) ;
4452this . ariaDisabled = disabled || null ;
4553this . attrDisabled = disabled ?'' :null ;
46- this . attrTabindex = disabled ?'-1' :null ;
54+ this . attrTabindex = disabled ?- 1 :( this . tabindex ( ) ?? null ) ;
4755this . styleCursor = disabled ?null :'pointer' ;
4856} ) ;
4957