-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DragDrop): introduce new package and deprecate old implementation
- Loading branch information
1 parent
7c58883
commit a724d73
Showing
42 changed files
with
948 additions
and
151 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
105 changes: 0 additions & 105 deletions
105
packages/react-core/src/components/DataList/examples/DataListDraggable.tsx
This file was deleted.
Oops, something went wrong.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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
1 change: 1 addition & 0 deletions
1
...act-core/src/components/DragDrop/index.ts → ...c/deprecated/components/DragDrop/index.ts
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 +1,4 @@ | ||
export * from './DragDrop'; | ||
export * from './Draggable'; | ||
export * from './Droppable'; | ||
export * from './DroppableContext'; |
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 +1 @@ | ||
export * from './'; | ||
export * from './DragDrop'; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "@patternfly/react-drag-drop", | ||
"version": "5.0.0-alpha.0", | ||
"description": "PatternFly drag and drop solution", | ||
"main": "dist/js/index.js", | ||
"module": "dist/esm/index.js", | ||
"types": "dist/esm/index.d.ts", | ||
"sideEffects": false, | ||
"publishConfig": { | ||
"access": "public", | ||
"tag": "alpha" | ||
}, | ||
"patternfly:src": "src/", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/patternfly/patternfly-react.git" | ||
}, | ||
"keywords": [ | ||
"react", | ||
"patternfly", | ||
"drag-drop" | ||
], | ||
"author": "Red Hat", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/patternfly/patternfly-react/issues" | ||
}, | ||
"homepage": "https://github.com/patternfly/patternfly-react/tree/main/packages/react-drag-drop#readme", | ||
"scripts": { | ||
"clean": "rimraf dist" | ||
}, | ||
"dependencies": { | ||
"@dnd-kit/core": "^6.0.8", | ||
"@dnd-kit/modifiers": "^6.0.1", | ||
"@dnd-kit/sortable": "^7.0.2", | ||
"@patternfly/react-core": "^5.0.0-alpha.4", | ||
"@patternfly/react-icons": "^5.0.0-alpha.1", | ||
"@patternfly/react-styles": "^5.0.0-alpha.1", | ||
"memoize-one": "^5.1.0", | ||
"resize-observer-polyfill": "^1.5.1" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.0 || ^17.0.0", | ||
"react-dom": "^16.8.0 || ^17.0.0" | ||
}, | ||
"devDependencies": { | ||
"rimraf": "^2.6.2", | ||
"typescript": "^4.7.4" | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/react-drag-drop/src/components/DragDrop/DragButton.tsx
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,22 @@ | ||
import * as React from 'react'; | ||
import { css } from '@patternfly/react-styles'; | ||
import dragButtonStyles from '@patternfly/react-styles/css/components/DataList/data-list'; | ||
import GripVerticalIcon from '@patternfly/react-icons/dist/esm/icons/grip-vertical-icon'; | ||
|
||
export interface DragButtonProps extends React.HTMLProps<HTMLButtonElement> { | ||
/** Additional classes added to the drag button */ | ||
className?: string; | ||
/** Sets button type */ | ||
type?: 'button' | 'submit' | 'reset'; | ||
/** Flag indicating if drag is disabled for the item */ | ||
isDisabled?: boolean; | ||
} | ||
|
||
export const DragButton: React.FunctionComponent<DragButtonProps> = ({ className, ...props }: DragButtonProps) => ( | ||
<button className={css(className, 'pf-c-button', 'pf-m-plain')} {...props}> | ||
<span className={css(dragButtonStyles.dataListItemDraggableIcon)}> | ||
<GripVerticalIcon /> | ||
</span> | ||
</button> | ||
); | ||
DragButton.displayName = 'DragButton'; |
Oops, something went wrong.