ywana-core8 0.1.17 → 0.1.19
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/index.cjs +14 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.modern.js +14 -8
- package/dist/index.modern.js.map +1 -1
- package/dist/index.umd.js +14 -8
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/html/textfield.js +2 -2
- package/src/widgets/explorer/Explorer.js +1 -1
- package/src/widgets/login/LoginBox.js +1 -1
- package/src/widgets/login/login_commons.js +6 -6
package/package.json
CHANGED
package/src/html/textfield.js
CHANGED
@@ -12,7 +12,7 @@ import './textarea.css'
|
|
12
12
|
export const TextField = (props) => {
|
13
13
|
|
14
14
|
const site = useContext(SiteContext)
|
15
|
-
const { id, type = 'text', className, label, labelPosition = 'top', placeholder, value, outlined, readOnly = false, canClear = true, onChange, onEnter, onClick, onFocus, onBlur } = props
|
15
|
+
const { id, type = 'text', className, label, labelPosition = 'top', placeholder, value, outlined, readOnly = false, canClear = true, onChange, onEnter, onClick, onFocus, onBlur, autoComplete="off" } = props
|
16
16
|
|
17
17
|
function onKeyPress(event) {
|
18
18
|
var key = event.charCode ? event.charCode : event.keyCode ? event.keyCode : 0;
|
@@ -64,7 +64,7 @@ export const TextField = (props) => {
|
|
64
64
|
|
65
65
|
return (
|
66
66
|
<div className={`${style} ${id} ${className}`} onClick={onClick}>
|
67
|
-
<input id={id} type={type} placeholder={placeholderTxt} value={value} required onChange={change} onKeyDown={onKeyPress} onFocus={focus} onBlur={blur} readOnly={readOnly} step="any" />
|
67
|
+
<input id={id} type={type} placeholder={placeholderTxt} value={value} required onChange={change} onKeyDown={onKeyPress} onFocus={focus} onBlur={blur} readOnly={readOnly} step="any" autocomplete={autoComplete} />
|
68
68
|
{readOnly === false && canClear && value && value.length > 0 ? <Icon icon="close" clickable size="small" action={clear} /> : null}
|
69
69
|
{type === "password" ? <Icon id={`${id}-visibility`} icon="visibility_off" clickable size="small" action={toggle} /> : null}
|
70
70
|
<span className="bar"></span>
|
@@ -132,7 +132,7 @@ export const FilesSearchBox = (props) => {
|
|
132
132
|
|
133
133
|
return (
|
134
134
|
<div className="file-searchbox">
|
135
|
-
<TextField placeholder="Search..." onChange={searchChanged} outlined />
|
135
|
+
<TextField id="files-search-box" type="search" placeholder="Search..." onChange={searchChanged} outlined />
|
136
136
|
</div>
|
137
137
|
)
|
138
138
|
}
|
@@ -56,7 +56,7 @@ export const LoginBox = ({
|
|
56
56
|
</header>
|
57
57
|
<main>
|
58
58
|
<TextField label={tx(userLabel)} value={user} onChange={changeUser} onEnter={ok} outlined />
|
59
|
-
<TextField label={tx(passwordLabel)} value={password} onChange={changePassword} onEnter={ok} type="password" outlined />
|
59
|
+
<TextField id="loginbox-password" label={tx(passwordLabel)} value={password} onChange={changePassword} onEnter={ok} type="password" outlined />
|
60
60
|
</main>
|
61
61
|
<footer>
|
62
62
|
{ loading ? <div className="load-box"><Icon icon="refresh" /></div> : <Button label={tx(loginLabel)} action={ok} disabled={!canOK()} raised className="login-button" /> }
|
@@ -4,37 +4,37 @@ export function validatePassword(contraseña) {
|
|
4
4
|
|
5
5
|
// Verificar longitud mínima y máxima
|
6
6
|
if (contraseña.length < 15 || contraseña.length > 50) {
|
7
|
-
error =
|
7
|
+
error = 'The password must be between 15 and 50 characters.';
|
8
8
|
return [ false, error]
|
9
9
|
}
|
10
10
|
|
11
11
|
// Verificar al menos una letra (mayúscula o minúscula)
|
12
12
|
if (!/[A-Za-z]/.test(contraseña)) {
|
13
|
-
error =
|
13
|
+
error = 'The password must contain at least one letter (A-Z or a-z).';
|
14
14
|
return [ false, error]
|
15
15
|
}
|
16
16
|
|
17
17
|
// Verificar al menos un número
|
18
18
|
if (!/[0-9]/.test(contraseña)) {
|
19
|
-
error =
|
19
|
+
error = 'The password must contain at least one number (0-9).';
|
20
20
|
return [ false, error]
|
21
21
|
}
|
22
22
|
|
23
23
|
// Verificar al menos una minúscula
|
24
24
|
if (!/[a-z]/.test(contraseña)) {
|
25
|
-
error =
|
25
|
+
error = 'The password must contain at least one lowercase letter (a-z).';
|
26
26
|
return [ false, error]
|
27
27
|
}
|
28
28
|
|
29
29
|
// Verificar al menos una mayúscula
|
30
30
|
if (!/[A-Z]/.test(contraseña)) {
|
31
|
-
error =
|
31
|
+
error = 'The password must contain at least one uppercase letter (A-Z).';
|
32
32
|
return [ false, error]
|
33
33
|
}
|
34
34
|
|
35
35
|
// Verificar al menos un carácter especial
|
36
36
|
if (!/[<>+&!?*\-_%\.:=]/.test(contraseña)) {
|
37
|
-
error =
|
37
|
+
error = 'The password must contain at least one special character (< > + & ! ? * - _ % . : =).';
|
38
38
|
return [ false, error]
|
39
39
|
}
|
40
40
|
|