UNPKG

@aveonline/ui-react

Version:

Home base for Aveonline design system - ecosystem react

109 lines (108 loc) 2.73 kB
declare type IFieldCustomMask = { charactersLength?: number; /** * Mask string. Format characters are: * * `9`: `0-9` * * `a`: `A-Z, a-z` * * `\*`: `A-Z, a-z, 0-9` * * Any character can be escaped with backslash, which usually will appear as double backslash in JS strings. * For example, German phone mask with unremoveable prefix +49 will look like `mask="+4\\9 99 999 99"` or `mask={"+4\\\\9 99 999 99"}` */ mask?: string | RegExp; /** * Character to cover unfilled editable parts of mask. Default character is "_". If set to null, unfilled parts will be empty, like in ordinary input. */ maskChar?: string | null | undefined; maskPlaceholder?: string; /** * Show mask even in empty input without focus. */ alwaysShowMask?: boolean | undefined; }; declare type IFieldCustom = { /** * Allow decimals * * Default = true */ allowDecimals?: boolean; /** * Allow user to enter negative value * * Default = true */ allowNegativeValue?: boolean; /** * Maximum characters the user can enter */ maxLength?: number; /** * Limit length of decimals allowed * * Default = 2 */ decimalsLimit?: number; /** * Specify decimal scale for padding/trimming * * Example: * 1.5 -> 1.50 * 1.234 -> 1.23 */ decimalScale?: number; /** * Value will always have the specified length of decimals * * Example: * 123 -> 1.23 * * Note: This formatting only happens onBlur */ fixedDecimalLength?: number; /** * Include a prefix eg. £ */ prefix?: string; /** * Include a suffix eg. € */ suffix?: string; /** * Incremental value change on arrow down and arrow up key press */ step?: number; /** * Separator between integer part and fractional part of value. * * This cannot be a number */ decimalSeparator?: string; /** * Separator between thousand, million and billion * * This cannot be a number */ groupSeparator?: string; /** * Disable auto adding separator between values eg. 1000 -> 1,000 * * Default = false */ disableGroupSeparators?: boolean; /** * Disable abbreviations (m, k, b) * * Default = false */ disableAbbreviations?: boolean; /** * Transform the raw value form the input before parsing */ transformRawValue?: (rawValue: string) => string; /** * All props for custom with mask */ mask?: IFieldCustomMask; }; export type { IFieldCustom, IFieldCustomMask };