Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setPerPageFieldAttributes - Customise perPage Dropdown Attributes #1677

Merged
merged 12 commits into from
Mar 1, 2024

Conversation

lrljoe
Copy link
Collaborator

@lrljoe lrljoe commented Mar 1, 2024

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:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

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

Changes to Core Features:

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

Copy link

codecov bot commented Mar 1, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

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

Additional details and impacted files
@@              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              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@lrljoe lrljoe mentioned this pull request Mar 1, 2024
9 tasks
@lrljoe lrljoe merged commit ac641df into rappasoft:develop Mar 1, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant