19declare(strict_types=1);
47 DataFactory $data_factory,
64 $this->
refinery->string()->hasMaxLength($max_limit)
88 $this->
refinery->string()->hasMinLength($min_limit)
108 return is_string($value);
116 if ($this->requirement_constraint !==
null) {
117 return $this->requirement_constraint;
120 if ($this->min_limit) {
121 return $this->
refinery->string()->hasMinLength($this->min_limit);
123 return $this->
refinery->string()->hasMinLength(1);
131 return $this->min_limit > 0 || $this->max_limit > 0;
139 return fn(
$id) =>
"$('#$id').on('input', function(event) {
140 il.UI.input.onFieldUpdate(event, '$id', $('#$id').val());
142 il.UI.input.onFieldUpdate(event, '$id', $('#$id').val());";
150 if ($this->strip_tags_from_input) {
151 yield $this->
refinery->custom()->transformation(fn($v) => strip_tags($v));
153 yield
from parent::getOperations();
161 $clone = clone $this;
162 $clone->strip_tags_from_input =
false;
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
This implements the textarea input.
isClientSideValueOk($value)
getMaxLimit()
get maximum limit of characters
getUpdateOnLoadCode()
Get update code.This method has to return JS code that calls il.UI.filter.onFieldUpdate(event,...
getConstraintForRequirement()
getMinLimit()
get minimum limit of characters
__construct(DataFactory $data_factory, \ILIAS\Refinery\Factory $refinery, string $label, ?string $byline)
bool $strip_tags_from_input
A constraint encodes some resrtictions on values.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.