Skip to content

Commit

Permalink
[DOCS]: EuiTable examples updated with unique checkbox labels. (#7578)
Browse files Browse the repository at this point in the history
  • Loading branch information
1Copenut authored Mar 13, 2024
1 parent 2c88903 commit 52b41e1
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
6 changes: 4 additions & 2 deletions src-docs/src/views/tables/actions/actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -262,8 +262,10 @@ export default () => {

const selection: EuiTableSelectionType<User> = {
selectable: (user: User) => user.online,
selectableMessage: (selectable: boolean) =>
!selectable ? 'User is currently offline' : '',
selectableMessage: (selectable: boolean, user: User) =>
!selectable
? `${user.firstName} ${user.lastName} is currently offline`
: `Select ${user.firstName} ${user.lastName}`,
onSelectionChange,
};

Expand Down
6 changes: 4 additions & 2 deletions src-docs/src/views/tables/expanding_rows/expanding_rows.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,10 @@ export default () => {

const selection: EuiTableSelectionType<User> = {
selectable: (user: User) => user.online,
selectableMessage: (selectable: boolean) =>
!selectable ? 'User is currently offline' : '',
selectableMessage: (selectable: boolean, user: User) =>
!selectable
? `${user.firstName} ${user.lastName} is currently offline`
: `Select ${user.firstName} ${user.lastName}`,
onSelectionChange,
};

Expand Down
6 changes: 4 additions & 2 deletions src-docs/src/views/tables/footer/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,10 @@ export default () => {

const selection: EuiTableSelectionType<User> = {
selectable: (user: User) => user.online,
selectableMessage: (selectable: boolean) =>
!selectable ? 'User is currently offline' : '',
selectableMessage: (selectable: boolean, user: User) =>
!selectable
? `${user.firstName} ${user.lastName} is currently offline`
: `Select ${user.firstName} ${user.lastName}`,
onSelectionChange,
};

Expand Down
6 changes: 4 additions & 2 deletions src-docs/src/views/tables/mobile/mobile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,10 @@ export default () => {

const selection: EuiTableSelectionType<User> = {
selectable: (user: User) => user.online,
selectableMessage: (selectable: boolean) =>
!selectable ? 'User is currently offline' : '',
selectableMessage: (selectable: boolean, user: User) =>
!selectable
? `${user.firstName} ${user.lastName} is currently offline`
: `Select ${user.firstName} ${user.lastName}`,
onSelectionChange,
};

Expand Down
6 changes: 4 additions & 2 deletions src-docs/src/views/tables/selection/selection_controlled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,10 @@ export default () => {

const selection: EuiTableSelectionType<User> = {
selectable: (user: User) => user.online,
selectableMessage: (selectable: boolean) =>
!selectable ? 'User is currently offline' : '',
selectableMessage: (selectable: boolean, user: User) =>
!selectable
? `${user.firstName} ${user.lastName} is currently offline`
: `Select ${user.firstName} ${user.lastName}`,
onSelectionChange,
selected: selectedItems,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,10 @@ export default () => {

const selection: EuiTableSelectionType<User> = {
selectable: (user: User) => user.online,
selectableMessage: (selectable: boolean) =>
!selectable ? 'User is currently offline' : '',
selectableMessage: (selectable: boolean, user: User) =>
!selectable
? `${user.firstName} ${user.lastName} is currently offline`
: `Select ${user.firstName} ${user.lastName}`,
onSelectionChange,
initialSelected: onlineUsers,
};
Expand Down

0 comments on commit 52b41e1

Please sign in to comment.