import * as i0 from '@angular/core'; import { InjectionToken, AfterViewInit, OnDestroy, OnChanges, ChangeDetectorRef, EventEmitter, ElementRef, SimpleChanges } from '@angular/core'; import { FocusableOption, FocusOrigin } from '@angular/cdk/a11y'; import { ControlValueAccessor, Validator, AbstractControl, ValidationErrors } from '@angular/forms'; import * as i1 from '@angular/cdk/observers'; import * as i1$1 from '@sbb-esta/angular/core'; /** Default `sbb-checkbox` options that can be overridden. */ interface SbbCheckboxDefaultOptions { clickAction?: SbbCheckboxClickAction; } /** Injection token to be used to override the default options for `sbb-checkbox`. */ declare const SBB_CHECKBOX_DEFAULT_OPTIONS: InjectionToken; /** @docs-private */ declare function SBB_CHECKBOX_DEFAULT_OPTIONS_FACTORY(): SbbCheckboxDefaultOptions; /** * Checkbox click action when user click on input element. * noop: Do not toggle checked or indeterminate. * check: Only toggle checked status, ignore indeterminate. * check-indeterminate: Toggle checked status, set indeterminate to false. Default behavior. * undefined: Same as `check-indeterminate`. */ type SbbCheckboxClickAction = 'noop' | 'check' | 'check-indeterminate' | undefined; /** Change event object emitted by SbbCheckbox. */ declare class SbbCheckboxChange { /** The source SbbCheckbox of the event. */ source: SbbCheckbox; /** The new `checked` value of the checkbox. */ checked: boolean; } /** * An SBB design checkbox component. Supports all the functionality of an HTML5 checkbox, * and exposes a similar API. A SbbCheckbox can be either checked, unchecked, indeterminate, or * disabled. Note that all additional accessibility attributes are taken care of by the component, * so there is no need to provide them yourself. However, if you want to omit a label and still * have the checkbox be accessible, you may supply an [aria-label] input. */ declare class SbbCheckbox implements ControlValueAccessor, AfterViewInit, OnDestroy, OnChanges, Validator, FocusableOption { private _elementRef; protected _changeDetectorRef: ChangeDetectorRef; private _focusMonitor; private _options; /** * Attached to the aria-label attribute of the host element. In most cases, aria-labelledby will * take precedence so this may be omitted. */ ariaLabel: string; /** * Users can specify the `aria-labelledby` attribute which will be forwarded to the input element */ ariaLabelledby: string | null; /** The 'aria-describedby' attribute is read after the element's label and field type. */ ariaDescribedby: string; /** * Users can specify the `aria-expanded` attribute which will be forwarded to the input element */ ariaExpanded: boolean; /** * Users can specify the `aria-controls` attribute which will be forwarded to the input element */ ariaControls: string; /** Users can specify the `aria-owns` attribute which will be forwarded to the input element */ ariaOwns: string; private _uniqueId; /** A unique id for the checkbox input. If none is supplied, it will be auto-generated. */ id: string; /** Returns the unique id for the visual hidden input. */ get inputId(): string; /** Whether the checkbox is required. */ required: boolean; /** Whether the label should appear after or before the checkbox. Defaults to 'after' */ labelPosition: 'before' | 'after'; /** Name value will be applied to the input element if present */ name: string | null; /** Tabindex for the checkbox. */ tabIndex: number; /** Event emitted when the checkbox's `checked` value changes. */ readonly change: EventEmitter; /** Event emitted when the checkbox's `indeterminate` value changes. */ readonly indeterminateChange: EventEmitter; /** The value attribute of the native input element */ value: string; /** The native `` element */ _inputElement: ElementRef; /** * Called when the checkbox is blurred. Needed to properly implement ControlValueAccessor. * @docs-private */ _onTouched: () => any; private _controlValueAccessorChangeFn; private _validatorChangeFn; constructor(...args: unknown[]); ngOnChanges(changes: SimpleChanges): void; ngAfterViewInit(): void; ngOnDestroy(): void; /** * Whether the checkbox is checked. */ get checked(): boolean; set checked(value: boolean); private _checked; /** * Whether the checkbox is disabled. This fully overrides the implementation provided by the input. */ get disabled(): boolean; set disabled(value: boolean); private _disabled; /** * Whether the checkbox is indeterminate. This is also known as "mixed" mode and can be used to * represent a checkbox with three states, e.g. a checkbox that represents a nested list of * checkable items. Note that whenever checkbox is manually clicked, indeterminate is immediately * set to false. */ get indeterminate(): boolean; set indeterminate(value: boolean); private _indeterminate; /** Method being called whenever the label text changes. */ _onLabelTextChange(): void; writeValue(value: any): void; registerOnChange(fn: (value: any) => void): void; registerOnTouched(fn: any): void; setDisabledState(isDisabled: boolean): void; validate(control: AbstractControl): ValidationErrors | null; registerOnValidatorChange(fn: () => void): void; protected _emitChangeEvent(): void; /** Toggles the `checked` state of the checkbox. */ toggle(): void; /** * Event handler for checkbox input element. * Toggles checked state if element is not disabled. * Do not toggle on (change) event since IE doesn't fire change event when * indeterminate checkbox is clicked. */ _onInputClick(event: Event): void; /** Focuses the checkbox. */ focus(origin?: FocusOrigin, options?: FocusOptions): void; _onInteractionEvent(event: Event): void; /** * Syncs the indeterminate value with the checkbox DOM node. * * We sync `indeterminate` directly on the DOM node, because in Ivy the check for whether a * property is supported on an element boils down to `if (propName in element)`. Domino's * HTMLInputElement doesn't have an `indeterminate` property so Ivy will warn during * server-side rendering. */ private _syncIndeterminate; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_tabIndex: unknown; static ngAcceptInputType_ariaExpanded: unknown; static ngAcceptInputType_required: unknown; static ngAcceptInputType_checked: unknown; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_indeterminate: unknown; } declare class SbbCheckboxModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { SBB_CHECKBOX_DEFAULT_OPTIONS, SBB_CHECKBOX_DEFAULT_OPTIONS_FACTORY, SbbCheckbox, SbbCheckboxChange, SbbCheckboxModule }; export type { SbbCheckboxClickAction, SbbCheckboxDefaultOptions };