Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UnifiedDocViewer] Implement floating actions #171365

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
}

.kbnDocViewer__tableRow {
position: relative;
font-size: $euiFontSizeXS;
font-family: $euiCodeFontFamily;

Expand All @@ -14,27 +15,26 @@
}

.kbnDocViewer__buttons {
// Show all icons if one is focused,
&:focus-within {
.kbnDocViewer__actionButton {
opacity: 1;
}
}
opacity: 0;
visibility: hidden;
transition: visibility $euiAnimSpeedFast, opacity $euiAnimSpeedFast;

position: absolute;
left: $euiSizeXS;
top: (-$euiSizeL);
z-index: $euiZLevel9; // the highest possible z-level

padding: 4px;
border-radius: 6px;
background-color: #FFF;
box-shadow: 0 0 0 1px #D3DAE6;
}

&:hover {
.kbnDocViewer__actionButton {
opacity: 1;
}
}

.kbnDocViewer__actionButton {
@include euiBreakpoint('m', 'l', 'xl') {
opacity: 0;
}

&:focus {
&:hover, &:focus-within {
.kbnDocViewer__buttons {
opacity: 1;
visibility: visible;
transition: visibility $euiAnimSpeedFast, opacity $euiAnimSpeedFast;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,13 +283,8 @@ export const DocViewerTable = ({
);

const headers = [
!hideActionsColumn && (
<EuiTableHeaderCell
key="header-cell-actions"
align="left"
width={showActionsInsideTableCell ? 150 : 62}
isSorted={false}
>
!showActionsInsideTableCell && !hideActionsColumn && (
<EuiTableHeaderCell key="header-cell-actions" align="left" width={62} isSorted={false}>
<EuiText size="xs">
<strong>
<FormattedMessage
Expand Down Expand Up @@ -332,7 +327,7 @@ export const DocViewerTable = ({
}: FieldRecord) => {
return (
<EuiTableRow key={field} className="kbnDocViewer__tableRow" isSelected={pinned}>
{!hideActionsColumn && (
{!showActionsInsideTableCell && !hideActionsColumn && (
<EuiTableRowCell
key={field + '-actions'}
align={showActionsInsideTableCell ? 'left' : 'center'}
Expand All @@ -342,7 +337,7 @@ export const DocViewerTable = ({
mobileOptions={MOBILE_OPTIONS}
>
<TableActions
mode={showActionsInsideTableCell ? 'inline' : 'as_popover'}
mode="as_popover"
field={field}
pinned={pinned}
fieldMapping={fieldMapping}
Expand All @@ -362,6 +357,19 @@ export const DocViewerTable = ({
textOnly={false}
mobileOptions={MOBILE_OPTIONS}
>
{!hideActionsColumn && showActionsInsideTableCell && (
<TableActions
mode="inline"
field={field}
pinned={pinned}
fieldMapping={fieldMapping}
flattenedField={flattenedField}
onFilter={onFilter!}
onToggleColumn={onToggleColumn}
ignoredValue={!!ignored}
onTogglePinned={onTogglePinned}
/>
)}
<FieldName
fieldName={field}
fieldType={fieldType}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ export const TableActions = ({
data-test-subj={item['data-test-subj']}
aria-label={item['aria-label']}
iconType={item.icon}
iconSize="s"
disabled={item.disabled}
onClick={item.onClick}
/>
Expand Down