23 abstract public function addLabel($caption, $style=
"label-default", $leftSeparator=
" ");
24 abstract public function addContent($content,$before=
false);
29 $this->
getField()->addToProperty(
"class", State::FOCUS);
33 if ($this->_hasIcon ===
false) {
34 throw new \Exception(
"Input must have an icon for showing a loader, use addIcon before");
45 public function labeled($label, $direction=Direction::LEFT, $icon=NULL) {
47 $labelO=$field->addLabel($label,$direction===Direction::LEFT,$icon);
48 $field->addToProperty(
"class", $direction .
" labeled");
59 public function labeledCheckbox($direction=Direction::LEFT,$caption=
"",$value=NULL,$checkboxType=NULL){
69 return $this->
labeled(
"", $direction .
" corner", $icon)->toCorner($direction);
79 public function addAction($action, $direction=Direction::RIGHT, $icon=NULL, $labeled=
false) {
82 if (\is_object($action) ===
false) {
83 $actionO=
new HtmlButton(
"action-" . $this->identifier, $action);
85 $actionO->addIcon($icon,
true, $labeled);
87 $field->addToProperty(
"class", $direction .
" action");
88 $field->addContent($actionO, \strstr($direction, Direction::LEFT) !==
false);
98 public function addDropdown($label=
"", $items=array(),$direction=Direction::RIGHT){
99 $labelO=
new HtmlDropdown(
"dd-".$this->identifier,$label,$items);
100 $labelO->asSelect(
"select-".$this->identifier,
false,
true);
101 return $this->
labeled($labelO,$direction);
105 return $this->
getField()->addToProperty(
"class",
"transparent");
119 $this->
getField()->addToProperty(
"class",
"fluid");
126 $field->addToProperty(
"class",
"disabled");
134 $id=$field->getIdentifier();
137 return '$("#'.$id.
'").val('.$content.
')';
145 public function asFile($caption=
'', $direction=Direction::RIGHT, $icon=
'cloud upload alternate', $labeled=
false){
147 $field->getDataField()->setProperty(
'readonly',
'readonly');
148 $file=
new HtmlInput5($this->identifier.
'-file',
'file');
149 $file->setProperty(
'style',
'display: none!important;');
150 $field->getField()->content[
'file']=$file;
151 $this->
addAction($caption,$direction,$icon,$labeled);
BaseHtml for HTML components.
Semantic Label component.