Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
host: { class: 'mc-tab-nav-bar' },
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class McTabNav extends McTabNavMixinBase
implements CanColor {
constructor(elementRef: ElementRef) {
super(elementRef);
}
}
// Boilerplate for applying mixins to McTabLink.
export class McTabLinkBase {}
// tslint:disable-next-line:naming-convention
export const McTabLinkMixinBase: HasTabIndexCtor & CanDisableCtor &
typeof McTabLinkBase = mixinTabIndex(mixinDisabled(McTabLinkBase));
/**
* Link inside of a `mc-tab-nav-bar`.
*/
@Directive({
selector: '[mc-tab-link], [mcTabLink]',
exportAs: 'mcTabLink',
inputs: ['disabled', 'tabIndex'],
host: {
class: 'mc-tab-link',
'[attr.aria-current]': 'active',
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.tabIndex]': 'tabIndex',
'[class.mc-disabled]': 'disabled',
'[class.mc-active]': 'active'
}
styleUrls: ['tab-nav-bar.css'],
host: { class: 'mc-tab-nav-bar' },
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush
})
export class McTabNav extends mcTabNavMixinBase
implements CanColor {
constructor(elementRef: ElementRef) {
super(elementRef);
}
}
// Boilerplate for applying mixins to McTabLink.
export class McTabLinkBase {}
export const mcTabLinkMixinBase: HasTabIndexCtor & CanDisableCtor &
typeof McTabLinkBase = mixinTabIndex(mixinDisabled(McTabLinkBase));
/**
* Link inside of a `mc-tab-nav-bar`.
*/
@Directive({
selector: '[mc-tab-link], [mcTabLink]',
exportAs: 'mcTabLink',
inputs: ['disabled', 'tabIndex'],
host: {
class: 'mc-tab-link',
'[attr.aria-current]': 'active',
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.tabIndex]': 'tabIndex',
'[class.mc-disabled]': 'disabled',
'[class.mc-active]': 'active'
}
}
/** Injection token that can be used to provide the default options the tabs module. */
export const MC_TABS_CONFIG = new InjectionToken('MC_TABS_CONFIG');
// Boilerplate for applying mixins to McTabGroup.
/** @docs-private */
export class McTabGroupBase {
// tslint:disable-next-line:naming-convention
constructor(public _elementRef: ElementRef) { }
}
// tslint:disable-next-line:naming-convention
export const McTabGroupMixinBase:
CanColorCtor &
typeof McTabGroupBase =
mixinColor(mixinDisabled(McTabGroupBase));
/**
* Tab-group component. Supports basic tab pairs (label + content) and includes
* keyboard navigation.
*/
@Component({
selector: 'mc-tab-group',
exportAs: 'mcTabGroup',
templateUrl: 'tab-group.html',
styleUrls: ['tab-group.css'],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
inputs: ['color'],
host: {
class: 'mc-tab-group',
'[class.mc-tab-group_dynamic-height]': 'dynamicHeight',
Optional,
Input,
ViewChild
} from '@angular/core';
import { IFocusableOption, FocusMonitor, FocusOrigin } from '@ptsecurity/cdk/a11y';
import { CanDisable, CanDisableCtor, mixinDisabled } from '@ptsecurity/mosaic/core';
import { Subject } from 'rxjs';
import { MC_DROPDOWN_PANEL, McDropdownPanel } from './dropdown-panel';
// Boilerplate for applying mixins to McDropdownItem.
/** @docs-private */
export class McDropdownItemBase {}
export const _McDropdownItemMixinBase: CanDisableCtor & typeof McDropdownItemBase =
mixinDisabled(McDropdownItemBase);
/**
* This directive is intended to be used inside an mc-dropdown tag.
* It exists mostly to set the role attribute.
*/
@Component({
selector: 'mc-dropdown-item, [mc-dropdown-item]',
exportAs: 'mcDropdownItem',
inputs: ['disabled'],
host: {
'[attr.role]': 'role',
class: 'mc-dropdown__item',
'[class.mc-dropdown__item_highlighted]': '_highlighted',
'[attr.tabindex]': '_getTabIndex()',
'[attr.aria-disabled]': 'disabled.toString()',
'[attr.disabled]': 'disabled || null',
animationDuration?: string;
}
/** Injection token that can be used to provide the default options the tabs module. */
export const MC_TABS_CONFIG = new InjectionToken('MC_TABS_CONFIG');
// Boilerplate for applying mixins to McTabGroup.
/** @docs-private */
export class McTabGroupBase {
// tslint:disable-next-line:naming-convention
constructor(public _elementRef: ElementRef) { }
}
export const mcTabGroupMixinBase:
CanColorCtor &
typeof McTabGroupBase =
mixinColor(mixinDisabled(McTabGroupBase));
/**
* Tab-group component. Supports basic tab pairs (label + content) and includes
* keyboard navigation.
*/
@Component({
selector: 'mc-tab-group',
exportAs: 'mcTabGroup',
templateUrl: 'tab-group.html',
styleUrls: ['tab-group.css'],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
inputs: ['color'],
host: {
class: 'mc-tab-group',
'[class.mc-tab-group_dynamic-height]': 'dynamicHeight',