Sha256: 2098363a0192f92978f6058facc1d38047ce89739bdc3bea48286f5782b1142e
Contents?: true
Size: 549 Bytes
Versions: 12
Compression:
Stored size: 549 Bytes
Contents
import { Controller } from "@hotwired/stimulus" export default class extends Controller { static targets = [ "input", "showIcon", "hideIcon" ] static values = { revealed: Boolean } revealedValueChanged() { this.#update() } reveal() { this.revealedValue = !this.revealedValue } #update() { this.inputTarget.type = this.#inputType this.showIconTarget.hidden = this.revealedValue this.hideIconTarget.hidden = !this.revealedValue } get #inputType() { return this.revealedValue ? "text" : "password" } }
Version data entries
12 entries across 12 versions & 1 rubygems