/** * @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 */ import { Directive, forwardRef } from '@angular/core'; import { CheckboxRequiredValidator, NG_VALIDATORS } from '@angular/forms'; import * as i0 from "@angular/core"; export 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`. */ export class MatCheckboxRequiredValidator extends CheckboxRequiredValidator { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatCheckboxRequiredValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: MatCheckboxRequiredValidator, selector: "mat-checkbox[required][formControlName],\n mat-checkbox[required][formControl], mat-checkbox[required][ngModel]", providers: [MAT_CHECKBOX_REQUIRED_VALIDATOR], usesInheritance: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatCheckboxRequiredValidator, decorators: [{ type: Directive, args: [{ selector: `mat-checkbox[required][formControlName], mat-checkbox[required][formControl], mat-checkbox[required][ngModel]`, providers: [MAT_CHECKBOX_REQUIRED_VALIDATOR], }] }] }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hlY2tib3gtcmVxdWlyZWQtdmFsaWRhdG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vc3JjL21hdGVyaWFsL2NoZWNrYm94L2NoZWNrYm94LXJlcXVpcmVkLXZhbGlkYXRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs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