Skip to content

Commit

Permalink
Merge pull request #4 from trendmicro-frontend/fix/broken-tabpane-con…
Browse files Browse the repository at this point in the history
…tent

Fixed broken layout on first render
  • Loading branch information
roth1002 authored Aug 21, 2018
2 parents f2b912a + f75a0a8 commit 1c5d4c8
Show file tree
Hide file tree
Showing 9 changed files with 9,101 additions and 872 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ package-lock.json
/.nyc_output
/coverage
/lib
yarn.lock
10 changes: 9 additions & 1 deletion dist/react-navs.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/react-navs.min.css

Large diffs are not rendered by default.

9,892 changes: 9,029 additions & 863 deletions docs/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
</head>
<body>
<div id="container"></div>
<script type="text/javascript" src="bundle.js?4fb8f4ffa1848784528d"></script></body>
<script type="text/javascript" src="bundle.js?cc452d7b43cce65d3c29"></script></body>
</html>
55 changes: 52 additions & 3 deletions examples/LightTabs.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,33 @@
import React from 'react';
import { MenuItem } from '@trendmicro/react-dropdown';
import Table from '@trendmicro/react-table';
import '@trendmicro/react-table/dist/react-table.css';

import { Nav, NavItem, NavDropdown, TabContent, TabPane } from '../src';
import { Section } from './layout';

const columns1 = [
{ title: 'Event Type', dataIndex: 'eventType1' },
{ title: 'Affected Devices', dataIndex: 'affectedDevices1' },
{ title: 'Detections', dataIndex: 'detections1', width: 800 }
];

const columns2 = [
{ title: 'Event Type', dataIndex: 'eventType2' },
{ title: 'Affected Devices', dataIndex: 'affectedDevices2' },
{ title: 'Detections', dataIndex: 'detections2' },
{ title: 'User', dataIndex: 'user' },
{ title: 'Domain', dataIndex: 'domain' }
];

const columns3 = [
{ title: 'Event Type', dataIndex: 'eventType3' },
{ title: 'Affected Devices', dataIndex: 'affectedDevices3' },
{ title: 'Detections', dataIndex: 'detections3' },
{ title: 'Endpoint', dataIndex: 'endpoint' },
{ title: 'Policy', dataIndex: 'policy' }
];

const LightTabs = ({ state, actions }) => {
return (
<Section className="row-md-8">
Expand All @@ -29,13 +54,37 @@ const LightTabs = ({ state, actions }) => {
</Nav>
<TabContent activeKey={state.tab}>
<TabPane eventKey={1}>
Tab 1 content
<Table
justified={false}
hoverable={false}
maxHeight={180}
useFixedHeader={true}
rowKey="id"
columns={columns1}
data={[]}
/>
</TabPane>
<TabPane eventKey={2}>
Tab 2 content
<Table
justified={false}
hoverable={false}
maxHeight={180}
useFixedHeader={true}
rowKey="id"
columns={columns2}
data={[]}
/>
</TabPane>
<TabPane eventKey={3}>
Tab 3 content
<Table
justified={false}
hoverable={false}
maxHeight={180}
useFixedHeader={true}
rowKey="id"
columns={columns3}
data={[]}
/>
</TabPane>
<TabPane eventKey={4.1}>
Tab 4.1 content
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@trendmicro/react-navs",
"version": "0.11.3",
"version": "0.11.4",
"description": "Trend Micro Components: React Navs",
"main": "lib/index.js",
"files": [
Expand Down Expand Up @@ -54,6 +54,7 @@
},
"devDependencies": {
"@trendmicro/react-buttons": "~1.3.0",
"@trendmicro/react-table": "^1.0.0-alpha",
"babel-cli": "~6.26.0",
"babel-core": "~6.26.0",
"babel-eslint": "~8.2.1",
Expand Down
6 changes: 5 additions & 1 deletion src/tab.styl
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
.tab-content > .tab-pane {
display: none;
display: block;
opacity: 0;
height: 0;
}

.tab-content > .active {
display: block;
opacity: 1;
height: inherit;
}

0 comments on commit 1c5d4c8

Please sign in to comment.