import * as _angular_core from '@angular/core'; import { AfterContentInit, OnDestroy, ElementRef } from '@angular/core'; import { BooleanInput } from '@angular/cdk/coercion'; import { ControlValueAccessor } from '@angular/forms'; import { ChangeFn, TouchFn } from '@spartan-ng/brain/forms'; import * as i1 from '@spartan-ng/brain/field'; declare const BRN_CHECKBOX_VALUE_ACCESSOR: { provide: _angular_core.InjectionToken; useExisting: _angular_core.Type; multi: boolean; }; declare class BrnCheckbox implements ControlValueAccessor, AfterContentInit, OnDestroy { private readonly _destroyRef; private readonly _renderer; private readonly _elementRef; private readonly _focusMonitor; private readonly _cdr; private readonly _fieldControl; private readonly _document; private readonly _isBrowser; protected readonly _focusVisible: _angular_core.WritableSignal; protected readonly _focused: _angular_core.WritableSignal; /** * The checked state of the checkbox. * Can be bound with [(checked)] for two-way binding. */ readonly checkedInput: _angular_core.InputSignalWithTransform; readonly checked: _angular_core.WritableSignal; /** Emits when checked state changes. */ readonly checkedChange: _angular_core.OutputEmitterRef; /** * Read-only signal of current checkbox state. * Use this when you only need to read state without changing it. */ readonly isChecked: _angular_core.Signal; readonly indeterminate: _angular_core.ModelSignal; /** * Computed data-state attribute value based on checked state. * Returns 'checked', 'unchecked', or 'indeterminate'. */ protected readonly _dataState: _angular_core.Signal<"checked" | "indeterminate" | "unchecked">; /** * Computed aria-checked attribute value for accessibility. * Returns 'true', 'false', or 'mixed' (for indeterminate). */ protected readonly _ariaChecked: _angular_core.Signal<"mixed" | "true" | "false">; /** * Unique identifier for checkbox component. * When provided, inner button gets ID without '-checkbox' suffix. * Auto-generates ID if not provided. */ readonly id: _angular_core.InputSignal; /** * Form control name for checkbox. * When provided, inner button gets name without '-checkbox' suffix. */ readonly name: _angular_core.InputSignal; /** * CSS classes applied to inner button element. */ readonly class: _angular_core.InputSignal; /** * Styles applied to the host element. Bound via `[style]` so they apply through the CSSOM and are * not blocked by a strict Content-Security-Policy. */ readonly hostStyles: _angular_core.InputSignal; /** * Accessibility label for screen readers. * Use when no visible label exists. */ readonly ariaLabel: _angular_core.InputSignal; /** * ID of element that labels this checkbox for accessibility. * Auto-set when checkbox is inside label element. */ readonly ariaLabelledby: _angular_core.InputSignal; readonly mutableAriaLabelledby: _angular_core.WritableSignal; /** * ID of element that describes this checkbox for accessibility. */ readonly ariaDescribedby: _angular_core.InputSignal; /** * Whether checkbox is required in a form. */ readonly requiredInput: _angular_core.InputSignalWithTransform; private readonly _hostRequired; readonly required: _angular_core.Signal; /** * Whether checkbox is disabled. * Disabled checkboxes cannot be toggled and indicate disabled state through data-disabled attribute. */ readonly disabled: _angular_core.InputSignalWithTransform; /** * Whether to force the field into an invalid state, regardless of the form control's state. * Overrides both the `data-invalid` and `data-matches-spartan-invalid` attributes. */ readonly forceInvalid: _angular_core.InputSignalWithTransform; /** * Computed state for checkbox container and accessibility. * Manages ID, name, and disabled state. */ protected readonly _state: _angular_core.Signal<{ disabled: _angular_core.WritableSignal; name: string | null; id: string | null; }>; protected readonly _buttonId: _angular_core.Signal; protected readonly _buttonName: _angular_core.Signal; readonly labelableId: _angular_core.Signal; protected readonly _dirty: _angular_core.Signal | undefined; protected readonly _invalid: _angular_core.Signal; readonly spartanInvalid: _angular_core.Signal; protected readonly _controlTouched: _angular_core.Signal | undefined; protected _onChange: ChangeFn; private _onTouched; /** * Reference to the checkbox button element in the template. */ readonly checkbox: _angular_core.Signal>; /** * Event emitted when checkbox is blurred (loses focus). * Used for form validation. */ readonly touched: _angular_core.OutputEmitterRef; constructor(); /** * Toggles checkbox between checked/unchecked states. * If checkbox is indeterminate, sets to checked. * Does nothing if checkbox is disabled. */ toggle(): void; ngAfterContentInit(): void; private _handleBlur; ngOnDestroy(): void; /** * Gets proper ID for inner button element. * Removes '-checkbox' suffix if present in container ID. * * @param idPassedToContainer - ID applied to container element * @returns ID to use for inner button or null */ protected _getCheckboxButtonId(idPassedToContainer: string | null | undefined): string | null; /** * Updates internal state when control value changes from outside. * Handles boolean and 'indeterminate' values. * Part of ControlValueAccessor interface. * * @param value - New checkbox state (true/false/'indeterminate') */ writeValue(value: boolean): void; /** * Registers callback for value changes. * Part of ControlValueAccessor interface. * * @param fn - Function to call when value changes */ registerOnChange(fn: ChangeFn): void; /** * Registers callback for touched events. * Part of ControlValueAccessor interface. * * @param fn - Function to call when control is touched */ registerOnTouched(fn: TouchFn): void; /** * Updates disabled state from form control. * Part of ControlValueAccessor interface. * * @param isDisabled - Whether checkbox should be disabled */ setDisabledState(isDisabled: boolean): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } declare const BrnCheckboxImports: readonly [typeof BrnCheckbox]; export { BRN_CHECKBOX_VALUE_ACCESSOR, BrnCheckbox, BrnCheckboxImports };