diff --git a/.github/workflows/run-tests-pcov-pull.yml b/.github/workflows/run-tests-pcov-pull.yml index 0fa82ceb9..38c961e84 100644 --- a/.github/workflows/run-tests-pcov-pull.yml +++ b/.github/workflows/run-tests-pcov-pull.yml @@ -88,7 +88,7 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run Unit Tests - run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Unit Test Suite" --cache-directory=".phpunit.cache/code-coverage" --strict-coverage --coverage-clover ./coverage.xml + run: php ./vendor/bin/phpunit --cache-directory=".phpunit.cache/code-coverage" --strict-coverage --coverage-clover ./coverage.xml --testsuite "Laravel Livewire Tables Unit Test Suite","Laravel Livewire Tables Visuals Test Suite" - name: Upload coverage reports to Codecov uses: codecov/codecov-action@v5 diff --git a/.github/workflows/run-tests-pull.yml b/.github/workflows/run-tests-pull.yml index 3d81e3b8c..1ea6334be 100644 --- a/.github/workflows/run-tests-pull.yml +++ b/.github/workflows/run-tests-pull.yml @@ -11,10 +11,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: fail-fast: false - max-parallel: 3 + max-parallel: 2 matrix: os: [ubuntu-latest] - php: [8.1, 8.2, 8.3, 8.4] + php: [8.2, 8.3, 8.4] laravel: [10.*] stability: [prefer-dist] @@ -85,8 +85,10 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run Unit Tests - run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + - name: Run Visuals Tests + run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage test-laravel11: runs-on: ${{ matrix.os }} @@ -166,4 +168,7 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run Unit Tests - run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + + - name: Run Visuals Tests + run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 05ff871b9..21161009c 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,10 +13,10 @@ jobs: runs-on: ${{ matrix.os }} strategy: fail-fast: false - max-parallel: 3 + max-parallel: 2 matrix: os: [ubuntu-24.04] - php: [8.1, 8.2, 8.3, 8.4] + php: [8.2, 8.3, 8.4] laravel: [10.*] stability: [prefer-dist] @@ -87,8 +87,10 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run Unit Tests - run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + - name: Run Visuals Tests + run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage test-laravel11: runs-on: ${{ matrix.os }} @@ -168,4 +170,7 @@ jobs: run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - name: Run Unit Tests - run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + run: php ./vendor/bin/paratest --testsuite "Laravel Livewire Tables Unit Test Suite" --no-coverage + + - name: Run Visuals Tests + run: php ./vendor/bin/phpunit --testsuite "Laravel Livewire Tables Visuals Test Suite" --no-coverage diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a6bf1d2a..deb5a8ab2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,46 @@ All notable changes to `laravel-livewire-tables` will be documented in this file + +## [v3.6.0] - UNRELEASED + +### Bug Fixes +- Ensure Default Sorting Is Shown in Pills by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2138 +- Filters + - Find Filters Before Query by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2143 + - Migrate Filter Code Appropriately by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2146 + - Migrate Filter Status into Own Trait by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2147 + +### Tweaks +- Enable InputAttributes for SelectFilter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2133 +- Tidy ComponentUtilities, Migrate ColumnSelectQueryString by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2135 +- TH Fixes - Clean-up, efficiency, and Sort Icons fixes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2140 +- Add hasCollapsedColumns as Computed by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2141 +- Tidy up Blade Class Definitions by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2145 +- Tidy ColumnSelectHelpers & displayToolbarFilters Method by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2150 +- Tidy & Improve Collapsed Columns Behaviour by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2159 +- Tidy computed properties behaviour by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2160 +- WithSearch Tweaks by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2163 +- Optimize Header/Footer by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2164 +- Clean up Column Component View and Slot behaviours by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2169 +- Adjustments for ComponentColumn - cleaning up behaviours by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2173 + +### Testing +- Add Missing Test for getCustomSortingPillDirectionsLabel with invalid direction by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2130 +- Add Custom FIlter Input Attributes, Cleanup Filter Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2131 +- Separate the Unit and Visuals Test Suites by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2144 +- Update PCOV Workflow by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2148 +- Add configurable area test by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2149 +- Add SortingConfiguration Missing Test by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2151 +- Add Missing Search Tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2152 +- Adjust SearchHelpersTest by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2153 +- Add test queryStringWithQueryString by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2154 +- Add missing tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2157 +- Add queryStringAliasTest by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2161 +- Migrate LivewireComponentColumn methods and add some missing basic tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2168 +- Add initial tests for LivewireComponentArrayFilter by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2170 +- Improve centralisation of tests by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2172 + ## [v3.5.10] - 2024-12-11 ### Tweaks - Migrate additional Styling into separate traits by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/2127 diff --git a/docs/filter-types/filters-number.md b/docs/filter-types/filters-number.md index 2bfba4404..78dd191a3 100644 --- a/docs/filter-types/filters-number.md +++ b/docs/filter-types/filters-number.md @@ -5,6 +5,27 @@ weight: 9 Number filters are just HTML number inputs. +```php +public function filters(): array +{ + return [ + NumberFilter::make('Amount') + ->filter(function(Builder $builder, string $value) { + $builder->where('amount', '<', $value); + }), + ]; +} +``` + +Historically, min/max/placeholders were set using the "config" option, which is still available. However, it is strongly recommended to use the new setInputAttributes for enhanced customisation. + +## Old Behaviour +The following would: +- Set a min of 0 +- Set a max of 100 +- Add a placeholder +- Keep the default colors & styling + ```php public function filters(): array { @@ -21,3 +42,28 @@ public function filters(): array ]; } ``` + +## New Behaviour +The following would: +- Set a min of 5 +- Set a max of 20 +- Set steps to be 0.5 +- Add a placeholder +- Keep the default colors & styling + +```php +public function filters(): array +{ + return [ + NumberFilter::make('Age') + ->setInputAttributes([ + 'min' => '5', // Minimum Value Accepted + 'max' => '20', // Maximum Value Accepted + 'step' => '0.5', // Set step + 'placeholder' => 'Enter Number 0 - 100', // A placeholder value + 'default-colors' => true, + 'default-styling' => true, + ]), + ]; +} +``` \ No newline at end of file diff --git a/docs/filters/available-filter-methods.md b/docs/filters/available-filter-methods.md index 6e17a63b4..9597372d4 100644 --- a/docs/filters/available-filter-methods.md +++ b/docs/filters/available-filter-methods.md @@ -208,6 +208,58 @@ TextFilter::make('Name') ), ``` +## setInputAttributes +Allows for customising the attributes that will apply to the input field for the filter. + +By default, this replaces the default classes on the Filter Input, if you would like to keep them, set the default-styling and/or default-colors flags to true. + +### TextFilter Example +The following would: +- Set a maxlength of 75 +- Set a placeholder of "Enter a Name" +- Replace the default colors +- Retain the default styling (e.g. rounding/shadow) + +```php +public function filters(): array +{ + return [ + TextFilter::make('Name') + ->setInputAttributes([ + 'maxlength' => '75', + 'placeholder' => 'Enter a Name', + 'class' => 'text-white bg-red-500 dark:bg-red-500', + 'default-colors' => false, + 'default-styling' => true, + ]), + ]; +} +``` + +### NumberFilter Example +The following would: +- Set a min of 5 +- Set a max of 20 +- Set steps to be 0.5 +- Keep the default colors & styling + +```php +public function filters(): array +{ + return [ + NumberFilter::make('Age') + ->setInputAttributes([ + 'min' => '5', + 'max' => '20', + 'step' => '0.5', + 'default-colors' => true, + 'default-styling' => 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 diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1d717c349..30d511e6d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -12,6 +12,9 @@ tests/Unit + + tests/Visuals + tests/Localisations/Unit diff --git a/resources/views/components/includes/actions.blade.php b/resources/views/components/includes/actions.blade.php index 035c8397a..f10f44af7 100644 --- a/resources/views/components/includes/actions.blade.php +++ b/resources/views/components/includes/actions.blade.php @@ -1,14 +1,16 @@
merge($this->getActionWrapperAttributes) - ->class(['flex flex-cols py-2 space-x-2' => $this->isTailwind && $this->getActionWrapperAttributes['default-styling'] ?? true]) - ->class(['' => $this->isTailwind && $this->getActionWrapperAttributes['default-colors'] ?? true]) - ->class(['d-flex flex-cols py-2 space-x-2' => $this->isBootstrap && $this->getActionWrapperAttributes['default-styling'] ?? true]) - ->class(['' => $this->isBootstrap && $this->getActionWrapperAttributes['default-colors'] ?? true]) - ->class(['justify-start' => $this->getActionsPosition === 'left']) - ->class(['justify-center' => $this->getActionsPosition === 'center']) - ->class(['justify-end' => $this->getActionsPosition === 'right']) - ->class(['pl-2' => $this->showActionsInToolbar && $this->getActionsPosition === 'left']) - ->class(['pr-2' => $this->showActionsInToolbar && $this->getActionsPosition === 'right']) + ->class([ + 'flex flex-cols py-2 space-x-2' => $this->isTailwind && ($this->getActionWrapperAttributes['default-styling'] ?? true), + '' => $this->isTailwind && ($this->getActionWrapperAttributes['default-colors'] ?? true), + 'd-flex flex-cols py-2 space-x-2' => $this->isBootstrap && ($this->getActionWrapperAttributes['default-styling'] ?? true), + '' => $this->isBootstrap && ($this->getActionWrapperAttributes['default-colors'] ?? true), + 'justify-start' => $this->getActionsPosition === 'left', + 'justify-center' => $this->getActionsPosition === 'center', + 'justify-end' => $this->getActionsPosition === 'right', + 'pl-2' => $this->showActionsInToolbar && $this->getActionsPosition === 'left', + 'pr-2' => $this->showActionsInToolbar && $this->getActionsPosition === 'right', + ]) ->except(['default','default-styling','default-colors']) }} > @foreach($this->getActions as $action) diff --git a/resources/views/components/includes/loading.blade.php b/resources/views/components/includes/loading.blade.php index ef88b43e8..c4c5c31e9 100644 --- a/resources/views/components/includes/loading.blade.php +++ b/resources/views/components/includes/loading.blade.php @@ -9,14 +9,18 @@ merge($loaderRow) - ->class(['hidden w-full text-center place-items-center align-middle' => $this->isTailwind && ($loaderRow['default'] ?? true)]) - ->class(['d-none w-100 text-center align-items-center' => $this->isBootstrap && ($loaderRow['default'] ?? true)]) + ->class([ + 'hidden w-full text-center place-items-center align-middle' => $this->isTailwind && ($loaderRow['default'] ?? true), + 'd-none w-100 text-center align-items-center' => $this->isBootstrap && ($loaderRow['default'] ?? true), + ]) ->except(['default','default-styling','default-colors']) }}> merge($loaderCell) - ->class(['py-4' => $this->isTailwind && ($loaderCell['default'] ?? true)]) - ->class(['py-4' => $this->isBootstrap && ($loaderCell['default'] ?? true)]) + ->class([ + 'py-4' => $this->isTailwind && ($loaderCell['default'] ?? true), + 'py-4' => $this->isBootstrap && ($loaderCell['default'] ?? true), + ]) ->except(['default','default-styling','default-colors', 'colspan','wire:key']) }}> @if($this->hasLoadingPlaceholderBlade()) @@ -25,8 +29,10 @@
merge($loaderIcon) - ->class(['lds-hourglass' => $this->isTailwind && ($loaderIcon['default'] ?? true)]) - ->class(['lds-hourglass' => $this->isBootstrap && ($loaderIcon['default'] ?? true)]) + ->class([ + 'lds-hourglass' => $this->isTailwind && ($loaderIcon['default'] ?? true), + 'lds-hourglass' => $this->isBootstrap && ($loaderIcon['default'] ?? true), + ]) ->except(['default','default-styling','default-colors']) }}>
{!! $this->getLoadingPlaceholderContent() !!}
diff --git a/resources/views/components/table.blade.php b/resources/views/components/table.blade.php index 87d0c3c05..a972275b0 100644 --- a/resources/views/components/table.blade.php +++ b/resources/views/components/table.blade.php @@ -13,7 +13,9 @@
merge($customAttributes['wrapper']) - ->class(['shadow overflow-y-auto border-b border-gray-200 dark:border-gray-700 sm:rounded-lg' => $customAttributes['wrapper']['default'] ?? true]) + ->class([ + 'shadow overflow-y-auto border-b border-gray-200 dark:border-gray-700 sm:rounded-lg' => $customAttributes['wrapper']['default'] ?? true + ]) ->except(['default','default-styling','default-colors']) }} > merge($customAttributes['thead']) - ->class(['bg-gray-50 dark:bg-gray-800' => $customAttributes['thead']['default'] ?? true]) + ->class([ + 'bg-gray-50 dark:bg-gray-800' => $customAttributes['thead']['default'] ?? true + ]) ->except(['default','default-styling','default-colors']) }} > @@ -37,7 +41,9 @@ wire:key="{{ $tableName }}-tbody" id="{{ $tableName }}-tbody" {{ $attributes->merge($customAttributes['tbody']) - ->class(['bg-white divide-y divide-gray-200 dark:bg-gray-800 dark:divide-none' => $customAttributes['tbody']['default'] ?? true]) + ->class([ + 'bg-white divide-y divide-gray-200 dark:bg-gray-800 dark:divide-none' => $customAttributes['tbody']['default'] ?? true + ]) ->except(['default','default-styling','default-colors']) }} > {{ $slot }} diff --git a/resources/views/components/table/collapsed-columns.blade.php b/resources/views/components/table/collapsed-columns.blade.php index f773bd8ae..e3ccbbd0a 100644 --- a/resources/views/components/table/collapsed-columns.blade.php +++ b/resources/views/components/table/collapsed-columns.blade.php @@ -1,75 +1,49 @@ @aware([ 'tableName', 'primaryKey','isTailwind','isBootstrap']) @props(['row', 'rowIndex']) -@php - $customAttributes = $this->getTrAttributes($row, $rowIndex); -@endphp - -@if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns()) - @php - $colspan = $this->getColspanCount(); - $columns = collect(); - - if($this->shouldCollapseAlways()) - { - $columns->push($this->getCollapsedAlwaysColumns()); - } - if ($this->shouldCollapseOnMobile() && $this->shouldCollapseOnTablet()) { - $columns->push($this->getCollapsedMobileColumns()); - $columns->push($this->getCollapsedTabletColumns()); - } elseif ($this->shouldCollapseOnTablet() && ! $this->shouldCollapseOnMobile()) { - $columns->push($this->getCollapsedTabletColumns()); - } elseif ($this->shouldCollapseOnMobile() && ! $this->shouldCollapseOnTablet()) { - $columns->push($this->getCollapsedMobileColumns()); - } - - $columns = $columns->collapse(); - @endphp - - collapsingColumnsAreEnabled && $this->hasCollapsedColumns) + @php($customAttributes = $this->getTrAttributes($row, $rowIndex)) + merge($customAttributes) - ->class(['hidden bg-white dark:bg-gray-700 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 === 0)]) - ->class(['hidden bg-gray-50 dark:bg-gray-800 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 !== 0)]) - ->class(['d-none bg-light rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 === 0 && ($customAttributes['default'] ?? true))]) - ->class(['d-none bg-white rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 !== 0 && ($customAttributes['default'] ?? true))]) + $attributes->merge([ + 'wire:loading.class.delay' => 'opacity-50 dark:bg-gray-900 dark:opacity-60', + 'wire:key' => $tableName.'-row-'.$row->{$primaryKey}.'-collapsed-contents', + ]) + ->merge($customAttributes) + ->class([ + 'hidden bg-white dark:bg-gray-700 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 === 0), + 'hidden bg-gray-50 dark:bg-gray-800 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 !== 0), + 'd-none bg-light rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 === 0 && ($customAttributes['default'] ?? true)), + 'd-none bg-white rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 !== 0 && ($customAttributes['default'] ?? true)), + ]) ->except(['default','default-styling','default-colors']) }} - > - - @elseif ($isBootstrap) - - @endif +@if ($this->collapsingColumnsAreEnabled && $this->hasCollapsedColumns) + @endif diff --git a/resources/views/components/table/td/plain.blade.php b/resources/views/components/table/td/plain.blade.php index 417f6c6b6..d47872a03 100644 --- a/resources/views/components/table/td/plain.blade.php +++ b/resources/views/components/table/td/plain.blade.php @@ -5,10 +5,12 @@ @if ($isTailwind) -@elseif ($isBootstrap) - -@endif + @endif + + @endunless + @endif + diff --git a/resources/views/components/table/th/bulk-actions.blade.php b/resources/views/components/table/th/bulk-actions.blade.php index d15f5a728..e99199e2f 100644 --- a/resources/views/components/table/th/bulk-actions.blade.php +++ b/resources/views/components/table/th/bulk-actions.blade.php @@ -1,20 +1,17 @@ -@aware([ 'tableName']) @php $customAttributes = $this->hasBulkActionsThAttributes ? $this->getBulkActionsThAttributes : $this->getAllThAttributes($this->getBulkActionsColumn())['customAttributes']; - $bulkActionsThCheckboxAttributes = $this->getBulkActionsThCheckboxAttributes(); - $theme = $this->getTheme(); @endphp @if ($this->bulkActionsAreEnabled() && $this->hasBulkActions()) - +
$theme === 'tailwind', - 'form-check' => $theme === 'bootstrap-5', + 'inline-flex rounded-md shadow-sm' => $this->isTailwind, + 'form-check' => $this->isBootstrap, ]) > merge($bulkActionsThCheckboxAttributes)->class([ - 'rounded border-gray-300 text-indigo-600 shadow-sm transition duration-150 ease-in-out focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600' => ($theme === 'tailwind') && ($bulkActionsThCheckboxAttributes['default'] ?? true), - 'form-check-input' => ($theme === 'bootstrap-5') && ($bulkActionsThCheckboxAttributes['default'] ?? true), + 'border-gray-300 text-indigo-600 focus:border-indigo-300 focus:ring-indigo-200 dark:bg-gray-900 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600 dark:focus:bg-gray-600' => $this->isTailwind && (($bulkActionsThCheckboxAttributes['default'] ?? true) || ($bulkActionsThCheckboxAttributes['default-colors'] ?? true)), + 'rounded shadow-sm transition duration-150 ease-in-out focus:ring focus:ring-opacity-50 ' => $this->isTailwind && (($bulkActionsThCheckboxAttributes['default'] ?? true) || ($bulkActionsThCheckboxAttributes['default-styling'] ?? true)), + 'form-check-input' => $this->isBootstrap && ($bulkActionsThCheckboxAttributes['default'] ?? true), ])->except(['default','default-styling','default-colors']) }} /> diff --git a/resources/views/components/table/th/collapsed-columns.blade.php b/resources/views/components/table/th/collapsed-columns.blade.php index eebc53e70..ad8a1860d 100644 --- a/resources/views/components/table/th/collapsed-columns.blade.php +++ b/resources/views/components/table/th/collapsed-columns.blade.php @@ -1,29 +1,15 @@ -@aware([ 'tableName','isTailwind','isBootstrap']) - -@if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns()) - @if ($isTailwind) -
- @elseif ($isBootstrap) - - @endif +@if ($this->collapsingColumnsAreEnabled && $this->hasCollapsedColumns) + @endif diff --git a/resources/views/components/table/th/label.blade.php b/resources/views/components/table/th/label.blade.php new file mode 100644 index 000000000..bafe25fdb --- /dev/null +++ b/resources/views/components/table/th/label.blade.php @@ -0,0 +1,4 @@ +@props(['columnTitle' => '', 'customLabelAttributes' => ['default' => true]]) +except(['default', 'default-colors', 'default-styling']) }}> + {{ $columnTitle }} + diff --git a/resources/views/components/table/th/plain.blade.php b/resources/views/components/table/th/plain.blade.php index 0b9c8326e..b15d56d0f 100644 --- a/resources/views/components/table/th/plain.blade.php +++ b/resources/views/components/table/th/plain.blade.php @@ -1,14 +1,11 @@ -@aware(['isTailwind','isBootstrap']) @props(['displayMinimisedOnReorder' => false, 'hideUntilReorder' => false, 'customAttributes' => ['default' => true]]) - diff --git a/resources/views/components/table/th/reorder.blade.php b/resources/views/components/table/th/reorder.blade.php index e4fe7cecb..a3b1f7e86 100644 --- a/resources/views/components/table/th/reorder.blade.php +++ b/resources/views/components/table/th/reorder.blade.php @@ -1,14 +1,16 @@ -@aware(['tableName','isTailwind','isBootstrap']) @php $customThAttributes = $this->hasReorderThAttributes() ? $this->getReorderThAttributes() : $this->getAllThAttributes($this->getReorderColumn())['customAttributes']; @endphp -merge($customThAttributes) - ->class(['text-gray-500 dark:bg-gray-800 dark:text-gray-400' => (($customThAttributes['default-colors'] ?? true) || ($customThAttributes['default'] ?? true))]) - ->class(['table-cell px-6 py-3 text-left text-xs font-medium whitespace-nowrap uppercase tracking-wider' => (($customThAttributes['default-styling'] ?? true) || ($customThAttributes['default'] ?? true))]) - ->class(['laravel-livewire-tables-reorderingMinimised' => ($isBootstrap) && ($customThAttributes['default'] ?? true)]) + ->class([ + 'table-cell px-6 py-3 text-left text-xs font-medium whitespace-nowrap uppercase tracking-wider' => $this->isTailwind && (($customThAttributes['default-styling'] ?? true) || ($customThAttributes['default'] ?? true)), + 'text-gray-500 dark:bg-gray-800 dark:text-gray-400' => $this->isTailwind && (($customThAttributes['default-colors'] ?? true) || ($customThAttributes['default'] ?? true)), + 'laravel-livewire-tables-reorderingMinimised' => $this->isBootstrap && ($customThAttributes['default'] ?? true), + ]) + ->except(['default','default-styling','default-colors']) }} >
diff --git a/resources/views/components/table/th/sort-icons.blade.php b/resources/views/components/table/th/sort-icons.blade.php index b26b7d964..f08cd3473 100644 --- a/resources/views/components/table/th/sort-icons.blade.php +++ b/resources/views/components/table/th/sort-icons.blade.php @@ -1,32 +1,79 @@ -@props(['direction']) -class([ +@props(['direction' => 'none', 'customIconAttributes']) + $this->isTailwind, 'relative d-flex align-items-center' => $this->isBootstrap - ]) }} + ]) > + @if($this->isTailwind) @switch($direction) @case('asc') - - - @break + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-100 group-hover:opacity-0', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-0 group-hover:opacity-100', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + @break @case('desc') - - - @break + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-100 group-hover:opacity-0', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-0 group-hover:opacity-100', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + + @break @default - - @endswitch + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-100 group-hover:opacity-0', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + merge($customIconAttributes) + ->class([ + 'w-3 h-3' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + 'absolute opacity-0 group-hover:opacity-100', + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> + @endswitch + + @else @switch($direction) @case('asc') - + merge($customIconAttributes) + ->class([ + 'laravel-livewire-tables-btn-smaller ms-1' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> @break @case('desc') - + merge($customIconAttributes) + ->class([ + 'laravel-livewire-tables-btn-smaller ms-1' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> @break @default - + merge($customIconAttributes) + ->class([ + 'laravel-livewire-tables-btn-smaller ms-1' => $customIconAttributes['default-styling'] ?? ($customIconAttributes['default'] ?? true), + ]) + ->except(['default', 'default-colors', 'default-styling', 'wire:key']) }} /> @endswitch @endif diff --git a/resources/views/components/table/tr.blade.php b/resources/views/components/table/tr.blade.php index 9f5f84b20..92ef2955e 100644 --- a/resources/views/components/table/tr.blade.php +++ b/resources/views/components/table/tr.blade.php @@ -22,11 +22,13 @@ loopType="{{ ($rowIndex % 2 === 0) ? 'even' : 'odd' }}" {{ $attributes->merge($customAttributes) - ->class(['bg-white dark:bg-gray-700 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 === 0)]) - ->class(['bg-gray-50 dark:bg-gray-800 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 !== 0)]) - ->class(['cursor-pointer' => ($isTailwind && $this->hasTableRowUrl() && ($customAttributes['default'] ?? true))]) - ->class(['bg-light rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 === 0 && ($customAttributes['default'] ?? true))]) - ->class(['bg-white rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 !== 0 && ($customAttributes['default'] ?? true))]) + ->class([ + 'bg-white dark:bg-gray-700 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 === 0), + 'bg-gray-50 dark:bg-gray-800 dark:text-white rappasoft-striped-row' => ($isTailwind && ($customAttributes['default'] ?? true) && $rowIndex % 2 !== 0), + 'cursor-pointer' => ($isTailwind && $this->hasTableRowUrl() && ($customAttributes['default'] ?? true)), + 'bg-light rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 === 0 && ($customAttributes['default'] ?? true)), + 'bg-white rappasoft-striped-row' => ($isBootstrap && $rowIndex % 2 !== 0 && ($customAttributes['default'] ?? true)), + ]) ->except(['default','default-styling','default-colors']) }} diff --git a/resources/views/components/table/tr/plain.blade.php b/resources/views/components/table/tr/plain.blade.php index f299b3c0a..ba7c3d695 100644 --- a/resources/views/components/table/tr/plain.blade.php +++ b/resources/views/components/table/tr/plain.blade.php @@ -4,8 +4,10 @@ @if ($isTailwind)
merge($customAttributes) - ->class(['bg-white dark:bg-gray-700 dark:text-white' => $customAttributes['default'] ?? true]) - ->class(['laravel-livewire-tables-reorderingMinimised']) + ->class([ + 'laravel-livewire-tables-reorderingMinimised', + 'bg-white dark:bg-gray-700 dark:text-white' => ($customAttributes['default'] ?? true), + ]) ->except(['default','default-styling','default-colors']) }} > @@ -14,8 +16,10 @@ @elseif ($isBootstrap) merge($customAttributes) - ->class(['' => $customAttributes['default'] ?? true]) - ->class(['laravel-livewire-tables-reorderingMinimised']) + ->class([ + 'laravel-livewire-tables-reorderingMinimised', + '' => $customAttributes['default'] ?? true, + ]) ->except(['default','default-styling','default-colors']) }} > diff --git a/resources/views/components/tools.blade.php b/resources/views/components/tools.blade.php index 38b80037c..ae652df20 100644 --- a/resources/views/components/tools.blade.php +++ b/resources/views/components/tools.blade.php @@ -3,8 +3,10 @@
merge() - ->class(['flex-col' => $isTailwind && ($toolsAttributes['default-styling'] ?? true)]) - ->class(['d-flex flex-column' => $isBootstrap && ($toolsAttributes['default-styling'] ?? true)]) + ->class([ + 'flex-col' => $isTailwind && ($toolsAttributes['default-styling'] ?? true), + 'd-flex flex-column' => $isBootstrap && ($toolsAttributes['default-styling'] ?? true) + ]) ->except(['default','default-styling','default-colors']) }} > diff --git a/resources/views/components/tools/filter-label.blade.php b/resources/views/components/tools/filter-label.blade.php index f6993c8f9..c7c69fb75 100644 --- a/resources/views/components/tools/filter-label.blade.php +++ b/resources/views/components/tools/filter-label.blade.php @@ -13,9 +13,11 @@ {{ $attributes->merge($customLabelAttributes)->merge($filterLabelAttributes) - ->class(['block text-sm font-medium leading-5 text-gray-700 dark:text-white' => $isTailwind && ($filterLabelAttributes['default'] ?? true)]) - ->class(['d-block' => $isBootstrap && $filterLayout === 'slide-down' && ($filterLabelAttributes['default'] ?? true)]) - ->class(['mb-2' => $isBootstrap && $filterLayout === 'popover' && ($filterLabelAttributes['default'] ?? true)]) + ->class([ + 'block text-sm font-medium leading-5 text-gray-700 dark:text-white' => $isTailwind && ($filterLabelAttributes['default'] ?? true), + 'd-block' => $isBootstrap && $filterLayout === 'slide-down' && ($filterLabelAttributes['default'] ?? true), + 'mb-2' => $isBootstrap && $filterLayout === 'popover' && ($filterLabelAttributes['default'] ?? true), + ]) ->except(['default', 'default-colors', 'default-styling']) }} diff --git a/resources/views/components/tools/filters/boolean.blade.php b/resources/views/components/tools/filters/boolean.blade.php index abc983581..759400e13 100644 --- a/resources/views/components/tools/filters/boolean.blade.php +++ b/resources/views/components/tools/filters/boolean.blade.php @@ -7,14 +7,15 @@ -
$isTailwind, 'text-start pt-3 p-2' => $isBootstrap, - ]) - colspan="{{ $colspan }}" - > + ])>
- @foreach($columns as $colIndex => $column) - @continue($column->isHidden()) - @continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column)) - -

