wip
This commit is contained in:
1 parent
2e829b984f
commit
c2e0e0b89b
18 files changed
+300
-203
No files matched your search
@@ -27,6 +27,7 @@ use Filament\Support\Enums\SlideOverPosition;
|
|||||||
use Filament\Support\Enums\Width;
|
use Filament\Support\Enums\Width;
|
||||||
use Filament\Support\RawJs;
|
use Filament\Support\RawJs;
|
||||||
use Illuminate\Contracts\Support\Htmlable;
|
use Illuminate\Contracts\Support\Htmlable;
|
||||||
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Support\HtmlString;
|
use Illuminate\Support\HtmlString;
|
||||||
|
|
||||||
class Statistic extends BaseDashboard
|
class Statistic extends BaseDashboard
|
||||||
@@ -87,18 +88,19 @@ class Statistic extends BaseDashboard
|
|||||||
->color('gray')
|
->color('gray')
|
||||||
->keyBindings(['esc'])
|
->keyBindings(['esc'])
|
||||||
->action('resetFilters'),
|
->action('resetFilters'),
|
||||||
Action::make('calculator')
|
Action::make('openDispatcherBoard')
|
||||||
->modalHeading('')
|
->modalHeading('')
|
||||||
->modalSubmitAction(false) // Hides the submit button
|
|
||||||
->modalCancelAction(false) // Optional: hides the cancel button too
|
|
||||||
->label('Calculate')
|
->label('Calculate')
|
||||||
->icon('icon-player')
|
->icon('icon-player')
|
||||||
|
->color('indigo')
|
||||||
->color(fn (): string => $this->filters['team_id'] ? 'primary' : 'gray')
|
->color(fn (): string => $this->filters['team_id'] ? 'primary' : 'gray')
|
||||||
->disabled(fn (): string => $this->filters['team_id'] ? false : true)
|
->disabled(fn (): string => $this->filters['team_id'] ? false : true)
|
||||||
|
->slideOver()
|
||||||
->slideOverPosition(SlideOverPosition::Start)
|
->slideOverPosition(SlideOverPosition::Start)
|
||||||
->modalWidth(Width::SixExtraLarge)
|
->modalWidth(Width::SixExtraLarge)
|
||||||
->slideOver()
|
->modalSubmitAction(false)
|
||||||
->modalContentFooter(view('filament.modals.player-calculator-modal', ['filters' => $this->filters])),
|
->modalCancelAction(false)
|
||||||
|
->modalContent(fn (): View => view('livewire.board-dispatcher-modal-wrapper', ['filters' => $this->filters])),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class BoardDispatcher extends Component
|
||||||
|
{
|
||||||
|
public array $lists = [];
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->lists['source-attack'] = [
|
||||||
|
['id' => '1', 'name' => 'Source Item A', 'origin' => 'source-attack'],
|
||||||
|
['id' => '2', 'name' => 'Source Item B', 'origin' => 'source-attack'],
|
||||||
|
];
|
||||||
|
$this->lists['source-midfield'] = [
|
||||||
|
['id' => '3', 'name' => 'Source Item C', 'origin' => 'source-midfield'],
|
||||||
|
];
|
||||||
|
$this->lists['source-defence'] = [
|
||||||
|
['id' => '4', 'name' => 'Source Item D', 'origin' => 'source-defence'],
|
||||||
|
['id' => '5', 'name' => 'Source Item E', 'origin' => 'source-defence'],
|
||||||
|
];
|
||||||
|
$this->lists['source-goalkeeper'] = [
|
||||||
|
['id' => '6', 'name' => 'Source Item F', 'origin' => 'source-goalkeeper'],
|
||||||
|
];
|
||||||
|
|
||||||
|
for ($i = 1; $i <= 21; $i++) {
|
||||||
|
$this->lists["dest-{$i}"] = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function moveItem($itemId, $fromList, $toList, $newIndex)
|
||||||
|
{
|
||||||
|
$itemId = (string) $itemId;
|
||||||
|
$newIndex = (int) $newIndex;
|
||||||
|
|
||||||
|
// Abbrechen falls kein Ziel vorhanden ist oder die Position unverändert blieb
|
||||||
|
if (! $toList || $fromList === $toList) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$foundItem = null;
|
||||||
|
|
||||||
|
// 1. Element aus der alten Liste entfernen
|
||||||
|
if (isset($this->lists[$fromList])) {
|
||||||
|
foreach ($this->lists[$fromList] as $key => $item) {
|
||||||
|
if ((string) $item['id'] === $itemId) {
|
||||||
|
$foundItem = $item;
|
||||||
|
unset($this->lists[$fromList][$key]);
|
||||||
|
$this->lists[$fromList] = array_values($this->lists[$fromList]); // Array-Keys korrigieren
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 2. Element in die neue Zielliste am exakten Index einfügen
|
||||||
|
if ($foundItem && isset($this->lists[$toList])) {
|
||||||
|
array_splice($this->lists[$toList], $newIndex, 0, [$foundItem]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function returnToOrigin($itemId, $currentListId)
|
||||||
|
{
|
||||||
|
$itemId = (string) $itemId;
|
||||||
|
|
||||||
|
if (! isset($this->lists[$currentListId])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
$foundItem = null;
|
||||||
|
|
||||||
|
foreach ($this->lists[$currentListId] as $key => $item) {
|
||||||
|
if ((string) $item['id'] === $itemId) {
|
||||||
|
$foundItem = $item;
|
||||||
|
unset($this->lists[$currentListId][$key]);
|
||||||
|
$this->lists[$currentListId] = array_values($this->lists[$currentListId]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($foundItem && isset($this->lists[$foundItem['origin']])) {
|
||||||
|
array_unshift($this->lists[$foundItem['origin']], $foundItem);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.board-dispatcher');
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -119,12 +119,14 @@ class PlayerCalculator extends Component
|
|||||||
'player_id' => $player_id,
|
'player_id' => $player_id,
|
||||||
'player_name' => $name,
|
'player_name' => $name,
|
||||||
'position' => $position,
|
'position' => $position,
|
||||||
'position_color' => $position_color,
|
'type_color' => $position_color,
|
||||||
'color' => $color,
|
'event_color' => $color,
|
||||||
'info' => 'Ev '.$events_played.', '.$preferred_foot.', '.$everage_minutes,
|
'info' => 'Ev '.$events_played.', '.$preferred_foot.', '.$everage_minutes,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// dd($result);
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -15,6 +15,7 @@ use Filament\Tables\View\TablesRenderHook;
|
|||||||
use Filament\View\PanelsRenderHook;
|
use Filament\View\PanelsRenderHook;
|
||||||
use Illuminate\Contracts\View\View;
|
use Illuminate\Contracts\View\View;
|
||||||
use Illuminate\Support\Facades\Blade;
|
use Illuminate\Support\Facades\Blade;
|
||||||
|
use Illuminate\Support\HtmlString;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class AppServiceProvider extends ServiceProvider
|
class AppServiceProvider extends ServiceProvider
|
||||||
@@ -35,10 +36,20 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
|
|
||||||
FilamentTimezone::set('Europe/Vienna');
|
FilamentTimezone::set('Europe/Vienna');
|
||||||
|
|
||||||
|
FilamentView::registerRenderHook(
|
||||||
|
'panels::head.end',
|
||||||
|
fn (): HtmlString => new HtmlString('
|
||||||
|
<script>
|
||||||
|
document.addEventListener("alpine:init", () => {
|
||||||
|
(function(){function l(t){t.directive("sort",(e,{modifiers:d,expression:c},{evaluateLater:p,cleanup:f})=>{let m=p(c),v=d.includes("group")?e.getAttribute("x-sort:group"):"default";e._sortable=new Sortable(e,{group:v,animation:150,onEnd:s=>{let n=s.item.getAttribute("x-sort:item"),a=s.oldIndex,i=s.newIndex,r=s.to.getAttribute("id")||"default";m(()=>{},{scope:{$item:n,$oldIndex:a,$newIndex:i,$owner:r}})}});f(()=>e._sortable.destroy())})}l.inline=l;var u=l;document.addEventListener("DOMContentLoaded",()=>{if(typeof Sortable==="undefined"){let t=document.createElement("script");t.src="https://cloudflare.com";document.head.appendChild(t)}});})();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
'),
|
||||||
|
);
|
||||||
|
|
||||||
FilamentAsset::register([
|
FilamentAsset::register([
|
||||||
Css::make('font-stylesheet', __DIR__.'/../../resources/css/font.css'),
|
Css::make('font-stylesheet', __DIR__.'/../../resources/css/font.css'),
|
||||||
Js::make('number-animator', __DIR__.'/../../resources/js/number-animator.js'),
|
Js::make('number-animator', __DIR__.'/../../resources/js/number-animator.js'),
|
||||||
Js::make('dragndrop', __DIR__ . '/../../resources/js/dragndrop-store.js'),
|
|
||||||
]);
|
]);
|
||||||
|
|
||||||
FilamentView::registerRenderHook(
|
FilamentView::registerRenderHook(
|
||||||
|
|||||||
@@ -20,8 +20,6 @@ use Filament\Http\Middleware\DisableBladeIconComponents;
|
|||||||
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
use Filament\Http\Middleware\DispatchServingFilamentEvent;
|
||||||
use Filament\Panel;
|
use Filament\Panel;
|
||||||
use Filament\PanelProvider;
|
use Filament\PanelProvider;
|
||||||
use Filament\Support\Assets\Css;
|
|
||||||
use Filament\Support\Assets\Js;
|
|
||||||
use Filament\Support\Enums\Width;
|
use Filament\Support\Enums\Width;
|
||||||
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
|
||||||
use Illuminate\Cookie\Middleware\EncryptCookies;
|
use Illuminate\Cookie\Middleware\EncryptCookies;
|
||||||
@@ -30,7 +28,6 @@ use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
|
|||||||
use Illuminate\Routing\Middleware\SubstituteBindings;
|
use Illuminate\Routing\Middleware\SubstituteBindings;
|
||||||
use Illuminate\Session\Middleware\StartSession;
|
use Illuminate\Session\Middleware\StartSession;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Vite;
|
|
||||||
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
use Illuminate\View\Middleware\ShareErrorsFromSession;
|
||||||
use Joaopaulolndev\FilamentEditProfile\FilamentEditProfilePlugin;
|
use Joaopaulolndev\FilamentEditProfile\FilamentEditProfilePlugin;
|
||||||
use Joaopaulolndev\FilamentEditProfile\Pages\EditProfilePage;
|
use Joaopaulolndev\FilamentEditProfile\Pages\EditProfilePage;
|
||||||
@@ -48,11 +45,6 @@ class AdminPanelProvider extends PanelProvider
|
|||||||
->middleware([
|
->middleware([
|
||||||
RecordUserActivity::class,
|
RecordUserActivity::class,
|
||||||
])
|
])
|
||||||
->assets([
|
|
||||||
// Point directly to the source files on disk relative to this provider
|
|
||||||
Css::make('dragula-css', base_path('resources/js/filament-dragula.js')), // Vite extracts CSS imported here
|
|
||||||
Js::make('filament-dragula', Vite::asset('resources/js/filament-dragula.js'))->module(),
|
|
||||||
])
|
|
||||||
->userMenuItems([
|
->userMenuItems([
|
||||||
ExportAction::make('download_betfair')
|
ExportAction::make('download_betfair')
|
||||||
->columnMapping(false)
|
->columnMapping(false)
|
||||||
|
|||||||
Generated
+8
-12
@@ -4705,24 +4705,24 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "mongodb/mongodb",
|
"name": "mongodb/mongodb",
|
||||||
"version": "2.2.0",
|
"version": "2.3.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/mongodb/mongo-php-library.git",
|
"url": "https://github.com/mongodb/mongo-php-library",
|
||||||
"reference": "bbb13f969e37e047fd822527543df55fdc1c9298"
|
"reference": "12e56461166d915e3dd8e4969ad0940ed5207d88"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/bbb13f969e37e047fd822527543df55fdc1c9298",
|
"url": "https://api.github.com/repos/mongodb/mongo-php-library/zipball/12e56461166d915e3dd8e4969ad0940ed5207d88",
|
||||||
"reference": "bbb13f969e37e047fd822527543df55fdc1c9298",
|
"reference": "12e56461166d915e3dd8e4969ad0940ed5207d88",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"composer-runtime-api": "^2.0",
|
"composer-runtime-api": "^2.0",
|
||||||
"ext-mongodb": "^2.2",
|
"ext-mongodb": "^2.3",
|
||||||
"php": "^8.1",
|
"php": "^8.1",
|
||||||
"psr/log": "^1.1.4|^2|^3",
|
"psr/log": "^1.1.4|^2|^3",
|
||||||
"symfony/polyfill-php85": "^1.32"
|
"symfony/polyfill-php85": "^1.33"
|
||||||
},
|
},
|
||||||
"replace": {
|
"replace": {
|
||||||
"mongodb/builder": "*"
|
"mongodb/builder": "*"
|
||||||
@@ -4774,11 +4774,7 @@
|
|||||||
"mongodb",
|
"mongodb",
|
||||||
"persistence"
|
"persistence"
|
||||||
],
|
],
|
||||||
"support": {
|
"time": "2026-04-28T12:50:06+00:00"
|
||||||
"issues": "https://github.com/mongodb/mongo-php-library/issues",
|
|
||||||
"source": "https://github.com/mongodb/mongo-php-library/tree/2.2.0"
|
|
||||||
},
|
|
||||||
"time": "2026-02-11T11:39:56+00:00"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "monolog/monolog",
|
"name": "monolog/monolog",
|
||||||
|
|||||||
Generated
+16
-48
@@ -5,7 +5,7 @@
|
|||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dragula": "^3.7.3",
|
"@alpinejs/sort": "^3.17.1",
|
||||||
"prettier-plugin-blade": "^3.3.2"
|
"prettier-plugin-blade": "^3.3.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@@ -18,6 +18,15 @@
|
|||||||
"vite": "^7.0.4"
|
"vite": "^7.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@alpinejs/sort": {
|
||||||
|
"version": "3.17.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@alpinejs/sort/-/sort-3.17.1.tgz",
|
||||||
|
"integrity": "sha512-Q6qF00WI4cQAZdIxPgbsHnxZIiIv4T1kfSPyEy2QB/SLhLdISuIjzTBa3TQAe1P45BkRtNk5Y8fQuDZuKhN/6w==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"sortablejs": "^1.15.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@esbuild/aix-ppc64": {
|
"node_modules/@esbuild/aix-ppc64": {
|
||||||
"version": "0.25.12",
|
"version": "0.25.12",
|
||||||
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
|
"resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.25.12.tgz",
|
||||||
@@ -1268,12 +1277,6 @@
|
|||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
},
|
},
|
||||||
"node_modules/atoa": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/atoa/-/atoa-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-VVE1H6cc4ai+ZXo/CRWoJiHXrA1qfA31DPnx6D20+kSI547hQN5Greh51LQ1baMRMfxO5K5M4ImMtZbZt2DODQ==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/axios": {
|
"node_modules/axios": {
|
||||||
"version": "1.20.0",
|
"version": "1.20.0",
|
||||||
"resolved": "https://registry.npmjs.org/axios/-/axios-1.20.0.tgz",
|
"resolved": "https://registry.npmjs.org/axios/-/axios-1.20.0.tgz",
|
||||||
@@ -1404,31 +1407,6 @@
|
|||||||
"url": "https://github.com/open-cli-tools/concurrently?sponsor=1"
|
"url": "https://github.com/open-cli-tools/concurrently?sponsor=1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/contra": {
|
|
||||||
"version": "1.9.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/contra/-/contra-1.9.4.tgz",
|
|
||||||
"integrity": "sha512-N9ArHAqwR/lhPq4OdIAwH4e1btn6EIZMAz4TazjnzCiVECcWUPTma+dRAM38ERImEJBh8NiCCpjoQruSZ+agYg==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"atoa": "1.0.0",
|
|
||||||
"ticky": "1.0.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/crossvent": {
|
|
||||||
"version": "1.5.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/crossvent/-/crossvent-1.5.5.tgz",
|
|
||||||
"integrity": "sha512-MY4xhBYEnVi+pmTpHCOCsCLYczc0PVtGdPBz6NXNXxikLaUZo4HdAeUb1UqAo3t3yXAloSelTmfxJ+/oUqkW5w==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"custom-event": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/custom-event": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-GAj5FOq0Hd+RsCGVJxZuKaIDXDf3h6GQoNEjFgbLLI/trgtavwUbSnZ5pVfg27DVCaWjIohryS0JFwIJyT2cMg==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/debug": {
|
"node_modules/debug": {
|
||||||
"version": "4.4.3",
|
"version": "4.4.3",
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
|
||||||
@@ -1467,16 +1445,6 @@
|
|||||||
"node": ">=8"
|
"node": ">=8"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/dragula": {
|
|
||||||
"version": "3.7.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/dragula/-/dragula-3.7.3.tgz",
|
|
||||||
"integrity": "sha512-/rRg4zRhcpf81TyDhaHLtXt6sEywdfpv1cRUMeFFy7DuypH2U0WUL0GTdyAQvXegviT4PJK4KuMmOaIDpICseQ==",
|
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
|
||||||
"contra": "1.9.4",
|
|
||||||
"crossvent": "1.5.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/dunder-proto": {
|
"node_modules/dunder-proto": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz",
|
||||||
@@ -2403,6 +2371,12 @@
|
|||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/sortablejs": {
|
||||||
|
"version": "1.15.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/sortablejs/-/sortablejs-1.15.7.tgz",
|
||||||
|
"integrity": "sha512-Kk8wLQPlS+yi1ZEf48a4+fzHa4yxjC30M/Sr2AnQu+f/MPwvvX9XjZ6OWejiz8crBsLwSq8GHqaxaET7u6ux0A==",
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/source-map-js": {
|
"node_modules/source-map-js": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
|
||||||
@@ -2478,12 +2452,6 @@
|
|||||||
"url": "https://opencollective.com/webpack"
|
"url": "https://opencollective.com/webpack"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ticky": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/ticky/-/ticky-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-RX35iq/D+lrsqhcPWIazM9ELkjOe30MSeoBHQHSsRwd1YuhJO5ui1K1/R0r7N3mFvbLBs33idw+eR6j+w6i/DA==",
|
|
||||||
"license": "MIT"
|
|
||||||
},
|
|
||||||
"node_modules/tinyglobby": {
|
"node_modules/tinyglobby": {
|
||||||
"version": "0.2.17",
|
"version": "0.2.17",
|
||||||
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
|
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
"esbuild@0.28.2": true
|
"esbuild@0.28.2": true
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"dragula": "^3.7.3",
|
"@alpinejs/sort": "^3.17.1",
|
||||||
"prettier-plugin-blade": "^3.3.2"
|
"prettier-plugin-blade": "^3.3.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -274,6 +274,6 @@ less padding in table
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* 3. Sicherstellen, dass die Dropzones Platz für das Element bieten */
|
/* 3. Sicherstellen, dass die Dropzones Platz für das Element bieten */
|
||||||
.drag-box {
|
/* .drag-box {
|
||||||
@apply flex flex-col gap-0 size-24 bg-gray-100/50 border-2 border-dashed border-gray-300 rounded-xl text-xs p-0;
|
@apply flex flex-col gap-0 bg-gray-100/50 border-2 border-dashed border-gray-300 rounded-xl text-xs p-0;
|
||||||
}
|
} */
|
||||||
@@ -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)); })();
|
||||||
@@ -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;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
import dragula from "dragula";
|
|
||||||
import "dragula/dist/dragula.css";
|
|
||||||
|
|
||||||
document.addEventListener("alpine:init", () => {
|
|
||||||
window.dragula = dragula;
|
|
||||||
});
|
|
||||||
@@ -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);
|
||||||
|
});
|
||||||
@@ -1 +0,0 @@
|
|||||||
@livewire('player-calculator', ['filters' => $filters])
|
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<div>
|
||||||
|
<!-- Render the livewire element smoothly within the Filament modal context -->
|
||||||
|
@livewire('board-dispatcher')
|
||||||
|
</div>
|
||||||
@@ -0,0 +1,139 @@
|
|||||||
|
<!-- Ermittelt dynamisch die erste verfügbare Quelle als Start-Tab -->
|
||||||
|
<div class="space-y-6 max-h-[75vh] overflow-y-auto p-1"
|
||||||
|
x-data="{ activeTab: '{{ collect(array_keys($lists))->first(fn($key) => str_starts_with($key, 'source-')) }}' }">
|
||||||
|
|
||||||
|
<!-- 🌟 SEKTION 1: DIE 4 SOURCE-CONTAINER IN NATIVEN FILAMENT TABS -->
|
||||||
|
<div wire:key="sources-tab-container">
|
||||||
|
|
||||||
|
<div class="flex items-center justify-between border-b border-gray-200 dark:border-gray-700 pb-2 mb-4" wire:key="header-split-zone">
|
||||||
|
|
||||||
|
<!-- Native Filament Tabs-Leiste -->
|
||||||
|
<x-filament::tabs wire:key="filament-tabs-bar">
|
||||||
|
@foreach($lists as $listId => $items)
|
||||||
|
@if(str_starts_with($listId, 'source-'))
|
||||||
|
<x-filament::tabs.item icon="heroicon-m-bell"
|
||||||
|
:alpine-active="'activeTab === \'' . $listId . '\''"
|
||||||
|
x-on:click="activeTab = '{{ $listId }}'"
|
||||||
|
wire:key="tab-button-{{ $listId }}"
|
||||||
|
class="cursor-pointer">
|
||||||
|
|
||||||
|
<div class="flex items-center space-x-2">
|
||||||
|
<span>{{ ucwords(str_replace('source-', '', $listId)) }}</span>
|
||||||
|
<!-- Kleiner Zähler direkt im Tab-Titel -->
|
||||||
|
<x-filament::badge size="xs" color="gray">
|
||||||
|
{{ count($items) }}
|
||||||
|
</x-filament::badge>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</x-filament::tabs.item>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</x-filament::tabs>
|
||||||
|
|
||||||
|
<div class="flex items-center pl-4 shrink-0" wire:key="modal-close-right-side">
|
||||||
|
<x-filament::icon-button
|
||||||
|
icon="heroicon-m-x-mark"
|
||||||
|
color="gray"
|
||||||
|
size="md"
|
||||||
|
label="Schließen"
|
||||||
|
tooltip="Modal schließen"
|
||||||
|
x-on:click="close()"
|
||||||
|
class="cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800 rounded-lg transition-colors"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tab-Inhalte (Die Listen selbst) -->
|
||||||
|
<div class="mt-4" wire:key="sources-lists-loop">
|
||||||
|
@foreach($lists as $listId => $items)
|
||||||
|
@if(str_starts_with($listId, 'source-'))
|
||||||
|
<div x-show="activeTab === '{{ $listId }}'" class="transition-all" wire:key="tab-panel-{{ $listId }}">
|
||||||
|
<x-filament::section compact>
|
||||||
|
<!-- SortableJS Container für die aktive Quelle -->
|
||||||
|
<div x-init="new Sortable($el, {
|
||||||
|
group: 'master-board',
|
||||||
|
animation: 150,
|
||||||
|
onEnd: function(evt) {
|
||||||
|
$wire.moveItem(evt.item.getAttribute('data-id'), evt.from.id, evt.to.id, evt.newIndex);
|
||||||
|
}
|
||||||
|
})"
|
||||||
|
id="{{ $listId }}"
|
||||||
|
class="space-y-2 border border-dashed border-gray-300 dark:border-gray-700 rounded-lg p-2 min-h-30 transition duration-200 hover:border-primary-500">
|
||||||
|
|
||||||
|
@foreach($items as $item)
|
||||||
|
<div data-id="{{ $item['id'] }}"
|
||||||
|
wire:key="item-source-{{ $item['id'] }}"
|
||||||
|
class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 rounded-lg p-3 flex items-center justify-between shadow-sm cursor-grab active:cursor-grabbing hover:border-primary-500 dark:hover:border-primary-500 transition-all">
|
||||||
|
<span class="text-sm font-medium text-gray-900 dark:text-gray-100">{{ $item['name'] }}</span>
|
||||||
|
<svg class="h-4 w-4 text-gray-400 pointer-events-none" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 9h16.5m-16.5 6.75h16.5" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</x-filament::section>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 🌟 SEKTION 2: DIE 21 DESTINATION BAYS -->
|
||||||
|
<div wire:key="destinations-main-container">
|
||||||
|
<div class="text-xs font-bold uppercase tracking-wider text-success-500 mb-3">Target Destination Slots (21)</div>
|
||||||
|
|
||||||
|
<div class="grid grid-cols-2 md:grid-cols-4 lg:grid-cols-7 gap-3" wire:key="destations-grid-loop">
|
||||||
|
@foreach($lists as $listId => $items)
|
||||||
|
@if(str_starts_with($listId, 'dest-'))
|
||||||
|
<div class="bg-gray-50 dark:bg-gray-800/40 border border-gray-200 dark:border-gray-700/50 rounded-xl p-3 flex flex-col min-h-[140px]" wire:key="box-{{ $listId }}">
|
||||||
|
<div class="flex items-center justify-between mb-2">
|
||||||
|
<span class="text-[11px] font-bold uppercase text-gray-500 dark:text-gray-400">Bay {{ str_replace('dest-', '', $listId) }}</span>
|
||||||
|
<x-filament::badge color="success" size="xs">
|
||||||
|
{{ count($items) }}
|
||||||
|
</x-filament::badge>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- SortableJS Container für das Zielgebiet -->
|
||||||
|
<div x-init="new Sortable($el, {
|
||||||
|
group: 'master-board',
|
||||||
|
animation: 150,
|
||||||
|
onEnd: function(evt) {
|
||||||
|
$wire.moveItem(evt.item.getAttribute('data-id'), evt.from.id, evt.to.id, evt.newIndex);
|
||||||
|
}
|
||||||
|
})"
|
||||||
|
id="{{ $listId }}"
|
||||||
|
class="flex-1 space-y-1.5 border border-dashed border-gray-200 dark:border-gray-700 rounded-lg p-1.5 min-h-[80px] transition-colors duration-200 hover:border-success-500">
|
||||||
|
|
||||||
|
@foreach($items as $item)
|
||||||
|
<div data-id="{{ $item['id'] }}"
|
||||||
|
wire:key="item-dest-{{ $item['id'] }}"
|
||||||
|
class="bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 text-xs rounded-md p-2 flex items-center justify-between gap-2 cursor-grab active:cursor-grabbing hover:border-danger-500 transition-all">
|
||||||
|
|
||||||
|
<span class="truncate font-medium text-gray-900 dark:text-gray-100 flex-1">
|
||||||
|
{{ $item['name'] }}
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<div class="flex items-center space-x-1 shrink-0">
|
||||||
|
<!-- Return Button -->
|
||||||
|
<button type="button"
|
||||||
|
title="Return to {{ str_replace('-', ' ', $item['origin']) }}"
|
||||||
|
@click.stop="$wire.returnToOrigin('{{ $item['id'] }}', '{{ $listId }}')"
|
||||||
|
class="p-1 rounded text-gray-400 hover:text-danger-500 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors cursor-pointer">
|
||||||
|
<svg class="h-3.5 w-3.5" fill="none" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M6 18L18 6M6 6l12 12" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<svg class="h-3.5 w-3.5 text-gray-400 pointer-events-none" fill="none" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M3.75 9h16.5m-16.5 6.75h16.5" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@@ -1,71 +1,4 @@
|
|||||||
<!-- 1. Der Alpine-Wrapper (Komplett clean, ohne 'dropzones' oder 'sources') -->
|
<!-- Inside your Custom Filament Page Blade Template -->
|
||||||
<div x-data="{
|
<x-filament-panels::page>
|
||||||
init() {
|
<livewire:board-dispatcher />
|
||||||
this.$nextTick(() => {
|
</x-filament-panels::page>
|
||||||
// Findet alle 22 Container (1 Quelle + 21 Ziele) im HTML
|
|
||||||
const allContainers = this.$el.querySelectorAll('.drag-container');
|
|
||||||
|
|
||||||
if (allContainers.length === 0) return;
|
|
||||||
|
|
||||||
// Dragula initialisieren
|
|
||||||
const drake = dragula(Array.from(allContainers), {
|
|
||||||
revertOnSpill: true,
|
|
||||||
copy: false
|
|
||||||
});
|
|
||||||
|
|
||||||
// Drop-Event verarbeiten
|
|
||||||
drake.on('drop', (el, target, source) => {
|
|
||||||
const playerId = el.getAttribute('data-item-id');
|
|
||||||
const targetZone = target.getAttribute('data-container-id');
|
|
||||||
const sourceZone = source.getAttribute('data-container-id');
|
|
||||||
|
|
||||||
console.log('Spieler ' + playerId + ' von ' + sourceZone + ' nach ' + targetZone);
|
|
||||||
|
|
||||||
|
|
||||||
{{-- If the item lands in the "trash" zone, remove it entirely
|
|
||||||
if (targetZone === 'trash') {
|
|
||||||
el.remove();
|
|
||||||
}
|
|
||||||
--}}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}" class="grid grid-cols-12 gap-1">
|
|
||||||
<div class="col-span-5 drag-container flex flex-row flex-wrap gap-2" data-container-id="source-1">
|
|
||||||
@foreach ($players as $player)
|
|
||||||
<x-filament::button class="h-12" size="sm" color="gray" data-item-id="{{ $player['player_id'] }}">
|
|
||||||
⚽️ {{ $player['player_name'] }}
|
|
||||||
</x-filament::button>
|
|
||||||
@endforeach
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-span-6 bg-cover bg-center" style="background-image:url({{ asset('svg/soccerfield.svg') }})">
|
|
||||||
<div class="grid grid-cols-5 grid-rows-7 gap-4 justify-between items-center border">
|
|
||||||
{{-- first row --}}
|
|
||||||
<div></div>
|
|
||||||
<div></div>
|
|
||||||
<div class="drag-container drag-box" data-container-id="zone-1">
|
|
||||||
<div class="font-black text-center">SW</div>
|
|
||||||
</div>
|
|
||||||
<div></div>
|
|
||||||
<div></div>
|
|
||||||
{{-- second row --}}
|
|
||||||
<div class="drag-container drag-box" data-container-id="zone-2">
|
|
||||||
<div class="font-black text-black/30 text-center">DR</div>
|
|
||||||
</div>
|
|
||||||
<div class="drag-container drag-box" data-container-id="zone-3">
|
|
||||||
<div class="font-black text-black/30 text-center">DC</div>
|
|
||||||
</div>
|
|
||||||
<div class="drag-container drag-box" data-container-id="zone-4">
|
|
||||||
<div class="font-black text-black/30 text-center">DC</div>
|
|
||||||
</div>
|
|
||||||
<div class="drag-container drag-box" data-container-id="zone-5">
|
|
||||||
<div class="font-black text-black/30 text-center">DC</div>
|
|
||||||
</div>
|
|
||||||
<div class="drag-container drag-box" data-container-id="zone-6">
|
|
||||||
<div class="font-black text-black/30 text-center">DL</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div>Actions</div>
|
|
||||||
</div>
|
|
||||||
+4
-1
@@ -8,11 +8,14 @@ export default defineConfig({
|
|||||||
input: [
|
input: [
|
||||||
"resources/css/app.css",
|
"resources/css/app.css",
|
||||||
"resources/js/app.js",
|
"resources/js/app.js",
|
||||||
"resources/js/filament-dragula.js",
|
'resources/js/filament-sort.js',
|
||||||
"resources/css/filament/admin/theme.css",
|
"resources/css/filament/admin/theme.css",
|
||||||
],
|
],
|
||||||
refresh: true,
|
refresh: true,
|
||||||
}),
|
}),
|
||||||
tailwindcss(),
|
tailwindcss(),
|
||||||
],
|
],
|
||||||
|
define: {
|
||||||
|
global: 'window',
|
||||||
|
},
|
||||||
});
|
});
|
||||||
Reference in new issue
Block a user