mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Style
This commit is contained in:
@@ -46,11 +46,11 @@ class ComponentContainer extends ViewComponent
|
||||
{
|
||||
return match ($parameterName) {
|
||||
'livewire' => [$this->getLivewire()],
|
||||
'record' => [$this->getRecord()],
|
||||
'record' => [$this->getRecord()],
|
||||
default => parent::resolveDefaultClosureDependencyForEvaluationByName($parameterName),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array<mixed>
|
||||
*/
|
||||
|
||||
@@ -36,7 +36,7 @@ class Component extends ViewComponent
|
||||
protected function resolveDefaultClosureDependencyForEvaluationByName(string $parameterName): array
|
||||
{
|
||||
return match ($parameterName) {
|
||||
'livewire' => [$this->getLivewire()],
|
||||
'livewire' => [$this->getLivewire()],
|
||||
'record' => [$this->getRecord()],
|
||||
'state' => [$this->getState()],
|
||||
default => parent::resolveDefaultClosureDependencyForEvaluationByName($parameterName),
|
||||
|
||||
@@ -10,25 +10,25 @@ use Livewire\Component;
|
||||
|
||||
class Livewire extends Component implements HasForms, HasInfolists
|
||||
{
|
||||
use InteractsWithForms;
|
||||
use InteractsWithInfolists;
|
||||
|
||||
public $data;
|
||||
|
||||
public static function make(): static
|
||||
{
|
||||
return new static;
|
||||
}
|
||||
|
||||
public function data($data): static
|
||||
{
|
||||
$this->data = $data;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
use InteractsWithForms;
|
||||
use InteractsWithInfolists;
|
||||
|
||||
public $data;
|
||||
|
||||
public static function make(): static
|
||||
{
|
||||
return new static;
|
||||
}
|
||||
|
||||
public function data($data): static
|
||||
{
|
||||
$this->data = $data;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getData()
|
||||
{
|
||||
return $this->data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,8 +15,8 @@ it('can inject the correct `$livewire` for infolists outside a panel', function
|
||||
->assertSee('First Entry State')
|
||||
->assertSee('Second Entry Label')
|
||||
->assertSee('Second Entry State')
|
||||
->assertSee('Third Entry Label')
|
||||
->assertSee('Third Entry State (dynamic)');
|
||||
->assertSee('Third Entry Label')
|
||||
->assertSee('Third Entry State (dynamic)');
|
||||
});
|
||||
|
||||
class TestComponentWithInfolist extends Livewire
|
||||
@@ -55,11 +55,11 @@ class TestComponentWithInfolist extends Livewire
|
||||
->label('Second Entry Label'),
|
||||
Infolists\Components\TextEntry::make('third_entry')
|
||||
->label('Third Entry Label')
|
||||
->getStateUsing(function (TestComponentWithInfolist $livewire) {
|
||||
expect($livewire)->toBe($this);
|
||||
|
||||
return 'Third Entry State (dynamic)';
|
||||
}),
|
||||
->getStateUsing(function (TestComponentWithInfolist $livewire) {
|
||||
expect($livewire)->toBe($this);
|
||||
|
||||
return 'Third Entry State (dynamic)';
|
||||
}),
|
||||
];
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user