This commit is contained in:
salam committed 2026-09-05 07:36:26 +02:00
1 parent 2e829b984f
commit c2e0e0b89b
18 files changed
+343 -246

No files matched your search

+1
View File
@@ -0,0 +1 @@
(() => { function l(f) { f.directive("sort", (m, { modifiers: E, expression: I }, { Alpine: g, effect: v, evaluateLater: w }) => { let a = m.closest("[x-data]"); if (!a) return; let x = w(I), o = g.$data(a), [r] = E; v(() => { x(e => { let n = [...o[r]]; if (["asc", "desc"].includes(e)) { let c = e === "asc" ? n.sort((s, t) => s > t ? 1 : -1) : n.sort((s, t) => s < t ? 1 : -1); o[r] = c; return } let [y, ...p] = e.split("."), A = n.sort((c, s) => { let t = p.reduce((i, d) => i[d], c), u = p.reduce((i, d) => i[d], s); return y === "asc" ? t > u ? 1 : -1 : t < u ? 1 : -1 }); o[r] = A }) }) }) } document.addEventListener("alpine:init", () => window.Alpine.plugin(l)); })();
-44
View File
@@ -1,44 +0,0 @@
document.addEventListener("alpine:init", () => {
Alpine.store("main", {
attack: true,
midfield: true,
defence: true,
goalkeeper: true,
players: [],
groups: [],
toggleAttack() {
this.attack = !this.attack;
// Loop through them and add Tailwind's invisible class
elements.forEach((el) => el.classList.add("invisible"));
},
console(index) {
console.log(this.players[index].player_id);
var p = this.players[index].player_id;
},
loadPlayer(data) {
this.players = data;
},
setPosGroup(group) {
this.groups = group;
console.log(this.groups, group);
},
hasVisible(type) {
console.log(type);
return true;
},
toggleType(toggleStates) {
var toggleState = toggleStates;
// var toggleState = JSON.parse(mode);
// this.visa = toggleState[0].data.status;
// console.log(this.visabilities);
},
findByPlayerId(player_id) {
const index = this.items.findIndex(
(item) => item.player_id === player_id,
);
if (index > -1) {
return item;
}
},
});
});
-6
View File
@@ -1,6 +0,0 @@
import dragula from "dragula";
import "dragula/dist/dragula.css";
document.addEventListener("alpine:init", () => {
window.dragula = dragula;
});
+6
View File
@@ -0,0 +1,6 @@
import sort from '@alpinejs/sort';
// Intercept the global document event before Filament initializes its engine
document.addEventListener('alpine:init', () => {
window.Alpine.plugin(sort);
});