|
@@ -342,96 +342,4 @@ function initializeAlpineOnTo(from, to, childrenOnly) {
|
|
// This should simulate backend Livewire being aware of Alpine changes.
|
|
// This should simulate backend Livewire being aware of Alpine changes.
|
|
window.Alpine.clone(from, to)
|
|
window.Alpine.clone(from, to)
|
|
}
|
|
}
|
|
-
|
|
|
|
- // x-show elements require care because of transitions.
|
|
|
|
- if (
|
|
|
|
- Array.from(from.attributes)
|
|
|
|
- .map(attr => attr.name)
|
|
|
|
- .some(name => /x-show/.test(name))
|
|
|
|
- ) {
|
|
|
|
- if (from._x_transition) {
|
|
|
|
- // This covers @entangle('something')
|
|
|
|
- // childrenOnly()
|
|
|
|
- } else {
|
|
|
|
- // This covers x-show="$wire.something"
|
|
|
|
- //
|
|
|
|
- // If the element has x-show, we need to "reverse" the damage done by "clone",
|
|
|
|
- // so that if/when the element has a transition on it, it will occur naturally.
|
|
|
|
- // if (isHiding(from, to)) {
|
|
|
|
- // let style = to.getAttribute('style')
|
|
|
|
- // to.setAttribute('style', style.replace('display: none;', ''))
|
|
|
|
- // } else if (isShowing(from, to)) {
|
|
|
|
- // to.style.display = from.style.display
|
|
|
|
- // }
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-function isHiding(from, to) {
|
|
|
|
- return from._x_isShown && ! to._x_isShown
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
-function isShowing(from, to) {
|
|
|
|
- return ! from._x_isShown && to._x_isShown
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-// This is from Livewire:
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-// function alpinifyElementsForMorphdom(from, to) {
|
|
|
|
-// // If the element we are updating is an Alpine component...
|
|
|
|
-// if (from.__x) {
|
|
|
|
-// // Then temporarily clone it (with it's data) to the "to" element.
|
|
|
|
-// // This should simulate backend Livewire being aware of Alpine changes.
|
|
|
|
-// window.Alpine.clone(from.__x, to)
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// // x-show elements require care because of transitions.
|
|
|
|
-// if (
|
|
|
|
-// Array.from(from.attributes)
|
|
|
|
-// .map(attr => attr.name)
|
|
|
|
-// .some(name => /x-show/.test(name))
|
|
|
|
-// ) {
|
|
|
|
-// if (from.__x_transition) {
|
|
|
|
-// // This covers @entangle('something')
|
|
|
|
-// from.skipElUpdatingButStillUpdateChildren = true
|
|
|
|
-// } else {
|
|
|
|
-// // This covers x-show="$wire.something"
|
|
|
|
-// //
|
|
|
|
-// // If the element has x-show, we need to "reverse" the damage done by "clone",
|
|
|
|
-// // so that if/when the element has a transition on it, it will occur naturally.
|
|
|
|
-// if (isHiding(from, to)) {
|
|
|
|
-// let style = to.getAttribute('style')
|
|
|
|
-
|
|
|
|
-// if (style) {
|
|
|
|
-// to.setAttribute('style', style.replace('display: none;', ''))
|
|
|
|
-// }
|
|
|
|
-// } else if (isShowing(from, to)) {
|
|
|
|
-// to.style.display = from.style.display
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// function isHiding(from, to) {
|
|
|
|
-// if (beforeAlpineTwoPointSevenPointThree()) {
|
|
|
|
-// return from.style.display === '' && to.style.display === 'none'
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// return from._x_isShown && ! to._x_isShown
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// function isShowing(from, to) {
|
|
|
|
-// if (beforeAlpineTwoPointSevenPointThree()) {
|
|
|
|
-// return from.style.display === 'none' && to.style.display === ''
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// return ! from._x_isShown && to._x_isShown
|
|
|
|
-// }
|
|
|
|
-
|
|
|
|
-// function beforeAlpineTwoPointSevenPointThree() {
|
|
|
|
-// let [major, minor, patch] = window.Alpine.version.split('.').map(i => Number(i))
|
|
|
|
-
|
|
|
|
-// return major <= 2 && minor <= 7 && patch <= 2
|
|
|
|
-// }
|
|
|