£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyʦ•ꎅȮFÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~芩ÊǍí`ÔÑ©ú뙵'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶êםӼ㞪éUWŸÈË%DÒÕ¬ï‘]/Åcx ‰ï2ß]ä6G[]S£Ôϯrs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ ¯¹ægƒÛowЍø^d™ý½ßB7áyMä9ÜÖUã !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! /** @jsx h */ import { Component, h } from 'preact'; class Tabs extends Component { constructor(props) { super(props); this.state = { activeKey: props.defaultActiveKey }; } render() { var navs = []; var contents = []; var i; for (i = 0; i < this.props.children.length; i++) { var child = this.props.children[i]; if (child !== undefined) { navs.push(this._buildNav(child)); contents.push(this._buildContent(child)); } } return (
{contents}
); } getActiveKey() { return this.state.activeKey; } setActiveKey(eventKey) { this.setState({ activeKey: eventKey }); } _buildNav(tab) { var className; if (this.getActiveKey() === tab.attributes.eventKey) { className = 'active'; } var self = this; var clickHandler = function(e) { self._handleTabClick(e, tab); }; return (
  • {tab.attributes.title}
  • ); } _buildContent(tab) { var className = 'tab-pane'; if (this.getActiveKey() === tab.attributes.eventKey) { className += ' active'; } return (
    {tab}
    ); } _buildIdForTab(tab) { if (tab.attributes.id) { return tab.attributes.id; } else if (this.props.id === undefined || this.props.id === '') { return tab.attributes.eventKey; } else { return this.props.id + '-' + tab.attributes.eventKey; } } _handleTabClick(e, tab) { e.preventDefault(); this.setActiveKey(tab.attributes.eventKey); } } export default Tabs;