Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v3.4.22 Master Release #1972

Merged
merged 91 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
30d65ac
Add explanation of setRefreshMethod (#1857)
lrljoe Aug 16, 2024
b3137d9
Unlocking Entangled Items (#1859)
lrljoe Aug 17, 2024
b6890e9
Add dispatch on updated filter components (#1861)
lrljoe Aug 18, 2024
fb646a5
v3.4.8
lrljoe Aug 18, 2024
4a18b05
Merge branch 'master' into development
lrljoe Aug 18, 2024
8eafffe
Fix superfluous bulk actions tr < (#1868)
lrljoe Aug 21, 2024
d1a563f
Default useComputedProperties to False (#1869)
lrljoe Aug 21, 2024
da50aa1
Update ChangeLog
lrljoe Aug 21, 2024
1ff4126
Merge branch 'master' into development
lrljoe Aug 21, 2024
74c35e2
Add Action Buttons (#1864)
lrljoe Aug 21, 2024
46d2752
FixDateRangeFilter (#1872)
lrljoe Aug 23, 2024
7aa4268
Adjust Methods - useComputedProperties (#1873)
lrljoe Aug 23, 2024
3456674
Update ChangeLog
lrljoe Aug 23, 2024
6480f1a
Merge branch 'master' into development
lrljoe Aug 23, 2024
32fe628
AllowDeleteDateRangeFilter (#1875)
lrljoe Aug 23, 2024
1f0c14d
Fix ChangeLog
lrljoe Aug 23, 2024
b80be2d
Update Docs (#1876)
lrljoe Aug 23, 2024
f0c5d04
Update ChangeLog - Add Docs Update
lrljoe Aug 23, 2024
ec5401a
Add setIconLeft/setIconRight (#1877)
lrljoe Aug 23, 2024
ae019cf
Adjust ChangeLog
lrljoe Aug 23, 2024
8e33fba
Merge branch 'master' into development
lrljoe Aug 23, 2024
edc7ea3
Adjust Action Button Icon Margin (#1880)
lrljoe Aug 23, 2024
79cf988
Merge branch 'master' into development
lrljoe Aug 23, 2024
6766707
Change Order of "Getting Started" section (#1883)
lrljoe Aug 24, 2024
39c5032
Add Button with No Icon (#1887)
lrljoe Aug 25, 2024
918bd31
Add a "Recommended" approach (#1886)
lrljoe Aug 25, 2024
1d18cb2
v3.4.13
lrljoe Aug 25, 2024
683666f
Merge branch 'master' into development
lrljoe Aug 25, 2024
8cafe98
Set actions position (#1889)
lrljoe Aug 25, 2024
5007627
Update ChangeLog
lrljoe Aug 25, 2024
b927a98
Merge branch 'master' into development
lrljoe Aug 25, 2024
d0da3b1
Doc Type Fixes (#1891)
lrljoe Aug 25, 2024
2a977ec
BooleanColumn - Toggleable Callback (#1892)
lrljoe Aug 25, 2024
a61ba21
Update ChangeLog
lrljoe Aug 25, 2024
e1acab7
Merge branch 'master' into development
lrljoe Aug 25, 2024
c14692b
Enable/Disable Tools/Toolbar (#1896)
lrljoe Aug 26, 2024
84eaf9b
Use Computed Properties By Default (#1898)
lrljoe Aug 26, 2024
0b0d9cb
Fix has actions (#1901)
lrljoe Aug 26, 2024
0882827
Add icon column (#1902)
lrljoe Aug 27, 2024
6ff95af
Add Baseline - Convert phpstan.neon to tabs (#1903)
lrljoe Aug 27, 2024
ce76b40
Update ChangeLog
lrljoe Aug 27, 2024
244951b
Merge branch 'master' into development
lrljoe Aug 27, 2024
570abdc
Save filter selection to session (BETA) (#1910)
lrljoe Sep 1, 2024
1f076af
Add hide table option (#1914)
lrljoe Sep 1, 2024
bf84029
Add column select session methods (#1913)
lrljoe Sep 1, 2024
2ebaf3b
Use Core HasTheme Methods (#1915)
lrljoe Sep 1, 2024
2322e8d
Use Core Attribute Bag (#1916)
lrljoe Sep 1, 2024
ed64834
Merge branch 'master' into development
lrljoe Sep 1, 2024
a63fb44
Fix ChangeLog
lrljoe Sep 1, 2024
2fd6014
Add Polish translation by @meavric (#1925)
lrljoe Sep 4, 2024
a7b1f68
Merge branch 'master' into development
lrljoe Sep 4, 2024
3a04d51
Add Vertical Scrolling Example (#1926)
lrljoe Sep 4, 2024
2a4b2d1
Adjusting contributing
lrljoe Sep 4, 2024
f1e041e
Fix missing variable in workflow (#1933)
lrljoe Sep 8, 2024
5b326cc
Fixes for ButtonGroupColumn, ImageColumn, LinkColumn - to not default…
lrljoe Sep 8, 2024
82e6e70
Add button type to tailwind pagination blade template (#1928)
matzeschmitt Sep 8, 2024
d5bdd7b
v3.4.19 ChangeLog
lrljoe Sep 8, 2024
1be3aad
Merge branch 'master' into development
lrljoe Sep 8, 2024
6a63e9f
Revert tableName to be public (#1937)
lrljoe Sep 10, 2024
05e0221
v3.4.20 ChangeLog
lrljoe Sep 10, 2024
90d6ffb
Merge branch 'master' into development
lrljoe Sep 10, 2024
530b0bf
Migration to Core attribute management (#1943)
lrljoe Sep 12, 2024
a76ae7b
Update docs - add Action setLabelAttributes method (#1952)
lrljoe Sep 18, 2024
07e8dbc
Reset Page on "Per Page" changing (#1953)
lrljoe Sep 18, 2024
256b12d
Localisation - Avoid Conflicts With Other Packages (#1955)
lrljoe Sep 20, 2024
bb005d0
Add filterComponents into queryString (#1957)
lrljoe Sep 21, 2024
1dfaca1
Fix syntax for DateColumn outputFormat in docs (#1960)
lrljoe Sep 21, 2024
a6c150a
Fix Filter Pills Icon - Tailwind (#1961)
lrljoe Sep 22, 2024
1760c3c
Add original translation strings - for use in published views (#1959)
lrljoe Sep 22, 2024
1817b9f
Fix for Search Field Attribute Defaults (#1962)
lrljoe Sep 22, 2024
3f7898f
Change the type of LaravelLivewireTablesEvent::$user from Illuminate\…
khwadj Sep 24, 2024
74a0cc8
Remove persist from getFilterGenericData (#1966)
lrljoe Sep 24, 2024
d19dba0
Update ChangeLog
lrljoe Sep 24, 2024
5f6e5d6
Update Pint Workflow (#1967)
lrljoe Sep 24, 2024
e222c1e
Update Discord Releases Workflow (#1968)
lrljoe Sep 24, 2024
5c47e61
Update ChangeLog
lrljoe Sep 24, 2024
2f4224b
Merge branch 'master' into development
lrljoe Sep 24, 2024
2d7f705
Fix Loading Placeholder Bug - Breaking Table (#1969)
lrljoe Sep 25, 2024
71717f9
v3.4.22 ChangeLog
lrljoe Sep 25, 2024
566a039
Merge branch 'master' into development
lrljoe Sep 25, 2024
9a8436f
Update ChangeLog
lrljoe Sep 27, 2024
905b43c
Add comment on getTitle (#1976)
lrljoe Sep 29, 2024
fd13aa9
Add before-wrapper and after-wrapper configurable areas (#1977)
lrljoe Sep 29, 2024
6bf0d09
Add initial commit for setPaginationWrapperAttributes (#1978)
lrljoe Sep 29, 2024
b4a247d
Update ChangeLog
lrljoe Sep 29, 2024
8b3df64
Update ChangeLog
lrljoe Sep 29, 2024
a7b1579
Adjust ChangeLog Date
lrljoe Sep 29, 2024
cd89e9e
Add ToolsAttributes and ToolbarAttributes (#1982)
lrljoe Sep 29, 2024
cf0a41f
Add docs for the ColumnSelect lifecycle hooks (#1983)
lrljoe Sep 29, 2024
7dc5e8f
Add setToolsAttributes and setToolBarAttributes docs (#1984)
lrljoe Sep 30, 2024
61a9b66
Update ChangeLog
lrljoe Sep 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@

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

## [v3.4.22] - 2024-09-29
### Bug Fixes
- Fix Loading Placeholder Bug - Breaking Table by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1969

### New Features
- Add setPaginationWrapperAttributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1978
- Add configurable areas - before-wrapper and after-wrapper by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1977
- Add ToolsAttributes and ToolbarAttributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1982

### Docs
- Add getTitle reference for setTdAttributes/setTrAttributes by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1976
- Add setToolsAttributes and setToolBarAttributes docs by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1984
- Add docs for the ColumnSelect lifecycle hooks by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1983

## [v3.4.21] - 2024-09-25
### Bug Fixes
- Remove persist from getFilterGenericData by @lrljoe in https://github.com/rappasoft/laravel-livewire-tables/pull/1966
Expand Down
10 changes: 10 additions & 0 deletions docs/columns/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ Below is a copy of the relevant sections from [datatable styling](../datatable/s

Set a list of attributes to override on the th elements.

If your Column does not have a field (e.g. a label column), then you may use the following, which will utilise the first parameter in Column::make()
```php
$column->getTitle()
```

```php
public function configure(): void
{
Expand Down Expand Up @@ -204,6 +209,11 @@ public function configure(): void

Set a list of attributes to override on the td elements. For example, changing the background color between red/green based on whether the "total" field is over or under 1000.

If your Column does not have a field (e.g. a label column), then you may use the following, which will utilise the first parameter in Column::make()
```php
$column->getTitle()
```

```php
public function configure(): void
{
Expand Down
2 changes: 2 additions & 0 deletions docs/datatable/configurable-areas.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ You can use the `setConfigurableAreas` method to set multiple areas that you wan
public function configure(): void
{
$this->setConfigurableAreas([
'before-wrapper' => 'path.to.my.view',
'before-tools' => 'path.to.my.view',
'toolbar-left-start' => 'path.to.my.view',
'toolbar-left-end' => 'path.to.my.view',
Expand All @@ -35,6 +36,7 @@ public function configure(): void
'after-toolbar' => 'path.to.my.view',
'before-pagination' => 'path.to.my.view',
'after-pagination' => 'path.to.my.view',
'after-wrapper' => 'path.to.my.view',
]);
}
```
Expand Down
10 changes: 10 additions & 0 deletions docs/datatable/styling.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,11 @@ public function configure(): void

Set a list of attributes to override on the th elements.

If your Column does not have a field (e.g. a label column), then you may use the following, which will utilise the first parameter in Column::make()
```php
$column->getTitle()
```

```php
public function configure(): void
{
Expand Down Expand Up @@ -311,6 +316,11 @@ public function configure(): void

Set a list of attributes to override on the td elements

If your Column does not have a field (e.g. a label column), then you may use the following, which will utilise the first parameter in Column::make()
```php
$column->getTitle()
```

```php
public function configure(): void
{
Expand Down
6 changes: 6 additions & 0 deletions docs/misc/lifecycle-hooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ This is called prior to setting up the available Columns via the columns() metho
## columnsSet
This is called immediately after the Columns are set up

## configuringColumnSelect
This is called immediately prior to setting up Column Select

## configuredColumnSelect
This is called immediately after setting up Column Select

## rowsRetrieved
This is called immediately after the query is executed, and is passed the result from the executed query.

Expand Down
26 changes: 25 additions & 1 deletion docs/misc/tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,28 @@ Disables the Toolbar, which contains the Reorder, Filters, Search, Column Select
{
$this->setToolBarDisabled();
}
```
```

### setToolsAttributes
Allows setting of attributes for the parent element in the tools blade

By default, this replaces the default classes on the tools blade, if you would like to keep them, set the default-colors/default-styling flags to true as appropriate

```php
public function configure(): void
{
$this->setToolsAttributes(['class' => ' bg-green-500', 'default-colors' => false, 'default-styling' => true]);
}
```

### setToolBarAttributes
Allows setting of attributes for the parent element in the toolbar blade.

By default, this replaces the default classes on the toolbar blade, if you would like to keep them, set the default-colors/default-styling flags to true as appropriate

```php
public function configure(): void
{
$this->setToolBarAttributes(['class' => ' bg-red-500', 'default-colors' => false, 'default-styling' => true]);
}
```
11 changes: 11 additions & 0 deletions docs/pagination/available-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,3 +296,14 @@ public function configure(): void
$this->setShouldRetrieveTotalItemCountDisabled();
}
```

## setPaginationWrapperAttributes

Used to set attributes for the "div" that wraps the pagination section

```php
public function configure(): void
{
$this->setPaginationWrapperAttributes(['class' => 'text-lg']);
}
```
8 changes: 4 additions & 4 deletions resources/views/components/includes/loading.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
@include($this->getLoadingPlaceHolderBlade(), ['colCount' => $colCount])
@else

<tr wire:key="{{ $tableName }}-loader" class="hidden d-none"
<tr wire:key="{{ $tableName }}-loader"
{{
$attributes->merge($customAttributes['loader-wrapper'])
->class(['w-full text-center h-screen place-items-center align-middle' => $isTailwind && ($customAttributes['loader-wrapper']['default'] ?? true)])
->class(['w-100 text-center h-100 align-items-center' => $isBootstrap && ($customAttributes['loader-wrapper']['default'] ?? true)]);
->class(['hidden w-full text-center h-screen place-items-center align-middle' => $isTailwind && ($customAttributes['loader-wrapper']['default'] ?? true)])
->class(['d-none w-100 text-center h-100 align-items-center' => $isBootstrap && ($customAttributes['loader-wrapper']['default'] ?? true)]);
}}
wire:loading.class.remove="hidden d-none"
>
<td colspan="{{ $colCount }}">
<td colspan="{{ $colCount }}" wire:key="{{ $tableName }}-loader-column" >
<div class="h-min self-center align-middle text-center">
<div class="lds-hourglass"
{{
Expand Down
22 changes: 13 additions & 9 deletions resources/views/components/pagination.blade.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
@aware(['component','isTailwind','isBootstrap','isBootstrap4','isBootstrap5'])

@if ($this->hasConfigurableAreaFor('before-pagination'))
@include($this->getConfigurableAreaFor('before-pagination'), $this->getParametersForConfigurableArea('before-pagination'))
@endif
@includeWhen(
$this->hasConfigurableAreaFor('before-pagination'),
$this->getConfigurableAreaFor('before-pagination'),
$this->getParametersForConfigurableArea('before-pagination')
)

@if ($this->isTailwind)
<div>
<div {{ $this->getPaginationWrapperAttributesBag() }}>
@if ($this->paginationVisibilityIsEnabled())
<div class="mt-4 px-4 md:p-0 sm:flex justify-between items-center space-y-4 sm:space-y-0">
<div>
Expand Down Expand Up @@ -47,7 +49,7 @@
@endif
</div>
@elseif ($this->isBootstrap4)
<div >
<div {{ $this->getPaginationWrapperAttributesBag() }}>
@if ($this->paginationVisibilityIsEnabled())
@if ($this->paginationIsEnabled() && $this->isPaginationMethod('standard') && $this->getRows->lastPage() > 1)
<div class="row mt-3">
Expand Down Expand Up @@ -100,7 +102,7 @@
@endif
</div>
@elseif ($this->isBootstrap5)
<div >
<div {{ $this->getPaginationWrapperAttributesBag() }} >
@if ($this->paginationVisibilityIsEnabled())
@if ($this->paginationIsEnabled() && $this->isPaginationMethod('standard') && $this->getRows->lastPage() > 1)
<div class="row mt-3">
Expand Down Expand Up @@ -152,6 +154,8 @@
</div>
@endif

@if ($this->hasConfigurableAreaFor('after-pagination'))
@include($this->getConfigurableAreaFor('after-pagination'), $this->getParametersForConfigurableArea('after-pagination'))
@endif
@includeWhen(
$this->hasConfigurableAreaFor('after-pagination'),
$this->getConfigurableAreaFor('after-pagination'),
$this->getParametersForConfigurableArea('after-pagination')
)
4 changes: 2 additions & 2 deletions resources/views/components/table/tr.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
x-on:dragover.prevent.throttle.500ms="currentlyReorderingStatus && dragOverEvent(event)"
x-on:dragleave.prevent.throttle.500ms="currentlyReorderingStatus && dragLeaveEvent(event)"
@if($this->hasDisplayLoadingPlaceholder())
wire:loading.remove
wire:loading.class.add="hidden d-none"
@else
wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60"
wire:loading.class.delay="opacity-50 dark:bg-gray-900 dark:opacity-60"
@endif
id="{{ $tableName }}-row-{{ $row->{$primaryKey} }}"
:draggable="currentlyReorderingStatus"
Expand Down
12 changes: 8 additions & 4 deletions resources/views/components/tools.blade.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
@aware(['component','isTailwind','isBootstrap'])
@php($toolsAttributes = $this->getToolsAttributesBag())

<div @class([
'flex-col' => $isTailwind,
'd-flex flex-column ' => ($isBootstrap),
])>
<div {{
$toolsAttributes->merge()
->class(['flex-col' => $isTailwind && ($toolsAttributes['default-styling'] ?? true)])
->class(['d-flex flex-column' => $isBootstrap && ($toolsAttributes['default-styling'] ?? true)])
->except(['default','default-styling','default-colors'])
}}
>
{{ $slot }}
</div>
20 changes: 10 additions & 10 deletions resources/views/components/tools/toolbar.blade.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
@aware(['component', 'tableName','isTailwind','isBootstrap'])
@props([])
@php($toolBarAttributes = $this->getToolBarAttributesBag())

<div @class([
'd-md-flex justify-content-between mb-3' => $this->isBootstrap,
'md:flex md:justify-between mb-4 px-4 md:p-0' => $this->isTailwind,
])
<div
{{
$toolBarAttributes->merge()
->class(['md:flex md:justify-between mb-4 px-4 md:p-0' => $isTailwind && ($toolBarAttributes['default-styling'] ?? true)])
->class(['d-md-flex justify-content-between mb-3' => $isBootstrap && ($toolBarAttributes['default-styling'] ?? true)])
->except(['default','default-styling','default-colors'])
}}
>
<div @class([
'd-md-flex' => $this->isBootstrap,
Expand Down Expand Up @@ -52,9 +56,7 @@
'md:flex md:items-center space-y-4 md:space-y-0 md:space-x-2' => $this->isTailwind,
])
>
@if ($this->hasConfigurableAreaFor('toolbar-right-start'))
@include($this->getConfigurableAreaFor('toolbar-right-start'), $this->getParametersForConfigurableArea('toolbar-right-start'))
@endif
@includeWhen($this->hasConfigurableAreaFor('toolbar-right-start'), $this->getConfigurableAreaFor('toolbar-right-start'), $this->getParametersForConfigurableArea('toolbar-right-start'))

@if($this->hasActions && $this->showActionsInToolbar && $this->getActionsPosition == 'right')
<x-livewire-tables::includes.actions/>
Expand All @@ -72,9 +74,7 @@
<x-livewire-tables::tools.toolbar.items.pagination-dropdown />
@endif

@if ($this->hasConfigurableAreaFor('toolbar-right-end'))
@include($this->getConfigurableAreaFor('toolbar-right-end'), $this->getParametersForConfigurableArea('toolbar-right-end'))
@endif
@includeWhen($this->hasConfigurableAreaFor('toolbar-right-end'), $this->getConfigurableAreaFor('toolbar-right-end'), $this->getParametersForConfigurableArea('toolbar-right-end'))
</div>
</div>
@if (
Expand Down
36 changes: 31 additions & 5 deletions resources/views/datatable.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,24 @@
@php($isBootstrap5 = $this->isBootstrap5)

<div {{ $this->getTopLevelAttributes() }}>

@includeWhen(
$this->hasConfigurableAreaFor('before-wrapper'),
$this->getConfigurableAreaFor('before-wrapper'),
$this->getParametersForConfigurableArea('before-wrapper')
)

<x-livewire-tables::wrapper :component="$this" :tableName="$tableName" :$primaryKey :$isTailwind :$isBootstrap :$isBootstrap4 :$isBootstrap5>
@if($this->hasActions && !$this->showActionsInToolbar)
<x-livewire-tables::includes.actions/>
@endif


@if ($this->hasConfigurableAreaFor('before-tools'))
@include($this->getConfigurableAreaFor('before-tools'), $this->getParametersForConfigurableArea('before-tools'))
@endif
@includeWhen(
$this->hasConfigurableAreaFor('before-tools'),
$this->getConfigurableAreaFor('before-tools'),
$this->getParametersForConfigurableArea('before-tools')
)

@if($this->shouldShowTools)
<x-livewire-tables::tools>
Expand All @@ -26,11 +35,21 @@
<x-livewire-tables::tools.filter-pills />
@endif

@includeWhen($this->hasConfigurableAreaFor('before-toolbar'), $this->getConfigurableAreaFor('before-toolbar'), $this->getParametersForConfigurableArea('before-toolbar'))
@includeWhen(
$this->hasConfigurableAreaFor('before-toolbar'),
$this->getConfigurableAreaFor('before-toolbar'),
$this->getParametersForConfigurableArea('before-toolbar')
)

@if($this->shouldShowToolBar)
<x-livewire-tables::tools.toolbar />
@endif
@includeWhen($this->hasConfigurableAreaFor('after-toolbar'), $this->getConfigurableAreaFor('after-toolbar'), $this->getParametersForConfigurableArea('after-toolbar'))

@includeWhen(
$this->hasConfigurableAreaFor('after-toolbar'),
$this->getConfigurableAreaFor('after-toolbar'),
$this->getParametersForConfigurableArea('after-toolbar')
)

</x-livewire-tables::tools>
@endif
Expand Down Expand Up @@ -110,4 +129,11 @@

@includeIf($customView)
</x-livewire-tables::wrapper>

@includeWhen(
$this->hasConfigurableAreaFor('after-wrapper'),
$this->getConfigurableAreaFor('after-wrapper'),
$this->getParametersForConfigurableArea('after-wrapper')
)

</div>
7 changes: 7 additions & 0 deletions src/Traits/Configuration/PaginationConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,11 @@ public function setShouldRetrieveTotalItemCountDisabled(): self

return $this;
}

public function setPaginationWrapperAttributes(array $paginationWrapperAttributes): self
{
$this->paginationWrapperAttributes = array_merge(['class' => ''], $paginationWrapperAttributes);

return $this;
}
}
5 changes: 5 additions & 0 deletions src/Traits/Core/HasCustomAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,9 @@ public function setCustomAttributes(string $propertyName, array $customAttribute

return $this;
}

public function getCustomAttributesBagFromArray(array $attributesArray): ComponentAttributeBag
{
return new ComponentAttributeBag($attributesArray);
}
}
12 changes: 12 additions & 0 deletions src/Traits/Helpers/PaginationHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Rappasoft\LaravelLivewireTables\Traits\Helpers;

use Illuminate\View\ComponentAttributeBag;
use Livewire\Attributes\Computed;

trait PaginationHelpers
Expand Down Expand Up @@ -155,4 +156,15 @@ public function getShouldRetrieveTotalItemCount(): bool
{
return $this->shouldRetrieveTotalItemCount;
}

public function getPaginationWrapperAttributes(): array
{
return $this->paginationWrapperAttributes ?? ['class' => ''];
}

#[Computed]
public function getPaginationWrapperAttributesBag(): ComponentAttributeBag
{
return new ComponentAttributeBag($this->getPaginationWrapperAttributes());
}
}
Loading
Loading