22
33namespace Rupadana \FilamentCustomForms \Components ;
44
5- use Closure ;
65use Error ;
76use Filament \Forms \Components \Component ;
87use Filament \Forms \Components \Concerns \CanBeValidated ;
98use Filament \Forms \Components \Concerns \HasChildComponents ;
109use Filament \Forms \Components \Concerns \HasHelperText ;
1110use Filament \Forms \Components \Concerns \HasHint ;
1211use Filament \Forms \Components \Concerns \HasLabel ;
13- use Filament \Forms \Components \Field ;
14- use Illuminate \Support \Arr ;
1512
1613class InputSliderGroup extends Component
1714{
18- use HasLabel;
19- use HasHelperText;
20- use HasHint;
2115 use CanBeValidated;
2216 use HasChildComponents;
17+ use HasHelperText;
18+ use HasHint;
19+ use HasLabel;
2320
2421 protected string $ view = 'filament-custom-forms::components.input-slider ' ;
2522
@@ -46,10 +43,10 @@ class InputSliderGroup extends Component
4643 public static function make (): static
4744 {
4845 $ static = new static ;
46+
4947 return $ static ;
5048 }
5149
52-
5350 /**
5451 * Get the value of max
5552 */
@@ -115,7 +112,7 @@ public function step($step)
115112 */
116113 public function getBehaviour (): string
117114 {
118- return join ( " - " , $ this ->behaviour );
115+ return implode ( ' - ' , $ this ->behaviour );
119116 }
120117
121118 /**
@@ -163,7 +160,7 @@ public function getSliders(): array
163160 *
164161 * @return self
165162 */
166- public function sliders (array $ sliders )
163+ public function sliders (array $ sliders )
167164 {
168165 $ this ->sliders = $ sliders ;
169166
@@ -185,7 +182,6 @@ public function getStates(): array
185182 })
186183 ->toArray ();
187184
188-
189185 return $ states ;
190186 }
191187
@@ -198,33 +194,31 @@ public function getStart(): array
198194 })
199195 ->toArray ();
200196
201-
202197 return $ start ;
203198 }
204199
205200 /**
206201 * Get the value of connect
207- */
202+ */
208203 public function getConnect ()
209204 {
210205
211- if ($ this ->connect ) {
212- if (! (count ($ this ->connect ) == count ($ this ->getSliders ()) + 1 )) {
213- throw new Error (" connect property must be total sliders + 1 " );
206+ if ($ this ->connect ) {
207+ if (! (count ($ this ->connect ) == count ($ this ->getSliders ()) + 1 )) {
208+ throw new Error (' connect property must be total sliders + 1 ' );
214209 }
215210
216211 return $ this ->connect ;
217212 }
218213
219-
220214 return array_fill (0 , count ($ this ->getSliders ()) + 1 , false );
221215 }
222216
223217 /**
224218 * Set the value of connect
225219 *
226220 * @return self
227- */
221+ */
228222 public function connect (array $ connect )
229223 {
230224 $ this ->connect = $ connect ;
@@ -234,43 +228,47 @@ public function connect(array $connect)
234228
235229 /**
236230 * Get the value of range
237- */
231+ */
238232 public function getRange ()
239233 {
240- if ($ this ->range ) return $ this ->range ;
234+ if ($ this ->range ) {
235+ return $ this ->range ;
236+ }
241237
242238 return [
243239 'min ' => $ this ->getMin (),
244- 'max ' => $ this ->getMax ()
240+ 'max ' => $ this ->getMax (),
245241 ];
246242 }
247243
248244 /**
249245 * Set the value of range
250246 *
251247 * @return self
252- */
248+ */
253249 public function range (array $ range )
254250 {
255251 $ this ->range = $ range ;
256252
257253 return $ this ;
258254 }
259255
260- public function enableTooltips (bool $ condition = true ) {
256+ public function enableTooltips (bool $ condition = true )
257+ {
261258 $ this ->isEnableTooltips = $ condition ;
262259
263260 return $ this ;
264261 }
265262
266263 /**
267264 * Get the value of tooltips
268- */
265+ */
269266 public function getTooltips ()
270267 {
271268
272- if ($ this ->tooltips ) return $ this ->tooltips ;
273-
269+ if ($ this ->tooltips ) {
270+ return $ this ->tooltips ;
271+ }
274272
275273 return array_fill (0 , count ($ this ->getSliders ()), $ this ->isEnableTooltips );
276274 }
@@ -279,7 +277,7 @@ public function getTooltips()
279277 * Set the value of tooltips
280278 *
281279 * @return self
282- */
280+ */
283281 public function tooltips (array $ tooltips )
284282 {
285283 $ this ->tooltips = $ tooltips ;
0 commit comments