-
Notifications
You must be signed in to change notification settings - Fork 841
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert display selector width style
- just inline it in the component, since it's super minor + update Enzyme tests to RTL, snapshot full popover
- Loading branch information
Showing
4 changed files
with
279 additions
and
102 deletions.
There are no files selected for viewing
311 changes: 242 additions & 69 deletions
311
packages/eui/src/components/datagrid/controls/__snapshots__/display_selector.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,78 +1,251 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`useDataGridDisplaySelector displaySelector renders a toolbar button/popover allowing users to customize display settings 1`] = ` | ||
<Fragment> | ||
<EuiPopover | ||
anchorPosition="downRight" | ||
button={ | ||
<EuiToolTip | ||
content="Display options" | ||
delay="long" | ||
display="inlineBlock" | ||
position="top" | ||
<body> | ||
<div> | ||
<div | ||
class="euiPopover emotion-euiPopover-inline-block" | ||
data-test-subj="dataGridDisplaySelectorPopover" | ||
> | ||
<span | ||
class="euiToolTipAnchor emotion-euiToolTipAnchor-inlineBlock" | ||
> | ||
<EuiButtonIcon | ||
<button | ||
aria-label="Display options" | ||
color="text" | ||
class="euiButtonIcon emotion-euiButtonIcon-xs-empty-text" | ||
data-test-subj="dataGridDisplaySelectorButton" | ||
iconType="controlsHorizontal" | ||
onClick={[Function]} | ||
size="xs" | ||
/> | ||
</EuiToolTip> | ||
} | ||
closePopover={[Function]} | ||
data-test-subj="dataGridDisplaySelectorPopover" | ||
display="inline-block" | ||
hasArrow={true} | ||
isOpen={false} | ||
ownFocus={true} | ||
panelClassName="euiDataGrid__displayPopoverPanel" | ||
panelPaddingSize="s" | ||
repositionToCrossAxis={true} | ||
type="button" | ||
> | ||
<span | ||
aria-hidden="true" | ||
class="euiButtonIcon__icon" | ||
color="inherit" | ||
data-euiicon-type="controlsHorizontal" | ||
/> | ||
</button> | ||
</span> | ||
</div> | ||
</div> | ||
<div | ||
data-euiportal="true" | ||
> | ||
<EuiI18n | ||
defaults={ | ||
[ | ||
"Density", | ||
"Compact", | ||
"Normal", | ||
"Expanded", | ||
] | ||
} | ||
tokens={ | ||
[ | ||
"euiDisplaySelector.densityLabel", | ||
"euiDisplaySelector.labelCompact", | ||
"euiDisplaySelector.labelNormal", | ||
"euiDisplaySelector.labelExpanded", | ||
] | ||
} | ||
> | ||
<Component /> | ||
</EuiI18n> | ||
<EuiI18n | ||
defaults={ | ||
[ | ||
"Row height", | ||
"Single", | ||
"Auto fit", | ||
"Custom", | ||
"Lines per row", | ||
] | ||
} | ||
tokens={ | ||
[ | ||
"euiDisplaySelector.rowHeightLabel", | ||
"euiDisplaySelector.labelSingle", | ||
"euiDisplaySelector.labelAuto", | ||
"euiDisplaySelector.labelCustom", | ||
"euiDisplaySelector.lineCountLabel", | ||
] | ||
} | ||
<div | ||
data-focus-guard="true" | ||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;" | ||
tabindex="-1" | ||
/> | ||
<div | ||
data-focus-lock-disabled="disabled" | ||
> | ||
<Component /> | ||
</EuiI18n> | ||
</EuiPopover> | ||
</Fragment> | ||
<div | ||
aria-describedby="generated-id" | ||
aria-live="off" | ||
aria-modal="true" | ||
class="euiPanel euiPanel--plain euiPanel--paddingSmall euiPopover__panel euiDataGrid__displayPopoverPanel emotion-euiPanel-grow-m-s-plain-euiPopover__panel-light-hasTransform" | ||
data-autofocus="true" | ||
data-popover-panel="true" | ||
role="dialog" | ||
style="top: 16px; left: -22px; will-change: transform, opacity; z-index: 2000;" | ||
tabindex="0" | ||
> | ||
<div | ||
class="euiPopover__arrow emotion-euiPopoverArrow-bottom" | ||
data-popover-arrow="bottom" | ||
style="left: 10px; top: 0px;" | ||
/> | ||
<p | ||
class="emotion-euiScreenReaderOnly" | ||
id="generated-id" | ||
> | ||
You are in a dialog. Press Escape, or tap/click outside the dialog to close. | ||
</p> | ||
<div> | ||
<div | ||
class="euiFormRow euiFormRow--hasLabel emotion-euiFormRow-columnCompressed" | ||
id="generated-id-row" | ||
> | ||
<div | ||
class="euiFormRow__labelWrapper" | ||
> | ||
<label | ||
class="euiFormLabel euiFormRow__label emotion-euiFormLabel" | ||
for="generated-id" | ||
id="generated-id-label" | ||
> | ||
Density | ||
</label> | ||
</div> | ||
<div | ||
class="euiFormRow__fieldWrapper" | ||
> | ||
<fieldset | ||
class="euiButtonGroup emotion-euiButtonGroup-fullWidth" | ||
data-test-subj="densityButtonGroup" | ||
id="generated-id" | ||
> | ||
<legend | ||
class="emotion-euiScreenReaderOnly" | ||
> | ||
Density | ||
</legend> | ||
<div | ||
class="euiButtonGroup__buttons emotion-euiButtonGroup__buttons-fullWidth-compressed" | ||
> | ||
<button | ||
aria-pressed="false" | ||
class="euiButtonGroupButton emotion-euiButtonDisplay-s-defaultMinWidth-euiButtonGroupButton-compressed-empty-text" | ||
data-test-subj="compact" | ||
title="Compact" | ||
type="button" | ||
> | ||
<span | ||
class="emotion-euiButtonDisplayContent-euiButtonGroupButton__content-compressed" | ||
> | ||
<span | ||
class="eui-textTruncate emotion-euiButtonGroupButton__text" | ||
data-text="Compact" | ||
> | ||
Compact | ||
</span> | ||
</span> | ||
</button> | ||
<button | ||
aria-pressed="false" | ||
class="euiButtonGroupButton emotion-euiButtonDisplay-s-defaultMinWidth-euiButtonGroupButton-compressed-empty-text" | ||
data-test-subj="normal" | ||
title="Normal" | ||
type="button" | ||
> | ||
<span | ||
class="emotion-euiButtonDisplayContent-euiButtonGroupButton__content-compressed" | ||
> | ||
<span | ||
class="eui-textTruncate emotion-euiButtonGroupButton__text" | ||
data-text="Normal" | ||
> | ||
Normal | ||
</span> | ||
</span> | ||
</button> | ||
<button | ||
aria-pressed="false" | ||
class="euiButtonGroupButton emotion-euiButtonDisplay-s-defaultMinWidth-euiButtonGroupButton-compressed-empty-text" | ||
data-test-subj="expanded" | ||
title="Expanded" | ||
type="button" | ||
> | ||
<span | ||
class="emotion-euiButtonDisplayContent-euiButtonGroupButton__content-compressed" | ||
> | ||
<span | ||
class="eui-textTruncate emotion-euiButtonGroupButton__text" | ||
data-text="Expanded" | ||
> | ||
Expanded | ||
</span> | ||
</span> | ||
</button> | ||
</div> | ||
</fieldset> | ||
</div> | ||
</div> | ||
<div | ||
class="euiFormRow euiFormRow--hasLabel emotion-euiFormRow-columnCompressed" | ||
id="generated-id-row" | ||
> | ||
<div | ||
class="euiFormRow__labelWrapper" | ||
> | ||
<label | ||
class="euiFormLabel euiFormRow__label emotion-euiFormLabel" | ||
for="generated-id" | ||
id="generated-id-label" | ||
> | ||
Row height | ||
</label> | ||
</div> | ||
<div | ||
class="euiFormRow__fieldWrapper" | ||
> | ||
<fieldset | ||
class="euiButtonGroup emotion-euiButtonGroup-fullWidth" | ||
data-test-subj="rowHeightButtonGroup" | ||
id="generated-id" | ||
> | ||
<legend | ||
class="emotion-euiScreenReaderOnly" | ||
> | ||
Row height | ||
</legend> | ||
<div | ||
class="euiButtonGroup__buttons emotion-euiButtonGroup__buttons-fullWidth-compressed" | ||
> | ||
<button | ||
aria-pressed="true" | ||
class="euiButtonGroupButton euiButtonGroupButton-isSelected emotion-euiButtonDisplay-s-defaultMinWidth-euiButtonGroupButton-compressed-fill-text" | ||
data-test-subj="undefined" | ||
title="Single" | ||
type="button" | ||
> | ||
<span | ||
class="emotion-euiButtonDisplayContent-euiButtonGroupButton__content-compressed" | ||
> | ||
<span | ||
class="eui-textTruncate emotion-euiButtonGroupButton__text" | ||
data-text="Single" | ||
> | ||
Single | ||
</span> | ||
</span> | ||
</button> | ||
<button | ||
aria-pressed="false" | ||
class="euiButtonGroupButton emotion-euiButtonDisplay-s-defaultMinWidth-euiButtonGroupButton-compressed-empty-text" | ||
data-test-subj="auto" | ||
title="Auto fit" | ||
type="button" | ||
> | ||
<span | ||
class="emotion-euiButtonDisplayContent-euiButtonGroupButton__content-compressed" | ||
> | ||
<span | ||
class="eui-textTruncate emotion-euiButtonGroupButton__text" | ||
data-text="Auto fit" | ||
> | ||
Auto fit | ||
</span> | ||
</span> | ||
</button> | ||
<button | ||
aria-pressed="false" | ||
class="euiButtonGroupButton emotion-euiButtonDisplay-s-defaultMinWidth-euiButtonGroupButton-compressed-empty-text" | ||
data-test-subj="lineCount" | ||
title="Custom" | ||
type="button" | ||
> | ||
<span | ||
class="emotion-euiButtonDisplayContent-euiButtonGroupButton__content-compressed" | ||
> | ||
<span | ||
class="eui-textTruncate emotion-euiButtonGroupButton__text" | ||
data-text="Custom" | ||
> | ||
Custom | ||
</span> | ||
</span> | ||
</button> | ||
</div> | ||
</fieldset> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div | ||
data-focus-guard="true" | ||
style="width: 1px; height: 0px; padding: 0px; overflow: hidden; position: fixed; top: 1px; left: 1px;" | ||
tabindex="-1" | ||
/> | ||
</div> | ||
</body> | ||
`; |
3 changes: 0 additions & 3 deletions
3
packages/eui/src/components/datagrid/controls/_data_grid_display.scss
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,3 +0,0 @@ | ||
.euiDataGrid__displayPopoverPanel { | ||
width: $euiFormMaxWidth + $euiSize; | ||
} | ||
Oops, something went wrong.