UNPKG

@rcsb/rcsb-saguaro-app

Version:
26 lines (25 loc) 1.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RcsbTabs = void 0; const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = tslib_1.__importDefault(require("react")); const react_bootstrap_1 = require("react-bootstrap"); const classes = tslib_1.__importStar(require("../../scss/bootstrap-fv-display.module.scss")); const uniqid_1 = tslib_1.__importDefault(require("uniqid")); class RcsbTabs extends react_1.default.Component { constructor(props) { super(props); } render() { return ((0, jsx_runtime_1.jsx)("div", { className: classes.bootstrapFvComponentScope, children: (0, jsx_runtime_1.jsx)(react_bootstrap_1.Tabs, { id: this.props.id, defaultActiveKey: this.props.default, onSelect: (eventKey) => { this.props.onSelect(eventKey); }, children: this.props.tabList.map((tab, n) => ((0, jsx_runtime_1.jsxs)(react_bootstrap_1.Tab, { eventKey: tab.key, title: tab.title, children: [tab.additionalComponent, (0, jsx_runtime_1.jsx)("div", { id: tab.key + RcsbTabs.UI_SUFFIX, style: { height: 20 } }), (0, jsx_runtime_1.jsx)("div", { id: tab.key })] }, (0, uniqid_1.default)(`${tab.key}_`)))) }) })); } componentDidMount() { this.props.onMount(this.props.default); } } exports.RcsbTabs = RcsbTabs; RcsbTabs.UI_SUFFIX = "_" + (0, uniqid_1.default)() + "_UI_DIV"; RcsbTabs.SELECT_SUFFIX = "_" + (0, uniqid_1.default)() + "_SELECT_DIV";