-
Notifications
You must be signed in to change notification settings - Fork 82
feat(useDraggable): add public facing hook #7356
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
Open
tomdavies73
wants to merge
9
commits into
master
Choose a base branch
from
FE-6907
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1f51b0d
chore: add relevant pragmatic drag and drop dependencies
tomdavies73 f126ffa
chore: add drag event polyfill to properly unit test against drags wi…
tomdavies73 6a3fc0b
chore: amend playwright config to run over all src files
tomdavies73 e3c6b3a
chore: add isGuid util for checking if a string is generated via our …
tomdavies73 7cd8cdd
feat(draggable-utils): add draggable utils file
tomdavies73 b6d6054
feat(draggable-item, draggable-container): add internal foundation co…
tomdavies73 70a836a
feat(useDraggable): add public facing hook
tomdavies73 f23e894
refactor(draggable-container, draggable-item): re-build using the use…
tomdavies73 7acdcdf
refactor(flat-table): re-build using internal foundation components
tomdavies73 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,63 @@ | ||
import React from "react"; | ||
import DraggableItem from "./draggable-item"; | ||
import DraggableContainer, { | ||
DraggableContainerProps, | ||
} from "./draggable-container"; | ||
|
||
export const BasicConfiguration = (props: Partial<DraggableContainerProps>) => ( | ||
<DraggableContainer | ||
containerProps={{ "data-role": "draggable-container" }} | ||
{...props} | ||
> | ||
<DraggableItem id="1">Item 1</DraggableItem> | ||
<DraggableItem id="2">Item 2</DraggableItem> | ||
<DraggableItem id="3">Item 3</DraggableItem> | ||
<DraggableItem id="4">Item 4</DraggableItem> | ||
<DraggableItem id="5">Item 5</DraggableItem> | ||
</DraggableContainer> | ||
); | ||
|
||
export const OutOfBoundsConfiguration = ( | ||
props: Partial<DraggableContainerProps>, | ||
) => ( | ||
<> | ||
<DraggableContainer | ||
containerProps={{ "data-role": "draggable-container" }} | ||
{...props} | ||
> | ||
<DraggableItem id="1">Item 1</DraggableItem> | ||
<DraggableItem id="2">Item 2</DraggableItem> | ||
<DraggableItem id="3">Item 3</DraggableItem> | ||
<DraggableItem id="4">Item 4</DraggableItem> | ||
<DraggableItem id="5">Item 5</DraggableItem> | ||
</DraggableContainer> | ||
<div>Out of bounds</div> | ||
</> | ||
); | ||
|
||
export const MultipleContainersConfiguration = ( | ||
props: Partial<DraggableContainerProps>, | ||
) => ( | ||
<> | ||
<DraggableContainer | ||
containerProps={{ "data-role": "draggable-container-1" }} | ||
{...props} | ||
> | ||
<DraggableItem id="1">Item 1</DraggableItem> | ||
<DraggableItem id="2">Item 2</DraggableItem> | ||
<DraggableItem id="3">Item 3</DraggableItem> | ||
<DraggableItem id="4">Item 4</DraggableItem> | ||
<DraggableItem id="5">Item 5</DraggableItem> | ||
</DraggableContainer> | ||
<DraggableContainer | ||
containerProps={{ "data-role": "draggable-container-2" }} | ||
{...props} | ||
> | ||
<DraggableItem id="6">Item 6</DraggableItem> | ||
<DraggableItem id="7">Item 7</DraggableItem> | ||
<DraggableItem id="8">Item 8</DraggableItem> | ||
<DraggableItem id="9">Item 9</DraggableItem> | ||
<DraggableItem id="10">Item 10</DraggableItem> | ||
</DraggableContainer> | ||
</> | ||
); |
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,13 @@ | ||
import { createContext } from "react"; | ||
|
||
interface DraggableContainerContextType { | ||
columnId: string | number; | ||
dragType?: "continuous" | "onDrop"; | ||
} | ||
|
||
const DraggableContainerContext = createContext<DraggableContainerContextType>({ | ||
columnId: "", | ||
dragType: undefined, | ||
}); | ||
|
||
export default DraggableContainerContext; |
Oops, something went wrong.
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.
question(non-blocking): Why has this been changed?
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.
So playwright can run on the
.pw.tsx
file added to theuseDraggable
hook, previously it would only run over components which would mean this test wouldn't be included.