|
1 | 1 | @aware([ 'tableName','isTailwind','isBootstrap']) |
2 | 2 | @props(['rowIndex', 'hidden' => false]) |
3 | 3 |
|
4 | | -@if ($this->collapsingColumnsAreEnabled() && $this->hasCollapsedColumns()) |
5 | | - @if ($isTailwind) |
6 | | - <td x-data="{open:false}" wire:key="{{ $tableName }}-collapsingIcon-{{ $rowIndex }}-{{ md5(now()) }}" |
7 | | - {{ |
8 | | - $attributes |
9 | | - ->merge() |
10 | | - ->class([ |
11 | | - 'p-3 table-cell text-center', |
12 | | - 'sm:hidden' => !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet(), |
13 | | - 'md:hidden' => !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet() && $this->shouldCollapseOnMobile(), |
14 | | - 'lg:hidden' => !$this->shouldCollapseAlways() && ($this->shouldCollapseOnTablet() || $this->shouldCollapseOnMobile()), |
15 | | - ]) |
16 | | - }} |
17 | | - :class="currentlyReorderingStatus ? 'laravel-livewire-tables-reorderingMinimised' : ''" |
18 | | - > |
19 | | - @if (! $hidden) |
20 | | - <button |
21 | | - x-cloak x-show="!currentlyReorderingStatus" |
22 | | - x-on:click.prevent="$dispatch('toggle-row-content', {'tableName': '{{ $tableName }}', 'row': {{ $rowIndex }}}); open = !open" |
23 | | - > |
24 | | - <x-heroicon-o-plus-circle x-cloak x-show="!open" |
25 | | - {{ |
26 | | - $attributes->merge($this->getCollapsingColumnButtonExpandAttributes) |
27 | | - ->class([ |
28 | | - 'h-6 w-6' => $this->getCollapsingColumnButtonExpandAttributes['default-styling'] ?? true, |
29 | | - 'text-green-600' => $this->getCollapsingColumnButtonExpandAttributes['default-colors'] ?? true, |
30 | | - ]) |
31 | | - ->except(['default','default-styling','default-colors']) |
32 | | - }} |
33 | | - /> |
34 | | - <x-heroicon-o-minus-circle x-cloak x-show="open" |
35 | | - {{ |
36 | | - $attributes->merge($this->getCollapsingColumnButtonCollapseAttributes) |
37 | | - ->class([ |
38 | | - 'h-6 w-6' => $this->getCollapsingColumnButtonCollapseAttributes['default-styling'] ?? true, |
39 | | - 'text-yellow-600' => $this->getCollapsingColumnButtonCollapseAttributes['default-colors'] ?? true, |
40 | | - ]) |
41 | | - ->except(['default','default-styling','default-colors']) |
42 | | - }} |
43 | | - /> |
44 | | - </button> |
45 | | - @endif |
46 | | - </td> |
47 | | - @elseif ($isBootstrap) |
48 | | - <td x-data="{open:false}" wire:key="{{ $tableName }}-collapsingIcon-{{ $rowIndex }}-{{ md5(now()) }}" |
49 | | - {{ |
50 | | - $attributes |
51 | | - ->class([ |
52 | | - 'd-sm-none' => !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet(), |
53 | | - 'd-md-none' => !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet() && $this->shouldCollapseOnMobile(), |
54 | | - 'd-lg-none' => !$this->shouldCollapseAlways() && ($this->shouldCollapseOnTablet() || $this->shouldCollapseOnMobile()), |
55 | | - ]) |
56 | | - }} |
57 | | - :class="currentlyReorderingStatus ? 'laravel-livewire-tables-reorderingMinimised' : ''" |
58 | | - > |
59 | | - @if (! $hidden) |
60 | | - <button |
61 | | - x-cloak x-show="!currentlyReorderingStatus" |
62 | | - x-on:click.prevent="$dispatch('toggle-row-content', {'tableName': '{{ $tableName }}', 'row': {{ $rowIndex }}});open = !open" |
63 | | - class="border-0 bg-transparent p-0" |
64 | | - > |
65 | | - <x-heroicon-o-plus-circle x-cloak x-show="!open" |
66 | | - {{ |
67 | | - $attributes->merge($this->getCollapsingColumnButtonExpandAttributes) |
68 | | - ->class([ |
69 | | - 'laravel-livewire-tables-btn-lg text-success' => $this->getCollapsingColumnButtonExpandAttributes['default-colors'] ?? true, |
70 | | - ]) |
71 | | - ->except(['default','default-styling','default-colors']) |
72 | | - }} |
73 | | - /> |
74 | | - <x-heroicon-o-minus-circle x-cloak x-show="open" |
75 | | - {{ |
76 | | - $attributes->merge($this->getCollapsingColumnButtonExpandAttributes) |
77 | | - ->class([ |
78 | | - 'laravel-livewire-tables-btn-lg text-warning' => $this->getCollapsingColumnButtonExpandAttributes['default-colors'] ?? true, |
79 | | - ]) |
80 | | - ->except(['default','default-styling','default-colors']) |
81 | | - }} |
82 | | - /> |
83 | | - </button> |
84 | | - @endif |
85 | | - </td> |
86 | | - @endif |
| 4 | +@if ($this->collapsingColumnsAreEnabled && $this->hasCollapsedColumns) |
| 5 | + <td x-data="{open:false}" wire:key="{{ $tableName }}-collapsingIcon-{{ $rowIndex }}-{{ md5(now()) }}" |
| 6 | + {{ |
| 7 | + $attributes |
| 8 | + ->merge() |
| 9 | + ->class([ |
| 10 | + 'p-3 table-cell text-center' => $isTailwind, |
| 11 | + 'sm:hidden' => $isTailwind && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet(), |
| 12 | + 'md:hidden' => $isTailwind && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet() && $this->shouldCollapseOnMobile(), |
| 13 | + 'lg:hidden' => $isTailwind && !$this->shouldCollapseAlways() && ($this->shouldCollapseOnTablet() || $this->shouldCollapseOnMobile()), |
| 14 | + 'd-sm-none' => $isBootstrap && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet(), |
| 15 | + 'd-md-none' => $isBootstrap && !$this->shouldCollapseAlways() && !$this->shouldCollapseOnTablet() && $this->shouldCollapseOnMobile(), |
| 16 | + 'd-lg-none' => $isBootstrap && !$this->shouldCollapseAlways() && ($this->shouldCollapseOnTablet() || $this->shouldCollapseOnMobile()), |
| 17 | + ]) |
| 18 | + }} |
| 19 | + :class="currentlyReorderingStatus ? 'laravel-livewire-tables-reorderingMinimised' : ''" |
| 20 | + > |
| 21 | + @if (! $hidden) |
| 22 | + <button |
| 23 | + x-cloak x-show="!currentlyReorderingStatus" |
| 24 | + x-on:click.prevent="$dispatch('toggle-row-content', {'tableName': '{{ $tableName }}', 'row': {{ $rowIndex }}}); open = !open" |
| 25 | + @class([ |
| 26 | + 'border-0 bg-transparent p-0' => $isBootstrap |
| 27 | + ]) |
| 28 | + > |
| 29 | + <x-heroicon-o-plus-circle x-cloak x-show="!open" {{ |
| 30 | + $attributes->merge($this->getCollapsingColumnButtonExpandAttributes) |
| 31 | + ->class([ |
| 32 | + 'h-6 w-6' => $isTailwind && ($this->getCollapsingColumnButtonExpandAttributes['default-styling'] ?? true), |
| 33 | + 'text-green-600' => $isTailwind && ($this->getCollapsingColumnButtonExpandAttributes['default-colors'] ?? true), |
| 34 | + 'laravel-livewire-tables-btn-lg text-success' => $isBootstrap && ($this->getCollapsingColumnButtonExpandAttributes['default-colors'] ?? true) |
| 35 | + ]) |
| 36 | + ->except(['default','default-styling','default-colors']) |
| 37 | + }} |
| 38 | + /> |
| 39 | + <x-heroicon-o-minus-circle x-cloak x-show="open" {{ |
| 40 | + $attributes->merge($this->getCollapsingColumnButtonCollapseAttributes) |
| 41 | + ->class([ |
| 42 | + 'h-6 w-6' => $isTailwind && ($this->getCollapsingColumnButtonCollapseAttributes['default-styling'] ?? true), |
| 43 | + 'text-yellow-600' => $isTailwind && ($this->getCollapsingColumnButtonCollapseAttributes['default-colors'] ?? true), |
| 44 | + 'laravel-livewire-tables-btn-lg text-warning' => $isBootstrap && ($this->getCollapsingColumnButtonExpandAttributes['default-colors'] ?? true), |
| 45 | + ]) |
| 46 | + ->except(['default','default-styling','default-colors']) |
| 47 | + }} |
| 48 | + /> |
| 49 | + </button> |
| 50 | + @endif |
| 51 | + </td> |
87 | 52 | @endif |
0 commit comments