Skip to content

Commit f7e08d5

Browse files
committed
CollapseRework4 - Additional Fixes
1 parent 73de220 commit f7e08d5

File tree

16 files changed

+155
-49
lines changed

16 files changed

+155
-49
lines changed

resources/views/components/bulk-actions/th.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@aware(['tableName','isTailwind', 'isBootstrap'])
22
@php
3-
$customAttributes = $this->hasBulkActionsThAttributes ? $this->getBulkActionsThAttributes : $this->getAllThAttributes($this->getBulkActionsColumn())['customAttributes'];
3+
$customAttributes = $this->hasBulkActionsThAttributes() ? $this->getBulkActionsThAttributes() : $this->getAllThAttributes($this->getBulkActionsColumn())['customAttributes'];
44
$bulkActionsThCheckboxAttributes = $this->getBulkActionsThCheckboxAttributes();
55
@endphp
66

resources/views/components/includes/actions.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
])
1919
->except(['default','default-styling','default-colors'])
2020
}} >
21-
@foreach($this->getActions as $action)
21+
@foreach($this->getActions() as $action)
2222
{{ $action->render() }}
2323
@endforeach
2424
</div>

resources/views/components/reorder/th.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
@aware(['isTailwind', 'isBootstrap'])
1+
@aware(['isTailwind', 'isBootstrap', 'tableName'])
22
@php
33
$customThAttributes = $this->hasReorderThAttributes() ? $this->getReorderThAttributes() : $this->getAllThAttributes($this->getReorderColumn())['customAttributes'];
44
@endphp
55

