-
Notifications
You must be signed in to change notification settings - Fork 840
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Move cell
showOnHover
API to basic table actions
API
- The goal of this is to limit usage to being controlled by EUI, and reduce potentially hidden information from users - this allows us to replace `showOnHover` props on basic table columns (of which there is one usage in Kibana) + remove length logic from `ExpandedItemActions`, and let the correct hover className be determined via p rop instead + update docs example to show custom actions working with `isPrimary` and `showOnHover` logic (previously could not be easily customized with these options)
- Loading branch information
Showing
8 changed files
with
107 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
**Breaking changes** | ||
|
||
- Removed the `showOnHover` prop from `EuiTableRowCell` / `EuiBasicTable`/`EuiInMemoryTable`'s `columns` API. Use the new actions `columns[].actions[].showOnHover` API instead. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 42 additions & 35 deletions
77
src/components/basic_table/__snapshots__/expanded_item_actions.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,46 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ExpandedItemActions render 1`] = ` | ||
<Fragment> | ||
<DefaultItemAction | ||
action={ | ||
Object { | ||
"description": "default 1", | ||
"name": "default1", | ||
"onClick": [Function], | ||
} | ||
} | ||
enabled={true} | ||
item={ | ||
Object { | ||
"id": "xyz", | ||
} | ||
} | ||
key="item_action_xyz_0" | ||
exports[`ExpandedItemActions renders 1`] = ` | ||
<div> | ||
<span | ||
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock" | ||
> | ||
<button | ||
class="euiButtonEmpty emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right" | ||
type="button" | ||
> | ||
<span | ||
class="euiButtonEmpty__content emotion-euiButtonDisplayContent" | ||
> | ||
<span | ||
class="eui-textTruncate euiButtonEmpty__text" | ||
> | ||
default1 | ||
</span> | ||
</span> | ||
</button> | ||
</span> | ||
<div | ||
class="" | ||
/> | ||
<CustomItemAction | ||
action={ | ||
Object { | ||
"description": "custom 1", | ||
"name": "custom1", | ||
"render": [Function], | ||
} | ||
} | ||
enabled={true} | ||
index={1} | ||
item={ | ||
Object { | ||
"id": "xyz", | ||
} | ||
} | ||
key="item_action_xyz_1" | ||
/> | ||
</Fragment> | ||
<span | ||
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock" | ||
> | ||
<a | ||
class="euiButtonEmpty euiBasicTableAction-showOnHover emotion-euiButtonDisplay-euiButtonEmpty-s-empty-primary-flush-right" | ||
href="#" | ||
rel="noreferrer" | ||
> | ||
<span | ||
class="euiButtonEmpty__content emotion-euiButtonDisplayContent" | ||
> | ||
<span | ||
class="eui-textTruncate euiButtonEmpty__text" | ||
> | ||
showOnHover | ||
</span> | ||
</span> | ||
</a> | ||
</span> | ||
</div> | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters