@dnb/eufemia
Version:
DNB Eufemia Design System UI Library
91 lines • 3.76 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 { getFieldEventsWithTypes } from '../FieldDocs';
import { stringProperties } from '../String/StringDocs';
import { FieldProperties } from '../../Field/FieldDocs';
export const PhoneNumberProperties = {
countries: {
doc: 'List only a certain set of countries: `Scandinavia`, `Nordic`, `Europe` or `Prioritized`(all countries [sorted by priority](/uilib/extensions/forms/feature-fields/SelectCountry/#filter-or-prioritize-country-listing)). Defaults to `Prioritized`.',
type: 'string',
status: 'optional'
},
filterCountries: {
doc: 'Use this prop to filter out certain countries. The function receives the country object and should return a boolean. Returning `false` will omit the country.',
type: 'function',
status: 'optional'
},
pattern: {
doc: 'Validation based on regex pattern for the number field e.g. `pattern="^[49]+"`.',
type: 'string',
status: 'optional'
},
omitCountryCodeField: {
doc: 'If `true` is given, then everything related to country code is removed.',
type: 'boolean',
status: 'optional'
},
countryCodeFieldClassName: {
doc: 'Class name for the country code component.',
type: 'string',
status: 'optional'
},
numberFieldClassName: {
doc: 'Class name for the number component.',
type: 'string',
status: 'optional'
},
countryCodePlaceholder: {
doc: 'Placeholder for the country code field.',
type: 'string',
status: 'optional'
},
countryCodeLabel: {
doc: 'Label to show above / before the country code field.',
type: 'string',
status: 'optional'
},
numberMask: {
doc: 'See property `mask` of the [InputMasked](/uilib/components/input-masked/properties) component.',
type: 'Various',
status: 'optional'
},
width: {
doc: '`large` for predefined standard width, `stretch` for fill available width.',
type: 'string | false',
status: 'optional'
},
label: _objectSpread(_objectSpread({}, FieldProperties.label), {}, {
doc: 'Field label to show above / before the phone number input field.'
}),
size: stringProperties.size,
'[Space](/uilib/layout/space/properties)': {
doc: 'Spacing properties like `top` or `bottom` are supported.',
type: ['string', 'object'],
status: 'optional'
}
};
export const PhoneNumberSpecificEvents = {
onChange: {
doc: 'Callback on phone number and country code change.',
type: '(value?: string, additionalArgs?: { countryCode?: string, phoneNumber?: string, iso?: string }) => void',
status: 'optional'
},
onCountryCodeChange: {
doc: 'Callback on country code change.',
type: '(value?: string) => void',
status: 'optional'
},
onNumberChange: {
doc: 'Callback on phone number change.',
type: '(value?: string) => void',
status: 'optional'
}
};
export const PhoneNumberGeneralEvents = getFieldEventsWithTypes({
type: 'string',
optional: true
}, {
type: 'object'
});
//# sourceMappingURL=PhoneNumberDocs.js.map