Field.d.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import * as React from 'react';
  2. export interface FieldProps extends React.HTMLProps<HTMLInputElement> {
  3. vtype?: string;
  4. vtypeMsg?: string;
  5. onEnterKey?: Function;
  6. }
  7. export interface FieldRef extends HTMLInputElement {
  8. isValid: () => Boolean;
  9. }
  10. export declare class Field extends React.Component<FieldProps> {
  11. id: string;
  12. el: FieldRef | null | undefined;
  13. label: HTMLLabelElement | null | undefined;
  14. state: {
  15. labelClassName: string;
  16. focusCount: number;
  17. errmsg: string;
  18. };
  19. constructor(props: FieldProps);
  20. getDefaults(): {
  21. placeholder: string;
  22. id: number;
  23. className: string;
  24. label: string;
  25. type: string;
  26. icon: string;
  27. };
  28. getValue(): string | null | undefined;
  29. setValue(val: string): void;
  30. isValid(): Boolean;
  31. onBlur(e: React.FocusEvent<HTMLInputElement>): void;
  32. onFocus(e: React.FocusEvent<HTMLInputElement>): void;
  33. validate(blure?: boolean): Boolean;
  34. makeInValid(): void;
  35. makeValid(): void;
  36. componentDidMount(): void;
  37. onKeyUp(e?: React.KeyboardEvent<HTMLInputElement>): void;
  38. uuidv4(): any;
  39. getErrorView(): React.JSX.Element | undefined;
  40. render(): React.JSX.Element;
  41. }