@alyle/ui
Version:
Minimal Design, a set of components for Angular
182 lines (181 loc) • 7.76 kB
TypeScript
import { ChangeDetectorRef, OnInit, OnDestroy, QueryList, EventEmitter, NgZone, ElementRef, Renderer2, AfterViewInit } from '@angular/core';
import { ControlValueAccessor } from '@angular/forms';
import { LyTheme2, LyCoreStyles, ThemeVariables, LyFocusState, StyleCollection, LyClasses, StyleTemplate, ThemeRef, StyleRenderer } from '@alyle/ui';
import { Platform } from '@angular/cdk/platform';
import { BooleanInput } from '@angular/cdk/coercion';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/forms";
import * as i3 from "@alyle/ui";
export interface LyRadioTheme {
/** Styles for Radio Component */
root?: StyleCollection<((classes: LyClasses<typeof STYLES>) => StyleTemplate)> | ((classes: LyClasses<typeof STYLES>) => StyleTemplate);
}
export interface LyRadioVariables {
radio?: LyRadioTheme;
}
export declare const LY_RADIO_CONTROL_VALUE_ACCESSOR: any;
export declare class UndefinedValue {
constructor();
}
export declare const STYLES: (theme: ThemeVariables & LyRadioVariables, ref: ThemeRef) => {
$priority: number;
/** ly-radio-group */
root: () => (_className: string) => string;
radio: () => (_className: string) => string;
label: (_className: string) => string;
labelContent: any;
container: (_className: string) => string;
checked: any;
_animations: () => (_className: string) => string;
onFocusByKeyboard: any;
disabled: () => (_className: string) => string;
};
export declare class LyRadioGroup implements ControlValueAccessor {
private _theme;
private _cd;
/** @docs-private */
static readonly и = "LyRadioGroup";
/** @docs-private */
readonly classes: LyClasses<(theme: ThemeVariables & LyRadioVariables, ref: ThemeRef) => {
$priority: number;
/** ly-radio-group */
root: () => (_className: string) => string;
radio: () => (_className: string) => string;
label: (_className: string) => string;
labelContent: any;
container: (_className: string) => string;
checked: any;
_animations: () => (_className: string) => string;
onFocusByKeyboard: any;
disabled: () => (_className: string) => string;
}>;
private _value;
/** @docs-private */
name: string;
set value(val: any);
get value(): any;
readonly change: EventEmitter<void>;
color: string;
_radios: QueryList<LyRadio>;
/** The method to be called in order to update ngModel */
_controlValueAccessorChangeFn: (value: any) => void;
/**
* onTouch function registered via registerOnTouch (ControlValueAccessor).
* @docs-private
*/
onTouched: () => any;
/**
* Mark this group as being "touched" (for ngModel). Meant to be called by the contained
* radio buttons upon their blur.
*/
_touch(): void;
/** @docs-private */
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.
* @docs-private
*/
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.
* @docs-private
*/
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.
* @docs-private
*/
setDisabledState(_isDisabled: boolean): void;
constructor(elementRef: ElementRef, renderer: Renderer2, _theme: LyTheme2, _cd: ChangeDetectorRef);
_updateCheckFromValue(val: any): void;
/** @docs-private */
updatevalue(value: any): void;
_markForCheck(): void;
_radioResetChecked(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<LyRadioGroup, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<LyRadioGroup, "ly-radio-group", ["lyRadioGroup"], { "value": { "alias": "value"; "required": false; }; "color": { "alias": "color"; "required": false; }; }, { "change": "change"; }, ["_radios"], ["*"], false, never>;
}
/** @docs-private */
export declare class LyRadioBase {
_theme: LyTheme2;
_ngZone: NgZone;
_platform: Platform;
constructor(_theme: LyTheme2, _ngZone: NgZone, _platform: Platform);
}
/** @docs-private */
export declare const LyRadioMixinBase: import("@alyle/ui/src/common/constructor").Constructor<import("@alyle/ui/src/common/disable-ripple").CanDisableRipple> & typeof LyRadioBase;
export declare class LyRadio extends LyRadioMixinBase implements OnInit, AfterViewInit, OnDestroy {
/** @docs-private */
radioGroup: LyRadioGroup;
private _elementRef;
private _renderer;
private changeDetectorRef;
_coreStyles: LyCoreStyles;
private _focusState;
private _styleRenderer;
/** @docs-private */
static readonly и = "LyRadio";
/** @docs-private */
readonly classes: LyClasses<(theme: ThemeVariables & LyRadioVariables, ref: ThemeRef) => {
$priority: number;
/** ly-radio-group */
root: () => (_className: string) => string;
radio: () => (_className: string) => string;
label: (_className: string) => string;
labelContent: any;
container: (_className: string) => string;
checked: any;
_animations: () => (_className: string) => string;
onFocusByKeyboard: any;
disabled: () => (_className: string) => string;
}>;
/** @docs-private */
id: string;
/** @docs-private */
name: string;
private _value;
private _checked;
private _color;
private _animClass;
private _disabled;
private _disabledClass?;
_input: ElementRef;
private _radioContainer;
_labelContainer: ElementRef;
change: EventEmitter<boolean>;
set value(val: any);
get value(): any;
set color(val: string);
get color(): string;
[0x1]: string;
set checked(val: BooleanInput);
get checked(): BooleanInput;
/** @docs-private */
get inputId(): string;
get disabled(): boolean;
set disabled(value: BooleanInput);
constructor(
/** @docs-private */
radioGroup: LyRadioGroup, _elementRef: ElementRef, _renderer: Renderer2, theme: LyTheme2, changeDetectorRef: ChangeDetectorRef, ngZone: NgZone, _coreStyles: LyCoreStyles, _focusState: LyFocusState, _styleRenderer: StyleRenderer, platform: Platform);
ngOnInit(): void;
ngAfterViewInit(): void;
_markForCheck(): void;
ngOnDestroy(): void;
_onInputChange(event: any): void;
private _addAnim;
_onInputClick(event: Event): void;
_setCheckedToFalsy(): void;
static ɵfac: i0.ɵɵFactoryDeclaration<LyRadio, [{ optional: true; }, null, null, null, null, null, null, null, null, null]>;
static ɵcmp: i0.ɵɵComponentDeclaration<LyRadio, "ly-radio", never, { "disableRipple": { "alias": "disableRipple"; "required": false; }; "value": { "alias": "value"; "required": false; }; "color": { "alias": "color"; "required": false; }; "checked": { "alias": "checked"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; }, { "change": "change"; }, never, ["*"], false, never>;
}
export declare class LyRadioModule {
static ɵfac: i0.ɵɵFactoryDeclaration<LyRadioModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<LyRadioModule, [typeof LyRadioGroup, typeof LyRadio], [typeof i1.CommonModule, typeof i2.FormsModule, typeof i3.LyCommonModule], [typeof LyRadioGroup, typeof LyRadio]>;
static ɵinj: i0.ɵɵInjectorDeclaration<LyRadioModule>;
}