Skip to content

Commit

Permalink
Update downstream snapshots
Browse files Browse the repository at this point in the history
+ fix `false` className by using `classNames()` util
  • Loading branch information
cee-chen committed Sep 15, 2023
1 parent 0c85e13 commit e6e8ce2
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,20 @@ exports[`useDataGridColumnSelector columnSelector [React 17] renders a toolbar b
class="euiDataGrid__controlScroll"
>
<div
class="euiDroppable euiDroppable--noGrow"
class="euiDroppable emotion-euiDroppable-noGrow"
data-rfd-droppable-context-id="0"
data-rfd-droppable-id="columnOrder"
data-test-subj="droppable"
>
<div
class="euiDraggable euiDraggable--hasCustomDragHandle"
class="euiDraggable emotion-euiDraggable"
data-rfd-draggable-context-id="0"
data-rfd-draggable-id="columnA"
data-test-subj="draggable"
role="group"
>
<div
class="euiDataGridColumnSelector__item false euiDraggable__item euiDraggable__item--hasCustomDragHandle"
class="euiDataGridColumnSelector__item euiDraggable__item emotion-euiDraggable__item"
data-test-subj="dataGridColumnSelectorColumnItem-columnA"
>
<div
Expand Down Expand Up @@ -163,14 +163,14 @@ exports[`useDataGridColumnSelector columnSelector [React 17] renders a toolbar b
</div>
</div>
<div
class="euiDraggable euiDraggable--hasCustomDragHandle"
class="euiDraggable emotion-euiDraggable"
data-rfd-draggable-context-id="0"
data-rfd-draggable-id="columnB"
data-test-subj="draggable"
role="group"
>
<div
class="euiDataGridColumnSelector__item false euiDraggable__item euiDraggable__item--hasCustomDragHandle"
class="euiDataGridColumnSelector__item euiDraggable__item emotion-euiDraggable__item"
data-test-subj="dataGridColumnSelectorColumnItem-columnB"
>
<div
Expand Down Expand Up @@ -375,20 +375,20 @@ exports[`useDataGridColumnSelector columnSelector [React 18] renders a toolbar b
class="euiDataGrid__controlScroll"
>
<div
class="euiDroppable euiDroppable--noGrow"
class="euiDroppable emotion-euiDroppable-noGrow"
data-rfd-droppable-context-id=":r0:"
data-rfd-droppable-id="columnOrder"
data-test-subj="droppable"
>
<div
class="euiDraggable euiDraggable--hasCustomDragHandle"
class="euiDraggable emotion-euiDraggable"
data-rfd-draggable-context-id=":r0:"
data-rfd-draggable-id="columnA"
data-test-subj="draggable"
role="group"
>
<div
class="euiDataGridColumnSelector__item false euiDraggable__item euiDraggable__item--hasCustomDragHandle"
class="euiDataGridColumnSelector__item euiDraggable__item emotion-euiDraggable__item"
data-test-subj="dataGridColumnSelectorColumnItem-columnA"
>
<div
Expand Down Expand Up @@ -458,14 +458,14 @@ exports[`useDataGridColumnSelector columnSelector [React 18] renders a toolbar b
</div>
</div>
<div
class="euiDraggable euiDraggable--hasCustomDragHandle"
class="euiDraggable emotion-euiDraggable"
data-rfd-draggable-context-id=":r0:"
data-rfd-draggable-id="columnB"
data-test-subj="draggable"
role="group"
>
<div
class="euiDataGridColumnSelector__item false euiDraggable__item euiDraggable__item--hasCustomDragHandle"
class="euiDataGridColumnSelector__item euiDraggable__item emotion-euiDraggable__item"
data-test-subj="dataGridColumnSelectorColumnItem-columnB"
>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,20 +61,20 @@ exports[`useDataGridColumnSorting columnSorting [React 17] renders a toolbar but
role="region"
>
<div
class="euiDroppable euiDroppable--noGrow"
class="euiDroppable emotion-euiDroppable-noGrow"
data-rfd-droppable-context-id="0"
data-rfd-droppable-id="columnSorting"
data-test-subj="droppable"
>
<div
class="euiDraggable euiDraggable--hasCustomDragHandle"
class="euiDraggable emotion-euiDraggable"
data-rfd-draggable-context-id="0"
data-rfd-draggable-id="columnA"
data-test-subj="draggable"
role="group"
>
<div
class="euiDataGridColumnSorting__item false euiDraggable__item euiDraggable__item--hasCustomDragHandle"
class="euiDataGridColumnSorting__item euiDraggable__item emotion-euiDraggable__item"
>
<p
class="emotion-euiScreenReaderOnly"
Expand Down Expand Up @@ -351,20 +351,20 @@ exports[`useDataGridColumnSorting columnSorting [React 18] renders a toolbar but
role="region"
>
<div
class="euiDroppable euiDroppable--noGrow"
class="euiDroppable emotion-euiDroppable-noGrow"
data-rfd-droppable-context-id=":r0:"
data-rfd-droppable-id="columnSorting"
data-test-subj="droppable"
>
<div
class="euiDraggable euiDraggable--hasCustomDragHandle"
class="euiDraggable emotion-euiDraggable"
data-rfd-draggable-context-id=":r0:"
data-rfd-draggable-id="columnA"
data-test-subj="draggable"
role="group"
>
<div
class="euiDataGridColumnSorting__item false euiDraggable__item euiDraggable__item--hasCustomDragHandle"
class="euiDataGridColumnSorting__item euiDraggable__item emotion-euiDraggable__item"
>
<p
class="emotion-euiScreenReaderOnly"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

exports[`EuiDataGridColumnSortingDraggable [React 17] renders an EuiDraggable component of a single column that is currently being sorted 1`] = `
<div
class="euiDraggable euiDraggable--hasCustomDragHandle"
class="euiDraggable emotion-euiDraggable"
data-rfd-draggable-context-id="0"
data-rfd-draggable-id="columnA"
data-test-subj="draggable"
role="group"
>
<div
class="euiDataGridColumnSorting__item false euiDraggable__item euiDraggable__item--hasCustomDragHandle"
class="euiDataGridColumnSorting__item euiDraggable__item emotion-euiDraggable__item"
>
<p
class="emotion-euiScreenReaderOnly"
Expand Down Expand Up @@ -161,14 +161,14 @@ exports[`EuiDataGridColumnSortingDraggable [React 17] renders an EuiDraggable co

exports[`EuiDataGridColumnSortingDraggable [React 18] renders an EuiDraggable component of a single column that is currently being sorted 1`] = `
<div
class="euiDraggable euiDraggable--hasCustomDragHandle"
class="euiDraggable emotion-euiDraggable"
data-rfd-draggable-context-id=":r0:"
data-rfd-draggable-id="columnA"
data-test-subj="draggable"
role="group"
>
<div
class="euiDataGridColumnSorting__item false euiDraggable__item euiDraggable__item--hasCustomDragHandle"
class="euiDataGridColumnSorting__item euiDraggable__item emotion-euiDraggable__item"
>
<p
class="emotion-euiScreenReaderOnly"
Expand Down
17 changes: 10 additions & 7 deletions src/components/datagrid/controls/column_selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
*/

import React, {
Fragment,
useState,
useMemo,
useCallback,
ReactNode,
ChangeEvent,
} from 'react';
import classNames from 'classnames';

import { EuiPopover, EuiPopoverFooter, EuiPopoverTitle } from '../../popover';
import { EuiI18n, useEuiI18n } from '../../i18n';
import { EuiButtonEmpty } from '../../button';
Expand Down Expand Up @@ -197,7 +197,7 @@ export const useDataGridColumnSelector = (
droppableId="columnOrder"
isDropDisabled={!isDragEnabled}
>
<Fragment>
<>
{filteredColumns.map((id, index) => (
<EuiDraggable
key={id}
Expand All @@ -209,10 +209,13 @@ export const useDataGridColumnSelector = (
>
{(provided, state) => (
<div
className={`euiDataGridColumnSelector__item ${
state.isDragging &&
'euiDataGridColumnSelector__item-isDragging'
}`}
className={classNames(
'euiDataGridColumnSelector__item',
{
'euiDataGridColumnSelector__item-isDragging':
state.isDragging,
}
)}
data-test-subj={`dataGridColumnSelectorColumnItem-${id}`}
>
<EuiFlexGroup
Expand Down Expand Up @@ -272,7 +275,7 @@ export const useDataGridColumnSelector = (
)}
</EuiDraggable>
))}
</Fragment>
</>
</EuiDroppable>
</EuiDragDropContext>
</div>
Expand Down
8 changes: 5 additions & 3 deletions src/components/datagrid/controls/column_sorting_draggable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
*/

import React, { FunctionComponent } from 'react';
import classNames from 'classnames';

import { EuiScreenReaderOnly } from '../../accessibility';
import { EuiButtonGroup, EuiButtonIcon } from '../../button';
import { EuiDraggable } from '../../drag_and_drop';
Expand Down Expand Up @@ -78,9 +80,9 @@ export const EuiDataGridColumnSortingDraggable: FunctionComponent<
>
{(provided, state) => (
<div
className={`euiDataGridColumnSorting__item ${
state.isDragging && 'euiDataGridColumnSorting__item-isDragging'
}`}
className={classNames('euiDataGridColumnSorting__item', {
'euiDataGridColumnSorting__item-isDragging': state.isDragging,
})}
>
<EuiScreenReaderOnly>
<p>
Expand Down

0 comments on commit e6e8ce2

Please sign in to comment.