3
3
namespace Thiktak \FilamentNestedBuilderForm \Forms \Components ;
4
4
5
5
use Closure ;
6
- use Filament \Forms \Components \Builder ;
7
6
use Illuminate \Support \Collection ;
8
7
9
8
class NestedBuilder extends NestedSubBuilder
10
9
{
11
- public Closure | null $ nestedConfiguration = null ;
10
+ public ?Closure $ nestedConfiguration = null ;
11
+
12
12
protected array $ nestedSchemas = [];
13
13
14
14
protected NestedSubBuilder $ nestedSubBuilder ;
15
15
16
16
public function nestedSchema (Closure $ components , string $ name = 'default ' ): static
17
17
{
18
18
$ this ->nestedSchemas [$ name ] = $ components ;
19
+
19
20
return $ this ;
20
21
}
21
22
@@ -33,7 +34,6 @@ public function getNestedSubBuilder(): NestedSubBuilder
33
34
return $ this ->nestedSubBuilder ?? $ this ;
34
35
}
35
36
36
-
37
37
public function getNestedNamedChildComponents (string $ name = 'default ' , string $ fallbackName = 'default ' ): mixed
38
38
{
39
39
if (isset ($ this ->nestedSchemas [$ name ])) {
@@ -45,7 +45,7 @@ public function getNestedNamedChildComponents(string $name = 'default', string $
45
45
return [];
46
46
}
47
47
48
- public function nestedConfiguration (Closure | null $ nestedConfiguration = null ): static
48
+ public function nestedConfiguration (Closure $ nestedConfiguration = null ): static
49
49
{
50
50
$ this ->nestedConfiguration = $ nestedConfiguration ;
51
51
@@ -57,12 +57,12 @@ public function nestedConfiguration(Closure | null $nestedConfiguration = null):
57
57
public function getNestedConfiguration (NestedSubBuilder $ builder ): static
58
58
{
59
59
$ this ->evaluate ($ this ->nestedConfiguration , [
60
- 'builder ' => $ builder ?: $ this
60
+ 'builder ' => $ builder ?: $ this ,
61
61
]);
62
+
62
63
return $ this ;
63
64
}
64
65
65
-
66
66
/*protected function getRootNestedBuilderIterator($data, $object): Collection
67
67
{
68
68
if (!is_object($object)) {
0 commit comments