@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
100 lines • 3.96 kB
JavaScript
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
import { inputProperties } from '../../../../components/input/InputDocs';
export const numberProperties = {
decimalLimit: {
doc: 'Max number of decimals. Values with more decimals will be rounded. Defaults to `12`.',
type: 'number',
status: 'optional'
},
percent: {
doc: 'Format a number as percentage.',
type: 'boolean',
status: 'optional'
},
currency: {
doc: 'Currency code (ISO 4217) or `true` to use the default `NOK`. Uses two decimals by default.',
type: ['boolean', 'string'],
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. Defaults to `false`.',
type: 'boolean',
status: 'optional'
},
minimum: {
doc: 'Validation for inclusive minimum number value (greater than or equal). Defaults to `Number.MIN_SAFE_INTEGER`.',
type: 'number',
status: 'optional'
},
maximum: {
doc: 'Validation for inclusive maximum number value (less than or equal). Defaults to `Number.MAX_SAFE_INTEGER`.',
type: 'number',
status: 'optional'
},
exclusiveMinimum: {
doc: 'Validation for exclusive minimum number value (greater than).',
type: 'number',
status: 'optional'
},
exclusiveMaximum: {
doc: 'Validation for exclusive maximum number value (less than).',
type: 'number',
status: 'optional'
},
multipleOf: {
doc: 'Validation that requires the number to be a multiple of given value.',
type: 'number',
status: 'optional'
},
width: {
doc: '`false` for no width (use browser default), `small`, `medium` or `large` for predefined standard widths, `stretch` for fill available width.',
type: ['string', 'false'],
status: 'optional'
},
size: _objectSpread(_objectSpread({}, inputProperties.size), {}, {
doc: `${inputProperties.size.doc} Consider rather setting field sizes with [Form.Appearance](/uilib/extensions/forms/Form/Appearance/).`
}),
align: {
doc: 'Lateral alignment of contents of input field, one of `left` (default), `center`, or `right`.',
type: 'string',
status: 'optional'
},
autoComplete: {
doc: 'For HTML `autocomplete` attributes.',
type: ['on', 'string'],
status: 'optional'
},
prefix: {
doc: 'Text added before the value input.',
type: 'string',
status: 'optional'
},
suffix: {
doc: 'Text added after the value input.',
type: 'string',
status: 'optional'
},
step: {
doc: 'Determines step granularity when in/decreasing value input through step controls buttons or arrow keys. Defaults to 1.',
type: 'number',
status: 'optional'
},
startWith: {
doc: 'When no `value` or `defaultValue` is given, start with a given value when in/decreasing value input through step controls buttons or arrow keys. Defaults to `null`.',
type: 'number',
status: 'optional'
},
showStepControls: {
doc: 'Show buttons that in/decreases value input by the step value.',
type: 'boolean',
status: 'optional'
}
};
//# sourceMappingURL=NumberDocs.js.map