UNPKG

ngx-pluto

Version:
50 lines (49 loc) 1.67 kB
import { OnInit, OnChanges, SimpleChanges, EventEmitter, ElementRef } from "@angular/core"; import { ControlValueAccessor, Validator, ValidationErrors, AbstractControl } from "@angular/forms"; /** * 输入框 * * <example-url>https://stackblitz.com/edit/np-input-sample?embed=1&file=src/app/app.component.html</example-url> */ export declare class NpInput implements OnInit, OnChanges, ControlValueAccessor, Validator { uuid: string; val: string; private navigationKeys; currentLen: number; chineseReg: RegExp; /**标签 */ label: string; /**是否必填 - 必填则有红色*号在标签前面;否则没有 */ isRequired: boolean; /**占位符 */ placeholder: string; /**错误信息 - 将以红色字体显示在输入框下方 */ errorMessage: string; /**是否禁用 */ isDisabled: boolean; /** * 最大长度 * * Default -1 indicate that the length of input is not limited */ maxLen: number; /**只允许填写数字 */ numberOnly: boolean; private emitChange; npInput: ElementRef<HTMLElement>; onBlur: EventEmitter<any>; constructor(); ngOnInit(): void; ngOnChanges(changes: SimpleChanges): void; onChange(event: any): void; onInputBlur(event: any): void; writeValue(obj: any): void; registerOnChange(fn: any): void; registerOnTouched(fn: any): void; validate(control: AbstractControl): ValidationErrors; focus(): void; onKeyup(e: KeyboardEvent): void; onKeyDown(e: KeyboardEvent): void; private calculateCurrentLen; private isTriggerKeyEvents; }