import { EventEmitter, OnDestroy, ElementRef, ChangeDetectorRef } from "@angular/core"; import { ControlValueAccessor, NgControl } from "@angular/forms"; import { IdService } from "../shared/services/id.service"; import { Observable } from "rxjs"; export interface CheckboxUpdateEvent { id: string; checked: boolean; } /** * Defines the set of states for a checkbox component. */ export declare enum CheckboxState { Init = 0, Indeterminate = 1, Checked = 2, Unchecked = 3 } export declare class CheckboxUpdate { id: string; checked: boolean; } export declare class CheckboxComponent implements ControlValueAccessor, OnDestroy { private idService; protected changeDetectorRef: ChangeDetectorRef; private controlDirective; id: string; disabled: boolean; name: string; labelSrOnly: boolean; label: string; wrapperClass: any; ariaLabel: any; checkboxRef: ElementRef; checkboxWrap: ElementRef; mouseoutObservable: Observable; /** * Set the checkbox's indeterminate state to match the parameter and transition the view to reflect the change. * * Allows double binding with the `indeterminateChange` Output. */ /** * Reflects whether the checkbox state is indeterminate. */ indeterminate: boolean; /** * Sets the `checked` state. `true` for checked, `false` for unchecked * * Allows double binding with the `checkBoxUpdate` Output. */ /** * Returns value `true` if state is selected for the checkbox. */ checked: boolean; /** * Emits click event. * Event emitter that allows you to control the model manually * @deprecated use `checkBoxUpdate` instead */ click: EventEmitter; /** * Emits click event. * Event emitter that allows you to control the model manually */ onClickEmitter: EventEmitter; /** * Emits click event without giving parent component control.. */ checkBoxClick: EventEmitter; /** * Emits event notifying other classes when a change in state occurs on a checkbox after a * click. * * @deprecated use `checkBoxUpdate` instead */ change: EventEmitter; /** * Emits an event when the value of the checkbox changes. * * Allows double biding with the `checked` Input. */ checkBoxUpdate: EventEmitter; /** * Emits event notifying other classes when a change in state occurs specifically * on an indeterminate checkbox. */ indeterminateChange: EventEmitter; /** * Set to `true` if the input checkbox is selected (or checked). */ _checked: boolean; /** * Set to `true` if the input checkbox is in state indeterminate. */ _indeterminate: boolean; /** * Keeps a reference to the checkboxes current state, as defined in `CheckboxState`. */ currentCheckboxState: CheckboxState; constructor(idService: IdService, changeDetectorRef: ChangeDetectorRef, controlDirective: NgControl); ngOnDestroy(): void; /** * Toggle the selected state of the checkbox. */ toggle(): void; /** * Writes a value from `ngModel` to the component. * * In this case the value is the `checked` property. * * @param value boolean, corresponds to the `checked` property. */ writeValue(value: any): void; /** * Sets a method in order to propagate changes back to the form. */ registerOnChange(fn: any): void; /** * Registers a callback to be triggered when the control has been touched. * @param fn Callback to be triggered when the checkbox is touched. */ registerOnTouched(fn: any): void; /** * `ControlValueAccessor` method to programmatically disable the checkbox. * * ex: `this.formGroup.get("myCheckbox").disable();` * * @param isDisabled `true` to disable the checkbox */ setDisabledState(isDisabled: boolean): void; focusOut(): void; /** * Executes on the event of a change within `Checkbox` to block propagation. */ onChange(event: Event): void; /** * Handles click events on the `Checkbox` and emits changes to other classes. */ onClick(event: Event): void; /** * Called when checkbox is blurred. Needed to properly implement `ControlValueAccessor`. */ onTouched: () => any; /** * Handles changes between checkbox states. */ transitionCheckboxState(newState: CheckboxState): void; /** * Creates instance of `CheckboxChange` used to propagate the change event. */ emitChangeEvent(): void; /** * Method set in `registerOnChange` to propagate changes back to the form. */ propagateChange: (_: any) => void; /** * Sets checked state and optionally resets indeterminate state. */ private setChecked; removeFocus(): void; classGen(): {}; ariaGen(): any; }