rappasoft / laravel-livewire-tables

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

setPerPageFieldAttributes - Customise perPage Dropdown Attributes #1677

Closed lrljoe closed 7 months ago

lrljoe commented 7 months ago

Adds a new feature for customising the Per-Page Dropdown

setPerPageFieldAttributes

Allows for customisation of the appearance of the "Per Page" dropdown

Note that this utilises a refreshed approach for attributes, and allows for appending to, or replacing the styles and colors independently, via the below methods.

default-colors

Setting to false will disable the default colors for the Per Page dropdown, the default colors are: Bootstrap: None

Tailwind: border-gray-300 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-700 dark:text-white dark:border-gray-600

default-styling

Setting to false will disable the default styling for the Per Page dropdown, the default styling is: Bootstrap 4: form-control

Bootstrap 5: form-select

Tailwind: block w-full rounded-md shadow-sm transition duration-150 ease-in-out sm:text-sm sm:leading-5 focus:ring focus:ring-opacity-50

public function configure(): void
{
    $this->setPerPageFieldAttributes([
        'class' => 'border-red-300 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-red-700 dark:text-white dark:border-red-600', // Add these classes to the dropdown
        'default-colors' => false, // Do not output the default colors
        'default-styles' => true, // Output the default styling
    ]);
}

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

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 88.16%. Comparing base (56ce863) to head (97a715d).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## develop #1677 +/- ## ============================================= + Coverage 88.14% 88.16% +0.01% - Complexity 1312 1314 +2 ============================================= Files 123 123 Lines 3105 3110 +5 ============================================= + Hits 2737 2742 +5 Misses 368 368 ```

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