simple-tailwind.blade.php (4414B)
1 @php 2 if (! isset($scrollTo)) { 3 $scrollTo = 'body'; 4 } 5 6 $scrollIntoViewJsSnippet = ($scrollTo !== false) 7 ? <<<JS 8 (\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).scrollIntoView() 9 JS 10 : ''; 11 @endphp 12 13 <div> 14 @if ($paginator->hasPages()) 15 <nav role="navigation" aria-label="Pagination Navigation" class="flex justify-between"> 16 <span> 17 {{-- Previous Page Link --}} 18 @if ($paginator->onFirstPage()) 19 <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 select-none"> 20 {!! __('pagination.previous') !!} 21 </span> 22 @else 23 @if(method_exists($paginator,'getCursorName')) 24 <button type="button" dusk="previousPage" wire:key="cursor-{{ $paginator->getCursorName() }}-{{ $paginator->previousCursor()->encode() }}" wire:click="setPage('{{$paginator->previousCursor()->encode()}}','{{ $paginator->getCursorName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" wire:loading.attr="disabled" 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"> 25 {!! __('pagination.previous') !!} 26 </button> 27 @else 28 <button 29 type="button" wire:click="previousPage('{{ $paginator->getPageName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" wire:loading.attr="disabled" dusk="previousPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}" 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"> 30 {!! __('pagination.previous') !!} 31 </button> 32 @endif 33 @endif 34 </span> 35 36 <span> 37 {{-- Next Page Link --}} 38 @if ($paginator->hasMorePages()) 39 @if(method_exists($paginator,'getCursorName')) 40 <button type="button" dusk="nextPage" wire:key="cursor-{{ $paginator->getCursorName() }}-{{ $paginator->nextCursor()->encode() }}" wire:click="setPage('{{$paginator->nextCursor()->encode()}}','{{ $paginator->getCursorName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" wire:loading.attr="disabled" 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"> 41 {!! __('pagination.next') !!} 42 </button> 43 @else 44 <button type="button" wire:click="nextPage('{{ $paginator->getPageName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" wire:loading.attr="disabled" dusk="nextPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}" 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"> 45 {!! __('pagination.next') !!} 46 </button> 47 @endif 48 @else 49 <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 select-none"> 50 {!! __('pagination.next') !!} 51 </span> 52 @endif 53 </span> 54 </nav> 55 @endif 56 </div>