Sha256: ac6a9da7b83f818123074ad88f478a849b5cfbf976d781bcc219f5ab8418e41e
Contents?: true
Size: 513 Bytes
Versions: 3
Compression:
Stored size: 513 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.warning.length > 0) { this.strengthIndicatorTarget.innerText = `${result.feedback.warning}.`; this.strengthIndicatorTarget.classList.remove("hidden"); } else { this.strengthIndicatorTarget.classList.add("hidden"); } } }
Version data entries
3 entries across 3 versions & 1 rubygems