Password checker component, based on LitElement.
<dile-password-checker
label="Write the password:"
button-label="Show/hide"
validate-label="Validate">
</dile-password-checker>
npm install dile-password-checker
Import the component.
import 'dile-password-checker/dile-password-checker.js';
Use the component
<dile-password-checker
label="Write the password:"
button-label="Show/hide"
validate-label="Validate">
</dile-password-checker>
- label: the element label
- buttonLabel: label for button show/hide
- validateLabel: label for button validate
- hidePassword: Flag to know if the inputs should hide the passwords
- error: on true, the element has an error
The dile-password-checker-error
event is dispatched when passwords do not match.
el.addEventListener('dile-password-checker-error', (e) => {
console.log('dile-password-checker-error event');
});
The dile-password-checker-validate
event is dispatched when passwords match.
el.addEventListener('dile-password-checker-validate', (e) => {
console.log('dile-password-checker-validate event');
});