true ], $config ); // Parent constructor parent::__construct( $config ); // Initialization $this->name = $name; $this->label = $config['label'] ?? null; $this->tabItemConfig = $config['tabItemConfig'] ?? []; $this->addClasses( [ 'oo-ui-tabPanelLayout' ] ); $this->setAttributes( [ 'role' => 'tabpanel', ] ); } /** @inheritDoc */ public function getConfig( &$config ) { $config['name'] = $this->name; $config['label'] = $this->label; if ( $this->tabItemConfig ) { $config['tabItemConfig'] = $this->tabItemConfig; } // scrollable default has changed to true if ( !$this->hasClass( 'oo-ui-panelLayout-scrollable' ) ) { $config['scrollable'] = false; } else { unset( $config['scrollable'] ); } return parent::getConfig( $config ); } /** * @return string */ public function getName() { return $this->name; } /** * @return array */ public function getTabItemConfig() { return $this->tabItemConfig; } /** * @return string|HtmlSnippet|null */ public function getLabel() { return $this->label; } /** * @param bool $active */ public function setActive( $active ) { $this->active = $active; $this->removeClasses( [ 'oo-ui-tabPanelLayout-active' ] ); if ( $active ) { $this->addClasses( [ 'oo-ui-tabPanelLayout-active' ] ); } } }