-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d2097e
commit d411518
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
resources/views/livewire-tables/components/table/tr.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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@aware(['component', 'tableName']) | ||
@props(['row', 'rowIndex']) | ||
|
||
@php | ||
$customAttributes = $component->getTrAttributes($row, $rowIndex); | ||
@endphp | ||
|
||
<tr | ||
rowpk='{{ $row->{$component->getPrimaryKey()} }}' | ||
x-on:dragstart.self="currentlyReorderingStatus && dragStart(event)" | ||
x-on:drop.prevent="currentlyReorderingStatus && dropEvent(event)" | ||
x-on:dragover.prevent.throttle.500ms="currentlyReorderingStatus && dragOverEvent(event)" | ||
x-on:dragleave.prevent.throttle.500ms="currentlyReorderingStatus && dragLeaveEvent(event)" | ||
@if($component->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 }} | ||
</tr> |