@kingteza/crud-component 1.22.3 → 1.23.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_commonjsHelpers.cjs.js +1 -0
- package/dist/_virtual/_commonjsHelpers.es.js +6 -0
- package/dist/_virtual/index.cjs.js +1 -0
- package/dist/_virtual/index.cjs2.js +1 -0
- package/dist/_virtual/index.cjs3.js +1 -0
- package/dist/_virtual/index.cjs4.js +1 -0
- package/dist/_virtual/index.cjs5.js +1 -0
- package/dist/_virtual/index.es.js +7 -0
- package/dist/_virtual/index.es2.js +7 -0
- package/dist/_virtual/index.es3.js +4 -0
- package/dist/_virtual/index.es4.js +4 -0
- package/dist/_virtual/index.es5.js +4 -0
- package/dist/_virtual/react-is.development.cjs.js +1 -0
- package/dist/_virtual/react-is.development.es.js +4 -0
- package/dist/_virtual/react-is.production.min.cjs.js +1 -0
- package/dist/_virtual/react-is.production.min.es.js +4 -0
- package/dist/common/text-field/PhoneNumberField.cjs.js +1 -1
- package/dist/common/text-field/PhoneNumberField.d.ts +9 -1
- package/dist/common/text-field/PhoneNumberField.es.js +70 -15
- package/dist/common/text-field/index.d.ts +1 -0
- package/dist/crud/CrudComponent.d.ts +5 -0
- package/dist/crud/CrudField.cjs.js +1 -1
- package/dist/crud/CrudField.es.js +238 -213
- package/dist/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.cjs.js +5 -0
- package/dist/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.es.js +42 -0
- package/dist/node_modules/.pnpm/country-flag-icons@1.6.12/node_modules/country-flag-icons/modules/react/3x2/index.cjs.js +1 -0
- package/dist/node_modules/.pnpm/country-flag-icons@1.6.12/node_modules/country-flag-icons/modules/react/3x2/index.es.js +6214 -0
- package/dist/node_modules/.pnpm/country-flag-icons@1.6.12/node_modules/country-flag-icons/modules/unicode.cjs.js +1 -0
- package/dist/node_modules/.pnpm/country-flag-icons@1.6.12/node_modules/country-flag-icons/modules/unicode.es.js +9 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/closeBraces.cjs.js +1 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/closeBraces.es.js +9 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/dom.cjs.js +1 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/dom.es.js +43 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/edit.cjs.js +1 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/edit.es.js +17 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/format.cjs.js +1 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/format.es.js +28 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/helpers.cjs.js +2 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/helpers.es.js +37 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/inputControl.cjs.js +1 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/inputControl.es.js +36 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/parse.cjs.js +1 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/parse.es.js +15 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/react/Input.cjs.js +1 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/react/Input.es.js +86 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/react/useInput.cjs.js +1 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/react/useInput.es.js +69 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/templateFormatter.cjs.js +2 -0
- package/dist/node_modules/.pnpm/input-format@0.3.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/input-format/modules/templateFormatter.es.js +62 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouType.cjs.js +2 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouType.es.js +366 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.cjs.js +4 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternMatcher.es.js +172 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.PatternParser.es.js +157 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.cjs.js +2 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.complete.es.js +49 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.es.js +264 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.cjs.js +2 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeFormatter.util.es.js +63 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeParser.cjs.js +2 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeParser.es.js +265 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeState.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/AsYouTypeState.es.js +110 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/ParseError.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/ParseError.es.js +89 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/PhoneNumber.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/PhoneNumber.es.js +188 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/constants.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/constants.es.js +10 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/format.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/format.es.js +98 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/formatIncompletePhoneNumber.es.js +7 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/getCountries.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/getCountries.es.js +7 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/RFC3966.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/RFC3966.es.js +11 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/applyInternationalSeparatorStyle.es.js +7 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/checkNumberLength.es.js +16 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extension/createExtensionPattern.es.js +11 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extension/extractExtension.es.js +18 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCode.es.js +47 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.es.js +22 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractFormattedPhoneNumberFromPossibleRfc3966NumberUri.es.js +23 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractNationalNumber.es.js +39 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractNationalNumberFromPossiblyIncompleteNumber.es.js +31 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/extractPhoneContext.es.js +23 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/formatNationalNumberUsingFormat.es.js +27 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getCountryByCallingCode.es.js +12 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.cjs.js +2 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getCountryByNationalNumber.es.js +45 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getIddPrefix.es.js +12 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getNumberType.cjs.js +2 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getNumberType.es.js +50 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/getPossibleCountriesForNumber.es.js +14 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/isObject.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/isObject.es.js +7 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/isViablePhoneNumber.es.js +20 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/matchesEntirely.es.js +6 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/parseDigits.cjs.js +2 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/parseDigits.es.js +112 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/helpers/stripIddPrefix.es.js +19 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/isPossible.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/isPossible.es.js +42 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/isValid.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/isValid.es.js +12 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/isValidPhoneNumber.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/isValidPhoneNumber.es.js +59 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/metadata.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/metadata.es.js +473 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/normalizeArguments.cjs.js +2 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/normalizeArguments.es.js +108 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parse.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parse.es.js +119 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.cjs.js +2 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parseIncompletePhoneNumber.es.js +47 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parsePhoneNumber.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parsePhoneNumber.es.js +9 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parsePhoneNumberWithError_.es.js +55 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parsePhoneNumber_.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/parsePhoneNumber_.es.js +62 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/tools/semver-compare.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/es6/tools/semver-compare.es.js +14 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/metadata.min.json.cjs.js +1 -0
- package/dist/node_modules/.pnpm/libphonenumber-js@1.12.36/node_modules/libphonenumber-js/metadata.min.json.es.js +4 -0
- package/dist/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.cjs.js +5 -0
- package/dist/node_modules/.pnpm/object-assign@4.1.1/node_modules/object-assign/index.es.js +54 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.cjs.js +1 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/checkPropTypes.es.js +54 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.cjs.js +1 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithThrowingShims.es.js +52 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.cjs.js +2 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/factoryWithTypeCheckers.es.js +329 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.cjs.js +1 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/index.es.js +17 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.cjs.js +1 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/ReactPropTypesSecret.es.js +10 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.cjs.js +1 -0
- package/dist/node_modules/.pnpm/prop-types@15.8.1/node_modules/prop-types/lib/has.es.js +7 -0
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.cjs.js +8 -0
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.development.es.js +95 -0
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.cjs.js +8 -0
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.es.js +78 -0
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/index.es.js +10 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/locale/en.json.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/locale/en.json.es.js +263 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/min/index.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/min/index.es.js +20 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountryIcon.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountryIcon.es.js +69 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountrySelect.cjs.js +2 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/CountrySelect.es.js +158 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/Flag.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/Flag.es.js +62 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputBasic.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputBasic.es.js +113 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputSmart.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InputSmart.es.js +106 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InternationalIcon.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/InternationalIcon.es.js +122 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PhoneInputWithCountry.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PhoneInputWithCountry.es.js +830 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PhoneInputWithCountryDefault.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PhoneInputWithCountryDefault.es.js +50 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PropTypes.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/PropTypes.es.js +9 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/countries.cjs.js +2 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/countries.es.js +78 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/getInternationalPhoneNumberPrefix.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/getInternationalPhoneNumberPrefix.es.js +8 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/getPhoneInputWithCountryStateUpdateFromNewProps.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/getPhoneInputWithCountryStateUpdateFromNewProps.es.js +141 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/inputValuePrefix.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/inputValuePrefix.es.js +12 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/isE164Number.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/isE164Number.es.js +17 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/parsePhoneNumberCharacter.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/parsePhoneNumberCharacter.es.js +17 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/phoneInputHelpers.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/helpers/phoneInputHelpers.es.js +203 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/useExternalRef.cjs.js +2 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/useExternalRef.es.js +39 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/useInputKeyDownHandler.cjs.js +1 -0
- package/dist/node_modules/.pnpm/react-phone-number-input@3.4.14_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/react-phone-number-input/modules/useInputKeyDownHandler.es.js +18 -0
- package/dist/style.css +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import b from "./helpers/extractCountryCallingCode.es.js";
|
|
2
|
+
import y from "./helpers/extractCountryCallingCodeFromInternationalNumberWithoutPlusSign.es.js";
|
|
3
|
+
import m from "./helpers/extractNationalNumberFromPossiblyIncompleteNumber.es.js";
|
|
4
|
+
import C from "./helpers/stripIddPrefix.es.js";
|
|
5
|
+
import v from "./helpers/parseDigits.es.js";
|
|
6
|
+
import { VALID_PUNCTUATION as s, VALID_DIGITS as g, PLUS_CHARS as p } from "./constants.es.js";
|
|
7
|
+
function d(i) {
|
|
8
|
+
"@babel/helpers - typeof";
|
|
9
|
+
return d = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
|
|
10
|
+
return typeof n;
|
|
11
|
+
} : function(n) {
|
|
12
|
+
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
|
|
13
|
+
}, d(i);
|
|
14
|
+
}
|
|
15
|
+
function h(i, n) {
|
|
16
|
+
return I(i) || P(i, n) || S(i, n) || x();
|
|
17
|
+
}
|
|
18
|
+
function x() {
|
|
19
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
20
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
21
|
+
}
|
|
22
|
+
function S(i, n) {
|
|
23
|
+
if (i) {
|
|
24
|
+
if (typeof i == "string") return N(i, n);
|
|
25
|
+
var t = {}.toString.call(i).slice(8, -1);
|
|
26
|
+
return t === "Object" && i.constructor && (t = i.constructor.name), t === "Map" || t === "Set" ? Array.from(i) : t === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? N(i, n) : void 0;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function N(i, n) {
|
|
30
|
+
(n == null || n > i.length) && (n = i.length);
|
|
31
|
+
for (var t = 0, e = Array(n); t < n; t++) e[t] = i[t];
|
|
32
|
+
return e;
|
|
33
|
+
}
|
|
34
|
+
function P(i, n) {
|
|
35
|
+
var t = i == null ? null : typeof Symbol < "u" && i[Symbol.iterator] || i["@@iterator"];
|
|
36
|
+
if (t != null) {
|
|
37
|
+
var e, r, a, o, u = [], l = !0, c = !1;
|
|
38
|
+
try {
|
|
39
|
+
if (a = (t = t.call(i)).next, n !== 0) for (; !(l = (e = a.call(t)).done) && (u.push(e.value), u.length !== n); l = !0) ;
|
|
40
|
+
} catch (f) {
|
|
41
|
+
c = !0, r = f;
|
|
42
|
+
} finally {
|
|
43
|
+
try {
|
|
44
|
+
if (!l && t.return != null && (o = t.return(), Object(o) !== o)) return;
|
|
45
|
+
} finally {
|
|
46
|
+
if (c) throw r;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return u;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
function I(i) {
|
|
53
|
+
if (Array.isArray(i)) return i;
|
|
54
|
+
}
|
|
55
|
+
function A(i, n) {
|
|
56
|
+
if (!(i instanceof n)) throw new TypeError("Cannot call a class as a function");
|
|
57
|
+
}
|
|
58
|
+
function _(i, n) {
|
|
59
|
+
for (var t = 0; t < n.length; t++) {
|
|
60
|
+
var e = n[t];
|
|
61
|
+
e.enumerable = e.enumerable || !1, e.configurable = !0, "value" in e && (e.writable = !0), Object.defineProperty(i, T(e.key), e);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function E(i, n, t) {
|
|
65
|
+
return n && _(i.prototype, n), Object.defineProperty(i, "prototype", { writable: !1 }), i;
|
|
66
|
+
}
|
|
67
|
+
function T(i) {
|
|
68
|
+
var n = D(i, "string");
|
|
69
|
+
return d(n) == "symbol" ? n : n + "";
|
|
70
|
+
}
|
|
71
|
+
function D(i, n) {
|
|
72
|
+
if (d(i) != "object" || !i) return i;
|
|
73
|
+
var t = i[Symbol.toPrimitive];
|
|
74
|
+
if (t !== void 0) {
|
|
75
|
+
var e = t.call(i, n);
|
|
76
|
+
if (d(e) != "object") return e;
|
|
77
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
78
|
+
}
|
|
79
|
+
return String(i);
|
|
80
|
+
}
|
|
81
|
+
var R = "[" + s + g + "]+", F = new RegExp("^" + R + "$", "i"), k = "(?:[" + p + "][" + s + g + "]*|[" + s + g + "]+)", O = new RegExp("[^" + s + g + "]+.*$"), M = /[^\d\[\]]/, $ = /* @__PURE__ */ (function() {
|
|
82
|
+
function i(n) {
|
|
83
|
+
var t = n.defaultCountry, e = n.defaultCallingCode, r = n.metadata, a = n.onNationalSignificantNumberChange;
|
|
84
|
+
A(this, i), this.defaultCountry = t, this.defaultCallingCode = e, this.metadata = r, this.onNationalSignificantNumberChange = a;
|
|
85
|
+
}
|
|
86
|
+
return E(i, [{
|
|
87
|
+
key: "input",
|
|
88
|
+
value: function(t, e) {
|
|
89
|
+
var r = j(t), a = h(r, 2), o = a[0], u = a[1], l = v(o), c;
|
|
90
|
+
return u && (e.digits || (e.startInternationalNumber(void 0, void 0), l || (c = !0))), l && this.inputDigits(l, e), {
|
|
91
|
+
digits: l,
|
|
92
|
+
justLeadingPlus: c
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Inputs "next" phone number digits.
|
|
97
|
+
* @param {string} digits
|
|
98
|
+
* @return {string} [formattedNumber] Formatted national phone number (if it can be formatted at this stage). Returning `undefined` means "don't format the national phone number at this stage".
|
|
99
|
+
*/
|
|
100
|
+
}, {
|
|
101
|
+
key: "inputDigits",
|
|
102
|
+
value: function(t, e) {
|
|
103
|
+
var r = e.digits, a = r.length < 3 && r.length + t.length >= 3;
|
|
104
|
+
if (e.appendDigits(t), a && this.extractIddPrefix(e), this.isWaitingForCountryCallingCode(e)) {
|
|
105
|
+
if (!this.extractCountryCallingCode(e))
|
|
106
|
+
return;
|
|
107
|
+
} else
|
|
108
|
+
e.appendNationalSignificantNumberDigits(t);
|
|
109
|
+
e.international || this.hasExtractedNationalSignificantNumber || this.extractNationalSignificantNumber(e.getNationalDigits(), function(o) {
|
|
110
|
+
return e.update(o);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
}, {
|
|
114
|
+
key: "isWaitingForCountryCallingCode",
|
|
115
|
+
value: function(t) {
|
|
116
|
+
var e = t.international, r = t.callingCode;
|
|
117
|
+
return e && !r;
|
|
118
|
+
}
|
|
119
|
+
// Extracts a country calling code from a number
|
|
120
|
+
// being entered in internatonal format.
|
|
121
|
+
}, {
|
|
122
|
+
key: "extractCountryCallingCode",
|
|
123
|
+
value: function(t) {
|
|
124
|
+
var e = b("+" + t.getDigitsWithoutInternationalPrefix(), t.country, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), r = e.countryCallingCode, a = e.number;
|
|
125
|
+
if (r)
|
|
126
|
+
return t.setCallingCode(r), t.update({
|
|
127
|
+
nationalSignificantNumber: a
|
|
128
|
+
}), !0;
|
|
129
|
+
}
|
|
130
|
+
}, {
|
|
131
|
+
key: "reset",
|
|
132
|
+
value: function(t) {
|
|
133
|
+
if (t) {
|
|
134
|
+
this.hasSelectedNumberingPlan = !0;
|
|
135
|
+
var e = t._nationalPrefixForParsing();
|
|
136
|
+
this.couldPossiblyExtractAnotherNationalSignificantNumber = e && M.test(e);
|
|
137
|
+
} else
|
|
138
|
+
this.hasSelectedNumberingPlan = void 0, this.couldPossiblyExtractAnotherNationalSignificantNumber = void 0;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Extracts a national (significant) number from user input.
|
|
142
|
+
* Google's library is different in that it only applies `national_prefix_for_parsing`
|
|
143
|
+
* and doesn't apply `national_prefix_transform_rule` after that.
|
|
144
|
+
* https://github.com/google/libphonenumber/blob/a3d70b0487875475e6ad659af404943211d26456/java/libphonenumber/src/com/google/i18n/phonenumbers/AsYouTypeFormatter.java#L539
|
|
145
|
+
* @return {boolean} [extracted]
|
|
146
|
+
*/
|
|
147
|
+
}, {
|
|
148
|
+
key: "extractNationalSignificantNumber",
|
|
149
|
+
value: function(t, e) {
|
|
150
|
+
if (this.hasSelectedNumberingPlan) {
|
|
151
|
+
var r = m(t, this.metadata), a = r.nationalPrefix, o = r.nationalNumber, u = r.carrierCode;
|
|
152
|
+
if (o !== t)
|
|
153
|
+
return this.onExtractedNationalNumber(a, u, o, t, e), !0;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* In Google's code this function is called "attempt to extract longer NDD".
|
|
158
|
+
* "Some national prefixes are a substring of others", they say.
|
|
159
|
+
* @return {boolean} [result] — Returns `true` if extracting a national prefix produced different results from what they were.
|
|
160
|
+
*/
|
|
161
|
+
}, {
|
|
162
|
+
key: "extractAnotherNationalSignificantNumber",
|
|
163
|
+
value: function(t, e, r) {
|
|
164
|
+
if (!this.hasExtractedNationalSignificantNumber)
|
|
165
|
+
return this.extractNationalSignificantNumber(t, r);
|
|
166
|
+
if (this.couldPossiblyExtractAnotherNationalSignificantNumber) {
|
|
167
|
+
var a = m(t, this.metadata), o = a.nationalPrefix, u = a.nationalNumber, l = a.carrierCode;
|
|
168
|
+
if (u !== e)
|
|
169
|
+
return this.onExtractedNationalNumber(o, l, u, t, r), !0;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}, {
|
|
173
|
+
key: "onExtractedNationalNumber",
|
|
174
|
+
value: function(t, e, r, a, o) {
|
|
175
|
+
var u = !1, l, c = a.lastIndexOf(r);
|
|
176
|
+
if (c < 0 || c !== a.length - r.length)
|
|
177
|
+
u = !0;
|
|
178
|
+
else {
|
|
179
|
+
var f = a.slice(0, c);
|
|
180
|
+
f && f !== t && (l = f);
|
|
181
|
+
}
|
|
182
|
+
o({
|
|
183
|
+
nationalPrefix: t,
|
|
184
|
+
carrierCode: e,
|
|
185
|
+
nationalSignificantNumber: r,
|
|
186
|
+
nationalSignificantNumberIsModified: u,
|
|
187
|
+
prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix: l
|
|
188
|
+
}), this.hasExtractedNationalSignificantNumber = !0, this.onNationalSignificantNumberChange();
|
|
189
|
+
}
|
|
190
|
+
}, {
|
|
191
|
+
key: "reExtractNationalSignificantNumber",
|
|
192
|
+
value: function(t) {
|
|
193
|
+
if (this.extractAnotherNationalSignificantNumber(t.getNationalDigits(), t.nationalSignificantNumber, function(e) {
|
|
194
|
+
return t.update(e);
|
|
195
|
+
}))
|
|
196
|
+
return !0;
|
|
197
|
+
if (this.extractIddPrefix(t))
|
|
198
|
+
return this.extractCallingCodeAndNationalSignificantNumber(t), !0;
|
|
199
|
+
if (this.fixMissingPlus(t))
|
|
200
|
+
return this.extractCallingCodeAndNationalSignificantNumber(t), !0;
|
|
201
|
+
}
|
|
202
|
+
}, {
|
|
203
|
+
key: "extractIddPrefix",
|
|
204
|
+
value: function(t) {
|
|
205
|
+
var e = t.international, r = t.IDDPrefix, a = t.digits;
|
|
206
|
+
if (t.nationalSignificantNumber, !(e || r)) {
|
|
207
|
+
var o = C(a, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata);
|
|
208
|
+
if (o !== void 0 && o !== a)
|
|
209
|
+
return t.update({
|
|
210
|
+
IDDPrefix: a.slice(0, a.length - o.length)
|
|
211
|
+
}), this.startInternationalNumber(t, {
|
|
212
|
+
country: void 0,
|
|
213
|
+
callingCode: void 0
|
|
214
|
+
}), !0;
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}, {
|
|
218
|
+
key: "fixMissingPlus",
|
|
219
|
+
value: function(t) {
|
|
220
|
+
if (!t.international) {
|
|
221
|
+
var e = y(t.digits, t.country, this.defaultCountry, this.defaultCallingCode, this.metadata.metadata), r = e.countryCallingCode;
|
|
222
|
+
if (r)
|
|
223
|
+
return t.update({
|
|
224
|
+
missingPlus: !0
|
|
225
|
+
}), this.startInternationalNumber(t, {
|
|
226
|
+
country: t.country,
|
|
227
|
+
callingCode: r
|
|
228
|
+
}), !0;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}, {
|
|
232
|
+
key: "startInternationalNumber",
|
|
233
|
+
value: function(t, e) {
|
|
234
|
+
var r = e.country, a = e.callingCode;
|
|
235
|
+
t.startInternationalNumber(r, a), t.nationalSignificantNumber && (t.resetNationalSignificantNumber(), this.onNationalSignificantNumberChange(), this.hasExtractedNationalSignificantNumber = void 0);
|
|
236
|
+
}
|
|
237
|
+
}, {
|
|
238
|
+
key: "extractCallingCodeAndNationalSignificantNumber",
|
|
239
|
+
value: function(t) {
|
|
240
|
+
this.extractCountryCallingCode(t) && this.extractNationalSignificantNumber(t.getNationalDigits(), function(e) {
|
|
241
|
+
return t.update(e);
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
}]);
|
|
245
|
+
})();
|
|
246
|
+
function L(i) {
|
|
247
|
+
var n = i.search(k);
|
|
248
|
+
if (!(n < 0)) {
|
|
249
|
+
i = i.slice(n);
|
|
250
|
+
var t;
|
|
251
|
+
return i[0] === "+" && (t = !0, i = i.slice(1)), i = i.replace(O, ""), t && (i = "+" + i), i;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
function w(i) {
|
|
255
|
+
var n = L(i) || "";
|
|
256
|
+
return n[0] === "+" ? [n.slice(1), !0] : [n];
|
|
257
|
+
}
|
|
258
|
+
function j(i) {
|
|
259
|
+
var n = w(i), t = h(n, 2), e = t[0], r = t[1];
|
|
260
|
+
return F.test(e) || (e = ""), [e, r];
|
|
261
|
+
}
|
|
262
|
+
export {
|
|
263
|
+
$ as default,
|
|
264
|
+
j as extractFormattedDigitsAndPlus
|
|
265
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function a(e){"@babel/helpers - typeof";return a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},a(e)}function l(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function s(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}function u(e,t,i){return t&&s(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function f(e){var t=g(e,"string");return a(t)=="symbol"?t:t+""}function g(e,t){if(a(e)!="object"||!e)return e;var i=e[Symbol.toPrimitive];if(i!==void 0){var n=i.call(e,t);if(a(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}var h=(function(){function e(t){var i=t.onCountryChange,n=t.onCallingCodeChange;l(this,e),this.onCountryChange=i,this.onCallingCodeChange=n}return u(e,[{key:"reset",value:function(i){var n=i.country,r=i.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(n,r)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberIsModified=!1,this.nationalPrefix=void 0,this.carrierCode=void 0,this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix=void 0}},{key:"update",value:function(i){for(var n=0,r=Object.keys(i);n<r.length;n++){var o=r[n];this[o]=i[o]}}},{key:"initCountryAndCallingCode",value:function(i,n){this.setCountry(i),this.setCallingCode(n)}},{key:"setCountry",value:function(i){this.country=i,this.onCountryChange(i)}},{key:"setCallingCode",value:function(i){this.callingCode=i,this.onCallingCodeChange(i,this.country)}},{key:"startInternationalNumber",value:function(i,n){this.international=!0,this.initCountryAndCallingCode(i,n)}},{key:"appendDigits",value:function(i){this.digits+=i}},{key:"appendNationalSignificantNumberDigits",value:function(i){this.nationalSignificantNumber+=i}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}])})();module.exports=h;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
function a(e) {
|
|
2
|
+
"@babel/helpers - typeof";
|
|
3
|
+
return a = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
4
|
+
return typeof t;
|
|
5
|
+
} : function(t) {
|
|
6
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
7
|
+
}, a(e);
|
|
8
|
+
}
|
|
9
|
+
function l(e, t) {
|
|
10
|
+
if (!(e instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
11
|
+
}
|
|
12
|
+
function s(e, t) {
|
|
13
|
+
for (var i = 0; i < t.length; i++) {
|
|
14
|
+
var n = t[i];
|
|
15
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, f(n.key), n);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function u(e, t, i) {
|
|
19
|
+
return t && s(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
20
|
+
}
|
|
21
|
+
function f(e) {
|
|
22
|
+
var t = g(e, "string");
|
|
23
|
+
return a(t) == "symbol" ? t : t + "";
|
|
24
|
+
}
|
|
25
|
+
function g(e, t) {
|
|
26
|
+
if (a(e) != "object" || !e) return e;
|
|
27
|
+
var i = e[Symbol.toPrimitive];
|
|
28
|
+
if (i !== void 0) {
|
|
29
|
+
var n = i.call(e, t);
|
|
30
|
+
if (a(n) != "object") return n;
|
|
31
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
32
|
+
}
|
|
33
|
+
return String(e);
|
|
34
|
+
}
|
|
35
|
+
var h = /* @__PURE__ */ (function() {
|
|
36
|
+
function e(t) {
|
|
37
|
+
var i = t.onCountryChange, n = t.onCallingCodeChange;
|
|
38
|
+
l(this, e), this.onCountryChange = i, this.onCallingCodeChange = n;
|
|
39
|
+
}
|
|
40
|
+
return u(e, [{
|
|
41
|
+
key: "reset",
|
|
42
|
+
value: function(i) {
|
|
43
|
+
var n = i.country, o = i.callingCode;
|
|
44
|
+
this.international = !1, this.missingPlus = !1, this.IDDPrefix = void 0, this.callingCode = void 0, this.digits = "", this.resetNationalSignificantNumber(), this.initCountryAndCallingCode(n, o);
|
|
45
|
+
}
|
|
46
|
+
}, {
|
|
47
|
+
key: "resetNationalSignificantNumber",
|
|
48
|
+
value: function() {
|
|
49
|
+
this.nationalSignificantNumber = this.getNationalDigits(), this.nationalSignificantNumberIsModified = !1, this.nationalPrefix = void 0, this.carrierCode = void 0, this.prefixBeforeNationalSignificantNumberThatIsNotNationalPrefix = void 0;
|
|
50
|
+
}
|
|
51
|
+
}, {
|
|
52
|
+
key: "update",
|
|
53
|
+
value: function(i) {
|
|
54
|
+
for (var n = 0, o = Object.keys(i); n < o.length; n++) {
|
|
55
|
+
var r = o[n];
|
|
56
|
+
this[r] = i[r];
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}, {
|
|
60
|
+
key: "initCountryAndCallingCode",
|
|
61
|
+
value: function(i, n) {
|
|
62
|
+
this.setCountry(i), this.setCallingCode(n);
|
|
63
|
+
}
|
|
64
|
+
}, {
|
|
65
|
+
key: "setCountry",
|
|
66
|
+
value: function(i) {
|
|
67
|
+
this.country = i, this.onCountryChange(i);
|
|
68
|
+
}
|
|
69
|
+
}, {
|
|
70
|
+
key: "setCallingCode",
|
|
71
|
+
value: function(i) {
|
|
72
|
+
this.callingCode = i, this.onCallingCodeChange(i, this.country);
|
|
73
|
+
}
|
|
74
|
+
}, {
|
|
75
|
+
key: "startInternationalNumber",
|
|
76
|
+
value: function(i, n) {
|
|
77
|
+
this.international = !0, this.initCountryAndCallingCode(i, n);
|
|
78
|
+
}
|
|
79
|
+
}, {
|
|
80
|
+
key: "appendDigits",
|
|
81
|
+
value: function(i) {
|
|
82
|
+
this.digits += i;
|
|
83
|
+
}
|
|
84
|
+
}, {
|
|
85
|
+
key: "appendNationalSignificantNumberDigits",
|
|
86
|
+
value: function(i) {
|
|
87
|
+
this.nationalSignificantNumber += i;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Returns the part of `this.digits` that corresponds to the national number.
|
|
91
|
+
* Basically, all digits that have been input by the user, except for the
|
|
92
|
+
* international prefix and the country calling code part
|
|
93
|
+
* (if the number is an international one).
|
|
94
|
+
* @return {string}
|
|
95
|
+
*/
|
|
96
|
+
}, {
|
|
97
|
+
key: "getNationalDigits",
|
|
98
|
+
value: function() {
|
|
99
|
+
return this.international ? this.digits.slice((this.IDDPrefix ? this.IDDPrefix.length : 0) + (this.callingCode ? this.callingCode.length : 0)) : this.digits;
|
|
100
|
+
}
|
|
101
|
+
}, {
|
|
102
|
+
key: "getDigitsWithoutInternationalPrefix",
|
|
103
|
+
value: function() {
|
|
104
|
+
return this.international && this.IDDPrefix ? this.digits.slice(this.IDDPrefix.length) : this.digits;
|
|
105
|
+
}
|
|
106
|
+
}]);
|
|
107
|
+
})();
|
|
108
|
+
export {
|
|
109
|
+
h as default
|
|
110
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function i(r){"@babel/helpers - typeof";return i=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(r)}function a(r,t,n){return Object.defineProperty(r,"prototype",{writable:!1}),r}function s(r,t){if(!(r instanceof t))throw new TypeError("Cannot call a class as a function")}function l(r,t,n){return t=c(t),y(r,p()?Reflect.construct(t,n||[],c(r).constructor):t.apply(r,n))}function y(r,t){if(t&&(i(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return b(r)}function b(r){if(r===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function _(r,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(t&&t.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),Object.defineProperty(r,"prototype",{writable:!1}),t&&u(r,t)}function f(r){var t=typeof Map=="function"?new Map:void 0;return f=function(e){if(e===null||!v(e))return e;if(typeof e!="function")throw new TypeError("Super expression must either be null or a function");if(t!==void 0){if(t.has(e))return t.get(e);t.set(e,o)}function o(){return h(e,arguments,c(this).constructor)}return o.prototype=Object.create(e.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),u(o,e)},f(r)}function h(r,t,n){if(p())return Reflect.construct.apply(null,arguments);var e=[null];e.push.apply(e,t);var o=new(r.bind.apply(r,e));return n&&u(o,n.prototype),o}function p(){try{var r=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(p=function(){return!!r})()}function v(r){try{return Function.toString.call(r).indexOf("[native code]")!==-1}catch{return typeof r=="function"}}function u(r,t){return u=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,e){return n.__proto__=e,n},u(r,t)}function c(r){return c=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},c(r)}var O=(function(r){function t(n){var e;return s(this,t),e=l(this,t,[n]),Object.setPrototypeOf(e,t.prototype),e.name=e.constructor.name,e}return _(t,r),a(t)})(f(Error));module.exports=O;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
function i(r) {
|
|
2
|
+
"@babel/helpers - typeof";
|
|
3
|
+
return i = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
4
|
+
return typeof t;
|
|
5
|
+
} : function(t) {
|
|
6
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
7
|
+
}, i(r);
|
|
8
|
+
}
|
|
9
|
+
function a(r, t, n) {
|
|
10
|
+
return Object.defineProperty(r, "prototype", { writable: !1 }), r;
|
|
11
|
+
}
|
|
12
|
+
function s(r, t) {
|
|
13
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
14
|
+
}
|
|
15
|
+
function l(r, t, n) {
|
|
16
|
+
return t = c(t), y(r, p() ? Reflect.construct(t, n || [], c(r).constructor) : t.apply(r, n));
|
|
17
|
+
}
|
|
18
|
+
function y(r, t) {
|
|
19
|
+
if (t && (i(t) == "object" || typeof t == "function")) return t;
|
|
20
|
+
if (t !== void 0) throw new TypeError("Derived constructors may only return object or undefined");
|
|
21
|
+
return b(r);
|
|
22
|
+
}
|
|
23
|
+
function b(r) {
|
|
24
|
+
if (r === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
25
|
+
return r;
|
|
26
|
+
}
|
|
27
|
+
function _(r, t) {
|
|
28
|
+
if (typeof t != "function" && t !== null) throw new TypeError("Super expression must either be null or a function");
|
|
29
|
+
r.prototype = Object.create(t && t.prototype, { constructor: { value: r, writable: !0, configurable: !0 } }), Object.defineProperty(r, "prototype", { writable: !1 }), t && u(r, t);
|
|
30
|
+
}
|
|
31
|
+
function f(r) {
|
|
32
|
+
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
33
|
+
return f = function(e) {
|
|
34
|
+
if (e === null || !v(e)) return e;
|
|
35
|
+
if (typeof e != "function") throw new TypeError("Super expression must either be null or a function");
|
|
36
|
+
if (t !== void 0) {
|
|
37
|
+
if (t.has(e)) return t.get(e);
|
|
38
|
+
t.set(e, o);
|
|
39
|
+
}
|
|
40
|
+
function o() {
|
|
41
|
+
return h(e, arguments, c(this).constructor);
|
|
42
|
+
}
|
|
43
|
+
return o.prototype = Object.create(e.prototype, { constructor: { value: o, enumerable: !1, writable: !0, configurable: !0 } }), u(o, e);
|
|
44
|
+
}, f(r);
|
|
45
|
+
}
|
|
46
|
+
function h(r, t, n) {
|
|
47
|
+
if (p()) return Reflect.construct.apply(null, arguments);
|
|
48
|
+
var e = [null];
|
|
49
|
+
e.push.apply(e, t);
|
|
50
|
+
var o = new (r.bind.apply(r, e))();
|
|
51
|
+
return n && u(o, n.prototype), o;
|
|
52
|
+
}
|
|
53
|
+
function p() {
|
|
54
|
+
try {
|
|
55
|
+
var r = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
56
|
+
}));
|
|
57
|
+
} catch {
|
|
58
|
+
}
|
|
59
|
+
return (p = function() {
|
|
60
|
+
return !!r;
|
|
61
|
+
})();
|
|
62
|
+
}
|
|
63
|
+
function v(r) {
|
|
64
|
+
try {
|
|
65
|
+
return Function.toString.call(r).indexOf("[native code]") !== -1;
|
|
66
|
+
} catch {
|
|
67
|
+
return typeof r == "function";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
function u(r, t) {
|
|
71
|
+
return u = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, e) {
|
|
72
|
+
return n.__proto__ = e, n;
|
|
73
|
+
}, u(r, t);
|
|
74
|
+
}
|
|
75
|
+
function c(r) {
|
|
76
|
+
return c = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
|
|
77
|
+
return t.__proto__ || Object.getPrototypeOf(t);
|
|
78
|
+
}, c(r);
|
|
79
|
+
}
|
|
80
|
+
var O = /* @__PURE__ */ (function(r) {
|
|
81
|
+
function t(n) {
|
|
82
|
+
var e;
|
|
83
|
+
return s(this, t), e = l(this, t, [n]), Object.setPrototypeOf(e, t.prototype), e.name = e.constructor.name, e;
|
|
84
|
+
}
|
|
85
|
+
return _(t, r), a(t);
|
|
86
|
+
})(/* @__PURE__ */ f(Error));
|
|
87
|
+
export {
|
|
88
|
+
O as default
|
|
89
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("./metadata.cjs.js"),h=require("./isPossible.cjs.js"),m=require("./isValid.cjs.js"),v=require("./helpers/getNumberType.cjs.js"),w=require("./helpers/getPossibleCountriesForNumber.cjs.js"),P=require("./helpers/extractCountryCallingCode.cjs.js"),f=require("./helpers/isObject.cjs.js"),C=require("./format.cjs.js");function o(r){"@babel/helpers - typeof";return o=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(r)}function c(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function l(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?c(Object(t),!0).forEach(function(n){E(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function E(r,e,t){return(e=y(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function j(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function O(r,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(r,y(n.key),n)}}function k(r,e,t){return e&&O(r.prototype,e),Object.defineProperty(r,"prototype",{writable:!1}),r}function y(r){var e=T(r,"string");return o(e)=="symbol"?e:e+""}function T(r,e){if(o(r)!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e);if(o(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}var q=(function(){function r(e,t,n){if(j(this,r),!e)throw new TypeError("First argument is required");if(typeof e!="string")throw new TypeError("First argument must be a string");if(e[0]==="+"&&!t)throw new TypeError("`metadata` argument not passed");if(f(t)&&f(t.countries)){n=t;var i=e;if(!_.test(i))throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');var a=P(i,void 0,void 0,void 0,n),b=a.countryCallingCode,g=a.number;if(t=g,e=b,!t)throw new Error("Invalid `number` argument passed: too short")}if(!t)throw new TypeError("`nationalNumber` argument is required");if(typeof t!="string")throw new TypeError("`nationalNumber` argument must be a string");u.validateMetadata(n);var s=S(e,n),p=s.country,d=s.countryCallingCode;this.country=p,this.countryCallingCode=d,this.nationalNumber=t,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}}return k(r,[{key:"setExt",value:function(t){this.ext=t}},{key:"getPossibleCountries",value:function(){return this.country?[this.country]:w(this.countryCallingCode,this.nationalNumber,this.getMetadata())}},{key:"isPossible",value:function(){return h.default(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return m(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){var t=new u.default(this.getMetadata());return t.isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(t){return this.number===t.number&&this.ext===t.ext}},{key:"getType",value:function(){return v.default(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(t,n){return C.default(this,t,n?l(l({},n),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(t){return this.format("NATIONAL",t)}},{key:"formatInternational",value:function(t){return this.format("INTERNATIONAL",t)}},{key:"getURI",value:function(t){return this.format("RFC3966",t)}}])})(),N=function(e){return/^[A-Z]{2}$/.test(e)};function S(r,e){var t,n,i=new u.default(e);return N(r)?(t=r,i.selectNumberingPlan(t),n=i.countryCallingCode()):n=r,{country:t,countryCallingCode:n}}var _=/^\+\d+$/;module.exports=q;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
import l, { validateMetadata as h } from "./metadata.es.js";
|
|
2
|
+
import d from "./isPossible.es.js";
|
|
3
|
+
import v from "./isValid.es.js";
|
|
4
|
+
import w from "./helpers/getNumberType.es.js";
|
|
5
|
+
import P from "./helpers/getPossibleCountriesForNumber.es.js";
|
|
6
|
+
import C from "./helpers/extractCountryCallingCode.es.js";
|
|
7
|
+
import s from "./helpers/isObject.es.js";
|
|
8
|
+
import E from "./format.es.js";
|
|
9
|
+
function o(r) {
|
|
10
|
+
"@babel/helpers - typeof";
|
|
11
|
+
return o = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
12
|
+
return typeof t;
|
|
13
|
+
} : function(t) {
|
|
14
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
15
|
+
}, o(r);
|
|
16
|
+
}
|
|
17
|
+
function f(r, t) {
|
|
18
|
+
var e = Object.keys(r);
|
|
19
|
+
if (Object.getOwnPropertySymbols) {
|
|
20
|
+
var n = Object.getOwnPropertySymbols(r);
|
|
21
|
+
t && (n = n.filter(function(i) {
|
|
22
|
+
return Object.getOwnPropertyDescriptor(r, i).enumerable;
|
|
23
|
+
})), e.push.apply(e, n);
|
|
24
|
+
}
|
|
25
|
+
return e;
|
|
26
|
+
}
|
|
27
|
+
function c(r) {
|
|
28
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
29
|
+
var e = arguments[t] != null ? arguments[t] : {};
|
|
30
|
+
t % 2 ? f(Object(e), !0).forEach(function(n) {
|
|
31
|
+
j(r, n, e[n]);
|
|
32
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(r, Object.getOwnPropertyDescriptors(e)) : f(Object(e)).forEach(function(n) {
|
|
33
|
+
Object.defineProperty(r, n, Object.getOwnPropertyDescriptor(e, n));
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
return r;
|
|
37
|
+
}
|
|
38
|
+
function j(r, t, e) {
|
|
39
|
+
return (t = y(t)) in r ? Object.defineProperty(r, t, { value: e, enumerable: !0, configurable: !0, writable: !0 }) : r[t] = e, r;
|
|
40
|
+
}
|
|
41
|
+
function O(r, t) {
|
|
42
|
+
if (!(r instanceof t)) throw new TypeError("Cannot call a class as a function");
|
|
43
|
+
}
|
|
44
|
+
function k(r, t) {
|
|
45
|
+
for (var e = 0; e < t.length; e++) {
|
|
46
|
+
var n = t[e];
|
|
47
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(r, y(n.key), n);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function N(r, t, e) {
|
|
51
|
+
return t && k(r.prototype, t), Object.defineProperty(r, "prototype", { writable: !1 }), r;
|
|
52
|
+
}
|
|
53
|
+
function y(r) {
|
|
54
|
+
var t = T(r, "string");
|
|
55
|
+
return o(t) == "symbol" ? t : t + "";
|
|
56
|
+
}
|
|
57
|
+
function T(r, t) {
|
|
58
|
+
if (o(r) != "object" || !r) return r;
|
|
59
|
+
var e = r[Symbol.toPrimitive];
|
|
60
|
+
if (e !== void 0) {
|
|
61
|
+
var n = e.call(r, t);
|
|
62
|
+
if (o(n) != "object") return n;
|
|
63
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
64
|
+
}
|
|
65
|
+
return String(r);
|
|
66
|
+
}
|
|
67
|
+
var U = /* @__PURE__ */ (function() {
|
|
68
|
+
function r(t, e, n) {
|
|
69
|
+
if (O(this, r), !t)
|
|
70
|
+
throw new TypeError("First argument is required");
|
|
71
|
+
if (typeof t != "string")
|
|
72
|
+
throw new TypeError("First argument must be a string");
|
|
73
|
+
if (t[0] === "+" && !e)
|
|
74
|
+
throw new TypeError("`metadata` argument not passed");
|
|
75
|
+
if (s(e) && s(e.countries)) {
|
|
76
|
+
n = e;
|
|
77
|
+
var i = t;
|
|
78
|
+
if (!_.test(i))
|
|
79
|
+
throw new Error('Invalid `number` argument passed: must consist of a "+" followed by digits');
|
|
80
|
+
var u = C(i, void 0, void 0, void 0, n), m = u.countryCallingCode, p = u.number;
|
|
81
|
+
if (e = p, t = m, !e)
|
|
82
|
+
throw new Error("Invalid `number` argument passed: too short");
|
|
83
|
+
}
|
|
84
|
+
if (!e)
|
|
85
|
+
throw new TypeError("`nationalNumber` argument is required");
|
|
86
|
+
if (typeof e != "string")
|
|
87
|
+
throw new TypeError("`nationalNumber` argument must be a string");
|
|
88
|
+
h(n);
|
|
89
|
+
var a = S(t, n), b = a.country, g = a.countryCallingCode;
|
|
90
|
+
this.country = b, this.countryCallingCode = g, this.nationalNumber = e, this.number = "+" + this.countryCallingCode + this.nationalNumber, this.getMetadata = function() {
|
|
91
|
+
return n;
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
return N(r, [{
|
|
95
|
+
key: "setExt",
|
|
96
|
+
value: function(e) {
|
|
97
|
+
this.ext = e;
|
|
98
|
+
}
|
|
99
|
+
}, {
|
|
100
|
+
key: "getPossibleCountries",
|
|
101
|
+
value: function() {
|
|
102
|
+
return this.country ? [this.country] : P(this.countryCallingCode, this.nationalNumber, this.getMetadata());
|
|
103
|
+
}
|
|
104
|
+
}, {
|
|
105
|
+
key: "isPossible",
|
|
106
|
+
value: function() {
|
|
107
|
+
return d(this, {
|
|
108
|
+
v2: !0
|
|
109
|
+
}, this.getMetadata());
|
|
110
|
+
}
|
|
111
|
+
}, {
|
|
112
|
+
key: "isValid",
|
|
113
|
+
value: function() {
|
|
114
|
+
return v(this, {
|
|
115
|
+
v2: !0
|
|
116
|
+
}, this.getMetadata());
|
|
117
|
+
}
|
|
118
|
+
}, {
|
|
119
|
+
key: "isNonGeographic",
|
|
120
|
+
value: function() {
|
|
121
|
+
var e = new l(this.getMetadata());
|
|
122
|
+
return e.isNonGeographicCallingCode(this.countryCallingCode);
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
key: "isEqual",
|
|
126
|
+
value: function(e) {
|
|
127
|
+
return this.number === e.number && this.ext === e.ext;
|
|
128
|
+
}
|
|
129
|
+
// This function was originally meant to be an equivalent for `validatePhoneNumberLength()`,
|
|
130
|
+
// but later it was found out that it doesn't include the possible `TOO_SHORT` result
|
|
131
|
+
// returned from `parsePhoneNumberWithError()` in the original `validatePhoneNumberLength()`,
|
|
132
|
+
// so eventually I simply commented out this method from the `PhoneNumber` class
|
|
133
|
+
// and just left the `validatePhoneNumberLength()` function, even though that one would require
|
|
134
|
+
// and additional step to also validate the actual country / calling code of the phone number.
|
|
135
|
+
// validateLength() {
|
|
136
|
+
// const metadata = new Metadata(this.getMetadata())
|
|
137
|
+
// metadata.selectNumberingPlan(this.countryCallingCode)
|
|
138
|
+
// const result = checkNumberLength(this.nationalNumber, metadata)
|
|
139
|
+
// if (result !== 'IS_POSSIBLE') {
|
|
140
|
+
// return result
|
|
141
|
+
// }
|
|
142
|
+
// }
|
|
143
|
+
}, {
|
|
144
|
+
key: "getType",
|
|
145
|
+
value: function() {
|
|
146
|
+
return w(this, {
|
|
147
|
+
v2: !0
|
|
148
|
+
}, this.getMetadata());
|
|
149
|
+
}
|
|
150
|
+
}, {
|
|
151
|
+
key: "format",
|
|
152
|
+
value: function(e, n) {
|
|
153
|
+
return E(this, e, n ? c(c({}, n), {}, {
|
|
154
|
+
v2: !0
|
|
155
|
+
}) : {
|
|
156
|
+
v2: !0
|
|
157
|
+
}, this.getMetadata());
|
|
158
|
+
}
|
|
159
|
+
}, {
|
|
160
|
+
key: "formatNational",
|
|
161
|
+
value: function(e) {
|
|
162
|
+
return this.format("NATIONAL", e);
|
|
163
|
+
}
|
|
164
|
+
}, {
|
|
165
|
+
key: "formatInternational",
|
|
166
|
+
value: function(e) {
|
|
167
|
+
return this.format("INTERNATIONAL", e);
|
|
168
|
+
}
|
|
169
|
+
}, {
|
|
170
|
+
key: "getURI",
|
|
171
|
+
value: function(e) {
|
|
172
|
+
return this.format("RFC3966", e);
|
|
173
|
+
}
|
|
174
|
+
}]);
|
|
175
|
+
})(), M = function(t) {
|
|
176
|
+
return /^[A-Z]{2}$/.test(t);
|
|
177
|
+
};
|
|
178
|
+
function S(r, t) {
|
|
179
|
+
var e, n, i = new l(t);
|
|
180
|
+
return M(r) ? (e = r, i.selectNumberingPlan(e), n = i.countryCallingCode()) : n = r, {
|
|
181
|
+
country: e,
|
|
182
|
+
countryCallingCode: n
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
var _ = /^\+\d+$/;
|
|
186
|
+
export {
|
|
187
|
+
U as default
|
|
188
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var u=2,_=17,N=3,S="0-90-9٠-٩۰-۹",a="-‐-―−ー-",T="//",A="..",F=" ",E="()()[]\\[\\]",r="~⁓∼~",I="".concat(a).concat(T).concat(A).concat(F).concat(E).concat(r),c="++";exports.MAX_LENGTH_COUNTRY_CODE=N;exports.MAX_LENGTH_FOR_NSN=_;exports.MIN_LENGTH_FOR_NSN=u;exports.PLUS_CHARS=c;exports.VALID_DIGITS=S;exports.VALID_PUNCTUATION=I;exports.WHITESPACE=F;
|