22
33namespace Rupadana \FilamentCustomForms \Components ;
44
5- use Filament \Forms \Components \Concerns \HasLabel ;
6- use Filament \Forms \Components \Grid ;
75use Closure ;
6+ use Filament \Forms \Components \Concerns \HasLabel ;
87use Filament \Forms \Components \Field ;
8+ use Filament \Forms \Components \Grid ;
99
1010class InputGroup extends Grid
1111{
1212 use HasLabel;
13+
1314 protected string $ view = 'filament-custom-forms::components.grid ' ;
1415
1516 public static function make (array | int | string | null $ columns = 2 ): static
@@ -19,11 +20,10 @@ public static function make(array | int | string | null $columns = 2): static
1920 $ static ->extraAttributes (['class ' => 'filament-input-group gap-y-2 grid ' ]);
2021
2122 $ static ->columnSpan (1 );
22-
23+
2324 return $ static ;
2425 }
2526
26-
2727 public function schema (array | Closure $ components ): static
2828 {
2929 $ this ->childComponents ($ components );
@@ -34,7 +34,7 @@ public function schema(array | Closure $components): static
3434 public function showChildLabel (bool $ condition = true )
3535 {
3636
37- $ this ->isHideChildLabel = !$ condition ;
37+ $ this ->isHideChildLabel = ! $ condition ;
3838
3939 return $ this ;
4040 }
@@ -46,12 +46,13 @@ public function getChildComponents(): array
4646 {
4747
4848 $ components = $ this ->childComponents ;
49-
49+
5050 if ($ this ->isHideChildLabel ) {
5151 $ components = collect ($ components )->map (function (Field $ component ) {
5252 if (method_exists ($ component , 'placeholder ' )) {
5353 $ component = $ component ->placeholder ($ component ->getLabel ());
5454 }
55+
5556 return $ component ->hiddenLabel ();
5657 })->toArray ();
5758 }
0 commit comments