Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
rupadana authored and github-actions[bot] committed Oct 2, 2023
1 parent 5b1a658 commit 2bd6a41
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Components/InputGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

namespace Rupadana\FilamentCustomForms\Components;

use Filament\Forms\Components\Concerns\HasLabel;
use Filament\Forms\Components\Grid;
use Closure;
use Filament\Forms\Components\Concerns\HasLabel;
use Filament\Forms\Components\Field;
use Filament\Forms\Components\Grid;

class InputGroup extends Grid
{
use HasLabel;

protected string $view = 'filament-custom-forms::components.grid';

public static function make(array | int | string | null $columns = 2): static
Expand All @@ -19,11 +20,10 @@ public static function make(array | int | string | null $columns = 2): static
$static->extraAttributes(['class' => 'filament-input-group gap-y-2 grid']);

$static->columnSpan(1);

return $static;
}


public function schema(array | Closure $components): static
{
$this->childComponents($components);
Expand All @@ -34,7 +34,7 @@ public function schema(array | Closure $components): static
public function showChildLabel(bool $condition = true)
{

$this->isHideChildLabel = !$condition;
$this->isHideChildLabel = ! $condition;

Check failure on line 37 in src/Components/InputGroup.php

View workflow job for this annotation

GitHub Actions / phpstan

Access to an undefined property Rupadana\FilamentCustomForms\Components\InputGroup::$isHideChildLabel.

return $this;
}
Expand All @@ -46,12 +46,13 @@ public function getChildComponents(): array
{

$components = $this->childComponents;

if ($this->isHideChildLabel) {

Check failure on line 50 in src/Components/InputGroup.php

View workflow job for this annotation

GitHub Actions / phpstan

Access to an undefined property Rupadana\FilamentCustomForms\Components\InputGroup::$isHideChildLabel.
$components = collect($components)->map(function (Field $component) {
if (method_exists($component, 'placeholder')) {
$component = $component->placeholder($component->getLabel());
}

return $component->hiddenLabel();
})->toArray();
}
Expand Down

0 comments on commit 2bd6a41

Please sign in to comment.