1 | <?php |
||
5 | class TextSelect extends Element |
||
6 | { |
||
7 | /** |
||
8 | * @var array |
||
9 | */ |
||
10 | protected $options = []; |
||
11 | |||
12 | /** |
||
13 | * Except attributes to insert. |
||
14 | * |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $exceptAttributes = [ 'stat', 'default' ]; |
||
18 | |||
19 | /** |
||
20 | * Required attributes which can't be replaced. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $requiredAttributes = [ |
||
25 | 'style' => 'max-width: 300px', |
||
26 | 'data-input-type' => 'text_dropdown', |
||
27 | 'class' => 'ui fluid search selection dropdown' |
||
28 | ]; |
||
29 | |||
30 | /** |
||
31 | * Render input. |
||
32 | * |
||
33 | * @return string |
||
34 | */ |
||
35 | public function renderInput() |
||
52 | |||
53 | /** |
||
54 | * Get default text value. |
||
55 | * |
||
56 | * @param string $default |
||
57 | * @return null |
||
58 | */ |
||
59 | public function getDefaultText($default = 'default') |
||
65 | |||
66 | /** |
||
67 | * Get options |
||
68 | * |
||
69 | * @return array |
||
70 | */ |
||
71 | public function getOptions() |
||
78 | |||
79 | /** |
||
80 | * Convert array attributes into html attributes. |
||
81 | * |
||
82 | * @return string |
||
83 | */ |
||
84 | private function renderAttributesAsHtml() |
||
100 | |||
101 | /** |
||
102 | * Clear attributes. |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | public function cleanAttributes() |
||
118 | |||
119 | /** |
||
120 | * Render value as html attribute. |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | private function renderValueAsHtml() |
||
133 | } |