Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
mdcClasses: ['mdc-fab', 'mdc-fab--mini', 'mat-mdc-mini-fab'],
},
{
selector: 'mat-icon-button',
mdcClasses: ['mdc-icon-button', 'mat-mdc-icon-button'],
}
];
// Boilerplate for applying mixins to MatButton.
/** @docs-private */
export class MatButtonMixinCore {
constructor(public _elementRef: ElementRef) {}
}
export const _MatButtonBaseMixin: CanDisableRippleCtor&CanDisableCtor&CanColorCtor&
typeof MatButtonMixinCore = mixinColor(mixinDisabled(mixinDisableRipple(MatButtonMixinCore)));
/** Base class for all buttons. */
@Directive()
export class MatButtonBase extends _MatButtonBaseMixin implements CanDisable, CanColor,
CanDisableRipple {
/** The ripple animation configuration to use for the buttons. */
_rippleAnimation: RippleAnimationConfig = {
enterDuration: numbers.DEACTIVATION_TIMEOUT_MS,
exitDuration: numbers.FG_DEACTIVATION_MS
};
/** Whether the ripple is centered on the button. */
_isRippleCentered = false;
/** Reference to the MatRipple instance of the button. */
@ViewChild(MatRipple) ripple: MatRipple;
/** Object that can be used to configure the default options for the tabs module. */
export interface MatTabsConfig {
/** Duration for the tab animation. Must be a valid CSS value (e.g. 600ms). */
animationDuration?: string;
}
/** Injection token that can be used to provide the default options the tabs module. */
export const MAT_TABS_CONFIG = new InjectionToken('MAT_TABS_CONFIG');
// Boilerplate for applying mixins to MatTabGroup.
/** @docs-private */
export class MatTabGroupBase {
constructor(public _elementRef: ElementRef) {}
}
export const _MatTabGroupMixinBase: CanColorCtor & CanDisableRippleCtor & typeof MatTabGroupBase =
mixinColor(mixinDisableRipple(MatTabGroupBase), 'primary');
/**
* Material design tab-group component. Supports basic tab pairs (label + content) and includes
* animated ink-bar, keyboard navigation, and screen reader.
* See: https://material.io/design/components/tabs.html
*/
@Component({
moduleId: module.id,
selector: 'mat-tab-group',
exportAs: 'matTabGroup',
templateUrl: 'tab-group.html',
styleUrls: ['tab-group.css'],
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
inputs: ['color', 'disableRipple'],
host: {
/** Event object that is emitted when an autocomplete option is selected. */
export class MatAutocompleteSelectedEvent {
constructor(
/** Reference to the autocomplete panel that emitted the event. */
public source: MatAutocomplete,
/** Option that was selected. */
public option: MatOption) { }
}
// Boilerplate for applying mixins to MatAutocomplete.
/** @docs-private */
export class MatAutocompleteBase {}
export const _MatAutocompleteMixinBase: CanDisableRippleCtor & typeof MatAutocompleteBase =
mixinDisableRipple(MatAutocompleteBase);
/** Default `mat-autocomplete` options that can be overridden. */
export interface MatAutocompleteDefaultOptions {
/** Whether the first option should be highlighted when an autocomplete panel is opened. */
autoActiveFirstOption?: boolean;
}
/** Injection token to be used to override the default options for `mat-autocomplete`. */
export const MAT_AUTOCOMPLETE_DEFAULT_OPTIONS =
new InjectionToken('mat-autocomplete-default-options', {
providedIn: 'root',
factory: MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY,
});
/** @docs-private */
export function MAT_AUTOCOMPLETE_DEFAULT_OPTIONS_FACTORY(): MatAutocompleteDefaultOptions {
* @deprecated @breaking-change 9.0.0 `platform` parameter to become required.
*/
@Optional() platform?: Platform,
@Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string) {
super(elementRef, dir, ngZone, changeDetectorRef, viewportRuler, platform, animationMode);
}
static ngAcceptInputType_disableRipple: BooleanInput;
static ngAcceptInputType_selectedIndex: NumberInput;
}
// Boilerplate for applying mixins to MatTabLink.
class MatTabLinkMixinBase {}
const _MatTabLinkMixinBase:
HasTabIndexCtor & CanDisableRippleCtor & CanDisableCtor & typeof MatTabLinkMixinBase =
mixinTabIndex(mixinDisableRipple(mixinDisabled(MatTabLinkMixinBase)));
/** Base class with all of the `MatTabLink` functionality. */
@Directive()
// tslint:disable-next-line:class-name
export class _MatTabLinkBase extends _MatTabLinkMixinBase implements OnDestroy, CanDisable,
CanDisableRipple, HasTabIndex, RippleTarget, FocusableOption {
/** Whether the tab link is active or not. */
protected _isActive: boolean = false;
/** Whether the link is active. */
@Input()
get active(): boolean { return this._isActive; }
set active(value: boolean) {
if (value !== this._isActive) {
this._isActive = value;
} from '@angular/core';
import {
CanDisableRipple,
CanDisableRippleCtor,
MatLine,
setLines,
mixinDisableRipple,
} from '@angular/material/core';
import {Subject} from 'rxjs';
import {takeUntil} from 'rxjs/operators';
// Boilerplate for applying mixins to MatList.
/** @docs-private */
export class MatListBase {}
export const _MatListMixinBase: CanDisableRippleCtor & typeof MatListBase =
mixinDisableRipple(MatListBase);
// Boilerplate for applying mixins to MatListItem.
/** @docs-private */
export class MatListItemBase {}
export const _MatListItemMixinBase: CanDisableRippleCtor & typeof MatListItemBase =
mixinDisableRipple(MatListItemBase);
@Component({
moduleId: module.id,
selector: 'mat-nav-list',
exportAs: 'matNavList',
host: {
'role': 'navigation',
'class': 'mat-nav-list mat-list-base'
},
templateUrl: 'list.html',
class MatSlideToggleChange {
}
/**
* \@docs-private
*/
class MatSlideToggleBase {
/**
* @param {?} _renderer
* @param {?} _elementRef
*/
constructor(_renderer, _elementRef) {
this._renderer = _renderer;
this._elementRef = _elementRef;
}
}
const _MatSlideToggleMixinBase = mixinTabIndex(mixinColor(mixinDisableRipple(mixinDisabled(MatSlideToggleBase)), 'accent'));
/**
* Represents a slidable "switch" toggle that can be moved between on and off.
*/
class MatSlideToggle extends _MatSlideToggleMixinBase {
/**
* @param {?} elementRef
* @param {?} renderer
* @param {?} _platform
* @param {?} _focusMonitor
* @param {?} _changeDetectorRef
* @param {?} tabIndex
*/
constructor(elementRef, renderer, _platform, _focusMonitor, _changeDetectorRef, tabIndex) {
super(renderer, elementRef);
this._platform = _platform;
this._focusMonitor = _focusMonitor;
/**
* Boilerplate for applying mixins to MatChip.
* @docs-private
*/
class MatChipBase {
disabled!: boolean;
constructor(public _elementRef: ElementRef) {}
}
const _MatChipMixinBase:
CanColorCtor &
CanDisableRippleCtor &
HasTabIndexCtor &
typeof MatChipBase =
mixinTabIndex(mixinColor(mixinDisableRipple(MatChipBase), 'primary'), -1);
/**
* Material design styled Chip base component. Used inside the MatChipSet component.
*
* Extended by MatChipOption and MatChipRow for different interaction patterns.
*/
@Component({
selector: 'mat-basic-chip, mat-chip',
inputs: ['color', 'disableRipple'],
exportAs: 'matChip',
templateUrl: 'chip.html',
styleUrls: ['chips.css'],
host: {
'[class.mat-mdc-chip-disabled]': 'disabled',
'[class.mat-mdc-chip-highlighted]': 'highlighted',
'[class.mat-mdc-chip-with-avatar]': 'leadingIcon',