diff --git a/.github/workflows/phpstan.yml b/.github/workflows/phpstan.yml index 856c1c7..9908ea3 100644 --- a/.github/workflows/phpstan.yml +++ b/.github/workflows/phpstan.yml @@ -16,7 +16,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: [8.3, 8.4] + php-version: [8.2, 8.3, 8.4, 8.5] coverage: none - name: Install composer dependencies diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 03d8632..58dae74 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -13,9 +13,18 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - php: [8.3, 8.4] - laravel: [9.*] + php: [8.2, 8.3, 8.4, 8.5] + laravel: [11.*, 12.*] stability: [prefer-lowest, prefer-stable] + exclude: + - laravel: 11.* + stability: prefer-lowest + - laravel: 12.* + stability: prefer-lowest + - laravel: 11.* + php: 8.5 + - php: 8.2 + stability: prefer-lowest name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }} @@ -41,5 +50,5 @@ jobs: composer update --${{ matrix.stability }} --prefer-dist --no-interaction - name: Execute tests - run: vendor/bin/pest --ci + run: vendor/bin/pest --no-coverage -vv --ci diff --git a/.github/workflows/x-ray.yml b/.github/workflows/x-ray.yml index b6f029f..b51a3ed 100644 --- a/.github/workflows/x-ray.yml +++ b/.github/workflows/x-ray.yml @@ -16,7 +16,7 @@ jobs: - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: [8.3, 8.4] + php-version: [8.2, 8.3, 8.4, 8.5] coverage: none - name: Install composer dependencies diff --git a/README.md b/README.md index 0e120e7..c69fbde 100644 --- a/README.md +++ b/README.md @@ -45,54 +45,6 @@ Optionally, you can publish the views using php artisan vendor:publish --tag="wired-tables-views" ``` - -## Tailwind configuration - -In order to keep wired tables tailwind classes, add this to your `tailwind.config.js`: - -```js -module.exports = { - content: [ - //... - './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php', - './vendor/wire-elements/modal/resources/views/*.blade.php', - //... - ], - theme: { - extend: {}, - }, - plugins: [], - prefix: 'tw-', - corePlugins: { - preflight: false, - } -} -``` - -### Using tailwind along with other frameworks (i.e. bootstrap) - -set `style = tailwind_3_prefixed` config in `configs/wired-tables.php` (see above for info on how to publish config file) - -and add these to your `tailwind.config.js`: - -```js -module.exports = { - content: [ - //... - './vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php', - './vendor/wire-elements/modal/resources/views/*.blade.php', - ], - - //... - - prefix: 'tw-', - corePlugins: { - //... - preflight: false, - } -} -``` - ## Usage ```php diff --git a/composer.json b/composer.json index 685f03f..9c4eb9b 100644 --- a/composer.json +++ b/composer.json @@ -16,26 +16,25 @@ } ], "require": { - "php": "^8.3|8.4", - "spatie/laravel-package-tools": "^1.9.2", - "illuminate/contracts": "^9.0|^10.0", - "illuminate/database": "^9.0|^10.0", - "livewire/livewire": "^2.5" + "php": "^8.2", + "spatie/laravel-package-tools": "^1.19.0", + "illuminate/contracts": "^11.0|^12.0", + "illuminate/database": "^11.0|^12.0", + "livewire/livewire": "^3.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^v3.1", - "nunomaduro/collision": "^6.0|^7.0", - "nunomaduro/larastan": "^2.0.1", - "orchestra/testbench": "^6.22|^v7.1|^8.0", - "pestphp/pest": "^1.21", - "pestphp/pest-plugin-laravel": "^1.1", - "phpstan/extension-installer": "^1.1", - "phpstan/phpstan-deprecation-rules": "^1.0", - "phpstan/phpstan-phpunit": "^1.0", - "phpunit/phpunit": "^9.5|^10.0", - "spatie/invade": "^1.1", - "spatie/laravel-ray": "^1.26", - "spatie/pest-plugin-snapshots": "^1.1", + "nunomaduro/collision": "^8.8.3", + "nunomaduro/larastan": "^2.0 | ^3.0", + "orchestra/testbench": "^9.0 | ^10.0", + "pestphp/pest": "^3.0 | ^4.0", + "pestphp/pest-plugin-laravel": "^3.0 | ^4.0", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan-deprecation-rules": "^2.0.3", + "phpstan/phpstan-phpunit": "^2.0.11", + "spatie/invade": "^2.1", + "spatie/laravel-ray": "^1.43", + "spatie/pest-plugin-snapshots": "^2.2.1", "spatie/x-ray": "dev-main" }, "autoload": { @@ -53,7 +52,7 @@ "lint": "PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix -v", "test:lint": "PHP_CS_FIXER_IGNORE_ENV=1 vendor/bin/php-cs-fixer fix -v --dry-run", "test:types": "vendor/bin/phpstan analyse --ansi", - "test:unit": "vendor/bin/pest --colors=always --exclude-group=sandbox", + "test:unit": "vendor/bin/pest --no-coverage --colors=always --exclude-group=sandbox", "test": [ "@test:lint", "@test:types", diff --git a/resources/views/tailwind_3/components/actions.blade.php b/resources/views/tailwind_3/components/actions.blade.php index 7c353d7..d66558e 100644 --- a/resources/views/tailwind_3/components/actions.blade.php +++ b/resources/views/tailwind_3/components/actions.blade.php @@ -9,9 +9,9 @@ @php($visibleActions = collect($this->actions)->filter(fn(DefStudio\WiredTables\Elements\Action $action) => $action->isVisible())) @if($this->config(\DefStudio\WiredTables\Enums\Config::group_actions)) -
class('relative')}} wire:key="wt-{{$this->id}}-actions-wrapper" x-data="{show_actions: false}"> +
class('relative')}} wire:key="wt-{{$this->getId()}}-actions-wrapper" x-data="{show_actions: false}"> -
@foreach($action_group as $index => $action) -
- @@ -44,11 +44,11 @@ class="bg-transparent border focus-visible:outline-0 border-solid p-2 whitespace
@else -
class('flex')}} wire:key="wt-{{$this->id}}-actions-wrapper"> +
class('flex')}} wire:key="wt-{{$this->getId()}}-actions-wrapper"> @foreach($visibleActions as $index => $action) -
- diff --git a/resources/views/tailwind_3/components/body/rows-selector.blade.php b/resources/views/tailwind_3/components/body/rows-selector.blade.php index 7499cb4..54f0bf6 100644 --- a/resources/views/tailwind_3/components/body/rows-selector.blade.php +++ b/resources/views/tailwind_3/components/body/rows-selector.blade.php @@ -15,11 +15,11 @@ @props(['model']) @if($this->shouldShowRowsSelector()) - class(['pl-6 py-3 text-left'])}} > - @endif diff --git a/resources/views/tailwind_3/components/body/td.blade.php b/resources/views/tailwind_3/components/body/td.blade.php index c8edf19..378c192 100644 --- a/resources/views/tailwind_3/components/body/td.blade.php +++ b/resources/views/tailwind_3/components/body/td.blade.php @@ -13,7 +13,7 @@ $content = $column->render(); $attributes = $attributes->merge([ - 'wire:key' => "wt-$this->id-row-{$this->getRowId($model)}-cell" + 'wire:key' => "wt-{$this->getId()}-row-{$this->getRowId($model)}-cell" ])->class([ "px-2 py-1" => $this->config(\DefStudio\WiredTables\Enums\Config::compact_table), "px-6 py-3" => !$this->config(\DefStudio\WiredTables\Enums\Config::compact_table), @@ -42,7 +42,7 @@ @props(['column', 'model']) - + @if($url = $column->getUrl()) get(\DefStudio\WiredTables\Enums\Config::url_target)) ? "target='$url_target'": ''}}> diff --git a/resources/views/tailwind_3/components/body/tr.blade.php b/resources/views/tailwind_3/components/body/tr.blade.php index 90aa78b..ae56bed 100644 --- a/resources/views/tailwind_3/components/body/tr.blade.php +++ b/resources/views/tailwind_3/components/body/tr.blade.php @@ -14,7 +14,7 @@ @props(['model']) class([ 'bg-white' => !$this->config(\DefStudio\WiredTables\Enums\Config::striped), 'odd:bg-white even:bg-gray-50' => $this->config(\DefStudio\WiredTables\Enums\Config::striped), diff --git a/resources/views/tailwind_3/components/elements/filters/checkbox.blade.php b/resources/views/tailwind_3/components/elements/filters/checkbox.blade.php index eaa929a..b00ceef 100644 --- a/resources/views/tailwind_3/components/elements/filters/checkbox.blade.php +++ b/resources/views/tailwind_3/components/elements/filters/checkbox.blade.php @@ -9,19 +9,19 @@ @props(['filter', 'label' => true]) -
+
@if($label) - @endif - id}}-filter-{{$filter->key()}}-wrapper" {{$attributes}}> +
@if($label) - @endif - id}}-filter-{{$filter->key()}}-wrapper" {{$attributes}}> +
@if($label) - @endif - id}}-filters-wrapper" x-data="{show: false}"> +
class('relative')}} wire:key="wt-{{$this->getId()}}-filters-wrapper" x-data="{show: false}"> -
@foreach($filter_group as $filter) -
+
id}}-filters-wrapper"> +
class('flex')}} wire:key="wt-{{$this->getId()}}-filters-wrapper"> @foreach($visibleFilters as $filter) + {{$this->getColumnSum($column->name())}} diff --git a/resources/views/tailwind_3/components/header/rows-selector.blade.php b/resources/views/tailwind_3/components/header/rows-selector.blade.php index 8d69a64..8d41b14 100644 --- a/resources/views/tailwind_3/components/header/rows-selector.blade.php +++ b/resources/views/tailwind_3/components/header/rows-selector.blade.php @@ -12,7 +12,7 @@ @if($this->shouldShowRowsSelector()) class([ "px-6 text-left align-middle", "py-3" => !$this->shouldShowColumnFilters(), @@ -26,6 +26,6 @@ $this->allSelected = true; } ?> - + @endif diff --git a/resources/views/tailwind_3/components/page-size-selector.blade.php b/resources/views/tailwind_3/components/page-size-selector.blade.php index e2aeebf..19ff383 100644 --- a/resources/views/tailwind_3/components/page-size-selector.blade.php +++ b/resources/views/tailwind_3/components/page-size-selector.blade.php @@ -9,7 +9,7 @@ ?> @if($availablePageSize && count($availablePageSize)>1) - class("bg-transparent border focus-visible:outline-0 border-solid px-2 pr-7 py-2 border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md shadow-sm text-sm text-gray-700 cursor-pointer")}} wire:model.live="pageSize"> @foreach($availablePageSize as $availPagSize) @endforeach diff --git a/resources/views/tailwind_3/components/pagination.blade.php b/resources/views/tailwind_3/components/pagination.blade.php index d5b7232..6a22272 100644 --- a/resources/views/tailwind_3/components/pagination.blade.php +++ b/resources/views/tailwind_3/components/pagination.blade.php @@ -15,7 +15,7 @@ @endif
- +
diff --git a/resources/views/tailwind_3/components/search.blade.php b/resources/views/tailwind_3/components/search.blade.php index 4158626..b705768 100644 --- a/resources/views/tailwind_3/components/search.blade.php +++ b/resources/views/tailwind_3/components/search.blade.php @@ -15,12 +15,12 @@
-
diff --git a/resources/views/tailwind_3/components/top.blade.php b/resources/views/tailwind_3/components/top.blade.php index 1284a46..cd3299b 100644 --- a/resources/views/tailwind_3/components/top.blade.php +++ b/resources/views/tailwind_3/components/top.blade.php @@ -6,15 +6,15 @@ ?>
- + -
+
@if($this->activeFilters()->isNotEmpty())
Filters:
@foreach($this->activeFilters() as $filter) -
@@ -32,7 +32,7 @@ class="font-medium ml-1 px-1 py-0.5 text-xs text-indigo-600 bg-indigo-200 hover:
Sort:
@foreach($this->sorting as $columnName => $dir) -
@@ -56,7 +56,7 @@ class="font-medium ml-1 px-1 py-0.5 text-xs text-indigo-600 bg-indigo-200 hover:
- +
diff --git a/resources/views/tailwind_3/livewire-pagination.blade.php b/resources/views/tailwind_3/livewire-pagination.blade.php index b0af906..4d27051 100644 --- a/resources/views/tailwind_3/livewire-pagination.blade.php +++ b/resources/views/tailwind_3/livewire-pagination.blade.php @@ -1,7 +1,5 @@
@if ($paginator->hasPages()) - @php(isset($this->numberOfPaginatorsRendered[$paginator->getPageName()]) ? $this->numberOfPaginatorsRendered[$paginator->getPageName()]++ : $this->numberOfPaginatorsRendered[$paginator->getPageName()] = 1) -