Sha256: 09372396589be9c5c5beaeb599ec0a71191e80d6e5feea5bbd25f75eb08bc784
Contents?: true
Size: 554 Bytes
Versions: 56
Compression:
Stored size: 554 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
56 entries across 56 versions & 1 rubygems