@mirai/ui 2.0.37 → 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.
- package/build/components/Form/__tests__/__snapshots__/Form.test.jsx.snap +2 -2
- package/build/components/InputText/InputText.js +1 -1
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +6 -6
- 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/package.json +1 -1
|
@@ -22,13 +22,13 @@ exports[`component:<Form> prop:children 1`] = `
|
|
|
22
22
|
>
|
|
23
23
|
<ui-label
|
|
24
24
|
class="text paragraph text label"
|
|
25
|
-
htmlfor="
|
|
25
|
+
htmlfor="name"
|
|
26
26
|
>
|
|
27
27
|
label
|
|
28
28
|
</ui-label>
|
|
29
29
|
<input
|
|
30
30
|
class="input input withLabel"
|
|
31
|
-
id="
|
|
31
|
+
id="name"
|
|
32
32
|
name="name"
|
|
33
33
|
type="text"
|
|
34
34
|
value=""
|
|
@@ -90,7 +90,7 @@ var InputText = function InputText(_ref) {
|
|
|
90
90
|
value: others.value !== undefined && (((_others$value = others.value) === null || _others$value === void 0 ? void 0 : _others$value.length) > 0 || typeof others.value === 'number'),
|
|
91
91
|
stateIcon: showState && (error || success || warning)
|
|
92
92
|
};
|
|
93
|
-
var id = label ?
|
|
93
|
+
var id = label ? others.id || others.name : others.id;
|
|
94
94
|
return /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
95
95
|
role: others.role,
|
|
96
96
|
tag: "input-text",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputText.js","names":["InputText","caption","children","disabled","error","hint","icon","label","markdown","multiLine","showRequired","showState","success","type","warning","onChange","onEnter","onLeave","others","useState","focus","setFocus","password","setPassword","inputMode","setInputMode","handleChange","value","event","handleEnter","handleLeave","handlePress","is","search","undefined","has","length","stateIcon","id","name","role","styles","style","inputContainer","className","inputBorder","ICON","SEARCH","left","content","for","required","input","withLabel","MARKDOWN","EYE_CLOSE","EYE_OPEN","CLOSE","displayName","propTypes","PropTypes","string","node","bool","func","isRequired"],"sources":["../../../src/components/InputText/InputText.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { ICON, Icon, Input, Pressable, Text, View } from '../../primitives';\nimport style from './InputText.module.css';\nimport { Hint, IconState, Label } from './partials';\n\nconst InputText = ({\n caption,\n children,\n disabled,\n error,\n hint,\n icon,\n label,\n markdown,\n multiLine,\n showRequired = false,\n showState = true,\n success,\n type,\n warning,\n onChange = () => {},\n onEnter = () => {},\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n const [password, setPassword] = useState(true);\n const [inputMode, setInputMode] = useState(true);\n\n const handleChange = (value, event) => {\n onChange(value, event);\n };\n\n const handleEnter = (event) => {\n setFocus(true);\n onEnter(event);\n };\n\n const handleLeave = (event) => {\n setFocus(false);\n onLeave(event);\n };\n\n const handlePress = (event) => {\n if (is.password) setPassword(!password);\n else if (is.search) onChange(undefined, event);\n };\n\n const is = {\n password: type === 'password',\n search: type === 'search',\n };\n\n const has = {\n icon: !!icon || is.search,\n label: !!label,\n value: others.value !== undefined && (others.value?.length > 0 || typeof others.value === 'number'),\n stateIcon: showState && (error || success || warning),\n };\n\n const id = label ? `input.${others.id || others.name}` : others.id;\n\n return (\n <View\n role={others.role}\n tag=\"input-text\"\n className={styles(style.inputContainer, others.className)}\n style={others.style}\n >\n <View\n row\n className={styles(style.inputBorder, disabled && style.disabled, error && style.error, focus && style.focus)}\n >\n {has.icon && (\n <Icon\n value={icon || ICON.SEARCH}\n className={styles(style.icon, style.left, disabled && style.disabled, error && style.error)}\n />\n )}\n\n {caption && (\n <Text action light className={style.caption}>\n {caption}\n </Text>\n )}\n\n <View wide className={style.content}>\n {label && (\n <Label\n {...{\n disabled,\n error,\n focus,\n for: id,\n label,\n required: showRequired && others.required,\n value: others.value,\n }}\n />\n )}\n\n {inputMode && (\n <Input\n {...{ ...others, disabled, id, multiLine }}\n type={!is.password || password ? type : 'text'}\n value={others.value !== undefined ? others.value : ''}\n className={styles(style.input, has.label && style.withLabel, multiLine && style.multiLine)}\n onChange={handleChange}\n onEnter={handleEnter}\n onLeave={handleLeave}\n aria-label={label}\n />\n )}\n {markdown && !inputMode && (\n <Text\n markdown\n onClick={() => setInputMode(true)}\n className={styles(style.input, has.label && style.withLabel, multiLine && style.multiLine)}\n >\n {others.value}\n </Text>\n )}\n </View>\n\n {markdown && (\n <Pressable onPress={() => setInputMode(!inputMode)}>\n <Icon value={ICON.MARKDOWN} className={styles(style.icon, inputMode && style.disabled)} />\n </Pressable>\n )}\n\n {(is.password || (is.search && has.value)) && !disabled && (\n <Pressable tabIndex={-1} onPress={handlePress}>\n <Icon\n value={is.password ? (password ? ICON.EYE_CLOSE : ICON.EYE_OPEN) : ICON.CLOSE}\n className={styles(style.icon, style.password)}\n />\n </Pressable>\n )}\n\n {children}\n\n {has.stateIcon && <IconState {...{ error, success, warning }} />}\n </View>\n\n {hint && <Hint {...{ disabled, error, hint }} />}\n </View>\n );\n};\n\nInputText.displayName = 'Component:InputText';\n\nInputText.propTypes = {\n caption: PropTypes.string,\n children: PropTypes.node,\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n hint: PropTypes.string,\n icon: PropTypes.func,\n label: PropTypes.string,\n markdown: PropTypes.bool,\n multiLine: PropTypes.bool,\n name: PropTypes.string.isRequired,\n showRequired: PropTypes.bool,\n showState: PropTypes.bool,\n success: PropTypes.bool,\n type: PropTypes.string,\n warning: PropTypes.bool,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { InputText };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAoD;AAAA;AAAA;AAA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/C,OAAO,EAAE2C,kBAAS,CAACI;AACrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"InputText.js","names":["InputText","caption","children","disabled","error","hint","icon","label","markdown","multiLine","showRequired","showState","success","type","warning","onChange","onEnter","onLeave","others","useState","focus","setFocus","password","setPassword","inputMode","setInputMode","handleChange","value","event","handleEnter","handleLeave","handlePress","is","search","undefined","has","length","stateIcon","id","name","role","styles","style","inputContainer","className","inputBorder","ICON","SEARCH","left","content","for","required","input","withLabel","MARKDOWN","EYE_CLOSE","EYE_OPEN","CLOSE","displayName","propTypes","PropTypes","string","node","bool","func","isRequired"],"sources":["../../../src/components/InputText/InputText.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { ICON, Icon, Input, Pressable, Text, View } from '../../primitives';\nimport style from './InputText.module.css';\nimport { Hint, IconState, Label } from './partials';\n\nconst InputText = ({\n caption,\n children,\n disabled,\n error,\n hint,\n icon,\n label,\n markdown,\n multiLine,\n showRequired = false,\n showState = true,\n success,\n type,\n warning,\n onChange = () => {},\n onEnter = () => {},\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n const [password, setPassword] = useState(true);\n const [inputMode, setInputMode] = useState(true);\n\n const handleChange = (value, event) => {\n onChange(value, event);\n };\n\n const handleEnter = (event) => {\n setFocus(true);\n onEnter(event);\n };\n\n const handleLeave = (event) => {\n setFocus(false);\n onLeave(event);\n };\n\n const handlePress = (event) => {\n if (is.password) setPassword(!password);\n else if (is.search) onChange(undefined, event);\n };\n\n const is = {\n password: type === 'password',\n search: type === 'search',\n };\n\n const has = {\n icon: !!icon || is.search,\n label: !!label,\n value: others.value !== undefined && (others.value?.length > 0 || typeof others.value === 'number'),\n stateIcon: showState && (error || success || warning),\n };\n\n const id = label ? others.id || others.name : others.id;\n\n return (\n <View\n role={others.role}\n tag=\"input-text\"\n className={styles(style.inputContainer, others.className)}\n style={others.style}\n >\n <View\n row\n className={styles(style.inputBorder, disabled && style.disabled, error && style.error, focus && style.focus)}\n >\n {has.icon && (\n <Icon\n value={icon || ICON.SEARCH}\n className={styles(style.icon, style.left, disabled && style.disabled, error && style.error)}\n />\n )}\n\n {caption && (\n <Text action light className={style.caption}>\n {caption}\n </Text>\n )}\n\n <View wide className={style.content}>\n {label && (\n <Label\n {...{\n disabled,\n error,\n focus,\n for: id,\n label,\n required: showRequired && others.required,\n value: others.value,\n }}\n />\n )}\n\n {inputMode && (\n <Input\n {...{ ...others, disabled, id, multiLine }}\n type={!is.password || password ? type : 'text'}\n value={others.value !== undefined ? others.value : ''}\n className={styles(style.input, has.label && style.withLabel, multiLine && style.multiLine)}\n onChange={handleChange}\n onEnter={handleEnter}\n onLeave={handleLeave}\n aria-label={label}\n />\n )}\n {markdown && !inputMode && (\n <Text\n markdown\n onClick={() => setInputMode(true)}\n className={styles(style.input, has.label && style.withLabel, multiLine && style.multiLine)}\n >\n {others.value}\n </Text>\n )}\n </View>\n\n {markdown && (\n <Pressable onPress={() => setInputMode(!inputMode)}>\n <Icon value={ICON.MARKDOWN} className={styles(style.icon, inputMode && style.disabled)} />\n </Pressable>\n )}\n\n {(is.password || (is.search && has.value)) && !disabled && (\n <Pressable tabIndex={-1} onPress={handlePress}>\n <Icon\n value={is.password ? (password ? ICON.EYE_CLOSE : ICON.EYE_OPEN) : ICON.CLOSE}\n className={styles(style.icon, style.password)}\n />\n </Pressable>\n )}\n\n {children}\n\n {has.stateIcon && <IconState {...{ error, success, warning }} />}\n </View>\n\n {hint && <Hint {...{ disabled, error, hint }} />}\n </View>\n );\n};\n\nInputText.displayName = 'Component:InputText';\n\nInputText.propTypes = {\n caption: PropTypes.string,\n children: PropTypes.node,\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n hint: PropTypes.string,\n icon: PropTypes.func,\n label: PropTypes.string,\n markdown: PropTypes.bool,\n multiLine: PropTypes.bool,\n name: PropTypes.string.isRequired,\n showRequired: PropTypes.bool,\n showState: PropTypes.bool,\n success: PropTypes.bool,\n type: PropTypes.string,\n warning: PropTypes.bool,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { InputText };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AACA;AACA;AACA;AAAoD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEpD,IAAMA,SAAS,GAAG,SAAZA,SAAS,OAmBT;EAAA;EAAA,IAlBJC,OAAO,QAAPA,OAAO;IACPC,QAAQ,QAARA,QAAQ;IACRC,QAAQ,QAARA,QAAQ;IACRC,KAAK,QAALA,KAAK;IACLC,IAAI,QAAJA,IAAI;IACJC,IAAI,QAAJA,IAAI;IACJC,KAAK,QAALA,KAAK;IACLC,QAAQ,QAARA,QAAQ;IACRC,SAAS,QAATA,SAAS;IAAA,yBACTC,YAAY;IAAZA,YAAY,kCAAG,KAAK;IAAA,sBACpBC,SAAS;IAATA,SAAS,+BAAG,IAAI;IAChBC,OAAO,QAAPA,OAAO;IACPC,IAAI,QAAJA,IAAI;IACJC,OAAO,QAAPA,OAAO;IAAA,qBACPC,QAAQ;IAARA,QAAQ,8BAAG,YAAM,CAAC,CAAC;IAAA,oBACnBC,OAAO;IAAPA,OAAO,6BAAG,YAAM,CAAC,CAAC;IAAA,oBAClBC,OAAO;IAAPA,OAAO,6BAAG,YAAM,CAAC,CAAC;IACfC,MAAM;EAET,gBAA0B,IAAAC,eAAQ,EAAC,KAAK,CAAC;IAAA;IAAlCC,KAAK;IAAEC,QAAQ;EACtB,iBAAgC,IAAAF,eAAQ,EAAC,IAAI,CAAC;IAAA;IAAvCG,QAAQ;IAAEC,WAAW;EAC5B,iBAAkC,IAAAJ,eAAQ,EAAC,IAAI,CAAC;IAAA;IAAzCK,SAAS;IAAEC,YAAY;EAE9B,IAAMC,YAAY,GAAG,SAAfA,YAAY,CAAIC,KAAK,EAAEC,K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BAAS,CAACG,IAAI;EACvBlD,IAAI,EAAE+C,kBAAS,CAACC,MAAM;EACtB/C,OAAO,EAAE8C,kBAAS,CAACG,IAAI;EACvBhD,QAAQ,EAAE6C,kBAAS,CAACI,IAAI;EACxBhD,OAAO,EAAE4C,kBAAS,CAACI,IAAI;EACvB/C,OAAO,EAAE2C,kBAAS,CAACI;AACrB,CAAC"}
|
|
@@ -204,13 +204,13 @@ exports[`component:<InputText> prop:label 1`] = `
|
|
|
204
204
|
>
|
|
205
205
|
<ui-label
|
|
206
206
|
class="text paragraph text label"
|
|
207
|
-
htmlfor="
|
|
207
|
+
htmlfor="name"
|
|
208
208
|
>
|
|
209
209
|
label
|
|
210
210
|
</ui-label>
|
|
211
211
|
<input
|
|
212
212
|
class="input input withLabel"
|
|
213
|
-
id="
|
|
213
|
+
id="name"
|
|
214
214
|
name="name"
|
|
215
215
|
type="text"
|
|
216
216
|
value=""
|
|
@@ -300,7 +300,7 @@ exports[`component:<InputText> prop:required & prop:showRequired (true) 1`] = `
|
|
|
300
300
|
>
|
|
301
301
|
<ui-label
|
|
302
302
|
class="text paragraph text label"
|
|
303
|
-
htmlfor="
|
|
303
|
+
htmlfor="name"
|
|
304
304
|
>
|
|
305
305
|
label
|
|
306
306
|
<span
|
|
@@ -311,7 +311,7 @@ exports[`component:<InputText> prop:required & prop:showRequired (true) 1`] = `
|
|
|
311
311
|
</ui-label>
|
|
312
312
|
<input
|
|
313
313
|
class="input input withLabel"
|
|
314
|
-
id="
|
|
314
|
+
id="name"
|
|
315
315
|
name="name"
|
|
316
316
|
required=""
|
|
317
317
|
type="text"
|
|
@@ -336,13 +336,13 @@ exports[`component:<InputText> prop:required 1`] = `
|
|
|
336
336
|
>
|
|
337
337
|
<ui-label
|
|
338
338
|
class="text paragraph text label"
|
|
339
|
-
htmlfor="
|
|
339
|
+
htmlfor="name"
|
|
340
340
|
>
|
|
341
341
|
label
|
|
342
342
|
</ui-label>
|
|
343
343
|
<input
|
|
344
344
|
class="input input withLabel"
|
|
345
|
-
id="
|
|
345
|
+
id="name"
|
|
346
346
|
name="name"
|
|
347
347
|
required=""
|
|
348
348
|
type="text"
|
|
@@ -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"}
|