From 22f422225554873d484155ee7bdb7ebeabd48cad Mon Sep 17 00:00:00 2001 From: Hao Sun Date: Thu, 16 Feb 2023 09:45:25 +0800 Subject: [PATCH] * zin: actionItem supports more types --- zin/wg/actionitem/v1.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/zin/wg/actionitem/v1.php b/zin/wg/actionitem/v1.php index e68d5b76b0..3f031b0ef4 100644 --- a/zin/wg/actionitem/v1.php +++ b/zin/wg/actionitem/v1.php @@ -1,13 +1,44 @@ prop('icon', 'text', 'trailingIcon'); + + return h::span + ( + set($text), + set($this->props->skip(array_keys(actionItem::getDefinedProps()))), + $icon ? icon($icon) : NULL, + $this->children(), + $trailingIcon ? icon($trailingIcon) : NULL, + ); + } + + protected function buildBtnItem() + { + return new btn($this->props->skip('tagName,type,name,outerTag,outerProps')); + } + protected function buildItem() { + $type = $this->prop('type'); + $methodName = "build{$type}Item"; + if(method_exists($this, $methodName)) return $this->$methodName(); + list($tagName, $icon, $text, $trailingIcon) = $this->prop('tagName', 'icon', 'text', 'trailingIcon'); + return h::create ( $tagName,