UNPKG

@dnb/eufemia

Version:

DNB Eufemia Design System UI Library

99 lines (98 loc) 4.58 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PhoneNumberSpecificEvents = exports.PhoneNumberProperties = exports.PhoneNumberGeneralEvents = void 0; var _FieldDocs = require("../FieldDocs"); var _StringDocs = require("../String/StringDocs"); var _FieldDocs2 = require("../../Field/FieldDocs"); 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; } function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; } function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } const PhoneNumberProperties = exports.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({}, _FieldDocs2.FieldProperties.label), {}, { doc: 'Field label to show above / before the phone number input field.' }), size: _StringDocs.stringProperties.size, '[Space](/uilib/layout/space/properties)': { doc: 'Spacing properties like `top` or `bottom` are supported.', type: ['string', 'object'], status: 'optional' } }; const PhoneNumberSpecificEvents = exports.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' } }; const PhoneNumberGeneralEvents = exports.PhoneNumberGeneralEvents = (0, _FieldDocs.getFieldEventsWithTypes)({ type: 'string', optional: true }, { type: 'object' }); //# sourceMappingURL=PhoneNumberDocs.js.map