Skip to content

Commit bb21854

Browse files
rupadanagithub-actions[bot]
authored andcommitted
Fix styling
1 parent 6250220 commit bb21854

File tree

5 files changed

+32
-41
lines changed

5 files changed

+32
-41
lines changed

src/Components/Concerns/HasRange.php

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

33
namespace Rupadana\FilamentCustomForms\Components\Concerns;
44

5-
use Closure;
6-
75
trait HasRange
86
{
9-
107
}

src/Components/Concerns/InputSliderBehaviour.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
namespace Rupadana\FilamentCustomForms\Components\Concerns;
44

5-
6-
class InputSliderBehaviour {
5+
class InputSliderBehaviour
6+
{
77
const DRAG = 'drag';
88

99
const DRAGALL = 'drag-all';
@@ -15,8 +15,8 @@ class InputSliderBehaviour {
1515
const SNAP = 'snap';
1616

1717
const UNCONSTRAINED = 'unconstrained';
18-
18+
1919
const HOVER = 'hover-snap';
20-
20+
2121
const NONE = 'none';
22-
}
22+
}

src/Components/InputSlider.php

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

33
namespace Rupadana\FilamentCustomForms\Components;
44

5-
use Closure;
6-
use Filament\Forms\Components\Component;
7-
use Filament\Forms\Components\Concerns\HasLabel;
85
use Filament\Forms\Components\Field;
96

10-
class InputSlider extends Field {
7+
class InputSlider extends Field
8+
{
119
protected string $view = 'filament-custom-forms::components.hidden-input';
1210

1311
public static function make(string $name): static
@@ -18,5 +16,4 @@ public static function make(string $name): static
1816

1917
return $static;
2018
}
21-
22-
}
19+
}

src/Components/InputSliderGroup.php

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,21 @@
22

33
namespace Rupadana\FilamentCustomForms\Components;
44

5-
use Closure;
65
use Error;
76
use Filament\Forms\Components\Component;
87
use Filament\Forms\Components\Concerns\CanBeValidated;
98
use Filament\Forms\Components\Concerns\HasChildComponents;
109
use Filament\Forms\Components\Concerns\HasHelperText;
1110
use Filament\Forms\Components\Concerns\HasHint;
1211
use Filament\Forms\Components\Concerns\HasLabel;
13-
use Filament\Forms\Components\Field;
14-
use Illuminate\Support\Arr;
1512

1613
class 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;

src/FilamentCustomFormsServiceProvider.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
use Spatie\LaravelPackageTools\Package;
1717
use Spatie\LaravelPackageTools\PackageServiceProvider;
1818

19-
2019
class FilamentCustomFormsServiceProvider extends PackageServiceProvider
2120
{
2221
public static string $name = 'filament-custom-forms';

0 commit comments

Comments
 (0)