-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(list): Add support for dragging items. (#7109)
**Related Issue:** #6554 ## Summary - SortableComponent - Moves all configuration options into the interface so a component can consistently setup SortableJS. - Changes usage of `onUpdate` to `onSort` for moving between lists and getting `calciteListOrderChange` event. - Adds support for `canPut`/`canPull` so users can configure whether an item can be dragged to another list and vice versa. - List - Sets up sorting - keyboard sorting only works within a list. Cannot keyboard sort across lists at this time (including nested lists). - Adds dragHandle rendering to `list-item` - ListItemGroup and List emit an internal event when its default slot changes in order to update whether an expand caret shows or not. - Handle - Updates handle to support displaying ariaLabel (logic taken from value-list) - Handle will emit an internal event for parent components to update an aria-live region. - No breaking changes necessary. We can advise users to nest another `calcite-list` to work with sorting on children. - `calcite-list-item-group` will not be draggable/sortable at this time.
- Loading branch information
Showing
21 changed files
with
920 additions
and
88 deletions.
There are no files selected for viewing
6 changes: 5 additions & 1 deletion
6
packages/calcite-components/src/components/handle/assets/handle/t9n/messages.json
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,7 @@ | ||
{ | ||
"dragHandle": "Drag handle" | ||
"dragHandle": "Drag handle", | ||
"dragHandleActive": "Reordering {itemLabel}, current position {position} of {total}.", | ||
"dragHandleChange": "{itemLabel}, new position {position} of {total}. Press space to confirm.", | ||
"dragHandleCommit": "{itemLabel}, current position {position} of {total}.", | ||
"dragHandleIdle": "{itemLabel}, press space and use arrow keys to reorder content. Current position {position} of {total}." | ||
} |
6 changes: 5 additions & 1 deletion
6
packages/calcite-components/src/components/handle/assets/handle/t9n/messages_en.json
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,7 @@ | ||
{ | ||
"dragHandle": "Drag handle" | ||
"dragHandle": "Drag handle", | ||
"dragHandleActive": "Reordering {itemLabel}, current position {position} of {total}.", | ||
"dragHandleChange": "{itemLabel}, new position {position} of {total}. Press space to confirm.", | ||
"dragHandleCommit": "{itemLabel}, current position {position} of {total}.", | ||
"dragHandleIdle": "{itemLabel}, press space and use arrow keys to reorder content. Current position {position} of {total}." | ||
} |
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
4 changes: 4 additions & 0 deletions
4
packages/calcite-components/src/components/handle/interfaces.d.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,7 @@ | ||
export interface HandleNudge { | ||
direction: "up" | "down"; | ||
} | ||
|
||
export interface HandleChange { | ||
message: string; | ||
} |
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
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
Oops, something went wrong.