|
1
|
|
|
<?php |
|
2
|
|
|
namespace Ajax\semantic\html\elements; |
|
3
|
|
|
|
|
4
|
|
|
use Ajax\semantic\html\base\HtmlSemDoubleElement; |
|
5
|
|
|
use Ajax\semantic\html\base\constants\State; |
|
6
|
|
|
use Ajax\semantic\html\base\constants\Variation; |
|
7
|
|
|
use Ajax\semantic\html\base\traits\IconTrait; |
|
8
|
|
|
use Ajax\semantic\html\collections\form\traits\TextFieldsTrait; |
|
9
|
|
|
use Ajax\semantic\html\collections\form\traits\FieldTrait; |
|
10
|
|
|
|
|
11
|
|
|
class HtmlInput extends HtmlSemDoubleElement { |
|
12
|
|
|
use IconTrait,TextFieldsTrait,FieldTrait; |
|
13
|
|
|
|
|
14
|
|
|
public function __construct($identifier, $type="text", $value="", $placeholder="") { |
|
15
|
|
|
parent::__construct("div-" . $identifier, "div", "ui input"); |
|
16
|
|
|
$this->content=[ "field" => new \Ajax\common\html\html5\HtmlInput($identifier, $type, $value, $placeholder) ]; |
|
17
|
|
|
$this->_states=[ State::DISABLED,State::FOCUS,State::ERROR ]; |
|
18
|
|
|
$this->_variations=[ Variation::TRANSPARENT ]; |
|
19
|
|
|
} |
|
20
|
|
|
|
|
21
|
|
|
public function getField() { |
|
22
|
|
|
return $this->content["field"]; |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
public function getDataField() { |
|
26
|
|
|
return $this->getField(); |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
public static function outline($identifier, $icon, $value="", $placeholder="") { |
|
30
|
|
|
$result=new HtmlInput($identifier, "text", $value, $placeholder); |
|
31
|
|
|
$result->addToProperty("class", "transparent"); |
|
32
|
|
|
$result->addIcon($icon)->setOutline(); |
|
33
|
|
|
return $result; |
|
34
|
|
|
} |
|
35
|
|
|
} |