-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update simple tailwind paginator styles
- Loading branch information
Showing
1 changed file
with
48 additions
and
32 deletions.
There are no files selected for viewing
80 changes: 48 additions & 32 deletions
80
resources/views/vendor/livewire/simple-tailwind.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,72 @@ | ||
@php | ||
if (! isset($scrollTo)) { | ||
$scrollTo = 'body'; | ||
} | ||
if (! isset($scrollTo)) { | ||
$scrollTo = 'body'; | ||
} | ||
$scrollIntoViewJsSnippet = ($scrollTo !== false) | ||
? <<<JS | ||
(\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).scrollIntoView() | ||
JS | ||
: ''; | ||
$scrollIntoViewJsSnippet = ($scrollTo !== false) | ||
? <<<JS | ||
(\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).scrollIntoView() | ||
JS | ||
: ''; | ||
@endphp | ||
<div> | ||
@if ($paginator->hasPages()) | ||
<nav role="navigation" aria-label="Pagination Navigation" class="flex justify-between"> | ||
@if ($paginator->hasPages()) | ||
<nav role="navigation" aria-label="Pagination Navigation" class="flex justify-between"> | ||
<span> | ||
{{-- Previous Page Link --}} | ||
@if ($paginator->onFirstPage()) | ||
<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"> | ||
@if ($paginator->onFirstPage()) | ||
<span | ||
class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-neutral-500 bg-white dark:bg-black border border-neutral-300 cursor-default leading-5 rounded-md"> | ||
{!! __('pagination.previous') !!} | ||
</span> | ||
@else | ||
@if(method_exists($paginator,'getCursorName')) | ||
<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"> | ||
@else | ||
@if(method_exists($paginator,'getCursorName')) | ||
<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-neutral-700 bg-white dark:bg-black border border-neutral-300 leading-5 rounded-md hover:text-neutral-500 focus:outline-none focus:ring ring-neutral-300 focus:border-blue-300 active:text-neutral-700 transition ease-in-out duration-150"> | ||
{!! __('pagination.previous') !!} | ||
</button> | ||
@else | ||
<button | ||
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"> | ||
@else | ||
<button | ||
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-neutral-700 bg-white dark:bg-black border border-neutral-300 leading-5 rounded-md hover:text-neutral-500 focus:outline-none focus:ring ring-neutral-300 focus:border-blue-300 active:text-neutral-700 transition ease-in-out duration-150"> | ||
{!! __('pagination.previous') !!} | ||
</button> | ||
@endif | ||
@endif | ||
@endif | ||
@endif | ||
</span> | ||
<span> | ||
<span> | ||
{{-- Next Page Link --}} | ||
@if ($paginator->hasMorePages()) | ||
@if(method_exists($paginator,'getCursorName')) | ||
<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"> | ||
@if ($paginator->hasMorePages()) | ||
@if(method_exists($paginator,'getCursorName')) | ||
<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 text-sm font-medium text-neutral-700 bg-white dark:bg-black border border-neutral-300 leading-5 rounded-md hover:text-neutral-500 focus:outline-none focus:ring ring-neutral-300 focus:border-blue-300 active:text-neutral-700 transition ease-in-out duration-150"> | ||
{!! __('pagination.next') !!} | ||
</button> | ||
@else | ||
<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"> | ||
@else | ||
<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 text-sm font-medium text-neutral-700 bg-white dark:bg-black border border-neutral-300 leading-5 rounded-md hover:text-neutral-500 focus:outline-none focus:ring ring-neutral-300 focus:border-blue-300 active:text-neutral-700 transition ease-in-out duration-150"> | ||
{!! __('pagination.next') !!} | ||
</button> | ||
@endif | ||
@else | ||
<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"> | ||
@endif | ||
@else | ||
<span | ||
class="relative inline-flex items-center px-4 py-2 text-sm font-medium text-neutral-500 bg-white dark:bg-black border border-neutral-300 cursor-default leading-5 rounded-md"> | ||
{!! __('pagination.next') !!} | ||
</span> | ||
@endif | ||
@endif | ||
</span> | ||
</nav> | ||
@endif | ||
</nav> | ||
@endif | ||
</div> |