Skip to content

Commit ffc9247

Browse files
committed
Migrate pagination into array
1 parent b31e3f8 commit ffc9247

29 files changed

+392
-662
lines changed

docs/columns/column-selection.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,18 @@ public function configure(): void
155155
}
156156
```
157157

158+
### setColumnSelectDelay
159+
160+
Set the delay when selecting Columns
161+
```php
162+
public function configure(): void
163+
{
164+
// Defaults to 1500
165+
$this->setColumnSelectDelay(500);
166+
}
167+
```
168+
169+
158170
### setDataTableFingerprint
159171

160172
In order to idenfify each table and prevent conflicts on column selection, each table is given a unique fingerprint.

docs/tools/toolbar.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@ title: ToolBar
33
weight: 3
44
---
55

6+
The Toolbar provides several key features:
7+
8+
| Item | Purpose |
9+
| --- | --- |
10+
| 'bulk-actions' | The Bulk Actions dropdown - if Bulk Actions are defined, then this displays a list of the Bulk Actions |
11+
| 'column-select' | Column Select dropdown - allowing for toggling visibility of a Column |
12+
| 'filters' | The Filters Button - toggling the display of the Filters popover/slidedown |
13+
| 'pagination-dropdown' | The Pagination dropdown, allowing for adjustment of per-page |
14+
| 'reorder' | The Reorder Button - if reordering is enabled |
15+
| 'search' | The Search Input -if one or more Columns are configured as searchable |
16+
17+
18+
619
## Component Available Methods
720

821
### setToolBarEnabled
@@ -37,9 +50,12 @@ You can add/remove items or change the order within the Toolbar Sections:
3750
| 'reorder' | The Reorder Button |
3851
| 'search' | The Search Input |
3952

40-
Note that these sections are prepended/appended with the relevant configurableArea
53+
Note that these sections are prepended/appended with the relevant configurableArea, and Actions in the Toolbar are placed appropriately.
54+
55+
Should you wish to modify the order, then keep in mind the following defaults:
4156

42-
#### Customising The Left Elements
57+
#### Defaults
58+
##### The Left Toolbar Elements
4359
By default, the following is returned.
4460
```php
4561
public function toolbarItemsLeft()
@@ -48,11 +64,41 @@ By default, the following is returned.
4864
}
4965
```
5066

51-
#### Customising The Right Elements
67+
##### The Right Toolbar Elements
5268
By default, the following is returned:
5369
```php
5470
public function toolbarItemsRight()
5571
{
5672
return ['bulk-actions','column-select','pagination-dropdown'];
5773
}
74+
```
75+
76+
#### Example
77+
This example moves the "bulk actions" dropdown to the left of the toolbar, and the "search" to the right of the toolbar.
78+
79+
```php
80+
public function toolbarItemsLeft()
81+
{
82+
// Instead Of
83+
// return ['reorder','search','filters'];
84+
return ['reorder','bulk-actions','filters'];
85+
}
86+
87+
public function toolbarItemsRight()
88+
{
89+
// Instead Of
90+
// ['bulk-actions','column-select','pagination-dropdown'];
91+
return ['search','column-select','pagination-dropdown'];
92+
}
93+
```
94+
95+
#### Example 2
96+
This example adds an extra instance of the "search" input on the right side of the Toolbar
97+
98+
```php
99+
100+
public function toolbarItemsRight()
101+
{
102+
return ['search','bulk-actions','column-select','pagination-dropdown'];
103+
}
58104
```

resources/js/partials/core/bulkactionsHelper.min.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
function bulkactionsHelper() {
44
Alpine.data('bulkactions', (wire) => ({
5-
paginationCurrentCount: wire.entangle('paginationCurrentCount'),
6-
paginationCurrentItems: wire.entangle('paginationCurrentItems'),
5+
paginationCurrentCount: wire.entangle('paginationConfig.paginationCurrentCount'),
6+
paginationCurrentItems: wire.entangle('paginationConfig.paginationCurrentItems'),
77
selectAllStatus: wire.entangle('bulkActionConfig.selectAll'),
88
delaySelectAll: wire.entangle('bulkActionConfig.delaySelectAll'),
99
newSelectCount: 0,

resources/js/partials/core/table.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ function table() {
99
tableName: wire.entangle('tableName'),
1010
dataTableFingerprint: wire.entangle('dataTableFingerprint'),
1111
listeners: [],
12-
paginationCurrentCount: wire.entangle('paginationCurrentCount'),
13-
paginationTotalItemCount: wire.entangle('paginationTotalItemCount'),
14-
paginationCurrentItems: wire.entangle('paginationCurrentItems'),
12+
paginationCurrentCount: wire.entangle('paginationConfig.paginationCurrentCount'),
13+
paginationTotalItemCount: wire.entangle('paginationConfig.paginationTotalItemCount'),
14+
paginationCurrentItems: wire.entangle('paginationConfig.paginationCurrentItems'),
1515
selectedItems: wire.entangle('selected'),
1616
selectAllStatus: wire.entangle('bulkActionConfig.selectAll'),
1717
selectedAllOnPage: false,

resources/js/partials/core/table.min.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
function table() {
44
Alpine.data('laravellivewiretable', (wire) => ({
55
tableId: '',
6-
paginationTotalItemCount: wire.entangle('paginationTotalItemCount'),
6+
paginationTotalItemCount: wire.entangle('paginationConfig.paginationTotalItemCount'),
77
selectedItems: wire.entangle('selected'),
88
hideBulkActionsWhenEmpty: wire.entangle('bulkActionConfig.hideBulkActionsWhenEmpty'),
99
indeterminateCheckbox: false,

resources/js/partials/core/tableWrap.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ function tableWrap() {
44
Alpine.data('tableWrapper', (wire, showBulkActionsAlpine) => ({
55
shouldBeDisplayed: wire.entangle('shouldBeDisplayed'),
66
listeners: [],
7-
paginationCurrentCount: wire.entangle('paginationCurrentCount'),
8-
paginationTotalItemCount: wire.entangle('paginationTotalItemCount'),
9-
paginationCurrentItems: wire.entangle('paginationCurrentItems'),
7+
paginationCurrentCount: wire.entangle('paginationConfig.paginationCurrentCount'),
8+
paginationTotalItemCount: wire.entangle('paginationConfig.paginationTotalItemCount'),
9+
paginationCurrentItems: wire.entangle('paginationConfig.paginationCurrentItems'),
1010
selectedItems: wire.entangle('selected'),
1111
selectAllStatus: wire.entangle('bulkActionConfig.selectAll'),
1212
delaySelectAll: wire.entangle('bulkActionConfig.delaySelectAll'),

resources/js/partials/core/tableWrap.min.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ function tableWrap() {
44
Alpine.data('tableWrapper', (wire, showBulkActionsAlpine) => ({
55
shouldBeDisplayed: wire.entangle('shouldBeDisplayed'),
66
listeners: [],
7-
paginationCurrentCount: wire.entangle('paginationCurrentCount'),
8-
paginationTotalItemCount: wire.entangle('paginationTotalItemCount'),
9-
paginationCurrentItems: wire.entangle('paginationCurrentItems'),
7+
paginationCurrentCount: wire.entangle('paginationConfig.paginationCurrentCount'),
8+
paginationTotalItemCount: wire.entangle('paginationConfig.paginationTotalItemCount'),
9+
paginationCurrentItems: wire.entangle('paginationConfig.paginationCurrentItems'),
1010
selectedItems: wire.entangle('selected'),
1111
selectAllStatus: wire.entangle('bulkActionConfig.selectAll'),
1212
delaySelectAll: wire.entangle('bulkActionConfig.delaySelectAll'),

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

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)