@mirai/ui 1.0.154 → 1.0.156
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/Form.stories.js +7 -3
- package/build/components/Form/Form.stories.js.map +1 -1
- package/build/components/InputPhone/InputPhone.js +1 -0
- package/build/components/InputPhone/InputPhone.js.map +1 -1
- package/build/components/InputPhone/InputPhone.stories.js +8 -2
- package/build/components/InputPhone/InputPhone.stories.js.map +1 -1
- package/build/components/InputPhone/__tests__/__snapshots__/InputPhone.test.js.snap +21 -0
- package/build/helpers/getInputErrors.js +1 -1
- package/build/helpers/getInputErrors.js.map +1 -1
- package/build/helpers/getInputPhoneErrors.js +9 -9
- package/build/helpers/getInputPhoneErrors.js.map +1 -1
- package/package.json +1 -1
|
@@ -110,6 +110,7 @@ var Story = function Story(props) {
|
|
|
110
110
|
label: "Email",
|
|
111
111
|
hint: "Should contains @mirai.com",
|
|
112
112
|
required: true,
|
|
113
|
+
showRequired: true,
|
|
113
114
|
type: "email",
|
|
114
115
|
value: form.email
|
|
115
116
|
}), /*#__PURE__*/_react.default.createElement(_.InputText, {
|
|
@@ -118,6 +119,7 @@ var Story = function Story(props) {
|
|
|
118
119
|
hint: "At least 10 chars.",
|
|
119
120
|
label: "Password",
|
|
120
121
|
required: true,
|
|
122
|
+
showRequired: true,
|
|
121
123
|
minLength: 10,
|
|
122
124
|
type: "password",
|
|
123
125
|
value: form.password
|
|
@@ -135,6 +137,7 @@ var Story = function Story(props) {
|
|
|
135
137
|
max: "31/12/2022",
|
|
136
138
|
min: "10/04/1980",
|
|
137
139
|
required: true,
|
|
140
|
+
showRequired: true,
|
|
138
141
|
type: "inputDate",
|
|
139
142
|
value: form.dateOfBirth
|
|
140
143
|
}), /*#__PURE__*/_react.default.createElement(_.InputPhone, {
|
|
@@ -144,6 +147,7 @@ var Story = function Story(props) {
|
|
|
144
147
|
labelPrefix: "Prefix",
|
|
145
148
|
prefixes: ['+34', '+44', '+001', '+999', '+39', '+56'],
|
|
146
149
|
required: true,
|
|
150
|
+
showRequired: true,
|
|
147
151
|
type: "inputPhone",
|
|
148
152
|
value: form.phone
|
|
149
153
|
}), /*#__PURE__*/_react.default.createElement(_.InputText, {
|
|
@@ -155,14 +159,14 @@ var Story = function Story(props) {
|
|
|
155
159
|
name: "children",
|
|
156
160
|
label: "Children",
|
|
157
161
|
hint: "Ages 0 - 17",
|
|
158
|
-
value: form.children
|
|
159
|
-
required: true
|
|
162
|
+
value: form.children
|
|
160
163
|
}), /*#__PURE__*/_react.default.createElement(_.InputOption, {
|
|
161
164
|
type: "checkbox",
|
|
162
165
|
name: "checkbox",
|
|
163
166
|
label: "checkbox",
|
|
164
167
|
checked: form.checkbox,
|
|
165
|
-
required: true
|
|
168
|
+
required: true,
|
|
169
|
+
showRequired: true
|
|
166
170
|
}), /*#__PURE__*/_react.default.createElement(_.InputOption, {
|
|
167
171
|
type: "switch",
|
|
168
172
|
name: "switch",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.stories.js","names":["title","Story","props","useState","condition","setCondition","email","checkbox","dateOfBirth","switch","radio","form","setForm","error","setError","useEffect","handleChange","next","others","console","log","handleEnter","handleError","handleLeave","handleSubmit","value","includes","password","emptyOption","gender","phone","bio","children","Array","from","keys","map","index","Object","length","justifyContent","marginTop","marginRight","storyName","args","debounce","schema","showErrors","validateOnMount","argTypes"],"sources":["../../../src/components/Form/Form.stories.jsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport { Button, InputDate, InputNumber, InputOption, InputPhone, InputText, InputSelect, Text, View } from '../../';\nimport { Form } from './Form';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => {\n const [condition, setCondition] = useState(false);\n const [form, setForm] = useState({\n email: 'javi@mirai.com',\n checkbox: true,\n dateOfBirth: '04/10/1980',\n switch: true,\n radio: 'radio-2',\n });\n const [error, setError] = useState({});\n\n useEffect(\n () =>\n setForm({\n email: 'javi@mirai.com',\n checkbox: true,\n dateOfBirth: '04/10/1980',\n switch: true,\n radio: 'radio-2',\n }),\n [],\n ); // * Simulate a state hydration\n\n const handleChange = (next, ...others) => {\n setForm(next);\n console.log('<Form>::onChange', next, ...others);\n };\n\n const handleEnter = (...others) => console.log('<Form>::onEnter', ...others);\n\n const handleError = (next, ...others) => {\n setError(next);\n console.log('<Form>::onError', next, ...others);\n };\n\n const handleLeave = (...others) => console.log('<Form>::onLeave', ...others);\n\n const handleSubmit = (...others) => console.log('<Form>::onSubmit', ...others);\n\n return (\n <>\n <Form\n {...props}\n onLeave={handleLeave}\n onChange={handleChange}\n onError={handleError}\n onEnter={handleEnter}\n onSubmit={handleSubmit}\n >\n <View row>\n <Text headline>Form component</Text>\n </View>\n\n <InputText\n name=\"email\"\n error={!!error.email}\n test={(value) => value.includes('@mirai.com')}\n label=\"Email\"\n hint=\"Should contains @mirai.com\"\n required\n type=\"email\"\n value={form.email}\n />\n <InputText\n name=\"password\"\n error={!!error.password}\n hint=\"At least 10 chars.\"\n label=\"Password\"\n required\n minLength={10}\n type=\"password\"\n value={form.password}\n />\n <InputSelect\n name=\"gender\"\n emptyOption=\"Select...\"\n error={!!error.emptyOption}\n label=\"Your gender\"\n options={['one', 'two', 'three', 'four', 'five']}\n value={form.gender}\n />\n <InputDate\n name=\"dateOfBirth\"\n error={!!error.dateOfBirth}\n label=\"Your birthdate\"\n max=\"31/12/2022\"\n min=\"10/04/1980\"\n required\n type=\"inputDate\"\n value={form.dateOfBirth}\n />\n <InputPhone\n name=\"phone\"\n error={!!error.phone}\n label=\"Phone\"\n labelPrefix=\"Prefix\"\n prefixes={['+34', '+44', '+001', '+999', '+39', '+56']}\n required\n type=\"inputPhone\"\n value={form.phone}\n />\n <InputText name=\"bio\" label=\"Bio\" multiLine value={form.bio} />\n <InputNumber name=\"children\" label=\"Children\" hint=\"Ages 0 - 17\" value={form.children}
|
|
1
|
+
{"version":3,"file":"Form.stories.js","names":["title","Story","props","useState","condition","setCondition","email","checkbox","dateOfBirth","switch","radio","form","setForm","error","setError","useEffect","handleChange","next","others","console","log","handleEnter","handleError","handleLeave","handleSubmit","value","includes","password","emptyOption","gender","phone","bio","children","Array","from","keys","map","index","Object","length","justifyContent","marginTop","marginRight","storyName","args","debounce","schema","showErrors","validateOnMount","argTypes"],"sources":["../../../src/components/Form/Form.stories.jsx"],"sourcesContent":["import React, { useEffect, useState } from 'react';\n\nimport { Button, InputDate, InputNumber, InputOption, InputPhone, InputText, InputSelect, Text, View } from '../../';\nimport { Form } from './Form';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => {\n const [condition, setCondition] = useState(false);\n const [form, setForm] = useState({\n email: 'javi@mirai.com',\n checkbox: true,\n dateOfBirth: '04/10/1980',\n switch: true,\n radio: 'radio-2',\n });\n const [error, setError] = useState({});\n\n useEffect(\n () =>\n setForm({\n email: 'javi@mirai.com',\n checkbox: true,\n dateOfBirth: '04/10/1980',\n switch: true,\n radio: 'radio-2',\n }),\n [],\n ); // * Simulate a state hydration\n\n const handleChange = (next, ...others) => {\n setForm(next);\n console.log('<Form>::onChange', next, ...others);\n };\n\n const handleEnter = (...others) => console.log('<Form>::onEnter', ...others);\n\n const handleError = (next, ...others) => {\n setError(next);\n console.log('<Form>::onError', next, ...others);\n };\n\n const handleLeave = (...others) => console.log('<Form>::onLeave', ...others);\n\n const handleSubmit = (...others) => console.log('<Form>::onSubmit', ...others);\n\n return (\n <>\n <Form\n {...props}\n onLeave={handleLeave}\n onChange={handleChange}\n onError={handleError}\n onEnter={handleEnter}\n onSubmit={handleSubmit}\n >\n <View row>\n <Text headline>Form component</Text>\n </View>\n\n <InputText\n name=\"email\"\n error={!!error.email}\n test={(value) => value.includes('@mirai.com')}\n label=\"Email\"\n hint=\"Should contains @mirai.com\"\n required\n showRequired\n type=\"email\"\n value={form.email}\n />\n <InputText\n name=\"password\"\n error={!!error.password}\n hint=\"At least 10 chars.\"\n label=\"Password\"\n required\n showRequired\n minLength={10}\n type=\"password\"\n value={form.password}\n />\n <InputSelect\n name=\"gender\"\n emptyOption=\"Select...\"\n error={!!error.emptyOption}\n label=\"Your gender\"\n options={['one', 'two', 'three', 'four', 'five']}\n value={form.gender}\n />\n <InputDate\n name=\"dateOfBirth\"\n error={!!error.dateOfBirth}\n label=\"Your birthdate\"\n max=\"31/12/2022\"\n min=\"10/04/1980\"\n required\n showRequired\n type=\"inputDate\"\n value={form.dateOfBirth}\n />\n <InputPhone\n name=\"phone\"\n error={!!error.phone}\n label=\"Phone\"\n labelPrefix=\"Prefix\"\n prefixes={['+34', '+44', '+001', '+999', '+39', '+56']}\n required\n showRequired\n type=\"inputPhone\"\n value={form.phone}\n />\n <InputText name=\"bio\" label=\"Bio\" multiLine value={form.bio} />\n <InputNumber name=\"children\" label=\"Children\" hint=\"Ages 0 - 17\" value={form.children} />\n <InputOption type=\"checkbox\" name=\"checkbox\" label=\"checkbox\" checked={form.checkbox} required showRequired />\n <InputOption type=\"switch\" name=\"switch\" label=\"switch\" checked={form.switch} />\n {Array.from(Array(2).keys()).map((index) => (\n <InputOption\n key={index}\n type=\"radio\"\n name=\"radio\"\n value={`radio-${index}`}\n label={`radio-${index}`}\n checked={form.radio === `radio-${index}`}\n />\n ))}\n {condition && <InputText label=\"condition\" name=\"condition\" />}\n\n <Button disabled={Object.keys(error).length !== 0} type=\"submit\" wide>\n Submit\n </Button>\n </Form>\n\n <View row style={{ justifyContent: 'flex-end', marginTop: 'var(--mirai-ui-space-L)' }}>\n <Button small secondary onPress={() => setForm({})} style={{ marginRight: 'var(--mirai-ui-space-M)' }}>\n Reset\n </Button>\n <Button small secondary onPress={() => setCondition(!condition)}>\n {`${condition ? 'Hide' : 'Show'} dynamic field`}\n </Button>\n </View>\n </>\n );\n};\n\nStory.storyName = 'Form';\n\nStory.args = {\n debounce: 0,\n schema: {},\n showErrors: false,\n validateOnMount: false,\n // inherited properties\n ['data-testid']: 'test-story',\n style: {},\n};\n\nStory.argTypes = {};\n"],"mappings":";;;;;;;AAAA;AAEA;A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AS;IAAC,OAAO,EAAE;MAAA,OAAMrC,YAAY,CAAC,CAACD,SAAS,CAAC;IAAA;EAAC,aAC1DA,SAAS,GAAG,MAAM,GAAG,MAAM,oBACxB,CACJ,CACN;AAEP,CAAC;AAAC;AAEFH,KAAK,CAAC0C,SAAS,GAAG,MAAM;AAExB1C,KAAK,CAAC2C,IAAI;EACRC,QAAQ,EAAE,CAAC;EACXC,MAAM,EAAE,CAAC,CAAC;EACVC,UAAU,EAAE,KAAK;EACjBC,eAAe,EAAE;AAAK,gCAErB,aAAa,EAAG,YAAY,yCACtB,CAAC,CAAC,eACV;AAED/C,KAAK,CAACgD,QAAQ,GAAG,CAAC,CAAC"}
|
|
@@ -176,6 +176,7 @@ var InputPhone = function InputPhone(_ref) {
|
|
|
176
176
|
value: phone
|
|
177
177
|
}), /*#__PURE__*/_react.default.createElement(_primitives.Input, _extends({}, others, {
|
|
178
178
|
disabled: disabled,
|
|
179
|
+
maxLength: 12,
|
|
179
180
|
name: "".concat(name, "-phone"),
|
|
180
181
|
type: "tel",
|
|
181
182
|
value: phone || '',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputPhone.js","names":["InputPhone","disabled","error","hint","icon","label","labelPrefix","name","prefixes","showRequired","showState","success","propValue","value","warning","onChange","onEnter","onError","onLeave","others","useState","focus","setFocus","prefixFocus","setPrefixFocus","setValue","useEffect","handleChange","next","event","isPhone","hasPrefixes","split","undefined","prefix","phone","nextValue","replace","join","trim","getInputPhoneErrors","handleEnter","handleLeave","length","has","stateIcon","testId","styles","stylePhone","container","className","style","inputBorder","content","required","input","withLabel","empty","ICON","EXPAND_MORE","select","expand","separator","left","displayName","propTypes","PropTypes","bool","string","func","isRequired","arrayOf"],"sources":["../../../src/components/InputPhone/InputPhone.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { getInputPhoneErrors } from '../../helpers';\nimport { Icon, ICON, Input, Select, View } from '../../primitives';\nimport style from '../InputText/InputText.module.css';\nimport { Hint, IconState, Label } from '../InputText/partials';\nimport stylePhone from './InputPhone.module.css';\n\nconst InputPhone = ({\n disabled,\n error,\n hint,\n icon,\n label,\n labelPrefix,\n name,\n prefixes,\n showRequired = false,\n showState = true,\n success,\n value: propValue,\n warning,\n onChange = () => {},\n onEnter = () => {},\n onError,\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n const [prefixFocus, setPrefixFocus] = useState(false);\n const [value, setValue] = useState();\n\n useEffect(() => {\n setValue(propValue);\n }, [propValue]);\n\n const handleChange = (next, event, { isPhone = true } = {}) => {\n const [prefix = '', phone = ''] = hasPrefixes ? value?.split(' ') || [] : [undefined, value];\n let nextValue = (isPhone ? [prefix, next?.replace(/[^\\d]/g, '')] : [next, phone]).join(' ');\n if (!hasPrefixes) nextValue = nextValue.trim();\n\n setValue(nextValue);\n onError && onError(getInputPhoneErrors({ prefixes, value: nextValue }));\n onChange(nextValue, event);\n };\n\n const handleEnter = (event, { isPhone = true } = {}) => {\n isPhone ? setFocus(true) : setPrefixFocus(true);\n onEnter(event);\n };\n\n const handleLeave = (event, { isPhone = true } = {}) => {\n isPhone ? setFocus(false) : setPrefixFocus(false);\n onLeave(event);\n };\n const hasPrefixes = !!prefixes?.length;\n const [prefix, phone] = hasPrefixes ? value?.split(' ') || [] : [undefined, value];\n const has = {\n icon: !!icon,\n label: !!label,\n labelPrefix: !!labelPrefix,\n prefix: prefix?.length > 0,\n phone: phone?.length > 0,\n stateIcon: showState && (error || success || warning),\n };\n const { ['data-testid']: testId } = others;\n\n return (\n <View className={styles(stylePhone.container, others.className)} style={others.style}>\n <View\n row\n className={styles(\n style.inputBorder,\n disabled && style.disabled,\n error && style.error,\n (focus || prefixFocus) && !error && style.focus,\n )}\n >\n {hasPrefixes && (\n <>\n <View row>\n <View className={styles(style.content)}>\n {labelPrefix && (\n <Label\n {...{\n disabled,\n error,\n focus: prefixFocus,\n label: labelPrefix,\n required: showRequired && others.required,\n value: prefix,\n }}\n />\n )}\n <Select\n {...others}\n disabled={disabled}\n name={`${name}-prefix`}\n options={prefixes}\n style={undefined}\n type={undefined}\n value={prefix || ''}\n onChange={(value, event) => handleChange(value, event, { isPhone: false })}\n onEnter={(event) => handleEnter(event, { isPhone: false })}\n onLeave={(event) => handleLeave(event, { isPhone: false })}\n className={styles(\n style.input,\n stylePhone.prefix,\n has.labelPrefix && style.withLabel,\n has.labelPrefix && !(prefixFocus || error || has.prefix) && style.empty,\n )}\n data-testid={testId ? `${testId}-select` : undefined}\n />\n </View>\n {!disabled && <Icon value={ICON.EXPAND_MORE} className={(style.icon, style.select, stylePhone.expand)} />}\n </View>\n <View forceRow className={stylePhone.separator}></View>\n </>\n )}\n\n <View row wide>\n {has.icon && (\n <Icon\n value={icon}\n className={styles(style.icon, style.left, disabled && style.disabled, error && style.error)}\n />\n )}\n <View wide className={style.content}>\n {label && (\n <Label {...{ disabled, error, focus, label, required: showRequired && others.required, value: phone }} />\n )}\n <Input\n {...others}\n disabled={disabled}\n name={`${name}-phone`}\n type=\"tel\"\n value={phone || ''}\n onChange={(value, event) => handleChange(value, event)}\n onEnter={(event) => handleEnter(event)}\n onLeave={(event) => handleLeave(event)}\n className={styles(style.input, has.label && style.withLabel)}\n data-testid={testId ? `${testId}-input` : undefined}\n />\n </View>\n </View>\n {has.stateIcon && <IconState {...{ error, success, warning }} />}\n </View>\n {hint && <Hint {...{ disabled, error, hint }} />}\n </View>\n );\n};\n\nInputPhone.displayName = 'Component:InputPhone';\n\nInputPhone.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n hint: PropTypes.string,\n icon: PropTypes.func,\n label: PropTypes.string,\n labelPrefix: PropTypes.string,\n name: PropTypes.string.isRequired,\n prefixes: PropTypes.arrayOf(PropTypes.string),\n showRequired: PropTypes.bool,\n showState: PropTypes.bool,\n success: PropTypes.bool,\n value: PropTypes.string,\n warning: PropTypes.bool,\n onChange: PropTypes.func,\n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AM;EACvBtD,OAAO,EAAEoD,kBAAS,CAACC,IAAI;EACvBpD,QAAQ,EAAEmD,kBAAS,CAACG,IAAI;EACxBrD,OAAO,EAAEkD,kBAAS,CAACG,IAAI;EACvBpD,OAAO,EAAEiD,kBAAS,CAACG,IAAI;EACvBnD,OAAO,EAAEgD,kBAAS,CAACG;AACrB,CAAC"}
|
|
1
|
+
{"version":3,"file":"InputPhone.js","names":["InputPhone","disabled","error","hint","icon","label","labelPrefix","name","prefixes","showRequired","showState","success","propValue","value","warning","onChange","onEnter","onError","onLeave","others","useState","focus","setFocus","prefixFocus","setPrefixFocus","setValue","useEffect","handleChange","next","event","isPhone","hasPrefixes","split","undefined","prefix","phone","nextValue","replace","join","trim","getInputPhoneErrors","handleEnter","handleLeave","length","has","stateIcon","testId","styles","stylePhone","container","className","style","inputBorder","content","required","input","withLabel","empty","ICON","EXPAND_MORE","select","expand","separator","left","displayName","propTypes","PropTypes","bool","string","func","isRequired","arrayOf"],"sources":["../../../src/components/InputPhone/InputPhone.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React, { useEffect, useState } from 'react';\n\nimport { styles } from '../../helpers';\nimport { getInputPhoneErrors } from '../../helpers';\nimport { Icon, ICON, Input, Select, View } from '../../primitives';\nimport style from '../InputText/InputText.module.css';\nimport { Hint, IconState, Label } from '../InputText/partials';\nimport stylePhone from './InputPhone.module.css';\n\nconst InputPhone = ({\n disabled,\n error,\n hint,\n icon,\n label,\n labelPrefix,\n name,\n prefixes,\n showRequired = false,\n showState = true,\n success,\n value: propValue,\n warning,\n onChange = () => {},\n onEnter = () => {},\n onError,\n onLeave = () => {},\n ...others\n}) => {\n const [focus, setFocus] = useState(false);\n const [prefixFocus, setPrefixFocus] = useState(false);\n const [value, setValue] = useState();\n\n useEffect(() => {\n setValue(propValue);\n }, [propValue]);\n\n const handleChange = (next, event, { isPhone = true } = {}) => {\n const [prefix = '', phone = ''] = hasPrefixes ? value?.split(' ') || [] : [undefined, value];\n let nextValue = (isPhone ? [prefix, next?.replace(/[^\\d]/g, '')] : [next, phone]).join(' ');\n if (!hasPrefixes) nextValue = nextValue.trim();\n\n setValue(nextValue);\n onError && onError(getInputPhoneErrors({ prefixes, value: nextValue }));\n onChange(nextValue, event);\n };\n\n const handleEnter = (event, { isPhone = true } = {}) => {\n isPhone ? setFocus(true) : setPrefixFocus(true);\n onEnter(event);\n };\n\n const handleLeave = (event, { isPhone = true } = {}) => {\n isPhone ? setFocus(false) : setPrefixFocus(false);\n onLeave(event);\n };\n const hasPrefixes = !!prefixes?.length;\n const [prefix, phone] = hasPrefixes ? value?.split(' ') || [] : [undefined, value];\n const has = {\n icon: !!icon,\n label: !!label,\n labelPrefix: !!labelPrefix,\n prefix: prefix?.length > 0,\n phone: phone?.length > 0,\n stateIcon: showState && (error || success || warning),\n };\n const { ['data-testid']: testId } = others;\n\n return (\n <View className={styles(stylePhone.container, others.className)} style={others.style}>\n <View\n row\n className={styles(\n style.inputBorder,\n disabled && style.disabled,\n error && style.error,\n (focus || prefixFocus) && !error && style.focus,\n )}\n >\n {hasPrefixes && (\n <>\n <View row>\n <View className={styles(style.content)}>\n {labelPrefix && (\n <Label\n {...{\n disabled,\n error,\n focus: prefixFocus,\n label: labelPrefix,\n required: showRequired && others.required,\n value: prefix,\n }}\n />\n )}\n <Select\n {...others}\n disabled={disabled}\n name={`${name}-prefix`}\n options={prefixes}\n style={undefined}\n type={undefined}\n value={prefix || ''}\n onChange={(value, event) => handleChange(value, event, { isPhone: false })}\n onEnter={(event) => handleEnter(event, { isPhone: false })}\n onLeave={(event) => handleLeave(event, { isPhone: false })}\n className={styles(\n style.input,\n stylePhone.prefix,\n has.labelPrefix && style.withLabel,\n has.labelPrefix && !(prefixFocus || error || has.prefix) && style.empty,\n )}\n data-testid={testId ? `${testId}-select` : undefined}\n />\n </View>\n {!disabled && <Icon value={ICON.EXPAND_MORE} className={(style.icon, style.select, stylePhone.expand)} />}\n </View>\n <View forceRow className={stylePhone.separator}></View>\n </>\n )}\n\n <View row wide>\n {has.icon && (\n <Icon\n value={icon}\n className={styles(style.icon, style.left, disabled && style.disabled, error && style.error)}\n />\n )}\n <View wide className={style.content}>\n {label && (\n <Label {...{ disabled, error, focus, label, required: showRequired && others.required, value: phone }} />\n )}\n <Input\n {...others}\n disabled={disabled}\n maxLength={12}\n name={`${name}-phone`}\n type=\"tel\"\n value={phone || ''}\n onChange={(value, event) => handleChange(value, event)}\n onEnter={(event) => handleEnter(event)}\n onLeave={(event) => handleLeave(event)}\n className={styles(style.input, has.label && style.withLabel)}\n data-testid={testId ? `${testId}-input` : undefined}\n />\n </View>\n </View>\n {has.stateIcon && <IconState {...{ error, success, warning }} />}\n </View>\n {hint && <Hint {...{ disabled, error, hint }} />}\n </View>\n );\n};\n\nInputPhone.displayName = 'Component:InputPhone';\n\nInputPhone.propTypes = {\n disabled: PropTypes.bool,\n error: PropTypes.bool,\n hint: PropTypes.string,\n icon: PropTypes.func,\n label: PropTypes.string,\n labelPrefix: PropTypes.string,\n name: PropTypes.string.isRequired,\n prefixes: PropTypes.arrayOf(PropTypes.string),\n showRequired: PropTypes.bool,\n showState: PropTypes.bool,\n success: PropTypes.bool,\n value: PropTypes.string,\n warning: PropTypes.bool,\n onChange: PropTypes.func,\n onEnter: PropTypes.func,\n onError: PropTypes.func,\n onLeave: PropTypes.func,\n};\n\nexport { InputPhone };\n"],"mappings":";;;;;;;AAAA;AACA;AAEA;AAEA;AACA;AACA;AACA;AAAiD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEjD,IAAMA,UAAU,GAAG,SAAbA,UAAU,OAmBV;EAAA,IAlBJC,QAAQ,QAARA,QAAQ;IACRC,KAAK,QAALA,KAAK;IACLC,IAAI,QAAJA,IAAI;IACJC,IAAI,QAAJA,IAAI;IACJC,KAAK,QAALA,KAAK;IACLC,WAAW,QAAXA,WAAW;IACXC,IAAI,QAAJA,IAAI;IACJC,QAAQ,QAARA,QA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,EAAPA;EAAO,EAAM,CAC3D,EACNX,IAAI,iBAAI,6BAAC,cAAI;IAAOF,QAAQ,EAARA,QAAQ;IAAEC,KAAK,EAALA,KAAK;IAAEC,IAAI,EAAJA;EAAI,EAAM,CAC3C;AAEX,CAAC;AAAC;AAEFH,UAAU,CAACgE,WAAW,GAAG,sBAAsB;AAE/ChE,UAAU,CAACiE,SAAS,GAAG;EACrBhE,QAAQ,EAAEiE,kBAAS,CAACC,IAAI;EACxBjE,KAAK,EAAEgE,kBAAS,CAACC,IAAI;EACrBhE,IAAI,EAAE+D,kBAAS,CAACE,MAAM;EACtBhE,IAAI,EAAE8D,kBAAS,CAACG,IAAI;EACpBhE,KAAK,EAAE6D,kBAAS,CAACE,MAAM;EACvB9D,WAAW,EAAE4D,kBAAS,CAACE,MAAM;EAC7B7D,IAAI,EAAE2D,kBAAS,CAACE,MAAM,CAACE,UAAU;EACjC9D,QAAQ,EAAE0D,kBAAS,CAACK,OAAO,CAACL,kBAAS,CAACE,MAAM,CAAC;EAC7C3D,YAAY,EAAEyD,kBAAS,CAACC,IAAI;EAC5BzD,SAAS,EAAEwD,kBAAS,CAACC,IAAI;EACzBxD,OAAO,EAAEuD,kBAAS,CAACC,IAAI;EACvBtD,KAAK,EAAEqD,kBAAS,CAACE,MAAM;EACvBtD,OAAO,EAAEoD,kBAAS,CAACC,IAAI;EACvBpD,QAAQ,EAAEmD,kBAAS,CAACG,IAAI;EACxBrD,OAAO,EAAEkD,kBAAS,CAACG,IAAI;EACvBpD,OAAO,EAAEiD,kBAAS,CAACG,IAAI;EACvBnD,OAAO,EAAEgD,kBAAS,CAACG;AACrB,CAAC"}
|
|
@@ -9,6 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _primitives = require("../../primitives");
|
|
10
10
|
var _InputPhone = require("./InputPhone");
|
|
11
11
|
var _Story$args;
|
|
12
|
+
var _excluded = ["value"];
|
|
12
13
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
13
14
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
14
15
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
@@ -25,12 +26,16 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
25
26
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
26
27
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0) { ; } } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
27
28
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
29
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
30
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
28
31
|
var _default = {
|
|
29
32
|
title: 'Components'
|
|
30
33
|
};
|
|
31
34
|
exports.default = _default;
|
|
32
|
-
var Story = function Story(
|
|
33
|
-
var
|
|
35
|
+
var Story = function Story(_ref) {
|
|
36
|
+
var propValue = _ref.value,
|
|
37
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
38
|
+
var _useState = (0, _react.useState)(propValue),
|
|
34
39
|
_useState2 = _slicedToArray(_useState, 2),
|
|
35
40
|
value = _useState2[0],
|
|
36
41
|
setValue = _useState2[1];
|
|
@@ -87,6 +92,7 @@ Story.args = (_Story$args = {
|
|
|
87
92
|
showRequired: false,
|
|
88
93
|
showState: true,
|
|
89
94
|
success: false,
|
|
95
|
+
value: '+34 615702323',
|
|
90
96
|
warning: false
|
|
91
97
|
}, _defineProperty(_Story$args, 'data-testid', 'test-story'), _defineProperty(_Story$args, "style", {}), _Story$args);
|
|
92
98
|
Story.argTypes = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputPhone.stories.js","names":["title","Story","
|
|
1
|
+
{"version":3,"file":"InputPhone.stories.js","names":["title","Story","propValue","value","props","useState","setValue","handleChange","next","others","console","log","handleEnter","handleError","handleLeave","ICON","icon","storyName","args","disabled","error","hint","undefined","label","labelPrefix","name","prefixes","required","showRequired","showState","success","warning","argTypes","options","Object","keys","control","type","defaultValue"],"sources":["../../../src/components/InputPhone/InputPhone.stories.jsx"],"sourcesContent":["import React, { useState } from 'react';\n\nimport { ICON } from '../../primitives';\nimport { InputPhone } from './InputPhone';\nexport default { title: 'Components' };\n\nexport const Story = ({ value: propValue, ...props }) => {\n const [value, setValue] = useState(propValue);\n\n const handleChange = (next, ...others) => {\n setValue(next);\n console.log('<InputPhone>::onChange', next, ...others);\n };\n\n const handleEnter = (...others) => console.log('<InputSelect>::onEnter', ...others);\n\n const handleError = (...others) => console.log('<InputSelect>::onError', ...others);\n\n const handleLeave = (...others) => console.log('<InputSelect>::onLeave', ...others);\n\n return (\n <InputPhone\n {...props}\n icon={ICON[props.icon]}\n value={value}\n onChange={handleChange}\n onEnter={handleEnter}\n onError={handleError}\n onLeave={handleLeave}\n />\n );\n};\n\nStory.storyName = 'InputPhone';\n\nStory.args = {\n disabled: false,\n error: false,\n hint: 'hint',\n icon: undefined,\n label: 'Phone Number',\n labelPrefix: 'Code',\n name: 'name',\n prefixes: ['+34', '+44', '+001', '+999', '+39', '+56'],\n required: true,\n showRequired: false,\n showState: true,\n success: false,\n value: '+34 615702323',\n warning: false,\n // inherited properties\n ['data-testid']: 'test-story',\n style: {},\n};\n\nStory.argTypes = {\n icon: {\n options: [undefined, ...Object.keys(ICON)],\n control: { type: 'select' },\n defaultValue: undefined,\n },\n};\n"],"mappings":";;;;;;;AAAA;AAEA;AACA;AAA0C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,eAC3B;EAAEA,KAAK,EAAE;AAAa,CAAC;AAAA;AAE/B,IAAMC,KAAK,GAAG,SAARA,KAAK,OAAuC;EAAA,IAA1BC,SA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M,SAAS;EACfC,KAAK,EAAE,cAAc;EACrBC,WAAW,EAAE,MAAM;EACnBC,IAAI,EAAE,MAAM;EACZC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC;EACtDC,QAAQ,EAAE,IAAI;EACdC,YAAY,EAAE,KAAK;EACnBC,SAAS,EAAE,IAAI;EACfC,OAAO,EAAE,KAAK;EACd3B,KAAK,EAAE,eAAe;EACtB4B,OAAO,EAAE;AAAK,gCAEb,aAAa,EAAG,YAAY,yCACtB,CAAC,CAAC,eACV;AAED9B,KAAK,CAAC+B,QAAQ,GAAG;EACfhB,IAAI,EAAE;IACJiB,OAAO,GAAGX,SAAS,4BAAKY,MAAM,CAACC,IAAI,CAACpB,gBAAI,CAAC,EAAC;IAC1CqB,OAAO,EAAE;MAAEC,IAAI,EAAE;IAAS,CAAC;IAC3BC,YAAY,EAAEhB;EAChB;AACF,CAAC"}
|
|
@@ -69,6 +69,7 @@ exports[`component:<InputPhone> inherit:className 1`] = `
|
|
|
69
69
|
>
|
|
70
70
|
<input
|
|
71
71
|
class="input input"
|
|
72
|
+
maxlength="12"
|
|
72
73
|
name="name-phone"
|
|
73
74
|
type="tel"
|
|
74
75
|
value=""
|
|
@@ -129,6 +130,7 @@ exports[`component:<InputPhone> prop:disabled 1`] = `
|
|
|
129
130
|
<input
|
|
130
131
|
class="input input"
|
|
131
132
|
disabled=""
|
|
133
|
+
maxlength="12"
|
|
132
134
|
name="name-phone"
|
|
133
135
|
type="tel"
|
|
134
136
|
value=""
|
|
@@ -209,6 +211,7 @@ exports[`component:<InputPhone> prop:error 1`] = `
|
|
|
209
211
|
>
|
|
210
212
|
<input
|
|
211
213
|
class="input input"
|
|
214
|
+
maxlength="12"
|
|
212
215
|
name="name-phone"
|
|
213
216
|
type="tel"
|
|
214
217
|
value=""
|
|
@@ -310,6 +313,7 @@ exports[`component:<InputPhone> prop:hint 1`] = `
|
|
|
310
313
|
>
|
|
311
314
|
<input
|
|
312
315
|
class="input input"
|
|
316
|
+
maxlength="12"
|
|
313
317
|
name="name-phone"
|
|
314
318
|
type="tel"
|
|
315
319
|
value=""
|
|
@@ -396,6 +400,7 @@ exports[`component:<InputPhone> prop:icon & disabled 1`] = `
|
|
|
396
400
|
<input
|
|
397
401
|
class="input input"
|
|
398
402
|
disabled=""
|
|
403
|
+
maxlength="12"
|
|
399
404
|
name="name-phone"
|
|
400
405
|
type="tel"
|
|
401
406
|
value=""
|
|
@@ -497,6 +502,7 @@ exports[`component:<InputPhone> prop:icon & error 1`] = `
|
|
|
497
502
|
>
|
|
498
503
|
<input
|
|
499
504
|
class="input input"
|
|
505
|
+
maxlength="12"
|
|
500
506
|
name="name-phone"
|
|
501
507
|
type="tel"
|
|
502
508
|
value=""
|
|
@@ -619,6 +625,7 @@ exports[`component:<InputPhone> prop:icon 1`] = `
|
|
|
619
625
|
>
|
|
620
626
|
<input
|
|
621
627
|
class="input input"
|
|
628
|
+
maxlength="12"
|
|
622
629
|
name="name-phone"
|
|
623
630
|
type="tel"
|
|
624
631
|
value=""
|
|
@@ -704,6 +711,7 @@ exports[`component:<InputPhone> prop:label 1`] = `
|
|
|
704
711
|
</span>
|
|
705
712
|
<input
|
|
706
713
|
class="input input withLabel"
|
|
714
|
+
maxlength="12"
|
|
707
715
|
name="name-phone"
|
|
708
716
|
type="tel"
|
|
709
717
|
value=""
|
|
@@ -789,6 +797,7 @@ exports[`component:<InputPhone> prop:labelPrefix 1`] = `
|
|
|
789
797
|
>
|
|
790
798
|
<input
|
|
791
799
|
class="input input"
|
|
800
|
+
maxlength="12"
|
|
792
801
|
name="name-phone"
|
|
793
802
|
type="tel"
|
|
794
803
|
value=""
|
|
@@ -890,6 +899,7 @@ exports[`component:<InputPhone> prop:required & prop:showRequired (true) 1`] = `
|
|
|
890
899
|
</span>
|
|
891
900
|
<input
|
|
892
901
|
class="input input withLabel"
|
|
902
|
+
maxlength="12"
|
|
893
903
|
name="name-phone"
|
|
894
904
|
required=""
|
|
895
905
|
type="tel"
|
|
@@ -982,6 +992,7 @@ exports[`component:<InputPhone> prop:required 1`] = `
|
|
|
982
992
|
</span>
|
|
983
993
|
<input
|
|
984
994
|
class="input input withLabel"
|
|
995
|
+
maxlength="12"
|
|
985
996
|
name="name-phone"
|
|
986
997
|
required=""
|
|
987
998
|
type="tel"
|
|
@@ -1063,6 +1074,7 @@ exports[`component:<InputPhone> prop:showState (false) & error 1`] = `
|
|
|
1063
1074
|
>
|
|
1064
1075
|
<input
|
|
1065
1076
|
class="input input"
|
|
1077
|
+
maxlength="12"
|
|
1066
1078
|
name="name-phone"
|
|
1067
1079
|
type="tel"
|
|
1068
1080
|
value=""
|
|
@@ -1164,6 +1176,7 @@ exports[`component:<InputPhone> prop:showState (false) & success 1`] = `
|
|
|
1164
1176
|
>
|
|
1165
1177
|
<input
|
|
1166
1178
|
class="input input"
|
|
1179
|
+
maxlength="12"
|
|
1167
1180
|
name="name-phone"
|
|
1168
1181
|
type="tel"
|
|
1169
1182
|
value=""
|
|
@@ -1265,6 +1278,7 @@ exports[`component:<InputPhone> prop:showState (false) & warning 1`] = `
|
|
|
1265
1278
|
>
|
|
1266
1279
|
<input
|
|
1267
1280
|
class="input input"
|
|
1281
|
+
maxlength="12"
|
|
1268
1282
|
name="name-phone"
|
|
1269
1283
|
type="tel"
|
|
1270
1284
|
value=""
|
|
@@ -1362,6 +1376,7 @@ exports[`component:<InputPhone> prop:success 1`] = `
|
|
|
1362
1376
|
>
|
|
1363
1377
|
<input
|
|
1364
1378
|
class="input input"
|
|
1379
|
+
maxlength="12"
|
|
1365
1380
|
name="name-phone"
|
|
1366
1381
|
type="tel"
|
|
1367
1382
|
value=""
|
|
@@ -1463,6 +1478,7 @@ exports[`component:<InputPhone> prop:value 1`] = `
|
|
|
1463
1478
|
>
|
|
1464
1479
|
<input
|
|
1465
1480
|
class="input input"
|
|
1481
|
+
maxlength="12"
|
|
1466
1482
|
name="name-phone"
|
|
1467
1483
|
type="tel"
|
|
1468
1484
|
value="212123789"
|
|
@@ -1490,6 +1506,7 @@ exports[`component:<InputPhone> prop:value:without prefixes 1`] = `
|
|
|
1490
1506
|
>
|
|
1491
1507
|
<input
|
|
1492
1508
|
class="input input"
|
|
1509
|
+
maxlength="12"
|
|
1493
1510
|
name="name-phone"
|
|
1494
1511
|
type="tel"
|
|
1495
1512
|
value="212123789"
|
|
@@ -1570,6 +1587,7 @@ exports[`component:<InputPhone> prop:warning 1`] = `
|
|
|
1570
1587
|
>
|
|
1571
1588
|
<input
|
|
1572
1589
|
class="input input"
|
|
1590
|
+
maxlength="12"
|
|
1573
1591
|
name="name-phone"
|
|
1574
1592
|
type="tel"
|
|
1575
1593
|
value=""
|
|
@@ -1667,6 +1685,7 @@ exports[`component:<InputPhone> renders 1`] = `
|
|
|
1667
1685
|
>
|
|
1668
1686
|
<input
|
|
1669
1687
|
class="input input"
|
|
1688
|
+
maxlength="12"
|
|
1670
1689
|
name="name-phone"
|
|
1671
1690
|
type="tel"
|
|
1672
1691
|
value=""
|
|
@@ -1749,6 +1768,7 @@ exports[`component:<InputPhone> testID 1`] = `
|
|
|
1749
1768
|
<input
|
|
1750
1769
|
class="input input"
|
|
1751
1770
|
data-testid="mirai-input"
|
|
1771
|
+
maxlength="12"
|
|
1752
1772
|
name="name-phone"
|
|
1753
1773
|
type="tel"
|
|
1754
1774
|
value=""
|
|
@@ -1777,6 +1797,7 @@ exports[`component:<InputPhone> testID:without prefixes 1`] = `
|
|
|
1777
1797
|
<input
|
|
1778
1798
|
class="input input"
|
|
1779
1799
|
data-testid="mirai-input"
|
|
1800
|
+
maxlength="12"
|
|
1780
1801
|
name="name-phone"
|
|
1781
1802
|
type="tel"
|
|
1782
1803
|
value=""
|
|
@@ -33,7 +33,7 @@ var getInputErrors = function getInputErrors() {
|
|
|
33
33
|
var errors = {};
|
|
34
34
|
|
|
35
35
|
// Common
|
|
36
|
-
if (required && (value === undefined || value.length === 0)) errors.required = true;
|
|
36
|
+
if (required && (value === undefined || value === false || value.length === 0)) errors.required = true;
|
|
37
37
|
if (minLength > 0 && value.length < minLength) errors.minLength = true;
|
|
38
38
|
if (regexp && regexp.exec && regexp.exec(value) === null) errors.regexp = true;
|
|
39
39
|
if (test && !test(value)) errors.test = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInputErrors.js","names":["getInputErrors","minLength","regexp","required","test","type","value","others","errors","undefined","length","exec","isValidDate","isValidEmail","isValidPhone","format","getInputDateErrors","getInputPhoneErrors","Object","keys"],"sources":["../../src/helpers/getInputErrors.js"],"sourcesContent":["import { getInputDateErrors } from './getInputDateErrors';\nimport { getInputPhoneErrors } from './getInputPhoneErrors';\nimport { isValidDate } from './isValidDate';\nimport { isValidEmail } from './isValidEmail';\nimport { isValidPhone } from './isValidPhone';\n\nexport const getInputErrors = ({\n minLength = 0,\n regexp,\n required,\n test,\n type = 'text',\n value = '',\n ...others\n} = {}) => {\n let errors = {};\n\n // Common\n if (required && (value === undefined || value.length === 0)) errors.required = true;\n if (minLength > 0 && value.length < minLength) errors.minLength = true;\n if (regexp && regexp.exec && regexp.exec(value) === null) errors.regexp = true;\n if (test && !test(value)) errors.test = true;\n // Email, Phone & Date format\n if (\n (type === 'date' && !isValidDate(value, others)) ||\n (type === 'email' && !isValidEmail(value)) ||\n (type === 'tel' && !isValidPhone(value))\n )\n errors.format = true;\n // Custom Inputs\n if (type === 'inputDate') errors = { ...errors, ...getInputDateErrors({ ...others, value }) };\n if (type === 'inputPhone') errors = { ...errors, ...getInputPhoneErrors({ ...others, value }) };\n\n return Object.keys(errors).length > 0 ? errors : undefined;\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AAA8C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEvC,IAAMA,cAAc,GAAG,SAAjBA,cAAc,GAQhB;EAAA,+EAAP,CAAC,CAAC;IAAA,sBAPJC,SAAS;IAATA,SAAS,+BAAG,CAAC;IACbC,MAAM,QAANA,MAAM;IACNC,QAAQ,QAARA,QAAQ;IACRC,IAAI,QAAJA,IAAI;IAAA,iBACJC,IAAI;IAAJA,IAAI,0BAAG,MAAM;IAAA,kBACbC,KAAK;IAALA,KAAK,2BAAG,EAAE;IACPC,MAAM;EAET,IAAIC,MAAM,GAAG,CAAC,CAAC;;EAEf;EACA,IAAIL,QAAQ,KAAKG,KAAK,KAAKG,SAAS,IAAIH,KAAK,CAACI,MAAM,KAAK,CAAC,CAAC,EAAEF,MAAM,CAACL,QAAQ,GAAG,IAAI;
|
|
1
|
+
{"version":3,"file":"getInputErrors.js","names":["getInputErrors","minLength","regexp","required","test","type","value","others","errors","undefined","length","exec","isValidDate","isValidEmail","isValidPhone","format","getInputDateErrors","getInputPhoneErrors","Object","keys"],"sources":["../../src/helpers/getInputErrors.js"],"sourcesContent":["import { getInputDateErrors } from './getInputDateErrors';\nimport { getInputPhoneErrors } from './getInputPhoneErrors';\nimport { isValidDate } from './isValidDate';\nimport { isValidEmail } from './isValidEmail';\nimport { isValidPhone } from './isValidPhone';\n\nexport const getInputErrors = ({\n minLength = 0,\n regexp,\n required,\n test,\n type = 'text',\n value = '',\n ...others\n} = {}) => {\n let errors = {};\n\n // Common\n if (required && (value === undefined || value === false || value.length === 0)) errors.required = true;\n if (minLength > 0 && value.length < minLength) errors.minLength = true;\n if (regexp && regexp.exec && regexp.exec(value) === null) errors.regexp = true;\n if (test && !test(value)) errors.test = true;\n // Email, Phone & Date format\n if (\n (type === 'date' && !isValidDate(value, others)) ||\n (type === 'email' && !isValidEmail(value)) ||\n (type === 'tel' && !isValidPhone(value))\n )\n errors.format = true;\n // Custom Inputs\n if (type === 'inputDate') errors = { ...errors, ...getInputDateErrors({ ...others, value }) };\n if (type === 'inputPhone') errors = { ...errors, ...getInputPhoneErrors({ ...others, value }) };\n\n return Object.keys(errors).length > 0 ? errors : undefined;\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AAA8C;AA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kCAAMT,MAAM;IAAED,KAAK,EAALA;EAAK,GAAG,CAAE;EAC7F,IAAID,IAAI,KAAK,YAAY,EAAEG,MAAM,mCAAQA,MAAM,GAAK,IAAAS,wCAAmB,kCAAMV,MAAM;IAAED,KAAK,EAALA;EAAK,GAAG,CAAE;EAE/F,OAAOY,MAAM,CAACC,IAAI,CAACX,MAAM,CAAC,CAACE,MAAM,GAAG,CAAC,GAAGF,MAAM,GAAGC,SAAS;AAC5D,CAAC;AAAC"}
|
|
@@ -6,20 +6,20 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getInputPhoneErrors = void 0;
|
|
7
7
|
var getInputPhoneErrors = function getInputPhoneErrors() {
|
|
8
8
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
9
|
-
prefixes = _ref.prefixes,
|
|
9
|
+
_ref$prefixes = _ref.prefixes,
|
|
10
|
+
prefixes = _ref$prefixes === void 0 ? [] : _ref$prefixes,
|
|
10
11
|
_ref$value = _ref.value,
|
|
11
12
|
value = _ref$value === void 0 ? '' : _ref$value;
|
|
12
|
-
if (value ===
|
|
13
|
+
if (value.trim().length === 0) return;
|
|
13
14
|
var errors = {};
|
|
14
|
-
var
|
|
15
|
-
var minLength = hasPrefixes ? 10 : 8;
|
|
16
|
-
var validPrefix = !hasPrefixes || prefixes.some(function (prefix) {
|
|
17
|
-
return value.includes(prefix);
|
|
18
|
-
});
|
|
15
|
+
var withPrefix = prefixes.length > 0;
|
|
19
16
|
var _value$replace = value.replace(/\D/g, ''),
|
|
20
17
|
length = _value$replace.length;
|
|
21
|
-
if (
|
|
22
|
-
|
|
18
|
+
if (length < (withPrefix ? 10 : 8)) errors.minLength = true;
|
|
19
|
+
if (withPrefix && !prefixes.some(function (item) {
|
|
20
|
+
return value.includes(item);
|
|
21
|
+
})) errors.format = true;
|
|
22
|
+
return Object.keys(errors).length > 0 ? errors : undefined;
|
|
23
23
|
};
|
|
24
24
|
exports.getInputPhoneErrors = getInputPhoneErrors;
|
|
25
25
|
//# sourceMappingURL=getInputPhoneErrors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getInputPhoneErrors.js","names":["getInputPhoneErrors","prefixes","value","
|
|
1
|
+
{"version":3,"file":"getInputPhoneErrors.js","names":["getInputPhoneErrors","prefixes","value","trim","length","errors","withPrefix","replace","minLength","some","item","includes","format","Object","keys","undefined"],"sources":["../../src/helpers/getInputPhoneErrors.js"],"sourcesContent":["export const getInputPhoneErrors = ({ prefixes = [], value = '' } = {}) => {\n if (value.trim().length === 0) return;\n\n const errors = {};\n const withPrefix = prefixes.length > 0;\n const { length } = value.replace(/\\D/g, '');\n\n if (length < (withPrefix ? 10 : 8)) errors.minLength = true;\n if (withPrefix && !prefixes.some((item) => value.includes(item))) errors.format = true;\n\n return Object.keys(errors).length > 0 ? errors : undefined;\n};\n"],"mappings":";;;;;;AAAO,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,IAAMC,UAAU,GAAGL,QAAQ,CAACG,MAAM,GAAG,CAAC;EACtC,qBAAmBF,KAAK,CAACK,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IAAnCH,MAAM,kBAANA,MAAM;EAEd,IAAIA,MAAM,IAAIE,UAAU,GAAG,EAAE,GAAG,CAAC,CAAC,EAAED,MAAM,CAACG,SAAS,GAAG,IAAI;EAC3D,IAAIF,UAAU,IAAI,CAACL,QAAQ,CAACQ,IAAI,CAAC,UAACC,IAAI;IAAA,OAAKR,KAAK,CAACS,QAAQ,CAACD,IAAI,CAAC;EAAA,EAAC,EAAEL,MAAM,CAACO,MAAM,GAAG,IAAI;EAEtF,OAAOC,MAAM,CAACC,IAAI,CAACT,MAAM,CAAC,CAACD,MAAM,GAAG,CAAC,GAAGC,MAAM,GAAGU,SAAS;AAC5D,CAAC;AAAC"}
|