-
Notifications
You must be signed in to change notification settings - Fork 377
feat(DragDrop): new drag drop styling fixes #9784
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
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
322e003
feat(DragDrop): introduce new package and deprecate old implementation
nicolethoen 38841ca
refactor a bunch
nicolethoen 8179836
style fixes
kmcfaul f19fe1f
fix lint errors
kmcfaul d4d9fc7
fix lint
kmcfaul b5bec3a
update snap
kmcfaul eebc504
update duallistselector example, try exporting interface from separat…
kmcfaul c5e90a7
bump versions in dragdrop for mismatch
kmcfaul 55e3705
fix versions
kmcfaul b9b4267
pr feedback
kmcfaul e4c07b1
fix versions after merge
kmcfaul b55066b
version update after rebase
kmcfaul 104d938
update md
kmcfaul 127c1a4
move into next folder for docgen
kmcfaul 592ca6b
update version after rebase
kmcfaul 22d4b4e
update ver after rebase
kmcfaul 0069766
update ver after rebase
kmcfaul 1512512
update ver after rebase
kmcfaul c35e1a3
remove unused prop, update wording
kmcfaul 1e0d582
move some examples to demos
kmcfaul 8b5702b
update ver after rebase
kmcfaul 0e0c061
update new demos text
kmcfaul 0c87a8f
update wording p1
kmcfaul 26629c2
update wording p2
kmcfaul 8068fea
update wording p3
kmcfaul 80ec1b6
update wording p4
kmcfaul 18806d3
fix links
kmcfaul 51375fb
remove beta flags since page is beta
kmcfaul 71a831d
update ver after rebase
kmcfaul File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,7 +1,9 @@ | ||
| export * from './DualListSelector'; | ||
| export * from './DualListSelectorContext'; | ||
| export * from './DualListSelectorControl'; | ||
| export * from './DualListSelectorControlsWrapper'; | ||
| export * from './DualListSelectorPane'; | ||
| export * from './DualListSelectorList'; | ||
| export * from './DualListSelectorListItem'; | ||
| export * from './DualListSelectorTree'; | ||
| export * from './DualListSelectorContext'; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,49 @@ | ||
| { | ||
| "name": "@patternfly/react-drag-drop", | ||
| "version": "5.2.0-prelease.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" | ||
| }, | ||
| "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.2.0-prerelease.41", | ||
| "@patternfly/react-icons": "^5.2.0-prerelease.9", | ||
| "@patternfly/react-styles": "^5.2.0-prerelease.6", | ||
| "memoize-one": "^5.1.0", | ||
| "resize-observer-polyfill": "^1.5.1" | ||
| }, | ||
| "peerDependencies": { | ||
| "react": "^17 || ^18", | ||
| "react-dom": "^17 || ^18" | ||
| }, | ||
| "devDependencies": { | ||
| "rimraf": "^2.6.2", | ||
| "typescript": "^4.7.4" | ||
| } | ||
| } |
This file contains hidden or 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 @@ | ||
| export * from './next'; |
27 changes: 27 additions & 0 deletions
27
packages/react-drag-drop/src/next/components/DragDrop/DragButton.tsx
This file contains hidden or 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,27 @@ | ||
| import * as React from 'react'; | ||
| import { css } from '@patternfly/react-styles'; | ||
| import dragButtonStyles from '@patternfly/react-styles/css/components/DataList/data-list'; | ||
| import buttonStyles from '@patternfly/react-styles/css/components/Button/button'; | ||
| 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, buttonStyles.button, buttonStyles.modifiers.plain)} | ||
| aria-label="Drag button" | ||
| {...props} | ||
| > | ||
| <span className={css(dragButtonStyles.dataListItemDraggableIcon)}> | ||
| <GripVerticalIcon /> | ||
| </span> | ||
| </button> | ||
| ); | ||
| DragButton.displayName = 'DragButton'; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This data list class will not do anything unless it's a child of
dataListItemDraggableButton. https://github.com/patternfly/patternfly/blob/48c4dc9c315d08989d30b20488d932b77be1172f/src/patternfly/components/DataList/data-list.scss#L341-L377The main thing it does is manipulate the cursor to "grab" when you hover the button that will drag a thing - you'll see that in data list and dual list selector, but not in the drag/drop next examples. We can add styling support to the base drag/drop component styles for that support if needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can leave this in for now to have the grab cursor for the data list and dual list selector, but we will probably want to include this in the generic drag/drop styling in the future.