Package-level declarations

Types

Link copied to clipboard

Functions

Link copied to clipboard
fun applyCurrencyMask(value: String, currencyCode: String = "USD", locale: String = "en"): String

Mirrors applyCurrencyMask from mask-input.tsx.

Link copied to clipboard
fun applyMask(value: String, pattern: String, allowLetters: Boolean = false): String

Applies a #-placeholder pattern to value.

Link copied to clipboard

Mirrors applyPercentageMask from mask-input.tsx.

Link copied to clipboard
fun fromUnmaskedIndex(masked: String, pattern: String, unmaskedIndex: Int): Int

Converts a raw-string index back to a caret position in the masked string.

Link copied to clipboard
fun getUnmaskedValue(value: String, allowLetters: Boolean = false): String

Strips all non-digit (or non-alphanumeric) chars from value.

Link copied to clipboard
fun KMaskInput(value: String, onValueChange: (String) -> Unit, modifier: Modifier = Modifier, mask: KMaskPattern? = null, customPattern: String? = null, allowLetters: Boolean = mask?.keyboardType == KeyboardType.Text && mask.withoutMask.not(), withoutMask: Boolean = mask?.withoutMask ?: false, placeholder: String = mask?.placeholder ?: customPattern?.replace('#', '0') ?: "", enabled: Boolean = true, isError: Boolean = false, autoValidate: Boolean = true, customValidate: (String) -> Boolean? = null, onValidationChange: (Boolean) -> Unit? = null, keyboardActions: KeyboardActions = KeyboardActions.Default)

Shadcn/ui-style masked input field — mirrors KMaskInput from mask-input.tsx.

Link copied to clipboard
fun toUnmaskedIndex(masked: String, pattern: String, caret: Int): Int

Converts a caret position in the masked string to an index in the raw string.