6-
<x-livewire-tables::table.th.plain x-cloak x-show="currentlyReorderingStatus" wire:key="{{ $this->getTableName }}-thead-reorder" :displayMinimisedOnReorder="false"
6+
<x-livewire-tables::table.th.plain x-cloak x-show="currentlyReorderingStatus" wire:key="{{ $tableName }}-thead-reorder" :displayMinimisedOnReorder="false"
77
{{
88
$attributes->merge($customThAttributes)
99
->class($isTailwind ? [

resources/views/components/table.blade.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
@props(['bulkActionsTdAttributes','bulkActionsTdCheckboxAttributes', 'currentRows'])
33

44

5-
<div>
5+
<div >
66
<div {{ $attributes->merge($coreTableAttributes['wrapper'])
77
->class($isTailwind ? [
88
'border-gray-200 dark:border-gray-700' => $coreTableAttributes['wrapper']['default-colors'] ?? ($coreTableAttributes['wrapper']['default'] ?? false),
@@ -40,11 +40,8 @@
4040
*/
4141
set: function (sortable) {
4242
var order = sortable.toArray();
43-
console.log('Storing Order');
4443
const result = order.filter((word) => (word !== 'thead' && word !== 'tfoot' && word !== 'loading'));
45-
console.log(result);
46-
47-
localStorage.setItem(sortable.options.group.name, result.join('|'));
44+
updateOrderOfItems(result);
4845
}
4946
}
5047
}"

resources/views/components/tfoot/tr/footer.blade.php

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,20 @@
1414

1515

1616
@tableloop($selectedVisibleColumns as $colIndex => $column)
17+
@if($column->hasFooter() && $column->hasFooterCallback())
1718

18-
<x-livewire-tables::table.td.plain wire:key="{{ $tableName . '-footer-datatable-td-' . $column->getSlug() }}" :$column :$colIndex :customAttributes="$this->getFooterTdAttributes($column, $currentRows, $colIndex)">
19+
<x-livewire-tables::table.td.plain wire:key="{{ $tableName . '-footer-datatable-td-' . $column->getSlug() }}" :$column :$colIndex :customAttributes="$this->getFooterTdAttributes($column, $currentRows, $colIndex)">
1920

20-
@if($column->hasFooter() && $column->hasFooterCallback())
21-
@if($column->footerCallbackIsFilter())
22-
{{ $column->getFooterFilter($column->getFooterCallback(), $filterGenericData) }}
23-
@elseif($column->footerCallbackIsString())
24-
{{ $column->getFooterFilter($this->getFilterByKey($column->getFooterCallback()), $filterGenericData) }}
25-
@else
26-
{{ $column->getNewFooterContents($currentRows) }}
27-
@endif
28-
@endif
29-
30-
</x-livewire-tables::table.td.plain>
31-
@endtableloop
21+
@if($column->footerCallbackIsFilter())
22+
{{ $column->getFooterFilter($column->getFooterCallback(), $filterGenericData) }}
23+
@elseif($column->footerCallbackIsString())
24+
{{ $column->getFooterFilter($this->getFilterByKey($column->getFooterCallback()), $filterGenericData) }}
25+
@else
26+
{{ $column->getNewFooterContents($currentRows) }}
27+
@endif
28+
</x-livewire-tables::table.td.plain>
29+
@else
30+
<x-livewire-tables::table.td.plain wire:key="{{ $tableName . '-footer-header-datatable-td-' . $column->getSlug() }}" :$column :$colIndex />
31+
@endif
32+
@endtableloop
3233
</x-livewire-tables::table.tr.plain>

resources/views/components/thead/tr/secondary-header.blade.php

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@
1313
@endif
1414

1515
@tableloop($selectedVisibleColumns as $colIndex => $column)
16-
<x-livewire-tables::table.td.plain wire:key="{{ $tableName . '-secondary-header-datatable-td-' . $column->getSlug() }}" :$column :$colIndex :customAttributes="$this->getSecondaryHeaderTdAttributes($column, $currentRows, $colIndex)">
1716
@if($column->hasSecondaryHeader() && $column->hasSecondaryHeaderCallback())
18-
@if( $column->secondaryHeaderCallbackIsFilter())
19-
{{ $column->getSecondaryHeaderFilter($column->getSecondaryHeaderCallback(), $filterGenericData) }}
20-
@elseif($column->secondaryHeaderCallbackIsString())
21-
{{ $column->getSecondaryHeaderFilter($this->getFilterByKey($column->getSecondaryHeaderCallback()), $filterGenericData) }}
22-
@else
23-
{{ $column->getNewSecondaryHeaderContents($currentRows) }}
24-
@endif
17+
<x-livewire-tables::table.td.plain wire:key="{{ $tableName . '-secondary-header-datatable-td-' . $column->getSlug() }}" :$column :$colIndex :customAttributes="$this->getSecondaryHeaderTdAttributes($column, $currentRows, $colIndex)">
18+
@if( $column->secondaryHeaderCallbackIsFilter())
19+
{{ $column->getSecondaryHeaderFilter($column->getSecondaryHeaderCallback(), $filterGenericData) }}
20+
@elseif($column->secondaryHeaderCallbackIsString())
21+
{{ $column->getSecondaryHeaderFilter($this->getFilterByKey($column->getSecondaryHeaderCallback()), $filterGenericData) }}
22+
@else
23+
{{ $column->getNewSecondaryHeaderContents($currentRows) }}
24+
@endif
25+
</x-livewire-tables::table.td.plain>
26+
@else
27+
<x-livewire-tables::table.td.plain wire:key="{{ $tableName . '-secondary-header-datatable-td-' . $column->getSlug() }}" :$column :$colIndex />
28+
2529
@endif
26-
</x-livewire-tables::table.td.plain>
30+
2731
@endtableloop
2832
</x-livewire-tables::table.tr.plain>

resources/views/components/tools/filter-pills/buttons/reset-all.blade.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
@aware(['isTailwind','isBootstrap','isBootstrap4','isBootstrap5', 'localisationPath'])
2+
@php($resetAllButtonAttributes = $this->getFilterPillsResetAllButtonAttributes())
3+
24
@if ($isTailwind)
35
<button
46
x-on:click.prevent="resetAllFilters"
@@ -7,10 +9,10 @@
79
])>
810
<span
911
{{
10-
$attributes->merge($this->getFilterPillsResetAllButtonAttributes)
12+
$attributes->merge($resetAllButtonAttributes)
1113
->class([
12-
'inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium' => ($this->getFilterPillsResetAllButtonAttributes['default-styling'] ?? true),
13-
'bg-gray-100 text-gray-800 dark:bg-gray-200 dark:text-gray-900' => ($this->getFilterPillsResetAllButtonAttributes['default-colors'] ?? true),
14+
'inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium' => ($resetAllButtonAttributes['default-styling'] ?? true),
15+
'bg-gray-100 text-gray-800 dark:bg-gray-200 dark:text-gray-900' => ($resetAllButtonAttributes['default-colors'] ?? true),
1416
])
1517
->except(['default-styling', 'default-colors'])
1618
}}
@@ -23,10 +25,10 @@
2325
href="#"
2426
x-on:click.prevent="resetAllFilters"
2527
{{
26-
$attributes->merge($this->getFilterPillsResetAllButtonAttributes)
28+
$attributes->merge($resetAllButtonAttributes)
2729
->class([
28-
'badge badge-pill badge-light' => $isBootstrap4 && ($this->getFilterPillsResetAllButtonAttributes['default-styling'] ?? true),
29-
'badge rounded-pill bg-light text-dark text-decoration-none' => $isBootstrap5 && ($this->getFilterPillsResetAllButtonAttribute['default-styling'] ?? true),
30+
'badge badge-pill badge-light' => $isBootstrap4 && ($resetAllButtonAttributes['default-styling'] ?? true),
31+
'badge rounded-pill bg-light text-dark text-decoration-none' => $isBootstrap5 && ($resetAllButtonAttributes['default-styling'] ?? true),
3032
])
3133
->except(['default-styling', 'default-colors'])
3234
}}

resources/views/components/tools/sorting-pills.blade.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
@continue(is_null($column))
1313
@continue($column->isHidden())
14-
@continue($this->columnSelectIsEnabled && ! $this->columnSelectIsEnabledForColumn($column))
14+
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
1515

1616
<span
1717
wire:key="{{ $tableName }}-sorting-pill-{{ $columnSelectName }}"
@@ -24,7 +24,7 @@
2424
->except(['default-styling', 'default-colors'])
2525
}}
2626
>
27-
{{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirectionLabel($direction, $this->getDefaultSortingLabelAsc, $this->getDefaultSortingLabelDesc) }}
27+
{{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirectionLabel($direction, $this->getDefaultSortingLabelAsc(), $this->getDefaultSortingLabelDesc()) }}
2828

2929
<button
3030
wire:click="clearSort('{{ $columnSelectName }}')"
@@ -75,7 +75,7 @@ class="focus:outline-none active:outline-none"
7575

7676
@continue(is_null($column))
7777
@continue($column->isHidden())
78-
@continue($this->columnSelectIsEnabled && ! $this->columnSelectIsEnabledForColumn($column))
78+
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
7979

8080
<span
8181
wire:key="{{ $tableName . '-sorting-pill-' . $columnSelectName }}"
@@ -87,7 +87,7 @@ class="focus:outline-none active:outline-none"
8787
->except(['default-styling', 'default-colors'])
8888
}}
8989
>
90-
{{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirectionLabel($direction, $this->getDefaultSortingLabelAsc, $this->getDefaultSortingLabelDesc) }}
90+
{{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirectionLabel($direction, $this->getDefaultSortingLabelAsc(), $this->getDefaultSortingLabelDesc()) }}
9191

