wip: continue implementation

This commit is contained in:
Björn Fromme
2024-11-27 11:31:48 +01:00
parent b5d52b0053
commit 84ab6446ea
81 changed files with 9127 additions and 898 deletions
+39
View File
@@ -0,0 +1,39 @@
import { Controller } from '@hotwired/stimulus'
export default class extends Controller {
static classes = [ 'closed' ]
static targets = [ 'toggle', 'icon' ]
static values = {
open: {
type: Boolean,
default: true,
},
}
initialize() {
this.target = this.hasToggleTarget ? this.toggleTarget : this.element
}
toggle() {
this.openValue = !this.openValue
}
close() {
this.openValue = false
}
open() {
this.openValue = true
}
openValueChanged(open) {
this.target.classList.toggle(this.closedClass, false === open)
if (false === this.hasIconTarget) {
return
}
this.iconTarget.classList.toggle('rotate-90', true === open)
}
}