* zin: refactor datePicker with zui component.
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user