Skip to content

Commit

Permalink
V3 Develop to Master -> LW3.0.6 Fixes & collapseAlways (#1410)
Browse files Browse the repository at this point in the history
Co-authored-by: lrljoe <[email protected]>

* Update Reorder Documentation

* Fix DateRangeFilter Blade Items (#1394)

* Add setFilterLabelAttributes Capability

* Adjust documentation for setCustomFilterLabel

---------

Co-authored-by: lrljoe <[email protected]>

* v3 - Apply Reorder Sorting When Reordering (#1402)
---------

Co-authored-by: lrljoe <[email protected]>

* v3 - Fix Unrequired Update Call (#1407)

* Increase cache time to 1 day from 1 hour


---------

Co-authored-by: lrljoe <[email protected]>

* v3 - Adding CollapseAlways Option for Columns (#1403)

---------

Co-authored-by: lrljoe <[email protected]>

* V3 - Fix Reorder Cols (#1412)
---------

Co-authored-by: lrljoe <[email protected]>
Co-authored-by: Anthony Rappa <[email protected]>
  • Loading branch information
3 people authored Oct 13, 2023
1 parent babe430 commit 4985e9b
Show file tree
Hide file tree
Showing 30 changed files with 265 additions and 109 deletions.
19 changes: 14 additions & 5 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@
/phpunit.result.cache export-ignore
/phpstan.neon export-ignore
/phpunit.xml.dist export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
/codecov.yml export-ignore
/coverage.xml export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
/codecov.yml export-ignore
/coverage.xml export-ignore

# Exclude unminified versions of files
/resources/js/laravel-livewire-tables-thirdparty.js export-ignore
/resources/js/laravel-livewire-tables.js export-ignore
/resources/css/laravel-livewire-tables-thirdparty.css export-ignore
/resources/css/laravel-livewire-tables.css export-ignore
/resources/css/numberRange.css export-ignore
/resources/css/numericSlider.css export-ignore
/resources/css/flatpickr.css export-ignore
9 changes: 7 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,18 @@

All notable changes to `laravel-livewire-tables` will be documented in this file

## [3.0.0-beta.1] - 2023-10-08
## [3.0.0-beta.3] - 2023-10-13
- Fix for Livewire ^3.0.6 where the table loading causes an additional lifecycle
- Add unminified files to .gitattributes export-ignore
- Increase cached time to 1 day from 1 hour if cache is enabled

## [3.0.0-beta.2] - 2023-10-08
- Removes superfluous @endphp from the DateRangeFilter blade
- Removes reference to remote/published 3rd party assets
- Add setFilterLabelAttributes Capability Per-Filter
- Fix for reorder sort not applying automatically

## [3.0.0-beta.0] - 3.x Initial Release
## [3.0.0-beta.1] - 3.x Initial Release
- Amending Documentation for Reordering
- Adding capabilities & tests for setTrAttributes
- Force calculation of even/odd only once in reorder mode
Expand Down
10 changes: 9 additions & 1 deletion docs/columns/available-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,15 @@ The component has the ability to collapse certain columns at different screen si

![Collapsing](https://imgur.com/z1rWHzP.png)

You have 2 options when it comes to collapsing.
You have 3 options when it comes to collapsing.

Collapse Always:

```php
Column::make('Name')
->collapseAlways(),
```
The columns will always be collapsed

Collapse on tablet:

Expand Down
4 changes: 2 additions & 2 deletions resources/imports/laravel-livewire-tables-all.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../js/laravel-livewire-tables-thirdparty.min.js'
import '../js/laravel-livewire-tables.min.js'
import '../css/laravel-livewire-tables-thirdparty.css'
import '../css/laravel-livewire-tables.css'
import '../css/laravel-livewire-tables-thirdparty.min.css'
import '../css/laravel-livewire-tables.min.css'
2 changes: 1 addition & 1 deletion resources/imports/laravel-livewire-tables-thirdparty.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import '../css/laravel-livewire-tables-thirdparty.css'
import '../css/laravel-livewire-tables-thirdparty.min.css'
import '../js/laravel-livewire-tables-thirdparty.min.js'
2 changes: 1 addition & 1 deletion resources/imports/laravel-livewire-tables.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import '../css/laravel-livewire-tables.css'
import '../css/laravel-livewire-tables.min.css'
import '../js/laravel-livewire-tables.min.js'
2 changes: 0 additions & 2 deletions resources/js/flatpickr.min.js

This file was deleted.

6 changes: 3 additions & 3 deletions resources/js/laravel-livewire-tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ document.addEventListener('alpine:init', () => {
Alpine.data('tableWrapper', (wire, showBulkActionsAlpine) => ({
childElementOpen: false,
filtersOpen: wire.entangle('filterSlideDownDefaultVisible'),
paginationCurrentCount: wire.entangle('paginationCurrentCount').live,
paginationTotalItemCount: wire.entangle('paginationTotalItemCount').live,
paginationCurrentItems: wire.entangle('paginationCurrentItems').live,
paginationCurrentCount: wire.entangle('paginationCurrentCount'),
paginationTotalItemCount: wire.entangle('paginationTotalItemCount'),
paginationCurrentItems: wire.entangle('paginationCurrentItems'),
selectedItems: wire.entangle('selected'),
alwaysShowBulkActions: !wire.entangle('hideBulkActionsWhenEmpty'),
toggleSelectAll() {
Expand Down
2 changes: 1 addition & 1 deletion resources/js/laravel-livewire-tables.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion resources/laravel-livewire-tables.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import './css/laravel-livewire-tables.css'
import './css/laravel-livewire-tables.min.css'
import './js/laravel-livewire-tables.js'
23 changes: 17 additions & 6 deletions resources/views/components/table/row-contents.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
$colspan = $component->getColspanCount();
$columns = collect();
if($component->shouldCollapseAlways())
{
$columns->push($component->getCollapsedAlwaysColumns());
}
if ($component->shouldCollapseOnMobile() && $component->shouldCollapseOnTablet()) {
$columns->push($component->getCollapsedMobileColumns());
$columns->push($component->getCollapsedTabletColumns());
Expand All @@ -26,8 +30,8 @@
wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60"

@class([
'hidden md:hidden bg-white dark:bg-gray-700 dark:text-white' => $component->isTailwind(),
'd-none d-md-none' => $component->isBootstrap()
'hidden bg-white dark:bg-gray-700 dark:text-white' => $component->isTailwind(),
'd-none' => $component->isBootstrap()
])
>
<td
Expand All @@ -43,11 +47,18 @@
@continue($this->columnSelectIsEnabled() && ! $this->columnSelectIsEnabledForColumn($column))

<p wire:key="{{ $tableName }}-row-{{ $row->{$this->getPrimaryKey()} }}-collapsed-contents-{{ $colIndex }}"

@class([
'block mb-2 sm:hidden' => $component->isTailwind() && $column->shouldCollapseOnMobile(),
'block mb-2 md:hidden' => $component->isTailwind() && $column->shouldCollapseOnTablet(),
'd-block mb-2 d-sm-none' => $component->isBootstrap() && $column->shouldCollapseOnMobile(),
'd-block mb-2 d-md-none' => $component->isBootstrap() && $column->shouldCollapseOnTablet(),
'block mb-2' => $component->isTailwind() && $column->shouldCollapseAlways(),
'block mb-2 sm:hidden' => $component->isTailwind() && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && !$column->shouldCollapseOnMobile(),
'block mb-2 md:hidden' => $component->isTailwind() && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && $column->shouldCollapseOnMobile(),
'block mb-2 lg:hidden' => $component->isTailwind() && !$column->shouldCollapseAlways() && ($column->shouldCollapseOnTablet() || $column->shouldCollapseOnMobile()),
'd-block mb-2' => $component->isBootstrap() && $column->shouldCollapseAlways(),
'd-block mb-2 d-sm-none' => $component->isBootstrap() && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && !$column->shouldCollapseOnMobile(),
'd-block mb-2 d-md-none' => $component->isBootstrap() && !$column->shouldCollapseAlways() && !$column->shouldCollapseOnTablet() && $column->shouldCollapseOnMobile(),
'd-block mb-2 d-lg-none' => $component->isBootstrap() && !$column->shouldCollapseAlways() && ($column->shouldCollapseOnTablet() || $column->shouldCollapseOnMobile()),
])
>
<strong>{{ $column->getTitle() }}</strong>: {{ $column->renderContents($row) }}
Expand Down
Loading

0 comments on commit 4985e9b

Please sign in to comment.