N°4021 - Introduce sticky header for panels and object details (tab container to be done)

This commit is contained in:
Molkobain
2021-05-25 20:16:36 +02:00
parent dd284a6c1d
commit 3ee4a14c56
12 changed files with 526 additions and 54 deletions

View File

@@ -44,6 +44,9 @@ class Panel extends UIContentBlock
public const BLOCK_CODE = 'ibo-panel';
public const DEFAULT_HTML_TEMPLATE_REL_PATH = 'base/components/panel/layout';
public const DEFAULT_JS_TEMPLATE_REL_PATH = 'base/components/panel/layout';
public const DEFAULT_JS_FILES_REL_PATH = [
'js/components/panel.js',
];
// Specific constants
/** @var string ENUM_COLOR_PRIMARY */
@@ -103,6 +106,11 @@ class Panel extends UIContentBlock
public const DEFAULT_ICON_COVER_METHOD = self::ENUM_ICON_COVER_METHOD_CONTAIN;
/** @var bool */
public const DEFAULT_ICON_AS_MEDALLION = false;
/**
* @var bool
* @see static::$bIsHeaderVisibleOnScroll
*/
public const DEFAULT_IS_HEADER_VISIBLE_ON_SCROLL = false;
/** @var iUIContentBlock $oTitleBlock */
protected $oTitleBlock;
@@ -118,6 +126,8 @@ class Panel extends UIContentBlock
protected $sColor;
/** @var bool $bIsCollapsible */
protected $bIsCollapsible;
/** @var bool $bIsHeaderVisibleOnScroll True if the header of the panel should remain visible when scrolling */
protected $bIsHeaderVisibleOnScroll;
/**
* Panel constructor.
@@ -146,6 +156,7 @@ class Panel extends UIContentBlock
$this->SetMainBlocks([]);
$this->SetToolBlocks([]);
$this->bIsCollapsible = false;
$this->bIsHeaderVisibleOnScroll = static::DEFAULT_IS_HEADER_VISIBLE_ON_SCROLL;
}
/**
@@ -448,6 +459,27 @@ class Panel extends UIContentBlock
return $this;
}
/**
* @see static::$bIsHeaderVisibleOnScroll
* @return bool
*/
public function IsHeaderVisibleOnScroll(): bool
{
return $this->bIsHeaderVisibleOnScroll;
}
/**
* @see static::$bIsHeaderVisibleOnScroll
*
* @param bool $bIsHeaderVisibleOnScroll
*
* @return $this
*/
public function SetIsHeaderVisibleOnScroll(bool $bIsHeaderVisibleOnScroll)
{
$this->bIsHeaderVisibleOnScroll = $bIsHeaderVisibleOnScroll;
return $this;
}
//----------------------
// Specific content area