summaryrefslogtreecommitdiff
path: root/resources/views
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2025-09-23 22:48:52 +0100
committerSam Light <samlight1994@gmail.com>2025-09-23 22:48:52 +0100
commitfa50828dbe10ed4aa44717c6e4bfa333ca4aae60 (patch)
treed1b6a6244334ccc1346b22e0f91dd0e7c35e4fa6 /resources/views
parentc28779dcb765e53e38d1fff4f0deaf2908fdc357 (diff)
Added table protected properties to config wrapper components and classes
Diffstat (limited to 'resources/views')
-rw-r--r--resources/views/components/wrapper.blade.php1
-rw-r--r--resources/views/table.blade.php94
2 files changed, 53 insertions, 42 deletions
diff --git a/resources/views/components/wrapper.blade.php b/resources/views/components/wrapper.blade.php
new file mode 100644
index 0000000..3338f62
--- /dev/null
+++ b/resources/views/components/wrapper.blade.php
@@ -0,0 +1 @@
+{{ $slot }}
diff --git a/resources/views/table.blade.php b/resources/views/table.blade.php
index 8812b0c..741a27f 100644
--- a/resources/views/table.blade.php
+++ b/resources/views/table.blade.php
@@ -1,51 +1,61 @@
-<div>
- @foreach($toolbars as $toolbar)
- {{ $toolbar?->render() }}
- @endforeach
- <table class="table">
- <colgroup>
- @foreach($columns as $column)
- <col @class([$column->getColClass()]) />
- @endforeach
- </colgroup>
- <thead>
- <tr>
+<div @class($rootClass)>
+
+ <x-dynamic-component :component="$toolbarsWrapperComponent">
+ @foreach($toolbars as $toolbar)
+ {{ $toolbar?->render() }}
+ @endforeach
+ </x-dynamic-component>
+
+ <x-dynamic-component :component="$tableWrapperComponent">
+ <table @class($tableClass)>
+ <colgroup>
@foreach($columns as $column)
- <th
- scope="col"
- >
- <div
- @class([
- 'ordered' => $column->isSortable(),
- 'ordered-asc' => $column->name === $order && $orderDirection === 'asc',
- 'ordered-desc' => $column->name === $order && $orderDirection === 'desc',
- ])
- @if($column->isSortable())
- wire:click="orderBy('{{ $column->name }}')"
- @endif
- >
- {{ $column->getTitle() }}
- </div>
- </th>
+ <col @class([$column->getColClass()]) />
@endforeach
- </tr>
- </thead>
- <tbody>
- @foreach($data as $row)
+ </colgroup>
+ <thead>
<tr>
@foreach($columns as $column)
- {{ $column->view($row) }}
+ <th
+ scope="col"
+ >
+ <div
+ @class([
+ 'ordered' => $column->isSortable(),
+ 'ordered-asc' => $column->name === $order && $orderDirection === 'asc',
+ 'ordered-desc' => $column->name === $order && $orderDirection === 'desc',
+ ])
+ @if($column->isSortable())
+ wire:click="orderBy('{{ $column->name }}')"
+ @endif
+ >
+ {{ $column->getTitle() }}
+ </div>
+ </th>
@endforeach
</tr>
- @endforeach
- </tbody>
- </table>
- <div class="table-pagination d-flex justify-content-between align-items-center">
- {{ $data->links() }}
- <div>
- {{ __('Showing') }} {{ $data->count() }}
- {{ __('of') }} {{ $data->total() }}
+ </thead>
+ <tbody>
+ @foreach($data as $row)
+ <tr>
+ @foreach($columns as $column)
+ {{ $column->view($row) }}
+ @endforeach
+ </tr>
+ @endforeach
+ </tbody>
+ </table>
+ </x-dynamic-component>
+
+ <x-dynamic-component :component="$paginationWrapperComponent">
+ <div class="table-pagination d-flex justify-content-between align-items-center">
+ {{ $data->links() }}
+ <div>
+ {{ __('Showing') }} {{ $data->count() }}
+ {{ __('of') }} {{ $data->total() }}
+ </div>
</div>
- </div>
+ </x-dynamic-component>
+
</div>