Merge branch 'main' into disable-column-restore-transition
This commit is contained in:
@@ -4,6 +4,9 @@ import { nextFrame } from "helpers/timing_helpers";
|
||||
export default class extends Controller {
|
||||
static classes = [ "collapsed", "noTransitions" ]
|
||||
static targets = [ "column", "button" ]
|
||||
static values = {
|
||||
collection: String
|
||||
}
|
||||
|
||||
async connect() {
|
||||
this.#disableTransitions()
|
||||
@@ -84,6 +87,6 @@ export default class extends Controller {
|
||||
}
|
||||
|
||||
#localStorageKeyFor(column) {
|
||||
return `expand-${column.getAttribute("id")}`
|
||||
return `expand-${this.collectionValue}-${column.getAttribute("id")}`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,4 +43,11 @@ export default class extends Controller {
|
||||
closeOnClickOutside({ target }) {
|
||||
if (!this.element.contains(target)) this.close()
|
||||
}
|
||||
|
||||
preventCloseOnMorphing(event) {
|
||||
if (event.detail?.attributeName === "open") {
|
||||
event.preventDefault()
|
||||
event.stopPropagation()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { Controller } from "@hotwired/stimulus"
|
||||
import { debounce, nextFrame } from "helpers/timing_helpers";
|
||||
|
||||
export default class extends Controller {
|
||||
static targets = [ "cancel", "submit" ]
|
||||
static targets = [ "cancel", "submit", "input" ]
|
||||
|
||||
static values = {
|
||||
debounceTimeout: { type: Number, default: 300 }
|
||||
@@ -16,6 +16,17 @@ export default class extends Controller {
|
||||
this.element.requestSubmit()
|
||||
}
|
||||
|
||||
preventEmptySubmit(event) {
|
||||
const input = this.hasInputTarget ? this.inputTarget : null
|
||||
|
||||
if (input) {
|
||||
const value = (input.value || "").trim()
|
||||
if (value.length === 0) {
|
||||
event.preventDefault()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debouncedSubmit(event) {
|
||||
this.submit(event)
|
||||
}
|
||||
|
||||
@@ -90,7 +90,6 @@ export default class extends Controller {
|
||||
#replacePaginationLinkWithFrame(linkElement) {
|
||||
const turboFrame = this.#buildTurboFrameFor(linkElement)
|
||||
this.#insertTurboFrameAtPosition(linkElement, turboFrame)
|
||||
linkElement.remove()
|
||||
}
|
||||
|
||||
#buildTurboFrameFor(linkElement) {
|
||||
|
||||
Reference in New Issue
Block a user