2
2
3
3
namespace Tapp \FilamentValueRangeFilter \Filters ;
4
4
5
+ use Filament \Schemas \Components \Fieldset ;
6
+ use Filament \Forms \Components \Select ;
7
+ use Filament \Schemas \Components \Utilities \Set ;
8
+ use Filament \Forms \Components \TextInput ;
9
+ use Filament \Schemas \Components \Utilities \Get ;
10
+ use Filament \Schemas \Components \Grid ;
5
11
use Closure ;
6
12
use Filament \Forms ;
7
- use Filament \Forms \Get ;
8
- use Filament \Forms \Set ;
9
13
use Filament \Tables \Filters \Filter ;
10
14
use Filament \Tables \Filters \Indicator ;
11
15
use Illuminate \Database \Eloquent \Builder ;
@@ -37,10 +41,10 @@ protected function setUp(): void
37
41
parent ::setup ();
38
42
39
43
$ this
40
- ->form (fn () => [
41
- Forms \ Components \ Fieldset::make ($ this ->getlabel ())
44
+ ->schema (fn () => [
45
+ Fieldset::make ($ this ->getlabel ())
42
46
->schema ([
43
- Forms \ Components \ Select::make ('range_condition ' )
47
+ Select::make ('range_condition ' )
44
48
->hiddenLabel ()
45
49
->placeholder (__ ('filament-value-range-filter::filament-value-range-filter.range.placeholder ' ))
46
50
->live ()
@@ -63,47 +67,47 @@ protected function setUp(): void
63
67
$ set ('range_less_than ' , null );
64
68
$ set ('range_less_than_equal ' , null );
65
69
}),
66
- Forms \ Components \ TextInput::make ('range_equal ' )
70
+ TextInput::make ('range_equal ' )
67
71
->hiddenLabel ()
68
72
->numeric ()
69
73
->placeholder (fn (): string => $ this ->getFormattedValue (0 ))
70
74
->visible (fn (Get $ get ): bool => $ get ('range_condition ' ) === 'equal ' || empty ($ get ('range_condition ' ))),
71
- Forms \ Components \ TextInput::make ('range_not_equal ' )
75
+ TextInput::make ('range_not_equal ' )
72
76
->hiddenLabel ()
73
77
->numeric ()
74
78
->placeholder (fn (): string => $ this ->getFormattedValue (0 ))
75
79
->visible (fn (Get $ get ): bool => $ get ('range_condition ' ) === 'not_equal ' ),
76
- Forms \ Components \ Grid::make ([
80
+ Grid::make ([
77
81
'default ' => 1 ,
78
82
'sm ' => 2 ,
79
83
])
80
84
->schema ([
81
- Forms \ Components \ TextInput::make ('range_between_from ' )
85
+ TextInput::make ('range_between_from ' )
82
86
->hiddenLabel ()
83
87
->numeric ()
84
88
->placeholder (fn (): string => $ this ->getFormattedValue (0 )),
85
- Forms \ Components \ TextInput::make ('range_between_to ' )
89
+ TextInput::make ('range_between_to ' )
86
90
->hiddenLabel ()
87
91
->numeric ()
88
92
->placeholder (fn (): string => $ this ->getFormattedValue (0 )),
89
93
])
90
94
->visible (fn (Get $ get ): bool => $ get ('range_condition ' ) === 'between ' ),
91
- Forms \ Components \ TextInput::make ('range_greater_than ' )
95
+ TextInput::make ('range_greater_than ' )
92
96
->hiddenLabel ()
93
97
->numeric ()
94
98
->placeholder (fn (): string => $ this ->getFormattedValue (0 ))
95
99
->visible (fn (Get $ get ): bool => $ get ('range_condition ' ) === 'greater_than ' ),
96
- Forms \ Components \ TextInput::make ('range_greater_than_equal ' )
100
+ TextInput::make ('range_greater_than_equal ' )
97
101
->hiddenLabel ()
98
102
->numeric ()
99
103
->placeholder (fn (): string => $ this ->getFormattedValue (0 ))
100
104
->visible (fn (Get $ get ): bool => $ get ('range_condition ' ) === 'greater_than_equal ' ),
101
- Forms \ Components \ TextInput::make ('range_less_than ' )
105
+ TextInput::make ('range_less_than ' )
102
106
->hiddenLabel ()
103
107
->numeric ()
104
108
->placeholder (fn (): string => $ this ->getFormattedValue (0 ))
105
109
->visible (fn (Get $ get ): bool => $ get ('range_condition ' ) === 'less_than ' ),
106
- Forms \ Components \ TextInput::make ('range_less_than_equal ' )
110
+ TextInput::make ('range_less_than_equal ' )
107
111
->hiddenLabel ()
108
112
->numeric ()
109
113
->placeholder (fn (): string => $ this ->getFormattedValue (0 ))
0 commit comments