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.
74 lines (73 loc) • 2.96 kB
TypeScript
import { type FormValue } from '../common/mixins/forms/form-value.js';
import { IgcMaskInputBaseComponent, type MaskRange } from './mask-input-base.js';
/**
* A masked input is an input field where a developer can control user input and format the visible value,
* based on configurable rules
*
* @element igc-mask-input
*
* @slot prefix - Renders content before the input
* @slot suffix - Renders content after the input
* @slot helper-text - Renders content below the input
* @slot value-missing - Renders content when the required validation fails.
* @slot bad-input - Renders content when a required mask pattern validation fails.
* @slot custom-error - Renders content when setCustomValidity(message) is set.
* @slot invalid - Renders content when the component is in invalid state (validity.valid = false).
*
* @fires igcInput - Emitted when the control receives user input
* @fires igcChange - Emitted when an alteration of the control's value is committed by the user
*
* @csspart container - The main wrapper that holds all main input elements
* @csspart input - The native input element
* @csspart label - The native label element
* @csspart prefix - The prefix wrapper
* @csspart suffix - The suffix wrapper
* @csspart helper-text - The helper text wrapper
*/
export default class IgcMaskInputComponent extends IgcMaskInputBaseComponent {
static readonly tagName = "igc-mask-input";
static register(): void;
protected get __validators(): import("../common/validators.js").Validator<IgcMaskInputComponent>[];
protected _formValue: FormValue<string>;
protected get _isRawMode(): boolean;
/**
* Dictates the behavior when retrieving the value of the control:
*
* - `raw` will return the clean user input.
* - `withFormatting` will return the value with all literals and prompts.
* @attr value-mode
*/
valueMode: 'raw' | 'withFormatting';
/**
* The value of the input.
*
* Regardless of the currently set `value-mode`, an empty value will return an empty string.
* @attr
*/
get value(): string;
set value(string: string);
/**
* The mask pattern to apply on the input.
* @attr
*/
get mask(): string;
/** The mask pattern to apply on the input. */
set mask(value: string);
constructor();
protected promptChange(): void;
protected _restoreDefaultValue(): void;
protected updateInput(string: string, range: MaskRange): Promise<void>;
protected handleDragEnter(): void;
protected handleDragLeave(): void;
protected handleFocus(): Promise<void>;
protected handleBlur(): void;
protected handleChange(): void;
protected updateMaskedValue(): void;
protected _updateSetRangeTextValue(): void;
protected renderInput(): import("lit-html").TemplateResult<1>;
}
declare global {
interface HTMLElementTagNameMap {
'igc-mask-input': IgcMaskInputComponent;
}
}