import { EventTypeWithTarget, JBBaseComponent } from "jb-core"; import "jb-icons/close"; import { ShowValidationErrorParameters, ValidationHelper, WithValidation } from "jb-validation"; import { JBFormInputStandards } from "jb-form"; //#region modules/jb-input/web-component/lib/types.d.ts export type ElementsObject = { input: HTMLInputElement; inputBox: HTMLDivElement; clearButton: HTMLButtonElement | null; label: HTMLLabelElement; messageBox: HTMLDivElement; slots: { inlineStart: HTMLSlotElement; inlineEnd: HTMLSlotElement; }; }; /** * @description "INPUT" is for onInput, "SET_VALUE" is for when value set from outside of component by dom.value="" or in attribute value set, and change call in onChange mean's it execute after blur */ export type ValueSetterEventType = "INPUT" | "SET_VALUE" | "CHANGE"; /** * @description this function used by derived input component so they can make different between display value and value value. * @param prevResult result of prev callback function it maybe useful in some cases when user add chain of value standard * @param eventType when standard value is called. its for filter some standard function in some events, for example disable min value check on input number and let user do blur before some standard function be applied */ export type StandardValueCallbackFunc = (inputtedString: string, oldValue: JBInputValue, prevResult: JBInputValue, eventType: ValueSetterEventType) => JBInputValue; export type JBInputValue = { value: string; displayValue: string; }; export type SupportedState = "disabled" | "invalid"; export type ValidationValue = JBInputValue; declare global { interface ElementInternals { setFormValue(value: string): void; } } export type JBInputEventType = EventTypeWithTarget; export type SizeVariants = 'xs' | 'sm' | 'md' | 'lg' | 'xl'; //#endregion //#region modules/jb-input/web-component/lib/jb-input.d.ts export declare class JBInputWebComponent extends JBBaseComponent implements WithValidation, JBFormInputStandards { #private; static get formAssociated(): boolean; elements: ElementsObject; get disabled(): boolean; get form(): HTMLFormElement | null; get clearable(): boolean; set clearable(value: 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; get displayValue(): string; get value(): string; set value(value: string); /** * Re-applies a value after an internal configuration change without treating * that reformatting as a consumer-provided live value. */ protected setValueFromInternal(value: string | null, eventType?: ValueSetterEventType): void; get initialValue(): string; set initialValue(value: string); reset(): void; formResetCallback(): void; formDisabledCallback(disabled: boolean): void; get isDirty(): boolean; get selectionStart(): number | null; set selectionStart(value: number); get selectionEnd(): number | null; set selectionEnd(value: number); get selectionDirection(): SelectionDirection | null; set selectionDirection(value: "forward" | "backward" | "none"); get name(): string; set name(value: string | null); 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; /** * show validation message error under input box * @public */ showValidationError(error: ShowValidationErrorParameters): void; /** * clear validation message error showing under input box * @public */ 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; get validity(): ValidityState; } declare global { interface HTMLElementTagNameMap { "jb-input": JBInputWebComponent; } } //#endregion //# sourceMappingURL=index.d.ts.map