blob: 150e86da3fdcc23bd77d1ddb336546d952337c65 [file] [log] [blame]
{"version":3,"file":"material-checkbox.umd.min.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/material/checkbox/checkbox-config.ts","../../src/material/checkbox/checkbox.ts","../../src/material/checkbox/checkbox-required-validator.ts","../../src/material/checkbox/checkbox-module.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) if (e.indexOf(p[i]) < 0)\r\n t[p[i]] = s[p[i]];\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\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 */\nimport {InjectionToken} from '@angular/core';\n\n\n/**\n * Checkbox click action when user click on input element.\n * noop: Do not toggle checked or indeterminate.\n * check: Only toggle checked status, ignore indeterminate.\n * check-indeterminate: Toggle checked status, set indeterminate to false. Default behavior.\n * undefined: Same as `check-indeterminate`.\n */\nexport type MatCheckboxClickAction = 'noop' | 'check' | 'check-indeterminate' | undefined;\n\n/**\n * Injection token that can be used to specify the checkbox click behavior.\n */\nexport const MAT_CHECKBOX_CLICK_ACTION =\n new InjectionToken<MatCheckboxClickAction>('mat-checkbox-click-action');\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 {FocusMonitor} from '@angular/cdk/a11y';\nimport {coerceBooleanProperty} from '@angular/cdk/coercion';\nimport {\n Attribute,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n forwardRef,\n Inject,\n Input,\n NgZone,\n OnDestroy,\n Optional,\n Output,\n ViewChild,\n ViewEncapsulation,\n AfterViewChecked,\n} from '@angular/core';\nimport {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms';\nimport {\n CanColor,\n CanColorCtor,\n CanDisable,\n CanDisableCtor,\n CanDisableRipple,\n CanDisableRippleCtor,\n HasTabIndex,\n HasTabIndexCtor,\n MatRipple,\n mixinColor,\n mixinDisabled,\n mixinDisableRipple,\n mixinTabIndex,\n} from '@angular/material/core';\nimport {ANIMATION_MODULE_TYPE} from '@angular/platform-browser/animations';\nimport {MAT_CHECKBOX_CLICK_ACTION, MatCheckboxClickAction} from './checkbox-config';\n\n\n// Increasing integer for generating unique ids for checkbox components.\nlet nextUniqueId = 0;\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 */\nexport const MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR: any = {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => MatCheckbox),\n multi: true\n};\n\n/**\n * Represents the different states that require custom transitions between them.\n * @docs-private\n */\nexport enum TransitionCheckState {\n /** The initial state of the component before any user interaction. */\n Init,\n /** The state representing the component when it's becoming checked. */\n Checked,\n /** The state representing the component when it's becoming unchecked. */\n Unchecked,\n /** The state representing the component when it's becoming indeterminate. */\n Indeterminate\n}\n\n/** Change event object emitted by MatCheckbox. */\nexport class MatCheckboxChange {\n /** The source MatCheckbox of the event. */\n source: MatCheckbox;\n /** The new `checked` value of the checkbox. */\n checked: boolean;\n}\n\n// Boilerplate for applying mixins to MatCheckbox.\n/** @docs-private */\nclass MatCheckboxBase {\n constructor(public _elementRef: ElementRef) {}\n}\nconst _MatCheckboxMixinBase:\n HasTabIndexCtor &\n CanColorCtor &\n CanDisableRippleCtor &\n CanDisableCtor &\n typeof MatCheckboxBase =\n mixinTabIndex(mixinColor(mixinDisableRipple(mixinDisabled(MatCheckboxBase)), 'accent'));\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 MatCheckbox 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 */\n@Component({\n moduleId: module.id,\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 '[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_CHECKBOX_CONTROL_VALUE_ACCESSOR],\n inputs: ['disableRipple', 'color', 'tabIndex'],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class MatCheckbox extends _MatCheckboxMixinBase implements ControlValueAccessor,\n AfterViewChecked, OnDestroy, CanColor, CanDisable, HasTabIndex, CanDisableRipple {\n\n /**\n * Attached to the aria-label attribute of the host element. In most cases, aria-labelledby will\n * take precedence so this may be omitted.\n */\n @Input('aria-label') ariaLabel: string = '';\n\n /**\n * Users can specify the `aria-labelledby` attribute which will be forwarded to the input element\n */\n @Input('aria-labelledby') ariaLabelledby: string | null = null;\n\n private _uniqueId: string = `mat-checkbox-${++nextUniqueId}`;\n\n /** A unique id for the checkbox input. If none is supplied, it will be auto-generated. */\n @Input() id: string = this._uniqueId;\n\n /** Returns the unique id for the visual hidden input. */\n get inputId(): string { return `${this.id || this._uniqueId}-input`; }\n\n /** Whether the checkbox is required. */\n @Input()\n get required(): boolean { return this._required; }\n set required(value: boolean) { this._required = coerceBooleanProperty(value); }\n private _required: boolean;\n\n /** Whether the label should appear after or before the checkbox. Defaults to 'after' */\n @Input() labelPosition: 'before' | 'after' = 'after';\n\n /** Name value will be applied to the input element if present */\n @Input() name: string | null = null;\n\n /** Event emitted when the checkbox's `checked` value changes. */\n @Output() readonly change: EventEmitter<MatCheckboxChange> =\n new EventEmitter<MatCheckboxChange>();\n\n /** Event emitted when the checkbox's `indeterminate` value changes. */\n @Output() readonly indeterminateChange: EventEmitter<boolean> = new EventEmitter<boolean>();\n\n /** The value attribute of the native input element */\n @Input() value: string;\n\n /** The native `<input type=\"checkbox\">` element */\n @ViewChild('input', {static: false}) _inputElement: ElementRef<HTMLInputElement>;\n\n /** Reference to the ripple instance of the checkbox. */\n @ViewChild(MatRipple, {static: false}) ripple: MatRipple;\n\n /**\n * Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor.\n * @docs-private\n */\n _onTouched: () => any = () => {};\n\n private _currentAnimationClass: string = '';\n\n private _currentCheckState: TransitionCheckState = TransitionCheckState.Init;\n\n private _controlValueAccessorChangeFn: (value: any) => void = () => {};\n\n constructor(elementRef: ElementRef<HTMLElement>,\n private _changeDetectorRef: ChangeDetectorRef,\n private _focusMonitor: FocusMonitor,\n private _ngZone: NgZone,\n @Attribute('tabindex') tabIndex: string,\n @Optional() @Inject(MAT_CHECKBOX_CLICK_ACTION)\n private _clickAction: MatCheckboxClickAction,\n @Optional() @Inject(ANIMATION_MODULE_TYPE) public _animationMode?: string) {\n super(elementRef);\n\n this.tabIndex = parseInt(tabIndex) || 0;\n\n this._focusMonitor.monitor(elementRef, true).subscribe(focusOrigin => {\n if (!focusOrigin) {\n // When a focused element becomes disabled, the browser *immediately* fires a blur event.\n // Angular does not expect events to be raised during change detection, so any state change\n // (such as a form control's 'ng-touched') will cause a changed-after-checked error.\n // See https://github.com/angular/angular/issues/17793. To work around this, we defer\n // telling the form control it has been touched until the next tick.\n Promise.resolve().then(() => {\n this._onTouched();\n _changeDetectorRef.markForCheck();\n });\n }\n });\n }\n\n // TODO: Delete next major revision.\n ngAfterViewChecked() {}\n\n ngOnDestroy() {\n this._focusMonitor.stopMonitoring(this._elementRef);\n }\n\n /**\n * Whether the checkbox is checked.\n */\n @Input()\n get checked(): boolean { return this._checked; }\n set checked(value: boolean) {\n if (value != this.checked) {\n this._checked = value;\n this._changeDetectorRef.markForCheck();\n }\n }\n private _checked: boolean = false;\n\n /**\n * Whether the checkbox is disabled. This fully overrides the implementation provided by\n * mixinDisabled, but the mixin is still required because mixinTabIndex requires it.\n */\n @Input()\n get disabled() { return this._disabled; }\n set disabled(value: any) {\n const newValue = coerceBooleanProperty(value);\n\n if (newValue !== this.disabled) {\n this._disabled = newValue;\n this._changeDetectorRef.markForCheck();\n }\n }\n private _disabled: boolean = false;\n\n /**\n * Whether the checkbox is indeterminate. This is also known as \"mixed\" mode and can be used to\n * represent a checkbox with three states, e.g. a checkbox that represents a nested list of\n * checkable items. Note that whenever checkbox is manually clicked, indeterminate is immediately\n * set to false.\n */\n @Input()\n get indeterminate(): boolean { return this._indeterminate; }\n set indeterminate(value: boolean) {\n const changed = value != this._indeterminate;\n this._indeterminate = value;\n\n if (changed) {\n if (this._indeterminate) {\n this._transitionCheckState(TransitionCheckState.Indeterminate);\n } else {\n this._transitionCheckState(\n this.checked ? TransitionCheckState.Checked : TransitionCheckState.Unchecked);\n }\n this.indeterminateChange.emit(this._indeterminate);\n }\n }\n private _indeterminate: boolean = false;\n\n _isRippleDisabled() {\n return this.disableRipple || this.disabled;\n }\n\n /** Method being called whenever the label text changes. */\n _onLabelTextChange() {\n // Since the event of the `cdkObserveContent` directive runs outside of the zone, the checkbox\n // component will be only marked for check, but no actual change detection runs automatically.\n // Instead of going back into the zone in order to trigger a change detection which causes\n // *all* components to be checked (if explicitly marked or not using OnPush), we only trigger\n // an explicit change detection for the checkbox view and it's children.\n this._changeDetectorRef.detectChanges();\n }\n\n // Implemented as part of ControlValueAccessor.\n writeValue(value: any) {\n this.checked = !!value;\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnChange(fn: (value: any) => void) {\n this._controlValueAccessorChangeFn = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n registerOnTouched(fn: any) {\n this._onTouched = fn;\n }\n\n // Implemented as part of ControlValueAccessor.\n setDisabledState(isDisabled: boolean) {\n this.disabled = isDisabled;\n }\n\n _getAriaChecked(): 'true' | 'false' | 'mixed' {\n return this.checked ? 'true' : (this.indeterminate ? 'mixed' : 'false');\n }\n\n private _transitionCheckState(newState: TransitionCheckState) {\n let oldState = this._currentCheckState;\n let element: HTMLElement = this._elementRef.nativeElement;\n\n if (oldState === newState) {\n return;\n }\n if (this._currentAnimationClass.length > 0) {\n element.classList.remove(this._currentAnimationClass);\n }\n\n this._currentAnimationClass = this._getAnimationClassForCheckStateTransition(\n oldState, newState);\n this._currentCheckState = newState;\n\n if (this._currentAnimationClass.length > 0) {\n element.classList.add(this._currentAnimationClass);\n\n // Remove the animation class to avoid animation when the checkbox is moved between containers\n const animationClass = this._currentAnimationClass;\n\n this._ngZone.runOutsideAngular(() => {\n setTimeout(() => {\n element.classList.remove(animationClass);\n }, 1000);\n });\n }\n }\n\n private _emitChangeEvent() {\n const event = new MatCheckboxChange();\n event.source = this;\n event.checked = this.checked;\n\n this._controlValueAccessorChangeFn(this.checked);\n this.change.emit(event);\n }\n\n /** Toggles the `checked` state of the checkbox. */\n toggle(): void {\n this.checked = !this.checked;\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\n // If resetIndeterminate is false, and the current state is indeterminate, do nothing on click\n if (!this.disabled && this._clickAction !== 'noop') {\n // When user manually click on the checkbox, `indeterminate` is set to false.\n if (this.indeterminate && this._clickAction !== 'check') {\n\n Promise.resolve().then(() => {\n this._indeterminate = false;\n this.indeterminateChange.emit(this._indeterminate);\n });\n }\n\n this.toggle();\n this._transitionCheckState(\n this._checked ? TransitionCheckState.Checked : TransitionCheckState.Unchecked);\n\n // Emit our custom change event if the native input emitted one.\n // It is important to only emit it, if the native input triggered one, because\n // we don't want to trigger a change event, when the `checked` variable changes for example.\n this._emitChangeEvent();\n } else if (!this.disabled && this._clickAction === 'noop') {\n // Reset native input when clicked with noop. The native checkbox becomes checked after\n // click, reset it to be align with `checked` value of `mat-checkbox`.\n this._inputElement.nativeElement.checked = this.checked;\n this._inputElement.nativeElement.indeterminate = this.indeterminate;\n }\n }\n\n /** Focuses the checkbox. */\n focus(): void {\n this._focusMonitor.focusVia(this._inputElement, 'keyboard');\n }\n\n _onInteractionEvent(event: Event) {\n // We always have to stop propagation on the change event.\n // Otherwise the change event, from the input element, will bubble up and\n // emit its event object to the `change` output.\n event.stopPropagation();\n }\n\n private _getAnimationClassForCheckStateTransition(\n oldState: TransitionCheckState, newState: TransitionCheckState): string {\n // Don't transition if animations are disabled.\n if (this._animationMode === 'NoopAnimations') {\n return '';\n }\n\n let animSuffix: string = '';\n\n switch (oldState) {\n case TransitionCheckState.Init:\n // Handle edge case where user interacts with checkbox that does not have [(ngModel)] or\n // [checked] bound to it.\n if (newState === TransitionCheckState.Checked) {\n animSuffix = 'unchecked-checked';\n } else if (newState == TransitionCheckState.Indeterminate) {\n animSuffix = 'unchecked-indeterminate';\n } else {\n return '';\n }\n break;\n case TransitionCheckState.Unchecked:\n animSuffix = newState === TransitionCheckState.Checked ?\n 'unchecked-checked' : 'unchecked-indeterminate';\n break;\n case TransitionCheckState.Checked:\n animSuffix = newState === TransitionCheckState.Unchecked ?\n 'checked-unchecked' : 'checked-indeterminate';\n break;\n case TransitionCheckState.Indeterminate:\n animSuffix = newState === TransitionCheckState.Checked ?\n 'indeterminate-checked' : 'indeterminate-unchecked';\n break;\n }\n\n return `mat-checkbox-anim-${animSuffix}`;\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 {\n Directive,\n forwardRef,\n Provider,\n} from '@angular/core';\nimport {\n CheckboxRequiredValidator,\n NG_VALIDATORS,\n} from '@angular/forms';\n\nexport const MAT_CHECKBOX_REQUIRED_VALIDATOR: Provider = {\n provide: NG_VALIDATORS,\n useExisting: forwardRef(() => MatCheckboxRequiredValidator),\n multi: true\n};\n\n/**\n * Validator for Material checkbox's required attribute in template-driven checkbox.\n * Current CheckboxRequiredValidator only work with `input type=checkbox` and does not\n * work with `mat-checkbox`.\n */\n@Directive({\n selector: `mat-checkbox[required][formControlName],\n mat-checkbox[required][formControl], mat-checkbox[required][ngModel]`,\n providers: [MAT_CHECKBOX_REQUIRED_VALIDATOR],\n host: {'[attr.required]': 'required ? \"\" : null'}\n})\nexport class MatCheckboxRequiredValidator extends CheckboxRequiredValidator {}\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 {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {MatCommonModule, MatRippleModule} from '@angular/material/core';\nimport {MatCheckbox} from './checkbox';\nimport {MatCheckboxRequiredValidator} from './checkbox-required-validator';\n\n/** This module is used by both original and MDC-based checkbox implementations. */\n@NgModule({\n exports: [MatCheckboxRequiredValidator],\n declarations: [MatCheckboxRequiredValidator],\n})\n// tslint:disable-next-line:class-name\nexport class _MatCheckboxRequiredValidatorModule {\n}\n\n@NgModule({\n imports: [\n CommonModule, MatRippleModule, MatCommonModule, ObserversModule,\n _MatCheckboxRequiredValidatorModule\n ],\n exports: [MatCheckbox, MatCommonModule, _MatCheckboxRequiredValidatorModule],\n declarations: [MatCheckbox],\n})\nexport class MatCheckboxModule {\n}\n"],"names":["__extends","d","b","__","this","constructor","extendStatics","prototype","Object","create","setPrototypeOf","__proto__","Array","p","hasOwnProperty","MAT_CHECKBOX_CLICK_ACTION","InjectionToken","nextUniqueId","MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR","provide","NG_VALUE_ACCESSOR","useExisting","forwardRef","MatCheckbox","multi","Init","Checked","Unchecked","Indeterminate","MatCheckboxChange","MatCheckboxBase","_elementRef","_MatCheckboxMixinBase","mixinTabIndex","mixinColor","mixinDisableRipple","mixinDisabled","_super","elementRef","_changeDetectorRef","_focusMonitor","_ngZone","tabIndex","_clickAction","_animationMode","_this","call","ariaLabel","ariaLabelledby","_uniqueId","id","labelPosition","name","change","EventEmitter","indeterminateChange","_onTouched","_currentAnimationClass","_currentCheckState","TransitionCheckState","_controlValueAccessorChangeFn","_checked","_disabled","_indeterminate","parseInt","monitor","subscribe","focusOrigin","Promise","resolve","then","markForCheck","tslib_1.__extends","defineProperty","_required","value","coerceBooleanProperty","ngAfterViewChecked","ngOnDestroy","stopMonitoring","checked","newValue","disabled","changed","_transitionCheckState","emit","_isRippleDisabled","disableRipple","_onLabelTextChange","detectChanges","writeValue","registerOnChange","fn","registerOnTouched","setDisabledState","isDisabled","_getAriaChecked","indeterminate","newState","oldState","element","nativeElement","length","classList","remove","_getAnimationClassForCheckStateTransition","add","animationClass_1","runOutsideAngular","setTimeout","_emitChangeEvent","event","source","toggle","_onInputClick","stopPropagation","_inputElement","focus","focusVia","_onInteractionEvent","animSuffix","type","Component","args","selector","template","styles","exportAs","host","class","[id]","[attr.tabindex]","[class.mat-checkbox-indeterminate]","[class.mat-checkbox-checked]","[class.mat-checkbox-disabled]","[class.mat-checkbox-label-before]","[class._mat-animation-noopable]","providers","inputs","encapsulation","ViewEncapsulation","None","changeDetection","ChangeDetectionStrategy","OnPush","FocusMonitor","NgZone","String","decorators","Attribute","undefined","Optional","Inject","ANIMATION_MODULE_TYPE","propDecorators","Input","required","Output","ViewChild","static","ripple","MatRipple","MAT_CHECKBOX_REQUIRED_VALIDATOR","NG_VALIDATORS","MatCheckboxRequiredValidator","Directive","[attr.required]","CheckboxRequiredValidator","_MatCheckboxRequiredValidatorModule","NgModule","exports","declarations","MatCheckboxModule","imports","CommonModule","MatRippleModule","MatCommonModule","ObserversModule"],"mappings":";;;;;;;k2BAuBA,SAAgBA,GAAUC,EAAGC,GAEzB,QAASC,KAAOC,KAAKC,YAAcJ,EADnCK,EAAcL,EAAGC,GAEjBD,EAAEM,UAAkB,OAANL,EAAaM,OAAOC,OAAOP,IAAMC,EAAGI,UAAYL,EAAEK,UAAW,GAAIJ,IAVnF,GAAIG,GAAgB,SAASL,EAAGC,GAI5B,OAHAI,EAAgBE,OAAOE,iBAChBC,uBAA2BC,QAAS,SAAUX,EAAGC,GAAKD,EAAEU,UAAYT,IACvE,SAAUD,EAAGC,GAAK,IAAK,GAAIW,KAAKX,GAAOA,EAAEY,eAAeD,KAAIZ,EAAEY,GAAKX,EAAEW,MACpDZ,EAAGC,ICEfa,EACT,GAAIC,GAAAA,eAAuC,6BC0B3CC,EAAe,EAONC,GACXC,QAASC,EAAAA,kBACTC,YAAaC,EAAAA,WAAU,WAAO,MAAAC,KAC9BC,OAAO,MASPC,KAAF,EAEEC,QAAF,EAEEC,UAAF,EAEEC,cAAF,wGAIA,kBAAA,QAAAC,MAKA,MAAAA,mBAKE,QAAFC,GAAqBC,GAAA3B,KAArB2B,YAAqBA,EACrB,MAAAD,MACME,EAMEC,EAAAA,cAAcC,EAAAA,WAAWC,EAAAA,mBAAmBC,EAAAA,cAAcN,IAAmB,WAWrFP,EAAA,SAAAc,GAmFE,QAAFd,GAAce,EACQC,EACAC,EACAC,EACeC,EAEXC,EACsCC,GAP9D,GAAFC,GAQIR,EARJS,KAAA1C,KAQUkC,IARVlC,WACsByC,GAAtBN,mBAAsBA,EACAM,EAAtBL,cAAsBA,EACAK,EAAtB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