9292
<a
9393
href="#"
@@ -133,7 +133,7 @@ class="focus:outline-none active:outline-none"
133133

134134
@continue(is_null($column))
135135
@continue($column->isHidden())
136-
@continue($this->columnSelectIsEnabled && ! $this->columnSelectIsEnabledForColumn($column))
136+
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))
137137

138138
<span
139139
wire:key="{{ $tableName }}-sorting-pill-{{ $columnSelectName }}"
@@ -145,7 +145,7 @@ class="focus:outline-none active:outline-none"
145145
->except(['default-styling', 'default-colors'])
146146
}}
147147
>
148-
{{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirectionLabel($direction, $this->getDefaultSortingLabelAsc, $this->getDefaultSortingLabelDesc) }}
148+
{{ $column->getSortingPillTitle() }}: {{ $column->getSortingPillDirectionLabel($direction, $this->getDefaultSortingLabelAsc(), $this->getDefaultSortingLabelDesc()) }}
149149

150150
<a
151151
href="#"

resources/views/components/tools/toolbar/items/bulk-actions.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class="origin-top-right absolute right-0 mt-2 w-full md:w-48 rounded-md shadow-l
9292
@else
9393
<div
9494
{{
95-
$attributes->merge($this->getBulkActionsMenuAttributes)
95+
$attributes->merge($this->getBulkActionsMenuAttributes())
9696
->class([
9797
'dropdown-menu dropdown-menu-right w-100' => $isBootstrap4 && ($this->getBulkActionsMenuAttributes['default-styling'] ?? true),
9898
'dropdown-menu dropdown-menu-end w-100' => $isBootstrap5 && ($this->getBulkActionsMenuAttributes['default-styling'] ?? true),

resources/views/components/tools/toolbar/toolbar.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
<x-livewire-tables::tools.toolbar.items.bulk-actions />
6969
@endif
7070

71-
@if ($this->columnSelectIsEnabled)
71+
@if ($this->columnSelectIsEnabled())
7272
<x-livewire-tables::tools.toolbar.items.column-select />
7373
@endif
7474

0 commit comments

Comments
 (0)