import * as i0 from '@angular/core'; import { AfterViewInit, OnDestroy, DoCheck, Signal, QueryList, EventEmitter, ChangeDetectorRef, InjectionToken, ElementRef } from '@angular/core'; import * as i1 from '@angular/common'; import * as i2 from '@aposin/ng-aquila/icon'; import { BooleanInput } from '@angular/cdk/coercion'; import { ControlValueAccessor, NgControl, NgForm, FormGroupDirective } from '@angular/forms'; import { NxAbstractControl } from '@aposin/ng-aquila/shared'; import { ErrorStateMatcher } from '@aposin/ng-aquila/utils'; import { Subject } from 'rxjs'; import { FocusMonitor, FocusOrigin } from '@angular/cdk/a11y'; import { UniqueSelectionDispatcher } from '@angular/cdk/collections'; import { NxErrorComponent } from '@aposin/ng-aquila/base'; /** @docs-private */ declare abstract class ToggleButton { abstract id: string; abstract value: string; abstract checked: boolean; abstract name: string; abstract negative: boolean; abstract disabled: boolean; abstract checkedChange: any; abstract selectionChange: any; abstract toggleButton: any; abstract toggle(event: Event): any; abstract setGroupSelection(checked: boolean): any; } /** * Appearance options for the circle toggle group component. */ type NxCircleToggleGroupAppearance = 'default' | 'expert'; /** * Represents the default options for the circle toggle group. * It can be configured using the `CIRCLE_TOGGLE_GROUP_DEFAULT_OPTIONS` injection token. */ interface CircleToggleGroupDefaultOptions { /** * Sets the default appearance (optional). */ appearance?: NxCircleToggleGroupAppearance; } declare const CIRCLE_TOGGLE_GROUP_DEFAULT_OPTIONS: InjectionToken; declare class NxCircleToggleGroupComponent implements ControlValueAccessor, AfterViewInit, OnDestroy, DoCheck, NxAbstractControl { private readonly _cdr; private readonly _errorStateMatcher; private readonly _defaultOptions; readonly ngControl: NgControl | null; private readonly _parentForm; private readonly _parentFormGroup; /** * Id of the circle toggle group. * * If not set, the circle toggle group gets an incremented value by default. */ set id(value: string); get id(): string; private _id; private errorChildren; ariaDescribedBy: Signal; readonly _stateChanges: Subject; get required(): boolean; /** @docs-private this is meant to be called by the radio buttons in this group. */ touch(): void; /** Name that is used for accessibility. */ set name(value: string); get name(): string; private _name; /** Whether the circle toggle group is disabled. */ set disabled(value: BooleanInput); get disabled(): boolean; private _disabled; readonly: boolean; /** Whether the circle toggle group uses the negative styling. */ set negative(value: BooleanInput); get negative(): boolean; _negative: boolean; /** The value of the selected circle toggle in the circle toggle group. */ set value(value: any); get value(): any; private _value; /** Whether the circle toggle group has a responsive behavior. */ set responsive(value: BooleanInput); get responsive(): boolean; private _responsive; get _isExpert(): boolean; errorState: i0.WritableSignal; /** @docs-private */ get selectedButton(): ToggleButton | null; /** @docs-private */ get buttons(): QueryList; private _buttons; /** An event emitted when the selection changes. Outputs the value of the currently selected button. */ readonly valueChange: EventEmitter; /** * **Expert option** * * Sets the appearance of the circle toggle group. * * Default: `'default'`. */ set appearance(value: NxCircleToggleGroupAppearance); get appearance(): NxCircleToggleGroupAppearance; private _appearance?; private readonly _destroyed; constructor(_cdr: ChangeDetectorRef, _errorStateMatcher: ErrorStateMatcher, _defaultOptions: CircleToggleGroupDefaultOptions | null, ngControl: NgControl | null, _parentForm: NgForm | null, _parentFormGroup: FormGroupDirective | null); private onChangeCallback; private onTouchedCallback; setReadonly(isReadonly: boolean): void; writeValue(value: any): void; ngOnDestroy(): void; ngAfterViewInit(): void; /** @docs-private */ subscribeToSelectionChanges(): void; /** * Inform the selected button if the group selection is set programattically at the beginning. * @docs-private */ notifySelectedChild(newValue: string): void; /** @docs-private */ updateToggleButtonsNames(): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState?(isDisabled: boolean): void; ngDoCheck(): void; _updateErrorState(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_readonly: unknown; } /** @docs-private */ declare class NxMobileToggleButtonComponent { private readonly _cdr; checked: boolean; negative: boolean; disabled: boolean; readonly: boolean; hint: string; label: string; circleText: string; /** @docs-private */ isFirst: boolean; /** @docs-private */ isLast: boolean; constructor(_cdr: ChangeDetectorRef); /** @docs-private */ setFirstButton(): void; /** @docs-private */ setLastButton(): void; /** @docs-private */ resetClasses(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_readonly: unknown; } /** * Appearance options for the circle toggle component. */ type NxCircleToggleAppearance = 'default' | 'expert'; /** * Represents the default options for the circle toggle. * It can be configured using the `CIRCLE_TOGGLE_DEFAULT_OPTIONS` injection token. */ interface CircleToggleDefaultOptions { /** * Sets the default appearance (optional). */ appearance?: NxCircleToggleAppearance; } declare const CIRCLE_TOGGLE_DEFAULT_OPTIONS: InjectionToken; declare class ToggleChangeEvent { /** A toggle button */ readonly button: ToggleButton; /** The value of the toggle button that is sent with the event. */ readonly value: string; constructor( /** A toggle button */ button: ToggleButton, /** The value of the toggle button that is sent with the event. */ value: string); } declare class NxCircleToggleComponent extends ToggleButton implements OnDestroy, AfterViewInit, ControlValueAccessor, DoCheck, NxAbstractControl { /** @docs-private */ readonly toggleGroup: NxCircleToggleGroupComponent | null; private readonly _checkedDispatcher; private readonly _cdr; private readonly _focusMonitor; readonly ngControl: NgControl | null; private readonly _defaultOptions; private _id; _nativeInput: ElementRef; errorChildren: Signal; ariaDescribedBy: i0.InputSignal; ariaDescribedByComputed: Signal; /** @docs-private */ inGroup: boolean; errorState: i0.WritableSignal; /** * Id of the circle toggle. * * If not set, the circle toggle gets an incremented value by default. */ set id(value: string); get id(): string; /** Name that is used for accessibility. */ set name(value: string); get name(): string; private _name; /** * An event that is emitted when the checked state fo the circle toggle changes. */ readonly checkedChange: EventEmitter; /** * An event that is emitted when the checked state of the circle toggle changes. * The event object contains the circle toggle itself and its value (see ToggleChangeEvent). */ readonly selectionChange: EventEmitter; /** Whether the circle toggle is checked. */ set checked(value: BooleanInput); get checked(): boolean; _checked: boolean; /** The value that is used in the model. */ set value(newValue: any); get value(): any; private _value; /** Id of the icon that should be displayed. */ set iconName(name: string); get iconName(): string; private _iconName; /** SVG that is displayed if the circle toggle is unchecked. */ set svg(src: string); get svg(): string; private _svg; /** SVG that is displayed if the circle toggle is checked. */ set svgChecked(src: string); get svgChecked(): string; private _svgChecked; /** A text that is displayed inside the circle toggle. */ set circleText(value: string); get circleText(): string; private _circleText; /** Label displayed below the circle. */ set label(value: string); get label(): string; private _label; /** Additional hint displayed below the label. */ set hint(value: string); get hint(): string; private _hint; /** Whether the circle toggle uses the negative set of styling. */ set negative(value: boolean); get negative(): boolean; private _negative; /** Whether the circle toggle has a responsive behavior. */ set responsive(value: boolean); get responsive(): boolean; private _responsive; /** Whether the circle toggle is disabled. */ set disabled(value: boolean); get disabled(): boolean; private _disabled; set readonly(value: boolean); get readonly(): boolean; private _readonly; /** * **Expert option** * * Sets the appearance of the circle toggle. * * Default: `'default'`. */ set appearance(value: NxCircleToggleAppearance); get appearance(): NxCircleToggleAppearance; private _appearance?; get _isExpert(): boolean; get required(): boolean; /** @docs-private */ toggleButton: NxMobileToggleButtonComponent; private _hover; /** Touched is set to true on touch devices. */ _touched: boolean; /** @docs-private */ onMouseEnter(): void; /** @docs-private */ onMouseLeave(): void; /** @docs-private */ onTouchStart(): void; _removeUniqueSelectionListener: () => void; private onChangeCallback; private onTouchedCallback; constructor( /** @docs-private */ toggleGroup: NxCircleToggleGroupComponent | null, _checkedDispatcher: UniqueSelectionDispatcher, _cdr: ChangeDetectorRef, _focusMonitor: FocusMonitor, ngControl: NgControl | null, _defaultOptions: CircleToggleDefaultOptions | null); hasError: Signal; ngDoCheck(): void; ngAfterViewInit(): void; ngOnDestroy(): void; setReadonly(isReadonly: boolean): void; /** @docs-private */ attachListenerForGroup(): void; writeValue(newValue: boolean): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; setDisabledState?(isDisabled: boolean): void; /** Focuses the radio button element. */ focus(focusOrigin?: FocusOrigin): void; /** Forward focus from host to hidden input field */ _forwardFocusToInput(): void; /** @docs-private */ toggle(event: Event): void; /** * Method called by the group if the internal value of the group is changed programatically, * does not trigger change emission. * @docs-private */ setGroupSelection(checked: boolean): void; /** @docs-private */ get svgButton(): boolean; /** @docs-private */ get svgUrl(): string; /** @docs-private */ get type(): "radio" | "checkbox"; /** @docs-private */ handleEnterKey(event: Event): void; touch(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_negative: unknown; static ngAcceptInputType_responsive: unknown; static ngAcceptInputType_disabled: unknown; static ngAcceptInputType_readonly: unknown; } /** @docs-private */ declare class NxIconToggleButtonComponent { inGroup: boolean; hint: string; label: string; checked: boolean; icon: string; disabled: boolean; negative: boolean; touched: boolean; circleText: string; readonly: boolean; svgUrl: string; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵcmp: i0.ɵɵComponentDeclaration; static ngAcceptInputType_readonly: unknown; } declare class NxCircleToggleModule { static ɵfac: i0.ɵɵFactoryDeclaration; static ɵmod: i0.ɵɵNgModuleDeclaration; static ɵinj: i0.ɵɵInjectorDeclaration; } export { CIRCLE_TOGGLE_DEFAULT_OPTIONS, CIRCLE_TOGGLE_GROUP_DEFAULT_OPTIONS, NxCircleToggleComponent, NxCircleToggleGroupComponent, NxCircleToggleModule, NxIconToggleButtonComponent, NxMobileToggleButtonComponent, ToggleChangeEvent }; export type { CircleToggleDefaultOptions, CircleToggleGroupDefaultOptions, NxCircleToggleAppearance, NxCircleToggleGroupAppearance };