* [misc,0.5h] add sqlbuilderhelpicon.

This commit is contained in:
qixinzhi
2024-09-04 16:10:43 +08:00
committed by 代婷婷
parent 6049c0b102
commit 576cc1cc82
+32
View File
@@ -0,0 +1,32 @@
<?php
declare(strict_types=1);
namespace zin;
class sqlBuilderHelpIcon extends wg
{
protected static array $defineProps = array(
"text?: string",
"placement?: string",
"toggle?: bool=true"
);
protected function build()
{
list($text, $placement, $toggle) = $this->prop(array('text', 'placement', 'toggle'));
if(empty($text)) return span
(
setClass('text-warning'),
icon('help'),
);
return btn
(
setClass('inline ghost'),
set::size('sm'),
setData(array('title' => $text, 'placement' => $placement, 'className' => 'text-gray border border-light', 'type' => 'white', 'hideOthers' => true)),
$toggle ? set('data-toggle', 'tooltip') : null,
icon('help')
);
}
}