Thiktak / filament-nested-builder-form

Plugin for FilamentPHP - NestedBuilder Form Component
MIT License
20 stars 7 forks source link

[Feature]: Make blocks collapsible #3

Open aeq-dev opened 7 months ago

aeq-dev commented 7 months ago

What happened?

Can we make blocks collapsible ?

How to reproduce the bug

-

Package Version

1.0.1

PHP Version

8.2

Laravel Version

10.x

Which operating systems does with happen with?

No response

Notes

No response

bariskanberkay commented 6 months ago

Simple add use CanBeCollapsed; NestedSubBuilder.php file use CanBeCollapsed; Ekran Resmi 2024-01-03 18 00 30

Forms\Components\Section::make('Genel Ayarlar IOS')
                    ->statePath('content.array_conf')
                    ->schema([
                        NestedBuilder::make('array_configuration')
                            ->collapsible() //ADD THIS
                            ->nestedConfiguration(function (NestedSubBuilder $builder) {
                                $builder->blockNumbers($builder->getLevel() == 1);
                                $builder->columnSpanFull();
                                $builder->collapsible(); //ADD THIS
                            })
                            ->nestedSchema(function (NestedSubBuilder $builder) { // Closure is mandatory
                                return self::getBlocks($builder);
                            })
                    ])

I created PR for this. #5