filamentphp / filament

A collection of beautiful full-stack components for Laravel. The perfect starting point for your next app. Using Livewire, Alpine.js and Tailwind CSS.
https://filamentphp.com
MIT License
18.1k stars 2.83k forks source link

Fieldset with one column #10539

Closed howdu closed 9 months ago

howdu commented 9 months ago

Package

filament/filament

Package Version

v3.1.25

Laravel Version

v10.38.1

Livewire Version

v3.3.3

PHP Version

8.2.9

Problem description

There is no way of using a fieldset with a single column.

By default the fieldset's setup method adds two columns but there's no way of removing this (without extending the class and overwriting the setup method).

Example below where on the left the lg grid class is manually removed to show what I'm trying to achieve.

Screenshot 2023-12-28 at 15 37 53

Expected behavior

Behave the same as other containing components group/grid.

Steps to reproduce

public static function form(Form $form): Form
{
    return $form->schema([
        Fieldset::make('Date')
            ->columnSpan(1)
            ->columns(['default' => 1])
            ->schema([
                DateTimePicker::make('from')
                    ->hiddenLabel()
                    ->prefix('From'),
                DateTimePicker::make('until')
                    ->hiddenLabel()
                    ->prefix('Until')
            ]),
        Fieldset::make('Date2')
            ->columnSpan(1)
            ->columns(['default' => 1])
            ->schema([
                DateTimePicker::make('from2')
                    ->hiddenLabel()
                    ->prefix('From2'),
                DateTimePicker::make('until2')
                    ->hiddenLabel()
                    ->prefix('Until2')
            ]),
    ])
        ->columns();
}

Reproduction repository

https://github.com/howdu/filament-issue/tree/fieldset-one-column

Relevant log output

No response

danharrin commented 9 months ago

->columns(1) or ->columns(['lg' => 1]) should work fine instead of default