@mirai/ui 2.0.38 → 2.0.39
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.
|
@@ -16,7 +16,7 @@ var getInputPhoneErrors = function getInputPhoneErrors() {
|
|
|
16
16
|
var _value$replace = value.replace(/\D/g, ''),
|
|
17
17
|
length = _value$replace.length;
|
|
18
18
|
var withPrefix = prefixes.length > 0;
|
|
19
|
-
if (length < (withPrefix ?
|
|
19
|
+
if (length < (withPrefix ? 8 : 6)) errors.minLength = true;
|
|
20
20
|
if (withPrefix && !(0, _helpers.sanitizePrefixes)(prefixes).some(function (item) {
|
|
21
21
|
return value.includes(item);
|
|
22
22
|
})) errors.format = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInputPhoneErrors.js","names":["getInputPhoneErrors","prefixes","value","trim","length","errors","replace","withPrefix","minLength","sanitizePrefixes","some","item","includes","format","Object","keys","undefined"],"sources":["../../src/helpers/getInputPhoneErrors.js"],"sourcesContent":["import { sanitizePrefixes } from '../components/InputPhone/helpers';\n\nexport const getInputPhoneErrors = ({ prefixes = [], value = '' } = {}) => {\n if (value.trim().length === 0) return;\n\n const errors = {};\n const { length } = value.replace(/\\D/g, '');\n const withPrefix = prefixes.length > 0;\n\n if (length < (withPrefix ?
|
|
1
|
+
{"version":3,"file":"getInputPhoneErrors.js","names":["getInputPhoneErrors","prefixes","value","trim","length","errors","replace","withPrefix","minLength","sanitizePrefixes","some","item","includes","format","Object","keys","undefined"],"sources":["../../src/helpers/getInputPhoneErrors.js"],"sourcesContent":["import { sanitizePrefixes } from '../components/InputPhone/helpers';\n\nexport const getInputPhoneErrors = ({ prefixes = [], value = '' } = {}) => {\n if (value.trim().length === 0) return;\n\n const errors = {};\n const { length } = value.replace(/\\D/g, '');\n const withPrefix = prefixes.length > 0;\n\n if (length < (withPrefix ? 8 : 6)) errors.minLength = true;\n if (withPrefix && !sanitizePrefixes(prefixes).some((item) => value.includes(item))) errors.format = true;\n\n return Object.keys(errors).length > 0 ? errors : undefined;\n};\n"],"mappings":";;;;;;AAAA;AAEO,IAAMA,mBAAmB,GAAG,SAAtBA,mBAAmB,GAA2C;EAAA,+EAAP,CAAC,CAAC;IAAA,qBAAhCC,QAAQ;IAARA,QAAQ,8BAAG,EAAE;IAAA,kBAAEC,KAAK;IAALA,KAAK,2BAAG,EAAE;EAC7D,IAAIA,KAAK,CAACC,IAAI,EAAE,CAACC,MAAM,KAAK,CAAC,EAAE;EAE/B,IAAMC,MAAM,GAAG,CAAC,CAAC;EACjB,qBAAmBH,KAAK,CAACI,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IAAnCF,MAAM,kBAANA,MAAM;EACd,IAAMG,UAAU,GAAGN,QAAQ,CAACG,MAAM,GAAG,CAAC;EAEtC,IAAIA,MAAM,IAAIG,UAAU,GAAG,CAAC,GAAG,CAAC,CAAC,EAAEF,MAAM,CAACG,SAAS,GAAG,IAAI;EAC1D,IAAID,UAAU,IAAI,CAAC,IAAAE,yBAAgB,EAACR,QAAQ,CAAC,CAACS,IAAI,CAAC,UAACC,IAAI;IAAA,OAAKT,KAAK,CAACU,QAAQ,CAACD,IAAI,CAAC;EAAA,EAAC,EAAEN,MAAM,CAACQ,MAAM,GAAG,IAAI;EAExG,OAAOC,MAAM,CAACC,IAAI,CAACV,MAAM,CAAC,CAACD,MAAM,GAAG,CAAC,GAAGC,MAAM,GAAGW,SAAS;AAC5D,CAAC;AAAC"}
|
|
@@ -10,7 +10,7 @@ var isValidPhone = function isValidPhone() {
|
|
|
10
10
|
_ref$countryCode = _ref.countryCode,
|
|
11
11
|
countryCode = _ref$countryCode === void 0 ? false : _ref$countryCode;
|
|
12
12
|
if (phone === '') return true;
|
|
13
|
-
var minLength = countryCode ?
|
|
13
|
+
var minLength = countryCode ? 8 : 6;
|
|
14
14
|
var _phone$replace = phone.replace(/\D/g, ''),
|
|
15
15
|
length = _phone$replace.length;
|
|
16
16
|
return length >= minLength && length <= 15;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isValidPhone.js","names":["isValidPhone","phone","countryCode","minLength","replace","length"],"sources":["../../src/helpers/isValidPhone.js"],"sourcesContent":["export const isValidPhone = (phone = '', { countryCode = false } = {}) => {\n if (phone === '') return true;\n const minLength = countryCode ?
|
|
1
|
+
{"version":3,"file":"isValidPhone.js","names":["isValidPhone","phone","countryCode","minLength","replace","length"],"sources":["../../src/helpers/isValidPhone.js"],"sourcesContent":["export const isValidPhone = (phone = '', { countryCode = false } = {}) => {\n if (phone === '') return true;\n const minLength = countryCode ? 8 : 6;\n\n const { length } = phone.replace(/\\D/g, '');\n return length >= minLength && length <= 15;\n};\n"],"mappings":";;;;;;AAAO,IAAMA,YAAY,GAAG,SAAfA,YAAY,GAAiD;EAAA,IAA7CC,KAAK,uEAAG,EAAE;EAAA,+EAA4B,CAAC,CAAC;IAAA,wBAA1BC,WAAW;IAAXA,WAAW,iCAAG,KAAK;EAC5D,IAAID,KAAK,KAAK,EAAE,EAAE,OAAO,IAAI;EAC7B,IAAME,SAAS,GAAGD,WAAW,GAAG,CAAC,GAAG,CAAC;EAErC,qBAAmBD,KAAK,CAACG,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IAAnCC,MAAM,kBAANA,MAAM;EACd,OAAOA,MAAM,IAAIF,SAAS,IAAIE,MAAM,IAAI,EAAE;AAC5C,CAAC;AAAC"}
|