import * as _angular_core from '@angular/core'; import { InjectionToken, Signal } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; /** * Two-state checkbox. * * **Standalone mode** — boolean value, works as a `ControlValueAccessor`: * * @example * ```html * I agree * ``` * * **Inside ``** — the checkbox's `value` is added to * or removed from the group's array. The standalone CVA is ignored. * * @example * ```html * * Autosave * Notifications * * ``` * * @see https://ngwr.dev/components/checkbox */ type WrCheckboxSize = 'sm' | 'md' | 'lg'; declare class WrCheckbox implements ControlValueAccessor { /** * Stable id used to associate the native input with its label. * * @default Randomly generated */ readonly id: _angular_core.InputSignal; /** * Per-checkbox value used only when inside a ``. * Ignored in standalone mode. */ readonly value: _angular_core.InputSignal; /** * Disable the checkbox. Also set automatically by Angular forms. * * @default false */ readonly disabled: _angular_core.InputSignalWithTransform; /** Control size — shares the `--wr-control-*` contract. @default 'md' */ readonly size: _angular_core.InputSignal; /** * Optional icon name rendered inside the box when checked, in place of the * default checkmark. Use any registered NGWR icon. */ readonly icon: _angular_core.InputSignal; private readonly group; protected readonly standaloneChecked: _angular_core.WritableSignal; protected readonly standaloneDisabledFromCva: _angular_core.WritableSignal; /** Derived "is checked". Reads from group when grouped, else local state. */ protected readonly checked: _angular_core.Signal; /** Effective disabled — input wins, then group, then CVA. */ protected readonly effectiveDisabled: _angular_core.Signal; protected readonly classes: _angular_core.Signal; private onChange; private onTouched; writeValue(value: boolean | null): void; registerOnChange(fn: (value: boolean) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; protected onInputChange(event: Event): void; protected onInputBlur(): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } /** * @license * * Use of this source code is governed by an MIT-style license that can be * found in the LICENSE file at https://github.com/thekhegay/ngwr/blob/main/LICENSE */ /** * Contract a checkbox uses to talk to its parent ``. * * @internal */ interface WrCheckboxGroupContext { /** Is the given value currently selected? */ isSelected(value: unknown): boolean; /** Toggle the given value in the group. */ toggle(value: unknown): void; /** Whether the entire group is disabled. */ readonly isDisabled: Signal; } /** * Token a `` injects to read selection state from — and * toggle values in — its parent `` (when present). * * @internal */ declare const WR_CHECKBOX_GROUP: InjectionToken; /** * Manages a group of `` children as a single form value * (an array of the checked items' `value` inputs). * * @example * ```html * * Autosave * Notifications * Dark mode * * ``` * * @see https://ngwr.dev/components/checkbox */ declare class WrCheckboxGroup implements ControlValueAccessor, WrCheckboxGroupContext { /** * Disable every child checkbox. Also set by Angular forms via * `setDisabledState`. * * @default false */ readonly disabled: _angular_core.InputSignalWithTransform; private readonly selected; private readonly disabledFromCva; /** Effective disabled state — input wins, CVA second. */ readonly isDisabled: _angular_core.Signal; private onChange; private onTouched; isSelected(value: unknown): boolean; toggle(value: unknown): void; writeValue(value: unknown): void; registerOnChange(fn: (value: unknown[]) => void): void; registerOnTouched(fn: () => void): void; setDisabledState(isDisabled: boolean): void; static ɵfac: _angular_core.ɵɵFactoryDeclaration; static ɵcmp: _angular_core.ɵɵComponentDeclaration; } export { WR_CHECKBOX_GROUP, WrCheckbox, WrCheckboxGroup }; export type { WrCheckboxGroupContext, WrCheckboxSize };