Class IgcMaskInputComponent

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

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

Fires

igcFocus - Emitted when the control gains focus

Fires

igcBlur - Emitted when the control loses focus

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

Hierarchy

Hierarchy

  • IgcMaskInputBaseComponent
    • IgcMaskInputComponent

Constructors

Properties

disabled: boolean

The disabled state of the component

Attr

[disabled=false]

invalid: boolean

Control the validity of the control.

Attr

label: string

The label for the control.

Attr

name: string

The name attribute of the control.

Attr

outlined: boolean = false

Whether the control will have outlined appearance.

Attr

placeholder: string

The placeholder attribute of the control.

Attr

prompt: string

The prompt symbol to use for unfilled parts of the mask.

readOnly: boolean = false

Makes the control a readonly field.

Attr

readonly

required: boolean

Makes the control a required field in a form context.

Attr

size: "small" | "medium" | "large"

Determines the size of the component.

Attr

Deprecated

since v4.5.0. Use the --ig-size CSS custom property instead.

valueMode: "raw" | "withFormatting" = 'raw'

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

styles: CSSResult[] = ...
tagName: "igc-mask-input" = 'igc-mask-input'

Accessors

  • get readonly(): boolean
  • Returns boolean

  • set readonly(value): void
  • Makes the control a readonly field.

    Deprecated

    since v4.4.0. Use the readOnly property instead.

    Parameters

    • value: boolean

    Returns void

  • get validity(): ValidityState
  • Returns a ValidityState object which represents the different validity states the element can be in, with respect to constraint validation.

    Returns ValidityState

  • get willValidate(): boolean
  • A boolean value which returns true if the element is a submittable element that is a candidate for constraint validation.

    Returns boolean

Methods

  • Type parameters

    Type Parameters

    • K extends keyof IgcInputEventMap
    • D extends string | void

    Parameters

    • type: K
    • Optional eventInitDict: CustomEventInit<D>

    Returns boolean

  • Sets focus on the control.

    Parameters

    • Optional options: FocusOptions

    Returns void

  • Sets a custom validation message for the control. As long as message is not empty, the control is considered invalid.

    Parameters

    • message: string

    Returns void

  • Replaces the selected text in the control and re-applies the mask

    Parameters

    • replacement: string
    • Optional start: number
    • Optional end: number
    • Optional selectMode: "end" | "start" | "select" | "preserve"

    Returns void

  • Parameters

    • start: number
    • end: number
    • Optional direction: "none" | "forward" | "backward"

    Returns void