Sha256: 8700a9b415dc8f09d770d2249d0f8bf6992e1dcb3cb5671556c34ed3c73c4731
Contents?: true
Size: 505 Bytes
Versions: 1
Compression:
Stored size: 505 Bytes
Contents
import { Controller } from "stimulus"; import zxcvbn from "zxcvbn"; export default class extends Controller { static targets = ["strengthIndicator"]; estimateStrength(e) { const result = zxcvbn(e.target.value); if (result.feedback && result.feedback.length > 0) { this.strengthIndicatorTarget.innerText = `${result.feedback.warning}.`; this.strengthIndicatorTarget.classList.remove("hidden"); } else { this.strengthIndicatorTarget.classList.add("hidden"); } } }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
bullet_train-fields-1.0.13 | app/javascript/controllers/fields/password_controller.js |