From d4115185051264c585d3156d842c6f2a766fae59 Mon Sep 17 00:00:00 2001 From: Irineu Junior Date: Fri, 19 Apr 2024 16:18:17 -0300 Subject: [PATCH] feat(role) stripped table --- .../components/table/tr.blade.php | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 resources/views/livewire-tables/components/table/tr.blade.php diff --git a/resources/views/livewire-tables/components/table/tr.blade.php b/resources/views/livewire-tables/components/table/tr.blade.php new file mode 100644 index 0000000..f7d217c --- /dev/null +++ b/resources/views/livewire-tables/components/table/tr.blade.php @@ -0,0 +1,35 @@ +@aware(['component', 'tableName']) +@props(['row', 'rowIndex']) + +@php + $customAttributes = $component->getTrAttributes($row, $rowIndex); +@endphp + +hasDisplayLoadingPlaceholder()) + wire:loading.remove + @else + wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60" + @endif + id="{{ $tableName }}-row-{{ $row->{$component->getPrimaryKey()} }}" + :draggable="currentlyReorderingStatus" + wire:key="{{ $tableName }}-tablerow-tr-{{ $row->{$component->getPrimaryKey()} }}" + loopType="{{ ($rowIndex % 2 === 0) ? 'even' : 'odd' }}" + {{ + $attributes->merge($customAttributes) + ->class(['bg-white dark:bg-gray-700 dark:text-white rappasoft-striped-row' => ($component->isTailwind() && ($customAttributes['default'] ?? true) && $rowIndex % 2 === 0)]) + ->class(['bg-gray-50 dark:bg-gray-800 dark:text-white rappasoft-striped-row' => ($component->isTailwind() && ($customAttributes['default'] ?? true) && $rowIndex % 2 !== 0)]) + ->class(['cursor-pointer' => ($component->isTailwind() && $component->hasTableRowUrl() && ($customAttributes['default'] ?? true))]) + ->class(['-bg-light rappasoft-striped-row' => ($component->isBootstrap() && $rowIndex % 2 === 0 && ($customAttributes['default'] ?? true))]) + ->class(['-bg-white rappasoft-striped-row' => ($component->isBootstrap() && $rowIndex % 2 !== 0 && ($customAttributes['default'] ?? true))]) + ->except(['default']) + }} + +> + {{ $slot }} +