19declare(strict_types=1);
48 DataFactory $data_factory,
65 $this->
refinery->string()->hasMaxLength($max_limit)
89 $this->
refinery->string()->hasMinLength($min_limit)
109 return is_string($value);
117 if ($this->requirement_constraint !==
null) {
118 return $this->requirement_constraint;
121 if ($this->min_limit) {
122 return $this->
refinery->string()->hasMinLength($this->min_limit);
124 return $this->
refinery->string()->hasMinLength(1);
132 return $this->min_limit > 0 || $this->max_limit > 0;
140 return fn(
$id) =>
"$('#$id').on('input', function(event) {
141 il.UI.input.onFieldUpdate(event, '$id', $('#$id').val());
143 il.UI.input.onFieldUpdate(event, '$id', $('#$id').val());";
151 if ($this->strip_tags_from_input) {
152 yield $this->
refinery->custom()->transformation(fn($v) => strip_tags($v));
154 yield
from parent::getOperations();
162 $clone = clone $this;
163 $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.