Skip to content

Commit b7a29d1

Browse files
Cleanup
1 parent 7201dbc commit b7a29d1

File tree

5 files changed

+3
-123
lines changed

5 files changed

+3
-123
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
function t({state:i}){return{state:i,init:function(){}}}export{t as default};

resources/js/index.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +0,0 @@
1-
export default function priceFilterSlider({state}) {
2-
return {
3-
state,
4-
init: function () {
5-
// Initialise the Alpine component here, if you need to.
6-
},
7-
}
8-
}

resources/views/price-filter-slider.blade.php

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

src/Filament/Tables/Filters/PriceFilter.php

Lines changed: 0 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ class PriceFilter extends Filter
1616

1717
public Closure | bool | null $cents = null;
1818

19-
public Closure | bool | null $slider = false;
20-
21-
public Closure | int $steps = 1;
22-
2319
public Closure | int $min = 0;
2420

2521
public Closure | int $max = 100000;
@@ -38,20 +34,6 @@ public function currency(Closure | string | null $currency = null, Closure | str
3834
return $this;
3935
}
4036

41-
public function slider(Closure | bool | null $slider = true): static
42-
{
43-
$this->slider = $slider;
44-
45-
return $this;
46-
}
47-
48-
public function steps(Closure | int $steps): static
49-
{
50-
$this->steps = $steps;
51-
52-
return $this;
53-
}
54-
5537
public function min(Closure | int $min): static
5638
{
5739
$this->min = $min;
@@ -76,16 +58,6 @@ public function getMax(): int
7658
return $this->evaluate($this->max);
7759
}
7860

79-
public function getSteps(): int
80-
{
81-
return $this->evaluate($this->steps);
82-
}
83-
84-
public function getSlider(): string
85-
{
86-
return $this->evaluate($this->slider);
87-
}
88-
8961
public function getCurrency(): string
9062
{
9163
if ($this->currency === null) {
@@ -126,30 +98,18 @@ protected function setUp(): void
12698
parent::setUp();
12799

128100
$this->form(function () {
129-
$view = $this->getSlider() ? 'filament-price-filter::price-filter-slider' : null;
130-
131-
$viewData = [
132-
'symbol' => $this->getCurrencySymbol($this->getCurrency()),
133-
'steps' => $this->getSteps(),
134-
'min' => $this->getMin(),
135-
'max' => $this->getMax(),
136-
];
137-
138101
return [
139102
TextInput::make('from')
140103
->label(__($this->getLabel() . ' from'))
141104
->prefix($this->getCurrencySymbol($this->getCurrency()))
142105
->minValue($this->getMin())
143106
->maxValue($this->getMax())
144-
->step(fn () => $this->getSteps())
145-
->view($view, $viewData)
146107
->numeric(),
147108
TextInput::make('to')
148109
->label(__($this->getLabel() . ' to'))
149110
->prefix($this->getCurrencySymbol($this->getCurrency()))
150111
->minValue($this->getMin())
151112
->maxValue($this->getMax())
152-
->view($view, $viewData)
153113
->numeric(),
154114
];
155115
});

src/FilamentPriceFilterServiceProvider.php

Lines changed: 3 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,6 @@
22

33
namespace CodeWithDennis\FilamentPriceFilter;
44

5-
use CodeWithDennis\FilamentPriceFilter\Commands\FilamentPriceFilterCommand;
6-
use CodeWithDennis\FilamentPriceFilter\Testing\TestsFilamentPriceFilter;
7-
use Filament\Support\Assets\AlpineComponent;
8-
use Filament\Support\Assets\Asset;
9-
use Filament\Support\Assets\Css;
10-
use Filament\Support\Facades\FilamentAsset;
11-
use Filament\Support\Facades\FilamentIcon;
12-
use Livewire\Features\SupportTesting\Testable;
135
use Spatie\LaravelPackageTools\Commands\InstallCommand;
146
use Spatie\LaravelPackageTools\Package;
157
use Spatie\LaravelPackageTools\PackageServiceProvider;
@@ -39,79 +31,40 @@ public function configurePackage(Package $package): void
3931
if (file_exists($package->basePath('/../resources/lang'))) {
4032
$package->hasTranslations();
4133
}
42-
43-
if (file_exists($package->basePath('/../resources/views'))) {
44-
$package->hasViews();
45-
}
4634
}
4735

4836
public function packageRegistered(): void {}
4937

5038
public function packageBooted(): void
5139
{
52-
// Asset Registration
53-
FilamentAsset::register(
54-
$this->getAssets(),
55-
$this->getAssetPackageName()
56-
);
57-
58-
FilamentAsset::registerScriptData(
59-
$this->getScriptData(),
60-
$this->getAssetPackageName()
61-
);
62-
63-
// Icon Registration
64-
FilamentIcon::register($this->getIcons());
65-
66-
// Testing
67-
Testable::mixin(new TestsFilamentPriceFilter);
40+
//
6841
}
6942

7043
protected function getAssetPackageName(): ?string
7144
{
7245
return 'codewithdennis/filament-price-filter';
7346
}
7447

75-
/**
76-
* @return array<Asset>
77-
*/
7848
protected function getAssets(): array
7949
{
80-
return [
81-
AlpineComponent::make('filament-price-filter', __DIR__ . '/../resources/dist/filament-price-filter.js'),
82-
Css::make('filament-price-filter', __DIR__ . '/../resources/dist/filament-price-filter.css'),
83-
];
50+
return [];
8451
}
8552

86-
/**
87-
* @return array<class-string>
88-
*/
8953
protected function getCommands(): array
9054
{
91-
return [
92-
FilamentPriceFilterCommand::class,
93-
];
55+
return [];
9456
}
9557

96-
/**
97-
* @return array<string>
98-
*/
9958
protected function getIcons(): array
10059
{
10160
return [];
10261
}
10362

104-
/**
105-
* @return array<string>
106-
*/
10763
protected function getRoutes(): array
10864
{
10965
return [];
11066
}
11167

112-
/**
113-
* @return array<string, mixed>
114-
*/
11568
protected function getScriptData(): array
11669
{
11770
return [];

0 commit comments

Comments
 (0)