You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

1 lines
11 KiB

{"version":3,"file":"button-toggle.d.ts","sources":["button-toggle.d.ts"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA;AACA","sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nimport { FocusMonitor } from '@angular/cdk/a11y';\nimport { BooleanInput } from '@angular/cdk/coercion';\nimport { AfterContentInit, ChangeDetectorRef, ElementRef, EventEmitter, OnDestroy, OnInit, QueryList, InjectionToken, AfterViewInit } from '@angular/core';\nimport { ControlValueAccessor } from '@angular/forms';\nimport { CanDisableRipple } from '@angular/material/core';\n/**\n * @deprecated No longer used.\n * @breaking-change 11.0.0\n */\nexport declare type ToggleType = 'checkbox' | 'radio';\n/** Possible appearance styles for the button toggle. */\nexport declare type MatButtonToggleAppearance = 'legacy' | 'standard';\n/**\n * Represents the default options for the button toggle that can be configured\n * using the `MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS` injection token.\n */\nexport interface MatButtonToggleDefaultOptions {\n /**\n * Default appearance to be used by button toggles. Can be overridden by explicitly\n * setting an appearance on a button toggle or group.\n */\n appearance?: MatButtonToggleAppearance;\n}\n/**\n * Injection token that can be used to configure the\n * default options for all button toggles within an app.\n */\nexport declare const MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS: InjectionToken<MatButtonToggleDefaultOptions>;\n/**\n * Injection token that can be used to reference instances of `MatButtonToggleGroup`.\n * It serves as alternative token to the actual `MatButtonToggleGroup` class which\n * could cause unnecessary retention of the class and its component metadata.\n */\nexport declare const MAT_BUTTON_TOGGLE_GROUP: InjectionToken<MatButtonToggleGroup>;\n/**\n * Provider Expression that allows mat-button-toggle-group to register as a ControlValueAccessor.\n * This allows it to support [(ngModel)].\n * @docs-private\n */\nexport declare const MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR: any;\n/** Change event object emitted by MatButtonToggle. */\nexport declare class MatButtonToggleChange {\n /** The MatButtonToggle that emits the event. */\n source: MatButtonToggle;\n /** The value assigned to the MatButtonToggle. */\n value: any;\n constructor(\n /** The MatButtonToggle that emits the event. */\n source: MatButtonToggle, \n /** The value assigned to the MatButtonToggle. */\n value: any);\n}\n/** Exclusive selection button toggle group that behaves like a radio-button group. */\nexport declare class MatButtonToggleGroup implements ControlValueAccessor, OnInit, AfterContentInit {\n private _changeDetector;\n private _vertical;\n private _multiple;\n private _disabled;\n private _selectionModel;\n /**\n * Reference to the raw value that the consumer tried to assign. The real\n * value will exclude any values from this one that don't correspond to a\n * toggle. Useful for the cases where the value is assigned before the toggles\n * have been initialized or at the same that they're being swapped out.\n */\n private _rawValue;\n /**\n * The method to be called in order to update ngModel.\n * Now `ngModel` binding is not supported in multiple selection mode.\n */\n _controlValueAccessorChangeFn: (value: any) => void;\n /** onTouch function registered via registerOnTouch (ControlValueAccessor). */\n _onTouched: () => any;\n /** Child button toggle buttons. */\n _buttonToggles: QueryList<MatButtonToggle>;\n /** The appearance for all the buttons in the group. */\n appearance: MatButtonToggleAppearance;\n /** `name` attribute for the underlying `input` element. */\n get name(): string;\n set name(value: string);\n private _name;\n /** Whether the toggle group is vertical. */\n get vertical(): boolean;\n set vertical(value: boolean);\n /** Value of the toggle group. */\n get value(): any;\n set value(newValue: any);\n /**\n * Event that emits whenever the value of the group changes.\n * Used to facilitate two-way data binding.\n * @docs-private\n */\n readonly valueChange: EventEmitter<any>;\n /** Selected button toggles in the group. */\n get selected(): MatButtonToggle | MatButtonToggle[];\n /** Whether multiple button toggles can be selected. */\n get multiple(): boolean;\n set multiple(value: boolean);\n /** Whether multiple button toggle group is disabled. */\n get disabled(): boolean;\n set disabled(value: boolean);\n /** Event emitted when the group's value changes. */\n readonly change: EventEmitter<MatButtonToggleChange>;\n constructor(_changeDetector: ChangeDetectorRef, defaultOptions?: MatButtonToggleDefaultOptions);\n ngOnInit(): void;\n ngAfterContentInit(): void;\n /**\n * Sets the model value. Implemented as part of ControlValueAccessor.\n * @param value Value to be set to the model.\n */\n writeValue(value: any): void;\n registerOnChange(fn: (value: any) => void): void;\n registerOnTouched(fn: any): void;\n setDisabledState(isDisabled: boolean): void;\n /** Dispatch change event with current selection and group value. */\n _emitChangeEvent(): void;\n /**\n * Syncs a button toggle's selected state with the model value.\n * @param toggle Toggle to be synced.\n * @param select Whether the toggle should be selected.\n * @param isUserInput Whether the change was a result of a user interaction.\n * @param deferEvents Whether to defer emitting the change events.\n */\n _syncButtonToggle(toggle: MatButtonToggle, select: boolean, isUserInput?: boolean, deferEvents?: boolean): void;\n /** Checks whether a button toggle is selected. */\n _isSelected(toggle: MatButtonToggle): boolean;\n /** Determines whether a button toggle should be checked on init. */\n _isPrechecked(toggle: MatButtonToggle): boolean;\n /** Updates the selection state of the toggles in the group based on a value. */\n private _setSelectionByValue;\n /** Clears the selected toggles. */\n private _clearSelection;\n /** Selects a value if there's a toggle that corresponds to it. */\n private _selectValue;\n /** Syncs up the group's value with the model and emits the change event. */\n private _updateModelValue;\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_multiple: BooleanInput;\n static ngAcceptInputType_vertical: BooleanInput;\n}\n/** @docs-private */\ndeclare const _MatButtonToggleBase: import(\"@angular/material/core/common-behaviors/constructor\").Constructor<CanDisableRipple> & import(\"@angular/material/core/common-behaviors/constructor\").AbstractConstructor<CanDisableRipple> & {\n new (): {};\n};\n/** Single button inside of a toggle group. */\nexport declare class MatButtonToggle extends _MatButtonToggleBase implements OnInit, AfterViewInit, CanDisableRipple, OnDestroy {\n private _changeDetectorRef;\n private _elementRef;\n private _focusMonitor;\n private _isSingleSelector;\n private _checked;\n /**\n * Attached to the aria-label attribute of the host element. In most cases, aria-labelledby will\n * take precedence so this may be omitted.\n */\n ariaLabel: string;\n /**\n * Users can specify the `aria-labelledby` attribute which will be forwarded to the input element\n */\n ariaLabelledby: string | null;\n /** Underlying native `button` element. */\n _buttonElement: ElementRef<HTMLButtonElement>;\n /** The parent button toggle group (exclusive selection). Optional. */\n buttonToggleGroup: MatButtonToggleGroup;\n /** Unique ID for the underlying `button` element. */\n get buttonId(): string;\n /** The unique ID for this button toggle. */\n id: string;\n /** HTML's 'name' attribute used to group radios for unique selection. */\n name: string;\n /** MatButtonToggleGroup reads this to assign its own value. */\n value: any;\n /** Tabindex for the toggle. */\n tabIndex: number | null;\n /** The appearance style of the button. */\n get appearance(): MatButtonToggleAppearance;\n set appearance(value: MatButtonToggleAppearance);\n private _appearance;\n /** Whether the button is checked. */\n get checked(): boolean;\n set checked(value: boolean);\n /** Whether the button is disabled. */\n get disabled(): boolean;\n set disabled(value: boolean);\n private _disabled;\n /** Event emitted when the group value changes. */\n readonly change: EventEmitter<MatButtonToggleChange>;\n constructor(toggleGroup: MatButtonToggleGroup, _changeDetectorRef: ChangeDetectorRef, _elementRef: ElementRef<HTMLElement>, _focusMonitor: FocusMonitor, defaultTabIndex: string, defaultOptions?: MatButtonToggleDefaultOptions);\n ngOnInit(): void;\n ngAfterViewInit(): void;\n ngOnDestroy(): void;\n /** Focuses the button. */\n focus(options?: FocusOptions): void;\n /** Checks the button toggle due to an interaction with the underlying native button. */\n _onButtonClick(): void;\n /**\n * Marks the button toggle as needing checking for change detection.\n * This method is exposed because the parent button toggle group will directly\n * update bound properties of the radio button.\n */\n _markForCheck(): void;\n static ngAcceptInputType_checked: BooleanInput;\n static ngAcceptInputType_disabled: BooleanInput;\n static ngAcceptInputType_vertical: BooleanInput;\n static ngAcceptInputType_multiple: BooleanInput;\n static ngAcceptInputType_disableRipple: BooleanInput;\n}\nexport {};\n"]}