Add features to Spinner block

This commit is contained in:
Stephen Abello
2023-04-14 11:09:21 +02:00
parent 95f0e97b5e
commit 16e27ef189
5 changed files with 180 additions and 3 deletions

View File

@@ -19,9 +19,71 @@ class Spinner extends UIBlock
// Overloaded constants
public const BLOCK_CODE = 'ibo-spinner';
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/spinner/layout';
/* @var string Display size for inline element, rather small */
public const ENUM_SPINNER_SIZE_INLINE = 'inline';
/* @var string Display size for small element, displayed in a column */
public const ENUM_SPINNER_SIZE_SMALL = 'small';
/* @var string Display size for medium element, displayed in a column */
public const ENUM_SPINNER_SIZE_MEDIUM = 'medium';
public function __construct(?string $sId = null)
/* @var string Display size for large element, displayed in a column */
public const ENUM_SPINNER_SIZE_LARGE = 'large';
/* @var string Default display size */
public const ENUM_SPINNER_SIZE_DEFAULT = self::ENUM_SPINNER_SIZE_INLINE;
/* @var string */
private $sDescription = '';
/* @var string */
private $sSize = self::ENUM_SPINNER_SIZE_DEFAULT;
public function __construct(?string $sId = null, $sDescription = '')
{
parent::__construct($sId);
$this->sDescription = $sDescription;
}
/**
* @return string
*/
public function GetDescription(): string
{
return $this->sDescription;
}
/**
* @param string $sDescription
* @return $this
*/
public function SetDescription($sDescription)
{
$this->sDescription = $sDescription;
return $this;
}
/**
* @return bool
*/
public function HasDescription(): bool
{
return $this->sDescription !== '';
}
/**
* @return string
*/
public function GetSize(): string
{
return $this->sSize;
}
/**
* @param string $sSize
* @return $this
*/
public function SetSize(string $sSize)
{
$this->sSize = $sSize;
return $this;
}
}