N°8955 New UIBlocks for setup

This commit is contained in:
Timothee
2026-01-15 11:33:17 +01:00
parent 8bacd62467
commit 43f9aaf55f
13 changed files with 315 additions and 45 deletions

View File

@@ -1,9 +1,11 @@
<?php
namespace Combodo\iTop\Application\UI\Base\Component\Badge;
use Combodo\iTop\Application\UI\Base\UIBlock;
class Badge extends UIBlock{
class Badge extends UIBlock
{
public const BLOCK_CODE = 'ibo-badge';
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/badge/layout';
@@ -24,13 +26,18 @@ class Badge extends UIBlock{
/** @var string ENUM_COLOR_SCHEME_CYAN */
public const ENUM_COLOR_SCHEME_CYAN = 'cyan';
/** @var string DEFAULT_COLOR_SCHEME */
public const ENUM_COLOR_SCHEME_GREY = 'grey';
/** @var string DEFAULT_COLOR_SCHEME */
public const ENUM_COLOR_SCHEME_BLUE_GREY = 'blue-grey';
/** @var string DEFAULT_COLOR_SCHEME */
public const ENUM_COLOR_SCHEME_ORANGE = 'orange';
/** @var string DEFAULT_COLOR_SCHEME */
public const DEFAULT_COLOR_SCHEME = self::ENUM_COLOR_SCHEME_NEUTRAL;
private string $sLabel;
private string $sColor;
private string $sTooltip;
public function __construct(string $sLabel, string $sColor = self::DEFAULT_COLOR_SCHEME,string $sTooltip = '', string $sId = null)
public function __construct(string $sLabel, string $sColor = self::DEFAULT_COLOR_SCHEME, string $sTooltip = '', string $sId = null)
{
parent::__construct($sId);
@@ -42,14 +49,16 @@ class Badge extends UIBlock{
/**
* @return string
*/
public function GetTooltip(): string {
public function GetTooltip(): string
{
return $this->sTooltip;
}
/**
* @param string $sTooltip
*/
public function SetTooltip(string $sTooltip) {
public function SetTooltip(string $sTooltip)
{
$this->sTooltip = $sTooltip;
return $this;
}
@@ -91,4 +100,4 @@ class Badge extends UIBlock{
$this->sColor = $sColor;
return $this;
}
}
}