Skip to content

Commit 6de8a14

Browse files
authored
Merge pull request rappasoft#617 from rappasoft/develop
v1.22.0
2 parents 5ec4a23 + 652005a commit 6de8a14

24 files changed

+369
-222
lines changed

CHANGELOG.md

Lines changed: 213 additions & 196 deletions
Large diffs are not rendered by default.

docs/bulk-actions/resetting-after-bulk-actions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@ public function myBulkAction()
3434
$this->resetSearch(); // Remove the search query
3535
$this->resetSorts(); // Remove the sorts
3636
$this->resetBulk(); // Clear the selected rows
37-
$this->resetPage(); // Go back to page 1
37+
$this->resetPage($this->pageName()); // Go back to page 1
3838
}
3939
```

docs/filters/creating-filters.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Creating filters is not required, and the filters box will be hidden if none are
77

88
To create filters, you return an array of `Filter` class objects from the `filters()` method.
99

10-
The current types of filters are: `select`, `multiSelect`, and `date`.
10+
The current types of filters are: `select`, `multiSelect`, `date`, and `datetime` (for supported browsers).
1111

1212
There are two steps to making a filter:
1313

@@ -49,7 +49,7 @@ public function filters(): array
4949
'tag2' => 'Tags 2',
5050
'tag3' => 'Tags 3',
5151
'tag4' => 'Tags 4',
52-
]),
52+
]),
5353
];
5454
}
5555
```

docs/rows/clickable-rows.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,21 @@ public function redirectToModel(string $name, array $parameters = [], $absolute
5353
```
5454

5555
Now the blank space of the row should have its action, while your links go to their own action.
56+
57+
## Working with `wire:click` on rows
58+
59+
You can add the row-level Livewire clicks by utilizing the following method.
60+
61+
```php
62+
public function getTableRowWireClick($row): ?string
63+
{
64+
return "doSomething(" . $row->id . ")";
65+
}
66+
67+
public function doSomething($id)
68+
{
69+
// ...
70+
}
71+
```
72+
73+
If you state both `getTableRowUrl` & `getTableRowWireClick`, the URL will supersede when a non-null value is supplied.

resources/lang/ar.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
"Bulk Actions": "إجراءات",
66
"Clear": "مسح",
77
"Filters": "التصفيات",
8-
"Remove filter option": "خذف خيار التصفيه",
9-
"Remove sort option": "خذف خيار الترتيب",
8+
"Remove filter option": "حذف خيار التصفية",
9+
"Remove sort option": "حذف خيار الترتيب",
1010
"Search": "بحث",
1111
"Select All": "تحديد الكل",
12-
"Showing": "إستعراض",
12+
"Showing": "استعراض",
1313
"Unselect All": "إلغاء تحديد الكل",
1414
"You are currently selecting all": "أنت الآن تختار الكل",
1515
"You are not connected to the internet.": "أنت غير متصل بالإنترنت.",
@@ -18,5 +18,5 @@
1818
"results": "النتائج",
1919
"rows": "صفوف",
2020
"rows, do you want to select all": "الصفوف ، هل تريد تحديد الكل",
21-
"to": "إلي"
21+
"to": "إلى"
2222
}

resources/lang/es.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"All": "Todo",
33
"Applied Filters": "Filtros Aplicados",
4-
"Applied Sorting": "Ordenamineto Aplicado",
4+
"Applied Sorting": "Ordenamiento Aplicado",
55
"Bulk Actions": "Acciones Masivas",
66
"Clear": "Borrar",
77
"Columns": "Columnas",
8-
"Done Reordering": "Reordenación finalizada",
8+
"Done Reordering": "Reordenamiento finalizado",
99
"Filters": "Filtros",
1010
"Remove filter option": "Remover opción de filtro",
11-
"Remove sort option": "Remover opción de ordenamineto",
11+
"Remove sort option": "Remover opción de ordenamiento",
1212
"Search": "Buscar",
1313
"Select All": "Seleccionar todo",
1414
"Showing": "Mostrando",
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div class="mb-3 mb-md-0 input-group">
2+
<input
3+
wire:model="filters.{{ $key }}"
4+
wire:key="filter-{{ $key }}"
5+
id="filter-{{ $key }}"
6+
type="datetime-local"
7+
@if(isset($filter->options['min']) && strlen($filter->options['min'])) min="{{ $filter->options['min'] }}" @endif
8+
@if(isset($filter->options['max']) && strlen($filter->options['max'])) max="{{ $filter->options['max'] }}" @endif
9+
class="form-control"
10+
/>
11+
</div>

resources/views/bootstrap-4/includes/filters.blade.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ class="dropdown-menu w-100 mt-md-3"
4242
@include('livewire-tables::bootstrap-4.includes.filter-type-multiselect')
4343
@elseif($filter->isDate())
4444
@include('livewire-tables::bootstrap-4.includes.filter-type-date')
45+
@elseif($filter->isDatetime())
46+
@include('livewire-tables::bootstrap-4.includes.filter-type-datetime')
4547
@endif
4648
</div>
4749
@endforeach

resources/views/bootstrap-4/includes/table.blade.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
:reordering="$reordering"
9999
:url="method_exists($this, 'getTableRowUrl') ? $this->getTableRowUrl($row) : ''"
100100
:target="method_exists($this, 'getTableRowUrlTarget') ? $this->getTableRowUrlTarget($row) : '_self'"
101+
:wireclick="method_exists($this, 'getTableRowWireClick') ? $this->getTableRowWireClick($row) : ''"
101102
:class="method_exists($this, 'setTableRowClass') ? ' ' . $this->setTableRowClass($row) : ''"
102103
:id="method_exists($this, 'setTableRowId') ? $this->setTableRowId($row) : ''"
103104
:customAttributes="method_exists($this, 'setTableRowAttributes') ? $this->setTableRowAttributes($row) : []"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div class="flex rounded-md shadow-sm mt-1">
2+
<input
3+
wire:model="filters.{{ $key }}"
4+
wire:key="filter-{{ $key }}"
5+
id="filter-{{ $key }}"
6+
type="datetime-local"
7+
@if(isset($filter->options['min']) && strlen($filter->options['min'])) min="{{ $filter->options['min'] }}" @endif
8+
@if(isset($filter->options['max']) && strlen($filter->options['max'])) max="{{ $filter->options['max'] }}" @endif
9+
class="form-control"
10+
/>
11+
</div>

0 commit comments

Comments
 (0)