|
3 | 3 | <div |
4 | 4 | @class([ |
5 | 5 | 'mb-3 mb-md-0 input-group' => $this->isBootstrap, |
6 | | - 'flex rounded-md shadow-sm' => $this->isTailwind, |
| 6 | + 'rounded-md shadow-sm' => $this->isTailwind, |
| 7 | + 'flex' => !$this->hasSearchIcon, |
| 8 | + 'relative inline-flex flex-row' => $this->hasSearchIcon, |
7 | 9 | ])> |
| 10 | + |
| 11 | + @if($this->hasSearchIcon) |
| 12 | + <div class="relative inset-y-0 left-6 |
| 13 | + inline-flex items-center |
| 14 | + pointer-events-none"> |
| 15 | + <x-heroicon-m-magnifying-glass {{ $attributes->merge($this->getSearchIconAttributes()) |
| 16 | + ->class([ |
| 17 | + 'w-4 h-4' => (($this->getSearchIconAttributes()['default'] ?? true) || ($this->getSearchIconAttributes()['default-styling'] ?? true)), |
| 18 | + ]) |
| 19 | + }} |
| 20 | + /> |
| 21 | + |
| 22 | + </div> |
| 23 | + @endif |
| 24 | + |
8 | 25 | <input |
9 | 26 | wire:model{{ $this->getSearchOptions() }}="search" |
10 | 27 | placeholder="{{ $this->getSearchPlaceholder() }}" |
11 | 28 | type="text" |
12 | 29 | {{ |
13 | 30 | $attributes->merge($this->getSearchFieldAttributes()) |
14 | 31 | ->class([ |
15 | | - 'block w-full 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)), |
16 | | - 'block w-full 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)), |
| 32 | + '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)), |
| 33 | + '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)), |
17 | 34 | '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)), |
18 | 35 | '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)), |
19 | | -
|
| 36 | + 'block w-full' => !$this->hasSearchIcon, |
| 37 | + 'pl-8 pr-4' => $this->hasSearchIcon, |
20 | 38 | 'form-control' => $this->isBootstrap && $this->getSearchFieldAttributes()['default'] ?? true, |
21 | 39 | ]) |
22 | 40 | ->except(['default','default-styling','default-colors']) |
|
0 commit comments