{"version":3,"file":"legacy-checkbox.mjs","sources":["../../../../../../src/material/legacy-checkbox/checkbox.ts","../../../../../../src/material/legacy-checkbox/checkbox.html","../../../../../../src/material/legacy-checkbox/checkbox-module.ts","../../../../../../src/material/legacy-checkbox/legacy-checkbox_public_index.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y';\nimport {\n AfterViewInit,\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n forwardRef,\n Inject,\n NgZone,\n OnDestroy,\n Optional,\n ViewEncapsulation,\n} from '@angular/core';\nimport {NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {\n _MatCheckboxBase,\n MAT_CHECKBOX_DEFAULT_OPTIONS,\n MatCheckboxDefaultOptions,\n} from '@angular/material/checkbox';\n\n/**\n * Change event object emitted by a checkbox.\n * @deprecated Use `MatCheckboxChange` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport class MatLegacyCheckboxChange {\n /** The source checkbox of the event. */\n source: MatLegacyCheckbox;\n /** The new `checked` value of the checkbox. */\n checked: boolean;\n}\n/**\n * Provider Expression that allows mat-checkbox to register as a ControlValueAccessor.\n * This allows it to support [(ngModel)].\n * @docs-private\n * @deprecated Use `MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\nexport const MAT_LEGACY_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatLegacyCheckbox),\n multi: true,\n};\n\n/**\n * A material design checkbox component. Supports all of the functionality of an HTML5 checkbox,\n * and exposes a similar API. A checkbox can be either checked, unchecked, indeterminate, or\n * disabled. Note that all additional accessibility attributes are taken care of by the component,\n * so there is no need to provide them yourself. However, if you want to omit a label and still\n * have the checkbox be accessible, you may supply an [aria-label] input.\n * See: https://material.io/design/components/selection-controls.html\n * @deprecated Use `MatCheckbox` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@Component({\n selector: 'mat-checkbox',\n templateUrl: 'checkbox.html',\n styleUrls: ['checkbox.css'],\n exportAs: 'matCheckbox',\n host: {\n 'class': 'mat-checkbox',\n '[id]': 'id',\n '[attr.tabindex]': 'null',\n '[attr.aria-label]': 'null',\n '[attr.aria-labelledby]': 'null',\n '[class.mat-checkbox-indeterminate]': 'indeterminate',\n '[class.mat-checkbox-checked]': 'checked',\n '[class.mat-checkbox-disabled]': 'disabled',\n '[class.mat-checkbox-label-before]': 'labelPosition == \"before\"',\n '[class._mat-animation-noopable]': `_animationMode === 'NoopAnimations'`,\n },\n providers: [MAT_LEGACY_CHECKBOX_CONTROL_VALUE_ACCESSOR],\n inputs: ['disableRipple', 'color', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class MatLegacyCheckbox\n extends _MatCheckboxBase\n implements AfterViewInit, OnDestroy\n{\n protected _animationClasses = {\n uncheckedToChecked: 'mat-checkbox-anim-unchecked-checked',\n uncheckedToIndeterminate: 'mat-checkbox-anim-unchecked-indeterminate',\n checkedToUnchecked: 'mat-checkbox-anim-checked-unchecked',\n checkedToIndeterminate: 'mat-checkbox-anim-checked-indeterminate',\n indeterminateToChecked: 'mat-checkbox-anim-indeterminate-checked',\n indeterminateToUnchecked: 'mat-checkbox-anim-indeterminate-unchecked',\n };\n\n constructor(\n elementRef: ElementRef,\n changeDetectorRef: ChangeDetectorRef,\n private _focusMonitor: FocusMonitor,\n ngZone: NgZone,\n @Attribute('tabindex') tabIndex: string,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) animationMode?: string,\n @Optional()\n @Inject(MAT_CHECKBOX_DEFAULT_OPTIONS)\n options?: MatCheckboxDefaultOptions,\n ) {\n super('mat-checkbox-', elementRef, changeDetectorRef, ngZone, tabIndex, animationMode, options);\n }\n\n protected _createChangeEvent(isChecked: boolean) {\n const event = new MatLegacyCheckboxChange();\n event.source = this;\n event.checked = isChecked;\n return event;\n }\n\n protected _getAnimationTargetElement() {\n return this._elementRef.nativeElement;\n }\n\n override ngAfterViewInit() {\n super.ngAfterViewInit();\n\n this._focusMonitor.monitor(this._elementRef, true).subscribe(focusOrigin => {\n if (!focusOrigin) {\n this._onBlur();\n }\n });\n }\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n }\n\n /**\n * Event handler for checkbox input element.\n * Toggles checked state if element is not disabled.\n * Do not toggle on (change) event since IE doesn't fire change event when\n * indeterminate checkbox is clicked.\n * @param event\n */\n _onInputClick(event: Event) {\n // We have to stop propagation for click events on the visual hidden input element.\n // By default, when a user clicks on a label element, a generated click event will be\n // dispatched on the associated input element. Since we are using a label element as our\n // root container, the click event on the `checkbox` will be executed twice.\n // The real click event will bubble up, and the generated click event also tries to bubble up.\n // This will lead to multiple click events.\n // Preventing bubbling for the second event will solve that issue.\n event.stopPropagation();\n super._handleInputClick();\n }\n\n /** Focuses the checkbox. */\n focus(origin?: FocusOrigin, options?: FocusOptions): void {\n if (origin) {\n this._focusMonitor.focusVia(this._inputElement, origin, options);\n } else {\n this._inputElement.nativeElement.focus(options);\n }\n }\n}\n","\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {ObserversModule} from '@angular/cdk/observers';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatLegacyCheckbox} from './checkbox';\nimport {_MatCheckboxRequiredValidatorModule} from '@angular/material/checkbox';\n\n/**\n * @deprecated Use `MatCheckboxModule` from `@angular/material/checkbox` instead. See https://material.angular.io/guide/mdc-migration for information about migrating.\n * @breaking-change 17.0.0\n */\n@NgModule({\n imports: [MatRippleModule, MatCommonModule, ObserversModule, _MatCheckboxRequiredValidatorModule],\n exports: [MatLegacyCheckbox, MatCommonModule, _MatCheckboxRequiredValidatorModule],\n declarations: [MatLegacyCheckbox],\n})\nexport class MatLegacyCheckboxModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;AA+BA;;;;AAIG;MACU,uBAAuB,CAAA;AAKnC,CAAA;AACD;;;;;;AAMG;AACU,MAAA,0CAA0C,GAAQ;AAC7D,IAAA,OAAO,EAAE,iBAAiB;AAC1B,IAAA,WAAW,EAAE,UAAU,CAAC,MAAM,iBAAiB,CAAC;AAChD,IAAA,KAAK,EAAE,IAAI;EACX;AAEF;;;;;;;;;AASG;AAuBG,MAAO,iBACX,SAAQ,gBAAyC,CAAA;AAYjD,IAAA,WAAA,CACE,UAAmC,EACnC,iBAAoC,EAC5B,aAA2B,EACnC,MAAc,EACS,QAAgB,EACI,aAAsB,EAGjE,OAAmC,EAAA;AAEnC,QAAA,KAAK,CAAC,eAAe,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,OAAO,CAAC,CAAC;QARxF,IAAa,CAAA,aAAA,GAAb,aAAa,CAAc;AAZ3B,QAAA,IAAA,CAAA,iBAAiB,GAAG;AAC5B,YAAA,kBAAkB,EAAE,qCAAqC;AACzD,YAAA,wBAAwB,EAAE,2CAA2C;AACrE,YAAA,kBAAkB,EAAE,qCAAqC;AACzD,YAAA,sBAAsB,EAAE,yCAAyC;AACjE,YAAA,sBAAsB,EAAE,yCAAyC;AACjE,YAAA,wBAAwB,EAAE,2CAA2C;SACtE,CAAC;KAcD;AAES,IAAA,kBAAkB,CAAC,SAAkB,EAAA;AAC7C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