/** * @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 } from '@angular/core'; import { CdkMenuItemSelectable } from './menu-item-selectable'; import { CdkMenuItem } from './menu-item'; import * as i0 from "@angular/core"; /** * A directive providing behavior for the "menuitemcheckbox" ARIA role, which behaves similarly to a * conventional checkbox. */ export class CdkMenuItemCheckbox extends CdkMenuItemSelectable { /** * Toggle the checked state of the checkbox. * @param options Options the configure how the item is triggered * - keepOpen: specifies that the menu should be kept open after triggering the item. */ trigger(options) { super.trigger(options); if (!this.disabled) { this.checked = !this.checked; } } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkMenuItemCheckbox, deps: null, target: i0.ɵɵFactoryTarget.Directive }); } static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.1.1", type: CdkMenuItemCheckbox, isStandalone: true, selector: "[cdkMenuItemCheckbox]", host: { attributes: { "role": "menuitemcheckbox" }, properties: { "class.cdk-menu-item-checkbox": "true" } }, providers: [ { provide: CdkMenuItemSelectable, useExisting: CdkMenuItemCheckbox }, { provide: CdkMenuItem, useExisting: CdkMenuItemSelectable }, ], exportAs: ["cdkMenuItemCheckbox"], usesInheritance: true, ngImport: i0 }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.1", ngImport: i0, type: CdkMenuItemCheckbox, decorators: [{ type: Directive, args: [{ selector: '[cdkMenuItemCheckbox]', exportAs: 'cdkMenuItemCheckbox', standalone: true, host: { 'role': 'menuitemcheckbox', '[class.cdk-menu-item-checkbox]': 'true', }, providers: [ { provide: CdkMenuItemSelectable, useExisting: CdkMenuItemCheckbox }, { provide: CdkMenuItem, useExisting: CdkMenuItemSelectable }, ], }] }] }); //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVudS1pdGVtLWNoZWNrYm94LmpzIiwic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