radio.mjs 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. import * as i0 from '@angular/core';
  2. import { forwardRef, InjectionToken, EventEmitter, Directive, Output, Input, ViewChild, ContentChildren, Component, ViewEncapsulation, ChangeDetectionStrategy, Optional, Inject, Attribute, NgModule } from '@angular/core';
  3. import * as i3 from '@angular/material/core';
  4. import { mixinDisableRipple, mixinTabIndex, MatCommonModule, MatRippleModule } from '@angular/material/core';
  5. import * as i1 from '@angular/cdk/a11y';
  6. import { coerceBooleanProperty, coerceNumberProperty } from '@angular/cdk/coercion';
  7. import * as i2 from '@angular/cdk/collections';
  8. import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
  9. import { NG_VALUE_ACCESSOR } from '@angular/forms';
  10. import { CommonModule } from '@angular/common';
  11. // Increasing integer for generating unique ids for radio components.
  12. let nextUniqueId = 0;
  13. /** Change event object emitted by radio button and radio group. */
  14. class MatRadioChange {
  15. constructor(
  16. /** The radio button that emits the change event. */
  17. source,
  18. /** The value of the radio button. */
  19. value) {
  20. this.source = source;
  21. this.value = value;
  22. }
  23. }
  24. /**
  25. * Provider Expression that allows mat-radio-group to register as a ControlValueAccessor. This
  26. * allows it to support [(ngModel)] and ngControl.
  27. * @docs-private
  28. */
  29. const MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR = {
  30. provide: NG_VALUE_ACCESSOR,
  31. useExisting: forwardRef(() => MatRadioGroup),
  32. multi: true,
  33. };
  34. /**
  35. * Injection token that can be used to inject instances of `MatRadioGroup`. It serves as
  36. * alternative token to the actual `MatRadioGroup` class which could cause unnecessary
  37. * retention of the class and its component metadata.
  38. */
  39. const MAT_RADIO_GROUP = new InjectionToken('MatRadioGroup');
  40. const MAT_RADIO_DEFAULT_OPTIONS = new InjectionToken('mat-radio-default-options', {
  41. providedIn: 'root',
  42. factory: MAT_RADIO_DEFAULT_OPTIONS_FACTORY,
  43. });
  44. function MAT_RADIO_DEFAULT_OPTIONS_FACTORY() {
  45. return {
  46. color: 'accent',
  47. };
  48. }
  49. /**
  50. * Base class with all of the `MatRadioGroup` functionality.
  51. * @docs-private
  52. */
  53. class _MatRadioGroupBase {
  54. /** Name of the radio button group. All radio buttons inside this group will use this name. */
  55. get name() {
  56. return this._name;
  57. }
  58. set name(value) {
  59. this._name = value;
  60. this._updateRadioButtonNames();
  61. }
  62. /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */
  63. get labelPosition() {
  64. return this._labelPosition;
  65. }
  66. set labelPosition(v) {
  67. this._labelPosition = v === 'before' ? 'before' : 'after';
  68. this._markRadiosForCheck();
  69. }
  70. /**
  71. * Value for the radio-group. Should equal the value of the selected radio button if there is
  72. * a corresponding radio button with a matching value. If there is not such a corresponding
  73. * radio button, this value persists to be applied in case a new radio button is added with a
  74. * matching value.
  75. */
  76. get value() {
  77. return this._value;
  78. }
  79. set value(newValue) {
  80. if (this._value !== newValue) {
  81. // Set this before proceeding to ensure no circular loop occurs with selection.
  82. this._value = newValue;
  83. this._updateSelectedRadioFromValue();
  84. this._checkSelectedRadioButton();
  85. }
  86. }
  87. _checkSelectedRadioButton() {
  88. if (this._selected && !this._selected.checked) {
  89. this._selected.checked = true;
  90. }
  91. }
  92. /**
  93. * The currently selected radio button. If set to a new radio button, the radio group value
  94. * will be updated to match the new selected button.
  95. */
  96. get selected() {
  97. return this._selected;
  98. }
  99. set selected(selected) {
  100. this._selected = selected;
  101. this.value = selected ? selected.value : null;
  102. this._checkSelectedRadioButton();
  103. }
  104. /** Whether the radio group is disabled */
  105. get disabled() {
  106. return this._disabled;
  107. }
  108. set disabled(value) {
  109. this._disabled = coerceBooleanProperty(value);
  110. this._markRadiosForCheck();
  111. }
  112. /** Whether the radio group is required */
  113. get required() {
  114. return this._required;
  115. }
  116. set required(value) {
  117. this._required = coerceBooleanProperty(value);
  118. this._markRadiosForCheck();
  119. }
  120. constructor(_changeDetector) {
  121. this._changeDetector = _changeDetector;
  122. /** Selected value for the radio group. */
  123. this._value = null;
  124. /** The HTML name attribute applied to radio buttons in this group. */
  125. this._name = `mat-radio-group-${nextUniqueId++}`;
  126. /** The currently selected radio button. Should match value. */
  127. this._selected = null;
  128. /** Whether the `value` has been set to its initial value. */
  129. this._isInitialized = false;
  130. /** Whether the labels should appear after or before the radio-buttons. Defaults to 'after' */
  131. this._labelPosition = 'after';
  132. /** Whether the radio group is disabled. */
  133. this._disabled = false;
  134. /** Whether the radio group is required. */
  135. this._required = false;
  136. /** The method to be called in order to update ngModel */
  137. this._controlValueAccessorChangeFn = () => { };
  138. /**
  139. * onTouch function registered via registerOnTouch (ControlValueAccessor).
  140. * @docs-private
  141. */
  142. this.onTouched = () => { };
  143. /**
  144. * Event emitted when the group value changes.
  145. * Change events are only emitted when the value changes due to user interaction with
  146. * a radio button (the same behavior as `<input type-"radio">`).
  147. */
  148. this.change = new EventEmitter();
  149. }
  150. /**
  151. * Initialize properties once content children are available.
  152. * This allows us to propagate relevant attributes to associated buttons.
  153. */
  154. ngAfterContentInit() {
  155. // Mark this component as initialized in AfterContentInit because the initial value can
  156. // possibly be set by NgModel on MatRadioGroup, and it is possible that the OnInit of the
  157. // NgModel occurs *after* the OnInit of the MatRadioGroup.
  158. this._isInitialized = true;
  159. }
  160. /**
  161. * Mark this group as being "touched" (for ngModel). Meant to be called by the contained
  162. * radio buttons upon their blur.
  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. /** Updates the `selected` radio button from the internal _value state. */
  178. _updateSelectedRadioFromValue() {
  179. // If the value already matches the selected radio, do nothing.
  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. /** Dispatch change event with current selection and group value. */
  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. * Sets the model value. Implemented as part of ControlValueAccessor.
  204. * @param value
  205. */
  206. writeValue(value) {
  207. this.value = value;
  208. this._changeDetector.markForCheck();
  209. }
  210. /**
  211. * Registers a callback to be triggered when the model value changes.
  212. * Implemented as part of ControlValueAccessor.
  213. * @param fn Callback to be registered.
  214. */
  215. registerOnChange(fn) {
  216. this._controlValueAccessorChangeFn = fn;
  217. }
  218. /**
  219. * Registers a callback to be triggered when the control is touched.
  220. * Implemented as part of ControlValueAccessor.
  221. * @param fn Callback to be registered.
  222. */
  223. registerOnTouched(fn) {
  224. this.onTouched = fn;
  225. }
  226. /**
  227. * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor.
  228. * @param isDisabled Whether the control should be disabled.
  229. */
  230. setDisabledState(isDisabled) {
  231. this.disabled = isDisabled;
  232. this._changeDetector.markForCheck();
  233. }
  234. static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: _MatRadioGroupBase, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive }); }
  235. static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: _MatRadioGroupBase, inputs: { color: "color", name: "name", labelPosition: "labelPosition", value: "value", selected: "selected", disabled: "disabled", required: "required" }, outputs: { change: "change" }, ngImport: i0 }); }
  236. }
  237. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", 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. // Boilerplate for applying mixins to MatRadioButton.
  257. /** @docs-private */
  258. class MatRadioButtonBase {
  259. constructor(_elementRef) {
  260. this._elementRef = _elementRef;
  261. }
  262. }
  263. const _MatRadioButtonMixinBase = mixinDisableRipple(mixinTabIndex(MatRadioButtonBase));
  264. /**
  265. * Base class with all of the `MatRadioButton` functionality.
  266. * @docs-private
  267. */
  268. class _MatRadioButtonBase extends _MatRadioButtonMixinBase {
  269. /** Whether this radio button is checked. */
  270. get checked() {
  271. return this._checked;
  272. }
  273. set checked(value) {
  274. const newCheckedState = coerceBooleanProperty(value);
  275. if (this._checked !== newCheckedState) {
  276. this._checked = newCheckedState;
  277. if (newCheckedState && this.radioGroup && this.radioGroup.value !== this.value) {
  278. this.radioGroup.selected = this;
  279. }
  280. else if (!newCheckedState && this.radioGroup && this.radioGroup.value === this.value) {
  281. // When unchecking the selected radio button, update the selected radio
  282. // property on the group.
  283. this.radioGroup.selected = null;
  284. }
  285. if (newCheckedState) {
  286. // Notify all radio buttons with the same name to un-check.
  287. this._radioDispatcher.notify(this.id, this.name);
  288. }
  289. this._changeDetector.markForCheck();
  290. }
  291. }
  292. /** The value of this radio button. */
  293. get value() {
  294. return this._value;
  295. }
  296. set value(value) {
  297. if (this._value !== value) {
  298. this._value = value;
  299. if (this.radioGroup !== null) {
  300. if (!this.checked) {
  301. // Update checked when the value changed to match the radio group's value
  302. this.checked = this.radioGroup.value === value;
  303. }
  304. if (this.checked) {
  305. this.radioGroup.selected = this;
  306. }
  307. }
  308. }
  309. }
  310. /** Whether the label should appear after or before the radio button. Defaults to 'after' */
  311. get labelPosition() {
  312. return this._labelPosition || (this.radioGroup && this.radioGroup.labelPosition) || 'after';
  313. }
  314. set labelPosition(value) {
  315. this._labelPosition = value;
  316. }
  317. /** Whether the radio button is disabled. */
  318. get disabled() {
  319. return this._disabled || (this.radioGroup !== null && this.radioGroup.disabled);
  320. }
  321. set disabled(value) {
  322. this._setDisabled(coerceBooleanProperty(value));
  323. }
  324. /** Whether the radio button is required. */
  325. get required() {
  326. return this._required || (this.radioGroup && this.radioGroup.required);
  327. }
  328. set required(value) {
  329. this._required = coerceBooleanProperty(value);
  330. }
  331. /** Theme color of the radio button. */
  332. get color() {
  333. // As per Material design specifications the selection control radio should use the accent color
  334. // palette by default. https://material.io/guidelines/components/selection-controls.html
  335. return (this._color ||
  336. (this.radioGroup && this.radioGroup.color) ||
  337. (this._providerOverride && this._providerOverride.color) ||
  338. 'accent');
  339. }
  340. set color(newValue) {
  341. this._color = newValue;
  342. }
  343. /** ID of the native input element inside `<mat-radio-button>` */
  344. get inputId() {
  345. return `${this.id || this._uniqueId}-input`;
  346. }
  347. constructor(radioGroup, elementRef, _changeDetector, _focusMonitor, _radioDispatcher, animationMode, _providerOverride, tabIndex) {
  348. super(elementRef);
  349. this._changeDetector = _changeDetector;
  350. this._focusMonitor = _focusMonitor;
  351. this._radioDispatcher = _radioDispatcher;
  352. this._providerOverride = _providerOverride;
  353. this._uniqueId = `mat-radio-${++nextUniqueId}`;
  354. /** The unique ID for the radio button. */
  355. this.id = this._uniqueId;
  356. /**
  357. * Event emitted when the checked state of this radio button changes.
  358. * Change events are only emitted when the value changes due to user interaction with
  359. * the radio button (the same behavior as `<input type-"radio">`).
  360. */
  361. this.change = new EventEmitter();
  362. /** Whether this radio is checked. */
  363. this._checked = false;
  364. /** Value assigned to this radio. */
  365. this._value = null;
  366. /** Unregister function for _radioDispatcher */
  367. this._removeUniqueSelectionListener = () => { };
  368. // Assertions. Ideally these should be stripped out by the compiler.
  369. // TODO(jelbourn): Assert that there's no name binding AND a parent radio group.
  370. this.radioGroup = radioGroup;
  371. this._noopAnimations = animationMode === 'NoopAnimations';
  372. if (tabIndex) {
  373. this.tabIndex = coerceNumberProperty(tabIndex, 0);
  374. }
  375. }
  376. /** Focuses the radio button. */
  377. focus(options, origin) {
  378. if (origin) {
  379. this._focusMonitor.focusVia(this._inputElement, origin, options);
  380. }
  381. else {
  382. this._inputElement.nativeElement.focus(options);
  383. }
  384. }
  385. /**
  386. * Marks the radio button as needing checking for change detection.
  387. * This method is exposed because the parent radio group will directly
  388. * update bound properties of the radio button.
  389. */
  390. _markForCheck() {
  391. // When group value changes, the button will not be notified. Use `markForCheck` to explicit
  392. // update radio button's status
  393. this._changeDetector.markForCheck();
  394. }
  395. ngOnInit() {
  396. if (this.radioGroup) {
  397. // If the radio is inside a radio group, determine if it should be checked
  398. this.checked = this.radioGroup.value === this._value;
  399. if (this.checked) {
  400. this.radioGroup.selected = this;
  401. }
  402. // Copy name from parent radio group
  403. this.name = this.radioGroup.name;
  404. }
  405. this._removeUniqueSelectionListener = this._radioDispatcher.listen((id, name) => {
  406. if (id !== this.id && name === this.name) {
  407. this.checked = false;
  408. }
  409. });
  410. }
  411. ngDoCheck() {
  412. this._updateTabIndex();
  413. }
  414. ngAfterViewInit() {
  415. this._updateTabIndex();
  416. this._focusMonitor.monitor(this._elementRef, true).subscribe(focusOrigin => {
  417. if (!focusOrigin && this.radioGroup) {
  418. this.radioGroup._touch();
  419. }
  420. });
  421. }
  422. ngOnDestroy() {
  423. this._focusMonitor.stopMonitoring(this._elementRef);
  424. this._removeUniqueSelectionListener();
  425. }
  426. /** Dispatch change event with current value. */
  427. _emitChangeEvent() {
  428. this.change.emit(new MatRadioChange(this, this._value));
  429. }
  430. _isRippleDisabled() {
  431. return this.disableRipple || this.disabled;
  432. }
  433. _onInputClick(event) {
  434. // We have to stop propagation for click events on the visual hidden input element.
  435. // By default, when a user clicks on a label element, a generated click event will be
  436. // dispatched on the associated input element. Since we are using a label element as our
  437. // root container, the click event on the `radio-button` will be executed twice.
  438. // The real click event will bubble up, and the generated click event also tries to bubble up.
  439. // This will lead to multiple click events.
  440. // Preventing bubbling for the second event will solve that issue.
  441. event.stopPropagation();
  442. }
  443. /** Triggered when the radio button receives an interaction from the user. */
  444. _onInputInteraction(event) {
  445. // We always have to stop propagation on the change event.
  446. // Otherwise the change event, from the input element, will bubble up and
  447. // emit its event object to the `change` output.
  448. event.stopPropagation();
  449. if (!this.checked && !this.disabled) {
  450. const groupValueChanged = this.radioGroup && this.value !== this.radioGroup.value;
  451. this.checked = true;
  452. this._emitChangeEvent();
  453. if (this.radioGroup) {
  454. this.radioGroup._controlValueAccessorChangeFn(this.value);
  455. if (groupValueChanged) {
  456. this.radioGroup._emitChangeEvent();
  457. }
  458. }
  459. }
  460. }
  461. /** Triggered when the user clicks on the touch target. */
  462. _onTouchTargetClick(event) {
  463. this._onInputInteraction(event);
  464. if (!this.disabled) {
  465. // Normally the input should be focused already, but if the click
  466. // comes from the touch target, then we might have to focus it ourselves.
  467. this._inputElement.nativeElement.focus();
  468. }
  469. }
  470. /** Sets the disabled state and marks for check if a change occurred. */
  471. _setDisabled(value) {
  472. if (this._disabled !== value) {
  473. this._disabled = value;
  474. this._changeDetector.markForCheck();
  475. }
  476. }
  477. /** Gets the tabindex for the underlying input element. */
  478. _updateTabIndex() {
  479. const group = this.radioGroup;
  480. let value;
  481. // Implement a roving tabindex if the button is inside a group. For most cases this isn't
  482. // necessary, because the browser handles the tab order for inputs inside a group automatically,
  483. // but we need an explicitly higher tabindex for the selected button in order for things like
  484. // the focus trap to pick it up correctly.
  485. if (!group || !group.selected || this.disabled) {
  486. value = this.tabIndex;
  487. }
  488. else {
  489. value = group.selected === this ? this.tabIndex : -1;
  490. }
  491. if (value !== this._previousTabIndex) {
  492. // We have to set the tabindex directly on the DOM node, because it depends on
  493. // the selected state which is prone to "changed after checked errors".
  494. const input = this._inputElement?.nativeElement;
  495. if (input) {
  496. input.setAttribute('tabindex', value + '');
  497. this._previousTabIndex = value;
  498. }
  499. }
  500. }
  501. static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: _MatRadioButtonBase, deps: "invalid", target: i0.ɵɵFactoryTarget.Directive }); }
  502. static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", 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 }); }
  503. }
  504. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: _MatRadioButtonBase, decorators: [{
  505. type: Directive
  506. }], 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: [{
  507. type: Input
  508. }], name: [{
  509. type: Input
  510. }], ariaLabel: [{
  511. type: Input,
  512. args: ['aria-label']
  513. }], ariaLabelledby: [{
  514. type: Input,
  515. args: ['aria-labelledby']
  516. }], ariaDescribedby: [{
  517. type: Input,
  518. args: ['aria-describedby']
  519. }], checked: [{
  520. type: Input
  521. }], value: [{
  522. type: Input
  523. }], labelPosition: [{
  524. type: Input
  525. }], disabled: [{
  526. type: Input
  527. }], required: [{
  528. type: Input
  529. }], color: [{
  530. type: Input
  531. }], change: [{
  532. type: Output
  533. }], _inputElement: [{
  534. type: ViewChild,
  535. args: ['input']
  536. }] } });
  537. /**
  538. * A group of radio buttons. May contain one or more `<mat-radio-button>` elements.
  539. */
  540. class MatRadioGroup extends _MatRadioGroupBase {
  541. static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatRadioGroup, deps: null, target: i0.ɵɵFactoryTarget.Directive }); }
  542. static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.0.0", type: MatRadioGroup, selector: "mat-radio-group", host: { attributes: { "role": "radiogroup" }, classAttribute: "mat-mdc-radio-group" }, providers: [
  543. MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,
  544. { provide: MAT_RADIO_GROUP, useExisting: MatRadioGroup },
  545. ], queries: [{ propertyName: "_radios", predicate: i0.forwardRef(function () { return MatRadioButton; }), descendants: true }], exportAs: ["matRadioGroup"], usesInheritance: true, ngImport: i0 }); }
  546. }
  547. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatRadioGroup, decorators: [{
  548. type: Directive,
  549. args: [{
  550. selector: 'mat-radio-group',
  551. exportAs: 'matRadioGroup',
  552. providers: [
  553. MAT_RADIO_GROUP_CONTROL_VALUE_ACCESSOR,
  554. { provide: MAT_RADIO_GROUP, useExisting: MatRadioGroup },
  555. ],
  556. host: {
  557. 'role': 'radiogroup',
  558. 'class': 'mat-mdc-radio-group',
  559. },
  560. }]
  561. }], propDecorators: { _radios: [{
  562. type: ContentChildren,
  563. args: [forwardRef(() => MatRadioButton), { descendants: true }]
  564. }] } });
  565. class MatRadioButton extends _MatRadioButtonBase {
  566. constructor(radioGroup, elementRef, _changeDetector, _focusMonitor, _radioDispatcher, animationMode, _providerOverride, tabIndex) {
  567. super(radioGroup, elementRef, _changeDetector, _focusMonitor, _radioDispatcher, animationMode, _providerOverride, tabIndex);
  568. }
  569. static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", 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 }); }
  570. static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.0.0", type: MatRadioButton, selector: "mat-radio-button", inputs: { disableRipple: "disableRipple", tabIndex: "tabIndex" }, host: { listeners: { "focus": "_inputElement.nativeElement.focus()" }, properties: { "attr.id": "id", "class.mat-primary": "color === \"primary\"", "class.mat-accent": "color === \"accent\"", "class.mat-warn": "color === \"warn\"", "class.mat-mdc-radio-checked": "checked", "class._mat-animation-noopable": "_noopAnimations", "attr.tabindex": "null", "attr.aria-label": "null", "attr.aria-labelledby": "null", "attr.aria-describedby": "null" }, classAttribute: "mat-mdc-radio-button" }, exportAs: ["matRadioButton"], usesInheritance: true, ngImport: i0, template: "<div class=\"mdc-form-field\" #formField\n [class.mdc-form-field--align-end]=\"labelPosition == 'before'\">\n <div class=\"mdc-radio\" [class.mdc-radio--disabled]=\"disabled\">\n <!-- Render this element first so the input is on top. -->\n <div class=\"mat-mdc-radio-touch-target\" (click)=\"_onTouchTargetClick($event)\"></div>\n <input #input class=\"mdc-radio__native-control\" 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 <div class=\"mdc-radio__background\">\n <div class=\"mdc-radio__outer-circle\"></div>\n <div class=\"mdc-radio__inner-circle\"></div>\n </div>\n <div mat-ripple class=\"mat-radio-ripple mat-mdc-focus-indicator\"\n [matRippleTrigger]=\"formField\"\n [matRippleDisabled]=\"_isRippleDisabled()\"\n [matRippleCentered]=\"true\">\n <div class=\"mat-ripple-element mat-radio-persistent-ripple\"></div>\n </div>\n </div>\n <label class=\"mdc-label\" [for]=\"inputId\">\n <ng-content></ng-content>\n </label>\n</div>\n", styles: [".mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio[hidden]{display:none}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:\"\";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:\"\";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-form-field{display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field[hidden]{display:none}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{margin-left:auto;margin-right:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}[dir=rtl] .mdc-form-field--space-between>label,.mdc-form-field--space-between>label[dir=rtl]{margin:0}.mat-mdc-radio-button{--mdc-radio-disabled-selected-icon-opacity:0.38;--mdc-radio-disabled-unselected-icon-opacity:0.38;--mdc-radio-state-layer-size:40px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{padding:calc((var(--mdc-radio-state-layer-size) - 20px) / 2)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-unselected-icon-opacity)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{top:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);left:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);right:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);left:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:not([disabled]):not(:focus)~.mdc-radio__background::before{opacity:.04;transform:scale(1)}.mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio__background::before{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button .mdc-radio--disabled+label{color:var(--mat-radio-disabled-label-color)}.mat-mdc-radio-button .mat-radio-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:50%}.mat-mdc-radio-button .mat-radio-ripple .mat-ripple-element{opacity:.14}.mat-mdc-radio-button .mat-radio-ripple::before{border-radius:50%}.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__background::before,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__outer-circle,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__inner-circle{transition:none !important}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:focus:enabled:not(:checked)~.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-focus-icon-color, black)}.mat-mdc-radio-button.cdk-focused .mat-mdc-focus-indicator::before{content:\"\"}.mat-mdc-radio-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}[dir=rtl] .mat-mdc-radio-touch-target{left:0;right:50%;transform:translate(50%, -50%)}"], 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 }); }
  571. }
  572. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatRadioButton, decorators: [{
  573. type: Component,
  574. args: [{ selector: 'mat-radio-button', host: {
  575. 'class': 'mat-mdc-radio-button',
  576. '[attr.id]': 'id',
  577. '[class.mat-primary]': 'color === "primary"',
  578. '[class.mat-accent]': 'color === "accent"',
  579. '[class.mat-warn]': 'color === "warn"',
  580. '[class.mat-mdc-radio-checked]': 'checked',
  581. '[class._mat-animation-noopable]': '_noopAnimations',
  582. // Needs to be removed since it causes some a11y issues (see #21266).
  583. '[attr.tabindex]': 'null',
  584. '[attr.aria-label]': 'null',
  585. '[attr.aria-labelledby]': 'null',
  586. '[attr.aria-describedby]': 'null',
  587. // Note: under normal conditions focus shouldn't land on this element, however it may be
  588. // programmatically set, for example inside of a focus trap, in this case we want to forward
  589. // the focus to the native element.
  590. '(focus)': '_inputElement.nativeElement.focus()',
  591. }, inputs: ['disableRipple', 'tabIndex'], exportAs: 'matRadioButton', encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"mdc-form-field\" #formField\n [class.mdc-form-field--align-end]=\"labelPosition == 'before'\">\n <div class=\"mdc-radio\" [class.mdc-radio--disabled]=\"disabled\">\n <!-- Render this element first so the input is on top. -->\n <div class=\"mat-mdc-radio-touch-target\" (click)=\"_onTouchTargetClick($event)\"></div>\n <input #input class=\"mdc-radio__native-control\" 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 <div class=\"mdc-radio__background\">\n <div class=\"mdc-radio__outer-circle\"></div>\n <div class=\"mdc-radio__inner-circle\"></div>\n </div>\n <div mat-ripple class=\"mat-radio-ripple mat-mdc-focus-indicator\"\n [matRippleTrigger]=\"formField\"\n [matRippleDisabled]=\"_isRippleDisabled()\"\n [matRippleCentered]=\"true\">\n <div class=\"mat-ripple-element mat-radio-persistent-ripple\"></div>\n </div>\n </div>\n <label class=\"mdc-label\" [for]=\"inputId\">\n <ng-content></ng-content>\n </label>\n</div>\n", styles: [".mdc-radio{display:inline-block;position:relative;flex:0 0 auto;box-sizing:content-box;width:20px;height:20px;cursor:pointer;will-change:opacity,transform,border-color,color}.mdc-radio[hidden]{display:none}.mdc-radio__background{display:inline-block;position:relative;box-sizing:border-box;width:20px;height:20px}.mdc-radio__background::before{position:absolute;transform:scale(0, 0);border-radius:50%;opacity:0;pointer-events:none;content:\"\";transition:opacity 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__outer-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;border-width:2px;border-style:solid;border-radius:50%;transition:border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__inner-circle{position:absolute;top:0;left:0;box-sizing:border-box;width:100%;height:100%;transform:scale(0, 0);border-width:10px;border-style:solid;border-radius:50%;transition:transform 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1),border-color 120ms 0ms cubic-bezier(0.4, 0, 0.6, 1)}.mdc-radio__native-control{position:absolute;margin:0;padding:0;opacity:0;cursor:inherit;z-index:1}.mdc-radio--touch{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:4px}.mdc-radio--touch .mdc-radio__native-control{top:calc((40px - 48px) / 2);right:calc((40px - 48px) / 2);left:calc((40px - 48px) / 2);width:48px;height:48px}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{pointer-events:none;border:2px solid rgba(0,0,0,0);border-radius:6px;box-sizing:content-box;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:100%;width:100%}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring{border-color:CanvasText}}.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{content:\"\";border:2px solid rgba(0,0,0,0);border-radius:8px;display:block;position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);height:calc(100% + 4px);width:calc(100% + 4px)}@media screen and (forced-colors: active){.mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__focus-ring::after,.mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__focus-ring::after{border-color:CanvasText}}.mdc-radio__native-control:checked+.mdc-radio__background,.mdc-radio__native-control:disabled+.mdc-radio__background{transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__outer-circle{transition:border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle,.mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio--disabled{cursor:default;pointer-events:none}.mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__inner-circle{transform:scale(0.5);transition:transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1),border-color 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-radio__native-control:disabled+.mdc-radio__background,[aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background{cursor:default}.mdc-radio__native-control:focus+.mdc-radio__background::before{transform:scale(1);opacity:.12;transition:opacity 120ms 0ms cubic-bezier(0, 0, 0.2, 1),transform 120ms 0ms cubic-bezier(0, 0, 0.2, 1)}.mdc-form-field{display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field[hidden]{display:none}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{margin-left:auto;margin-right:0}[dir=rtl] .mdc-form-field>label,.mdc-form-field>label[dir=rtl]{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{margin-left:0;margin-right:auto}[dir=rtl] .mdc-form-field--align-end>label,.mdc-form-field--align-end>label[dir=rtl]{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}[dir=rtl] .mdc-form-field--space-between>label,.mdc-form-field--space-between>label[dir=rtl]{margin:0}.mat-mdc-radio-button{--mdc-radio-disabled-selected-icon-opacity:0.38;--mdc-radio-disabled-unselected-icon-opacity:0.38;--mdc-radio-state-layer-size:40px;-webkit-tap-highlight-color:rgba(0,0,0,0)}.mat-mdc-radio-button .mdc-radio{padding:calc((var(--mdc-radio-state-layer-size) - 20px) / 2)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-disabled-selected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:checked+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled+.mdc-radio__background .mdc-radio__inner-circle{opacity:var(--mdc-radio-disabled-selected-icon-opacity)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-disabled-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio [aria-disabled=true] .mdc-radio__native-control:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:disabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{opacity:var(--mdc-radio-disabled-unselected-icon-opacity)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio.mdc-ripple-upgraded--background-focused .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle,.mat-mdc-radio-button .mdc-radio:not(.mdc-ripple-upgraded):focus .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-focus-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:checked+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled+.mdc-radio__background .mdc-radio__inner-circle{border-color:var(--mdc-radio-selected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-hover-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-icon-color)}.mat-mdc-radio-button .mdc-radio:not(:disabled):active .mdc-radio__native-control:enabled:not(:checked)+.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-pressed-icon-color)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{top:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);left:calc(-1 * (var(--mdc-radio-state-layer-size) - 20px) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control{top:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);right:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);left:calc((var(--mdc-radio-state-layer-size) - var(--mdc-radio-state-layer-size)) / 2);width:var(--mdc-radio-state-layer-size);height:var(--mdc-radio-state-layer-size)}.mat-mdc-radio-button .mdc-radio .mdc-radio__background::before{background-color:var(--mat-radio-ripple-color)}.mat-mdc-radio-button .mdc-radio:hover .mdc-radio__native-control:not([disabled]):not(:focus)~.mdc-radio__background::before{opacity:.04;transform:scale(1)}.mat-mdc-radio-button.mat-mdc-radio-checked .mdc-radio__background::before{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button.mat-mdc-radio-checked .mat-ripple-element{background-color:var(--mat-radio-checked-ripple-color)}.mat-mdc-radio-button .mdc-radio--disabled+label{color:var(--mat-radio-disabled-label-color)}.mat-mdc-radio-button .mat-radio-ripple{top:0;left:0;right:0;bottom:0;position:absolute;pointer-events:none;border-radius:50%}.mat-mdc-radio-button .mat-radio-ripple .mat-ripple-element{opacity:.14}.mat-mdc-radio-button .mat-radio-ripple::before{border-radius:50%}.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__background::before,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__outer-circle,.mat-mdc-radio-button._mat-animation-noopable .mdc-radio__inner-circle{transition:none !important}.mat-mdc-radio-button .mdc-radio .mdc-radio__native-control:focus:enabled:not(:checked)~.mdc-radio__background .mdc-radio__outer-circle{border-color:var(--mdc-radio-unselected-focus-icon-color, black)}.mat-mdc-radio-button.cdk-focused .mat-mdc-focus-indicator::before{content:\"\"}.mat-mdc-radio-touch-target{position:absolute;top:50%;height:48px;left:50%;width:48px;transform:translate(-50%, -50%)}[dir=rtl] .mat-mdc-radio-touch-target{left:0;right:50%;transform:translate(50%, -50%)}"] }]
  592. }], ctorParameters: function () { return [{ type: MatRadioGroup, decorators: [{
  593. type: Optional
  594. }, {
  595. type: Inject,
  596. args: [MAT_RADIO_GROUP]
  597. }] }, { type: i0.ElementRef }, { type: i0.ChangeDetectorRef }, { type: i1.FocusMonitor }, { type: i2.UniqueSelectionDispatcher }, { type: undefined, decorators: [{
  598. type: Optional
  599. }, {
  600. type: Inject,
  601. args: [ANIMATION_MODULE_TYPE]
  602. }] }, { type: undefined, decorators: [{
  603. type: Optional
  604. }, {
  605. type: Inject,
  606. args: [MAT_RADIO_DEFAULT_OPTIONS]
  607. }] }, { type: undefined, decorators: [{
  608. type: Attribute,
  609. args: ['tabindex']
  610. }] }]; } });
  611. class MatRadioModule {
  612. static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatRadioModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
  613. static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.0.0", ngImport: i0, type: MatRadioModule, declarations: [MatRadioGroup, MatRadioButton], imports: [MatCommonModule, CommonModule, MatRippleModule], exports: [MatCommonModule, MatRadioGroup, MatRadioButton] }); }
  614. static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatRadioModule, imports: [MatCommonModule, CommonModule, MatRippleModule, MatCommonModule] }); }
  615. }
  616. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.0", ngImport: i0, type: MatRadioModule, decorators: [{
  617. type: NgModule,
  618. args: [{
  619. imports: [MatCommonModule, CommonModule, MatRippleModule],
  620. exports: [MatCommonModule, MatRadioGroup, MatRadioButton],
  621. declarations: [MatRadioGroup, MatRadioButton],
  622. }]
  623. }] });
  624. /**
  625. * Generated bundle index. Do not edit.
  626. */
  627. 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 };
  628. //# sourceMappingURL=radio.mjs.map