UNPKG

@angular/material

Version:
1 lines 32.1 kB
{"version":3,"file":"button-toggle.mjs","sources":["../../../../../../src/material/button-toggle/button-toggle.ts","../../../../../../src/material/button-toggle/button-toggle.html","../../../../../../src/material/button-toggle/button-toggle-module.ts","../../../../../../src/material/button-toggle/public-api.ts","../../../../../../src/material/button-toggle/index.ts","../../../../../../src/material/button-toggle/button-toggle_public_index.ts"],"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 */\n\nimport {FocusMonitor} from '@angular/cdk/a11y';\nimport {BooleanInput, coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {SelectionModel} from '@angular/cdk/collections';\nimport {\n AfterContentInit,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ContentChildren,\n Directive,\n ElementRef,\n EventEmitter,\n forwardRef,\n Input,\n OnDestroy,\n OnInit,\n Optional,\n Output,\n QueryList,\n ViewChild,\n ViewEncapsulation,\n InjectionToken,\n Inject,\n AfterViewInit,\n} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {CanDisableRipple, mixinDisableRipple} from '@angular/material/core';\n\n/**\n * @deprecated No longer used.\n * @breaking-change 11.0.0\n */\nexport type ToggleType = 'checkbox' | 'radio';\n\n/** Possible appearance styles for the button toggle. */\nexport type MatButtonToggleAppearance = 'legacy' | 'standard';\n\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/**\n * Injection token that can be used to configure the\n * default options for all button toggles within an app.\n */\nexport const MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS = new InjectionToken<MatButtonToggleDefaultOptions>(\n 'MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS',\n);\n\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 const MAT_BUTTON_TOGGLE_GROUP = new InjectionToken<MatButtonToggleGroup>(\n 'MatButtonToggleGroup',\n);\n\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 const MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatButtonToggleGroup),\n multi: true,\n};\n\n// Counter used to generate unique IDs.\nlet uniqueIdCounter = 0;\n\n/** Change event object emitted by MatButtonToggle. */\nexport class MatButtonToggleChange {\n constructor(\n /** The MatButtonToggle that emits the event. */\n public source: MatButtonToggle,\n\n /** The value assigned to the MatButtonToggle. */\n public value: any,\n ) {}\n}\n\n/** Exclusive selection button toggle group that behaves like a radio-button group. */\n@Directive({\n selector: 'mat-button-toggle-group',\n providers: [\n MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR,\n {provide: MAT_BUTTON_TOGGLE_GROUP, useExisting: MatButtonToggleGroup},\n ],\n host: {\n 'role': 'group',\n 'class': 'mat-button-toggle-group',\n '[attr.aria-disabled]': 'disabled',\n '[class.mat-button-toggle-vertical]': 'vertical',\n '[class.mat-button-toggle-group-appearance-standard]': 'appearance === \"standard\"',\n },\n exportAs: 'matButtonToggleGroup',\n})\nexport class MatButtonToggleGroup implements ControlValueAccessor, OnInit, AfterContentInit {\n private _vertical = false;\n private _multiple = false;\n private _disabled = false;\n private _selectionModel: SelectionModel<MatButtonToggle>;\n\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: any;\n\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\n /** onTouch function registered via registerOnTouch (ControlValueAccessor). */\n _onTouched: () => any = () => {};\n\n /** Child button toggle buttons. */\n @ContentChildren(forwardRef(() => MatButtonToggle), {\n // Note that this would technically pick up toggles\n // from nested groups, but that's not a case that we support.\n descendants: true,\n })\n _buttonToggles: QueryList<MatButtonToggle>;\n\n /** The appearance for all the buttons in the group. */\n @Input() appearance: MatButtonToggleAppearance;\n\n /** `name` attribute for the underlying `input` element. */\n @Input()\n get name(): string {\n return this._name;\n }\n set name(value: string) {\n this._name = value;\n\n if (this._buttonToggles) {\n this._buttonToggles.forEach(toggle => {\n toggle.name = this._name;\n toggle._markForCheck();\n });\n }\n }\n private _name = `mat-button-toggle-group-${uniqueIdCounter++}`;\n\n /** Whether the toggle group is vertical. */\n @Input()\n get vertical(): boolean {\n return this._vertical;\n }\n set vertical(value: BooleanInput) {\n this._vertical = coerceBooleanProperty(value);\n }\n\n /** Value of the toggle group. */\n @Input()\n get value(): any {\n const selected = this._selectionModel ? this._selectionModel.selected : [];\n\n if (this.multiple) {\n return selected.map(toggle => toggle.value);\n }\n\n return selected[0] ? selected[0].value : undefined;\n }\n set value(newValue: any) {\n this._setSelectionByValue(newValue);\n this.valueChange.emit(this.value);\n }\n\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 @Output() readonly valueChange = new EventEmitter<any>();\n\n /** Selected button toggles in the group. */\n get selected(): MatButtonToggle | MatButtonToggle[] {\n const selected = this._selectionModel ? this._selectionModel.selected : [];\n return this.multiple ? selected : selected[0] || null;\n }\n\n /** Whether multiple button toggles can be selected. */\n @Input()\n get multiple(): boolean {\n return this._multiple;\n }\n set multiple(value: BooleanInput) {\n this._multiple = coerceBooleanProperty(value);\n }\n\n /** Whether multiple button toggle group is disabled. */\n @Input()\n get disabled(): boolean {\n return this._disabled;\n }\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n\n if (this._buttonToggles) {\n this._buttonToggles.forEach(toggle => toggle._markForCheck());\n }\n }\n\n /** Event emitted when the group's value changes. */\n @Output() readonly change: EventEmitter<MatButtonToggleChange> =\n new EventEmitter<MatButtonToggleChange>();\n\n constructor(\n private _changeDetector: ChangeDetectorRef,\n @Optional()\n @Inject(MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS)\n defaultOptions?: MatButtonToggleDefaultOptions,\n ) {\n this.appearance =\n defaultOptions && defaultOptions.appearance ? defaultOptions.appearance : 'standard';\n }\n\n ngOnInit() {\n this._selectionModel = new SelectionModel<MatButtonToggle>(this.multiple, undefined, false);\n }\n\n ngAfterContentInit() {\n this._selectionModel.select(...this._buttonToggles.filter(toggle => toggle.checked));\n }\n\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) {\n this.value = value;\n this._changeDetector.markForCheck();\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnTouched(fn: any) {\n this._onTouched = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n setDisabledState(isDisabled: boolean): void {\n this.disabled = isDisabled;\n }\n\n /** Dispatch change event with current selection and group value. */\n _emitChangeEvent(): void {\n const selected = this.selected;\n const source = Array.isArray(selected) ? selected[selected.length - 1] : selected;\n const event = new MatButtonToggleChange(source!, this.value);\n this._controlValueAccessorChangeFn(event.value);\n this.change.emit(event);\n }\n\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(\n toggle: MatButtonToggle,\n select: boolean,\n isUserInput = false,\n deferEvents = false,\n ) {\n // Deselect the currently-selected toggle, if we're in single-selection\n // mode and the button being toggled isn't selected at the moment.\n if (!this.multiple && this.selected && !toggle.checked) {\n (this.selected as MatButtonToggle).checked = false;\n }\n\n if (this._selectionModel) {\n if (select) {\n this._selectionModel.select(toggle);\n } else {\n this._selectionModel.deselect(toggle);\n }\n } else {\n deferEvents = true;\n }\n\n // We need to defer in some cases in order to avoid \"changed after checked errors\", however\n // the side-effect is that we may end up updating the model value out of sequence in others\n // The `deferEvents` flag allows us to decide whether to do it on a case-by-case basis.\n if (deferEvents) {\n Promise.resolve().then(() => this._updateModelValue(isUserInput));\n } else {\n this._updateModelValue(isUserInput);\n }\n }\n\n /** Checks whether a button toggle is selected. */\n _isSelected(toggle: MatButtonToggle) {\n return this._selectionModel && this._selectionModel.isSelected(toggle);\n }\n\n /** Determines whether a button toggle should be checked on init. */\n _isPrechecked(toggle: MatButtonToggle) {\n if (typeof this._rawValue === 'undefined') {\n return false;\n }\n\n if (this.multiple && Array.isArray(this._rawValue)) {\n return this._rawValue.some(value => toggle.value != null && value === toggle.value);\n }\n\n return toggle.value === this._rawValue;\n }\n\n /** Updates the selection state of the toggles in the group based on a value. */\n private _setSelectionByValue(value: any | any[]) {\n this._rawValue = value;\n\n if (!this._buttonToggles) {\n return;\n }\n\n if (this.multiple && value) {\n if (!Array.isArray(value) && (typeof ngDevMode === 'undefined' || ngDevMode)) {\n throw Error('Value must be an array in multiple-selection mode.');\n }\n\n this._clearSelection();\n value.forEach((currentValue: any) => this._selectValue(currentValue));\n } else {\n this._clearSelection();\n this._selectValue(value);\n }\n }\n\n /** Clears the selected toggles. */\n private _clearSelection() {\n this._selectionModel.clear();\n this._buttonToggles.forEach(toggle => (toggle.checked = false));\n }\n\n /** Selects a value if there's a toggle that corresponds to it. */\n private _selectValue(value: any) {\n const correspondingOption = this._buttonToggles.find(toggle => {\n return toggle.value != null && toggle.value === value;\n });\n\n if (correspondingOption) {\n correspondingOption.checked = true;\n this._selectionModel.select(correspondingOption);\n }\n }\n\n /** Syncs up the group's value with the model and emits the change event. */\n private _updateModelValue(isUserInput: boolean) {\n // Only emit the change event for user input.\n if (isUserInput) {\n this._emitChangeEvent();\n }\n\n // Note: we emit this one no matter whether it was a user interaction, because\n // it is used by Angular to sync up the two-way data binding.\n this.valueChange.emit(this.value);\n }\n}\n\n// Boilerplate for applying mixins to the MatButtonToggle class.\n/** @docs-private */\nconst _MatButtonToggleBase = mixinDisableRipple(class {});\n\n/** Single button inside of a toggle group. */\n@Component({\n selector: 'mat-button-toggle',\n templateUrl: 'button-toggle.html',\n styleUrls: ['button-toggle.css'],\n encapsulation: ViewEncapsulation.None,\n exportAs: 'matButtonToggle',\n changeDetection: ChangeDetectionStrategy.OnPush,\n inputs: ['disableRipple'],\n host: {\n '[class.mat-button-toggle-standalone]': '!buttonToggleGroup',\n '[class.mat-button-toggle-checked]': 'checked',\n '[class.mat-button-toggle-disabled]': 'disabled',\n '[class.mat-button-toggle-appearance-standard]': 'appearance === \"standard\"',\n 'class': 'mat-button-toggle',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[attr.id]': 'id',\n '[attr.name]': 'null',\n '(focus)': 'focus()',\n 'role': 'presentation',\n },\n})\nexport class MatButtonToggle\n extends _MatButtonToggleBase\n implements OnInit, AfterViewInit, CanDisableRipple, OnDestroy\n{\n private _isSingleSelector = false;\n private _checked = false;\n\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 @Input('aria-label') ariaLabel: string;\n\n /**\n * Users can specify the `aria-labelledby` attribute which will be forwarded to the input element\n */\n @Input('aria-labelledby') ariaLabelledby: string | null = null;\n\n /** Underlying native `button` element. */\n @ViewChild('button') _buttonElement: ElementRef<HTMLButtonElement>;\n\n /** The parent button toggle group (exclusive selection). Optional. */\n buttonToggleGroup: MatButtonToggleGroup;\n\n /** Unique ID for the underlying `button` element. */\n get buttonId(): string {\n return `${this.id}-button`;\n }\n\n /** The unique ID for this button toggle. */\n @Input() id: string;\n\n /** HTML's 'name' attribute used to group radios for unique selection. */\n @Input() name: string;\n\n /** MatButtonToggleGroup reads this to assign its own value. */\n @Input() value: any;\n\n /** Tabindex for the toggle. */\n @Input() tabIndex: number | null;\n\n /** The appearance style of the button. */\n @Input()\n get appearance(): MatButtonToggleAppearance {\n return this.buttonToggleGroup ? this.buttonToggleGroup.appearance : this._appearance;\n }\n set appearance(value: MatButtonToggleAppearance) {\n this._appearance = value;\n }\n private _appearance: MatButtonToggleAppearance;\n\n /** Whether the button is checked. */\n @Input()\n get checked(): boolean {\n return this.buttonToggleGroup ? this.buttonToggleGroup._isSelected(this) : this._checked;\n }\n set checked(value: BooleanInput) {\n const newValue = coerceBooleanProperty(value);\n\n if (newValue !== this._checked) {\n this._checked = newValue;\n\n if (this.buttonToggleGroup) {\n this.buttonToggleGroup._syncButtonToggle(this, this._checked);\n }\n\n this._changeDetectorRef.markForCheck();\n }\n }\n\n /** Whether the button is disabled. */\n @Input()\n get disabled(): boolean {\n return this._disabled || (this.buttonToggleGroup && this.buttonToggleGroup.disabled);\n }\n set disabled(value: BooleanInput) {\n this._disabled = coerceBooleanProperty(value);\n }\n private _disabled: boolean = false;\n\n /** Event emitted when the group value changes. */\n @Output() readonly change: EventEmitter<MatButtonToggleChange> =\n new EventEmitter<MatButtonToggleChange>();\n\n constructor(\n @Optional() @Inject(MAT_BUTTON_TOGGLE_GROUP) toggleGroup: MatButtonToggleGroup,\n private _changeDetectorRef: ChangeDetectorRef,\n private _elementRef: ElementRef<HTMLElement>,\n private _focusMonitor: FocusMonitor,\n @Attribute('tabindex') defaultTabIndex: string,\n @Optional()\n @Inject(MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS)\n defaultOptions?: MatButtonToggleDefaultOptions,\n ) {\n super();\n\n const parsedTabIndex = Number(defaultTabIndex);\n this.tabIndex = parsedTabIndex || parsedTabIndex === 0 ? parsedTabIndex : null;\n this.buttonToggleGroup = toggleGroup;\n this.appearance =\n defaultOptions && defaultOptions.appearance ? defaultOptions.appearance : 'standard';\n }\n\n ngOnInit() {\n const group = this.buttonToggleGroup;\n this._isSingleSelector = group && !group.multiple;\n this.id = this.id || `mat-button-toggle-${uniqueIdCounter++}`;\n\n if (this._isSingleSelector) {\n this.name = group.name;\n }\n\n if (group) {\n if (group._isPrechecked(this)) {\n this.checked = true;\n } else if (group._isSelected(this) !== this._checked) {\n // As as side effect of the circular dependency between the toggle group and the button,\n // we may end up in a state where the button is supposed to be checked on init, but it\n // isn't, because the checked value was assigned too early. This can happen when Ivy\n // assigns the static input value before the `ngOnInit` has run.\n group._syncButtonToggle(this, this._checked);\n }\n }\n }\n\n ngAfterViewInit() {\n this._focusMonitor.monitor(this._elementRef, true);\n }\n\n ngOnDestroy() {\n const group = this.buttonToggleGroup;\n\n this._focusMonitor.stopMonitoring(this._elementRef);\n\n // Remove the toggle from the selection once it's destroyed. Needs to happen\n // on the next tick in order to avoid \"changed after checked\" errors.\n if (group && group._isSelected(this)) {\n group._syncButtonToggle(this, false, false, true);\n }\n }\n\n /** Focuses the button. */\n focus(options?: FocusOptions): void {\n this._buttonElement.nativeElement.focus(options);\n }\n\n /** Checks the button toggle due to an interaction with the underlying native button. */\n _onButtonClick() {\n const newChecked = this._isSingleSelector ? true : !this._checked;\n\n if (newChecked !== this._checked) {\n this._checked = newChecked;\n if (this.buttonToggleGroup) {\n this.buttonToggleGroup._syncButtonToggle(this, this._checked, true);\n this.buttonToggleGroup._onTouched();\n }\n }\n // Emit a change event when it's the single selector\n this.change.emit(new MatButtonToggleChange(this, this.value));\n }\n\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() {\n // When the group value changes, the button will not be notified.\n // Use `markForCheck` to explicit update button toggle's status.\n this._changeDetectorRef.markForCheck();\n }\n}\n","<button #button class=\"mat-button-toggle-button mat-focus-indicator\"\n type=\"button\"\n [id]=\"buttonId\"\n [attr.tabindex]=\"disabled ? -1 : tabIndex\"\n [attr.aria-pressed]=\"checked\"\n [disabled]=\"disabled || null\"\n [attr.name]=\"name || null\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n (click)=\"_onButtonClick()\">\n <span class=\"mat-button-toggle-label-content\">\n <ng-content></ng-content>\n </span>\n</button>\n\n<span class=\"mat-button-toggle-focus-overlay\"></span>\n<span class=\"mat-button-toggle-ripple\" matRipple\n [matRippleTrigger]=\"button\"\n [matRippleDisabled]=\"this.disableRipple || this.disabled\">\n</span>\n","/**\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 */\n\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatButtonToggle, MatButtonToggleGroup} from './button-toggle';\n\n@NgModule({\n imports: [MatCommonModule, MatRippleModule],\n exports: [MatCommonModule, MatButtonToggleGroup, MatButtonToggle],\n declarations: [MatButtonToggleGroup, MatButtonToggle],\n})\nexport class MatButtonToggleModule {}\n","/**\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 */\n\nexport * from './button-toggle';\nexport * from './button-toggle-module';\n","/**\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 */\n\nexport * from './public-api';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;;;AA0DA;;;;MAIa,iCAAiC,GAAG,IAAI,cAAc,CACjE,mCAAmC,EACnC;AAEF;;;;;MAKa,uBAAuB,GAAG,IAAI,cAAc,CACvD,sBAAsB,EACtB;AAEF;;;;;MAKa,sCAAsC,GAAQ;IACzD,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,UAAU,CAAC,MAAM,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