license import { Constructor } from './constructor' ; import { CanDisable } from './disabled' ; docs-private export interface HasTabIndex { /** Tabindex of the component. */ tabIndex : number ; } docs-private export type HasTabIndexCtor = Constructor < HasTabIndex > ; /** Mixin to augment a directive with a `tabIndex` property. */ export function mixinTabIndex < T extends Constructor < CanDisable > > ( base , defaultTabIndex = 0 ) { return class extends base { private _tabIndex : number = defaultTabIndex ; get tabIndex ( ) : number { return this . disabled ? - 1 : this . _tabIndex ; } set tabIndex ( value ) { this . _tabIndex = value != null ? value : defaultTabIndex ; } constructor ( ... args ) { super ( ... args ) ; } } ; }