Skip to content

Commit

Permalink
Fix Collapsing Columns - View Point Break Incorrect (#1665)
Browse files Browse the repository at this point in the history
* Collapsing Fix 1.0

* Fix styling

* Hide Reorder When Not Reordering

* Update Changelog & Version

* Update Changelog

---------

Co-authored-by: lrljoe <lrljoe@users.noreply.github.com>
  • Loading branch information
lrljoe and lrljoe authored Feb 24, 2024
1 parent f20721a commit 52dac06
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
8 changes: 4 additions & 4 deletions resources/views/components/table/td.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
$attributes->merge($customAttributes)
->class(['px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $component->isTailwind() && ($customAttributes['default'] ?? true)])
->class(['hidden' => $component->isTailwind() && $column && $column->shouldCollapseAlways()])
->class(['hidden sm:table-cell' => $component->isTailwind() && $column && $column->shouldCollapseOnMobile()])
->class(['hidden md:table-cell' => $component->isTailwind() && $column && $column->shouldCollapseOnTablet()])
->class(['hidden md:table-cell' => $component->isTailwind() && $column && $column->shouldCollapseOnMobile()])
->class(['hidden lg:table-cell' => $component->isTailwind() && $column && $column->shouldCollapseOnTablet()])
->class(['' => $component->isBootstrap() && ($customAttributes['default'] ?? true)])
->class(['d-none' => $component->isBootstrap() && $column && $column->shouldCollapseAlways()])
->class(['d-none d-sm-table-cell' => $component->isBootstrap() && $column && $column->shouldCollapseOnMobile()])
->class(['d-none d-md-table-cell' => $component->isBootstrap() && $column && $column->shouldCollapseOnTablet()])
->class(['d-none d-md-table-cell' => $component->isBootstrap() && $column && $column->shouldCollapseOnMobile()])
->class(['d-none d-lg-table-cell' => $component->isBootstrap() && $column && $column->shouldCollapseOnTablet()])
->style(['cursor:pointer' => $component->isBootstrap()])
->except('default')
}}
Expand Down
8 changes: 4 additions & 4 deletions resources/views/components/table/td/plain.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
->merge($customAttributes)
->class(['px-6 py-4 whitespace-nowrap text-sm font-medium dark:text-white' => $customAttributes['default'] ?? true])
->class(['hidden' => $column && $column->shouldCollapseAlways()])
->class(['hidden sm:table-cell' => $column && $column->shouldCollapseOnMobile()])
->class(['hidden md:table-cell' => $column && $column->shouldCollapseOnTablet()])
->class(['hidden md:table-cell' => $column && $column->shouldCollapseOnMobile()])
->class(['hidden lg:table-cell' => $column && $column->shouldCollapseOnTablet()])
->except('default')
}} @if($hideUntilReorder) x-show="reorderDisplayColumn" @endif >
{{ $slot }}
Expand All @@ -17,8 +17,8 @@
->merge($customAttributes)
->class(['' => $customAttributes['default'] ?? true])
->class(['d-none' => $column && $column->shouldCollapseAlways()])
->class(['d-none d-sm-table-cell' => $column && $column->shouldCollapseOnMobile()])
->class(['d-none d-md-table-cell' => $column && $column->shouldCollapseOnTablet()])
->class(['d-none d-md-table-cell' => $column && $column->shouldCollapseOnMobile()])
->class(['d-none d-lg-table-cell' => $column && $column->shouldCollapseOnTablet()])
->except('default')
}}>
{{ $slot }}
Expand Down
8 changes: 6 additions & 2 deletions resources/views/datatable.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@

<x-livewire-tables::table>
<x-slot name="thead">
<x-livewire-tables::table.th.reorder x-cloak x-show="currentlyReorderingStatus" />
<x-livewire-tables::table.th.bulk-actions :displayMinimisedOnReorder="true" />
@if($this->getCurrentlyReorderingStatus())
<x-livewire-tables::table.th.reorder x-cloak x-show="currentlyReorderingStatus" />
@endif
@if($this->bulkActionsAreEnabled() && $this->hasBulkActions())
<x-livewire-tables::table.th.bulk-actions :displayMinimisedOnReorder="true" />
@endif
<x-livewire-tables::table.th.collapsed-columns />

@foreach($columns as $index => $column)
Expand Down
2 changes: 1 addition & 1 deletion src/LaravelLivewireTablesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LaravelLivewireTablesServiceProvider extends ServiceProvider
public function boot(): void
{

AboutCommand::add('Rappasoft Laravel Livewire Tables', fn () => ['Version' => '3.0.0']);
AboutCommand::add('Rappasoft Laravel Livewire Tables', fn () => ['Version' => '3.2.1']);

$this->mergeConfigFrom(
__DIR__.'/../config/livewire-tables.php', 'livewire-tables'
Expand Down

0 comments on commit 52dac06

Please sign in to comment.