Sha256: d8aba8dcfea8068b869fb97cefd06601e6d9be9de8d0235ffb8ce5baffde7484
Contents?: true
Size: 644 Bytes
Versions: 92
Compression:
Stored size: 644 Bytes
Contents
import { Controller } from "@hotwired/stimulus" export default class extends Controller { static values = { dependentsSelector: String } updateDependents(event) { if (!this.hasDependents) { return false } this.dependents.forEach((dependent) => { dependent.dispatchEvent(new CustomEvent(`${this.identifier}:updated`, { detail: { event: event }, bubbles: true, cancelable: false })) }) } get hasDependents() { return (this.dependents.length > 0) } get dependents() { if (!this.dependentsSelectorValue) { return [] } return document.querySelectorAll(this.dependentsSelectorValue) } }
Version data entries
92 entries across 92 versions & 1 rubygems