|
| 1 | +<div> |
| 2 | + @if ($paginator->hasPages()) |
| 3 | + @php(isset($this->numberOfPaginatorsRendered[$paginator->getPageName()]) ? $this->numberOfPaginatorsRendered[$paginator->getPageName()]++ : $this->numberOfPaginatorsRendered[$paginator->getPageName()] = 1) |
| 4 | + |
| 5 | + <nav role="navigation" aria-label="Pagination Navigation" class="flex items-center justify-between"> |
| 6 | + <div class="flex justify-between flex-1 md:hidden"> |
| 7 | + <span> |
| 8 | + @if ($paginator->onFirstPage()) |
| 9 | + <span class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md dark:bg-gray-700 dark:text-white dark:border-gray-600"> |
| 10 | + {!! __('pagination.previous') !!} |
| 11 | + </span> |
| 12 | + @else |
| 13 | + <button wire:click="previousPage('{{ $paginator->getPageName() }}')" wire:loading.attr="disabled" dusk="previousPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}.before" class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-700 dark:text-white dark:ring-gray-600 dark:border-gray-600"> |
| 14 | + {!! __('pagination.previous') !!} |
| 15 | + </button> |
| 16 | + @endif |
| 17 | + </span> |
| 18 | + |
| 19 | + <span> |
| 20 | + @if ($paginator->hasMorePages()) |
| 21 | + <button wire:click="nextPage('{{ $paginator->getPageName() }}')" wire:loading.attr="disabled" dusk="nextPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}.before" class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 rounded-md hover:text-gray-500 focus:outline-none focus:shadow-outline-blue focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-700 dark:text-white dark:ring-gray-600 dark:border-gray-600"> |
| 22 | + {!! __('pagination.next') !!} |
| 23 | + </button> |
| 24 | + @else |
| 25 | + <span class="relative inline-flex items-center px-4 py-2 ml-3 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 rounded-md dark:bg-gray-700 dark:text-white dark:border-gray-600"> |
| 26 | + {!! __('pagination.next') !!} |
| 27 | + </span> |
| 28 | + @endif |
| 29 | + </span> |
| 30 | + </div> |
| 31 | + |
| 32 | + <div class="hidden md:flex-1 md:flex md:items-center md:justify-between"> |
| 33 | + <div> |
| 34 | + <p class="text-sm text-gray-700 leading-5 dark:text-white"> |
| 35 | + <span>{!! __('Showing') !!}</span> |
| 36 | + <span class="font-medium">{{ $paginator->firstItem() }}</span> |
| 37 | + <span>{!! __('to') !!}</span> |
| 38 | + <span class="font-medium">{{ $paginator->lastItem() }}</span> |
| 39 | + <span>{!! __('of') !!}</span> |
| 40 | + <span class="font-medium">{{ $paginator->total() }}</span> |
| 41 | + <span>{!! __('results') !!}</span> |
| 42 | + </p> |
| 43 | + </div> |
| 44 | + |
| 45 | + <div> |
| 46 | + <span class="relative z-0 inline-flex rounded-md shadow-sm"> |
| 47 | + <span> |
| 48 | + {{-- Previous Page Link --}} |
| 49 | + @if ($paginator->onFirstPage()) |
| 50 | + <span aria-disabled="true" aria-label="{{ __('pagination.previous') }}"> |
| 51 | + <span class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-l-md leading-5 dark:bg-gray-700 dark:text-white dark:border-gray-600" aria-hidden="true"> |
| 52 | + <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> |
| 53 | + <path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" /> |
| 54 | + </svg> |
| 55 | + </span> |
| 56 | + </span> |
| 57 | + @else |
| 58 | + <button wire:click="previousPage('{{ $paginator->getPageName() }}')" dusk="previousPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}.after" rel="prev" class="relative inline-flex items-center px-2 py-2 text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-l-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150 dark:bg-gray-700 dark:text-white dark:ring-gray-600 dark:border-gray-600" aria-label="{{ __('pagination.previous') }}"> |
| 59 | + <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> |
| 60 | + <path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" /> |
| 61 | + </svg> |
| 62 | + </button> |
| 63 | + @endif |
| 64 | + </span> |
| 65 | + |
| 66 | + {{-- Pagination Elements --}} |
| 67 | + @foreach ($elements as $element) |
| 68 | + {{-- "Three Dots" Separator --}} |
| 69 | + @if (is_string($element)) |
| 70 | + <span aria-disabled="true"> |
| 71 | + <span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 cursor-default leading-5 dark:bg-gray-700 dark:text-white dark:border-gray-600">{{ $element }}</span> |
| 72 | + </span> |
| 73 | + @endif |
| 74 | + |
| 75 | + {{-- Array Of Links --}} |
| 76 | + @if (is_array($element)) |
| 77 | + @foreach ($element as $page => $url) |
| 78 | + <span wire:key="paginator-{{ $paginator->getPageName() }}-{{ $this->numberOfPaginatorsRendered[$paginator->getPageName()] }}-page{{ $page }}"> |
| 79 | + @if ($page == $paginator->currentPage()) |
| 80 | + <span aria-current="page"> |
| 81 | + <span class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default leading-5 dark:bg-gray-500 dark:text-white dark:border-gray-500">{{ $page }}</span> |
| 82 | + </span> |
| 83 | + @else |
| 84 | + <button wire:click="gotoPage({{ $page }}, '{{ $paginator->getPageName() }}')" class="relative inline-flex items-center px-4 py-2 -ml-px text-sm font-medium text-gray-700 bg-white border border-gray-300 leading-5 hover:text-gray-500 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-700 dark:text-white dark:ring-gray-600 dark:border-gray-600" aria-label="{{ __('Go to page :page', ['page' => $page]) }}"> |
| 85 | + {{ $page }} |
| 86 | + </button> |
| 87 | + @endif |
| 88 | + </span> |
| 89 | + @endforeach |
| 90 | + @endif |
| 91 | + @endforeach |
| 92 | + |
| 93 | + <span> |
| 94 | + {{-- Next Page Link --}} |
| 95 | + @if ($paginator->hasMorePages()) |
| 96 | + <button wire:click="nextPage('{{ $paginator->getPageName() }}')" dusk="nextPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}.after" rel="next" class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 rounded-r-md leading-5 hover:text-gray-400 focus:z-10 focus:outline-none focus:border-blue-300 focus:shadow-outline-blue active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150 dark:bg-gray-700 dark:text-white dark:ring-gray-600 dark:border-gray-600" aria-label="{{ __('pagination.next') }}"> |
| 97 | + <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> |
| 98 | + <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" /> |
| 99 | + </svg> |
| 100 | + </button> |
| 101 | + @else |
| 102 | + <span aria-disabled="true" aria-label="{{ __('pagination.next') }}"> |
| 103 | + <span class="relative inline-flex items-center px-2 py-2 -ml-px text-sm font-medium text-gray-500 bg-white border border-gray-300 cursor-default rounded-r-md leading-5 dark:bg-gray-700 dark:text-white dark:border-gray-600" aria-hidden="true"> |
| 104 | + <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20"> |
| 105 | + <path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" /> |
| 106 | + </svg> |
| 107 | + </span> |
| 108 | + </span> |
| 109 | + @endif |
| 110 | + </span> |
| 111 | + </span> |
| 112 | + </div> |
| 113 | + </div> |
| 114 | + </nav> |
| 115 | + @endif |
| 116 | +</div> |
0 commit comments