|
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 | + |
| 16 | + @svg($this->getSearchIcon, $this->getSearchIconClasses, $this->getSearchIconOtherAttributes()) |
| 17 | + |
| 18 | + </div> |
| 19 | + @endif |
| 20 | + |
8 | 21 | <input |
9 | 22 | wire:model{{ $this->getSearchOptions() }}="search" |
10 | 23 | placeholder="{{ $this->getSearchPlaceholder() }}" |
11 | 24 | type="text" |
12 | 25 | {{ |
13 | 26 | $attributes->merge($this->getSearchFieldAttributes()) |
14 | 27 | ->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)), |
| 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)), |
17 | 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)), |
18 | 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)), |
19 | | -
|
| 32 | + 'block w-full' => !$this->hasSearchIcon, |
| 33 | + 'pl-8 pr-4' => $this->hasSearchIcon, |
20 | 34 | 'form-control' => $this->isBootstrap && $this->getSearchFieldAttributes()['default'] ?? true, |
21 | 35 | ]) |
22 | 36 | ->except(['default','default-styling','default-colors']) |
|
0 commit comments