UNPKG

@tangential/input-widgets

Version:

Input Widgets with persistable, dynamic configuration.

65 lines (64 loc) 2.59 kB
import { ChangeDetectorRef, EventEmitter, OnChanges, OnInit, SimpleChange } from '@angular/core'; import { ControlValueAccessor } from '@angular/forms'; import { IconIF } from '@tangential/components'; import * as i0 from "@angular/core"; /** * Provider Expression that allows this widget to register as a ControlValueAccessor. * This allows it to support [(ngModel)]. * @docs-private */ export declare const TANJ_ICON_RATING_WIDGET_VIEW_CONTROL_VALUE_ACCESSOR: any; export declare class IconRatingWidgetChange { source: IconRatingWidgetComponent; value: number; constructor(source: IconRatingWidgetComponent, value: number); } export declare class IconRatingWidgetComponent implements ControlValueAccessor, OnInit, OnChanges { private changeDetectorRef; flex: string; flexLayout: string; flexLayoutAlign: string; value: number; valueChange: EventEmitter<number>; labelPosition: 'before' | 'after' | 'below'; disabled: boolean; hideLabel: boolean; onlyLabel: boolean; /** * Configuration Fields */ label: string; defaultValue: number; max: number; iconFont: string | undefined; offIconNames: string[]; onIconNames: string[]; change: EventEmitter<any>; icons: IconIF[]; onTouched: () => any; private controlValueAccessorChangeFn; constructor(changeDetectorRef: ChangeDetectorRef); ngOnInit(): void; ngOnChanges(changes: { config: SimpleChange; ival: SimpleChange; }): void; onIconClick(idx: number): void; swipeRight(event: any): void; swipeLeft(event: any): void; emitChangeEvent(): void; /** * Boilerplate / required for Angular * */ writeValue(value: number): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; /** * Sets the input's disabled state. Implemented as a part of ControlValueAccessor. * @param isDisabled Whether the input should be disabled. */ setDisabledState(isDisabled: boolean): void; static ɵfac: i0.ɵɵFactoryDeclaration<IconRatingWidgetComponent, never>; static ɵcmp: i0.ɵɵComponentDeclaration<IconRatingWidgetComponent, "tanj-icon-rating-widget", never, { "value": "value"; "labelPosition": "labelPosition"; "disabled": "disabled"; "hideLabel": "hideLabel"; "onlyLabel": "onlyLabel"; "label": "label"; "defaultValue": "defaultValue"; "max": "max"; "iconFont": "iconFont"; "offIconNames": "offIconNames"; "onIconNames": "onIconNames"; }, { "valueChange": "valueChange"; "change": "change"; }, never, never, false>; }