* zin: refactor datePicker with zui component.

This commit is contained in:
sunhao
2023-07-07 11:28:08 +08:00
parent b8b61842d4
commit 36b4a82c1e
2 changed files with 25 additions and 4 deletions
+9
View File
@@ -11,6 +11,7 @@ require_once dirname(__DIR__) . DS . 'radiolist' . DS . 'v1.php';
require_once dirname(__DIR__) . DS . 'select' . DS . 'v1.php';
require_once dirname(__DIR__) . DS . 'inputcontrol' . DS . 'v1.php';
require_once dirname(__DIR__) . DS . 'picker' . DS . 'v1.php';
require_once dirname(__DIR__) . DS . 'datepicker' . DS . 'v1.php';
class control extends wg
{
@@ -121,6 +122,14 @@ class control extends wg
);
}
protected function buildDate(): wg
{
return new datePicker
(
set($this->props->skip('type'))
);
}
protected function build(): wg
{
$type = $this->prop('type');
+16 -4
View File
@@ -3,9 +3,21 @@ namespace zin;
require_once dirname(__DIR__) . DS . 'input' . DS . 'v1.php';
class datePicker extends input
class datePicker extends wg
{
static $defaultProps = array(
'type' => 'date'
);
/**
* Build the widget.
*
* @access protected
* @return wg
*/
protected function build(): wg
{
return zui::datePicker
(
set::_class('form-group-wrapper'),
set::icon('calendar'),
set($this->props)
);
}
}