You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
602 lines
46 KiB
602 lines
46 KiB
import { FocusMonitor } from '@angular/cdk/a11y';
|
|
import { coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
import { InjectionToken, forwardRef, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, ElementRef, ChangeDetectorRef, NgZone, Attribute, Optional, Inject, Input, Output, ViewChild, Directive, NgModule } from '@angular/core';
|
|
import { NG_VALUE_ACCESSOR, NG_VALIDATORS, CheckboxRequiredValidator } from '@angular/forms';
|
|
import { mixinTabIndex, mixinColor, mixinDisableRipple, mixinDisabled, MatRipple, MatRippleModule, MatCommonModule } from '@angular/material/core';
|
|
import { ANIMATION_MODULE_TYPE } from '@angular/platform-browser/animations';
|
|
import { ObserversModule } from '@angular/cdk/observers';
|
|
|
|
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
/** Injection token to be used to override the default options for `mat-checkbox`. */
|
|
import * as ɵngcc0 from '@angular/core';
|
|
import * as ɵngcc1 from '@angular/cdk/a11y';
|
|
import * as ɵngcc2 from '@angular/material/core';
|
|
import * as ɵngcc3 from '@angular/cdk/observers';
|
|
|
|
const _c0 = ["input"];
|
|
const _c1 = function (a0) { return { enterDuration: a0 }; };
|
|
const _c2 = ["*"];
|
|
const MAT_CHECKBOX_DEFAULT_OPTIONS = new InjectionToken('mat-checkbox-default-options', {
|
|
providedIn: 'root',
|
|
factory: MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY
|
|
});
|
|
/** @docs-private */
|
|
function MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY() {
|
|
return {
|
|
color: 'accent',
|
|
clickAction: 'check-indeterminate',
|
|
};
|
|
}
|
|
|
|
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
// Increasing integer for generating unique ids for checkbox components.
|
|
let nextUniqueId = 0;
|
|
// Default checkbox configuration.
|
|
const defaults = MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY();
|
|
/**
|
|
* Provider Expression that allows mat-checkbox to register as a ControlValueAccessor.
|
|
* This allows it to support [(ngModel)].
|
|
* @docs-private
|
|
*/
|
|
const MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR = {
|
|
provide: NG_VALUE_ACCESSOR,
|
|
useExisting: forwardRef(() => MatCheckbox),
|
|
multi: true
|
|
};
|
|
/** Change event object emitted by MatCheckbox. */
|
|
class MatCheckboxChange {
|
|
}
|
|
// Boilerplate for applying mixins to MatCheckbox.
|
|
/** @docs-private */
|
|
const _MatCheckboxBase = mixinTabIndex(mixinColor(mixinDisableRipple(mixinDisabled(class {
|
|
constructor(_elementRef) {
|
|
this._elementRef = _elementRef;
|
|
}
|
|
}))));
|
|
/**
|
|
* A material design checkbox component. Supports all of the functionality of an HTML5 checkbox,
|
|
* and exposes a similar API. A MatCheckbox can be either checked, unchecked, indeterminate, or
|
|
* disabled. Note that all additional accessibility attributes are taken care of by the component,
|
|
* so there is no need to provide them yourself. However, if you want to omit a label and still
|
|
* have the checkbox be accessible, you may supply an [aria-label] input.
|
|
* See: https://material.io/design/components/selection-controls.html
|
|
*/
|
|
class MatCheckbox extends _MatCheckboxBase {
|
|
constructor(elementRef, _changeDetectorRef, _focusMonitor, _ngZone, tabIndex, _animationMode, _options) {
|
|
super(elementRef);
|
|
this._changeDetectorRef = _changeDetectorRef;
|
|
this._focusMonitor = _focusMonitor;
|
|
this._ngZone = _ngZone;
|
|
this._animationMode = _animationMode;
|
|
this._options = _options;
|
|
/**
|
|
* Attached to the aria-label attribute of the host element. In most cases, aria-labelledby will
|
|
* take precedence so this may be omitted.
|
|
*/
|
|
this.ariaLabel = '';
|
|
/**
|
|
* Users can specify the `aria-labelledby` attribute which will be forwarded to the input element
|
|
*/
|
|
this.ariaLabelledby = null;
|
|
this._uniqueId = `mat-checkbox-${++nextUniqueId}`;
|
|
/** A unique id for the checkbox input. If none is supplied, it will be auto-generated. */
|
|
this.id = this._uniqueId;
|
|
/** Whether the label should appear after or before the checkbox. Defaults to 'after' */
|
|
this.labelPosition = 'after';
|
|
/** Name value will be applied to the input element if present */
|
|
this.name = null;
|
|
/** Event emitted when the checkbox's `checked` value changes. */
|
|
this.change = new EventEmitter();
|
|
/** Event emitted when the checkbox's `indeterminate` value changes. */
|
|
this.indeterminateChange = new EventEmitter();
|
|
/**
|
|
* Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor.
|
|
* @docs-private
|
|
*/
|
|
this._onTouched = () => { };
|
|
this._currentAnimationClass = '';
|
|
this._currentCheckState = 0 /* Init */;
|
|
this._controlValueAccessorChangeFn = () => { };
|
|
this._checked = false;
|
|
this._disabled = false;
|
|
this._indeterminate = false;
|
|
this._options = this._options || defaults;
|
|
this.color = this.defaultColor = this._options.color || defaults.color;
|
|
this.tabIndex = parseInt(tabIndex) || 0;
|
|
}
|
|
/** Returns the unique id for the visual hidden input. */
|
|
get inputId() { return `${this.id || this._uniqueId}-input`; }
|
|
/** Whether the checkbox is required. */
|
|
get required() { return this._required; }
|
|
set required(value) { this._required = coerceBooleanProperty(value); }
|
|
ngAfterViewInit() {
|
|
this._focusMonitor.monitor(this._elementRef, true).subscribe(focusOrigin => {
|
|
if (!focusOrigin) {
|
|
// When a focused element becomes disabled, the browser *immediately* fires a blur event.
|
|
// Angular does not expect events to be raised during change detection, so any state change
|
|
// (such as a form control's 'ng-touched') will cause a changed-after-checked error.
|
|
// See https://github.com/angular/angular/issues/17793. To work around this, we defer
|
|
// telling the form control it has been touched until the next tick.
|
|
Promise.resolve().then(() => {
|
|
this._onTouched();
|
|
this._changeDetectorRef.markForCheck();
|
|
});
|
|
}
|
|
});
|
|
this._syncIndeterminate(this._indeterminate);
|
|
}
|
|
// TODO: Delete next major revision.
|
|
ngAfterViewChecked() { }
|
|
ngOnDestroy() {
|
|
this._focusMonitor.stopMonitoring(this._elementRef);
|
|
}
|
|
/**
|
|
* Whether the checkbox is checked.
|
|
*/
|
|
get checked() { return this._checked; }
|
|
set checked(value) {
|
|
if (value != this.checked) {
|
|
this._checked = value;
|
|
this._changeDetectorRef.markForCheck();
|
|
}
|
|
}
|
|
/**
|
|
* Whether the checkbox is disabled. This fully overrides the implementation provided by
|
|
* mixinDisabled, but the mixin is still required because mixinTabIndex requires it.
|
|
*/
|
|
get disabled() { return this._disabled; }
|
|
set disabled(value) {
|
|
const newValue = coerceBooleanProperty(value);
|
|
if (newValue !== this.disabled) {
|
|
this._disabled = newValue;
|
|
this._changeDetectorRef.markForCheck();
|
|
}
|
|
}
|
|
/**
|
|
* Whether the checkbox is indeterminate. This is also known as "mixed" mode and can be used to
|
|
* represent a checkbox with three states, e.g. a checkbox that represents a nested list of
|
|
* checkable items. Note that whenever checkbox is manually clicked, indeterminate is immediately
|
|
* set to false.
|
|
*/
|
|
get indeterminate() { return this._indeterminate; }
|
|
set indeterminate(value) {
|
|
const changed = value != this._indeterminate;
|
|
this._indeterminate = coerceBooleanProperty(value);
|
|
if (changed) {
|
|
if (this._indeterminate) {
|
|
this._transitionCheckState(3 /* Indeterminate */);
|
|
}
|
|
else {
|
|
this._transitionCheckState(this.checked ? 1 /* Checked */ : 2 /* Unchecked */);
|
|
}
|
|
this.indeterminateChange.emit(this._indeterminate);
|
|
}
|
|
this._syncIndeterminate(this._indeterminate);
|
|
}
|
|
_isRippleDisabled() {
|
|
return this.disableRipple || this.disabled;
|
|
}
|
|
/** Method being called whenever the label text changes. */
|
|
_onLabelTextChange() {
|
|
// Since the event of the `cdkObserveContent` directive runs outside of the zone, the checkbox
|
|
// component will be only marked for check, but no actual change detection runs automatically.
|
|
// Instead of going back into the zone in order to trigger a change detection which causes
|
|
// *all* components to be checked (if explicitly marked or not using OnPush), we only trigger
|
|
// an explicit change detection for the checkbox view and its children.
|
|
this._changeDetectorRef.detectChanges();
|
|
}
|
|
// Implemented as part of ControlValueAccessor.
|
|
writeValue(value) {
|
|
this.checked = !!value;
|
|
}
|
|
// Implemented as part of ControlValueAccessor.
|
|
registerOnChange(fn) {
|
|
this._controlValueAccessorChangeFn = fn;
|
|
}
|
|
// Implemented as part of ControlValueAccessor.
|
|
registerOnTouched(fn) {
|
|
this._onTouched = fn;
|
|
}
|
|
// Implemented as part of ControlValueAccessor.
|
|
setDisabledState(isDisabled) {
|
|
this.disabled = isDisabled;
|
|
}
|
|
_getAriaChecked() {
|
|
if (this.checked) {
|
|
return 'true';
|
|
}
|
|
return this.indeterminate ? 'mixed' : 'false';
|
|
}
|
|
_transitionCheckState(newState) {
|
|
let oldState = this._currentCheckState;
|
|
let element = this._elementRef.nativeElement;
|
|
if (oldState === newState) {
|
|
return;
|
|
}
|
|
if (this._currentAnimationClass.length > 0) {
|
|
element.classList.remove(this._currentAnimationClass);
|
|
}
|
|
this._currentAnimationClass = this._getAnimationClassForCheckStateTransition(oldState, newState);
|
|
this._currentCheckState = newState;
|
|
if (this._currentAnimationClass.length > 0) {
|
|
element.classList.add(this._currentAnimationClass);
|
|
// Remove the animation class to avoid animation when the checkbox is moved between containers
|
|
const animationClass = this._currentAnimationClass;
|
|
this._ngZone.runOutsideAngular(() => {
|
|
setTimeout(() => {
|
|
element.classList.remove(animationClass);
|
|
}, 1000);
|
|
});
|
|
}
|
|
}
|
|
_emitChangeEvent() {
|
|
const event = new MatCheckboxChange();
|
|
event.source = this;
|
|
event.checked = this.checked;
|
|
this._controlValueAccessorChangeFn(this.checked);
|
|
this.change.emit(event);
|
|
// Assigning the value again here is redundant, but we have to do it in case it was
|
|
// changed inside the `change` listener which will cause the input to be out of sync.
|
|
if (this._inputElement) {
|
|
this._inputElement.nativeElement.checked = this.checked;
|
|
}
|
|
}
|
|
/** Toggles the `checked` state of the checkbox. */
|
|
toggle() {
|
|
this.checked = !this.checked;
|
|
}
|
|
/**
|
|
* Event handler for checkbox input element.
|
|
* Toggles checked state if element is not disabled.
|
|
* Do not toggle on (change) event since IE doesn't fire change event when
|
|
* indeterminate checkbox is clicked.
|
|
* @param event
|
|
*/
|
|
_onInputClick(event) {
|
|
var _a;
|
|
const clickAction = (_a = this._options) === null || _a === void 0 ? void 0 : _a.clickAction;
|
|
// We have to stop propagation for click events on the visual hidden input element.
|
|
// By default, when a user clicks on a label element, a generated click event will be
|
|
// dispatched on the associated input element. Since we are using a label element as our
|
|
// root container, the click event on the `checkbox` will be executed twice.
|
|
// The real click event will bubble up, and the generated click event also tries to bubble up.
|
|
// This will lead to multiple click events.
|
|
// Preventing bubbling for the second event will solve that issue.
|
|
event.stopPropagation();
|
|
// If resetIndeterminate is false, and the current state is indeterminate, do nothing on click
|
|
if (!this.disabled && clickAction !== 'noop') {
|
|
// When user manually click on the checkbox, `indeterminate` is set to false.
|
|
if (this.indeterminate && clickAction !== 'check') {
|
|
Promise.resolve().then(() => {
|
|
this._indeterminate = false;
|
|
this.indeterminateChange.emit(this._indeterminate);
|
|
});
|
|
}
|
|
this.toggle();
|
|
this._transitionCheckState(this._checked ? 1 /* Checked */ : 2 /* Unchecked */);
|
|
// Emit our custom change event if the native input emitted one.
|
|
// It is important to only emit it, if the native input triggered one, because
|
|
// we don't want to trigger a change event, when the `checked` variable changes for example.
|
|
this._emitChangeEvent();
|
|
}
|
|
else if (!this.disabled && clickAction === 'noop') {
|
|
// Reset native input when clicked with noop. The native checkbox becomes checked after
|
|
// click, reset it to be align with `checked` value of `mat-checkbox`.
|
|
this._inputElement.nativeElement.checked = this.checked;
|
|
this._inputElement.nativeElement.indeterminate = this.indeterminate;
|
|
}
|
|
}
|
|
/** Focuses the checkbox. */
|
|
focus(origin, options) {
|
|
if (origin) {
|
|
this._focusMonitor.focusVia(this._inputElement, origin, options);
|
|
}
|
|
else {
|
|
this._inputElement.nativeElement.focus(options);
|
|
}
|
|
}
|
|
_onInteractionEvent(event) {
|
|
// We always have to stop propagation on the change event.
|
|
// Otherwise the change event, from the input element, will bubble up and
|
|
// emit its event object to the `change` output.
|
|
event.stopPropagation();
|
|
}
|
|
_getAnimationClassForCheckStateTransition(oldState, newState) {
|
|
// Don't transition if animations are disabled.
|
|
if (this._animationMode === 'NoopAnimations') {
|
|
return '';
|
|
}
|
|
let animSuffix = '';
|
|
switch (oldState) {
|
|
case 0 /* Init */:
|
|
// Handle edge case where user interacts with checkbox that does not have [(ngModel)] or
|
|
// [checked] bound to it.
|
|
if (newState === 1 /* Checked */) {
|
|
animSuffix = 'unchecked-checked';
|
|
}
|
|
else if (newState == 3 /* Indeterminate */) {
|
|
animSuffix = 'unchecked-indeterminate';
|
|
}
|
|
else {
|
|
return '';
|
|
}
|
|
break;
|
|
case 2 /* Unchecked */:
|
|
animSuffix = newState === 1 /* Checked */ ?
|
|
'unchecked-checked' : 'unchecked-indeterminate';
|
|
break;
|
|
case 1 /* Checked */:
|
|
animSuffix = newState === 2 /* Unchecked */ ?
|
|
'checked-unchecked' : 'checked-indeterminate';
|
|
break;
|
|
case 3 /* Indeterminate */:
|
|
animSuffix = newState === 1 /* Checked */ ?
|
|
'indeterminate-checked' : 'indeterminate-unchecked';
|
|
break;
|
|
}
|
|
return `mat-checkbox-anim-${animSuffix}`;
|
|
}
|
|
/**
|
|
* Syncs the indeterminate value with the checkbox DOM node.
|
|
*
|
|
* We sync `indeterminate` directly on the DOM node, because in Ivy the check for whether a
|
|
* property is supported on an element boils down to `if (propName in element)`. Domino's
|
|
* HTMLInputElement doesn't have an `indeterminate` property so Ivy will warn during
|
|
* server-side rendering.
|
|
*/
|
|
_syncIndeterminate(value) {
|
|
const nativeCheckbox = this._inputElement;
|
|
if (nativeCheckbox) {
|
|
nativeCheckbox.nativeElement.indeterminate = value;
|
|
}
|
|
}
|
|
}
|
|
MatCheckbox.ɵfac = function MatCheckbox_Factory(t) { return new (t || MatCheckbox)(ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ElementRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.ChangeDetectorRef), ɵngcc0.ɵɵdirectiveInject(ɵngcc1.FocusMonitor), ɵngcc0.ɵɵdirectiveInject(ɵngcc0.NgZone), ɵngcc0.ɵɵinjectAttribute('tabindex'), ɵngcc0.ɵɵdirectiveInject(ANIMATION_MODULE_TYPE, 8), ɵngcc0.ɵɵdirectiveInject(MAT_CHECKBOX_DEFAULT_OPTIONS, 8)); };
|
|
MatCheckbox.ɵcmp = /*@__PURE__*/ ɵngcc0.ɵɵdefineComponent({ type: MatCheckbox, selectors: [["mat-checkbox"]], viewQuery: function MatCheckbox_Query(rf, ctx) { if (rf & 1) {
|
|
ɵngcc0.ɵɵviewQuery(_c0, 5);
|
|
ɵngcc0.ɵɵviewQuery(MatRipple, 5);
|
|
} if (rf & 2) {
|
|
let _t;
|
|
ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx._inputElement = _t.first);
|
|
ɵngcc0.ɵɵqueryRefresh(_t = ɵngcc0.ɵɵloadQuery()) && (ctx.ripple = _t.first);
|
|
} }, hostAttrs: [1, "mat-checkbox"], hostVars: 12, hostBindings: function MatCheckbox_HostBindings(rf, ctx) { if (rf & 2) {
|
|
ɵngcc0.ɵɵhostProperty("id", ctx.id);
|
|
ɵngcc0.ɵɵattribute("tabindex", null);
|
|
ɵngcc0.ɵɵclassProp("mat-checkbox-indeterminate", ctx.indeterminate)("mat-checkbox-checked", ctx.checked)("mat-checkbox-disabled", ctx.disabled)("mat-checkbox-label-before", ctx.labelPosition == "before")("_mat-animation-noopable", ctx._animationMode === "NoopAnimations");
|
|
} }, inputs: { disableRipple: "disableRipple", color: "color", tabIndex: "tabIndex", ariaLabel: ["aria-label", "ariaLabel"], ariaLabelledby: ["aria-labelledby", "ariaLabelledby"], id: "id", labelPosition: "labelPosition", name: "name", required: "required", checked: "checked", disabled: "disabled", indeterminate: "indeterminate", ariaDescribedby: ["aria-describedby", "ariaDescribedby"], value: "value" }, outputs: { change: "change", indeterminateChange: "indeterminateChange" }, exportAs: ["matCheckbox"], features: [ɵngcc0.ɵɵProvidersFeature([MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR]), ɵngcc0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c2, decls: 17, vars: 21, consts: [[1, "mat-checkbox-layout"], ["label", ""], [1, "mat-checkbox-inner-container"], ["type", "checkbox", 1, "mat-checkbox-input", "cdk-visually-hidden", 3, "id", "required", "checked", "disabled", "tabIndex", "change", "click"], ["input", ""], ["matRipple", "", 1, "mat-checkbox-ripple", "mat-focus-indicator", 3, "matRippleTrigger", "matRippleDisabled", "matRippleRadius", "matRippleCentered", "matRippleAnimation"], [1, "mat-ripple-element", "mat-checkbox-persistent-ripple"], [1, "mat-checkbox-frame"], [1, "mat-checkbox-background"], ["version", "1.1", "focusable", "false", "viewBox", "0 0 24 24", 0, "xml", "space", "preserve", "aria-hidden", "true", 1, "mat-checkbox-checkmark"], ["fill", "none", "stroke", "white", "d", "M4.1,12.7 9,17.6 20.3,6.3", 1, "mat-checkbox-checkmark-path"], [1, "mat-checkbox-mixedmark"], [1, "mat-checkbox-label", 3, "cdkObserveContent"], ["checkboxLabel", ""], [2, "display", "none"]], template: function MatCheckbox_Template(rf, ctx) { if (rf & 1) {
|
|
ɵngcc0.ɵɵprojectionDef();
|
|
ɵngcc0.ɵɵelementStart(0, "label", 0, 1);
|
|
ɵngcc0.ɵɵelementStart(2, "span", 2);
|
|
ɵngcc0.ɵɵelementStart(3, "input", 3, 4);
|
|
ɵngcc0.ɵɵlistener("change", function MatCheckbox_Template_input_change_3_listener($event) { return ctx._onInteractionEvent($event); })("click", function MatCheckbox_Template_input_click_3_listener($event) { return ctx._onInputClick($event); });
|
|
ɵngcc0.ɵɵelementEnd();
|
|
ɵngcc0.ɵɵelementStart(5, "span", 5);
|
|
ɵngcc0.ɵɵelement(6, "span", 6);
|
|
ɵngcc0.ɵɵelementEnd();
|
|
ɵngcc0.ɵɵelement(7, "span", 7);
|
|
ɵngcc0.ɵɵelementStart(8, "span", 8);
|
|
ɵngcc0.ɵɵnamespaceSVG();
|
|
ɵngcc0.ɵɵelementStart(9, "svg", 9);
|
|
ɵngcc0.ɵɵelement(10, "path", 10);
|
|
ɵngcc0.ɵɵelementEnd();
|
|
ɵngcc0.ɵɵnamespaceHTML();
|
|
ɵngcc0.ɵɵelement(11, "span", 11);
|
|
ɵngcc0.ɵɵelementEnd();
|
|
ɵngcc0.ɵɵelementEnd();
|
|
ɵngcc0.ɵɵelementStart(12, "span", 12, 13);
|
|
ɵngcc0.ɵɵlistener("cdkObserveContent", function MatCheckbox_Template_span_cdkObserveContent_12_listener() { return ctx._onLabelTextChange(); });
|
|
ɵngcc0.ɵɵelementStart(14, "span", 14);
|
|
ɵngcc0.ɵɵtext(15, "\u00A0");
|
|
ɵngcc0.ɵɵelementEnd();
|
|
ɵngcc0.ɵɵprojection(16);
|
|
ɵngcc0.ɵɵelementEnd();
|
|
ɵngcc0.ɵɵelementEnd();
|
|
} if (rf & 2) {
|
|
const _r0 = ɵngcc0.ɵɵreference(1);
|
|
const _r2 = ɵngcc0.ɵɵreference(13);
|
|
ɵngcc0.ɵɵattribute("for", ctx.inputId);
|
|
ɵngcc0.ɵɵadvance(2);
|
|
ɵngcc0.ɵɵclassProp("mat-checkbox-inner-container-no-side-margin", !_r2.textContent || !_r2.textContent.trim());
|
|
ɵngcc0.ɵɵadvance(1);
|
|
ɵngcc0.ɵɵproperty("id", ctx.inputId)("required", ctx.required)("checked", ctx.checked)("disabled", ctx.disabled)("tabIndex", ctx.tabIndex);
|
|
ɵngcc0.ɵɵattribute("value", ctx.value)("name", ctx.name)("aria-label", ctx.ariaLabel || null)("aria-labelledby", ctx.ariaLabelledby)("aria-checked", ctx._getAriaChecked())("aria-describedby", ctx.ariaDescribedby);
|
|
ɵngcc0.ɵɵadvance(2);
|
|
ɵngcc0.ɵɵproperty("matRippleTrigger", _r0)("matRippleDisabled", ctx._isRippleDisabled())("matRippleRadius", 20)("matRippleCentered", true)("matRippleAnimation", ɵngcc0.ɵɵpureFunction1(19, _c1, ctx._animationMode === "NoopAnimations" ? 0 : 150));
|
|
} }, directives: [ɵngcc2.MatRipple, ɵngcc3.CdkObserveContent], styles: ["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"], encapsulation: 2, changeDetection: 0 });
|
|
MatCheckbox.ctorParameters = () => [
|
|
{ type: ElementRef },
|
|
{ type: ChangeDetectorRef },
|
|
{ type: FocusMonitor },
|
|
{ type: NgZone },
|
|
{ type: String, decorators: [{ type: Attribute, args: ['tabindex',] }] },
|
|
{ type: String, decorators: [{ type: Optional }, { type: Inject, args: [ANIMATION_MODULE_TYPE,] }] },
|
|
{ type: undefined, decorators: [{ type: Optional }, { type: Inject, args: [MAT_CHECKBOX_DEFAULT_OPTIONS,] }] }
|
|
];
|
|
MatCheckbox.propDecorators = {
|
|
ariaLabel: [{ type: Input, args: ['aria-label',] }],
|
|
ariaLabelledby: [{ type: Input, args: ['aria-labelledby',] }],
|
|
ariaDescribedby: [{ type: Input, args: ['aria-describedby',] }],
|
|
id: [{ type: Input }],
|
|
required: [{ type: Input }],
|
|
labelPosition: [{ type: Input }],
|
|
name: [{ type: Input }],
|
|
change: [{ type: Output }],
|
|
indeterminateChange: [{ type: Output }],
|
|
value: [{ type: Input }],
|
|
_inputElement: [{ type: ViewChild, args: ['input',] }],
|
|
ripple: [{ type: ViewChild, args: [MatRipple,] }],
|
|
checked: [{ type: Input }],
|
|
disabled: [{ type: Input }],
|
|
indeterminate: [{ type: Input }]
|
|
};
|
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(MatCheckbox, [{
|
|
type: Component,
|
|
args: [{
|
|
selector: 'mat-checkbox',
|
|
template: "<label [attr.for]=\"inputId\" class=\"mat-checkbox-layout\" #label>\n <span class=\"mat-checkbox-inner-container\"\n [class.mat-checkbox-inner-container-no-side-margin]=\"!checkboxLabel.textContent || !checkboxLabel.textContent.trim()\">\n <input #input\n class=\"mat-checkbox-input cdk-visually-hidden\" type=\"checkbox\"\n [id]=\"inputId\"\n [required]=\"required\"\n [checked]=\"checked\"\n [attr.value]=\"value\"\n [disabled]=\"disabled\"\n [attr.name]=\"name\"\n [tabIndex]=\"tabIndex\"\n [attr.aria-label]=\"ariaLabel || null\"\n [attr.aria-labelledby]=\"ariaLabelledby\"\n [attr.aria-checked]=\"_getAriaChecked()\"\n [attr.aria-describedby]=\"ariaDescribedby\"\n (change)=\"_onInteractionEvent($event)\"\n (click)=\"_onInputClick($event)\">\n <span matRipple class=\"mat-checkbox-ripple mat-focus-indicator\"\n [matRippleTrigger]=\"label\"\n [matRippleDisabled]=\"_isRippleDisabled()\"\n [matRippleRadius]=\"20\"\n [matRippleCentered]=\"true\"\n [matRippleAnimation]=\"{enterDuration: _animationMode === 'NoopAnimations' ? 0 : 150}\">\n <span class=\"mat-ripple-element mat-checkbox-persistent-ripple\"></span>\n </span>\n <span class=\"mat-checkbox-frame\"></span>\n <span class=\"mat-checkbox-background\">\n <svg version=\"1.1\"\n focusable=\"false\"\n class=\"mat-checkbox-checkmark\"\n viewBox=\"0 0 24 24\"\n xml:space=\"preserve\"\n aria-hidden=\"true\">\n <path class=\"mat-checkbox-checkmark-path\"\n fill=\"none\"\n stroke=\"white\"\n d=\"M4.1,12.7 9,17.6 20.3,6.3\"/>\n </svg>\n <!-- Element for rendering the indeterminate state checkbox. -->\n <span class=\"mat-checkbox-mixedmark\"></span>\n </span>\n </span>\n <span class=\"mat-checkbox-label\" #checkboxLabel (cdkObserveContent)=\"_onLabelTextChange()\">\n <!-- Add an invisible span so JAWS can read the label -->\n <span style=\"display:none\"> </span>\n <ng-content></ng-content>\n </span>\n</label>\n",
|
|
exportAs: 'matCheckbox',
|
|
host: {
|
|
'class': 'mat-checkbox',
|
|
'[id]': 'id',
|
|
'[attr.tabindex]': 'null',
|
|
'[class.mat-checkbox-indeterminate]': 'indeterminate',
|
|
'[class.mat-checkbox-checked]': 'checked',
|
|
'[class.mat-checkbox-disabled]': 'disabled',
|
|
'[class.mat-checkbox-label-before]': 'labelPosition == "before"',
|
|
'[class._mat-animation-noopable]': `_animationMode === 'NoopAnimations'`
|
|
},
|
|
providers: [MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR],
|
|
inputs: ['disableRipple', 'color', 'tabIndex'],
|
|
encapsulation: ViewEncapsulation.None,
|
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
styles: ["@keyframes mat-checkbox-fade-in-background{0%{opacity:0}50%{opacity:1}}@keyframes mat-checkbox-fade-out-background{0%,50%{opacity:1}100%{opacity:0}}@keyframes mat-checkbox-unchecked-checked-checkmark-path{0%,50%{stroke-dashoffset:22.910259}50%{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1)}100%{stroke-dashoffset:0}}@keyframes mat-checkbox-unchecked-indeterminate-mixedmark{0%,68.2%{transform:scaleX(0)}68.2%{animation-timing-function:cubic-bezier(0, 0, 0, 1)}100%{transform:scaleX(1)}}@keyframes mat-checkbox-checked-unchecked-checkmark-path{from{animation-timing-function:cubic-bezier(0.4, 0, 1, 1);stroke-dashoffset:0}to{stroke-dashoffset:-22.910259}}@keyframes mat-checkbox-checked-indeterminate-checkmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(45deg)}}@keyframes mat-checkbox-indeterminate-checked-checkmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:0;transform:rotate(45deg)}to{opacity:1;transform:rotate(360deg)}}@keyframes mat-checkbox-checked-indeterminate-mixedmark{from{animation-timing-function:cubic-bezier(0, 0, 0.2, 0.1);opacity:0;transform:rotate(-45deg)}to{opacity:1;transform:rotate(0deg)}}@keyframes mat-checkbox-indeterminate-checked-mixedmark{from{animation-timing-function:cubic-bezier(0.14, 0, 0, 1);opacity:1;transform:rotate(0deg)}to{opacity:0;transform:rotate(315deg)}}@keyframes mat-checkbox-indeterminate-unchecked-mixedmark{0%{animation-timing-function:linear;opacity:1;transform:scaleX(1)}32.8%,100%{opacity:0;transform:scaleX(0)}}.mat-checkbox-background,.mat-checkbox-frame{top:0;left:0;right:0;bottom:0;position:absolute;border-radius:2px;box-sizing:border-box;pointer-events:none}.mat-checkbox{display:inline-block;transition:background 400ms cubic-bezier(0.25, 0.8, 0.25, 1),box-shadow 280ms cubic-bezier(0.4, 0, 0.2, 1);cursor:pointer;-webkit-tap-highlight-color:transparent}._mat-animation-noopable.mat-checkbox{transition:none;animation:none}.mat-checkbox .mat-ripple-element:not(.mat-checkbox-persistent-ripple){opacity:.16}.mat-checkbox .mat-checkbox-ripple{position:absolute;left:calc(50% - 20px);top:calc(50% - 20px);height:40px;width:40px;z-index:1;pointer-events:none}.cdk-high-contrast-active .mat-checkbox.cdk-keyboard-focused .mat-checkbox-ripple{outline:solid 3px}.mat-checkbox-layout{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:inherit;align-items:baseline;vertical-align:middle;display:inline-flex;white-space:nowrap}.mat-checkbox-label{-webkit-user-select:auto;-moz-user-select:auto;-ms-user-select:auto;user-select:auto}.mat-checkbox-inner-container{display:inline-block;height:16px;line-height:0;margin:auto;margin-right:8px;order:0;position:relative;vertical-align:middle;white-space:nowrap;width:16px;flex-shrink:0}[dir=rtl] .mat-checkbox-inner-container{margin-left:8px;margin-right:auto}.mat-checkbox-inner-container-no-side-margin{margin-left:0;margin-right:0}.mat-checkbox-frame{background-color:transparent;transition:border-color 90ms cubic-bezier(0, 0, 0.2, 0.1);border-width:2px;border-style:solid}._mat-animation-noopable .mat-checkbox-frame{transition:none}.mat-checkbox-background{align-items:center;display:inline-flex;justify-content:center;transition:background-color 90ms cubic-bezier(0, 0, 0.2, 0.1),opacity 90ms cubic-bezier(0, 0, 0.2, 0.1);-webkit-print-color-adjust:exact;color-adjust:exact}._mat-animation-noopable .mat-checkbox-background{transition:none}.cdk-high-contrast-active .mat-checkbox .mat-checkbox-background{background:none}.mat-checkbox-persistent-ripple{display:block;width:100%;height:100%;transform:none}.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:.04}.mat-checkbox.cdk-keyboard-focused .mat-checkbox-persistent-ripple{opacity:.12}.mat-checkbox-persistent-ripple,.mat-checkbox.mat-checkbox-disabled .mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{opacity:0}@media(hover: none){.mat-checkbox-inner-container:hover .mat-checkbox-persistent-ripple{display:none}}.mat-checkbox-checkmark{top:0;left:0;right:0;bottom:0;position:absolute;width:100%}.mat-checkbox-checkmark-path{stroke-dashoffset:22.910259;stroke-dasharray:22.910259;stroke-width:2.1333333333px}.cdk-high-contrast-black-on-white .mat-checkbox-checkmark-path{stroke:#000 !important}.mat-checkbox-mixedmark{width:calc(100% - 6px);height:2px;opacity:0;transform:scaleX(0) rotate(0deg);border-radius:2px}.cdk-high-contrast-active .mat-checkbox-mixedmark{height:0;border-top:solid 2px;margin-top:2px}.mat-checkbox-label-before .mat-checkbox-inner-container{order:1;margin-left:8px;margin-right:auto}[dir=rtl] .mat-checkbox-label-before .mat-checkbox-inner-container{margin-left:auto;margin-right:8px}.mat-checkbox-checked .mat-checkbox-checkmark{opacity:1}.mat-checkbox-checked .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-checked .mat-checkbox-mixedmark{transform:scaleX(1) rotate(-45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark{opacity:0;transform:rotate(45deg)}.mat-checkbox-indeterminate .mat-checkbox-checkmark-path{stroke-dashoffset:0}.mat-checkbox-indeterminate .mat-checkbox-mixedmark{opacity:1;transform:scaleX(1) rotate(0deg)}.mat-checkbox-unchecked .mat-checkbox-background{background-color:transparent}.mat-checkbox-disabled{cursor:default}.cdk-high-contrast-active .mat-checkbox-disabled{opacity:.5}.mat-checkbox-anim-unchecked-checked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-checked .mat-checkbox-checkmark-path{animation:180ms linear 0ms mat-checkbox-unchecked-checked-checkmark-path}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-in-background}.mat-checkbox-anim-unchecked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-unchecked-indeterminate-mixedmark}.mat-checkbox-anim-checked-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-checked-unchecked .mat-checkbox-checkmark-path{animation:90ms linear 0ms mat-checkbox-checked-unchecked-checkmark-path}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-checkmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-checkmark}.mat-checkbox-anim-checked-indeterminate .mat-checkbox-mixedmark{animation:90ms linear 0ms mat-checkbox-checked-indeterminate-mixedmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-checkmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-checkmark}.mat-checkbox-anim-indeterminate-checked .mat-checkbox-mixedmark{animation:500ms linear 0ms mat-checkbox-indeterminate-checked-mixedmark}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-background{animation:180ms linear 0ms mat-checkbox-fade-out-background}.mat-checkbox-anim-indeterminate-unchecked .mat-checkbox-mixedmark{animation:300ms linear 0ms mat-checkbox-indeterminate-unchecked-mixedmark}.mat-checkbox-input{bottom:0;left:50%}\n"]
|
|
}]
|
|
}], function () { return [{ type: ɵngcc0.ElementRef }, { type: ɵngcc0.ChangeDetectorRef }, { type: ɵngcc1.FocusMonitor }, { type: ɵngcc0.NgZone }, { type: String, decorators: [{
|
|
type: Attribute,
|
|
args: ['tabindex']
|
|
}] }, { type: String, decorators: [{
|
|
type: Optional
|
|
}, {
|
|
type: Inject,
|
|
args: [ANIMATION_MODULE_TYPE]
|
|
}] }, { type: undefined, decorators: [{
|
|
type: Optional
|
|
}, {
|
|
type: Inject,
|
|
args: [MAT_CHECKBOX_DEFAULT_OPTIONS]
|
|
}] }]; }, { ariaLabel: [{
|
|
type: Input,
|
|
args: ['aria-label']
|
|
}], ariaLabelledby: [{
|
|
type: Input,
|
|
args: ['aria-labelledby']
|
|
}], id: [{
|
|
type: Input
|
|
}], labelPosition: [{
|
|
type: Input
|
|
}], name: [{
|
|
type: Input
|
|
}], change: [{
|
|
type: Output
|
|
}], indeterminateChange: [{
|
|
type: Output
|
|
}], required: [{
|
|
type: Input
|
|
}], checked: [{
|
|
type: Input
|
|
}], disabled: [{
|
|
type: Input
|
|
}], indeterminate: [{
|
|
type: Input
|
|
}], ariaDescribedby: [{
|
|
type: Input,
|
|
args: ['aria-describedby']
|
|
}], value: [{
|
|
type: Input
|
|
}], _inputElement: [{
|
|
type: ViewChild,
|
|
args: ['input']
|
|
}], ripple: [{
|
|
type: ViewChild,
|
|
args: [MatRipple]
|
|
}] }); })();
|
|
|
|
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
const MAT_CHECKBOX_REQUIRED_VALIDATOR = {
|
|
provide: NG_VALIDATORS,
|
|
useExisting: forwardRef(() => MatCheckboxRequiredValidator),
|
|
multi: true
|
|
};
|
|
/**
|
|
* Validator for Material checkbox's required attribute in template-driven checkbox.
|
|
* Current CheckboxRequiredValidator only work with `input type=checkbox` and does not
|
|
* work with `mat-checkbox`.
|
|
*/
|
|
class MatCheckboxRequiredValidator extends CheckboxRequiredValidator {
|
|
}
|
|
MatCheckboxRequiredValidator.ɵfac = /*@__PURE__*/ function () { let ɵMatCheckboxRequiredValidator_BaseFactory; return function MatCheckboxRequiredValidator_Factory(t) { return (ɵMatCheckboxRequiredValidator_BaseFactory || (ɵMatCheckboxRequiredValidator_BaseFactory = ɵngcc0.ɵɵgetInheritedFactory(MatCheckboxRequiredValidator)))(t || MatCheckboxRequiredValidator); }; }();
|
|
MatCheckboxRequiredValidator.ɵdir = /*@__PURE__*/ ɵngcc0.ɵɵdefineDirective({ type: MatCheckboxRequiredValidator, selectors: [["mat-checkbox", "required", "", "formControlName", ""], ["mat-checkbox", "required", "", "formControl", ""], ["mat-checkbox", "required", "", "ngModel", ""]], features: [ɵngcc0.ɵɵProvidersFeature([MAT_CHECKBOX_REQUIRED_VALIDATOR]), ɵngcc0.ɵɵInheritDefinitionFeature] });
|
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(MatCheckboxRequiredValidator, [{
|
|
type: Directive,
|
|
args: [{
|
|
selector: `mat-checkbox[required][formControlName],
|
|
mat-checkbox[required][formControl], mat-checkbox[required][ngModel]`,
|
|
providers: [MAT_CHECKBOX_REQUIRED_VALIDATOR]
|
|
}]
|
|
}], null, null); })();
|
|
|
|
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
/** This module is used by both original and MDC-based checkbox implementations. */
|
|
class _MatCheckboxRequiredValidatorModule {
|
|
}
|
|
_MatCheckboxRequiredValidatorModule.ɵfac = function _MatCheckboxRequiredValidatorModule_Factory(t) { return new (t || _MatCheckboxRequiredValidatorModule)(); };
|
|
_MatCheckboxRequiredValidatorModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: _MatCheckboxRequiredValidatorModule });
|
|
_MatCheckboxRequiredValidatorModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({});
|
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(_MatCheckboxRequiredValidatorModule, [{
|
|
type: NgModule,
|
|
args: [{
|
|
exports: [MatCheckboxRequiredValidator],
|
|
declarations: [MatCheckboxRequiredValidator]
|
|
}]
|
|
}], null, null); })();
|
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(_MatCheckboxRequiredValidatorModule, { declarations: [MatCheckboxRequiredValidator], exports: [MatCheckboxRequiredValidator] }); })();
|
|
class MatCheckboxModule {
|
|
}
|
|
MatCheckboxModule.ɵfac = function MatCheckboxModule_Factory(t) { return new (t || MatCheckboxModule)(); };
|
|
MatCheckboxModule.ɵmod = /*@__PURE__*/ ɵngcc0.ɵɵdefineNgModule({ type: MatCheckboxModule });
|
|
MatCheckboxModule.ɵinj = /*@__PURE__*/ ɵngcc0.ɵɵdefineInjector({ imports: [[
|
|
MatRippleModule, MatCommonModule, ObserversModule,
|
|
_MatCheckboxRequiredValidatorModule
|
|
], MatCommonModule, _MatCheckboxRequiredValidatorModule] });
|
|
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && ɵngcc0.ɵsetClassMetadata(MatCheckboxModule, [{
|
|
type: NgModule,
|
|
args: [{
|
|
imports: [
|
|
MatRippleModule, MatCommonModule, ObserversModule,
|
|
_MatCheckboxRequiredValidatorModule
|
|
],
|
|
exports: [MatCheckbox, MatCommonModule, _MatCheckboxRequiredValidatorModule],
|
|
declarations: [MatCheckbox]
|
|
}]
|
|
}], null, null); })();
|
|
(function () { (typeof ngJitMode === "undefined" || ngJitMode) && ɵngcc0.ɵɵsetNgModuleScope(MatCheckboxModule, { declarations: function () { return [MatCheckbox]; }, imports: function () { return [MatRippleModule, MatCommonModule, ObserversModule, _MatCheckboxRequiredValidatorModule]; }, exports: function () { return [MatCheckbox, MatCommonModule, _MatCheckboxRequiredValidatorModule]; } }); })();
|
|
|
|
/**
|
|
* @license
|
|
* Copyright Google LLC All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
/**
|
|
* Generated bundle index. Do not edit.
|
|
*/
|
|
|
|
export { MAT_CHECKBOX_CONTROL_VALUE_ACCESSOR, MAT_CHECKBOX_DEFAULT_OPTIONS, MAT_CHECKBOX_DEFAULT_OPTIONS_FACTORY, MAT_CHECKBOX_REQUIRED_VALIDATOR, MatCheckbox, MatCheckboxChange, MatCheckboxModule, MatCheckboxRequiredValidator, _MatCheckboxRequiredValidatorModule };
|
|
|
|
//# sourceMappingURL=checkbox.js.map
|