[] ]; /** * @var array */ protected static $propsRule = [ 'disabled' => 'boolean', 'alpha' => 'boolean', 'hue' => 'boolean', 'recommend' => 'boolean', 'size' => 'string', 'format' => 'string', ]; /** * 自定义颜色预设 * * @param $colors * @return $this */ public function colors($colors) { $colors = Helper::toType($colors, 'array'); $this->props['colors'] = array_merge($this->props['colors'], $colors); return $this; } public function getValidateHandler() { return Validate::str(); } /** * @return array */ public function build() { return [ 'type' => $this->name, 'field' => $this->field, 'title' => $this->title, 'value' => $this->value, 'props' => (object)$this->props, 'validate' => $this->validate, 'col' => $this->col ]; } }