@mirai/ui 2.0.38 → 2.0.40
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/build/helpers/getInputPhoneErrors.js +1 -1
- package/build/helpers/getInputPhoneErrors.js.map +1 -1
- package/build/helpers/isValidPhone.js +1 -1
- package/build/helpers/isValidPhone.js.map +1 -1
- package/build/primitives/Layer/helpers/getLayerPosition.js +1 -1
- package/build/primitives/Layer/helpers/getLayerPosition.js.map +1 -1
- package/package.json +1 -1
|
@@ -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"}
|
|
@@ -59,7 +59,7 @@ var getLayerPosition = function getLayerPosition() {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
var left = componentLeft;
|
|
62
|
-
var gapLeft =
|
|
62
|
+
var gapLeft = screenLeft + componentWidth;
|
|
63
63
|
var gapRight = width - offsetLeft;
|
|
64
64
|
if (contentWidth > gapRight && gapLeft > gapRight && !forceLeft || forceRight) {
|
|
65
65
|
left = componentLeft - contentWidth + componentWidth;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getLayerPosition.js","names":["getLayerPosition","componentLayout","contentLayout","device","modal","centered","forceBottom","forceLeft","forceRight","forceTop","left","componentLeft","scrollTop","top","componentTop","width","componentWidth","height","componentHeight","screenLeft","screenTop","contentWidth","contentHeight","aline","offsetLeft","offsetTop","orientation","gapBottom","gapLeft","gapRight","undefined","right","gapCenter","space","center"],"sources":["../../../../src/primitives/Layer/helpers/getLayerPosition.js"],"sourcesContent":["export const getLayerPosition = (\n componentLayout = {},\n contentLayout = {},\n device = {},\n modal,\n { centered, forceBottom, forceLeft, forceRight, forceTop } = {},\n) => {\n const {\n left: componentLeft = 0,\n scrollTop = 0,\n top: componentTop = 0,\n width: componentWidth = 0,\n height: componentHeight = 0,\n screenLeft = componentLeft || 0,\n screenTop = componentTop || 0,\n } = componentLayout;\n const { width: contentWidth = 0, height: contentHeight = 0 } = contentLayout;\n const { height = 0, width = 0 } = modal || device;\n const aline = centered && (forceLeft || forceRight);\n const offsetLeft = modal ? componentLeft : screenLeft;\n const offsetTop = modal ? componentTop : screenTop;\n let orientation = { left: true };\n\n let top = componentTop + componentHeight - scrollTop;\n const gapBottom = height - (offsetTop + componentHeight);\n if ((contentHeight > gapBottom && offsetTop > gapBottom && !forceBottom) || forceTop) {\n top = componentTop - contentHeight - scrollTop;\n orientation = { ...orientation, top: true };\n }\n\n let left = componentLeft;\n const gapLeft =
|
|
1
|
+
{"version":3,"file":"getLayerPosition.js","names":["getLayerPosition","componentLayout","contentLayout","device","modal","centered","forceBottom","forceLeft","forceRight","forceTop","left","componentLeft","scrollTop","top","componentTop","width","componentWidth","height","componentHeight","screenLeft","screenTop","contentWidth","contentHeight","aline","offsetLeft","offsetTop","orientation","gapBottom","gapLeft","gapRight","undefined","right","gapCenter","space","center"],"sources":["../../../../src/primitives/Layer/helpers/getLayerPosition.js"],"sourcesContent":["export const getLayerPosition = (\n componentLayout = {},\n contentLayout = {},\n device = {},\n modal,\n { centered, forceBottom, forceLeft, forceRight, forceTop } = {},\n) => {\n const {\n left: componentLeft = 0,\n scrollTop = 0,\n top: componentTop = 0,\n width: componentWidth = 0,\n height: componentHeight = 0,\n screenLeft = componentLeft || 0,\n screenTop = componentTop || 0,\n } = componentLayout;\n const { width: contentWidth = 0, height: contentHeight = 0 } = contentLayout;\n const { height = 0, width = 0 } = modal || device;\n const aline = centered && (forceLeft || forceRight);\n const offsetLeft = modal ? componentLeft : screenLeft;\n const offsetTop = modal ? componentTop : screenTop;\n let orientation = { left: true };\n\n let top = componentTop + componentHeight - scrollTop;\n const gapBottom = height - (offsetTop + componentHeight);\n if ((contentHeight > gapBottom && offsetTop > gapBottom && !forceBottom) || forceTop) {\n top = componentTop - contentHeight - scrollTop;\n orientation = { ...orientation, top: true };\n }\n\n let left = componentLeft;\n const gapLeft = screenLeft + componentWidth;\n const gapRight = width - offsetLeft;\n if ((contentWidth > gapRight && gapLeft > gapRight && !forceLeft) || forceRight) {\n left = componentLeft - contentWidth + componentWidth;\n orientation = { ...orientation, left: undefined, right: true };\n }\n\n if (aline) {\n orientation = { ...orientation, left: forceLeft, right: forceRight, top: undefined };\n if (forceLeft && contentWidth > gapLeft && gapRight > gapLeft)\n orientation = { ...orientation, left: undefined, right: true };\n else if (forceRight && contentWidth > gapRight && gapLeft > gapRight)\n orientation = { ...orientation, left: true, right: undefined };\n\n left = orientation.left ? componentLeft - contentWidth : componentLeft + componentWidth;\n top = componentTop - (contentHeight - componentHeight) / 2 - scrollTop;\n } else if (centered) {\n const gapCenter = (componentWidth + contentWidth) / 2;\n const space = (contentWidth - componentWidth) / 2;\n orientation = { ...orientation, left: true, right: undefined };\n\n if (gapLeft > gapRight) {\n left = componentLeft - contentWidth + componentWidth;\n orientation = { ...orientation, left: undefined, right: true };\n }\n if (gapLeft > gapCenter && gapRight > gapCenter) {\n left += space * (gapLeft > gapRight ? 1 : -1);\n orientation = { ...orientation, left: undefined, right: undefined, center: true };\n }\n }\n\n return { left, top, orientation };\n};\n"],"mappings":";;;;;;;;;;;;AAAO,IAAMA,gBAAgB,GAAG,SAAnBA,gBAAgB,GAMxB;EAAA,IALHC,eAAe,uEAAG,CAAC,CAAC;EAAA,IACpBC,aAAa,uEAAG,CAAC,CAAC;EAAA,IAClBC,MAAM,uEAAG,CAAC,CAAC;EAAA,IACXC,KAAK;EAAA,+EACwD,CAAC,CAAC;IAA7DC,QAAQ,QAARA,QAAQ;IAAEC,WAAW,QAAXA,WAAW;IAAEC,SAAS,QAATA,SAAS;IAAEC,UAAU,QAAVA,UAAU;IAAEC,QAAQ,QAARA,QAAQ;EAExD,4BAQIR,eAAe,CAPjBS,IAAI;IAAEC,aAAa,sCAAG,CAAC;IAAA,wBAOrBV,eAAe,CANjBW,SAAS;IAATA,SAAS,sCAAG,CAAC;IAAA,uBAMXX,eAAe,CALjBY,GAAG;IAAEC,YAAY,qCAAG,CAAC;IAAA,wBAKnBb,eAAe,CAJjBc,KAAK;IAAEC,cAAc,sCAAG,CAAC;IAAA,wBAIvBf,eAAe,CAHjBgB,MAAM;IAAEC,eAAe,sCAAG,CAAC;IAAA,wBAGzBjB,eAAe,CAFjBkB,UAAU;IAAVA,UAAU,sCAAGR,aAAa,IAAI,CAAC;IAAA,yBAE7BV,eAAe,CADjBmB,SAAS;IAATA,SAAS,uCAAGN,YAAY,IAAI,CAAC;EAE/B,2BAA+DZ,aAAa,CAApEa,KAAK;IAAEM,YAAY,qCAAG,CAAC;IAAA,wBAAgCnB,aAAa,CAA3Ce,MAAM;IAAEK,aAAa,sCAAG,CAAC;EAC1D,YAAkClB,KAAK,IAAID,MAAM;IAAA,qBAAzCc,MAAM;IAANA,MAAM,6BAAG,CAAC;IAAA,oBAAEF,KAAK;IAALA,KAAK,4BAAG,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