Skip to content

Commit

Permalink
Optimized imports (#2124)
Browse files Browse the repository at this point in the history
  • Loading branch information
edwinvdpol authored Dec 11, 2024
1 parent 1e55b7c commit 0dffa95
Show file tree
Hide file tree
Showing 71 changed files with 60 additions and 139 deletions.
1 change: 0 additions & 1 deletion src/Commands/MakeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Illuminate\Console\Command;
use Illuminate\Contracts\Console\PromptsForMissingInput;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use Livewire\Features\SupportConsoleCommands\Commands\ComponentParser;
Expand Down
1 change: 0 additions & 1 deletion src/Traits/ComponentUtilities.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Rappasoft\LaravelLivewireTables\Traits;

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Str;
use Livewire\Attributes\Locked;
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException;
use Rappasoft\LaravelLivewireTables\Traits\Configuration\ComponentConfiguration;
Expand Down
2 changes: 0 additions & 2 deletions src/Traits/Configuration/ColumnConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Rappasoft\LaravelLivewireTables\Traits\Configuration;

use Rappasoft\LaravelLivewireTables\Views\Column;

trait ColumnConfiguration
{
public function setPrependedColumns(array $prependedColumns): void
Expand Down
6 changes: 4 additions & 2 deletions src/Traits/Configuration/FooterConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Rappasoft\LaravelLivewireTables\Traits\Configuration;

use Closure;

trait FooterConfiguration
{
public function setFooterStatus(bool $status): self
Expand Down Expand Up @@ -46,14 +48,14 @@ public function setUseHeaderAsFooterDisabled(): self
return $this;
}

public function setFooterTrAttributes(\Closure $callback): self
public function setFooterTrAttributes(Closure $callback): self
{
$this->footerTrAttributesCallback = $callback;

return $this;
}

public function setFooterTdAttributes(\Closure $callback): self
public function setFooterTdAttributes(Closure $callback): self
{
$this->footerTdAttributesCallback = $callback;

Expand Down
6 changes: 4 additions & 2 deletions src/Traits/Configuration/SecondaryHeaderConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Rappasoft\LaravelLivewireTables\Traits\Configuration;

use Closure;

trait SecondaryHeaderConfiguration
{
public function setSecondaryHeaderStatus(bool $status): self
Expand All @@ -25,14 +27,14 @@ public function setSecondaryHeaderDisabled(): self
return $this;
}

public function setSecondaryHeaderTrAttributes(\Closure $callback): self
public function setSecondaryHeaderTrAttributes(Closure $callback): self
{
$this->secondaryHeaderTrAttributesCallback = $callback;

return $this;
}

public function setSecondaryHeaderTdAttributes(\Closure $callback): self
public function setSecondaryHeaderTdAttributes(Closure $callback): self
{
$this->secondaryHeaderTdAttributesCallback = $callback;

Expand Down
16 changes: 9 additions & 7 deletions src/Traits/Configuration/TableAttributeConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Rappasoft\LaravelLivewireTables\Traits\Configuration;

use Closure;

trait TableAttributeConfiguration
{
/**
Expand Down Expand Up @@ -68,7 +70,7 @@ public function setTbodyAttributes(array $attributes = []): self
/**
* Set a list of attributes to override on the th elements
*/
public function setThAttributes(\Closure $callback): self
public function setThAttributes(Closure $callback): self
{
$this->thAttributesCallback = $callback;

Expand All @@ -78,7 +80,7 @@ public function setThAttributes(\Closure $callback): self
/**
* Set a list of attributes to override on the th sort button elements
*/
public function setThSortButtonAttributes(\Closure $callback): self
public function setThSortButtonAttributes(Closure $callback): self
{
$this->thSortButtonAttributesCallback = $callback;

Expand All @@ -88,7 +90,7 @@ public function setThSortButtonAttributes(\Closure $callback): self
/**
* Set a list of attributes to override on the th sort icon elements
*/
public function setThSortIconAttributes(\Closure $callback): self
public function setThSortIconAttributes(Closure $callback): self
{
$this->thSortIconAttributesCallback = $callback;

Expand All @@ -98,7 +100,7 @@ public function setThSortIconAttributes(\Closure $callback): self
/**
* Set a list of attributes to override on the td elements
*/
public function setTrAttributes(\Closure $callback): self
public function setTrAttributes(Closure $callback): self
{
$this->trAttributesCallback = $callback;

Expand All @@ -108,21 +110,21 @@ public function setTrAttributes(\Closure $callback): self
/**
* Set a list of attributes to override on the td elements
*/
public function setTdAttributes(\Closure $callback): self
public function setTdAttributes(Closure $callback): self
{
$this->tdAttributesCallback = $callback;

return $this;
}

public function setTableRowUrl(\Closure $callback): self
public function setTableRowUrl(Closure $callback): self
{
$this->trUrlCallback = $callback;

return $this;
}

public function setTableRowUrlTarget(\Closure $callback): self
public function setTableRowUrlTarget(Closure $callback): self
{
$this->trUrlTargetCallback = $callback;

Expand Down
2 changes: 1 addition & 1 deletion src/Traits/HasAllTraits.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rappasoft\LaravelLivewireTables\Traits;

use Rappasoft\LaravelLivewireTables\Traits\Core\{HasCustomAttributes,HasLocalisations};
use Rappasoft\LaravelLivewireTables\Traits\Core\{HasCustomAttributes, HasLocalisations};
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasTheme;

trait HasAllTraits
Expand Down
1 change: 0 additions & 1 deletion src/Traits/Helpers/FilterHelpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Rappasoft\LaravelLivewireTables\Traits\Helpers;

use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use Livewire\Attributes\Computed;
use Livewire\Attributes\On;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Configuration;

use Closure;
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException;

trait FilterMenuStylingConfiguration
Expand Down Expand Up @@ -29,7 +30,7 @@ public function setFilterSlidedownWrapperAttributes(array $filterSlidedownWrappe
/**
* Set a list of attributes to override on the th sort button elements
*/
public function setFilterSlidedownRowAttributes(\Closure $callback): self
public function setFilterSlidedownRowAttributes(Closure $callback): self
{
$this->filterSlidedownRowCallback = $callback;

Expand Down
3 changes: 2 additions & 1 deletion src/Traits/Styling/HasFilterMenuStyling.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Rappasoft\LaravelLivewireTables\Traits\Styling;

use Closure;
use Livewire\Attributes\Locked;
use Rappasoft\LaravelLivewireTables\Traits\Styling\Configuration\FilterMenuStylingConfiguration;
use Rappasoft\LaravelLivewireTables\Traits\Styling\Helpers\FilterMenuStylingHelpers;
Expand All @@ -21,5 +22,5 @@ trait HasFilterMenuStyling

protected array $filterSlidedownWrapperAttributes = ['class' => '', 'default-colors' => true, 'default-styling' => true];

protected ?\Closure $filterSlidedownRowCallback;
protected ?Closure $filterSlidedownRowCallback;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Helpers;

use Livewire\Attributes\Computed;

trait LoadingPlaceholderStylingHelpers
{
public function getLoadingPlaceholderAttributes(): array
Expand Down
2 changes: 0 additions & 2 deletions src/Traits/Styling/Search/HasSearchInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

namespace Rappasoft\LaravelLivewireTables\Traits\Styling\Search;

use Livewire\Attributes\Computed;

trait HasSearchInput
{
protected array $searchFieldAttributes = [];
Expand Down
1 change: 0 additions & 1 deletion src/Traits/WithColumnSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use Rappasoft\LaravelLivewireTables\Events\ColumnsSelected;
use Rappasoft\LaravelLivewireTables\Traits\Configuration\ColumnSelectConfiguration;
use Rappasoft\LaravelLivewireTables\Traits\Helpers\ColumnSelectHelpers;
use Rappasoft\LaravelLivewireTables\Views\Column;

trait WithColumnSelect
{
Expand Down
1 change: 0 additions & 1 deletion src/Traits/WithColumns.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Rappasoft\LaravelLivewireTables\Traits;

use Illuminate\Support\Collection;
use Livewire\Attributes\Locked;
use Rappasoft\LaravelLivewireTables\Exceptions\NoColumnsException;
use Rappasoft\LaravelLivewireTables\Traits\Configuration\ColumnConfiguration;
use Rappasoft\LaravelLivewireTables\Traits\Helpers\ColumnHelpers;
Expand Down
5 changes: 3 additions & 2 deletions src/Traits/WithFooter.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Rappasoft\LaravelLivewireTables\Traits;

use Closure;
use Rappasoft\LaravelLivewireTables\Traits\Configuration\FooterConfiguration;
use Rappasoft\LaravelLivewireTables\Traits\Helpers\FooterHelpers;

Expand All @@ -16,9 +17,9 @@ trait WithFooter

protected bool $columnsWithFooter = false;

protected ?\Closure $footerTrAttributesCallback;
protected ?Closure $footerTrAttributesCallback;

protected ?\Closure $footerTdAttributesCallback;
protected ?Closure $footerTdAttributesCallback;

public function setupFooter(): void
{
Expand Down
1 change: 0 additions & 1 deletion src/Traits/WithReordering.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Rappasoft\LaravelLivewireTables\Traits;

use Livewire\Attributes\Locked;
use Rappasoft\LaravelLivewireTables\Traits\Configuration\ReorderingConfiguration;
use Rappasoft\LaravelLivewireTables\Traits\Helpers\ReorderingHelpers;

Expand Down
5 changes: 3 additions & 2 deletions src/Traits/WithSecondaryHeader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Rappasoft\LaravelLivewireTables\Traits;

use Closure;
use Rappasoft\LaravelLivewireTables\Traits\Configuration\SecondaryHeaderConfiguration;
use Rappasoft\LaravelLivewireTables\Traits\Helpers\SecondaryHeaderHelpers;

Expand All @@ -14,9 +15,9 @@ trait WithSecondaryHeader

protected bool $columnsWithSecondaryHeader = false;

protected ?\Closure $secondaryHeaderTrAttributesCallback;
protected ?Closure $secondaryHeaderTrAttributesCallback;

protected ?\Closure $secondaryHeaderTdAttributesCallback;
protected ?Closure $secondaryHeaderTdAttributesCallback;

public function bootedWithSecondaryHeader(): void
{
Expand Down
1 change: 0 additions & 1 deletion src/Traits/WithSorting.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Collection;
use Livewire\Attributes\Locked;
use Rappasoft\LaravelLivewireTables\Traits\Configuration\SortingConfiguration;
use Rappasoft\LaravelLivewireTables\Traits\Core\QueryStrings\HasQueryStringForSort;
use Rappasoft\LaravelLivewireTables\Traits\Helpers\SortingHelpers;
Expand Down
15 changes: 7 additions & 8 deletions src/Traits/WithTableAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Rappasoft\LaravelLivewireTables\Traits;

use Closure;
use Livewire\Attributes\On;
use Rappasoft\LaravelLivewireTables\Traits\Configuration\TableAttributeConfiguration;
use Rappasoft\LaravelLivewireTables\Traits\Helpers\TableAttributeHelpers;

Expand All @@ -22,19 +21,19 @@ trait WithTableAttributes

protected array $tbodyAttributes = [];

protected ?\Closure $thAttributesCallback;
protected ?Closure $thAttributesCallback;

protected ?\Closure $thSortButtonAttributesCallback;
protected ?Closure $thSortButtonAttributesCallback;

protected ?\Closure $thSortIconAttributesCallback;
protected ?Closure $thSortIconAttributesCallback;

protected ?\Closure $trAttributesCallback;
protected ?Closure $trAttributesCallback;

protected ?\Closure $tdAttributesCallback;
protected ?Closure $tdAttributesCallback;

protected ?\Closure $trUrlCallback;
protected ?Closure $trUrlCallback;

protected ?\Closure $trUrlTargetCallback;
protected ?Closure $trUrlTargetCallback;

public bool $shouldBeDisplayed = true;
}
2 changes: 1 addition & 1 deletion src/Views/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Rappasoft\LaravelLivewireTables\Views;

use Illuminate\View\{Component,ComponentAttributeBag};
use Illuminate\View\Component;
use Rappasoft\LaravelLivewireTables\Traits\Core\HasLocalisations;
use Rappasoft\LaravelLivewireTables\Views\Traits\Actions\{HasActionAttributes, HasRoute};
use Rappasoft\LaravelLivewireTables\Views\Traits\Columns\HasVisibility;
Expand Down
3 changes: 2 additions & 1 deletion src/Views/Columns/ColorColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Rappasoft\LaravelLivewireTables\Views\Columns;

use Closure;
use Illuminate\Database\Eloquent\Model;
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException;
use Rappasoft\LaravelLivewireTables\Views\Column;
Expand All @@ -17,7 +18,7 @@ class ColorColumn extends Column
ColorColumnHelpers;
use HasDefaultStringValue;

public ?\Closure $colorCallback;
public ?Closure $colorCallback;

protected string $view = 'livewire-tables::includes.columns.color';

Expand Down
3 changes: 2 additions & 1 deletion src/Views/Columns/IconColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Rappasoft\LaravelLivewireTables\Views\Columns;

use Closure;
use Illuminate\Database\Eloquent\Model;
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException;
use Rappasoft\LaravelLivewireTables\Views\Column;
Expand All @@ -15,7 +16,7 @@ class IconColumn extends Column
use IconColumnConfiguration,
IconColumnHelpers;

public ?\Closure $iconCallback;
public ?Closure $iconCallback;

protected string $view = 'livewire-tables::includes.columns.icon';

Expand Down
2 changes: 1 addition & 1 deletion src/Views/Columns/LinkColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException;
use Rappasoft\LaravelLivewireTables\Views\Column;
use Rappasoft\LaravelLivewireTables\Views\Traits\Configuration\LinkColumnConfiguration;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\{HasLocationCallback,HasTitleCallback};
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\{HasLocationCallback, HasTitleCallback};
use Rappasoft\LaravelLivewireTables\Views\Traits\Helpers\LinkColumnHelpers;

class LinkColumn extends Column
Expand Down
1 change: 0 additions & 1 deletion src/Views/Columns/ViewComponentColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\HtmlString;
use Illuminate\View\ComponentAttributeBag;
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException;
use Rappasoft\LaravelLivewireTables\Views\Column;
use Rappasoft\LaravelLivewireTables\Views\Traits\Configuration\ViewComponentColumnConfiguration;
Expand Down
2 changes: 1 addition & 1 deletion src/Views/Columns/WireLinkColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException;
use Rappasoft\LaravelLivewireTables\Views\Column;
use Rappasoft\LaravelLivewireTables\Views\Traits\Configuration\WireLinkColumnConfiguration;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\{HasActionCallback,HasConfirmation, HasTitleCallback};
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\{HasActionCallback, HasConfirmation, HasTitleCallback};
use Rappasoft\LaravelLivewireTables\Views\Traits\Helpers\WireLinkColumnHelpers;

class WireLinkColumn extends Column
Expand Down
2 changes: 1 addition & 1 deletion src/Views/Filters/DateRangeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Illuminate\Support\Facades\Validator;
use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{HandlesDates, HasConfig,HasOptions};
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{HandlesDates, HasConfig, HasOptions};

class DateRangeFilter extends Filter
{
Expand Down
Loading

0 comments on commit 0dffa95

Please sign in to comment.