Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add EuiBasicTable. #376

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src-docs/src/components/guide_section/guide_section.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export class GuideSection extends Component {

const title = _euiObjectType === 'type' ?
<EuiCode id={componentName}>{componentName}</EuiCode> :
<EuiText color="accent">{componentName}</EuiText>;
<EuiText>{componentName}</EuiText>;

let descriptionElement;

Expand Down
4 changes: 4 additions & 0 deletions src-docs/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ import { AvatarExample }
import { BadgeExample }
from './views/badge/badge_example';

import { BasicTableExample }
from './views/basic_table/basic_table_example';

import { BottomBarExample }
from './views/bottom_bar/bottom_bar_example';

Expand Down Expand Up @@ -250,6 +253,7 @@ const components = [
].map(example => createExample(example));

const patterns = [
BasicTableExample,
].map(example => createExample(example));

const sandboxes = [{
Expand Down
69 changes: 69 additions & 0 deletions src-docs/src/views/basic_table/basic_table_example.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import React from 'react';

import { renderToHtml } from '../../services';

import {
GuideSectionTypes,
} from '../../components';

import {
EuiCode,
EuiBasicTable,
} from '../../../../src/components';

import FullFeatured from './full_featured';
const fullFeaturedSource = require('!!raw-loader!./full_featured');
const fullFeaturedHtml = renderToHtml(FullFeatured);

import RenderingColumns from './rendering_columns';
const renderingColumnsSource = require('!!raw-loader!./rendering_columns');
const renderingColumnsHtml = renderToHtml(RenderingColumns);

export const BasicTableExample = {
title: 'BasicTable',
sections: [
{
title: 'Sorting, pagination, and row-selection',
source: [
{
type: GuideSectionTypes.JS,
code: fullFeaturedSource,
},
{
type: GuideSectionTypes.HTML,
code: fullFeaturedHtml,
}
],
props: { EuiBasicTable },
demo: <FullFeatured />
}, {
title: 'Rendering columns',
source: [
{
type: GuideSectionTypes.JS,
code: renderingColumnsSource,
},
{
type: GuideSectionTypes.HTML,
code: renderingColumnsHtml,
}
],
text: (
<div>
<p>
You can specify a <EuiCode>dataType</EuiCode> property on your column definitions
to choose a default format with which to render a column&rsquo;s cells.
</p>

<p>
If you want to customize how columns are rendered, you can specify a
<EuiCode>render</EuiCode> property on the column definitions to
customize the content of a column&rsquo;s cells.
</p>
</div>
),
props: { EuiBasicTable },
demo: <RenderingColumns />
},
]
};
Loading