self::TYPE_INPUT, 'maxLength' => 0 ]; /** * @var array */ protected static $propsRule = [ 'type' => 'string', 'src' => 'string', 'maxLength' => 'int', 'icon' => 'string', 'height' => 'string', 'width' => 'string', 'spin' => 'boolean', 'frameTitle' => ['string', 'title'], 'handleIcon' => 'boolean', 'allowRemove' => 'boolean', ]; /** * @param string|array $value * @return $this */ public function value($value) { $this->value = $value; return $this; } /** * */ protected function init() { $this->frameTitle($this->getPlaceHolder()); } public function getValidateHandler() { return Validate::arr(); } /** * @return array */ public function build() { $value = $this->value; if ($this->props['maxLength'] == 1 && is_array($value)) $value = isset($value[0]) ? $value[0] : ''; return [ 'type' => $this->name, 'field' => $this->field, 'title' => $this->title, 'value' => $value, 'props' => (object)$this->props, 'validate' => $this->validate, 'col' => $this->col ]; } }