|
1 | | -@aware(['component', 'tableName','isTailwind', 'isBootstrap']) |
| 1 | +@aware(['isTailwind', 'isBootstrap']) |
2 | 2 |
|
3 | 3 | <div |
4 | 4 | @class([ |
5 | | - 'mb-3 mb-md-0 input-group' => $this->isBootstrap, |
6 | | - 'rounded-md shadow-sm' => $this->isTailwind, |
| 5 | + 'mb-3 mb-md-0 input-group' => $isBootstrap, |
| 6 | + 'rounded-md shadow-sm' => $isTailwind, |
7 | 7 | 'flex' => !$this->hasSearchIcon, |
8 | 8 | 'relative inline-flex flex-row' => $this->hasSearchIcon, |
9 | 9 | ])> |
10 | 10 |
|
11 | 11 | @if($this->hasSearchIcon) |
12 | | - <div class="relative inset-y-0 left-6 |
13 | | - inline-flex items-center |
14 | | - pointer-events-none"> |
15 | | - |
16 | | - @svg($this->getSearchIcon, $this->getSearchIconClasses, $this->getSearchIconOtherAttributes()) |
17 | | - |
18 | | - </div> |
| 12 | + <x-livewire-tables::tools.toolbar.items.search.icon :searchIcon="$this->getSearchIcon" :searchIconClasses="$this->getSearchIconClasses" :searchIconOtherAttributes="$this->getSearchIconOtherAttributes" /> |
19 | 13 | @endif |
20 | 14 |
|
21 | | - <input |
22 | | - wire:model{{ $this->getSearchOptions() }}="search" |
23 | | - placeholder="{{ $this->getSearchPlaceholder() }}" |
24 | | - type="text" |
25 | | - {{ |
26 | | - $attributes->merge($this->getSearchFieldAttributes()) |
27 | | - ->class([ |
28 | | - 'rounded-md shadow-sm transition duration-150 ease-in-out sm:text-sm sm:leading-5 rounded-none rounded-l-md focus:ring-0 focus:border-gray-300' => $this->isTailwind && $this->hasSearch() && (($this->getSearchFieldAttributes()['default'] ?? true) || ($this->getSearchFieldAttributes()['default-styling'] ?? true)), |
29 | | - 'rounded-md shadow-sm transition duration-150 ease-in-out sm:text-sm sm:leading-5 rounded-md focus:ring focus:ring-opacity-50' => $this->isTailwind && !$this->hasSearch() && (($this->getSearchFieldAttributes()['default'] ?? true) || ($this->getSearchFieldAttributes()['default-styling'] ?? true)), |
30 | | - 'border-gray-300 dark:bg-gray-700 dark:text-white dark:border-gray-600 focus:border-gray-300' => $this->isTailwind && $this->hasSearch() && (($this->getSearchFieldAttributes()['default'] ?? true) || ($this->getSearchFieldAttributes()['default-colors'] ?? true)), |
31 | | - 'border-gray-300 dark:bg-gray-700 dark:text-white dark:border-gray-600 focus:border-indigo-300 focus:ring-indigo-200' => $this->isTailwind && !$this->hasSearch() && (($this->getSearchFieldAttributes()['default'] ?? true) || ($this->getSearchFieldAttributes()['default-colors'] ?? true)), |
32 | | - 'block w-full' => !$this->hasSearchIcon, |
33 | | - 'pl-8 pr-4' => $this->hasSearchIcon, |
34 | | - 'form-control' => $this->isBootstrap && $this->getSearchFieldAttributes()['default'] ?? true, |
35 | | - ]) |
36 | | - ->except(['default','default-styling','default-colors']) |
37 | | - }} |
38 | | - |
39 | | - /> |
| 15 | + <x-livewire-tables::tools.toolbar.items.search.input /> |
40 | 16 |
|
41 | | - @if ($this->hasSearch()) |
42 | | - <div @class([ |
43 | | - 'd-inline-flex h-100 align-items-center ' => $this->isBootstrap, |
44 | | - ])> |
45 | | - <div |
46 | | - wire:click="clearSearch" |
47 | | - |
48 | | - @class([ |
49 | | - 'btn btn-outline-secondary d-inline-flex h-100 align-items-center' => $this->isBootstrap, |
50 | | - 'inline-flex h-full items-center px-3 text-gray-500 bg-gray-50 rounded-r-md border border-l-0 border-gray-300 cursor-pointer sm:text-sm dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600' => $this->isTailwind, |
51 | | - ]) |
52 | | - > |
53 | | - @if($this->isTailwind) |
54 | | - <x-heroicon-m-x-mark class='w-4 h-4' /> |
55 | | - @else |
56 | | - <x-heroicon-m-x-mark class="laravel-livewire-tables-btn-smaller" /> |
57 | | - @endif |
58 | | - </div> |
59 | | - </div> |
| 17 | + @if ($this->hasSearch) |
| 18 | + <x-livewire-tables::tools.toolbar.items.search.remove /> |
60 | 19 | @endif |
61 | | - |
62 | | - |
63 | 20 | </div> |
0 commit comments