This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1754 from owncloud/feat-drag-drop-ghost-element
Add Ghost Element for Drag & Drop move
- Loading branch information
Showing
4 changed files
with
104 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Enhancement: Add Ghost Element for Drag & Drop | ||
|
||
We've added a custom ghost element for the drag&drop functionality in the OcTableFiles to | ||
better visualize the action to the user. | ||
|
||
https://github.com/owncloud/web/issues/5788 | ||
https://github.com/owncloud/owncloud-design-system/pull/1754 |
57 changes: 57 additions & 0 deletions
57
src/components/molecules/OcTable/GhostElement/GhostElement.vue
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,57 @@ | ||
<template> | ||
<div id="ghost-element" class="ghost-element"> | ||
<oc-icon :name="firstPreviewIcon" size="large" /> | ||
<span class="badge">{{ itemCount }}</span> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
/** | ||
* Please head to the OcTableFiles component (https://owncloud.design/#/oC%20Components/OcTableFiles) for a demo of the Ghost Element. | ||
*/ | ||
export default { | ||
name: "GhostElement", | ||
props: { | ||
previewItems: { | ||
type: Array, | ||
required: true, | ||
}, | ||
}, | ||
computed: { | ||
firstPreviewIcon() { | ||
const icon = this.previewItems[0].icon | ||
return icon ? icon : "file" | ||
}, | ||
itemCount() { | ||
return this.previewItems.length | ||
}, | ||
}, | ||
} | ||
</script> | ||
|
||
<style lang="scss"> | ||
.ghost-element { | ||
background-color: transparent; | ||
padding-top: 4px; | ||
padding-left: 5px; | ||
z-index: var(--oc-z-index-modal); | ||
position: absolute; | ||
.badge { | ||
position: absolute; | ||
top: -2px; | ||
right: -8px; | ||
padding: 4px; | ||
line-height: 10px; | ||
-webkit-border-radius: 30px; | ||
-moz-border-radius: 30px; | ||
border-radius: 30px; | ||
min-width: 10px; | ||
height: 10px; | ||
text-align: center; | ||
font-size: 12px; | ||
background: red; | ||
color: white; | ||
} | ||
} | ||
</style> |
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