Skip to content

Commit

Permalink
Fixing more docs implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
cchaos committed Feb 20, 2019
1 parent 7fe30a6 commit 235f90a
Show file tree
Hide file tree
Showing 8 changed files with 102 additions and 54 deletions.
21 changes: 12 additions & 9 deletions src-docs/src/views/tables/actions/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,22 @@ export class Table extends Component {
name: 'First Name',
truncateText: true,
sortable: true,
hideForMobile: true,
mobileOptions: {
render: (item) => (
<span>{item.firstName} {item.lastName}</span>
),
header: false,
truncateText: false,
enlarge: true,
fullWidth: true,
}
}, {
field: 'lastName',
name: 'Last Name',
truncateText: true,
hideForMobile: true,
}, {
field: 'firstName',
name: 'Full Name',
isMobileHeader: true,
render: (name, item) => (
<span>{item.firstName} {item.lastName}</span>
),
mobileOptions: {
show: false,
}
}, {
field: 'github',
name: 'Github',
Expand Down
21 changes: 12 additions & 9 deletions src-docs/src/views/tables/basic/basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,26 @@ export const Table = () => {
field: 'firstName',
name: 'First Name',
sortable: true,
hideForMobile: true,
'data-test-subj': 'firstNameCell',
mobileOptions: {
render: (item) => (
<span>{item.firstName} <EuiLink href="#" target="_blank">{item.lastName}</EuiLink></span>
),
header: false,
truncateText: false,
enlarge: true,
fullWidth: true,
}
}, {
field: 'lastName',
name: 'Last Name',
truncateText: true,
hideForMobile: true,
render: (name) => (
<EuiLink href="#" target="_blank">{name}</EuiLink>
),
}, {
field: 'firstName',
name: 'Full Name',
isMobileHeader: true,
render: (name, item) => (
<span>{item.firstName} <EuiLink href="#" target="_blank">{item.lastName}</EuiLink></span>
),
mobileOptions: {
show: false,
}
}, {
field: 'github',
name: 'Github',
Expand Down
24 changes: 17 additions & 7 deletions src-docs/src/views/tables/custom/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -221,18 +221,27 @@ export default class extends Component {
alignment: LEFT_ALIGNMENT,
width: '24px',
cellProvider: cell => <EuiIcon type={cell} size="m" />,
hideForMobile: true,
mobileOptions: {
show: false,
}
}, {
id: 'title',
label: 'Title',
footer: <em>Title</em>,
alignment: LEFT_ALIGNMENT,
isSortable: true,
hideForMobile: true,
mobileOptions: {
show: false,
}
}, {
id: 'title_type',
label: 'Title',
isMobileHeader: true,
mobileOptions: {
only: true,
header: false,
enlarge: true,
fullWidth: true,
},
render: (title, item) => (
<span><EuiIcon type={item.type} size="m" style={{ verticalAlign: 'text-top' }} /> {title}</span>
),
Expand Down Expand Up @@ -420,7 +429,7 @@ export default class extends Component {
onSort={column.isSortable ? this.onSort.bind(this, column.id) : undefined}
isSorted={this.state.sortedColumn === column.id}
isSortAscending={this.sortableProperties.isAscendingByName(column.id)}
isMobileHeader={column.isMobileHeader}
mobileOptions={column.mobileOptions}
>
{column.label}
</EuiTableHeaderCell>
Expand Down Expand Up @@ -527,12 +536,13 @@ export default class extends Component {
return (
<EuiTableRowCell
key={column.id}
header={column.label}
align={column.alignment}
truncateText={cell && cell.truncateText}
textOnly={cell ? cell.textOnly : true}
hideForMobile={column.hideForMobile}
isMobileHeader={column.isMobileHeader}
mobileOptions={{
header: column.label,
...column.mobileOptions
}}
>
{child}
</EuiTableRowCell>
Expand Down
22 changes: 12 additions & 10 deletions src-docs/src/views/tables/expanding_rows/expanding_rows.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,22 @@ export class Table extends Component {
name: 'First Name',
sortable: true,
truncateText: true,
hideForMobile: true,
mobileOptions: {
render: (item) => (
<span>{item.firstName} {item.lastName}</span>
),
header: false,
truncateText: false,
enlarge: true,
fullWidth: true,
}
}, {
field: 'lastName',
name: 'Last Name',
truncateText: true,
hideForMobile: true,
}, {
field: 'firstName',
name: 'Full Name',
sortable: true,
isMobileHeader: true,
render: (name, item) => (
<span>{item.firstName} {item.lastName}</span>
)
mobileOptions: {
show: false,
}
}, {
field: 'dateOfBirth',
name: 'Date of Birth',
Expand Down
13 changes: 10 additions & 3 deletions src-docs/src/views/tables/footer/footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,23 @@ export class Table extends Component {
footer: <em>Page totals:</em>,
sortable: true,
truncateText: true,
hideForMobile: true,
mobileOptions: {
show: false,
}
}, {
field: 'lastName',
name: 'Last Name',
truncateText: true,
hideForMobile: true,
mobileOptions: {
show: false,
}
}, {
field: 'firstName',
name: 'Full Name',
isMobileHeader: true,
mobileOptions: {
only: true,
fullWidth: true,
},
render: (name, item) => (
<EuiFlexGroup responsive={false} alignItems="center">
<EuiFlexItem>{item.firstName} {item.lastName}</EuiFlexItem>
Expand Down
14 changes: 12 additions & 2 deletions src-docs/src/views/tables/paginated/paginated.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,25 @@ export class Table extends Component {
name: 'First Name',
truncateText: true,
hideForMobile: true,
mobileOptions: {
show: false,
}
}, {
field: 'lastName',
name: 'Last Name',
truncateText: true,
hideForMobile: true,
mobileOptions: {
show: false,
}
}, {
field: 'firstName',
name: 'Full Name',
isMobileHeader: true,
mobileOptions: {
header: false,
only: true,
enlarge: true,
fullWidth: true,
},
render: (name, item) => (
<EuiFlexGroup responsive={false} alignItems="center">
<EuiFlexItem>{item.firstName} {item.lastName}</EuiFlexItem>
Expand Down
19 changes: 15 additions & 4 deletions src-docs/src/views/tables/selection/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,16 +129,25 @@ export class Table extends Component {
name: 'First Name',
sortable: true,
truncateText: true,
hideForMobile: true,
mobileOptions: {
show: false,
}
}, {
field: 'lastName',
name: 'Last Name',
truncateText: true,
hideForMobile: true,
mobileOptions: {
show: false,
}
}, {
field: 'firstName',
name: 'Full Name',
isMobileHeader: true,
mobileOptions: {
only: true,
header: false,
enlarge: true,
fullWidth: true,
},
render: (name, item) => (
<EuiFlexGroup responsive={false} alignItems="center">
<EuiFlexItem>{item.firstName} {item.lastName}</EuiFlexItem>
Expand Down Expand Up @@ -174,7 +183,9 @@ export class Table extends Component {
this.renderStatus(online)
),
sortable: true,
hideForMobile: true,
mobileOptions: {
show: false,
}
}];

const pagination = {
Expand Down
22 changes: 12 additions & 10 deletions src-docs/src/views/tables/sorting/sorting.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,23 @@ export class Table extends Component {
name: 'First Name',
sortable: true,
truncateText: true,
hideForMobile: true,
mobileOptions: {
render: (item) => (
<span>{item.firstName} {item.lastName}</span>
),
header: false,
truncateText: false,
enlarge: true,
fullWidth: true,
}
}, {
field: 'lastName',
name: 'Last Name',
sortable: true,
truncateText: true,
hideForMobile: true,
}, {
field: 'firstName',
name: 'Full Name',
sortable: true,
isMobileHeader: true,
render: (name, item) => (
<span>{item.firstName} {item.lastName}</span>
)
mobileOptions: {
show: false,
}
}, {
field: 'github',
name: (
Expand Down

0 comments on commit 235f90a

Please sign in to comment.