1 | import * as i1 from '@angular/cdk/a11y';
|
2 | import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
3 | import { SelectionModel } from '@angular/cdk/collections';
|
4 | import * as i0 from '@angular/core';
|
5 | import { InjectionToken, forwardRef, EventEmitter, Directive, Optional, Inject, ContentChildren, Input, Output, Component, ViewEncapsulation, ChangeDetectionStrategy, Attribute, ViewChild, NgModule } from '@angular/core';
|
6 | import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
7 | import * as i2 from '@angular/material/core';
|
8 | import { mixinDisableRipple, MatCommonModule, MatRippleModule } from '@angular/material/core';
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 | const MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS = new InjectionToken('MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS');
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | const MAT_BUTTON_TOGGLE_GROUP = new InjectionToken('MatButtonToggleGroup');
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 | const MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR = {
|
34 | provide: NG_VALUE_ACCESSOR,
|
35 | useExisting: forwardRef(() => MatButtonToggleGroup),
|
36 | multi: true,
|
37 | };
|
38 |
|
39 | let uniqueIdCounter = 0;
|
40 |
|
41 | class MatButtonToggleChange {
|
42 | constructor(
|
43 | /** The MatButtonToggle that emits the event. */
|
44 | source,
|
45 | /** The value assigned to the MatButtonToggle. */
|
46 | value) {
|
47 | this.source = source;
|
48 | this.value = value;
|
49 | }
|
50 | }
|
51 |
|
52 | class MatButtonToggleGroup {
|
53 | constructor(_changeDetector, defaultOptions) {
|
54 | this._changeDetector = _changeDetector;
|
55 | this._vertical = false;
|
56 | this._multiple = false;
|
57 | this._disabled = false;
|
58 | |
59 |
|
60 |
|
61 |
|
62 | this._controlValueAccessorChangeFn = () => { };
|
63 |
|
64 | this._onTouched = () => { };
|
65 | this._name = `mat-button-toggle-group-${uniqueIdCounter++}`;
|
66 | |
67 |
|
68 |
|
69 |
|
70 |
|
71 | this.valueChange = new EventEmitter();
|
72 |
|
73 | this.change = new EventEmitter();
|
74 | this.appearance =
|
75 | defaultOptions && defaultOptions.appearance ? defaultOptions.appearance : 'standard';
|
76 | }
|
77 |
|
78 | get name() {
|
79 | return this._name;
|
80 | }
|
81 | set name(value) {
|
82 | this._name = value;
|
83 | if (this._buttonToggles) {
|
84 | this._buttonToggles.forEach(toggle => {
|
85 | toggle.name = this._name;
|
86 | toggle._markForCheck();
|
87 | });
|
88 | }
|
89 | }
|
90 |
|
91 | get vertical() {
|
92 | return this._vertical;
|
93 | }
|
94 | set vertical(value) {
|
95 | this._vertical = coerceBooleanProperty(value);
|
96 | }
|
97 |
|
98 | get value() {
|
99 | const selected = this._selectionModel ? this._selectionModel.selected : [];
|
100 | if (this.multiple) {
|
101 | return selected.map(toggle => toggle.value);
|
102 | }
|
103 | return selected[0] ? selected[0].value : undefined;
|
104 | }
|
105 | set value(newValue) {
|
106 | this._setSelectionByValue(newValue);
|
107 | this.valueChange.emit(this.value);
|
108 | }
|
109 |
|
110 | get selected() {
|
111 | const selected = this._selectionModel ? this._selectionModel.selected : [];
|
112 | return this.multiple ? selected : selected[0] || null;
|
113 | }
|
114 |
|
115 | get multiple() {
|
116 | return this._multiple;
|
117 | }
|
118 | set multiple(value) {
|
119 | this._multiple = coerceBooleanProperty(value);
|
120 | }
|
121 |
|
122 | get disabled() {
|
123 | return this._disabled;
|
124 | }
|
125 | set disabled(value) {
|
126 | this._disabled = coerceBooleanProperty(value);
|
127 | if (this._buttonToggles) {
|
128 | this._buttonToggles.forEach(toggle => toggle._markForCheck());
|
129 | }
|
130 | }
|
131 | ngOnInit() {
|
132 | this._selectionModel = new SelectionModel(this.multiple, undefined, false);
|
133 | }
|
134 | ngAfterContentInit() {
|
135 | this._selectionModel.select(...this._buttonToggles.filter(toggle => toggle.checked));
|
136 | }
|
137 | |
138 |
|
139 |
|
140 |
|
141 | writeValue(value) {
|
142 | this.value = value;
|
143 | this._changeDetector.markForCheck();
|
144 | }
|
145 |
|
146 | registerOnChange(fn) {
|
147 | this._controlValueAccessorChangeFn = fn;
|
148 | }
|
149 |
|
150 | registerOnTouched(fn) {
|
151 | this._onTouched = fn;
|
152 | }
|
153 |
|
154 | setDisabledState(isDisabled) {
|
155 | this.disabled = isDisabled;
|
156 | }
|
157 |
|
158 | _emitChangeEvent() {
|
159 | const selected = this.selected;
|
160 | const source = Array.isArray(selected) ? selected[selected.length - 1] : selected;
|
161 | const event = new MatButtonToggleChange(source, this.value);
|
162 | this._controlValueAccessorChangeFn(event.value);
|
163 | this.change.emit(event);
|
164 | }
|
165 | |
166 |
|
167 |
|
168 |
|
169 |
|
170 |
|
171 |
|
172 | _syncButtonToggle(toggle, select, isUserInput = false, deferEvents = false) {
|
173 |
|
174 |
|
175 | if (!this.multiple && this.selected && !toggle.checked) {
|
176 | this.selected.checked = false;
|
177 | }
|
178 | if (this._selectionModel) {
|
179 | if (select) {
|
180 | this._selectionModel.select(toggle);
|
181 | }
|
182 | else {
|
183 | this._selectionModel.deselect(toggle);
|
184 | }
|
185 | }
|
186 | else {
|
187 | deferEvents = true;
|
188 | }
|
189 |
|
190 |
|
191 |
|
192 | if (deferEvents) {
|
193 | Promise.resolve().then(() => this._updateModelValue(isUserInput));
|
194 | }
|
195 | else {
|
196 | this._updateModelValue(isUserInput);
|
197 | }
|
198 | }
|
199 |
|
200 | _isSelected(toggle) {
|
201 | return this._selectionModel && this._selectionModel.isSelected(toggle);
|
202 | }
|
203 |
|
204 | _isPrechecked(toggle) {
|
205 | if (typeof this._rawValue === 'undefined') {
|
206 | return false;
|
207 | }
|
208 | if (this.multiple && Array.isArray(this._rawValue)) {
|
209 | return this._rawValue.some(value => toggle.value != null && value === toggle.value);
|
210 | }
|
211 | return toggle.value === this._rawValue;
|
212 | }
|
213 |
|
214 | _setSelectionByValue(value) {
|
215 | this._rawValue = value;
|
216 | if (!this._buttonToggles) {
|
217 | return;
|
218 | }
|
219 | if (this.multiple && value) {
|
220 | if (!Array.isArray(value) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
221 | throw Error('Value must be an array in multiple-selection mode.');
|
222 | }
|
223 | this._clearSelection();
|
224 | value.forEach((currentValue) => this._selectValue(currentValue));
|
225 | }
|
226 | else {
|
227 | this._clearSelection();
|
228 | this._selectValue(value);
|
229 | }
|
230 | }
|
231 |
|
232 | _clearSelection() {
|
233 | this._selectionModel.clear();
|
234 | this._buttonToggles.forEach(toggle => (toggle.checked = false));
|
235 | }
|
236 |
|
237 | _selectValue(value) {
|
238 | const correspondingOption = this._buttonToggles.find(toggle => {
|
239 | return toggle.value != null && toggle.value === value;
|
240 | });
|
241 | if (correspondingOption) {
|
242 | correspondingOption.checked = true;
|
243 | this._selectionModel.select(correspondingOption);
|
244 | }
|
245 | }
|
246 |
|
247 | _updateModelValue(isUserInput) {
|
248 |
|
249 | if (isUserInput) {
|
250 | this._emitChangeEvent();
|
251 | }
|
252 |
|
253 |
|
254 | this.valueChange.emit(this.value);
|
255 | }
|
256 | }
|
257 | MatButtonToggleGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatButtonToggleGroup, deps: [{ token: i0.ChangeDetectorRef }, { token: MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
258 | MatButtonToggleGroup.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: MatButtonToggleGroup, selector: "mat-button-toggle-group", inputs: { appearance: "appearance", name: "name", vertical: "vertical", value: "value", multiple: "multiple", disabled: "disabled" }, outputs: { valueChange: "valueChange", change: "change" }, host: { attributes: { "role": "group" }, properties: { "attr.aria-disabled": "disabled", "class.mat-button-toggle-vertical": "vertical", "class.mat-button-toggle-group-appearance-standard": "appearance === \"standard\"" }, classAttribute: "mat-button-toggle-group" }, providers: [
|
259 | MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR,
|
260 | { provide: MAT_BUTTON_TOGGLE_GROUP, useExisting: MatButtonToggleGroup },
|
261 | ], queries: [{ propertyName: "_buttonToggles", predicate: i0.forwardRef(function () { return MatButtonToggle; }), descendants: true }], exportAs: ["matButtonToggleGroup"], ngImport: i0 });
|
262 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatButtonToggleGroup, decorators: [{
|
263 | type: Directive,
|
264 | args: [{
|
265 | selector: 'mat-button-toggle-group',
|
266 | providers: [
|
267 | MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR,
|
268 | { provide: MAT_BUTTON_TOGGLE_GROUP, useExisting: MatButtonToggleGroup },
|
269 | ],
|
270 | host: {
|
271 | 'role': 'group',
|
272 | 'class': 'mat-button-toggle-group',
|
273 | '[attr.aria-disabled]': 'disabled',
|
274 | '[class.mat-button-toggle-vertical]': 'vertical',
|
275 | '[class.mat-button-toggle-group-appearance-standard]': 'appearance === "standard"',
|
276 | },
|
277 | exportAs: 'matButtonToggleGroup',
|
278 | }]
|
279 | }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: undefined, decorators: [{
|
280 | type: Optional
|
281 | }, {
|
282 | type: Inject,
|
283 | args: [MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS]
|
284 | }] }]; }, propDecorators: { _buttonToggles: [{
|
285 | type: ContentChildren,
|
286 | args: [forwardRef(() => MatButtonToggle), {
|
287 |
|
288 |
|
289 | descendants: true,
|
290 | }]
|
291 | }], appearance: [{
|
292 | type: Input
|
293 | }], name: [{
|
294 | type: Input
|
295 | }], vertical: [{
|
296 | type: Input
|
297 | }], value: [{
|
298 | type: Input
|
299 | }], valueChange: [{
|
300 | type: Output
|
301 | }], multiple: [{
|
302 | type: Input
|
303 | }], disabled: [{
|
304 | type: Input
|
305 | }], change: [{
|
306 | type: Output
|
307 | }] } });
|
308 |
|
309 |
|
310 | const _MatButtonToggleBase = mixinDisableRipple(class {
|
311 | });
|
312 |
|
313 | class MatButtonToggle extends _MatButtonToggleBase {
|
314 | constructor(toggleGroup, _changeDetectorRef, _elementRef, _focusMonitor, defaultTabIndex, defaultOptions) {
|
315 | super();
|
316 | this._changeDetectorRef = _changeDetectorRef;
|
317 | this._elementRef = _elementRef;
|
318 | this._focusMonitor = _focusMonitor;
|
319 | this._isSingleSelector = false;
|
320 | this._checked = false;
|
321 | |
322 |
|
323 |
|
324 | this.ariaLabelledby = null;
|
325 | this._disabled = false;
|
326 |
|
327 | this.change = new EventEmitter();
|
328 | const parsedTabIndex = Number(defaultTabIndex);
|
329 | this.tabIndex = parsedTabIndex || parsedTabIndex === 0 ? parsedTabIndex : null;
|
330 | this.buttonToggleGroup = toggleGroup;
|
331 | this.appearance =
|
332 | defaultOptions && defaultOptions.appearance ? defaultOptions.appearance : 'standard';
|
333 | }
|
334 |
|
335 | get buttonId() {
|
336 | return `${this.id}-button`;
|
337 | }
|
338 |
|
339 | get appearance() {
|
340 | return this.buttonToggleGroup ? this.buttonToggleGroup.appearance : this._appearance;
|
341 | }
|
342 | set appearance(value) {
|
343 | this._appearance = value;
|
344 | }
|
345 |
|
346 | get checked() {
|
347 | return this.buttonToggleGroup ? this.buttonToggleGroup._isSelected(this) : this._checked;
|
348 | }
|
349 | set checked(value) {
|
350 | const newValue = coerceBooleanProperty(value);
|
351 | if (newValue !== this._checked) {
|
352 | this._checked = newValue;
|
353 | if (this.buttonToggleGroup) {
|
354 | this.buttonToggleGroup._syncButtonToggle(this, this._checked);
|
355 | }
|
356 | this._changeDetectorRef.markForCheck();
|
357 | }
|
358 | }
|
359 |
|
360 | get disabled() {
|
361 | return this._disabled || (this.buttonToggleGroup && this.buttonToggleGroup.disabled);
|
362 | }
|
363 | set disabled(value) {
|
364 | this._disabled = coerceBooleanProperty(value);
|
365 | }
|
366 | ngOnInit() {
|
367 | const group = this.buttonToggleGroup;
|
368 | this._isSingleSelector = group && !group.multiple;
|
369 | this.id = this.id || `mat-button-toggle-${uniqueIdCounter++}`;
|
370 | if (this._isSingleSelector) {
|
371 | this.name = group.name;
|
372 | }
|
373 | if (group) {
|
374 | if (group._isPrechecked(this)) {
|
375 | this.checked = true;
|
376 | }
|
377 | else if (group._isSelected(this) !== this._checked) {
|
378 |
|
379 |
|
380 |
|
381 |
|
382 | group._syncButtonToggle(this, this._checked);
|
383 | }
|
384 | }
|
385 | }
|
386 | ngAfterViewInit() {
|
387 | this._focusMonitor.monitor(this._elementRef, true);
|
388 | }
|
389 | ngOnDestroy() {
|
390 | const group = this.buttonToggleGroup;
|
391 | this._focusMonitor.stopMonitoring(this._elementRef);
|
392 |
|
393 |
|
394 | if (group && group._isSelected(this)) {
|
395 | group._syncButtonToggle(this, false, false, true);
|
396 | }
|
397 | }
|
398 |
|
399 | focus(options) {
|
400 | this._buttonElement.nativeElement.focus(options);
|
401 | }
|
402 |
|
403 | _onButtonClick() {
|
404 | const newChecked = this._isSingleSelector ? true : !this._checked;
|
405 | if (newChecked !== this._checked) {
|
406 | this._checked = newChecked;
|
407 | if (this.buttonToggleGroup) {
|
408 | this.buttonToggleGroup._syncButtonToggle(this, this._checked, true);
|
409 | this.buttonToggleGroup._onTouched();
|
410 | }
|
411 | }
|
412 |
|
413 | this.change.emit(new MatButtonToggleChange(this, this.value));
|
414 | }
|
415 | |
416 |
|
417 |
|
418 |
|
419 |
|
420 | _markForCheck() {
|
421 |
|
422 |
|
423 | this._changeDetectorRef.markForCheck();
|
424 | }
|
425 | }
|
426 | MatButtonToggle.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatButtonToggle, deps: [{ token: MAT_BUTTON_TOGGLE_GROUP, optional: true }, { token: i0.ChangeDetectorRef }, { token: i0.ElementRef }, { token: i1.FocusMonitor }, { token: 'tabindex', attribute: true }, { token: MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
427 | MatButtonToggle.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: MatButtonToggle, selector: "mat-button-toggle", inputs: { disableRipple: "disableRipple", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], id: "id", name: "name", value: "value", tabIndex: "tabIndex", appearance: "appearance", checked: "checked", disabled: "disabled" }, outputs: { change: "change" }, host: { attributes: { "role": "presentation" }, listeners: { "focus": "focus()" }, properties: { "class.mat-button-toggle-standalone": "!buttonToggleGroup", "class.mat-button-toggle-checked": "checked", "class.mat-button-toggle-disabled": "disabled", "class.mat-button-toggle-appearance-standard": "appearance === \"standard\"", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.id": "id", "attr.name": "null" }, classAttribute: "mat-button-toggle" }, viewQueries: [{ propertyName: "_buttonElement", first: true, predicate: ["button"], descendants: true }], exportAs: ["matButtonToggle"], usesInheritance: true, ngImport: i0, template: "<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", styles: [".mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;border-radius:2px;-webkit-tap-highlight-color:rgba(0,0,0,0);transform:translateZ(0)}.cdk-high-contrast-active .mat-button-toggle-standalone,.cdk-high-contrast-active .mat-button-toggle-group{outline:solid 1px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:4px}.cdk-high-contrast-active .mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.cdk-high-contrast-active .mat-button-toggle-group-appearance-standard{outline:0}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:1}.cdk-high-contrast-active .mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:.5}.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay{opacity:.04}.mat-button-toggle-appearance-standard.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay{opacity:.12}.cdk-high-contrast-active .mat-button-toggle-appearance-standard.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay{opacity:.5}@media(hover: none){.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;line-height:36px;padding:0 16px;position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0}.cdk-high-contrast-active .mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 36px;opacity:.5;height:0}.cdk-high-contrast-active .mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.cdk-high-contrast-active .mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}"], dependencies: [{ kind: "directive", type: i2.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
428 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatButtonToggle, decorators: [{
|
429 | type: Component,
|
430 | args: [{ selector: 'mat-button-toggle', encapsulation: ViewEncapsulation.None, exportAs: 'matButtonToggle', changeDetection: ChangeDetectionStrategy.OnPush, inputs: ['disableRipple'], host: {
|
431 | '[class.mat-button-toggle-standalone]': '!buttonToggleGroup',
|
432 | '[class.mat-button-toggle-checked]': 'checked',
|
433 | '[class.mat-button-toggle-disabled]': 'disabled',
|
434 | '[class.mat-button-toggle-appearance-standard]': 'appearance === "standard"',
|
435 | 'class': 'mat-button-toggle',
|
436 | '[attr.aria-label]': 'null',
|
437 | '[attr.aria-labelledby]': 'null',
|
438 | '[attr.id]': 'id',
|
439 | '[attr.name]': 'null',
|
440 | '(focus)': 'focus()',
|
441 | 'role': 'presentation',
|
442 | }, template: "<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", styles: [".mat-button-toggle-standalone,.mat-button-toggle-group{position:relative;display:inline-flex;flex-direction:row;white-space:nowrap;overflow:hidden;border-radius:2px;-webkit-tap-highlight-color:rgba(0,0,0,0);transform:translateZ(0)}.cdk-high-contrast-active .mat-button-toggle-standalone,.cdk-high-contrast-active .mat-button-toggle-group{outline:solid 1px}.mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.mat-button-toggle-group-appearance-standard{border-radius:4px}.cdk-high-contrast-active .mat-button-toggle-standalone.mat-button-toggle-appearance-standard,.cdk-high-contrast-active .mat-button-toggle-group-appearance-standard{outline:0}.mat-button-toggle-vertical{flex-direction:column}.mat-button-toggle-vertical .mat-button-toggle-label-content{display:block}.mat-button-toggle{white-space:nowrap;position:relative}.mat-button-toggle .mat-icon svg{vertical-align:top}.mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:1}.cdk-high-contrast-active .mat-button-toggle.cdk-keyboard-focused .mat-button-toggle-focus-overlay{opacity:.5}.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay{opacity:.04}.mat-button-toggle-appearance-standard.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay{opacity:.12}.cdk-high-contrast-active .mat-button-toggle-appearance-standard.cdk-keyboard-focused:not(.mat-button-toggle-disabled) .mat-button-toggle-focus-overlay{opacity:.5}@media(hover: none){.mat-button-toggle-appearance-standard:not(.mat-button-toggle-disabled):hover .mat-button-toggle-focus-overlay{display:none}}.mat-button-toggle-label-content{-webkit-user-select:none;user-select:none;display:inline-block;line-height:36px;padding:0 16px;position:relative}.mat-button-toggle-appearance-standard .mat-button-toggle-label-content{padding:0 12px}.mat-button-toggle-label-content>*{vertical-align:middle}.mat-button-toggle-focus-overlay{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:inherit;pointer-events:none;opacity:0}.cdk-high-contrast-active .mat-button-toggle-checked .mat-button-toggle-focus-overlay{border-bottom:solid 36px;opacity:.5;height:0}.cdk-high-contrast-active .mat-button-toggle-checked:hover .mat-button-toggle-focus-overlay{opacity:.6}.cdk-high-contrast-active .mat-button-toggle-checked.mat-button-toggle-appearance-standard .mat-button-toggle-focus-overlay{border-bottom:solid 500px}.mat-button-toggle .mat-button-toggle-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none}.mat-button-toggle-button{border:0;background:none;color:inherit;padding:0;margin:0;font:inherit;outline:none;width:100%;cursor:pointer}.mat-button-toggle-disabled .mat-button-toggle-button{cursor:default}.mat-button-toggle-button::-moz-focus-inner{border:0}"] }]
|
443 | }], ctorParameters: function () { return [{ type: MatButtonToggleGroup, decorators: [{
|
444 | type: Optional
|
445 | }, {
|
446 | type: Inject,
|
447 | args: [MAT_BUTTON_TOGGLE_GROUP]
|
448 | }] }, { type: i0.ChangeDetectorRef }, { type: i0.ElementRef }, { type: i1.FocusMonitor }, { type: undefined, decorators: [{
|
449 | type: Attribute,
|
450 | args: ['tabindex']
|
451 | }] }, { type: undefined, decorators: [{
|
452 | type: Optional
|
453 | }, {
|
454 | type: Inject,
|
455 | args: [MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS]
|
456 | }] }]; }, propDecorators: { ariaLabel: [{
|
457 | type: Input,
|
458 | args: ['aria-label']
|
459 | }], ariaLabelledby: [{
|
460 | type: Input,
|
461 | args: ['aria-labelledby']
|
462 | }], _buttonElement: [{
|
463 | type: ViewChild,
|
464 | args: ['button']
|
465 | }], id: [{
|
466 | type: Input
|
467 | }], name: [{
|
468 | type: Input
|
469 | }], value: [{
|
470 | type: Input
|
471 | }], tabIndex: [{
|
472 | type: Input
|
473 | }], appearance: [{
|
474 | type: Input
|
475 | }], checked: [{
|
476 | type: Input
|
477 | }], disabled: [{
|
478 | type: Input
|
479 | }], change: [{
|
480 | type: Output
|
481 | }] } });
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 |
|
490 | class MatButtonToggleModule {
|
491 | }
|
492 | MatButtonToggleModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatButtonToggleModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
493 | MatButtonToggleModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.1", ngImport: i0, type: MatButtonToggleModule, declarations: [MatButtonToggleGroup, MatButtonToggle], imports: [MatCommonModule, MatRippleModule], exports: [MatCommonModule, MatButtonToggleGroup, MatButtonToggle] });
|
494 | MatButtonToggleModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatButtonToggleModule, imports: [MatCommonModule, MatRippleModule, MatCommonModule] });
|
495 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatButtonToggleModule, decorators: [{
|
496 | type: NgModule,
|
497 | args: [{
|
498 | imports: [MatCommonModule, MatRippleModule],
|
499 | exports: [MatCommonModule, MatButtonToggleGroup, MatButtonToggle],
|
500 | declarations: [MatButtonToggleGroup, MatButtonToggle],
|
501 | }]
|
502 | }] });
|
503 |
|
504 |
|
505 |
|
506 |
|
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 |
|
515 |
|
516 |
|
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 | export { MAT_BUTTON_TOGGLE_DEFAULT_OPTIONS, MAT_BUTTON_TOGGLE_GROUP, MAT_BUTTON_TOGGLE_GROUP_VALUE_ACCESSOR, MatButtonToggle, MatButtonToggleChange, MatButtonToggleGroup, MatButtonToggleModule };
|
525 |
|