import * as i0 from '@angular/core'; import { InjectionToken, AfterContentInit, OnDestroy, ChangeDetectorRef, EventEmitter, QueryList, OnInit, AfterViewInit, DoCheck, ElementRef } from '@angular/core'; import * as i1 from '@sbb-esta/angular/core'; import { TypeRef } from '@sbb-esta/angular/core'; import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y'; import { UniqueSelectionDispatcher } from '@angular/cdk/collections'; import { ControlValueAccessor } from '@angular/forms'; /** * Provider Expression that allows sbb-radio-group to register as a ControlValueAccessor. This * allows it to support [(ngModel)] and ngControl. * @docs-private */ declare const SBB_RADIO_GROUP_CONTROL_VALUE_ACCESSOR: any; /** Change event object emitted by SbbRadio and SbbRadioGroup. */ declare class SbbRadioChange { /** The SbbRadioButton that emits the change event. */ source: _SbbRadioButtonBase; /** The value of the SbbRadioButton. */ value: T; constructor( /** The SbbRadioButton that emits the change event. */ source: _SbbRadioButtonBase, /** The value of the SbbRadioButton. */ value: T); } /** * Injection token that can be used to inject instances of `SbbRadioGroup`. It serves as * alternative token to the actual `SbbRadioGroup` class which could cause unnecessary * retention of the class and its component metadata. */ declare const SBB_RADIO_GROUP: InjectionToken<_SbbRadioGroupBase<_SbbRadioButtonBase>>; /** * Injection token that can be used to inject instances of `_SbbRadioButtonBase` * implementations. It serves as alternative token to the actual `_SbbRadioButtonBase` * class which could cause unnecessary retention of the class and its component metadata. */ declare const SBB_RADIO_BUTTON: InjectionToken<_SbbRadioButtonBase>; declare abstract class _SbbRadioGroupBase implements AfterContentInit, OnDestroy, ControlValueAccessor { protected _changeDetector: ChangeDetectorRef; /** Name of the radio button group. All radio buttons inside this group will use this name. */ get name(): string; set name(value: string); /** * Value for the radio-group. Should equal the value of the selected radio button if there is * a corresponding radio button with a matching value. If there is not such a corresponding * radio button, this value persists to be applied in case a new radio button is added with a * matching value. */ get value(): any; set value(newValue: any); /** * The currently selected radio button. If set to a new radio button, the radio group value * will be updated to match the new selected button. */ get selected(): TRadio | null; set selected(selected: TRadio | null); /** Whether the radio group is disabled */ get disabled(): boolean; set disabled(value: boolean); /** Whether the radio group is required */ get required(): boolean; set required(value: boolean); /** * Event emitted when the group value changes. * Change events are only emitted when the value changes due to user interaction with * a radio button (the same behavior as ``). */ readonly change: EventEmitter; /** Child radio buttons. */ _radios: QueryList; /** Selected value for the radio group. */ private _value; /** The HTML name attribute applied to radio buttons in this group. */ private _name; /** The currently selected radio button. Should match value. */ private _selected; /** Whether the `value` has been set to its initial value. */ private _isInitialized; /** Whether the radio group is disabled. */ private _disabled; /** Whether the radio group is required. */ private _required; /** Subscription to changes in amount of radio buttons. */ private _buttonChanges; /** `View -> model callback called when value changes` */ _controlValueAccessorChangeFn: (value: any) => void; /** `View -> model callback called when radio group has been touched` */ _onTouched: () => any; constructor(_changeDetector: ChangeDetectorRef); _checkSelectedRadioButton(): void; /** * Initialize properties once content children are available. * This allows us to propagate relevant attributes to associated buttons. */ ngAfterContentInit(): void; ngOnDestroy(): void; /** * Mark this group as being "touched" (for ngModel). Meant to be called by the contained * radio buttons upon their blur. */ _touch(): void; /** Dispatch change event with current selection and group value. */ _emitChangeEvent(): void; _markRadiosForCheck(): void; /** Sets the model value. Implemented as part of ControlValueAccessor. */ writeValue(value: any): void; /** * Registers a callback to be triggered when the model value changes. * Implemented as part of ControlValueAccessor. * @param fn Callback to be registered. */ registerOnChange(fn: (value: any) => void): void; /** * Registers a callback to be triggered when the control is touched. * Implemented as part of ControlValueAccessor. * @param fn Callback to be registered. */ registerOnTouched(fn: any): void; /** * Sets the disabled state of the control. Implemented as a part of ControlValueAccessor. * @param isDisabled Whether the control should be disabled. */ setDisabledState(isDisabled: boolean): void; private _updateRadioButtonNames; /** Updates the `selected` radio button from the internal _value state. */ private _updateSelectedRadioFromValue; static ɵfac: i0.ɵɵFactoryDeclaration<_SbbRadioGroupBase, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<_SbbRadioGroupBase, never, never, { "name": { "alias": "name"; "required": false; }; "value": { "alias": "value"; "required": false; }; "selected": { "alias": "selected"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; }, { "change": "change"; }, ["_radios"], never, true, never>; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_required: unknown; } declare class SbbRadioGroup extends _SbbRadioGroupBase { _radios: QueryList; static ɵfac: i0.ɵɵFactoryDeclaration, never>; static ɵdir: i0.ɵɵDirectiveDeclaration, "sbb-radio-group", ["sbbRadioGroup"], {}, {}, ["_radios"], never, true, never>; } declare class _SbbRadioButtonBase implements OnInit, AfterViewInit, DoCheck, OnDestroy { private _elementRef; protected readonly _changeDetector: ChangeDetectorRef; private _focusMonitor; private _radioDispatcher; private _uniqueId; /** The id of this component. */ id: string; /** Analog to HTML 'name' attribute used to group radios for unique selection. */ name: string; /** Used to set the 'aria-label' attribute on the underlying input element. */ ariaLabel: string; /** The 'aria-labelledby' attribute takes precedence as the element's text alternative. */ ariaLabelledby: string; /** The 'aria-describedby' attribute is read after the element's label and field type. */ ariaDescribedby: string; /** Tabindex of the radio button. */ tabIndex: number; /** Whether this radio button is checked. */ get checked(): boolean; set checked(value: boolean); /** The value of this radio button. */ get value(): any; set value(value: any); /** Whether the radio button is disabled. */ get disabled(): boolean; set disabled(value: boolean); /** Whether the radio button is required. */ get required(): boolean; set required(value: boolean); /** * Event emitted when the checked state of this radio button changes. * Change events are only emitted when the value changes due to user interaction with * the radio button (the same behavior as ``). */ readonly change: EventEmitter; /** The parent radio group. May or may not be present. */ radioGroup: _SbbRadioGroupBase<_SbbRadioButtonBase>; /** Id for the inner input field. */ get inputId(): string; /** Whether this radio is checked. */ private _checked; /** Whether this radio is disabled. */ private _disabled; /** Whether this radio is required. */ private _required; /** Value assigned to this radio. */ private _value; /** Unregister function for _radioDispatcher */ private _removeUniqueSelectionListener; /** Previous value of the input's tabindex. */ private _previousTabIndex; /** The native `` element */ _inputElement: ElementRef; private _injector; constructor(radioGroup: TypeRef<_SbbRadioGroupBase<_SbbRadioButtonBase>>, _elementRef: ElementRef, _changeDetector: ChangeDetectorRef, _focusMonitor: FocusMonitor, _radioDispatcher: UniqueSelectionDispatcher, tabIndex?: string); /** Focuses the radio button. */ focus(options?: FocusOptions, origin?: FocusOrigin): void; /** * Marks the radio button as needing checking for change detection. * This method is exposed because the parent radio group will directly * update bound properties of the radio button. * @docs-private */ _markForCheck(): void; ngOnInit(): void; ngDoCheck(): void; ngAfterViewInit(): void; ngOnDestroy(): void; /** Dispatch change event with current value. */ private _emitChangeEvent; /** @docs-private */ _onInputClick(event: Event): void; /** * Triggered when the radio button received a click or the input recognized any change. * Clicking on a label element, will trigger a change event on the associated input. * @docs-private */ _onInputChange(event?: Event): void; /** Sets the disabled state and marks for check if a change occurred. */ protected _setDisabled(value: boolean): void; /** Gets the tabindex for the underlying input element. */ private _updateTabIndex; static ɵfac: i0.ɵɵFactoryDeclaration<_SbbRadioButtonBase, never>; static ɵdir: i0.ɵɵDirectiveDeclaration<_SbbRadioButtonBase, never, never, { "id": { "alias": "id"; "required": false; }; "name": { "alias": "name"; "required": false; }; "ariaLabel": { "alias": "aria-label"; "required": false; }; "ariaLabelledby": { "alias": "aria-labelledby"; "required": false; }; "ariaDescribedby": { "alias": "aria-describedby"; "required": false; }; "tabIndex": { "alias": "tabIndex"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "value": { "alias": "value"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "required": { "alias": "required"; "required": false; }; }, { "change": "change"; }, never, never, true, never>; static ngAcceptInputType_tabIndex: unknown; static ngAcceptInputType_checked: unknown; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_required: unknown; } declare class SbbRadioButton extends _SbbRadioButtonBase { constructor(radioGroup: SbbRadioGroup, elementRef: ElementRef, changeDetector: ChangeDetectorRef, focusMonitor: FocusMonitor, radioDispatcher: UniqueSelectionDispatcher, tabIndex?: string); static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; } declare class SbbRadioButtonModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { SBB_RADIO_BUTTON, SBB_RADIO_GROUP, SBB_RADIO_GROUP_CONTROL_VALUE_ACCESSOR, SbbRadioButton, SbbRadioButtonModule, SbbRadioChange, SbbRadioGroup, _SbbRadioButtonBase, _SbbRadioGroupBase };