diff --git a/css/form.css b/css/form.css index 31fe6149..32be82c0 100644 --- a/css/form.css +++ b/css/form.css @@ -7,6 +7,13 @@ opacity: 0.65; } +.fl-form .fa-eye, .fl-form .fa-eye-slash { + position: absolute; + top: 15px; + right: 30px; + display: inline-block; +} + .fl-form.form-offline .cover-form { position: absolute; top: 0; diff --git a/js/build.templates.js b/js/build.templates.js index 96d9903e..afb9e97f 100644 --- a/js/build.templates.js +++ b/js/build.templates.js @@ -59,7 +59,7 @@ this["Fliplet"]["Widget"]["Templates"]["templates.components.paragraph"] = Handl },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.password"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
{{ description }}
\r\n\r\n

Field is required.

\r\n\r\n
\r\n
Password requirements
\r\n
\r\n
\r\n = passwordMinLength\" readonly=\"readonly\" tabindex=\"-1\" />\r\n \r\n Password must be at least 8 characters.\r\n
\r\n
\r\n \r\n \r\n Password must contain at least 1 uppercase character.\r\n
\r\n
\r\n \r\n \r\n Password must contain at least 1 lowercase character.\r\n
\r\n
\r\n \r\n \r\n Password must contain at least 1 number.\r\n
\r\n
\r\n \r\n \r\n Password must contain at least 1 symbol.\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
Password confirmation
\r\n
\r\n
\r\n \r\n \r\n Password confirmation must match.\r\n
\r\n
\r\n
\r\n
\r\n
\r\n"; + return "
{{ description }}
\r\n\r\n\r\n

Field is required.

\r\n\r\n
\r\n
Password requirements
\r\n
\r\n
\r\n = passwordMinLength\" readonly=\"readonly\" tabindex=\"-1\" />\r\n \r\n Password must be at least 8 characters.\r\n
\r\n
\r\n \r\n \r\n Password must contain at least 1 uppercase character.\r\n
\r\n
\r\n \r\n \r\n Password must contain at least 1 lowercase character.\r\n
\r\n
\r\n \r\n \r\n Password must contain at least 1 number.\r\n
\r\n
\r\n \r\n \r\n Password must contain at least 1 symbol.\r\n
\r\n
\r\n
\r\n\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
Password confirmation
\r\n
\r\n
\r\n \r\n \r\n Password confirmation must match.\r\n
\r\n
\r\n
\r\n
\r\n
\r\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.components.radio"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { diff --git a/js/components/password.js b/js/components/password.js index 4a9baa58..0b18f85f 100644 --- a/js/components/password.js +++ b/js/components/password.js @@ -21,6 +21,10 @@ Fliplet.FormBuilder.field('password', { type: Boolean, default: false }, + canShowPassword: { + type: Boolean, + default: false + }, passwordConfirmation: { type: String, default: '' @@ -56,6 +60,7 @@ Fliplet.FormBuilder.field('password', { data: function() { return { isFocused: false, + isShowPassword: false, passwordMinLength: 8, defaultClass: 'panel-default', invalidClass: 'panel-danger', @@ -141,6 +146,10 @@ Fliplet.FormBuilder.field('password', { this.value = oldVal; this.updateValue(); } + + if (!newVal) { + this.isShowPassword = false; + } }, '$v.passwordConfirmation.$invalid': function(value) { if (!value) { diff --git a/js/interface.templates.js b/js/interface.templates.js index 8a1d9ad6..85a73db1 100644 --- a/js/interface.templates.js +++ b/js/interface.templates.js @@ -60,7 +60,7 @@ this["Fliplet"]["Widget"]["Templates"]["templates.configurations.paragraph"] = H },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.configurations.password"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { - return "
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n

Must be at least 8 characters

\r\n
\r\n\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n"; + return "
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n \r\n

Must be at least 8 characters

\r\n
\r\n\r\n
\r\n \r\n
\r\n \r\n \r\n
\r\n
\r\n \r\n \r\n
\r\n
\r\n\r\n
\r\n \r\n

An icon will be shown in the password field, allowing users to toggle between masked characters and plain text.

\r\n
\r\n \r\n \r\n
\r\n
\r\n"; },"useData":true}); this["Fliplet"]["Widget"]["Templates"]["templates.configurations.select"] = Handlebars.template({"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data) { diff --git a/templates/components/password.build.hbs b/templates/components/password.build.hbs index 3251f402..04c53928 100644 --- a/templates/components/password.build.hbs +++ b/templates/components/password.build.hbs @@ -1,6 +1,6 @@
\{{ description }}
+

Field is required.

diff --git a/templates/configurations/password.interface.hbs b/templates/configurations/password.interface.hbs index 016e9422..abdcb7d6 100644 --- a/templates/configurations/password.interface.hbs +++ b/templates/configurations/password.interface.hbs @@ -48,9 +48,9 @@
- +
@@ -60,3 +60,15 @@
+ +
+ +

An icon will be shown in the password field, allowing users to toggle between masked characters and plain text.

+
+ + +
+