|
| 1 | +@if ($columnSelect) |
| 2 | + <div class="w-full md:w-auto mb-4 md:mb-0"> |
| 3 | + <div |
| 4 | + x-data="{ open: false }" |
| 5 | + @keydown.window.escape="open = false" |
| 6 | + @click.away="open = false" |
| 7 | + class="relative inline-block text-left z-10 w-full md:w-auto" |
| 8 | + > |
| 9 | + <div> |
| 10 | + <span class="rounded-md shadow-sm"> |
| 11 | + <button |
| 12 | + @click="open = !open" |
| 13 | + type="button" |
| 14 | + class="inline-flex justify-center w-full rounded-md border border-gray-300 px-4 py-2 bg-white text-sm leading-5 font-medium text-gray-700 hover:text-gray-500 focus:outline-none focus:border-indigo-300 focus:shadow-outline-indigo active:bg-gray-50 active:text-gray-800 transition ease-in-out duration-150" |
| 15 | + id="column-select-menu" |
| 16 | + aria-haspopup="true" |
| 17 | + x-bind:aria-expanded="open" |
| 18 | + aria-expanded="true" |
| 19 | + > |
| 20 | + @lang('Columns') |
| 21 | + |
| 22 | + <svg class="-mr-1 ml-2 h-5 w-5" x-description="Heroicon name: chevron-down" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor"> |
| 23 | + <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"></path> |
| 24 | + </svg> |
| 25 | + </button> |
| 26 | + </span> |
| 27 | + </div> |
| 28 | + |
| 29 | + <div |
| 30 | + x-cloak |
| 31 | + x-show="open" |
| 32 | + x-transition:enter="transition ease-out duration-100" |
| 33 | + x-transition:enter-start="transform opacity-0 scale-95" |
| 34 | + x-transition:enter-end="transform opacity-100 scale-100" |
| 35 | + x-transition:leave="transition ease-in duration-75" |
| 36 | + x-transition:leave-start="transform opacity-100 scale-100" |
| 37 | + x-transition:leave-end="transform opacity-0 scale-95" |
| 38 | + class="origin-top-right absolute right-0 mt-2 w-48 rounded-md shadow-lg z-50" |
| 39 | + > |
| 40 | + <div class="rounded-md bg-white shadow-xs"> |
| 41 | + <div class="p-2" role="menu" aria-orientation="vertical" aria-labelledby="column-select-menu"> |
| 42 | + @foreach($columns as $column) |
| 43 | + @if ($column->isVisible() && ! $this->isColumnSelectExcluded($column)) |
| 44 | + <div> |
| 45 | + <label class="px-2 py-1 inline-flex items-center"> |
| 46 | + <input wire:model="columnSelectEnabled" type="checkbox" value="{{ $column->column() }}"> |
| 47 | + <span class="ml-2">{{ $column->text() }}</span> |
| 48 | + </label> |
| 49 | + </div> |
| 50 | + @endif |
| 51 | + @endforeach |
| 52 | + </div> |
| 53 | + </div> |
| 54 | + </div> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | +@endif |
0 commit comments