$isTailwind && $column->shouldCollapseAlways(), - 'block mb-2 sm:hidden' => $isTailwind && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && !$column->shouldCollapseOnMobile(), - 'block mb-2 md:hidden' => $isTailwind && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && $column->shouldCollapseOnMobile(), - 'block mb-2 lg:hidden' => $isTailwind && !$column->shouldCollapseAlways() && ($column->shouldCollapseOnTablet() || $column->shouldCollapseOnMobile()), - - 'd-block mb-2' => $isBootstrap && $column->shouldCollapseAlways(), - 'd-block mb-2 d-sm-none' => $isBootstrap && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && !$column->shouldCollapseOnMobile(), - 'd-block mb-2 d-md-none' => $isBootstrap && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && $column->shouldCollapseOnMobile(), - 'd-block mb-2 d-lg-none' => $isBootstrap && !$column->shouldCollapseAlways() && ($column->shouldCollapseOnTablet() || $column->shouldCollapseOnMobile()), - - ]) - > - {{ $column->getTitle() }}: {{ $column->renderContents($row) }} + @foreach($this->getCollapsedColumnsForContent as $colIndex => $column) + +

$isTailwind, + 'sm:block' => $isTailwind && $column->shouldCollapseAlways(), + 'sm:block md:hidden' => $isTailwind && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && $column->shouldCollapseOnMobile(), + 'sm:block lg:hidden' => $isTailwind && !$column->shouldCollapseAlways() && ($column->shouldCollapseOnTablet() || $column->shouldCollapseOnMobile()), + + 'd-block mb-2' => $isBootstrap, + 'd-sm-none' => $isBootstrap && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && !$column->shouldCollapseOnMobile(), + 'd-md-none' => $isBootstrap && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && $column->shouldCollapseOnMobile(), + 'd-lg-none' => $isBootstrap && !$column->shouldCollapseAlways() && ($column->shouldCollapseOnTablet() || $column->shouldCollapseOnMobile()), + ])> + {{ $column->getTitle() }}: + @if($column->isHtml()) + {!! $column->setIndexes($rowIndex, $colIndex)->renderContents($row) !!} + @else + {{ $column->setIndexes($rowIndex, $colIndex)->renderContents($row) }} + @endif

