23 $this->content = array();
28 if (isset($label) && $label !==
"")
31 $this->_validation = NULL;
36 $labelO->setPointing($pointing);
37 $this->
addContent($labelO, $pointing ===
"below" || $pointing ===
"right");
43 if (\is_string($label)) {
45 $labelO->setContent($label);
46 $labelO->setProperty(
"for", \str_replace(
"field-",
"", $this->identifier));
48 $this->content[
"label"] = $labelO;
52 $this->content[
"field"] = $field;
61 if (\array_key_exists(
"label", $this->content))
62 return $this->content[
"label"];
71 return $this->content[
"field"];
80 return $this->content[
"field"];
88 unset($this->content[
"label"]);
89 $this->content[
"label"] = $label;
99 if (\is_int($width)) {
100 $width = Wide::getConstants()[
"W" . $width];
103 if (isset($this->_container)) {
104 $this->_container->setEqualWidth(
false);
137 public function addRule($type, $prompt = NULL, $value = NULL) {
140 if (! isset($this->_validation)) {
143 if($type instanceof
Rule){
144 if($type->getType()==
'empty'){
147 }elseif ($type ===
'empty' || ($type[
'type'] ??
'') ===
'empty') {
150 $this->_validation->addRule($type, $prompt, $value);
158 if (! isset($this->_validation)) {
161 $this->_validation->setOptional($optional);
166 foreach ($rules as $rule) {
173 $this->_validation =
null;
177 public function addIcon($icon, $direction = Direction::LEFT) {
179 return $field->addIcon($icon, $direction);
187 return $this->
getField()->addToPropertyCtrl(
"class", $size, Size::getConstants());
191 if (isset($this->_validation)) {
192 $this->_validation->compile($js);
194 return parent::run($js);
jsDoJquery($jqueryCall, $param="")
Base class for Semantic double elements.
addToPropertyCtrl($name, $value, $typeCtrl)
Semantic Label component.