Skip to content

Commit

Permalink
Move Filter View Traits (#2189)
Browse files Browse the repository at this point in the history
* Initial Migration for FilterView Traits

* Fix styling
  • Loading branch information
lrljoe authored Jan 26, 2025
1 parent 3f18055 commit d56dc78
Show file tree
Hide file tree
Showing 34 changed files with 44 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/Views/Filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Rappasoft\LaravelLivewireTables\Views;

use Illuminate\Support\Str;
use Rappasoft\LaravelLivewireTables\Views\Traits\IsFilter;
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\IsFilter;

abstract class Filter
{
Expand Down
2 changes: 1 addition & 1 deletion src/Views/Filters/BooleanFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Rappasoft\LaravelLivewireTables\Views\Filters;

use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\HasWireables;

class BooleanFilter extends Filter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Views/Filters/DateFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace Rappasoft\LaravelLivewireTables\Views\Filters;

use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{HandlesDates, HasConfig, IsStringFilter};
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\{HandlesDates, HasConfig, HasWireables, IsStringFilter};

class DateFilter extends Filter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Views/Filters/DateRangeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
use Carbon\Carbon;
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\Filters\Traits\{HandlesDates, HasConfig, HasOptions, HasWireables};

class DateRangeFilter extends Filter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Views/Filters/DateTimeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace Rappasoft\LaravelLivewireTables\Views\Filters;

use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{HandlesDates, HasConfig, IsStringFilter};
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\{HandlesDates, HasConfig, HasWireables, IsStringFilter};

class DateTimeFilter extends Filter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Views/Filters/LivewireComponentArrayFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace Rappasoft\LaravelLivewireTables\Views\Filters;

use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{HasOptions, IsArrayFilter, IsLivewireComponentFilter};
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\{HasOptions, HasWireables, IsArrayFilter, IsLivewireComponentFilter};

class LivewireComponentArrayFilter extends Filter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Views/Filters/LivewireComponentFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace Rappasoft\LaravelLivewireTables\Views\Filters;

use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\IsLivewireComponentFilter;
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\{HasWireables, IsLivewireComponentFilter};

class LivewireComponentFilter extends Filter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Views/Filters/MultiSelectDropdownFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

use Illuminate\Support\Collection;
use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{HasOptions, IsArrayFilter};
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\{HasOptions, HasWireables, IsArrayFilter};

class MultiSelectDropdownFilter extends Filter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Views/Filters/MultiSelectFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace Rappasoft\LaravelLivewireTables\Views\Filters;

use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{HasOptions, IsArrayFilter};
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\{HasOptions, HasWireables, IsArrayFilter};

class MultiSelectFilter extends Filter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Views/Filters/NumberFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace Rappasoft\LaravelLivewireTables\Views\Filters;

use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{IsNumericFilter};
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\{HasWireables, IsNumericFilter};

class NumberFilter extends Filter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Views/Filters/NumberRangeFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace Rappasoft\LaravelLivewireTables\Views\Filters;

use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{HasOptions};
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\{HasOptions, HasWireables};

class NumberRangeFilter extends Filter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Views/Filters/SelectFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

use Illuminate\Support\Collection;
use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{HasOptions, IsStringFilter};
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\{HasOptions, HasWireables, IsStringFilter};

class SelectFilter extends Filter
{
Expand Down
3 changes: 1 addition & 2 deletions src/Views/Filters/TextFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
namespace Rappasoft\LaravelLivewireTables\Views\Filters;

use Rappasoft\LaravelLivewireTables\Views\Filter;
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables;
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{HandlesWildcardStrings, IsStringFilter};
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\{HandlesWildcardStrings, HasWireables, IsStringFilter};

class TextFilter extends Filter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Configuration;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

trait FilterConfiguration
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Helpers;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

use Rappasoft\LaravelLivewireTables\Views\Filter;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

trait HandlesApplyingFilter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

use Carbon\Carbon;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

trait HandlesFieldName
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

use Illuminate\Database\Eloquent\Builder;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

trait HasConfig
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

trait HasCustomPosition
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

trait HasOptions
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

trait HasPillsLocale
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasVisibility as HasCoreVisibility;

Expand Down
10 changes: 10 additions & 0 deletions src/Views/Filters/Traits/HasWireables.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

use Rappasoft\LaravelLivewireTables\Views\Traits\Core\HasWireables as HasWireablesCore;

trait HasWireables
{
use HasWireablesCore;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

trait IsArrayFilter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

use Livewire\Attributes\{Modelable, On, Renderless};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

use Livewire\Attributes\Modelable;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

use Rappasoft\LaravelLivewireTables\Traits\Core\HasLocalisations;
use Rappasoft\LaravelLivewireTables\Views\Traits\Configuration\FilterConfiguration;
use Rappasoft\LaravelLivewireTables\Views\Filters\Traits\Styling\{HandlesFilterInputAttributes, HandlesFilterLabelAttributes};
use Rappasoft\LaravelLivewireTables\Views\Traits\Core\{HasConfig, HasLabelAttributes, HasView};
use Rappasoft\LaravelLivewireTables\Views\Traits\Filters\{HasCustomPosition, HasVisibility};
use Rappasoft\LaravelLivewireTables\Views\Traits\Helpers\FilterHelpers;
use Rappasoft\LaravelLivewireTables\Views\Traits\Styling\{HandlesFilterInputAttributes, HandlesFilterLabelAttributes};

trait IsFilter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

use Rappasoft\LaravelLivewireTables\Exceptions\DataTableConfigurationException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

trait IsNumericFilter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Filters;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits;

trait IsStringFilter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Styling;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits\Styling;

use Illuminate\View\ComponentAttributeBag;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Rappasoft\LaravelLivewireTables\Views\Traits\Styling;
namespace Rappasoft\LaravelLivewireTables\Views\Filters\Traits\Styling;

use Illuminate\View\ComponentAttributeBag;

Expand Down

0 comments on commit d56dc78

Please sign in to comment.