quarkd
Version:
Mobile UI Components built on Web Components.
58 lines (57 loc) • 1.28 kB
TypeScript
import { QuarkElement } from "quarkc";
export interface Rule {
required?: boolean;
message?: string;
validator?: (value: string | number) => boolean;
}
export interface Props {
label?: string;
type?: string;
value?: string;
defaultvalue?: string;
name?: string;
placeholder?: string;
min?: string;
minlength?: string;
max?: string;
maxlength?: string;
disabled?: boolean;
readonly?: boolean;
required?: boolean;
errormsg?: string;
}
export interface CustomEvent {
change: (e: {
detail: {
value: string;
};
}) => void;
focus?: () => void;
blur?: () => void;
}
declare class QuarkField extends QuarkElement {
name: string;
label: string;
defaultvalue: string;
value: string;
type: string;
placeholder: string;
max: string;
maxlength: string;
autofocus: boolean;
min: string;
minlength: string;
errormsg: string;
disabled: boolean;
readonly: boolean;
required: boolean;
rules: Rule[];
inputRef: any;
errorRef: any;
showError: boolean;
evenFn: (type: string) => (e: Event) => void;
validRules: () => void;
setRules(rules: Rule[]): void;
render(): any;
}
export default QuarkField;