UNPKG

igniteui-webcomponents

Version:

Ignite UI for Web Components is a complete library of UI components, giving you the ability to build modern web applications using encapsulation and the concept of reusable components in a dependency-free approach.

44 lines (43 loc) 1.71 kB
import { IgcInputBaseComponent } from '../input/input-base.js'; import type { RangeTextSelectMode, SelectionRangeDirection } from '../types.js'; import { MaskParser } from './mask-parser.js'; export type MaskSelection = { start: number; end: number; }; export declare abstract class IgcMaskInputBaseComponent extends IgcInputBaseComponent { protected readonly _parser: MaskParser; protected _maskSelection: MaskSelection; protected compositionStart: number; protected _focused: boolean; protected _maskedValue: string; protected get _inputSelection(): MaskSelection; /** * The masked pattern of the component. * * @attr * @default 'CCCCCCCCCC' */ set mask(value: string); get mask(): string; /** * The prompt symbol to use for unfilled parts of the mask pattern. * * @attr * @default '_' */ set prompt(value: string); get prompt(): string; protected _handleInput({ inputType, isComposing, }: InputEvent): Promise<void>; protected _setMaskSelection(): void; protected _handleCompositionStart(): void; protected _handleCompositionEnd({ data }: CompositionEvent): void; protected _handleClick(): void; protected abstract _updateSetRangeTextValue(): void; protected abstract _updateInput(text: string, range: MaskSelection): void; /** Selects all text within the input. */ select(): void; setSelectionRange(start: number, end: number, direction?: SelectionRangeDirection): void; /** Replaces the selected text in the control and re-applies the mask */ setRangeText(replacement: string, start?: number, end?: number, selectMode?: RangeTextSelectMode): void; }