Skip to content

Commit

Permalink
move some props to custom table
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed Jan 22, 2019
1 parent 8dfa7a4 commit 2c08ed1
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 71 deletions.
4 changes: 2 additions & 2 deletions src-docs/src/views/tables/custom/custom_section.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
EuiTableHeaderCellCheckbox,
EuiTablePagination,
EuiTableRow,
EuiTableRowCell,
EuiTableRowCellCheckbox,
EuiTableHeaderMobile,
EuiTableSortMobile,
Expand All @@ -22,6 +21,7 @@ import { renderToHtml } from '../../../services';
import Custom from './custom';
const source = require('!!raw-loader!./custom');
const html = renderToHtml(Custom);
import { cellPropsInfo } from './props_info';

export const section = {
title: 'Build a custom table from individual components',
Expand Down Expand Up @@ -73,8 +73,8 @@ export const section = {
EuiTableHeaderCellCheckbox,
EuiTablePagination,
EuiTableRow,
EuiTableRowCell,
EuiTableRowCellCheckbox,
...cellPropsInfo,
EuiTableHeaderMobile,
EuiTableSortMobile,
EuiTableSortMobileItem,
Expand Down
112 changes: 112 additions & 0 deletions src-docs/src/views/tables/custom/props_info.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
export const cellPropsInfo = {

EuiTableRowCell: {
__docgenInfo: {
props: {
colSpan: {
description: 'Number of columns to span',
required: false,
type: { name: 'number' },
},
align: {
description: 'Horizontal alignment of the text in the cell',
required: false,
type: { name: 'left | right | center' },
defaultValue: { value: 'left' },
},
truncateText: {
description: 'Don\'t allow line breaks within cells',
required: false,
type: { name: 'bool' }
},
textOnly: {
description: 'Setting `textOnly` to `false` will break words unnecessarily on FF and IE. ' +
'To combat this problem on FF, wrap contents with the css utility `.eui-textBreakWord`.',
required: false,
type: { name: 'bool' }
},
showOnHover: {
description: '_Should only be used for action cells_',
required: false,
type: { name: 'bool' }
},
hasActions: {
description: 'Indicates if the column is dedicated to icon-only actions (currently affects mobile only)',
required: false,
type: { name: 'bool' }
},
isExpander: {
description: 'Indicates if the column is dedicated as the expandable row toggle',
required: false,
type: { name: 'bool' }
},
mobileOptions: {
description: 'Mobile options for displaying differently at small screens',
required: false,
type: { name: '#mobileOptions' },
},
header: {
description: 'DEPRECATED: use `mobileOptions.header`',
required: false,
type: { name: 'bool' }
},
isMobileHeader: {
description: 'DEPRECATED: use `mobileOptions.only = true`',
required: false,
type: { name: 'bool' }
},
hideForMobile: {
description: 'DEPRECATED: use `mobileOptions.show = false`',
required: false,
type: { name: 'bool' }
},
isMobileFullWidth: {
description: 'DEPRECATED: use `mobileOptions.fullWidth`',
required: false,
type: { name: 'bool' }
},
}
}
},

mobileOptions: {
__docgenInfo: {
_euiObjectType: 'type',
props: {
show: {
description: 'If false, will not render the cell at all for mobile',
required: false,
type: { name: 'bool' },
defaultValue: { value: 'true' },
},
only: {
description: 'Only show for mobile? If true, will not render the column at all for desktop',
required: false,
type: { name: 'bool' }
},
render: {
description: 'Custom render/children if different from desktop',
required: false,
type: { name: 'node' }
},
header: {
description: 'The column\'s header for use in mobile view (automatically passed down when using `EuiBasicTable`). ' +
'Or pass `false` to not show a header at all.',
required: false,
type: { name: 'node | bool' }
},
enlarge: {
description: 'Increase text size compared to rest of cells',
required: false,
type: { name: 'bool' }
},
fullWidth: {
description: 'Allocates 100% of the width of the container in mobile view (typically cells are contained to 50%)',
required: false,
type: { name: 'bool' }
},
}
}
},

};
69 changes: 0 additions & 69 deletions src-docs/src/views/tables/mobile/props_info.js
Original file line number Diff line number Diff line change
@@ -1,74 +1,5 @@
export const propsInfo = {

EuiTableRowCell: {
__docgenInfo: {
props: {
colSpan: {
description: 'Number of columns to span',
required: false,
type: { name: 'number' },
},
align: {
description: 'Horizontal alignment of the text in the cell',
required: false,
type: { name: 'left | right | center' },
defaultValue: { value: 'left' },
},
truncateText: {
description: 'Don\'t allow line breaks within cells',
required: false,
type: { name: 'bool' }
},
textOnly: {
description: 'Setting `textOnly` to `false` will break words unnecessarily on FF and IE. ' +
'To combat this problem on FF, wrap contents with the css utility `.eui-textBreakWord`.',
required: false,
type: { name: 'bool' }
},
showOnHover: {
description: '_Should only be used for action cells_',
required: false,
type: { name: 'bool' }
},
hasActions: {
description: 'Indicates if the column is dedicated to icon-only actions (currently affects mobile only)',
required: false,
type: { name: 'bool' }
},
isExpander: {
description: 'Indicates if the column is dedicated as the expandable row toggle',
required: false,
type: { name: 'bool' }
},
mobileOptions: {
description: 'Mobile options for displaying differently at small screens',
required: false,
type: { name: '#mobileOptions' },
},
header: {
description: 'DEPRECATED: use `mobileOptions.header`',
required: false,
type: { name: 'bool' }
},
isMobileHeader: {
description: 'DEPRECATED: use `mobileOptions.only = true`',
required: false,
type: { name: 'bool' }
},
hideForMobile: {
description: 'DEPRECATED: use `mobileOptions.show = false`',
required: false,
type: { name: 'bool' }
},
isMobileFullWidth: {
description: 'DEPRECATED: use `mobileOptions.fullWidth`',
required: false,
type: { name: 'bool' }
},
}
}
},

mobileOptions: {
__docgenInfo: {
_euiObjectType: 'type',
Expand Down

0 comments on commit 2c08ed1

Please sign in to comment.