mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
initial placeholder component
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<x-forms::field-group
|
||||
:column-span="$formComponent->getColumnSpan()"
|
||||
:error-key="$formComponent->getName()"
|
||||
:for="$formComponent->getId()"
|
||||
:label="$formComponent->getLabel()"
|
||||
>
|
||||
<div class="flex">
|
||||
<span
|
||||
class="block w-full placeholder-gray-400 placeholder-opacity-100 px-3 py-2 cursor-default"
|
||||
>
|
||||
{{ $formComponent->getName() }}
|
||||
</span>
|
||||
</div>
|
||||
</x-forms::field-group>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Filament\Forms\Components;
|
||||
|
||||
class Placeholder extends Component
|
||||
{
|
||||
protected $name;
|
||||
|
||||
public function __construct($placeholderValue)
|
||||
{
|
||||
$this->name($placeholderValue);
|
||||
$this->setUp();
|
||||
}
|
||||
|
||||
protected function name($name)
|
||||
{
|
||||
$this->name = $name;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
public static function make(string $placeholderValue)
|
||||
{
|
||||
return new static($placeholderValue);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Filament\Resources\Forms\Components;
|
||||
|
||||
class Placeholder extends \Filament\Forms\Components\Placeholder
|
||||
{
|
||||
use Concerns\CanBeDependentOnResourceRecord;
|
||||
}
|
||||
Reference in New Issue
Block a user