Skip to content

Commit

Permalink
v.1.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
gbalduzzi committed Jun 7, 2024
1 parent 0c6de03 commit 36b5060
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 4 deletions.
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,41 @@

All notable changes to `wire-table` will be documented in this file

## 1.5.1 - 2024-06-07

- feat: make paginatedData an accessible computed property
-

## 1.5.0 - 2024-05-10

- feat: support for pagination links on top of the table

## 1.4.0 - 2024-05-08

- feat: Update support to Laravel 11

## 1.3.0 - 2024-02-26

- Feat: Basic support for bulk selection
- Renamed bootstrap theme references to bs (backward-compatible)

## 1.2.0 - 2024-01-31

- Feat: Added global wiretable:reload event to reload tables data
- Removed unused layout references

## 1.1.2 - 2024-01-29

- Fix: use the proper view for simple pagination links

## 1.1.1 - 2024-01-11

- Fix: JS error when changing sorting due to overlap between sortBy method and property

## 1.1.0 - 2024-01-11
- BREAKING: ResetPageOnUpdate is not included by default, but it's automatically added when using the artisan `make:wiretable` command

- BREAKING: ResetPageOnUpdate is not included by default, but it's automatically added when using the
artisan `make:wiretable` command
- Fix: updated the stub namespace to the new Livewire v3 default namespace
- Fix: updated PHP and Laravel dependencies according to new livewire requirements

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"tiknil",
"wire-table"
],
"version": "1.5.0",
"version": "1.5.1",
"homepage": "https://github.com/tiknil/wire-table",
"license": "MIT",
"type": "library",
Expand Down
16 changes: 15 additions & 1 deletion docs/Pagination.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,24 @@ public int $pageSize = 20;

In case you need to reset the current page (e.g. when a filter changes), you can do so with the `resetPage()` method.

### Paginator

You can access the paginator element (e.g. to retrieve the records total) with `$this->paginatedData`, e.g:

```php
$total = $this->paginatedData->total()
```

> [!IMPORTANT]
> `paginatedData` is a livewire computed property. If you change any other property after retrieving the paginator,
> those changes will not affect the query.
>
> It's also important to access the paginator as a property (`$this->paginatedData`) and not as a
> method (`$this->paginatedData()`) to avoid query duplication.
### Placement

By default, pagination links and the record count are shown at the bottom, after the table.
By default, pagination links and the record count are shown at the bottom, after the table.
You can control where to show them by overriding these variables in your component:

```
Expand Down
2 changes: 1 addition & 1 deletion src/WireTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function paginatedData(): Paginator
protected function layoutData(): array
{
return [
'paginator' => $this->paginatedData,
'paginator' => $this->paginatedData(),
'theme' => $this->theme(),
'iconTheme' => $this->iconTheme(),
];
Expand Down

0 comments on commit 36b5060

Please sign in to comment.