From 20a74a696e7ca9728d334f7c22e826949536af71 Mon Sep 17 00:00:00 2001 From: Joe <104938042+lrljoe@users.noreply.github.com> Date: Tue, 10 Dec 2024 20:52:04 +0000 Subject: [PATCH] v3.5.8 Development to Master (#2125) ## [v3.5.8] - 2024-12-10 ### New Features - Set bulk action row button attributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2117 - Add setFilterSlidedownWrapperAttributes and setFilterSlidedownRowAttributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2120 ### Bug Fixes - Respect setDisplayPaginationDetailsDisabled for unpaginated tables by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2119 ### Localisation - Added neccessary files for Farsi translation by @AmirMehrabi in https://github.com/rappasoft/laravel-livewire-tables/pull/2100 ### Testing - Workflow Adjustments by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2108 - Add extra Search Lazy Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2107 - Restore Missing Lazy Search Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2106 - Ignore WithEvents Coverage by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2105 - Add missing tests for WithCustomisations by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2104 - Add missing LivewireComponentFilterTest and BooleanFilterTest by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2121 --- .github/workflows/discord-releases.yml | 2 +- .github/workflows/run-phpstan-pull.yml | 6 +- .github/workflows/run-phpstan.yml | 6 +- .github/workflows/run-tests-pcov-pull.yml | 22 +- .github/workflows/run-tests-pull.yml | 8 +- .github/workflows/run-tests.yml | 12 +- CHANGELOG.md | 19 + CONTRIBUTORS.md | 5 +- docs/filters/available-component-methods.md | 273 +++++++++ docs/filters/available-filter-methods.md | 289 ++++++++++ docs/filters/available-methods.md | 520 +----------------- docs/filters/creating-filters.md | 2 +- docs/filters/introduction.md | 2 +- resources/lang/json/fa.json | 72 +++ resources/lang/php/fa/core.php | 41 ++ .../views/components/pagination.blade.php | 129 ++--- .../table/tr/bulk-actions.blade.php | 206 +++---- .../toolbar/items/filter-slidedown.blade.php | 48 +- src/Traits/Helpers/PaginationHelpers.php | 2 + .../BulkActionStylingConfiguration.php | 10 + .../FilterMenuStylingConfiguration.php | 20 + src/Traits/Styling/HasBulkActionsStyling.php | 2 + src/Traits/Styling/HasFilterMenuStyling.php | 4 + .../Helpers/BulkActionStylingHelpers.php | 19 + .../Helpers/FilterMenuStylingHelpers.php | 28 + .../BulkActionsStylingConfigurationTest.php | 1 + .../Styling/FilterSlidedownStylingTest.php | 92 ++++ .../Traits/Visuals/PaginationVisualsTest.php | 6 +- .../Unit/Views/Filters/BooleanFilterTest.php | 17 + .../Filters/LivewireComponentFilterTest.php | 49 ++ 30 files changed, 1129 insertions(+), 783 deletions(-) create mode 100644 docs/filters/available-component-methods.md create mode 100644 docs/filters/available-filter-methods.md create mode 100644 resources/lang/json/fa.json create mode 100644 resources/lang/php/fa/core.php create mode 100644 tests/Unit/Traits/Styling/FilterSlidedownStylingTest.php create mode 100644 tests/Unit/Views/Filters/LivewireComponentFilterTest.php diff --git a/.github/workflows/discord-releases.yml b/.github/workflows/discord-releases.yml index 17e5ac816..236cea737 100644 --- a/.github/workflows/discord-releases.yml +++ b/.github/workflows/discord-releases.yml @@ -4,7 +4,7 @@ on: jobs: github-releases-to-discord: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/run-phpstan-pull.yml b/.github/workflows/run-phpstan-pull.yml index 9a288188b..7426e4a7a 100644 --- a/.github/workflows/run-phpstan-pull.yml +++ b/.github/workflows/run-phpstan-pull.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest] + os: [ubuntu-24.04] php: [8.3] laravel: [11] stability: [prefer-dist] @@ -20,7 +20,7 @@ jobs: name: PHPStan - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, exif, iconv, fileinfo steps: - name: Checkout code @@ -47,7 +47,7 @@ jobs: php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} coverage: pcov - tools: phpunit:9.5 + tools: phpunit:11.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run-phpstan.yml b/.github/workflows/run-phpstan.yml index 87180f167..5132a9479 100644 --- a/.github/workflows/run-phpstan.yml +++ b/.github/workflows/run-phpstan.yml @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest] + os: [ubuntu-24.04] php: [8.3] laravel: [11] stability: [prefer-dist] @@ -23,7 +23,7 @@ jobs: name: PHPStan - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: dom, curl, libxml, mbstring, zip, pcntl, pcov, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, exif, iconv, fileinfo steps: - name: Checkout code @@ -50,7 +50,7 @@ jobs: php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} coverage: pcov - tools: phpunit:9.5 + tools: phpunit:11.4 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/run-tests-pcov-pull.yml b/.github/workflows/run-tests-pcov-pull.yml index 4457fb22a..0fa82ceb9 100644 --- a/.github/workflows/run-tests-pcov-pull.yml +++ b/.github/workflows/run-tests-pcov-pull.yml @@ -16,7 +16,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest] + os: [ubuntu-24.04] php: [8.3] laravel: [11] stability: [prefer-dist] @@ -24,7 +24,7 @@ jobs: name: PCOV - ${{ matrix.os }} - P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-withpcov - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pcov,pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo steps: - name: Checkout code @@ -37,7 +37,14 @@ jobs: php-version: ${{ matrix.php }} extensions: ${{ env.extensions }} key: ${{ env.extensionKey }} - + + - name: Cache extensions + uses: actions/cache@v4 + with: + path: ${{ steps.extcache.outputs.dir }} + key: ${{ steps.extcache.outputs.key }} + restore-keys: ${{ steps.extcache.outputs.key }} + - name: Setup PHP uses: shivammathur/setup-php@v2 with: @@ -49,13 +56,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Cache extensions - uses: actions/cache@v4 - with: - path: ${{ steps.extcache.outputs.dir }} - key: ${{ steps.extcache.outputs.key }} - restore-keys: ${{ steps.extcache.outputs.key }} - - name: Setup problem matchers for PHP run: echo "::add-matcher::${{ runner.tool_cache }}/php.json" @@ -91,7 +91,7 @@ jobs: run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Unit Test Suite" --cache-directory=".phpunit.cache/code-coverage" --strict-coverage --coverage-clover ./coverage.xml - name: Upload coverage reports to Codecov - uses: codecov/codecov-action@v4 + uses: codecov/codecov-action@v5 env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index 0de41ddb2..3d81e3b8c 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -14,14 +14,14 @@ jobs: max-parallel: 3 matrix: os: [ubuntu-latest] - php: [8.1, 8.2, 8.3] + php: [8.1, 8.2, 8.3, 8.4] laravel: [10.*] stability: [prefer-dist] name: PULL PHP-${{ matrix.php }} - Laravel-10 env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr steps: - name: Checkout code @@ -95,14 +95,14 @@ jobs: max-parallel: 2 matrix: os: [ubuntu-latest] - php: [8.2, 8.3] + php: [8.2, 8.3, 8.4] laravel: [11.*] stability: [prefer-dist] name: PULL PHP-${{ matrix.php }} - Laravel-11 env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }}-L${{ matrix.laravel }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr steps: - name: Checkout code diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index ff452e572..05ff871b9 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -15,15 +15,15 @@ jobs: fail-fast: false max-parallel: 3 matrix: - os: [ubuntu-latest] - php: [8.1, 8.2, 8.3] + os: [ubuntu-24.04] + php: [8.1, 8.2, 8.3, 8.4] laravel: [10.*] stability: [prefer-dist] name: PHP-${{ matrix.php }} - Laravel-10 env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr steps: - name: Checkout code @@ -96,15 +96,15 @@ jobs: fail-fast: false max-parallel: 2 matrix: - os: [ubuntu-latest] - php: [8.2, 8.3] + os: [ubuntu-24.04] + php: [8.2, 8.3, 8.4] laravel: [11.*] stability: [prefer-dist] name: PHP-${{ matrix.php }} - Laravel-11 env: extensionKey: phpextensions-${{ matrix.os }}-P${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo, :psr + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, fileinfo, :psr steps: - name: Checkout code diff --git a/CHANGELOG.md b/CHANGELOG.md index 93bd62c02..3f3165858 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to `laravel-livewire-tables` will be documented in this file +## [v3.5.8] - 2024-12-10 +### New Features +- Set bulk action row button attributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2117 +- Add setFilterSlidedownWrapperAttributes and setFilterSlidedownRowAttributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2120 + +### Bug Fixes +- Respect setDisplayPaginationDetailsDisabled for unpaginated tables by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2119 + +### Localisation +- Added neccessary files for Farsi translation by @AmirMehrabi in https://github.com/rappasoft/laravel-livewire-tables/pull/2100 + +### Testing +- Workflow Adjustments by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2108 +- Add extra Search Lazy Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2107 +- Restore Missing Lazy Search Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2106 +- Ignore WithEvents Coverage by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2105 +- Add missing tests for WithCustomisations by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2104 +- Add missing LivewireComponentFilterTest and BooleanFilterTest by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2121 + ## [v3.5.7] - 2024-12-01 ### New Features - IncrementColumn by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2096 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index df270ea9a..f4a2f3e2d 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -12,12 +12,13 @@ | Chinese - Taiwan (TW) | None | | Danish (DA) | [jeppeolesen](https://github.com/jeppeolesen) | | Dutch (NL) | [siebsie23](https://github.com/siebsie23), [spekkie2002](https://github.com/spekkie2002), [Jerimu](https://github.com/Jerimu) | -| English (EN) | Core Team | +| English (EN) | Core Maintainers | +| Farsi (FA) | [AmirMehrabi](https://github.com/AmirMehrabi) | | Finnish (FI) | [devmikromike](https://github.com/devmikromike) | | French (FR) | [dgillier](https://github.com/dgillier), [khwadj](https://github.com/khwadj)| | German (DE) | [khwadj](https://github.com/khwadj) | | Indonesian (ID) | None | -| Italian (IT) | Core Team, [khwadj](https://github.com/khwadj) | +| Italian (IT) | Core Maintainers, [khwadj](https://github.com/khwadj) | | Malay (MS) | [wanadri](https://github.com/wanadri) | | Norwegian (NB) | [channor] (https://github.com/channor) | | Polish (PL) | [meavric](https://github.com/meavric) | diff --git a/docs/filters/available-component-methods.md b/docs/filters/available-component-methods.md new file mode 100644 index 000000000..9a463edbf --- /dev/null +++ b/docs/filters/available-component-methods.md @@ -0,0 +1,273 @@ +--- +title: Available Component Methods +weight: 5 +--- + +These are the available filters configuration methods on the component. These are "table-wide" methods. + +--- + +Filters are **enabled by default** but will only show up if you have at least one defined. + +## setFiltersStatus + +Enable/disable filters for the whole component. + +```php +public function configure(): void +{ + $this->setFiltersStatus(true); + $this->setFiltersStatus(false); +} +``` + +## setFiltersEnabled + +Enable filters for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFiltersStatus(true) + $this->setFiltersEnabled(); +} +``` + +## setFiltersDisabled + +Disable filters for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFiltersStatus(false) + $this->setFiltersDisabled(); +} +``` + +--- + +## setFiltersVisibilityStatus + +**Enabled by default**, show/hide the filters dropdown. + +```php +public function configure(): void +{ + $this->setFiltersVisibilityStatus(true); + $this->setFiltersVisibilityStatus(false); +} +``` + +## setFiltersVisibilityEnabled + +Show the filters dropdown for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFiltersVisibilityStatus(true) + $this->setFiltersVisibilityEnabled(); +} +``` + +## setFiltersVisibilityDisabled + +Hide the filters dropdown for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFiltersVisibilityStatus(false) + $this->setFiltersVisibilityDisabled(); +} +``` + +--- + +## setFilterPillsStatus + +**Enabled by default**, show/hide the filter pills. + +```php +public function configure(): void +{ + $this->setFilterPillsStatus(true); + $this->setFilterPillsStatus(false); +} +``` + +## setFilterPillsEnabled + +Show the filter pills for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFilterPillsStatus(true) + $this->setFilterPillsEnabled(); +} +``` + +## setFilterPillsDisabled + +Hide the filter pills for the component. + +```php +public function configure(): void +{ + // Shorthand for $this->setFilterPillsStatus(false) + $this->setFilterPillsDisabled(); +} +``` + +--- + +## setFilterLayout + +Set the filter layout for the component. + +```php +public function configure(): void +{ + $this->setFilterLayout('slide-down'); +} +``` + +## setFilterLayoutPopover + +Set the filter layout to popover. + +```php +public function configure(): void +{ + $this->setFilterLayoutPopover(); +} +``` + +Set the filter layout to slide down. + +## setFilterLayoutSlideDown + +```php +public function configure(): void +{ + $this->setFilterLayoutSlideDown(); +} +``` + +## setFilterSlideDownDefaultStatusEnabled + +Set the filter slide down to visible by default + +```php +public function configure(): void +{ + // Shorthand for $this->setFilterSlideDownDefaultStatus(true) + $this->setFilterSlideDownDefaultStatusEnabled(); +} +``` + +## setFilterSlideDownDefaultStatusDisabled + +Set the filter slide down to collapsed by default + +```php +public function configure(): void +{ + // Shorthand for $this->setFilterSlideDownDefaultStatus(false) + $this->setFilterSlideDownDefaultStatusDisabled(); +} +``` + +## storeFiltersInSessionEnabled + +Optional behaviour - stores filter values in the session (specific to table - based on the table name) + +### Exercise Caution +If re-using the same Livewire Table Component multiple times in your site, with the same table name, this may cause clashes in filter values + +```php +public function configure(): void +{ + $this->storeFiltersInSessionEnabled(); +} +``` +## storeFiltersInSessionDisabled + +Default behaviour - does not store filters in the session + +```php +public function configure(): void +{ + $this->storeFiltersInSessionDisabled(); +} +``` + +## setFilterPopoverAttributes + +Allows for the customisation of the appearance of the Filter Popover Menu. + +Note the addition of a "default-width" boolean, allowing you to customise the width more smoothly without impacting other applied classes. + +You may also replace default colors by setting "default-colors" to false, or default styling by setting "default-styling" to false, and specifying replacement classes in the "class" property. + +You can also replace the default transition behaviours (Tailwind) by specifying replacement attributes in the array. + +```php +public function configure(): void +{ + $this->setFilterPopoverAttributes( + [ + 'class' => 'w-96', + 'default-width' => false, + 'default-colors' => true, + 'default-styling' => true, + 'x-transition:enter' => 'transition ease-out duration-100', + ] + ); +} +``` + +## setFilterSlidedownWrapperAttributes + +Allows for the customisation of the appearance of the Filter Slidedown Wrapper. + +You may also replace default colors by setting "default-colors" to false, or default styling by setting "default-styling" to false, and specifying replacement classes in the "class" property. + +You can also replace the default transition behaviours (Tailwind) by specifying replacement attributes in the array, for example to extend the duration of the transition effect from the default duration-100 to duration-1000: + +```php +public function configure(): void +{ + $this->setFilterSlidedownWrapperAttributes([ + 'x-transition:enter' => 'transition ease-out duration-1000', + 'class' => 'text-black', + 'default-colors' => true, + 'default-styling' => true, + ]); +} +``` + +## setFilterSlidedownRowAttributes + +Allows for the customisation of the appearance of the Filter Slidedown Row. Note that this uses a callback, which receives the "rowIndex" of the Slidedown Row + +You may replace default colors by setting "default-colors" to false, or default styling by setting "default-styling" to false, and specifying replacement classes in the "class" property. + +```php +public function configure(): void +{ + $this->setFilterSlidedownRowAttributes(fn($rowIndex) => $rowIndex % 2 === 0 ? + [ + 'class' => 'bg-red-500', + 'default-colors' => true, + 'default-styling' => true, + ] : [ + 'class' => 'bg-blue-500', + 'default-colors' => true, + 'default-styling' => true, + ] + ); +} +``` diff --git a/docs/filters/available-filter-methods.md b/docs/filters/available-filter-methods.md new file mode 100644 index 000000000..6e17a63b4 --- /dev/null +++ b/docs/filters/available-filter-methods.md @@ -0,0 +1,289 @@ +--- +title: Available Filter Methods +weight: 6 +--- + +The following methods are available on the filter object. These are "filter-specific" methods. + +---- + +## setFilterPillTitle + +By default, the filter pill title is the filter name, but you can make it whatever you want: + +```php +SelectFilter::make('Active') + ->setFilterPillTitle('User Status') +``` + +## setFilterPillValues + +If you have numeric, or generated keys as your filter option values, they probably don't look too nice in the filter pill. You can set the values to be displayed in the filter pill: + +```php +SelectFilter::make('Active') + ->setFilterPillTitle('User Status') + ->setFilterPillValues([ + '1' => 'Active', + '0' => 'Inactive', + ]) + ->options([ + '' => 'All', + '1' => 'Yes', + '0' => 'No', + ]) +``` + +Now instead of `Active: Yes` it will say `User Status: Active` + +## hiddenFromMenus + +Hide the filter from both the filter popover and the filter slide down. + +```php +SelectFilter::make('Active') + ->hiddenFromMenus() +``` + +## hiddenFromPills + +Hide the filter from the filter pills when applied. + +```php +SelectFilter::make('Active') + ->hiddenFromPills() +``` + +## hiddenFromFilterCount + +Hide the filter from the filter count when applied. + +```php +SelectFilter::make('Active') + ->hiddenFromFilterCount() +``` + +## hiddenFromAll + +Hide the filter from the menus, pills, and count. + +```php +SelectFilter::make('Active') + ->hiddenFromAll() +``` + +## notResetByClearButton + +By default the `clear` button will reset all filters to their defaults. You can prevent this on a specific filter by using this method. + +```php +SelectFilter::make('Active') + ->notResetByClearButton() +``` + +## setFilterSlidedownRow + +This method applies only when using the Slide Down approach to filter display. +By default the filters will be displayed in the order that they are listed in the filters() method. This method allows you to specify the row that the filter will be listed. When multiple filters are placed on the same row, and a mobile device is used, then the first filter listed will "win" that row. +You may use either a string or an integer to pass to this method, and it can be used in conjunction with setFilterSlidedownColspan + +```php +SelectFilter::make('Active') + ->setFilterSlidedownRow(1) +``` + +## setFilterSlidedownColspan + +This method applies only when using the Slide Down approach to filter display. +By default each filter will take up one column, with the number of columns determined by the size of the screen, this ranges from 1 on a mobile device, to a maximum of 5 on a large display. This method allows you to specify the number of columns that the filter should span. It will span the number of columns specified, up to the number of columns available (depending on screen size). +You may use either a string or an integer to pass to this method, and it can be used in conjunction with setFilterSlidedownRow + +```php +DateFilter::make('Date') + ->config([ + 'min' => '2020-01-01', + 'max' => '2021-12-31', + ]) + ->setFilterSlidedownColspan('2') +``` + +## setFilterPillBlade + +Set a blade file for use in displaying the filter values in the pills area. You can use this in conjunction with setFilterPillValues() to prettify your applied filter values display. You will receive two properties ($filter) containing the filter instance, and ($value) containing the filter value. + +```php +SelectFilter::make('Active') + ->setFilterPillBlade('path.to.blade') +``` + +Example blade: +```php +@aware(['component']) +@props(['filter']) + + + {{ $filter->getFilterPillTitle() }} - ({{ $filter->getFilterPillValue($value) }}) + + + +``` + +## setCustomFilterLabel + +Set a custom blade file for the filter's label. This will be used in both the Pop-Over and SlideDown filter displays, you should therefore ensure that you cater for the different filter layouts. + +```php +SelectFilter::make('Active') + ->setCustomFilterLabel('path.to.blade') +``` + +You will receive several properties to your blade, explained here: +- $filter (the filter instance) +- $filterLayout ('slide-down' or 'popover') +- $tableName (the table name) +- $isTailwind (bool - is theme Tailwind) +- $isBootstrap (bool - is theme Bootstrap 4 or Bootstrap 5) +- $isBootstrap4 (bool - is theme Bootstrap 4) +- $isBootstrap5 (bool - is theme Bootstrap 5) +- $customLabelAttributes (array -> any customLabel attributes set using setFilterLabelAttributes()) + +Example label blade: +```php +@props(['filter', 'filterLayout' => 'popover', 'tableName' => 'table', 'isTailwind' => false, 'isBootstrap' => false, 'isBootstrap4' => false, 'isBootstrap5' => false, 'customLabelAttributes' => []]) + + + +``` + +## setFilterLabelAttributes + +### Old Method (Still Supported) +Set custom attributes for a Filter Label. At present it is recommended to only use this for "class" and "style" attributes to avoid conflicts. + +By default, this replaces the default classes on the Filter Label wrapper, if you would like to keep them, set the default flag to true. + +```php +TextFilter::make('Name') + ->setFilterLabelAttributes( + [ + 'class' => 'text-xl', + 'default' => true, + ] + ), +``` + +### New Method (Recommended) +Set custom attributes for a Filter Label. At present it is recommended to only use this for "class" and "style" attributes to avoid conflicts. + +By default, this replaces the default classes on the Filter Label wrapper, if you would like to keep them, set the default flag to true. + +```php +TextFilter::make('Name') + ->setLabelAttributes( + [ + 'class' => 'text-xl', + 'default' => true, + ] + ), +``` + +## setCustomView +Use a fully custom view for a filter. This will utilise solely your view when rendering this filter. Note that the following methods will no longer apply to a filter using this: +- setCustomFilterLabel +- setFilterLabelAttributes + +```php +TextFilter::make('Name') + ->setCustomView('text-custom-view'), +``` + +## Config + +If the filter takes any config options, you can set them with the `config` method: + +```php + DateFilter::make('Date') + ->config([ + 'min' => '2020-01-01', + 'max' => '2021-12-31', + ]) +``` + +## Customising Wireable Behaviour + +For the following Filters, you may customise how the input is wire:model into the Table Component: + +- DateFilter (Defaults to Live) +- DateTimeFilter (Defaults to Live) +- MultiSelectDropdownFilter (Defaults to live.debounce.250ms) +- MultiSelectFilter (Defaults to live.debounce.250ms) +- NumberFilter (Defaults to Blur) +- SelectFilter (Defaults to Live) +- TextFilter (Defaults to Blur) + +You may override this using the following methods, on any of the above Filter types: + +### setWireBlur() +Forces the filter to use a wire:model.blur approach +```php + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->setWireBlur() +``` + +### setWireDefer() +Forces the filter to use a wire:model approach +```php + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->setWireDefer() +``` + +### setWireLive() +Forces the fitler to use a wire:model.live approach +```php + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->setWireLive() +``` + +### setWireDebounce(int $debounceDelay) +Allows you to pass a string to use a wire:model.live.debounce.Xms approach +```php + TextFilter::make('Name') + ->config([ + 'placeholder' => 'Search Name', + 'maxlength' => '25', + ]) + ->setWireDebounce(50) +``` diff --git a/docs/filters/available-methods.md b/docs/filters/available-methods.md index 820916003..2fd27f523 100644 --- a/docs/filters/available-methods.md +++ b/docs/filters/available-methods.md @@ -3,521 +3,7 @@ title: Available Methods weight: 4 --- -## Component Methods +The documentation has now been split into two sections to enhance clarity. -These are the available filters configuration methods on the component. - ---- - -Filters are **enabled by default** but will only show up if you have at least one defined. - -### setFiltersStatus - -Enable/disable filters for the whole component. - -```php -public function configure(): void -{ - $this->setFiltersStatus(true); - $this->setFiltersStatus(false); -} -``` - -### setFiltersEnabled - -Enable filters for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFiltersStatus(true) - $this->setFiltersEnabled(); -} -``` - -### setFiltersDisabled - -Disable filters for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFiltersStatus(false) - $this->setFiltersDisabled(); -} -``` - ---- - -### setFiltersVisibilityStatus - -**Enabled by default**, show/hide the filters dropdown. - -```php -public function configure(): void -{ - $this->setFiltersVisibilityStatus(true); - $this->setFiltersVisibilityStatus(false); -} -``` - -### setFiltersVisibilityEnabled - -Show the filters dropdown for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFiltersVisibilityStatus(true) - $this->setFiltersVisibilityEnabled(); -} -``` - -### setFiltersVisibilityDisabled - -Hide the filters dropdown for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFiltersVisibilityStatus(false) - $this->setFiltersVisibilityDisabled(); -} -``` - ---- - -### setFilterPillsStatus - -**Enabled by default**, show/hide the filter pills. - -```php -public function configure(): void -{ - $this->setFilterPillsStatus(true); - $this->setFilterPillsStatus(false); -} -``` - -### setFilterPillsEnabled - -Show the filter pills for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFilterPillsStatus(true) - $this->setFilterPillsEnabled(); -} -``` - -### setFilterPillsDisabled - -Hide the filter pills for the component. - -```php -public function configure(): void -{ - // Shorthand for $this->setFilterPillsStatus(false) - $this->setFilterPillsDisabled(); -} -``` - ---- - -### setFilterLayout - -Set the filter layout for the component. - -```php -public function configure(): void -{ - $this->setFilterLayout('slide-down'); -} -``` - -### setFilterLayoutPopover - -Set the filter layout to popover. - -```php -public function configure(): void -{ - $this->setFilterLayoutPopover(); -} -``` - -Set the filter layout to slide down. - -### setFilterLayoutSlideDown - -```php -public function configure(): void -{ - $this->setFilterLayoutSlideDown(); -} -``` - -### setFilterSlideDownDefaultStatusEnabled - -Set the filter slide down to visible by default - -```php -public function configure(): void -{ - // Shorthand for $this->setFilterSlideDownDefaultStatus(true) - $this->setFilterSlideDownDefaultStatusEnabled(); -} -``` - -### setFilterSlideDownDefaultStatusDisabled - -Set the filter slide down to collapsed by default - -```php -public function configure(): void -{ - // Shorthand for $this->setFilterSlideDownDefaultStatus(false) - $this->setFilterSlideDownDefaultStatusDisabled(); -} -``` - -### storeFiltersInSessionEnabled - -Optional behaviour - stores filter values in the session (specific to table - based on the table name) - -#### Exercise Caution -If re-using the same Livewire Table Component multiple times in your site, with the same table name, this may cause clashes in filter values - -```php -public function configure(): void -{ - $this->storeFiltersInSessionEnabled(); -} -``` -### storeFiltersInSessionDisabled - -Default behaviour - does not store filters in the session - -```php -public function configure(): void -{ - $this->storeFiltersInSessionDisabled(); -} -``` - -### setFilterPopoverAttributes - -Allows for the customisation of the appearance of the Filter Popover Menu. - -Note the addition of a "default-width" boolean, allowing you to customise the width more smoothly without impacting other applied classes. - -You may also replace default colors by setting "default-colors" to false, or default styling by setting "default-styling" to false, and specifying replacement classes in the "class" property. - -You can also replace the default transition behaviours (Tailwind) by specifying replacement attributes in the array. - -```php -public function configure(): void -{ - $this->setFilterPopoverAttributes( - [ - 'class' => 'w-96', - 'default-width' => false, - 'default-colors' => true, - 'default-styling' => true, - 'x-transition:enter' => 'transition ease-out duration-100', - ] - ); -} -``` - ----- - -## Filter Methods - -The following methods are available on the filter object. - ----- - -### setFilterPillTitle - -By default, the filter pill title is the filter name, but you can make it whatever you want: - -```php -SelectFilter::make('Active') - ->setFilterPillTitle('User Status') -``` - -### setFilterPillValues - -If you have numeric, or generated keys as your filter option values, they probably don't look too nice in the filter pill. You can set the values to be displayed in the filter pill: - -```php -SelectFilter::make('Active') - ->setFilterPillTitle('User Status') - ->setFilterPillValues([ - '1' => 'Active', - '0' => 'Inactive', - ]) - ->options([ - '' => 'All', - '1' => 'Yes', - '0' => 'No', - ]) -``` - -Now instead of `Active: Yes` it will say `User Status: Active` - -### hiddenFromMenus - -Hide the filter from both the filter popover and the filter slide down. - -```php -SelectFilter::make('Active') - ->hiddenFromMenus() -``` - -### hiddenFromPills - -Hide the filter from the filter pills when applied. - -```php -SelectFilter::make('Active') - ->hiddenFromPills() -``` - -### hiddenFromFilterCount - -Hide the filter from the filter count when applied. - -```php -SelectFilter::make('Active') - ->hiddenFromFilterCount() -``` - -### hiddenFromAll - -Hide the filter from the menus, pills, and count. - -```php -SelectFilter::make('Active') - ->hiddenFromAll() -``` - -### notResetByClearButton - -By default the `clear` button will reset all filters to their defaults. You can prevent this on a specific filter by using this method. - -```php -SelectFilter::make('Active') - ->notResetByClearButton() -``` - -### setFilterSlidedownRow - -This method applies only when using the Slide Down approach to filter display. -By default the filters will be displayed in the order that they are listed in the filters() method. This method allows you to specify the row that the filter will be listed. When multiple filters are placed on the same row, and a mobile device is used, then the first filter listed will "win" that row. -You may use either a string or an integer to pass to this method, and it can be used in conjunction with setFilterSlidedownColspan - -```php -SelectFilter::make('Active') - ->setFilterSlidedownRow(1) -``` - -### setFilterSlidedownColspan - -This method applies only when using the Slide Down approach to filter display. -By default each filter will take up one column, with the number of columns determined by the size of the screen, this ranges from 1 on a mobile device, to a maximum of 5 on a large display. This method allows you to specify the number of columns that the filter should span. It will span the number of columns specified, up to the number of columns available (depending on screen size). -You may use either a string or an integer to pass to this method, and it can be used in conjunction with setFilterSlidedownRow - -```php -DateFilter::make('Date') - ->config([ - 'min' => '2020-01-01', - 'max' => '2021-12-31', - ]) - ->setFilterSlidedownColspan('2') -``` - -### setFilterPillBlade - -Set a blade file for use in displaying the filter values in the pills area. You can use this in conjunction with setFilterPillValues() to prettify your applied filter values display. You will receive two properties ($filter) containing the filter instance, and ($value) containing the filter value. - -```php -SelectFilter::make('Active') - ->setFilterPillBlade('path.to.blade') -``` - -Example blade: -```php -@aware(['component']) -@props(['filter']) - - - {{ $filter->getFilterPillTitle() }} - ({{ $filter->getFilterPillValue($value) }}) - - - -``` - -### setCustomFilterLabel - -Set a custom blade file for the filter's label. This will be used in both the Pop-Over and SlideDown filter displays, you should therefore ensure that you cater for the different filter layouts. - -```php -SelectFilter::make('Active') - ->setCustomFilterLabel('path.to.blade') -``` - -You will receive several properties to your blade, explained here: -- $filter (the filter instance) -- $filterLayout ('slide-down' or 'popover') -- $tableName (the table name) -- $isTailwind (bool - is theme Tailwind) -- $isBootstrap (bool - is theme Bootstrap 4 or Bootstrap 5) -- $isBootstrap4 (bool - is theme Bootstrap 4) -- $isBootstrap5 (bool - is theme Bootstrap 5) -- $customLabelAttributes (array -> any customLabel attributes set using setFilterLabelAttributes()) - -Example label blade: -```php -@props(['filter', 'filterLayout' => 'popover', 'tableName' => 'table', 'isTailwind' => false, 'isBootstrap' => false, 'isBootstrap4' => false, 'isBootstrap5' => false, 'customLabelAttributes' => []) - - - -``` - -### setFilterLabelAttributes - -#### Old Method (Still Supported) -Set custom attributes for a Filter Label. At present it is recommended to only use this for "class" and "style" attributes to avoid conflicts. - -By default, this replaces the default classes on the Filter Label wrapper, if you would like to keep them, set the default flag to true. - -```php -TextFilter::make('Name') - ->setFilterLabelAttributes( - [ - 'class' => 'text-xl', - 'default' => true, - ] - ), -``` - -#### New Method (Recommended) -Set custom attributes for a Filter Label. At present it is recommended to only use this for "class" and "style" attributes to avoid conflicts. - -By default, this replaces the default classes on the Filter Label wrapper, if you would like to keep them, set the default flag to true. - -```php -TextFilter::make('Name') - ->setLabelAttributes( - [ - 'class' => 'text-xl', - 'default' => true, - ] - ), -``` - -### setCustomView -Use a fully custom view for a filter. This will utilise solely your view when rendering this filter. Note that the following methods will no longer apply to a filter using this: -- setCustomFilterLabel -- setFilterLabelAttributes - -```php -TextFilter::make('Name') - ->setCustomView('text-custom-view'), -``` - -### Config - -If the filter takes any config options, you can set them with the `config` method: - -```php - DateFilter::make('Date') - ->config([ - 'min' => '2020-01-01', - 'max' => '2021-12-31', - ]) -``` - -### Customising Wireable Behaviour - -For the following Filters, you may customise how the input is wire:model into the Table Component: - -- DateFilter (Defaults to Live) -- DateTimeFilter (Defaults to Live) -- MultiSelectDropdownFilter (Defaults to live.debounce.250ms) -- MultiSelectFilter (Defaults to live.debounce.250ms) -- NumberFilter (Defaults to Blur) -- SelectFilter (Defaults to Live) -- TextFilter (Defaults to Blur) - -You may override this using the following methods, on any of the above Filter types: - -#### setWireBlur() -Forces the filter to use a wire:model.blur approach -```php - TextFilter::make('Name') - ->config([ - 'placeholder' => 'Search Name', - 'maxlength' => '25', - ]) - ->setWireBlur() -``` - -#### setWireDefer() -Forces the filter to use a wire:model approach -```php - TextFilter::make('Name') - ->config([ - 'placeholder' => 'Search Name', - 'maxlength' => '25', - ]) - ->setWireDefer() -``` - -#### setWireLive() -Forces the fitler to use a wire:model.live approach -```php - TextFilter::make('Name') - ->config([ - 'placeholder' => 'Search Name', - 'maxlength' => '25', - ]) - ->setWireLive() -``` - -#### setWireDebounce(int $debounceDelay) -Allows you to pass a string to use a wire:model.live.debounce.Xms approach -```php - TextFilter::make('Name') - ->config([ - 'placeholder' => 'Search Name', - 'maxlength' => '25', - ]) - ->setWireDebounce(50) -``` +Documentation for Available Component Methods is now: [Here](./available-component-methods) +Documentation for Available Filter Methods is now: [Here](./available-filter-methods) diff --git a/docs/filters/creating-filters.md b/docs/filters/creating-filters.md index e940c5952..e13e98563 100644 --- a/docs/filters/creating-filters.md +++ b/docs/filters/creating-filters.md @@ -3,7 +3,7 @@ title: Creating Filters weight: 2 --- -To create filters, you must implement the `filters()` method on your component. +To create filters, you must implement the `filters()` method on your component, which must return an array. ```php public function filters(): array diff --git a/docs/filters/introduction.md b/docs/filters/introduction.md index 11f0d9e76..b0888514b 100644 --- a/docs/filters/introduction.md +++ b/docs/filters/introduction.md @@ -3,7 +3,7 @@ title: Introduction weight: 1 --- -Filters are a good way to narrow down your data. Version 2 has two ways to interact with filters, either by a popover menu or a slide down area. +Filters are a good way to narrow down your data. Version 2 has two ways to interact with filters, either by a popover menu or a slide down area, which are configurable on a per-table basis. ## Popover Menu diff --git a/resources/lang/json/fa.json b/resources/lang/json/fa.json new file mode 100644 index 000000000..7bcf32940 --- /dev/null +++ b/resources/lang/json/fa.json @@ -0,0 +1,72 @@ +{ + "livewire-tables::All": "همه", + "livewire-tables::All Columns": "تمام ستونها", + "livewire-tables::Applied Filters": "فیلترهای اعمالشده", + "livewire-tables::Applied Sorting": "مرتبسازی اعمالشده", + "livewire-tables::Bulk Actions": "اقدامات گروهی", + "livewire-tables::Bulk Actions Confirm": "آیا مطمئن هستید؟", + "livewire-tables::Clear": "پاک کردن", + "livewire-tables::Columns": "ستونها", + "livewire-tables::Debugging Values": "مقادیر اشکالزدایی", + "livewire-tables::Deselect All": "لغو انتخاب همه", + "livewire-tables::Done Reordering": "مرتبسازی تمام شد", + "livewire-tables::Filters": "فیلترها", + "livewire-tables::loading": "در حال بارگذاری", + "livewire-tables::max": "حداکثر", + "livewire-tables::min": "حداقل", + "livewire-tables::not_applicable": "نامعتبر", + "livewire-tables::No": "خیر", + "livewire-tables::No items found. Try to broaden your search.": "موردی یافت نشد. جستجوی خود را گسترش دهید.", + "livewire-tables::of": "از", + "livewire-tables::Remove filter option": "حذف گزینه فیلتر", + "livewire-tables::Remove sort option": "حذف گزینه مرتبسازی", + "livewire-tables::Reorder": "دوباره مرتب کنید", + "livewire-tables::results": "نتایج", + "livewire-tables::row": "ردیف", + "livewire-tables::rows": "ردیفها", + "livewire-tables::rows, do you want to select all": "ردیفها، آیا میخواهید همه را انتخاب کنید", + "livewire-tables::Search": "جستجو", + "livewire-tables::Select All": "انتخاب همه", + "livewire-tables::Select All On Page": "انتخاب همه در صفحه", + "livewire-tables::Showing": "در حال نمایش", + "livewire-tables::to": "تا", + "livewire-tables::Yes": "بله", + "livewire-tables::You are currently selecting all": "شما در حال حاضر همه را انتخاب کردهاید", + "livewire-tables::You are not connected to the internet.": "شما به اینترنت متصل نیستید.", + "livewire-tables::You have selected": "شما انتخاب کردهاید", + "All": "همه", + "All Columns": "تمام ستونها", + "Applied Filters": "فیلترهای اعمالشده", + "Applied Sorting": "مرتبسازی اعمالشده", + "Bulk Actions": "اقدامات گروهی", + "Bulk Actions Confirm": "آیا مطمئن هستید؟", + "Clear": "پاک کردن", + "Columns": "ستونها", + "Debugging Values": "مقادیر اشکالزدایی", + "Deselect All": "لغو انتخاب همه", + "Done Reordering": "مرتبسازی تمام شد", + "Filters": "فیلترها", + "loading": "در حال بارگذاری", + "max": "حداکثر", + "min": "حداقل", + "not_applicable": "نامعتبر", + "No": "خیر", + "No items found. Try to broaden your search.": "موردی یافت نشد. جستجوی خود را گسترش دهید.", + "of": "از", + "Remove filter option": "حذف گزینه فیلتر", + "Remove sort option": "حذف گزینه مرتبسازی", + "Reorder": "دوباره مرتب کنید", + "results": "نتایج", + "row": "ردیف", + "rows": "ردیفها", + "rows, do you want to select all": "ردیفها، آیا میخواهید همه را انتخاب کنید", + "Search": "جستجو", + "Select All": "انتخاب همه", + "Select All On Page": "انتخاب همه در صفحه", + "Showing": "در حال نمایش", + "to": "تا", + "Yes": "بله", + "You are currently selecting all": "شما در حال حاضر همه را انتخاب کردهاید", + "You are not connected to the internet.": "شما به اینترنت متصل نیستید.", + "You have selected": "شما انتخاب کردهاید" +} \ No newline at end of file diff --git a/resources/lang/php/fa/core.php b/resources/lang/php/fa/core.php new file mode 100644 index 000000000..bf880aaeb --- /dev/null +++ b/resources/lang/php/fa/core.php @@ -0,0 +1,41 @@ + 'همه', + 'All Columns' => 'تمام ستونها', + 'Applied Filters' => 'فیلترهای اعمالشده', + 'Applied Sorting' => 'مرتبسازی اعمالشده', + 'Bulk Actions' => 'اقدامات گروهی', + 'Bulk Actions Confirm' => 'آیا مطمئن هستید؟', + 'cancel' => 'لغو', + 'Clear' => 'پاک کردن', + 'Columns' => 'ستونها', + 'Debugging Values' => 'مقادیر اشکالزدایی', + 'Deselect All' => 'لغو انتخاب همه', + 'Done Reordering' => 'مرتبسازی تمام شد', + 'Filters' => 'فیلترها', + 'loading' => 'در حال بارگذاری', + 'max' => 'حداکثر', + 'min' => 'حداقل', + 'not_applicable' => 'نامعتبر', + 'No' => 'خیر', + 'No items found, try to broaden your search' => 'موردی یافت نشد، جستجوی خود را گسترش دهید', + 'of' => 'از', + 'Remove filter option' => 'حذف گزینه فیلتر', + 'Remove sort option' => 'حذف گزینه مرتبسازی', + 'Reorder' => 'دوباره مرتب کنید', + 'results' => 'نتایج', + 'row' => 'ردیف', + 'rows' => 'ردیفها', + 'rows, do you want to select all' => 'ردیفها، آیا میخواهید همه را انتخاب کنید', + 'save' => 'ذخیره', + 'Search' => 'جستجو', + 'Select All' => 'انتخاب همه', + 'Select All On Page' => 'انتخاب همه در صفحه', + 'Showing' => 'در حال نمایش', + 'to' => 'تا', + 'Yes' => 'بله', + 'You are currently selecting all' => 'شما در حال حاضر همه را انتخاب کردهاید', + 'You are not connected to the internet' => 'شما به اینترنت متصل نیستید', + 'You have selected' => 'شما انتخاب کردهاید', +]; diff --git a/resources/views/components/pagination.blade.php b/resources/views/components/pagination.blade.php index 4a9ffca95..feab347e2 100644 --- a/resources/views/components/pagination.blade.php +++ b/resources/views/components/pagination.blade.php @@ -1,19 +1,16 @@ -@aware(['isTailwind','isBootstrap','isBootstrap4','isBootstrap5']) - @includeWhen( $this->hasConfigurableAreaFor('before-pagination'), $this->getConfigurableAreaFor('before-pagination'), $this->getParametersForConfigurableArea('before-pagination') ) -@if ($this->isTailwind) -
- @if($this->showPaginationDetails()) {{ __($this->getLocalisationPath.'Showing') }} {{ $this->getRows->firstItem() }} {{ __($this->getLocalisationPath.'to') }} @@ -21,44 +18,43 @@ {{ __($this->getLocalisationPath.'of') }} {{ __($this->getLocalisationPath.'results') }} - @endif
- @elseif ($this->paginationIsEnabled() && $this->isPaginationMethod('simple')) + @elseif ($this->paginationIsEnabled && $this->isPaginationMethod('simple') && $this->showPaginationDetails)- @if($this->showPaginationDetails()) - {{ __($this->getLocalisationPath.'Showing') }} - {{ $this->getRows->firstItem() }} - {{ __($this->getLocalisationPath.'to') }} - {{ $this->getRows->lastItem() }} - @endif + {{ __($this->getLocalisationPath.'Showing') }} + {{ $this->getRows->firstItem() }} + {{ __($this->getLocalisationPath.'to') }} + {{ $this->getRows->lastItem() }}
- @elseif ($this->paginationIsEnabled() && $this->isPaginationMethod('cursor')) + @elseif ($this->paginationIsEnabled && $this->isPaginationMethod('cursor')) @else -- {{ __($this->getLocalisationPath.'Showing') }} - {{ $this->getRows->count() }} - {{ __($this->getLocalisationPath.'results') }} -
+ @if($this->showPaginationDetails) ++ {{ __($this->getLocalisationPath.'Showing') }} + {{ $this->getRows->count() }} + {{ __($this->getLocalisationPath.'results') }} +
+ @endif @endif