tailwind.blade.php 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. @php
  2. if (! isset($scrollTo)) {
  3. $scrollTo = 'body';
  4. }
  5. $scrollIntoViewJsSnippet = ($scrollTo !== false)
  6. ? <<<JS
  7. (\$el.closest('{$scrollTo}') || document.querySelector('{$scrollTo}')).scrollIntoView()
  8. JS
  9. : '';
  10. @endphp
  11. <div>
  12. @if ($paginator->hasPages())
  13. <nav role="navigation" aria-label="Pagination Navigation" class="flex items-center justify-between">
  14. <div class="flex justify-between flex-1 sm:hidden">
  15. <span>
  16. @if ($paginator->onFirstPage())
  17. <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-800 dark:border-gray-600 dark:text-gray-300 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300">
  18. {!! __('pagination.previous') !!}
  19. </span>
  20. @else
  21. <button type="button" wire:click="previousPage('{{ $paginator->getPageName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" 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:ring ring-blue-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300">
  22. {!! __('pagination.previous') !!}
  23. </button>
  24. @endif
  25. </span>
  26. <span>
  27. @if ($paginator->hasMorePages())
  28. <button type="button" wire:click="nextPage('{{ $paginator->getPageName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" 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:ring ring-blue-300 focus:border-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-300 dark:focus:border-blue-700 dark:active:bg-gray-700 dark:active:text-gray-300">
  29. {!! __('pagination.next') !!}
  30. </button>
  31. @else
  32. <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:text-gray-600 dark:bg-gray-800 dark:border-gray-600">
  33. {!! __('pagination.next') !!}
  34. </span>
  35. @endif
  36. </span>
  37. </div>
  38. <div class="hidden sm:flex-1 sm:flex sm:items-center sm:justify-between">
  39. <div>
  40. <p class="text-sm text-gray-700 leading-5 dark:text-gray-400">
  41. <span>{!! __('Showing') !!}</span>
  42. <span class="font-medium">{{ $paginator->firstItem() }}</span>
  43. <span>{!! __('to') !!}</span>
  44. <span class="font-medium">{{ $paginator->lastItem() }}</span>
  45. <span>{!! __('of') !!}</span>
  46. <span class="font-medium">{{ $paginator->total() }}</span>
  47. <span>{!! __('results') !!}</span>
  48. </p>
  49. </div>
  50. <div>
  51. <span class="relative z-0 inline-flex rtl:flex-row-reverse rounded-md shadow-sm">
  52. <span>
  53. {{-- Previous Page Link --}}
  54. @if ($paginator->onFirstPage())
  55. <span aria-disabled="true" aria-label="{{ __('pagination.previous') }}">
  56. <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-800 dark:border-gray-600" aria-hidden="true">
  57. <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
  58. <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" />
  59. </svg>
  60. </span>
  61. </span>
  62. @else
  63. <button type="button" wire:click="previousPage('{{ $paginator->getPageName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" dusk="previousPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}.after" 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:ring ring-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:active:bg-gray-700 dark:focus:border-blue-800" aria-label="{{ __('pagination.previous') }}">
  64. <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
  65. <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" />
  66. </svg>
  67. </button>
  68. @endif
  69. </span>
  70. {{-- Pagination Elements --}}
  71. @foreach ($elements as $element)
  72. {{-- "Three Dots" Separator --}}
  73. @if (is_string($element))
  74. <span aria-disabled="true">
  75. <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-800 dark:border-gray-600 dark:text-gray-300">{{ $element }}</span>
  76. </span>
  77. @endif
  78. {{-- Array Of Links --}}
  79. @if (is_array($element))
  80. @foreach ($element as $page => $url)
  81. <span wire:key="paginator-{{ $paginator->getPageName() }}-page{{ $page }}">
  82. @if ($page == $paginator->currentPage())
  83. <span aria-current="page">
  84. <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-800 dark:border-gray-600">{{ $page }}</span>
  85. </span>
  86. @else
  87. <button type="button" wire:click="gotoPage({{ $page }}, '{{ $paginator->getPageName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" 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:ring ring-blue-300 active:bg-gray-100 active:text-gray-700 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:text-gray-400 dark:hover:text-gray-300 dark:active:bg-gray-700 dark:focus:border-blue-800" aria-label="{{ __('Go to page :page', ['page' => $page]) }}">
  88. {{ $page }}
  89. </button>
  90. @endif
  91. </span>
  92. @endforeach
  93. @endif
  94. @endforeach
  95. <span>
  96. {{-- Next Page Link --}}
  97. @if ($paginator->hasMorePages())
  98. <button type="button" wire:click="nextPage('{{ $paginator->getPageName() }}')" x-on:click="{{ $scrollIntoViewJsSnippet }}" dusk="nextPage{{ $paginator->getPageName() == 'page' ? '' : '.' . $paginator->getPageName() }}.after" 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:ring ring-blue-300 active:bg-gray-100 active:text-gray-500 transition ease-in-out duration-150 dark:bg-gray-800 dark:border-gray-600 dark:active:bg-gray-700 dark:focus:border-blue-800" aria-label="{{ __('pagination.next') }}">
  99. <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
  100. <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" />
  101. </svg>
  102. </button>
  103. @else
  104. <span aria-disabled="true" aria-label="{{ __('pagination.next') }}">
  105. <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-800 dark:border-gray-600" aria-hidden="true">
  106. <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20">
  107. <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" />
  108. </svg>
  109. </span>
  110. </span>
  111. @endif
  112. </span>
  113. </span>
  114. </div>
  115. </div>
  116. </nav>
  117. @endif
  118. </div>