jb-date-input
Version:
jalali date input web component
113 lines • 4.81 kB
TypeScript
import 'jb-calendar';
import 'jb-input';
import 'jb-popover';
import type { JBFormInputStandards } from 'jb-form';
import { type ElementsObject, type DateRestrictions, type ValueType, InputType, type ValidationValue } from './types';
import { ValidationHelper, type ValidationResult, type WithValidation, type ShowValidationErrorParameters } from 'jb-validation';
export * from "./types.js";
export declare class JBDateInputWebComponent extends HTMLElement implements WithValidation<ValidationValue>, JBFormInputStandards<string> {
#private;
static formAssociated: boolean;
elements: ElementsObject;
get isAutoValidationDisabled(): boolean;
set isAutoValidationDisabled(value: boolean);
inputFormat: string;
get validation(): ValidationHelper<ValidationValue>;
dateRestrictions: DateRestrictions;
get disabled(): boolean;
set disabled(value: 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");
setSelectionRange(start: number | null, end: number | null, direction?: "forward" | "backward" | "none"): void;
set required(value: boolean);
get required(): boolean;
DefaultValidationErrorMessage: string;
get name(): string;
get form(): HTMLFormElement;
get value(): string;
set value(value: string | Date);
initialValue: string | null;
get isDirty(): boolean;
setMonthList(inputType: InputType, monthName: string[]): void;
/**
* @description return date value if value valid and return null if inputted value is not valid
*/
get valueInDate(): Date | null;
get inputValue(): string;
get placeholder(): string | null;
set placeholder(value: string | null);
get showCalendar(): boolean;
set showCalendar(value: boolean);
get inputType(): InputType;
set inputType(value: InputType);
get valueType(): ValueType;
set valueType(value: ValueType);
get yearValue(): number | null;
get yearDisplayValue(): number | null;
get monthValue(): number | null;
get monthDisplayValue(): number | null;
get dayValue(): number | null;
get dayDisplayValue(): number | null;
get yearBaseOnInputType(): number | null;
get monthBaseOnInputType(): number | null;
get dayBaseOnInputType(): number | null;
get typedYear(): string;
get typedMonth(): string;
get typedDay(): string;
get sTypedYear(): string;
get sTypedMonth(): string;
get sTypedDay(): string;
get valueFormat(): string;
get showPersianNumber(): boolean;
set showPersianNumber(value: boolean);
constructor();
connectedCallback(): void;
static get dateInputObservedAttributes(): string[];
static get observedAttributes(): string[];
attributeChangedCallback(name: string, oldValue: string, newValue: string): void;
setFormat(newFormat: string): void;
setMinDate(minDate: string | Date): void;
setMaxDate(maxDate: string | Date): void;
inputChar(char: string, pos: number): void;
/**
* @description will convert current valueObject to expected value string
*/
getDateValue(type?: ValueType): string;
/**
* @public
* @description focus on date input web-component
*/
focus(): void;
/**
* @deprecated use dom.validation.checkValidity instead
*/
triggerInputValidation(showError?: boolean): Promise<ValidationResult<ValidationValue>>;
showValidationError(error: ShowValidationErrorParameters): void;
clearValidationError(): void;
onInputTypeChange(): Promise<void>;
/**
* set opened calendar date when date input value is empty
* @public
* @param year which year you want to show in empty state in calendar.
* @param month which month you want to show in empty state in calendar.
* @param dateType default is your configured input-type but you can set it otherwise if you want to change other type of calendar in case of change in input-type.
*/
setCalendarDefaultDateView(year: number, month: number, dateType: InputType | undefined): 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-date-input.d.ts.map