rappasoft / laravel-livewire-tables

A dynamic table component for Laravel Livewire
https://rappasoft.com/docs/laravel-livewire-tables/v2/introduction
MIT License
1.7k stars 320 forks source link

Add Capability for a Custom Empty View to be used #1583

Closed lrljoe closed 5 months ago

lrljoe commented 7 months ago

This allows for a Custom Empty View to be used instead of just replacing the text, giving more capability to stylise a table component.

You may also define custom classes to use on the full-width "td" element that wraps your custom class.

setCustomEmptyView

Set a custom view to be used when there are no results, this will be wrapped in a full-width table column (td)

public function configure(): void
{
    $this->setCustomEmptyView('empty-table-view');
}

setCustomEmptyViewClasses

When using a custom view, you may also set the classes that will apply to the td element wrapping your view. This will replace the default values, which are listed below.

public function configure(): void
{
    $this->setCustomEmptyView('empty-table-view')
         ->setCustomEmptyViewClasses('bg-light bg-gray-50 dark:bg-gray-800 dark:text-white rappasoft-striped-row');
}

All Submissions:

New Feature Submissions:

  1. [X] Does your submission pass tests and did you add any new tests needed for your feature?
  2. [X] Did you update all templates (if applicable)?
  3. [X] Did you add the relevant documentation (if applicable)?
  4. [X] Did you test locally to make sure your feature works as intended?

Changes to Core Features:

codecov[bot] commented 7 months ago

Codecov Report

Attention: 20 lines in your changes are missing coverage. Please review.

Comparison is base (c06563e) 89.14% compared to head (8d014df) 88.65%. Report is 17 commits behind head on develop.

Files Patch % Lines
...Traits/Configuration/EmptyMessageConfiguration.php 14.28% 18 Missing :warning:
src/Traits/Helpers/EmptyMessageHelpers.php 75.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1583 +/- ## ============================================= - Coverage 89.14% 88.65% -0.49% - Complexity 1334 1353 +19 ============================================= Files 105 108 +3 Lines 3140 3172 +32 ============================================= + Hits 2799 2812 +13 - Misses 341 360 +19 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

stale[bot] commented 5 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.