Skip to content

Commit eaad8c7

Browse files
authored
Merge pull request #459 from rappasoft/develop
v1.15.0
2 parents 14c0725 + 44c2e82 commit eaad8c7

22 files changed

+187
-107
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
44

55
## [Unreleased]
66

7+
## [1.15.0] - 2021-09-19
8+
9+
### Added
10+
11+
- Dark styles for Tailwind
12+
13+
### Changed
14+
15+
- Minimum Livewire version to 2.6.2 to avoid 2.6.1 bug.
16+
- Remove our custom pagination as Livewire 2.6 supports multiple pagination per page now.
17+
718
## [1.14.0] - 2021-08-31
819

920
### Added
@@ -456,7 +467,8 @@ All notable changes to `laravel-livewire-tables` will be documented in this file
456467

457468
- Initial release
458469

459-
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.14.0...development
470+
[Unreleased]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.15.0...development
471+
[1.15.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.14.0...v1.15.0
460472
[1.14.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.13.0...v1.14.0
461473
[1.13.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.12.0...v1.13.0
462474
[1.12.0]: https://github.com/rappasoft/laravel-livewire-tables/compare/v1.11.0...v1.12.0

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
],
2020
"require": {
2121
"php": "^7.4|^8.0",
22-
"livewire/livewire": "^2.5.3",
22+
"livewire/livewire": "^2.6.2",
2323
"spatie/laravel-package-tools": "^1.4.3",
2424
"illuminate/contracts": "^8.0"
2525
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@props(['customAttributes' => []])
22

3-
<td {{ $attributes->merge(array_merge(['class' => 'px-3 py-2 md:px-6 md:py-4 whitespace-nowrap text-sm leading-5 text-gray-900'], $customAttributes)) }}>
3+
<td {{ $attributes->merge(array_merge(['class' => 'px-3 py-2 md:px-6 md:py-4 whitespace-nowrap text-sm leading-5 text-gray-900 dark:text-white'], $customAttributes)) }}>
44
{{ $slot }}
55
</td>

resources/views/tailwind/components/table/heading.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@
88
])
99

1010
<th
11-
{{ $attributes->merge(array_merge(['class' => 'px-3 py-2 md:px-6 md:py-3 bg-gray-50'], $customAttributes)) }}
11+
{{ $attributes->merge(array_merge(['class' => 'px-3 py-2 md:px-6 md:py-3 bg-gray-50 dark:bg-gray-800'], $customAttributes)) }}
1212
>
1313
@unless ($sortingEnabled && $sortable)
14-
<span class="block text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider">
14+
<span class="block text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider dark:text-gray-400">
1515
{{ $text ?? $slot }}
1616
</span>
1717
@else
1818
<button
1919
wire:click="sortBy('{{ $column }}', '{{ $text ?? $column }}')"
2020
{{ $attributes->except('class') }}
21-
class="flex items-center space-x-1 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider group focus:outline-none focus:underline"
21+
class="flex items-center space-x-1 text-left text-xs leading-4 font-medium text-gray-500 uppercase tracking-wider group focus:outline-none focus:underline dark:text-gray-400"
2222
>
2323
<span>{{ $text ?? $slot }}</span>
2424

resources/views/tailwind/components/table/table.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<div class="align-middle min-w-full overflow-x-auto shadow overflow-hidden rounded-none md:rounded-lg">
2-
<table {{ $attributes->except('wire:sortable') }} class="min-w-full divide-y divide-gray-200">
2+
<table {{ $attributes->except('wire:sortable') }} class="min-w-full divide-y divide-gray-200 dark:divide-none">
33
<thead>
44
<tr>
55
{{ $head }}
66
</tr>
77
</thead>
88

9-
<tbody {{ $attributes->only('wire:sortable') }} class="bg-white divide-y divide-gray-200">
9+
<tbody {{ $attributes->only('wire:sortable') }} class="bg-white divide-y divide-gray-200 dark:divide-none">
1010
{{ $body }}
1111
</tbody>
1212
</table>

resources/views/tailwind/includes/bulk-actions.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class="relative inline-block text-left z-10 w-full md:w-auto"
1111
<button
1212
x-on:click="open = !open"
1313
type="button"
14-
class="inline-flex justify-center w-full rounded-md border border-gray-300 px-4 py-2 bg-white text-sm leading-5 font-medium text-gray-700 hover:text-gray-500 focus:outline-none focus:border-indigo-300 focus:shadow-outline-indigo active:bg-gray-50 active:text-gray-800 transition ease-in-out duration-150"
14+
class="inline-flex justify-center w-full rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-sm font-medium text-gray-700 hover:bg-gray-50 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600"
1515
id="options-menu"
1616
aria-haspopup="true"
1717
x-bind:aria-expanded="open"
@@ -37,14 +37,14 @@ class="inline-flex justify-center w-full rounded-md border border-gray-300 px-4
3737
x-transition:leave-end="transform opacity-0 scale-95"
3838
class="origin-top-right absolute right-0 mt-2 w-full md:w-48 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-100 focus:outline-none z-50"
3939
>
40-
<div class="rounded-md bg-white shadow-xs">
40+
<div class="rounded-md bg-white shadow-xs dark:bg-gray-700 dark:text-white">
4141
<div class="py-1" role="menu" aria-orientation="vertical" aria-labelledby="options-menu">
4242
@foreach($bulkActions as $action => $title)
4343
<button
4444
wire:click="{{ $action }}"
4545
wire:key="bulk-action-{{ $action }}"
4646
type="button"
47-
class="block w-full px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900 flex items-center space-x-2"
47+
class="block w-full px-4 py-2 text-sm leading-5 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900 flex items-center space-x-2 dark:text-white dark:hover:bg-gray-600"
4848
role="menuitem"
4949
>
5050
<span>{{ $title }}</span>

resources/views/tailwind/includes/bulk-select-row.blade.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@if ($bulkActionsEnabled && count($bulkActions) && (($selectPage && $rows->total() > $rows->count()) || count($selected)))
2-
<x-livewire-tables::table.row wire:key="row-message" class="bg-indigo-50">
2+
<x-livewire-tables::table.row wire:key="row-message" class="bg-indigo-50 dark:bg-gray-900 dark:text-white">
33
<x-livewire-tables::table.cell :colspan="$colspan">
44
@if (count($selected) && !$selectAll && !$selectPage)
55
<div>
@@ -13,7 +13,7 @@
1313
wire:click="resetBulk"
1414
wire:loading.attr="disabled"
1515
type="button"
16-
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out"
16+
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400"
1717
>
1818
@lang('Unselect All')
1919
</button>
@@ -30,7 +30,7 @@ class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium
3030
wire:click="resetBulk"
3131
wire:loading.attr="disabled"
3232
type="button"
33-
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out"
33+
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400"
3434
>
3535
@lang('Unselect All')
3636
</button>
@@ -48,7 +48,7 @@ class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium
4848
wire:click="resetBulk"
4949
wire:loading.attr="disabled"
5050
type="button"
51-
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out"
51+
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400"
5252
>
5353
@lang('Unselect All')
5454
</button>
@@ -66,7 +66,7 @@ class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium
6666
wire:click="selectAll"
6767
wire:loading.attr="disabled"
6868
type="button"
69-
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out"
69+
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400"
7070
>
7171
@lang('Select All')
7272
</button>
@@ -75,7 +75,7 @@ class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium
7575
wire:click="resetBulk"
7676
wire:loading.attr="disabled"
7777
type="button"
78-
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out"
78+
class="ml-1 text-blue-600 underline text-gray-700 text-sm leading-5 font-medium focus:outline-none focus:text-gray-800 focus:underline transition duration-150 ease-in-out dark:text-white dark:hover:text-gray-400"
7979
>
8080
@lang('Unselect All')
8181
</button>

resources/views/tailwind/includes/column-select.blade.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
@if ($columnSelect)
2-
<div class="w-full md:w-auto mb-4 md:mb-0 md:ml-2">
2+
<div class="mb-4 w-full md:w-auto md:mb-0 md:ml-2">
33
<div
44
x-data="{ open: false }"
55
@keydown.window.escape="open = false"
66
x-on:click.away="open = false"
7-
class="relative inline-block text-left w-full md:w-auto"
7+
class="inline-block relative w-full text-left md:w-auto"
88
>
99
<div>
1010
<span class="rounded-md shadow-sm">
1111
<button
1212
x-on:click="open = !open"
1313
type="button"
14-
class="inline-flex justify-center w-full rounded-md border border-gray-300 px-4 py-2 bg-white text-sm leading-5 font-medium text-gray-700 hover:text-gray-500 focus:outline-none focus:border-indigo-300 focus:shadow-outline-indigo active:bg-gray-50 active:text-gray-800 transition ease-in-out duration-150"
14+
class="inline-flex justify-center px-4 py-2 w-full text-sm font-medium text-gray-700 bg-white rounded-md border border-gray-300 shadow-sm hover:bg-gray-50 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600"
1515
id="column-select-menu"
1616
aria-haspopup="true"
1717
x-bind:aria-expanded="open"
1818
aria-expanded="true"
1919
>
2020
@lang('Columns')
2121

22-
<svg class="-mr-1 ml-2 h-5 w-5" x-description="Heroicon name: chevron-down" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
22+
<svg class="-mr-1 ml-2 w-5 h-5" x-description="Heroicon name: chevron-down" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor">
2323
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path>
2424
</svg>
2525
</button>
@@ -35,20 +35,20 @@ class="inline-flex justify-center w-full rounded-md border border-gray-300 px-4
3535
x-transition:leave="transition ease-in duration-75"
3636
x-transition:leave-start="transform opacity-100 scale-100"
3737
x-transition:leave-end="transform opacity-0 scale-95"
38-
class="origin-top-right absolute right-0 mt-2 w-full md:w-48 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 divide-y divide-gray-100 focus:outline-none z-50"
38+
class="absolute right-0 z-50 mt-2 w-full bg-white rounded-md divide-y divide-gray-100 ring-1 ring-black ring-opacity-5 shadow-lg origin-top-right md:w-48 focus:outline-none"
3939
>
40-
<div class="rounded-md bg-white shadow-xs">
40+
<div class="bg-white rounded-md shadow-xs dark:bg-gray-700 dark:text-white">
4141
<div class="p-2" role="menu" aria-orientation="vertical" aria-labelledby="column-select-menu">
4242
@foreach($columns as $column)
4343
@if ($column->isVisible() && $column->isSelectable())
4444
<div wire:key="columnSelect-{{ $loop->index }}">
4545
<label
4646
wire:loading.attr="disabled"
4747
wire:target="columnSelectEnabled"
48-
class="px-2 py-1 inline-flex items-center disabled:opacity-50 disabled:cursor-wait"
48+
class="inline-flex items-center px-2 py-1 disabled:opacity-50 disabled:cursor-wait"
4949
>
5050
<input
51-
class="disabled:opacity-50 disabled:cursor-wait"
51+
class="text-indigo-600 rounded border-gray-300 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 disabled:opacity-50 disabled:cursor-wait"
5252
wire:model="columnSelectEnabled"
5353
wire:target="columnSelectEnabled"
5454
wire:loading.attr="disabled"

resources/views/tailwind/includes/filter-pills.blade.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<div>
22
@if ($showFilters && count($this->getFiltersWithoutSearch()))
33
<div class="mb-4 p-6 md:p-0">
4-
<small class="text-gray-700">@lang('Applied Filters'):</small>
4+
<small class="text-gray-700 dark:text-white">@lang('Applied Filters'):</small>
55

66
@foreach($filters as $key => $value)
77
@if ($key !== 'search' && strlen($value))
88
<span
99
wire:key="filter-pill-{{ $key }}"
10-
class="inline-flex items-center py-0.5 pl-2 pr-0.5 rounded-full text-xs font-medium bg-indigo-100 text-indigo-700"
10+
class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium leading-4 bg-indigo-100 text-indigo-800 capitalize dark:bg-indigo-200 dark:text-indigo-900"
1111
>
1212
{{ $filterNames[$key] ?? collect($this->columns())->pluck('text', 'column')->get($key, ucwords(strtr($key, ['_' => ' ', '-' => ' ']))) }}:
1313
@if(isset($customFilters[$key]) && method_exists($customFilters[$key], 'options'))
@@ -31,7 +31,7 @@ class="flex-shrink-0 ml-0.5 h-4 w-4 rounded-full inline-flex items-center justif
3131
@endforeach
3232

3333
<button class="focus:outline-none active:outline-none" wire:click.prevent="resetFilters">
34-
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800">
34+
<span class="inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800 dark:bg-gray-200 dark:text-gray-900">
3535
@lang('Clear')
3636
</span>
3737
</button>

resources/views/tailwind/includes/filter-type-date.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
type="date"
77
@if(isset($filter->options['min']) && strlen($filter->options['min'])) min="{{ $filter->options['min'] }}" @endif
88
@if(isset($filter->options['max']) && strlen($filter->options['max'])) max="{{ $filter->options['max'] }}" @endif
9-
class="flex-1 shadow-sm border-gray-300 block w-full transition duration-150 ease-in-out sm:text-sm sm:leading-5 focus:outline-none focus:border-indigo-300 focus:shadow-outline-indigo @if (isset($filters[$key]) && strlen($filters[$key])) rounded-none rounded-l-md @else rounded-md @endif"
9+
class="block w-full border-gray-300 rounded-md 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-800 dark:text-white dark:border-gray-600"
1010
/>
1111
</div>

0 commit comments

Comments
 (0)