Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions .github/workflows/run-tests-pcov-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- 'develop'
- 'development'
- 'master'

jobs:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/run-tests-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- 'develop'
- 'development'
- 'master'

jobs:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"laravel/pint": "^1.10",
"monolog/monolog": "*",
"nunomaduro/collision": "^6.0|^7.0|^8.0",
"nunomaduro/larastan": "^2.6",
"larastan/larastan": "^2.6",
"orchestra/testbench": "^7.0|^8.0|^9.0",
"phpunit/phpunit": "^9.0|^10.0|^11.0"
},
Expand Down
35 changes: 35 additions & 0 deletions docs/bulk-actions/available-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,38 @@ public function configure(): void
]);
}
```

## setShouldAlwaysHideBulkActionsDropdownOption

Allows hiding the Bulk Actions button & menu, regardless of whether there are any items selected, or hideBulkActionsWhenEmptyEnabled behaviour

```php
public function configure(): void
{
$this->setShouldAlwaysHideBulkActionsDropdownOption(true);
}
```


## setShouldAlwaysHideBulkActionsDropdownOptionEnabled

Allows hiding the Bulk Actions button & menu, regardless of whether there are any items selected, or hideBulkActionsWhenEmptyEnabled behaviour

```php
public function configure(): void
{
$this->setShouldAlwaysHideBulkActionsDropdownOptionEnabled();
}
```


## setShouldAlwaysHideBulkActionsDropdownOptionDisabled

Restores the Bulk Actions to default functionality, so it will respect the hideBulkActionsWhenEmptyEnabled behaviour

```php
public function configure(): void
{
$this->setShouldAlwaysHideBulkActionsDropdownOptionDisabled();
}
```
33 changes: 33 additions & 0 deletions docs/pagination/available-methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,3 +263,36 @@ public function configure(): void
]);
}
```

## setShouldRetrieveTotalItemCountStatus

Used when "simple" pagination is being used, allows the enabling/disabling of the "total records" count. This may be desirable to disable in larger data sets. This is enabled by default.

```php
public function configure(): void
{
$this->setShouldRetrieveTotalItemCountStatus(false);
}
```

## setShouldRetrieveTotalItemCountEnabled

Used when "simple" pagination is being used, enables the "total records" count.

```php
public function configure(): void
{
$this->setShouldRetrieveTotalItemCountEnabled();
}
```

## setShouldRetrieveTotalItemCountDisabled

Used when "simple" pagination is being used, disables the "total records" count.

```php
public function configure(): void
{
$this->setShouldRetrieveTotalItemCountDisabled();
}
```
6 changes: 3 additions & 3 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
includes:
- vendor/nunomaduro/larastan/extension.neon
- vendor/larastan/larastan/extension.neon

