Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions resources/views/components/empty.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="flex justify-center items-center p-4">
<h3>{{ __('There are no items in this table') }}</h3>
</div>
8 changes: 6 additions & 2 deletions resources/views/grid-view/grid-view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
<div class="mb-2">
@include('laravel-views::components.toolbar.toolbar')
</div>

@if (count($items))
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 {{ $cols[$maxCols] }} gap-8 md:gap-8">
@foreach ($items as $item)
<div class="relative">
Expand All @@ -49,8 +49,12 @@
/>
</div>
@endforeach

</div>

@else
{{-- Empty data message --}}
<x-lv-dynamic-component :view="$emptyComponent" :data="[]"/>
@endif
{{-- Paginator, loading indicator and totals --}}
<div class="mt-8">
{{ $items->links() }}
Expand Down
5 changes: 5 additions & 0 deletions resources/views/list-view/list-view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</div>

<div>
@if (count($items))
@foreach ($items as $item)
<div class="flex items-center border-b border-gray-200 ">
@if ($this->hasBulkActions)
Expand All @@ -17,6 +18,10 @@
</div>
</div>
@endforeach
@else
{{-- Empty data message --}}
<x-lv-dynamic-component :view="$emptyComponent" :data="[]"/>
@endif
</div>

{{-- Paginator, loading indicator and totals --}}
Expand Down
4 changes: 1 addition & 3 deletions resources/views/table-view/table-view.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@

@else
{{-- Empty data message --}}
<div class="flex justify-center items-center p-4">
<h3>{{ __('There are no items in this table') }}</h3>
</div>
<x-lv-dynamic-component :view="$emptyComponent" :data="[]"/>
@endif

{{-- Paginator, loading indicator and totals --}}
Expand Down
2 changes: 2 additions & 0 deletions src/Views/DataView.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ abstract class DataView extends View

public $selected = [];
public $allSelected = false;

public $emptyComponent = 'laravel-views::components.empty';

public function hydrate()
{
Expand Down