Skip to content

Commit c92e71e

Browse files
committed
Update examples
1 parent 59a16bf commit c92e71e

File tree

4 files changed

+74
-16
lines changed

4 files changed

+74
-16
lines changed

examples/Section.styl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
position: relative;
55
z-index: 1;
66
transition: height .3s ease;
7+
overflow-y: auto;
78
}
89
.section:last-child {
910
margin-bottom: 20px;

examples/index.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import React from 'react';
33
import ReactDOM from 'react-dom';
44
import Navbar from './Navbar';
55
import Bordered from './tables/Bordered';
6-
import AutoFitOrJustified from './tables/AutoFitOrJustified';
6+
import AutoFit from './tables/AutoFit';
7+
import Justified from './tables/Justified';
78
import Displays from './tables/Displays';
89
import FixedColumns from './tables/FixedColumns';
910
import Pagination from './tables/Pagination';
@@ -21,7 +22,8 @@ const App = (props) => {
2122
<div className="container-fluid" style={{ padding: '20px 20px 0' }}>
2223
<div className="row">
2324
<Bordered />
24-
<AutoFitOrJustified />
25+
<AutoFit />
26+
<Justified />
2527
<Displays />
2628
<FixedColumns />
2729
<Pagination />

examples/tables/AutoFitOrJustified.jsx renamed to examples/tables/AutoFit.jsx

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,9 @@ export default class extends Component {
5252

5353
return (
5454
<div className="col-md-12">
55-
<Section className="row-sm-20">
56-
<h3>AutoFit and Justified</h3>
55+
<Section className="row-sm-10">
56+
<h3>AutoFit</h3>
5757
<div className={styles.sectionGroup}>
58-
<h5>AutoFit</h5>
5958
<Table
6059
bordered={true}
6160
hoverable={false}
@@ -65,17 +64,6 @@ export default class extends Component {
6564
data={data}
6665
/>
6766
</div>
68-
<div className={styles.sectionGroup}>
69-
<h5>Justified</h5>
70-
<Table
71-
bordered={false}
72-
hoverable={false}
73-
justified={true}
74-
rowKey={record => record.id}
75-
columns={columns}
76-
data={data}
77-
/>
78-
</div>
7967
</Section>
8068
</div>
8169
);

examples/tables/Justified.jsx

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import 'trendmicro-ui/dist/css/trendmicro-ui.css';
2+
import React, { Component } from 'react';
3+
import Table from '../../src';
4+
import Section from '../Section';
5+
import styles from '../index.styl';
6+
7+
const ipsum = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.';
8+
//Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.';
9+
10+
export default class extends Component {
11+
columns = [
12+
{
13+
title: 'Event Type',
14+
render: (value, row, index) => {
15+
return row.eventType;
16+
}
17+
},
18+
{
19+
title: 'Affected Devices',
20+
render: (value, row, index) => {
21+
return row.affectedDevices;
22+
}
23+
},
24+
{
25+
title: 'Detections',
26+
render: (value, row, index) => {
27+
return row.detections;
28+
}
29+
},
30+
{
31+
title: 'Description',
32+
dataKey: 'description'
33+
}
34+
];
35+
36+
data = [
37+
{ id: 1, eventType: 'Virus/Malware', affectedDevices: 20, detections: 634, description: ipsum },
38+
{ id: 2, eventType: 'Spyware/Grayware', affectedDevices: 20, detections: 634, description: ipsum },
39+
{ id: 3, eventType: 'URL Filtering', affectedDevices: 15, detections: 598, description: ipsum },
40+
{ id: 4, eventType: 'Web Reputation', affectedDevices: 15, detections: 598, description: ipsum },
41+
{ id: 5, eventType: 'Network Virus', affectedDevices: 15, detections: 497, description: ipsum },
42+
{ id: 6, eventType: 'Application Control', affectedDevices: 0, detections: 0, description: ipsum, width: '40%' }
43+
];
44+
45+
render() {
46+
const columns = this.columns;
47+
const data = this.data;
48+
49+
return (
50+
<div className="col-md-12">
51+
<Section className="row-sm-10">
52+
<h3>Justified</h3>
53+
<div className={styles.sectionGroup}>
54+
<Table
55+
bordered={false}
56+
hoverable={false}
57+
justified={true}
58+
rowKey={record => record.id}
59+
columns={columns}
60+
data={data}
61+
/>
62+
</div>
63+
</Section>
64+
</div>
65+
);
66+
}
67+
}

0 commit comments

Comments
 (0)