@props([ 'module' => 'table', // localStorage ayarları için benzersiz anahtar 'title' => null, 'subtitle' => null, 'icon' => null, 'columns' => [], // [['key','label','sortable','sort','visible','fixed','align','width']] 'filters' => [], // [['key','label','options'=>[val=>label],'value','placeholder']] 'search' => '', 'searchPlaceholder' => 'Ara...', 'sort' => null, 'dir' => 'desc', 'createUrl' => null, 'createLabel' => 'Yeni Ekle', 'bulk' => false, 'stats' => [], // [['label','value','icon','color']] 'paginator' => null, // LengthAwarePaginator → otomatik sayfalama çubuğu (üst + alt) 'perPageOptions' => [10, 25, 50, 100], // sayfa başına kayıt seçenekleri ]) @php $activeFilterCount = collect($filters)->filter(fn ($f) => ($f['value'] ?? '') !== '' && !is_null($f['value'] ?? null))->count(); $defaultHidden = collect($columns) ->filter(fn ($c) => (($c['visible'] ?? true) === false) && !($c['fixed'] ?? false)) ->pluck('key')->values(); @endphp
{{-- ── İstatistik Kartları ── --}} @if(count($stats))
@foreach($stats as $s)
{{ $s['value'] }}
{{ $s['label'] }}
@endforeach
@endif {{-- ── Başlık ── --}} @if($title || $createUrl)
@if($icon)@endif
@if($title)

{{ $title }}

@endif @if($subtitle)

{{ $subtitle }}

@endif
{{ $headerActions ?? '' }} @if($createUrl) {{ $createLabel }} @endif
@endif {{-- ── Araç Çubuğu (arama + filtre + ayarlar) ── --}}
@if(count($filters)) @endif
{{-- Filtre paneli --}} @if(count($filters))
@foreach($filters as $f)
@if(($f['type'] ?? 'select') === 'date') @else @endif
@endforeach
Temizle
@endif
{{-- ── Toplu İşlem Çubuğu ── --}} @if($bulk) @endif {{-- ── Tablo ── --}}
@if($paginator) @include('components.partials.dt-pager', ['paginator' => $paginator, 'perPageOptions' => $perPageOptions, 'position' => 'top']) @endif
@if($bulk) @endif @foreach($columns as $col) @endforeach {{ $slot }}
@if($col['sortable'] ?? false) @php $sortKey = $col['sort'] ?? $col['key']; $isActive = $sort === $sortKey; @endphp @else {{ $col['label'] }} @endif
@if($paginator) @elseif(isset($footer)) @endif
@once @push('styles') @endpush @push('scripts') @endpush @endonce