38 lines
897 B
PHP
38 lines
897 B
PHP
<?php
|
|
|
|
namespace Lucent\Schema\BlockUi;
|
|
|
|
use Lucent\Graph\Data\FieldData;
|
|
use Lucent\Schema\Field\FieldDataInterface;
|
|
use Lucent\Schema\Field\FieldInfo;
|
|
use Lucent\Schema\Field\FieldInterface;
|
|
use Lucent\Schema\Field\FieldType;
|
|
|
|
class Markdown implements FieldInterface,FieldDataInterface
|
|
{
|
|
public FieldInfo $info;
|
|
|
|
public function __construct(
|
|
public string $name,
|
|
public string $label,
|
|
public ?int $min = null,
|
|
public ?int $max = null,
|
|
public string $default = "",
|
|
)
|
|
{
|
|
$this->info = new FieldInfo("markdown", "Markdown Editor", FieldType::STRING);
|
|
}
|
|
|
|
public function format(FieldData $input, FieldData $output): FieldData
|
|
{
|
|
$value = $input->get($this->name);
|
|
$output->set($this->name,$value);
|
|
return $output;
|
|
}
|
|
public function isRequired(): bool
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|