UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

132 lines 5.1 kB
export const InputMaskedProperties = { asNumber: { doc: 'Set to `true` to automatically set a number mask based on the given or inherited locale.', type: 'boolean', status: 'optional' }, asPercent: { doc: 'Set to `true` to automatically set a number mask with a percentage sign based on the given or inherited locale.', type: 'boolean', status: 'optional' }, asCurrency: { doc: 'Set to `true` to use `NOK` or give it a currency code e.g. `USD` to automatically set a currency mask based on the given or inherited locale.', type: ['boolean', 'string'], status: 'optional' }, maskOptions: { doc: 'Use it to manipulate internal masks. You can use it instead of e.g. `numberMask` or `currencyMask`. All options are listed below.', type: 'object', status: 'optional' }, numberMask: { doc: 'Set to `true` to enable the default numbers formatting – or give an `object` containing the number mask properties. More details below. Can be a JSON string as well, containing the number mask properties. Is disabled by default.', type: ['boolean', 'object'], status: 'optional' }, currencyMask: { doc: 'Set to `true` or set the _valuta_ (currencyMask="kr") to enable a custom currency mask – or give an `object` containing the number mask properties. More details below. Can be a JSON string as well, containing the number mask properties. Is disabled by default. Defaults to `kr`.', type: ['boolean', 'object'], status: 'optional' }, numberFormat: { doc: 'Use an object with [NumberFormat](/uilib/components/number-format/properties).', type: 'object', status: 'optional' }, locale: { doc: 'Define the locale to be used in the `asNumber` or `asCurrency` masked. It will be inherited from the [Eufemia Provider](/uilib/usage/customisation/provider) if not given. Defaults to `nb-NO`.', type: 'string', status: 'optional' }, mask: { doc: 'A mask defined as an array of RegExp and string tokens (e.g. `[/\\d/, /\\d/, " ", /\\d/, /\\d/]`) or a single RegExp. Defaults to `number mask`.', type: ['RegExp', 'Array<RegExp | string>'], status: 'optional' }, allowOverflow: { doc: 'Allow users to keep typing after the defined mask has been filled. Extra characters will be appended without masking.', type: 'boolean', status: 'optional' }, overwriteMode: { doc: 'Control how overwriting characters is handled; `shift` (default) moves to the next slot while `replace` stays on the current slot.', type: ['string', 'function'], status: 'optional' }, showMask: { doc: 'Show mask when input is empty and has no focus. Defaults to `false`.', type: 'boolean', status: 'optional' }, '[Space](/uilib/layout/space/properties)': { doc: 'Spacing properties like `top` or `bottom` are supported.', type: ['string', 'object'], status: 'optional' }, '[Input](/uilib/components/input/properties)': { doc: 'All `Input` properties are supported.', type: 'Various', status: 'optional' } }; export const InputMaskedEvents = { onChange: { doc: 'Will be called on value changes made by the user. Returns an object with the value as a string and the native event: `{ value, numberValue, cleanedValue, event }`.', type: 'function', status: 'optional' }, '[Input](/uilib/components/input/events)': { doc: 'All `Input` events are supported.', type: 'Various', status: 'optional' } }; export const InputMaskedMaskOptionsProperties = { prefix: { doc: 'What to display before the amount. Defaults to an empty string.', type: 'string', status: 'optional' }, suffix: { doc: 'What to display after the amount. Defaults to an empty string.', type: 'string', status: 'optional' }, thousandsSeparatorSymbol: { doc: "Character with which to separate thousands. Defaults to `' '`.", type: 'string', status: 'optional' }, allowDecimal: { doc: 'Whether or not to allow the user to enter a fraction with the amount. Defaults to `false`.', type: 'boolean', status: 'optional' }, decimalSymbol: { doc: "Character that will act as a decimal point. Defaults to `','`.", type: 'string', status: 'optional' }, decimalLimit: { doc: 'How many digits to allow after the decimal. Defaults to `2`.', type: 'number', status: 'optional' }, integerLimit: { doc: 'Limit the length of the integer number. Defaults to `null` for unlimited.', type: 'number', status: 'optional' }, allowNegative: { doc: 'Whether or not to allow negative numbers. Defaults to `true`.', type: 'boolean', status: 'optional' }, disallowLeadingZeroes: { doc: 'Whether or not to allow leading zeroes during typing. *A leading zero is any 0 digit that comes before the first nonzero digit in a number string in positional notation* - [wikipedia](https://en.wikipedia.org/wiki/Leading_zero). Defaults to `false`.', type: 'boolean', status: 'optional' } }; //# sourceMappingURL=InputMaskedDocs.js.map