@endforeach
diff --git a/resources/views/components/table/td.blade.php b/resources/views/components/table/td.blade.php index 546bf33fe..9fae459d3 100644 --- a/resources/views/components/table/td.blade.php +++ b/resources/views/components/table/td.blade.php @@ -13,15 +13,17 @@ @endif {{ $attributes->merge($customAttributes) - ->class(['px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $isTailwind && ($customAttributes['default'] ?? true)]) - ->class(['hidden' => $isTailwind && $column && $column->shouldCollapseAlways()]) - ->class(['hidden md:table-cell' => $isTailwind && $column && $column->shouldCollapseOnMobile()]) - ->class(['hidden lg:table-cell' => $isTailwind && $column && $column->shouldCollapseOnTablet()]) - ->class(['' => $isBootstrap && ($customAttributes['default'] ?? true)]) - ->class(['d-none' => $isBootstrap && $column && $column->shouldCollapseAlways()]) - ->class(['d-none d-md-table-cell' => $isBootstrap && $column && $column->shouldCollapseOnMobile()]) - ->class(['d-none d-lg-table-cell' => $isBootstrap && $column && $column->shouldCollapseOnTablet()]) - ->class(['laravel-livewire-tables-cursor' => $isBootstrap && $column && $column->isClickable()]) + ->class([ + 'px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $isTailwind && ($customAttributes['default'] ?? true), + 'hidden' => $isTailwind && $column && $column->shouldCollapseAlways(), + 'hidden md:table-cell' => $isTailwind && $column && $column->shouldCollapseOnMobile(), + 'hidden lg:table-cell' => $isTailwind && $column && $column->shouldCollapseOnTablet(), + '' => $isBootstrap && ($customAttributes['default'] ?? true), + 'd-none' => $isBootstrap && $column && $column->shouldCollapseAlways(), + 'd-none d-md-table-cell' => $isBootstrap && $column && $column->shouldCollapseOnMobile(), + 'd-none d-lg-table-cell' => $isBootstrap && $column && $column->shouldCollapseOnTablet(), + 'laravel-livewire-tables-cursor' => $isBootstrap && $column && $column->isClickable(), + ]) ->except(['default','default-styling','default-colors']) }} > diff --git a/resources/views/components/table/td/collapsed-columns.blade.php b/resources/views/components/table/td/collapsed-columns.blade.php index 3bf65e170..078c1e39b 100644 --- a/resources/views/components/table/td/collapsed-columns.blade.php +++ b/resources/views/components/table/td/collapsed-columns.blade.php @@ -1,82 +1,52 @@ @aware([ 'tableName','isTailwind','isBootstrap']) @props(['rowIndex', 'hidden' => false]) -@if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns()) - @if ($isTailwind) -
merge(['class' => 'p-3 table-cell text-center ']) - ->class(['sm:hidden' => !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet()]) - ->class(['md:hidden' => !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet() && $this->shouldCollapseOnMobile()]) - ->class(['lg:hidden' => !$this->shouldCollapseAlways() && ($this->shouldCollapseOnTablet() || $this->shouldCollapseOnMobile())]) - }} - :class="currentlyReorderingStatus ? 'laravel-livewire-tables-reorderingMinimised' : ''" - > - @if (! $hidden) - - @endif - class(['d-sm-none' => !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet()]) - ->class(['d-md-none' => !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet() && $this->shouldCollapseOnMobile()]) - ->class(['d-lg-none' => !$this->shouldCollapseAlways() && ($this->shouldCollapseOnTablet() || $this->shouldCollapseOnMobile())]) - }} - :class="currentlyReorderingStatus ? 'laravel-livewire-tables-reorderingMinimised' : ''" - > - @if (! $hidden) - - @endif - merge() + ->class([ + 'p-3 table-cell text-center' => $isTailwind, + 'sm:hidden' => $isTailwind && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet(), + 'md:hidden' => $isTailwind && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet() && $this->shouldCollapseOnMobile(), + 'lg:hidden' => $isTailwind && !$this->shouldCollapseAlways() && ($this->shouldCollapseOnTablet() || $this->shouldCollapseOnMobile()), + 'd-sm-none' => $isBootstrap && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet(), + 'd-md-none' => $isBootstrap && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet() && $this->shouldCollapseOnMobile(), + 'd-lg-none' => $isBootstrap && !$this->shouldCollapseAlways() && ($this->shouldCollapseOnTablet() || $this->shouldCollapseOnMobile()), + ]) + }} + :class="currentlyReorderingStatus ? 'laravel-livewire-tables-reorderingMinimised' : ''" + > + @if (! $hidden) + + @endif + merge($customAttributes) - ->class(['px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $customAttributes['default'] ?? true]) - ->class(['hidden' => $column && $column->shouldCollapseAlways()]) - ->class(['hidden md:table-cell' => $column && $column->shouldCollapseOnMobile()]) - ->class(['hidden lg:table-cell' => $column && $column->shouldCollapseOnTablet()]) + ->class([ + 'px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $customAttributes['default'] ?? true, + 'hidden' => $column && $column->shouldCollapseAlways(), + 'hidden md:table-cell' => $column && $column->shouldCollapseOnMobile(), + 'hidden lg:table-cell' => $column && $column->shouldCollapseOnTablet(), + ]) ->except(['default','default-styling','default-colors']) }} @if($hideUntilReorder) x-show="reorderDisplayColumn" @endif > {{ $slot }} @@ -16,10 +18,12 @@ @elseif ($isBootstrap) merge($customAttributes) - ->class(['' => $customAttributes['default'] ?? true]) - ->class(['d-none' => $column && $column->shouldCollapseAlways()]) - ->class(['d-none d-md-table-cell' => $column && $column->shouldCollapseOnMobile()]) - ->class(['d-none d-lg-table-cell' => $column && $column->shouldCollapseOnTablet()]) + ->class([ + '' => $customAttributes['default'] ?? true, + 'd-none' => $column && $column->shouldCollapseAlways(), + 'd-none d-md-table-cell' => $column && $column->shouldCollapseOnMobile(), + 'd-none d-lg-table-cell' => $column && $column->shouldCollapseOnTablet(), + ]) ->except(['default','default-styling','default-colors']) }}> {{ $slot }} diff --git a/resources/views/components/table/th.blade.php b/resources/views/components/table/th.blade.php index 525833fe7..db8c0da4d 100644 --- a/resources/views/components/table/th.blade.php +++ b/resources/views/components/table/th.blade.php @@ -1,90 +1,60 @@ -@aware([ 'tableName','isTailwind','isBootstrap']) @props(['column', 'index']) @php - $attributes = $attributes->merge(['wire:key' => $tableName . '-header-col-'.$column->getSlug()]); $allThAttributes = $this->getAllThAttributes($column); - $customThAttributes = $allThAttributes['customAttributes']; $customSortButtonAttributes = $allThAttributes['sortButtonAttributes']; - $customSortIconAttributes = $allThAttributes['sortIconAttributes']; $customLabelAttributes = $allThAttributes['labelAttributes']; - - //$customThAttributes = $this->getThAttributes($column); - //$customSortButtonAttributes = $this->getThSortButtonAttributes($column); - //$customSortIconAttributes = $this->getThSortIconAttributes($column); - - $direction = $column->hasField() ? $this->getSort($column->getColumnSelectName()) : $this->getSort($column->getSlug()) ?? null ; + $customIconAttributes = $this->getThSortIconAttributes($column); + $direction = $column->hasField() ? $this->getSort($column->getColumnSelectName()) : $this->getSort($column->getSlug()) ?? null; @endphp -@if ($isTailwind) - merge($customThAttributes) - ->class(['text-gray-500 dark:bg-gray-800 dark:text-gray-400' => (($customThAttributes['default-colors'] ?? true) || ($customThAttributes['default'] ?? true))]) - ->class(['px-6 py-3 text-left text-xs font-medium whitespace-nowrap uppercase tracking-wider' => (($customThAttributes['default-styling'] ?? true) || ($customThAttributes['default'] ?? true))]) - ->class(['hidden' => $column->shouldCollapseAlways()]) - ->class(['hidden md:table-cell' => $column->shouldCollapseOnMobile()]) - ->class(['hidden lg:table-cell' => $column->shouldCollapseOnTablet()]) - ->except(['default', 'default-colors', 'default-styling']) - }} - > - @if($column->getColumnLabelStatus()) - @unless ($this->sortingIsEnabled() && ($column->isSortable() || $column->getSortCallback())) - except(['default', 'default-colors', 'default-styling']) }}>{{ $column->getTitle() }} - @else - - @endunless - @endif - merge($customThAttributes) - ->class(['' => $customThAttributes['default'] ?? true]) - ->class(['d-none' => $column->shouldCollapseAlways()]) - ->class(['d-none d-md-table-cell' => $column->shouldCollapseOnMobile()]) - ->class(['d-none d-lg-table-cell' => $column->shouldCollapseOnTablet()]) - ->except(['default','default-styling','default-colors']) - }} - > - @if($column->getColumnLabelStatus()) - @unless ($this->sortingIsEnabled() && ($column->isSortable() || $column->getSortCallback())) - except(['default', 'default-colors', 'default-styling']) }}>{{ $column->getTitle() }} - @else -
isBootstrap) +
merge($customSortButtonAttributes) - ->class(['' => (($customSortButtonAttributes['default-styling'] ?? true) || ($customSortButtonAttributes['default'] ?? true))]) + ->class([ + 'd-flex align-items-center laravel-livewire-tables-cursor' => (($customSortButtonAttributes['default-styling'] ?? true) || ($customSortButtonAttributes['default'] ?? true)) + ]) ->except(['default', 'default-colors', 'default-styling', 'wire:key']) - }} - > - except(['default', 'default-colors', 'default-styling']) }}>{{ $column->getTitle() }} + }}> + + - merge($customSortButtonAttributes) - ->class(['' => (($customSortButtonAttributes['default-colors'] ?? true) || ($customSortButtonAttributes['default'] ?? true))]) - ->except(['default', 'default-colors', 'default-styling', 'wire:key']) - }} - />
- @endunless - @endif -
merge(['class' => 'table-cell dark:bg-gray-800 laravel-livewire-tables-reorderingMinimised']) - ->class(['sm:hidden' => !$this->shouldCollapseOnTablet() && !$this->shouldCollapseAlways()]) - ->class(['md:hidden' => !$this->shouldCollapseOnMobile() && !$this->shouldCollapseOnTablet() && !$this->shouldCollapseAlways()]) - ->class(['lg:hidden' => !$this->shouldCollapseAlways()]) - }} - :class="{ 'laravel-livewire-tables-reorderingMinimised': ! currentlyReorderingStatus }" - >merge(['class' => 'd-table-cell laravel-livewire-tables-reorderingMinimised']) - ->class(['d-sm-none' => !$this->shouldCollapseOnTablet() && !$this->shouldCollapseAlways()]) - ->class(['d-md-none' => !$this->shouldCollapseOnMobile() && !$this->shouldCollapseOnTablet() && !$this->shouldCollapseAlways()]) - ->class(['d-lg-none' => !$this->shouldCollapseAlways()]) - }} - :class="{ 'laravel-livewire-tables-reorderingMinimised': ! currentlyReorderingStatus }" - >merge() + ->class([ + 'table-cell dark:bg-gray-800 laravel-livewire-tables-reorderingMinimised' => $this->isTailwind, + 'sm:hidden' => $this->isTailwind && !$this->shouldCollapseOnTablet && !$this->shouldCollapseAlways, + 'md:hidden' => $this->isTailwind && !$this->shouldCollapseOnMobile && !$this->shouldCollapseOnTablet && !$this->shouldCollapseAlways, + 'lg:hidden' => $this->isTailwind && !$this->shouldCollapseAlways, + 'd-table-cell laravel-livewire-tables-reorderingMinimised' => $this->isBootstrap, + 'd-sm-none' => $this->isBootstrap && !$this->shouldCollapseOnTablet && !$this->shouldCollapseAlways, + 'd-md-none' => $this->isBootstrap && !$this->shouldCollapseOnMobile && !$this->shouldCollapseOnTablet && !$this->shouldCollapseAlways, + 'd-lg-none' => $this->isBootstrap && !$this->shouldCollapseAlways, + ]) + }}>merge($customAttributes)->class([ - 'table-cell px-3 py-2 md:px-6 md:py-3 text-center md:text-left bg-gray-50 dark:bg-gray-800 laravel-livewire-tables-reorderingMinimised' => ($isTailwind) && (($customAttributes['default-colors'] ?? true) || ($customAttributes['default'] ?? true)), - 'laravel-livewire-tables-reorderingMinimised' => ($isBootstrap) && (($customAttributes['default-colors'] ?? true) || ($customAttributes['default'] ?? true)), - ]) - }} - @if($hideUntilReorder) :class="!reorderDisplayColumn && 'w-0 p-0 hidden'" @endif -> + 'table-cell px-3 py-2 md:px-6 md:py-3 text-center md:text-left laravel-livewire-tables-reorderingMinimised' => $this->isTailwind && (($customAttributes['default-styling'] ?? true) || ($customAttributes['default'] ?? true)), + 'bg-gray-50 dark:bg-gray-800' => $this->isTailwind && (($customAttributes['default-colors'] ?? true) || ($customAttributes['default'] ?? true)), + 'laravel-livewire-tables-reorderingMinimised' => $this->isBootstrap && (($customAttributes['default-colors'] ?? true) || ($customAttributes['default'] ?? true)), + ])->except(['default','default-styling','default-colors']) +}}> {{ $slot }}