UNPKG

jb-input

Version:

input web component with built in validation

61 lines 2.72 kB
import { type WithValidation, ValidationHelper, type ShowValidationErrorParameters } from 'jb-validation'; import type { JBFormInputStandards } from 'jb-form'; import type { ValueSetterEventType, ElementsObject, JBInputValue, StandardValueCallbackFunc, ValidationValue, SupportedState } from "./types"; export declare class JBInputWebComponent extends HTMLElement implements WithValidation<ValidationValue>, JBFormInputStandards<string> { #private; static get formAssociated(): boolean; elements: ElementsObject; get disabled(): boolean; set disabled(value: boolean); set required(value: boolean); get required(): boolean; hasState(state: SupportedState): boolean; /** * @description will determine if component trigger jb-validation mechanism automatically on user event or it just let user-developer handle validation mechanism by himself */ get isAutoValidationDisabled(): boolean; get validation(): ValidationHelper<JBInputValue>; get displayValue(): string; get value(): string; set value(value: string); initialValue: string; get isDirty(): boolean; get selectionStart(): number; set selectionStart(value: number); get selectionEnd(): number; set selectionEnd(value: number); get selectionDirection(): "forward" | "backward" | "none"; set selectionDirection(value: "forward" | "backward" | "none"); get name(): string; constructor(); connectedCallback(): void; addStandardValueCallback(func: StandardValueCallbackFunc): void; /** * @description this function will get user inputted or pasted text and convert it to standard one base on developer config */ standardValue(valueString: string | number, eventType: ValueSetterEventType): JBInputValue; initProp(): void; static get observedAttributes(): string[]; attributeChangedCallback(name: string, oldValue: string, newValue: string): void; protected onAttributeChange(name: string, value: string): void; showValidationError(error: ShowValidationErrorParameters): void; clearValidationError(): void; /** * @public */ focus(): void; setSelectionRange(start: number | null, end: number | null, direction?: "forward" | "backward" | "none"): void; /** * @public * @description this method used to check for validity but doesn't show error to user and just return the result * this method used by #internal of component */ checkValidity(): boolean; /** * @public * @description this method used to check for validity and show error to user */ reportValidity(): boolean; get validationMessage(): string; } //# sourceMappingURL=jb-input.d.ts.map