/** * @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_SLIDE_TOGGLE_REQUIRED_VALIDATOR = { provide: NG_VALIDATORS, useExisting: forwardRef(() => MatSlideToggleRequiredValidator), multi: true, }; /** * Validator for Material slide-toggle components with the required attribute in a * template-driven form. The default validator for required form controls asserts * that the control value is not undefined but that is not appropriate for a slide-toggle * where the value is always defined. * * Required slide-toggle form controls are valid when checked. */ export class MatSlideToggleRequiredValidator extends CheckboxRequiredValidator { static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatSlideToggleRequiredValidator, deps: null, target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: MatSlideToggleRequiredValidator, selector: "mat-slide-toggle[required][formControlName],\n mat-slide-toggle[required][formControl], mat-slide-toggle[required][ngModel]", providers: [MAT_SLIDE_TOGGLE_REQUIRED_VALIDATOR], usesInheritance: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: MatSlideToggleRequiredValidator, decorators: [{ type: Directive, args: [{ selector: `mat-slide-toggle[required][formControlName], mat-slide-toggle[required][formControl], mat-slide-toggle[required][ngModel]`, providers: [MAT_SLIDE_TOGGLE_REQUIRED_VALIDATOR], }] }] }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2xpZGUtdG9nZ2xlLXJlcXVpcmVkLXZhbGlkYXRvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3NyYy9tYXRlcmlhbC9zbGlkZS10b2dnbGUvc2xpZGUtd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