@@ -222,4 +222,67 @@ class UsersTable extends DataTableComponent
222
222
}
223
223
}
224
224
}
225
+ ```
226
+
227
+ ** input-search.blade.php**
228
+
229
+ ``` html
230
+ @if (config('livewire-tables.theme') === 'tailwind')
231
+ <div class =" flex rounded-md shadow-sm" >
232
+ <input
233
+ wire:model.debounce =" columnSearch.{{ $field }}"
234
+ placeholder =" Search {{ ucfirst($field) }}"
235
+ type =" text"
236
+ class =" block w-full border-gray-300 rounded-md shadow-sm transition duration-150 ease-in-out sm:text-sm sm:leading-5 dark:bg-gray-800 dark:text-white dark:border-gray-600 @if (isset($columnSearch[$field]) && strlen($columnSearch[$field])) rounded-none rounded-l-md focus:ring-0 focus:border-gray-300 @else focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md @endif"
237
+ />
238
+
239
+ @if (isset($columnSearch[$field]) && strlen($columnSearch[$field]))
240
+ <span wire:click =" $set('columnSearch.{{ $field }}', null)" class =" inline-flex items-center px-3 text-gray-500 border border-l-0 border-gray-300 cursor-pointer bg-gray-50 rounded-r-md sm:text-sm dark:bg-gray-700 dark:text-white dark:border-gray-600 dark:hover:bg-gray-600" >
241
+ <svg xmlns =" http://www.w3.org/2000/svg" class =" w-4 h-4" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
242
+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M6 18L18 6M6 6l12 12" />
243
+ </svg >
244
+ </span >
245
+ @endif
246
+ </div >
247
+ @endif
248
+
249
+ @if (config('livewire-tables.theme') === 'bootstrap-4')
250
+ <div class =" mb-3 mb-md-0 input-group" >
251
+ <input
252
+ wire:model.debounce =" columnSearch.{{ $field }}"
253
+ placeholder =" Search {{ ucfirst($field) }}"
254
+ type =" text"
255
+ class =" form-control"
256
+ >
257
+
258
+ @if (isset($columnSearch[$field]) && strlen($columnSearch[$field]))
259
+ <div class =" input-group-append" >
260
+ <button wire:click =" $set('columnSearch.{{ $field }}', null)" class =" btn btn-outline-secondary" type =" button" >
261
+ <svg style =" width :.75em ;height :.75em " xmlns =" http://www.w3.org/2000/svg" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
262
+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M6 18L18 6M6 6l12 12" />
263
+ </svg >
264
+ </button >
265
+ </div >
266
+ @endif
267
+ </div >
268
+ @endif
269
+
270
+ @if (config('livewire-tables.theme') === 'bootstrap-5')
271
+ <div class =" mb-3 mb-md-0 input-group" >
272
+ <input
273
+ wire:model.debounce =" columnSearch.{{ $field }}"
274
+ placeholder =" Search {{ ucfirst($field) }}"
275
+ type =" text"
276
+ class =" form-control"
277
+ >
278
+
279
+ @if (isset($columnSearch[$field]) && strlen($columnSearch[$field]))
280
+ <button wire:click =" $set('columnSearch.{{ $field }}', null)" class =" btn btn-outline-secondary" type =" button" >
281
+ <svg style =" width :.75em ;height :.75em " xmlns =" http://www.w3.org/2000/svg" fill =" none" viewBox =" 0 0 24 24" stroke =" currentColor" >
282
+ <path stroke-linecap =" round" stroke-linejoin =" round" stroke-width =" 2" d =" M6 18L18 6M6 6l12 12" />
283
+ </svg >
284
+ </button >
285
+ @endif
286
+ </div >
287
+ @endif
225
288
```
0 commit comments