parameters:
paths:
Expand All @@ -10,11 +10,11 @@ parameters:
tmpDir: build/phpstan
checkOctaneCompatibility: true
checkModelProperties: true
checkMissingIterableValueType: false
treatPhpDocTypesAsCertain: false
reportUnmatchedIgnoredErrors: false
checkGenericClassInNonGenericObjectType: false
ignoreErrors:
- identifier: missingType.generics
- identifier: missingType.iterableValue
- '#Access to an undefined property Rappasoft\\LaravelLivewireTables\\Views\\Column\:\:\$view#'
- "#Unsafe usage of new static#"
- '#on array\<string, non-empty-array\<int\<0, max\>, mixed\>\> in empty\(\) does not exist.#'
Expand Down
2 changes: 1 addition & 1 deletion resources/js/laravel-livewire-tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ document.addEventListener('alpine:init', () => {
paginationTotalItemCount: wire.entangle('paginationTotalItemCount'),
paginationCurrentItems: wire.entangle('paginationCurrentItems'),
selectedItems: wire.entangle('selected'),
alwaysShowBulkActions: !wire.entangle('hideBulkActionsWhenEmpty'),
hideBulkActionsWhenEmpty: wire.entangle('hideBulkActionsWhenEmpty'),
toggleSelectAll() {
if (!showBulkActionsAlpine) {
return;
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/views/components/table/td.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
->class(['d-none' => $component->isBootstrap() && $column && $column->shouldCollapseAlways()])
->class(['d-none d-md-table-cell' => $component->isBootstrap() && $column && $column->shouldCollapseOnMobile()])
->class(['d-none d-lg-table-cell' => $component->isBootstrap() && $column && $column->shouldCollapseOnTablet()])
->style(['cursor:pointer' => $component->isBootstrap()])
->style(['cursor:pointer' => $component->isBootstrap() && $column && $column->isClickable()])
->except('default')
}}
>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/components/tools/toolbar.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
@include($component->getConfigurableAreaFor('toolbar-right-start'), $component->getParametersForConfigurableArea('toolbar-right-start'))
@endif

@if ($component->showBulkActionsDropdownAlpine())
@if ($component->showBulkActionsDropdownAlpine() && $this->shouldAlwaysHideBulkActionsDropdownOption != true)
<x-livewire-tables::tools.toolbar.items.bulk-actions />
@endif

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@aware(['component', 'tableName'])
<div
x-data="{ open: false, childElementOpen: false, isTailwind: @js($component->isTailwind()), isBootstrap: @js($component->isBootstrap()) }"
x-cloak x-show="(selectedItems.length > 0 || alwaysShowBulkActions)"
x-cloak x-show="(selectedItems.length > 0 || hideBulkActionsWhenEmpty == false)"
@class([
'mb-3 mb-md-0' => $component->isBootstrap(),
'w-full md:w-auto mb-4 md:mb-0' => $component->isTailwind(),
Expand Down
4 changes: 1 addition & 3 deletions src/DataTableComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ public function boot(): void
/**
* Runs on every request, after the component is mounted or hydrated, but before any update methods are called
*/
public function booted(): void
{
}
public function booted(): void {}

public function render(): \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\View\View
{
Expand Down
4 changes: 1 addition & 3 deletions src/Exceptions/DataTableConfigurationException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Rappasoft\LaravelLivewireTables\Exceptions;

class DataTableConfigurationException extends \Exception
{
}
class DataTableConfigurationException extends \Exception {}
4 changes: 1 addition & 3 deletions src/Exceptions/NoColumnsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Rappasoft\LaravelLivewireTables\Exceptions;

class NoColumnsException extends \Exception
{
}
class NoColumnsException extends \Exception {}
4 changes: 1 addition & 3 deletions src/Exceptions/NoSearchableColumnsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Rappasoft\LaravelLivewireTables\Exceptions;

class NoSearchableColumnsException extends \Exception
{
}
class NoSearchableColumnsException extends \Exception {}
4 changes: 1 addition & 3 deletions src/Exceptions/NoSortableColumnsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@

namespace Rappasoft\LaravelLivewireTables\Exceptions;

class NoSortableColumnsException extends \Exception
{
}
class NoSortableColumnsException extends \Exception {}
8 changes: 6 additions & 2 deletions src/LaravelLivewireTablesServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ class LaravelLivewireTablesServiceProvider extends ServiceProvider
public function boot(): void
{

AboutCommand::add('Rappasoft Laravel Livewire Tables', fn () => ['Version' => '3.2.7']);
if (class_exists(AboutCommand::class) && class_exists(\Composer\InstalledVersions::class)) {
AboutCommand::add('Rappasoft Laravel Livewire Tables', [
'Version' => \Composer\InstalledVersions::getPrettyVersion('rappasoft/laravel-livewire-tables'),
]);
}

$this->mergeConfigFrom(
__DIR__.'/../config/livewire-tables.php', 'livewire-tables'
Expand All @@ -40,7 +44,7 @@ public function boot(): void

}

public function consoleCommands()
public function consoleCommands(): void
{
if ($this->app->runningInConsole()) {

Expand Down
Loading