diff --git a/README.md b/README.md index ddb88bc..1ece15e 100644 --- a/README.md +++ b/README.md @@ -191,6 +191,7 @@ add-tags-on-blur | Boolean | false | Add new tags when on the input is blur. The sort-search-results | Boolean | true | Whether the search results should be sorted. before-adding-tag | Function | `tag => true` | Callback to perform additional checks and actions before a tag is added. Return `true` to allow a tag to be added or `false` to forbid the action. before-removing-tag | Function | `tag => true` | Callback to perform additional checks and actions before a tag is removed. Return `true` to allow a tag to be added or `false` to forbid the action. +is-draggable | Boolean | false | Enable draggable sorting of tags. #### Events diff --git a/dist/style.css b/dist/style.css index ed9b6b3..437e720 100644 --- a/dist/style.css +++ b/dist/style.css @@ -60,7 +60,6 @@ width: 75%; left: 0.15em; background: #5dc282; - height: 2px; margin-top: -1px; } @@ -102,6 +101,16 @@ background-color: #f0f1f2; } +.tags-input-badge-draggable { + cursor: move; + -webkit-touch-callout: none; /* iOS Safari */ + -webkit-user-select: none; /* Safari */ + -khtml-user-select: none; /* Konqueror HTML */ + -moz-user-select: none; /* Firefox */ + -ms-user-select: none; /* Internet Explorer/Edge */ + user-select: none; /* Non-prefixed version, currently supported by Chrome and Opera */ +} + /* Typeahead */ .typeahead-hide-btn { color: #999 !important; diff --git a/package.json b/package.json index 8c59d73..8d13e86 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,9 @@ "dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot", "build": "cross-env NODE_ENV=production webpack --progress --hide-modules" }, - "dependencies": {}, + "dependencies": { + "vuedraggable": "^2.24.3" + }, "browserslist": [ "> 1%", "last 2 versions", diff --git a/src/VoerroTagsInput.vue b/src/VoerroTagsInput.vue index 5b96f37..c93968c 100644 --- a/src/VoerroTagsInput.vue +++ b/src/VoerroTagsInput.vue @@ -5,24 +5,26 @@ 'active': isActive, 'disabled': disabled, }"> - - + - - - - - + + + + + + +