File: D:/HostingSpaces/SBogers10/reiskick.komma.nl/vendor/komma/kms/src/Core/Attributes/TextField.php
<?php
namespace Komma\KMS\Core\Attributes;
use Komma\KMS\Core\Attributes\Interfaces\HasLabelInterface;
use Komma\KMS\Core\Attributes\Traits\ExplanationTrait;
use Komma\KMS\Core\Attributes\Traits\LabelTrait;
use Komma\KMS\Core\Attributes\Traits\PlaceholderTextTrait;
use Komma\KMS\Core\Attributes\Traits\ReadOnlyTrait;
/**
* Class TextField
* @package App\Kms\Core\Attributes
*/
class TextField extends Attribute implements HasLabelInterface
{
use LabelTrait;
use PlaceholderTextTrait;
use ReadOnlyTrait;
use ExplanationTrait;
/**
* A javascript regex pattern that is used to define how the text field should be entered.
* @example [A-Za-z]{3}.
* @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
*/
private string $pattern;
/**
* Returns a view that visually represents this attribute
*/
public function render(): string
{
return view('KMS::attributes.textField', [
'attribute' => $this
])->render();
}
/**
* @return bool
*/
public function hasPattern(): bool
{
return isset($this->pattern);
}
/**
* @return string
*/
public function getPattern(): ?string
{
return $this->pattern;
}
/**
* @param string $pattern
* @return TextField
*/
public function setPattern(string $pattern): TextField
{
$this->pattern = $pattern;
return $this;
}
}