1 | import * as i0 from '@angular/core';
|
2 | import { InjectionToken, forwardRef, EventEmitter, Directive, Output, Input, ContentChildren, ViewChild, Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, Inject, Attribute, NgModule } from '@angular/core';
|
3 | import * as i3 from '@angular/material/core';
|
4 | import { mixinDisableRipple, mixinTabIndex, MatRippleModule, MatCommonModule } from '@angular/material/core';
|
5 | import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
|
6 | import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
7 | import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
|
8 | import * as i1 from '@angular/cdk/a11y';
|
9 | import * as i2 from '@angular/cdk/collections';
|
10 |
|
11 | const MAT_RADIO_DEFAULT_OPTIONS = new InjectionToken('mat-radio-default-options', {
|
12 | providedIn: 'root',
|
13 | factory: MAT_RADIO_DEFAULT_OPTIONS_FACTORY,
|
14 | });
|
15 | function MAT_RADIO_DEFAULT_OPTIONS_FACTORY() {
|
16 | return {
|
17 | color: 'accent',
|
18 | };
|
19 | }
|
20 |
|
21 | let nextUniqueId = 0;
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 | const MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {
|
28 | provide: NG_VALUE_ACCESSOR,
|
29 | useExisting: forwardRef(() => MatRadioGroup),
|
30 | multi: true,
|
31 | };
|
32 |
|
33 | class MatRadioChange {
|
34 | constructor(
|
35 | /** The MatRadioButton that emits the change event. */
|
36 | source,
|
37 | /** The value of the MatRadioButton. */
|
38 | value) {
|
39 | this.source = source;
|
40 | this.value = value;
|
41 | }
|
42 | }
|
43 |
|
44 |
|
45 |
|
46 |
|
47 |
|
48 | const MAT_RADIO_GROUP = new InjectionToken('MatRadioGroup');
|
49 |
|
50 |
|
51 |
|
52 |
|
53 | class _MatRadioGroupBase {
|
54 | constructor(_changeDetector) {
|
55 | this._changeDetector = _changeDetector;
|
56 |
|
57 | this._value = null;
|
58 |
|
59 | this._name = `mat-radio-group-${nextUniqueId++}`;
|
60 |
|
61 | this._selected = null;
|
62 |
|
63 | this._isInitialized = false;
|
64 |
|
65 | this._labelPosition = 'after';
|
66 |
|
67 | this._disabled = false;
|
68 |
|
69 | this._required = false;
|
70 |
|
71 | this._controlValueAccessorChangeFn = () => { };
|
72 | |
73 |
|
74 |
|
75 |
|
76 | this.onTouched = () => { };
|
77 | |
78 |
|
79 |
|
80 |
|
81 |
|
82 | this.change = new EventEmitter();
|
83 | }
|
84 |
|
85 | get name() {
|
86 | return this._name;
|
87 | }
|
88 | set name(value) {
|
89 | this._name = value;
|
90 | this._updateRadioButtonNames();
|
91 | }
|
92 |
|
93 | get labelPosition() {
|
94 | return this._labelPosition;
|
95 | }
|
96 | set labelPosition(v) {
|
97 | this._labelPosition = v === 'before' ? 'before' : 'after';
|
98 | this._markRadiosForCheck();
|
99 | }
|
100 | |
101 |
|
102 |
|
103 |
|
104 |
|
105 |
|
106 | get value() {
|
107 | return this._value;
|
108 | }
|
109 | set value(newValue) {
|
110 | if (this._value !== newValue) {
|
111 |
|
112 | this._value = newValue;
|
113 | this._updateSelectedRadioFromValue();
|
114 | this._checkSelectedRadioButton();
|
115 | }
|
116 | }
|
117 | _checkSelectedRadioButton() {
|
118 | if (this._selected && !this._selected.checked) {
|
119 | this._selected.checked = true;
|
120 | }
|
121 | }
|
122 | |
123 |
|
124 |
|
125 |
|
126 | get selected() {
|
127 | return this._selected;
|
128 | }
|
129 | set selected(selected) {
|
130 | this._selected = selected;
|
131 | this.value = selected ? selected.value : null;
|
132 | this._checkSelectedRadioButton();
|
133 | }
|
134 |
|
135 | get disabled() {
|
136 | return this._disabled;
|
137 | }
|
138 | set disabled(value) {
|
139 | this._disabled = coerceBooleanProperty(value);
|
140 | this._markRadiosForCheck();
|
141 | }
|
142 |
|
143 | get required() {
|
144 | return this._required;
|
145 | }
|
146 | set required(value) {
|
147 | this._required = coerceBooleanProperty(value);
|
148 | this._markRadiosForCheck();
|
149 | }
|
150 | |
151 |
|
152 |
|
153 |
|
154 | ngAfterContentInit() {
|
155 |
|
156 |
|
157 |
|
158 | this._isInitialized = true;
|
159 | }
|
160 | |
161 |
|
162 |
|
163 |
|
164 | _touch() {
|
165 | if (this.onTouched) {
|
166 | this.onTouched();
|
167 | }
|
168 | }
|
169 | _updateRadioButtonNames() {
|
170 | if (this._radios) {
|
171 | this._radios.forEach(radio => {
|
172 | radio.name = this.name;
|
173 | radio._markForCheck();
|
174 | });
|
175 | }
|
176 | }
|
177 |
|
178 | _updateSelectedRadioFromValue() {
|
179 |
|
180 | const isAlreadySelected = this._selected !== null && this._selected.value === this._value;
|
181 | if (this._radios && !isAlreadySelected) {
|
182 | this._selected = null;
|
183 | this._radios.forEach(radio => {
|
184 | radio.checked = this.value === radio.value;
|
185 | if (radio.checked) {
|
186 | this._selected = radio;
|
187 | }
|
188 | });
|
189 | }
|
190 | }
|
191 |
|
192 | _emitChangeEvent() {
|
193 | if (this._isInitialized) {
|
194 | this.change.emit(new MatRadioChange(this._selected, this._value));
|
195 | }
|
196 | }
|
197 | _markRadiosForCheck() {
|
198 | if (this._radios) {
|
199 | this._radios.forEach(radio => radio._markForCheck());
|
200 | }
|
201 | }
|
202 | |
203 |
|
204 |
|
205 |
|
206 | writeValue(value) {
|
207 | this.value = value;
|
208 | this._changeDetector.markForCheck();
|
209 | }
|
210 | |
211 |
|
212 |
|
213 |
|
214 |
|
215 | registerOnChange(fn) {
|
216 | this._controlValueAccessorChangeFn = fn;
|
217 | }
|
218 | |
219 |
|
220 |
|
221 |
|
222 |
|
223 | registerOnTouched(fn) {
|
224 | this.onTouched = fn;
|
225 | }
|
226 | |
227 |
|
228 |
|
229 |
|
230 | setDisabledState(isDisabled) {
|
231 | this.disabled = isDisabled;
|
232 | this._changeDetector.markForCheck();
|
233 | }
|
234 | }
|
235 | _MatRadioGroupBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: _MatRadioGroupBase, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
236 | _MatRadioGroupBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: _MatRadioGroupBase, inputs: { color: "color", name: "name", labelPosition: "labelPosition", value: "value", selected: "selected", disabled: "disabled", required: "required" }, outputs: { change: "change" }, ngImport: i0 });
|
237 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: _MatRadioGroupBase, decorators: [{
|
238 | type: Directive
|
239 | }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { change: [{
|
240 | type: Output
|
241 | }], color: [{
|
242 | type: Input
|
243 | }], name: [{
|
244 | type: Input
|
245 | }], labelPosition: [{
|
246 | type: Input
|
247 | }], value: [{
|
248 | type: Input
|
249 | }], selected: [{
|
250 | type: Input
|
251 | }], disabled: [{
|
252 | type: Input
|
253 | }], required: [{
|
254 | type: Input
|
255 | }] } });
|
256 |
|
257 |
|
258 |
|
259 | class MatRadioGroup extends _MatRadioGroupBase {
|
260 | }
|
261 | MatRadioGroup.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatRadioGroup, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
262 | MatRadioGroup.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: MatRadioGroup, selector: "mat-radio-group", host: { attributes: { "role": "radiogroup" }, classAttribute: "mat-radio-group" }, providers: [
|
263 | MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,
|
264 | { provide: MAT_RADIO_GROUP, useExisting: MatRadioGroup },
|
265 | ], queries: [{ propertyName: "_radios", predicate: i0.forwardRef(function () { return MatRadioButton; }), descendants: true }], exportAs: ["matRadioGroup"], usesInheritance: true, ngImport: i0 });
|
266 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatRadioGroup, decorators: [{
|
267 | type: Directive,
|
268 | args: [{
|
269 | selector: 'mat-radio-group',
|
270 | exportAs: 'matRadioGroup',
|
271 | providers: [
|
272 | MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,
|
273 | { provide: MAT_RADIO_GROUP, useExisting: MatRadioGroup },
|
274 | ],
|
275 | host: {
|
276 | 'role': 'radiogroup',
|
277 | 'class': 'mat-radio-group',
|
278 | },
|
279 | }]
|
280 | }], propDecorators: { _radios: [{
|
281 | type: ContentChildren,
|
282 | args: [forwardRef(() => MatRadioButton), { descendants: true }]
|
283 | }] } });
|
284 |
|
285 |
|
286 | class MatRadioButtonBase {
|
287 | constructor(_elementRef) {
|
288 | this._elementRef = _elementRef;
|
289 | }
|
290 | }
|
291 | const _MatRadioButtonMixinBase = mixinDisableRipple(mixinTabIndex(MatRadioButtonBase));
|
292 |
|
293 |
|
294 |
|
295 |
|
296 | class _MatRadioButtonBase extends _MatRadioButtonMixinBase {
|
297 | constructor(radioGroup, elementRef, _changeDetector, _focusMonitor, _radioDispatcher, animationMode, _providerOverride, tabIndex) {
|
298 | super(elementRef);
|
299 | this._changeDetector = _changeDetector;
|
300 | this._focusMonitor = _focusMonitor;
|
301 | this._radioDispatcher = _radioDispatcher;
|
302 | this._providerOverride = _providerOverride;
|
303 | this._uniqueId = `mat-radio-${++nextUniqueId}`;
|
304 |
|
305 | this.id = this._uniqueId;
|
306 | |
307 |
|
308 |
|
309 |
|
310 |
|
311 | this.change = new EventEmitter();
|
312 |
|
313 | this._checked = false;
|
314 |
|
315 | this._value = null;
|
316 |
|
317 | this._removeUniqueSelectionListener = () => { };
|
318 |
|
319 |
|
320 | this.radioGroup = radioGroup;
|
321 | this._noopAnimations = animationMode === 'NoopAnimations';
|
322 | if (tabIndex) {
|
323 | this.tabIndex = coerceNumberProperty(tabIndex, 0);
|
324 | }
|
325 | this._removeUniqueSelectionListener = _radioDispatcher.listen((id, name) => {
|
326 | if (id !== this.id && name === this.name) {
|
327 | this.checked = false;
|
328 | }
|
329 | });
|
330 | }
|
331 |
|
332 | get checked() {
|
333 | return this._checked;
|
334 | }
|
335 | set checked(value) {
|
336 | const newCheckedState = coerceBooleanProperty(value);
|
337 | if (this._checked !== newCheckedState) {
|
338 | this._checked = newCheckedState;
|
339 | if (newCheckedState && this.radioGroup && this.radioGroup.value !== this.value) {
|
340 | this.radioGroup.selected = this;
|
341 | }
|
342 | else if (!newCheckedState && this.radioGroup && this.radioGroup.value === this.value) {
|
343 |
|
344 |
|
345 | this.radioGroup.selected = null;
|
346 | }
|
347 | if (newCheckedState) {
|
348 |
|
349 | this._radioDispatcher.notify(this.id, this.name);
|
350 | }
|
351 | this._changeDetector.markForCheck();
|
352 | }
|
353 | }
|
354 |
|
355 | get value() {
|
356 | return this._value;
|
357 | }
|
358 | set value(value) {
|
359 | if (this._value !== value) {
|
360 | this._value = value;
|
361 | if (this.radioGroup !== null) {
|
362 | if (!this.checked) {
|
363 |
|
364 | this.checked = this.radioGroup.value === value;
|
365 | }
|
366 | if (this.checked) {
|
367 | this.radioGroup.selected = this;
|
368 | }
|
369 | }
|
370 | }
|
371 | }
|
372 |
|
373 | get labelPosition() {
|
374 | return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';
|
375 | }
|
376 | set labelPosition(value) {
|
377 | this._labelPosition = value;
|
378 | }
|
379 |
|
380 | get disabled() {
|
381 | return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);
|
382 | }
|
383 | set disabled(value) {
|
384 | this._setDisabled(coerceBooleanProperty(value));
|
385 | }
|
386 |
|
387 | get required() {
|
388 | return this._required || (this.radioGroup && this.radioGroup.required);
|
389 | }
|
390 | set required(value) {
|
391 | this._required = coerceBooleanProperty(value);
|
392 | }
|
393 |
|
394 | get color() {
|
395 |
|
396 |
|
397 | return (this._color ||
|
398 | (this.radioGroup && this.radioGroup.color) ||
|
399 | (this._providerOverride && this._providerOverride.color) ||
|
400 | 'accent');
|
401 | }
|
402 | set color(newValue) {
|
403 | this._color = newValue;
|
404 | }
|
405 |
|
406 | get inputId() {
|
407 | return `${this.id || this._uniqueId}-input`;
|
408 | }
|
409 |
|
410 | focus(options, origin) {
|
411 | if (origin) {
|
412 | this._focusMonitor.focusVia(this._inputElement, origin, options);
|
413 | }
|
414 | else {
|
415 | this._inputElement.nativeElement.focus(options);
|
416 | }
|
417 | }
|
418 | |
419 |
|
420 |
|
421 |
|
422 |
|
423 | _markForCheck() {
|
424 |
|
425 |
|
426 | this._changeDetector.markForCheck();
|
427 | }
|
428 | ngOnInit() {
|
429 | if (this.radioGroup) {
|
430 |
|
431 | this.checked = this.radioGroup.value === this._value;
|
432 | if (this.checked) {
|
433 | this.radioGroup.selected = this;
|
434 | }
|
435 |
|
436 | this.name = this.radioGroup.name;
|
437 | }
|
438 | }
|
439 | ngDoCheck() {
|
440 | this._updateTabIndex();
|
441 | }
|
442 | ngAfterViewInit() {
|
443 | this._updateTabIndex();
|
444 | this._focusMonitor.monitor(this._elementRef, true).subscribe(focusOrigin => {
|
445 | if (!focusOrigin && this.radioGroup) {
|
446 | this.radioGroup._touch();
|
447 | }
|
448 | });
|
449 | }
|
450 | ngOnDestroy() {
|
451 | this._focusMonitor.stopMonitoring(this._elementRef);
|
452 | this._removeUniqueSelectionListener();
|
453 | }
|
454 |
|
455 | _emitChangeEvent() {
|
456 | this.change.emit(new MatRadioChange(this, this._value));
|
457 | }
|
458 | _isRippleDisabled() {
|
459 | return this.disableRipple || this.disabled;
|
460 | }
|
461 | _onInputClick(event) {
|
462 |
|
463 |
|
464 |
|
465 |
|
466 |
|
467 |
|
468 |
|
469 | event.stopPropagation();
|
470 | }
|
471 |
|
472 | _onInputInteraction(event) {
|
473 |
|
474 |
|
475 |
|
476 | event.stopPropagation();
|
477 | if (!this.checked && !this.disabled) {
|
478 | const groupValueChanged = this.radioGroup && this.value !== this.radioGroup.value;
|
479 | this.checked = true;
|
480 | this._emitChangeEvent();
|
481 | if (this.radioGroup) {
|
482 | this.radioGroup._controlValueAccessorChangeFn(this.value);
|
483 | if (groupValueChanged) {
|
484 | this.radioGroup._emitChangeEvent();
|
485 | }
|
486 | }
|
487 | }
|
488 | }
|
489 |
|
490 | _setDisabled(value) {
|
491 | if (this._disabled !== value) {
|
492 | this._disabled = value;
|
493 | this._changeDetector.markForCheck();
|
494 | }
|
495 | }
|
496 |
|
497 | _updateTabIndex() {
|
498 | var _a;
|
499 | const group = this.radioGroup;
|
500 | let value;
|
501 |
|
502 |
|
503 |
|
504 |
|
505 | if (!group || !group.selected || this.disabled) {
|
506 | value = this.tabIndex;
|
507 | }
|
508 | else {
|
509 | value = group.selected === this ? this.tabIndex : -1;
|
510 | }
|
511 | if (value !== this._previousTabIndex) {
|
512 |
|
513 |
|
514 | const input = (_a = this._inputElement) === null || _a === void 0 ? void 0 : _a.nativeElement;
|
515 | if (input) {
|
516 | input.setAttribute('tabindex', value + '');
|
517 | this._previousTabIndex = value;
|
518 | }
|
519 | }
|
520 | }
|
521 | }
|
522 | _MatRadioButtonBase.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: _MatRadioButtonBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive });
|
523 | _MatRadioButtonBase.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.1", type: _MatRadioButtonBase, inputs: { id: "id", name: "name", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], ariaDescribedby: ["aria-describedby", "ariaDescribedby"], checked: "checked", value: "value", labelPosition: "labelPosition", disabled: "disabled", required: "required", color: "color" }, outputs: { change: "change" }, viewQueries: [{ propertyName: "_inputElement", first: true, predicate: ["input"], descendants: true }], usesInheritance: true, ngImport: i0 });
|
524 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: _MatRadioButtonBase, decorators: [{
|
525 | type: Directive
|
526 | }], ctorParameters: function () { return [{ type: _MatRadioGroupBase }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.FocusMonitor }, { type: i2.UniqueSelectionDispatcher }, { type: undefined }, { type: undefined }, { type: undefined }]; }, propDecorators: { id: [{
|
527 | type: Input
|
528 | }], name: [{
|
529 | type: Input
|
530 | }], ariaLabel: [{
|
531 | type: Input,
|
532 | args: ['aria-label']
|
533 | }], ariaLabelledby: [{
|
534 | type: Input,
|
535 | args: ['aria-labelledby']
|
536 | }], ariaDescribedby: [{
|
537 | type: Input,
|
538 | args: ['aria-describedby']
|
539 | }], checked: [{
|
540 | type: Input
|
541 | }], value: [{
|
542 | type: Input
|
543 | }], labelPosition: [{
|
544 | type: Input
|
545 | }], disabled: [{
|
546 | type: Input
|
547 | }], required: [{
|
548 | type: Input
|
549 | }], color: [{
|
550 | type: Input
|
551 | }], change: [{
|
552 | type: Output
|
553 | }], _inputElement: [{
|
554 | type: ViewChild,
|
555 | args: ['input']
|
556 | }] } });
|
557 |
|
558 |
|
559 |
|
560 | class MatRadioButton extends _MatRadioButtonBase {
|
561 | constructor(radioGroup, elementRef, changeDetector, focusMonitor, radioDispatcher, animationMode, providerOverride, tabIndex) {
|
562 | super(radioGroup, elementRef, changeDetector, focusMonitor, radioDispatcher, animationMode, providerOverride, tabIndex);
|
563 | }
|
564 | }
|
565 | MatRadioButton.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatRadioButton, deps: [{ token: MAT_RADIO_GROUP, optional: true }, { token: i0.ElementRef }, { token: i0.ChangeDetectorRef }, { token: i1.FocusMonitor }, { token: i2.UniqueSelectionDispatcher }, { token: ANIMATION_MODULE_TYPE, optional: true }, { token: MAT_RADIO_DEFAULT_OPTIONS, optional: true }, { token: 'tabindex', attribute: true }], target: i0.ɵɵFactoryTarget.Component });
|
566 | MatRadioButton.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.1", type: MatRadioButton, selector: "mat-radio-button", inputs: { disableRipple: "disableRipple", tabIndex: "tabIndex" }, host: { listeners: { "focus": "_inputElement.nativeElement.focus()" }, properties: { "class.mat-radio-checked": "checked", "class.mat-radio-disabled": "disabled", "class._mat-animation-noopable": "_noopAnimations", "class.mat-primary": "color === \"primary\"", "class.mat-accent": "color === \"accent\"", "class.mat-warn": "color === \"warn\"", "attr.tabindex": "null", "attr.id": "id", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null" }, classAttribute: "mat-radio-button" }, exportAs: ["matRadioButton"], usesInheritance: true, ngImport: i0, template: "<!-- TODO(jelbourn): render the radio on either side of the content -->\n<!-- TODO(mtlin): Evaluate trade-offs of using native radio vs. cost of additional bindings. -->\n<label [attr.for]=\"inputId\" class=\"mat-radio-label\" #label>\n <!-- The actual 'radio' part of the control. -->\n <span class=\"mat-radio-container\">\n <span class=\"mat-radio-outer-circle\"></span>\n <span class=\"mat-radio-inner-circle\"></span>\n <input #input class=\"mat-radio-input\" type=\"radio\"\n [id]=\"inputId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n (change)=\"_onInputInteraction($event)\"\n (click)=\"_onInputClick($event)\">\n\n <!-- The ripple comes after the input so that we can target it with a CSS\n sibling selector when the input is focused. -->\n <span mat-ripple class=\"mat-radio-ripple mat-focus-indicator\"\n [matRippleTrigger]=\"label\"\n [matRippleDisabled]=\"_isRippleDisabled()\"\n [matRippleCentered]=\"true\"\n [matRippleRadius]=\"20\"\n [matRippleAnimation]=\"{enterDuration: _noopAnimations ? 0 : 150}\">\n\n <span class=\"mat-ripple-element mat-radio-persistent-ripple\"></span>\n </span>\n </span>\n\n <!-- The label content for radio control. -->\n <span class=\"mat-radio-label-content\" [class.mat-radio-label-before]=\"labelPosition == 'before'\">\n <!-- Add an invisible span so JAWS can read the label -->\n <span style=\"display:none\"> </span>\n <ng-content></ng-content>\n </span>\n</label>\n", styles: [".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-radio-label{-webkit-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{opacity:0;position:absolute;top:0;left:0;margin:0;width:100%;height:100%;cursor:inherit;z-index:-1}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}"], dependencies: [{ kind: "directive", type: i3.MatRipple, selector: "[mat-ripple], [matRipple]", inputs: ["matRippleColor", "matRippleUnbounded", "matRippleCentered", "matRippleRadius", "matRippleAnimation", "matRippleDisabled", "matRippleTrigger"], exportAs: ["matRipple"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
567 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatRadioButton, decorators: [{
|
568 | type: Component,
|
569 | args: [{ selector: 'mat-radio-button', inputs: ['disableRipple', 'tabIndex'], encapsulation: ViewEncapsulation.None, exportAs: 'matRadioButton', host: {
|
570 | 'class': 'mat-radio-button',
|
571 | '[class.mat-radio-checked]': 'checked',
|
572 | '[class.mat-radio-disabled]': 'disabled',
|
573 | '[class._mat-animation-noopable]': '_noopAnimations',
|
574 | '[class.mat-primary]': 'color === "primary"',
|
575 | '[class.mat-accent]': 'color === "accent"',
|
576 | '[class.mat-warn]': 'color === "warn"',
|
577 |
|
578 | '[attr.tabindex]': 'null',
|
579 | '[attr.id]': 'id',
|
580 | '[attr.aria-label]': 'null',
|
581 | '[attr.aria-labelledby]': 'null',
|
582 | '[attr.aria-describedby]': 'null',
|
583 |
|
584 |
|
585 |
|
586 | '(focus)': '_inputElement.nativeElement.focus()',
|
587 | }, changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- TODO(jelbourn): render the radio on either side of the content -->\n<!-- TODO(mtlin): Evaluate trade-offs of using native radio vs. cost of additional bindings. -->\n<label [attr.for]=\"inputId\" class=\"mat-radio-label\" #label>\n <!-- The actual 'radio' part of the control. -->\n <span class=\"mat-radio-container\">\n <span class=\"mat-radio-outer-circle\"></span>\n <span class=\"mat-radio-inner-circle\"></span>\n <input #input class=\"mat-radio-input\" type=\"radio\"\n [id]=\"inputId\"\n [checked]=\"checked\"\n [disabled]=\"disabled\"\n [attr.name]=\"name\"\n [attr.value]=\"value\"\n [required]=\"required\"\n [attr.aria-label]=\"ariaLabel\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n (change)=\"_onInputInteraction($event)\"\n (click)=\"_onInputClick($event)\">\n\n <!-- The ripple comes after the input so that we can target it with a CSS\n sibling selector when the input is focused. -->\n <span mat-ripple class=\"mat-radio-ripple mat-focus-indicator\"\n [matRippleTrigger]=\"label\"\n [matRippleDisabled]=\"_isRippleDisabled()\"\n [matRippleCentered]=\"true\"\n [matRippleRadius]=\"20\"\n [matRippleAnimation]=\"{enterDuration: _noopAnimations ? 0 : 150}\">\n\n <span class=\"mat-ripple-element mat-radio-persistent-ripple\"></span>\n </span>\n </span>\n\n <!-- The label content for radio control. -->\n <span class=\"mat-radio-label-content\" [class.mat-radio-label-before]=\"labelPosition == 'before'\">\n <!-- Add an invisible span so JAWS can read the label -->\n <span style=\"display:none\"> </span>\n <ng-content></ng-content>\n </span>\n</label>\n", styles: [".mat-radio-button{display:inline-block;-webkit-tap-highlight-color:rgba(0,0,0,0);outline:0}.mat-radio-label{-webkit-user-select:none;user-select:none;cursor:pointer;display:inline-flex;align-items:center;white-space:nowrap;vertical-align:middle;width:100%}.mat-radio-container{box-sizing:border-box;display:inline-block;position:relative;width:20px;height:20px;flex-shrink:0}.mat-radio-outer-circle{box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;transition:border-color ease 280ms;width:20px;border-width:2px;border-style:solid;border-radius:50%}._mat-animation-noopable .mat-radio-outer-circle{transition:none}.mat-radio-inner-circle{border-radius:50%;box-sizing:border-box;display:block;height:20px;left:0;position:absolute;top:0;opacity:0;transition:transform ease 280ms,background-color ease 280ms,opacity linear 1ms 280ms;width:20px;transform:scale(0.001);-webkit-print-color-adjust:exact;color-adjust:exact}.mat-radio-checked .mat-radio-inner-circle{transform:scale(0.5);opacity:1;transition:transform ease 280ms,background-color ease 280ms}.cdk-high-contrast-active .mat-radio-checked .mat-radio-inner-circle{border:solid 10px}._mat-animation-noopable .mat-radio-inner-circle{transition:none}.mat-radio-label-content{-webkit-user-select:auto;user-select:auto;display:inline-block;order:0;line-height:inherit;padding-left:8px;padding-right:0}[dir=rtl] .mat-radio-label-content{padding-right:8px;padding-left:0}.mat-radio-label-content.mat-radio-label-before{order:-1;padding-left:0;padding-right:8px}[dir=rtl] .mat-radio-label-content.mat-radio-label-before{padding-right:0;padding-left:8px}.mat-radio-disabled,.mat-radio-disabled .mat-radio-label{cursor:default}.mat-radio-button .mat-radio-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.mat-radio-button .mat-radio-ripple .mat-ripple-element:not(.mat-radio-persistent-ripple){opacity:.16}.mat-radio-persistent-ripple{width:100%;height:100%;transform:none;top:0;left:0}.mat-radio-container:hover .mat-radio-persistent-ripple{opacity:.04}.mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-persistent-ripple,.mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-persistent-ripple{opacity:.12}.mat-radio-persistent-ripple,.mat-radio-disabled .mat-radio-container:hover .mat-radio-persistent-ripple{opacity:0}@media(hover: none){.mat-radio-container:hover .mat-radio-persistent-ripple{display:none}}.mat-radio-input{opacity:0;position:absolute;top:0;left:0;margin:0;width:100%;height:100%;cursor:inherit;z-index:-1}.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-keyboard-focused .mat-radio-ripple,.cdk-high-contrast-active .mat-radio-button:not(.mat-radio-disabled).cdk-program-focused .mat-radio-ripple{outline:solid 3px}.cdk-high-contrast-active .mat-radio-disabled{opacity:.5}"] }]
|
588 | }], ctorParameters: function () {
|
589 | return [{ type: MatRadioGroup, decorators: [{
|
590 | type: Optional
|
591 | }, {
|
592 | type: Inject,
|
593 | args: [MAT_RADIO_GROUP]
|
594 | }] }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.FocusMonitor }, { type: i2.UniqueSelectionDispatcher }, { type: undefined, decorators: [{
|
595 | type: Optional
|
596 | }, {
|
597 | type: Inject,
|
598 | args: [ANIMATION_MODULE_TYPE]
|
599 | }] }, { type: undefined, decorators: [{
|
600 | type: Optional
|
601 | }, {
|
602 | type: Inject,
|
603 | args: [MAT_RADIO_DEFAULT_OPTIONS]
|
604 | }] }, { type: undefined, decorators: [{
|
605 | type: Attribute,
|
606 | args: ['tabindex']
|
607 | }] }];
|
608 | } });
|
609 |
|
610 |
|
611 |
|
612 |
|
613 |
|
614 |
|
615 |
|
616 |
|
617 | class MatRadioModule {
|
618 | }
|
619 | MatRadioModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
620 | MatRadioModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.0.1", ngImport: i0, type: MatRadioModule, declarations: [MatRadioGroup, MatRadioButton], imports: [MatRippleModule, MatCommonModule], exports: [MatRadioGroup, MatRadioButton, MatCommonModule] });
|
621 | MatRadioModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatRadioModule, imports: [MatRippleModule, MatCommonModule, MatCommonModule] });
|
622 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.1", ngImport: i0, type: MatRadioModule, decorators: [{
|
623 | type: NgModule,
|
624 | args: [{
|
625 | imports: [MatRippleModule, MatCommonModule],
|
626 | exports: [MatRadioGroup, MatRadioButton, MatCommonModule],
|
627 | declarations: [MatRadioGroup, MatRadioButton],
|
628 | }]
|
629 | }] });
|
630 |
|
631 |
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 |
|
638 |
|
639 |
|
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 |
|
646 |
|
647 |
|
648 |
|
649 |
|
650 |
|
651 | export { MAT_RADIO_DEFAULT_OPTIONS, MAT_RADIO_DEFAULT_OPTIONS_FACTORY, MAT_RADIO_GROUP, MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, MatRadioButton, MatRadioChange, MatRadioGroup, MatRadioModule, _MatRadioButtonBase, _MatRadioGroupBase };
|
652 |
|