Skip to content

Commit

Permalink
move DraggableObject to Container
Browse files Browse the repository at this point in the history
  • Loading branch information
kmcfaul committed Jun 13, 2024
1 parent 1795c24 commit 672cdfb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,22 @@ import { Draggable } from './Draggable';
import { DraggableDataListItem } from './DraggableDataListItem';
import { DraggableDualListSelectorListItem } from './DraggableDualListSelectorListItem';
import styles from '@patternfly/react-styles/css/components/DragDrop/drag-drop';
import { DraggableObject } from './DragDropSort';
import { canUseDOM } from '@patternfly/react-core';

export type DragDropContainerDragStartEvent = DragStartEvent;
export type DragDropContainerDragOverEvent = DragOverEvent;
export type DragDropContainerDragEndEvent = DragEndEvent;
export type DragDropContainerDragCancelEvent = DragCancelEvent;

export interface DraggableObject {
/** Unique id of the draggable object */
id: string | number;
/** Content rendered in the draggable object */
content: React.ReactNode;
/** Props spread to the rendered wrapper of the draggable object */
props?: any;
}

/**
* DragDropSortProps extends dnd-kit's props which may be viewed at https://docs.dndkit.com/api-documentation/context-provider#props.
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
import * as React from 'react';
import { DndContextProps, DragEndEvent, DragStartEvent } from '@dnd-kit/core';
import { Droppable } from './Droppable';
import { DragDropContainer } from './DragDropContainer';
import { DragDropContainer, DraggableObject } from './DragDropContainer';

export type DragDropSortDragEndEvent = DragEndEvent;
export type DragDropSortDragStartEvent = DragStartEvent;

export interface DraggableObject {
/** Unique id of the draggable object */
id: string | number;
/** Content rendered in the draggable object */
content: React.ReactNode;
/** Props spread to the rendered wrapper of the draggable object */
props?: any;
}

/**
* DragDropSortProps extends dnd-kit's props which may be viewed at https://docs.dndkit.com/api-documentation/context-provider#props.
*/
Expand Down

0 comments on commit 672cdfb

Please sign in to comment.