Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Relation refactor #375

Open
wants to merge 161 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
161 commits
Select commit Hold shift + click to select a range
942e6d0
Add over-ridden aggregates support in filters
renardudezert Jun 29, 2021
6198804
Merge branch 'master' into master
marksalmon Jul 3, 2021
cb845c6
Merge remote-tracking branch 'origin/master'
renardudezert Sep 14, 2021
3fa7aca
Base Mass Actions starting point.
tomshaw Oct 10, 2021
6528ea0
Group Mass Actions
tomshaw Oct 11, 2021
bb68c7e
Refactored group/groups methods.
tomshaw Oct 11, 2021
f61f3f5
Single flatten call.
tomshaw Oct 11, 2021
aaae9d9
Single flatten call.
tomshaw Oct 11, 2021
a2954e9
introduce ability to append a summary row to a datatable
Oct 14, 2021
59afa0c
Addition mass action exports with settings.
tomshaw Oct 14, 2021
4953ad7
Adjust spacing.
tomshaw Oct 14, 2021
abdf2dc
Adjust spacing.
tomshaw Oct 14, 2021
7e8b93f
Adjusting style ci issues.
tomshaw Oct 14, 2021
b922734
Evaluating a more verbose export API.
tomshaw Oct 15, 2021
47d0548
Miscellaneous code cleanup/refactoring.
tomshaw Oct 16, 2021
72fe18a
Add format method to Number Column.
mrsid18 Nov 16, 2021
8116641
Set Default places to 0
mrsid18 Nov 16, 2021
2ef864d
Update NumberColumn.php
mrsid18 Nov 16, 2021
141f407
Move highlight call before export callback calls.
chrisjimallen Dec 9, 2021
19abc35
Move highlight call before export callback calls.
chrisjimallen Dec 9, 2021
e84be27
wip
marksalmon Jan 6, 2022
73e677b
wip
marksalmon Jan 6, 2022
653abb6
wip
marksalmon Jan 6, 2022
073688a
wip
marksalmon Jan 6, 2022
3f9566b
Apply fixes from StyleCI (#374)
marksalmon Jan 6, 2022
098fb1b
obey table prefix, if defined in database connection (#365)
thyseus Jan 6, 2022
5a60a95
bugfix
marksalmon Jan 7, 2022
2696ff2
Apply fixes from StyleCI
StyleCIBot Jan 7, 2022
c8fe8c8
Get $model from builder() method (#379)
rikthomas Jan 11, 2022
c80d5af
datatable
trippo Jan 20, 2022
4a83f08
Merge branch 'upstream/master' into introduce-summary-row
Feb 3, 2022
72a9990
improvements of table reset
Feb 3, 2022
b2022d8
Merge pull request #387 from amvisor/table-reset
thyseus Feb 3, 2022
5122a89
Merge branch 'master' into mass-action-support
tomshaw Feb 3, 2022
b0db5d9
Update LivewireDatatable.php
tomshaw Feb 3, 2022
4ee6daa
Update LivewireDatatable.php
tomshaw Feb 3, 2022
5680aa1
Update LivewireDatatable.php
tomshaw Feb 3, 2022
432996e
Bump dependencies for Laravel 9
laravel-shift Feb 6, 2022
0c44d0a
Merge pull request #390 from laravel-shift/l9-compatibility
thyseus Feb 13, 2022
730f198
Merge pull request #322 from thyseus/introduce-summary-row
thyseus Feb 15, 2022
8ac87b7
rename livewire:datatable to make:livewire-datatable as it is the can…
Feb 16, 2022
e179ab4
move checkbox to separate view file
Feb 17, 2022
f1340a2
can set tooltip to column
Feb 18, 2022
1af1524
code style improvements
thyseus Feb 18, 2022
203315a
add tooltip to views
thyseus Feb 21, 2022
fa9864f
Merge pull request #399 from amvisor/tooltips
thyseus Feb 21, 2022
b9e378b
add some documentation for the mass action feature
thyseus Feb 21, 2022
928b7b2
Merge branch 'master' into mass-action-support
thyseus Feb 21, 2022
823a141
re-add accidentally lost hint in README.md
thyseus Feb 21, 2022
3e666b6
fix: use set sort direction
Feb 21, 2022
1df93f8
Merge pull request #400 from amvisor/fix_sort_direction
thyseus Feb 21, 2022
e185f06
add documentation about bulk export styling possibility
Feb 22, 2022
cb52707
Merge pull request #320 from tomshaw/mass-action-support
thyseus Feb 22, 2022
32356f2
Merge branch 'master' into pin-records
Feb 22, 2022
92e4a68
Merge branch 'master' into pin-records
Feb 22, 2022
413654c
introduce ability to pin specific records
Feb 23, 2022
f2f5a40
introduce applyPinnedRecords()
Feb 24, 2022
6453bf4
only call applyPinnedRecord() when given table is using canPinRecords…
Feb 24, 2022
f248cfd
add hint to index column in README.md
Feb 28, 2022
bc3accd
Merge pull request #406 from MedicOneSystems/doc-index-column
thyseus Feb 28, 2022
6bdbb22
Takes into account hidden columns when displaying summary row
3rgo Mar 2, 2022
529fe76
Merge pull request #407 from 3rgo/summary-row-hidden-columns
thyseus Mar 3, 2022
58516fd
simplify datatable view
trippo Mar 9, 2022
7077daa
Update
trippo Mar 9, 2022
a0f6549
Merge
trippo Mar 9, 2022
2c768ff
Merge branch 'master' of https://github.com/MedicOneSystems/livewire-…
trippo Mar 9, 2022
b11610b
Merge branch 'MedicOneSystems-master'
trippo Mar 9, 2022
afebbaa
Update readme
trippo Mar 9, 2022
5d648ee
fix wrong restore sort direction
Mar 16, 2022
2cedad7
Merge pull request #414 from amvisor/fix_restore_sort
thyseus Mar 16, 2022
b1b86e6
Merge pull request #397 from amvisor/pin-records
thyseus Mar 17, 2022
be090c0
Merge branch 'MedicOneSystems:master' into master
trippo Mar 18, 2022
a11d8d4
Move default cell class to config
trippo Mar 19, 2022
7d71a26
Move cell classes on config
trippo Mar 19, 2022
735e34a
Fix no result text
trippo Mar 19, 2022
f56d767
introduce the ability to pass a custom name for a callback column
thyseus Mar 22, 2022
76c20bf
sortable overhaul: rename 'unsortable' to 'sortable' which is more in…
thyseus Mar 22, 2022
4420afa
Merge pull request #420 from amvisor/sortable-overhaul
thyseus Mar 22, 2022
7ca4169
Merge pull request #419 from amvisor/custom-callback-name
thyseus Mar 22, 2022
6a71b49
introduce wrap() and nowrap() in Column
thyseus Mar 22, 2022
9a1fe0d
Merge pull request #421 from amvisor/wrap
thyseus Mar 22, 2022
82c22b4
Merge branch 'master' into master
thyseus Mar 22, 2022
74400d9
introduce alias (make:livewire-datatable, livewire:datatable)
thyseus Mar 22, 2022
a69fa6e
Merge pull request #396 from amvisor/rename-command
thyseus Mar 22, 2022
3da2c22
Merge pull request #353 from chrisjimallen/export-highlight-fix
thyseus Mar 22, 2022
29a1077
code style
thyseus Mar 22, 2022
313084e
Merge pull request #343 from mrsid18/master
thyseus Mar 22, 2022
5c05fd6
add alias to make:livewire-datatable command
thyseus Mar 22, 2022
118813a
Merge pull request #422 from amvisor/fix
thyseus Mar 22, 2022
58cf5e0
append truncate after whitespace-nowrap
thyseus Mar 22, 2022
24c359b
Merge pull request #423 from amvisor/wrap
thyseus Mar 22, 2022
9b2d07a
Remove .idea
trippo Mar 22, 2022
ed4af07
Merge branch 'master' of https://github.com/MedicOneSystems/livewire-…
trippo Mar 22, 2022
3dc9809
introduce headerAlign...() and contentAlign...()
thyseus Mar 22, 2022
3564263
Merge pull request #424 from amvisor/content-align
thyseus Mar 22, 2022
c6f93b4
Merge branch 'master' into master
thyseus Mar 22, 2022
e3854ac
Merge pull request #413 from trippo/master
thyseus Mar 22, 2022
165cf61
Merge pull request #376 from MedicOneSystems/analysis-QMRVyw
thyseus Mar 22, 2022
28d1b9f
s/alignCener/alignCenter
thyseus Mar 22, 2022
a928621
Merge pull request #425 from amvisor/content-align
thyseus Mar 22, 2022
92c663c
Change to allow use of checkbox without 'CanPinRecords'
levi730 Mar 23, 2022
258ed09
Fix issue: Column::callback(): Argument #1 ($columns) must be of type…
code23-barna Mar 23, 2022
f4018c9
Merge pull request #427 from levi730/master
thyseus Mar 23, 2022
0b1068c
Merge pull request #428 from code23-barna/master
thyseus Mar 23, 2022
8ed023d
Update composer.json
marksalmon Mar 23, 2022
f22720c
Update composer.json
marksalmon Mar 23, 2022
c79adb1
Argument #2 ($callback) must be of type Closure, string given
code23-barna Mar 24, 2022
8571d87
move view columns array to class property
Mar 28, 2022
2701203
Merge pull request #432 from amvisor/view_columns
thyseus Mar 28, 2022
d020ee5
Merge pull request #430 from code23-barna/master
thyseus Mar 28, 2022
d885039
The backtick on the sort string doesn't seem to work on sqlserv and
Mar 29, 2022
b4046e9
Merge branch 'MedicOneSystems:master' into master
renardudezert Mar 31, 2022
b8bc51e
Bugfix toggleSelectAll() with groupBy() in query builder
renardudezert Mar 31, 2022
20aa884
Fix typos in README.md
jevinsonlim Mar 31, 2022
1b9b521
improve the way to-be-exported columns are discovered
thyseus Apr 4, 2022
db88019
introduce ability to provide custom file name of exported file
thyseus Apr 4, 2022
ae5a131
Merge pull request #439 from amvisor/improve-column-discovery
thyseus Apr 4, 2022
ccadd9a
Merge pull request #437 from jevinsonlim/patch-1
thyseus Apr 4, 2022
379227c
Merge pull request #436 from renardudezert/master
thyseus Apr 4, 2022
141b6fd
Merge pull request #435 from shaneburrell/master
thyseus Apr 4, 2022
ad757f5
Column: introduce ability to pass custom data when using view()
May 9, 2022
cfcd9ce
Merge pull request #455 from MedicOneSystems/454-pass-params-to-render
thyseus May 11, 2022
230de7a
Add support to set default date filter start and end to support other…
shaneburrell May 11, 2022
d3559c0
fix boolean complex query
marksalmon May 18, 2022
4bfc91b
Merge branch 'relation-refactor' of https://github.com/MedicOneSystem…
marksalmon May 18, 2022
e8de7c8
try again
marksalmon May 18, 2022
c502ce9
Update README.md (#466)
AmilkarDominguez May 29, 2022
5fbaeb4
php 8 is required (#465)
amrography May 29, 2022
c2931fb
fix: tablePrefix problem (#473)
bleuren Jun 16, 2022
232b2b1
Add column argument to 'fieldEdited' event. (#479)
sha-hin Jul 6, 2022
0864400
add single quotes around id in call to delete function so it works wi…
josefbehr Jul 25, 2022
8972134
Adds hideable functionality to column select (#508)
rickdubiel Oct 14, 2022
e6cc450
Bugfix for relations in resolveColumnName method (#509)
renardudezert Oct 14, 2022
e76e00a
fix customWithAggregate and hasAggregate macros (#510)
HobieCat Oct 18, 2022
0d39c09
fix project description in composer.json
Nov 12, 2022
c13a4d0
Added defaultFilters to Livewire Datatables (#527)
Cosnavel Nov 27, 2022
f140158
Bugfix checkboxes behavior when search or filters are active (#522)
renardudezert Nov 27, 2022
06d4a2a
add SQLite dialect to resolveAdditionalSelects (#519)
HobieCat Nov 27, 2022
8dc46a7
fix addGlobalSearch method (#511)
HobieCat Nov 27, 2022
966b719
Apply fixes from StyleCI
StyleCIBot Jan 7, 2022
1d4a02a
Update composer.json
marksalmon Mar 23, 2022
1cc392d
Update composer.json
marksalmon Mar 23, 2022
3558658
try again
marksalmon May 18, 2022
3fda3f4
Merge branch 'relation-refactor' of https://github.com/MedicOneSystem…
marksalmon Dec 2, 2022
7957648
Apply fixes from StyleCI (#528)
marksalmon Dec 2, 2022
b09bb9f
rebase master
marksalmon Jan 6, 2022
1749ded
wip
marksalmon Jan 6, 2022
91fc90b
wip
marksalmon Jan 6, 2022
fad8d27
wip
marksalmon Jan 6, 2022
7a0757b
Apply fixes from StyleCI (#374)
marksalmon Jan 6, 2022
7d1e3cf
bugfix
marksalmon Jan 7, 2022
73f9a77
fix boolean complex query
marksalmon May 18, 2022
0490d74
Apply fixes from StyleCI
StyleCIBot Jan 7, 2022
63233cf
try again
marksalmon May 18, 2022
101861c
Apply fixes from StyleCI
StyleCIBot Jan 7, 2022
1e5a8dc
try again
marksalmon May 18, 2022
f424715
wip
marksalmon Dec 2, 2022
b1bb0c3
Merge branch 'relation-refactor' of https://github.com/MedicOneSystem…
marksalmon Dec 2, 2022
51388ad
Apply fixes from StyleCI (#529)
marksalmon Dec 2, 2022
628c06a
wip
marksalmon Dec 2, 2022
784e245
fix pagination with complex query
marksalmon Dec 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ vendor
coverage
.DS_Store
.vscode/
.idea/
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to `livewire-datatables` will be documented in this file

## 1.0.0 - 201X-XX-XX
## 1.0.0 - 201X-XX-XX ( to be released in the future... )

- initial release

## 0.9.0 ( 2022-03-22 )

- Breaking Change: 'unsortable' has been renamed to 'sortable', which is more intuitive. Please adjust your overwritten views, if any (thyseus).

199 changes: 169 additions & 30 deletions README.md

Large diffs are not rendered by default.

29 changes: 20 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"name": "mediconesystems/livewire-datatables",
"description": "",
"description": "Advanced datatables using Laravel, Livewire, Tailwind CSS and Alpine JS",
"keywords": [
"mediconesystems",
"livewire-datatables"
"php",
"laravel",
"livewire"
],
"homepage": "https://github.com/mediconesystems/livewire-datatables",
"license": "MIT",
Expand All @@ -13,18 +14,29 @@
"name": "Mark Salmon",
"email": "[email protected]",
"role": "Developer"
},
{
"name": "Shane Burrell",
"email": "[email protected]",
"role": "Developer"
},
{
"name": "Herbert Maschke",
"email": "[email protected]",
"role": "Developer"
}
],
"require": {
"php": "^7.2.5|^8.0",
"illuminate/support": "^7.0|^8.0",
"php": "^8.0",
"illuminate/support": "^7.0|^8.0|^9.0",
"livewire/livewire": "^2.4.4",
"maatwebsite/excel": "^3.1"
"maatwebsite/excel": "^3.1",
"reedware/laravel-relation-joins": "^2.4|^3.0"
},
"require-dev": {
"laravel/legacy-factories": "^1.0.4",
"orchestra/testbench": "^4.0|5.0|6.0",
"phpunit/phpunit": "^8.0|9.0"
"orchestra/testbench": "^4.0|5.0|6.0|^7.0",
"phpunit/phpunit": "^8.0|9.0|^9.5.10"
},
"autoload": {
"psr-4": {
Expand All @@ -39,7 +51,6 @@
"scripts": {
"test": "vendor/bin/phpunit",
"test-coverage": "vendor/bin/phpunit --coverage-html coverage"

},
"config": {
"sort-packages": true
Expand Down
29 changes: 28 additions & 1 deletion config/livewire-datatables.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,23 @@
'default_time_format' => 'H:i',
'default_date_format' => 'd/m/Y',

/*
|--------------------------------------------------------------------------
| Default Carbon Formats
|--------------------------------------------------------------------------
| The default formats that are used for TimeColumn & DateColumn.
| You can use the formatting characters from the PHP DateTime class.
| More info: https://www.php.net/manual/en/datetime.format.php
|
*/

'default_time_start' => '0000-00-00',
'default_time_end' => '9999-12-31',

// Defaults that work with smalldatetime in SQL Server
// 'default_time_start' => '1900-01-01',
// 'default_time_end' => '2079-06-06',

/*
|--------------------------------------------------------------------------
| Surpress Search Highlights
Expand Down Expand Up @@ -56,6 +73,16 @@

'model_namespace' => 'App',

/*
|--------------------------------------------------------------------------
| Default Sortable
|--------------------------------------------------------------------------
| Should a column of a datatable be sortable by default ?
|
*/

'default_sortable' => true,

/*
|--------------------------------------------------------------------------
| Default CSS classes
Expand All @@ -72,6 +99,6 @@
'odd' => 'divide-x divide-gray-100 text-sm text-gray-900 bg-gray-50',
'selected' => 'divide-x divide-gray-100 text-sm text-gray-900 bg-yellow-100',
],
'cell' => 'text-sm text-gray-900',
'cell' => 'whitespace-no-wrap text-sm text-gray-900 px-6 py-2',
],
];
8 changes: 7 additions & 1 deletion resources/views/livewire/datatables/checkbox.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
<div class="flex justify-center">
<input type="checkbox" wire:model="selected" value="{{ $value }}" class="form-checkbox mt-1 h-4 w-4 text-blue-600 transition duration-150 ease-in-out" />
<input
type="checkbox"
wire:model="selected"
value="{{ $value }}"
@if (property_exists($this, 'pinnedRecords') && in_array($value, $this->pinnedRecords)) checked @endif
class="w-4 h-4 mt-1 text-blue-600 form-checkbox transition duration-150 ease-in-out"
/>
</div>
96 changes: 51 additions & 45 deletions resources/views/livewire/datatables/complex-query.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,58 +16,64 @@
@endif</span>
</div>

@if(count($this->rules[0]['content']))
<div class="my-4 px-4 py-2 bg-gray-500 whitespace-pre-wrap @if($errors->any())text-red-200 @else text-green-100 @endif rounded">{{ $this->rulesString }}@if($errors->any()) Invalid rules @endif</div>
@endif
<div>
@if(count($this->rules[0]['content']))
<div class="my-4 px-4 py-2 bg-gray-500 whitespace-pre-wrap @if($errors->any())text-red-200 @else text-green-100 @endif rounded">{{ $this->rulesString }}@if($errors->any()) Invalid rules @endif</div>
@endif
</div>

<div>@include('datatables::complex-query-group', ['rules' => $rules, 'parentIndex' => null])</div>

@if(count($this->rules[0]['content']))
@unless($errors->any())
<div class="pt-2 sm:flex w-full justify-between">
<div>
{{-- <button class="bg-blue-500 px-3 py-2 rounded text-white" wire:click="runQuery">Apply Query</button> --}}
<div>
@if(count($this->rules[0]['content']))
@unless($errors->any())
<div class="pt-2 sm:flex w-full justify-between">
<div>
{{-- <button class="bg-blue-500 px-3 py-2 rounded text-white" wire:click="runQuery">Apply Query</button> --}}
</div>
<div class="mt-2 sm:mt-0 sm:flex sm:space-x-2">
@isset($savedQueries)
<div class="flex items-center space-x-2" x-data="{
name: null,
saveQuery() {
$wire.call('saveQuery', this.name)
this.name = null
}
}">
<input x-model="name" wire:loading.attr="disabled" x-on:keydown.enter="saveQuery" placeholder="save as..." class="flex-grow px-3 py-3 border text-sm text-gray-900 leading-4 block rounded-md border-gray-300 shadow-sm focus:outline-none focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50" />
<button x-bind:disabled="! name" x-show="rules" x-on:click="saveQuery" class="flex items-center space-x-2 px-3 py-0.5 border border-green-400 disabled:border-gray-300 rounded-md bg-white text-green-500 disabled:text-gray-300 text-xs leading-4 font-medium uppercase tracking-wider hover:bg-green-200 disabled:hover:bg-white focus:outline-none disabled:pointer-events-none">
<span>{{ __('Save') }}</span>
<span wire:loading.remove><x-icons.check-circle class="m-2" /></span>
<span wire:loading><x-icons.cog class="animate-spin m-2" /></span>
</button>
</div>
@endisset
<button x-show="rules" wire:click="resetQuery" class="flex items-center space-x-2 px-3 border border-red-400 rounded-md bg-white text-red-500 text-xs leading-4 font-medium uppercase tracking-wider hover:bg-red-200 focus:outline-none">
<span>{{ __('Reset') }}</span>
<x-icons.x-circle class="m-2" />
</button>
</div>
</div>
<div class="mt-2 sm:mt-0 sm:flex sm:space-x-2">
@isset($savedQueries)
<div class="flex items-center space-x-2" x-data="{
name: null,
saveQuery() {
$wire.call('saveQuery', this.name)
this.name = null
}
}">
<input x-model="name" wire:loading.attr="disabled" x-on:keydown.enter="saveQuery" placeholder="save as..." class="flex-grow px-3 py-3 border text-sm text-gray-900 leading-4 block rounded-md border-gray-300 shadow-sm focus:outline-none focus:border-blue-300 focus:ring focus:ring-blue-200 focus:ring-opacity-50" />
<button x-bind:disabled="! name" x-show="rules" x-on:click="saveQuery" class="flex items-center space-x-2 px-3 py-0.5 border border-green-400 disabled:border-gray-300 rounded-md bg-white text-green-500 disabled:text-gray-300 text-xs leading-4 font-medium uppercase tracking-wider hover:bg-green-200 disabled:hover:bg-white focus:outline-none disabled:pointer-events-none">
<span>{{ __('Save') }}</span>
<span wire:loading.remove><x-icons.check-circle class="m-2" /></span>
<span wire:loading><x-icons.cog class="animate-spin m-2" /></span>
@endif
@endif
</div>

<div>
@if(count($savedQueries ?? []))
<div>
<div class="mt-8 my-4 text-xl uppercase tracking-wide font-medium leading-none">Saved Queries</div>
<div class="grid md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-2">
@foreach($savedQueries as $saved)
<div class="flex" wire:key="{{ $saved['id'] }}">
<button wire:click="loadRules({{ json_encode($saved['rules']) }})" wire:loading.attr="disabled" class="p-2 flex-grow flex items-center space-x-2 px-3 border border-r-0 border-blue-400 rounded-md rounded-r-none bg-white text-blue-500 text-xs leading-4 font-medium uppercase tracking-wider hover:bg-blue-200 focus:outline-none">{{ $saved['name'] }}</button>
<button wire:click="deleteRules({{ $saved['id'] }})" wire:loading.attr="disabled" class="p-2 flex items-center space-x-2 px-3 border border-red-400 rounded-md rounded-l-none bg-white text-red-500 text-xs leading-4 font-medium uppercase tracking-wider hover:bg-red-200 focus:outline-none">
<x-icons.x-circle wire:loading.remove />
<x-icons.cog wire:loading class="h-6 w-6 animate-spin" />
</button>
</div>
@endisset
<button x-show="rules" wire:click="resetQuery" class="flex items-center space-x-2 px-3 border border-red-400 rounded-md bg-white text-red-500 text-xs leading-4 font-medium uppercase tracking-wider hover:bg-red-200 focus:outline-none">
<span>{{ __('Reset') }}</span>
<x-icons.x-circle class="m-2" />
</button>
@endforeach
</div>
</div>
@endif

@endif
@if(count($savedQueries ?? []))
<div>
<div class="mt-8 my-4 text-xl uppercase tracking-wide font-medium leading-none">Saved Queries</div>
<div class="grid md:grid-cols-2 xl:grid-cols-3 2xl:grid-cols-4 gap-2">
@foreach($savedQueries as $saved)
<div class="flex" wire:key="{{ $saved['id'] }}">
<button wire:click="loadRules({{ json_encode($saved['rules']) }})" wire:loading.attr="disabled" class="p-2 flex-grow flex items-center space-x-2 px-3 border border-r-0 border-blue-400 rounded-md rounded-r-none bg-white text-blue-500 text-xs leading-4 font-medium uppercase tracking-wider hover:bg-blue-200 focus:outline-none">{{ $saved['name'] }}</button>
<button wire:click="deleteRules({{ $saved['id'] }})" wire:loading.attr="disabled" class="p-2 flex items-center space-x-2 px-3 border border-red-400 rounded-md rounded-l-none bg-white text-red-500 text-xs leading-4 font-medium uppercase tracking-wider hover:bg-red-200 focus:outline-none">
<x-icons.x-circle wire:loading.remove />
<x-icons.cog wire:loading class="h-6 w-6 animate-spin" />
</button>
</div>
@endforeach
</div>
</div>
@endif
</div>
</div>
Loading