diff --git a/README.md b/README.md index 9031353..b5e0290 100644 --- a/README.md +++ b/README.md @@ -181,6 +181,7 @@ limit | Number | 0 | Limit the number of tags that can be chosen. 0 = no limit. hide-input-on-limit | Boolean | false | Hide the input field when the tags limit is reached. only-existing-tags | Boolean | false | Only existing tags can be added/chosen. New tags won't be created. case-sensitive-tags | Boolean | false | Determines whether tags are case sensitive. Setting this to `true` would allow tags like `php`, `PHP`, `PhP`, and so on to be added at the same time. +ignore-diacritics | Boolean | false | Determines whether the accents in words are ignored or not. Setting this to `true` would ignore the differences between words like `voila` and `voilà`. delete-on-backspace | Boolean | true | Whether deleting tags by pressing Backspace is allowed. allow-duplicates | Boolean | false | Allow users to add the same tags multiple times. validate | Function | `text => true` | Callback to validate tags' text with. diff --git a/dist/voerro-vue-tagsinput.js b/dist/voerro-vue-tagsinput.js index f3efd97..6c71c5c 100644 --- a/dist/voerro-vue-tagsinput.js +++ b/dist/voerro-vue-tagsinput.js @@ -1,2 +1,2 @@ -!function(e){var t={};function i(a){if(t[a])return t[a].exports;var s=t[a]={i:a,l:!1,exports:{}};return e[a].call(s.exports,s,s.exports,i),s.l=!0,s.exports}i.m=e,i.c=t,i.d=function(e,t,a){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(a,s,function(t){return e[t]}.bind(null,s));return a},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=0)}([function(e,t,i){"use strict";i.r(t);function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var s=function(e,t,i,a,s,n,r,l){var o,h="function"==typeof e?e.options:e;if(t&&(h.render=t,h.staticRenderFns=i,h._compiled=!0),a&&(h.functional=!0),n&&(h._scopeId="data-v-"+n),r?(o=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(r)},h._ssrRegister=o):s&&(o=l?function(){s.call(this,(h.functional?this.parent:this).$root.$options.shadowRoot)}:s),o)if(h.functional){h._injectStyles=o;var u=h.render;h.render=function(e,t){return o.call(t),u(e,t)}}else{var d=h.beforeCreate;h.beforeCreate=d?[].concat(d,o):[o]}return{exports:e,options:h}}({props:{elementId:String,inputId:String,existingTags:{type:Array,default:function(){return[]}},value:{type:Array,default:function(){return[]}},idField:{type:String,default:"key"},textField:{type:String,default:"value"},displayField:{type:String,default:null},valueFields:{type:String,default:null},disabled:{type:Boolean,default:!1},typeahead:{type:Boolean,default:!1},typeaheadStyle:{type:String,default:"badges"},typeaheadActivationThreshold:{type:Number,default:1},typeaheadMaxResults:{type:Number,default:0},typeaheadAlwaysShow:{type:Boolean,default:!1},typeaheadShowOnFocus:{type:Boolean,default:!0},typeaheadHideDiscard:{type:Boolean,default:!1},typeaheadUrl:{type:String,default:""},placeholder:{type:String,default:"Add a tag"},discardSearchText:{type:String,default:"Discard Search Results"},limit:{type:Number,default:0},hideInputOnLimit:{type:Boolean,default:!1},onlyExistingTags:{type:Boolean,default:!1},deleteOnBackspace:{type:Boolean,default:!0},allowDuplicates:{type:Boolean,default:!1},validate:{type:Function,default:function(){return!0}},addTagsOnComma:{type:Boolean,default:!1},addTagsOnSpace:{type:Boolean,default:!1},addTagsOnBlur:{type:Boolean,default:!1},wrapperClass:{type:String,default:"tags-input-wrapper-default"},sortSearchResults:{type:Boolean,default:!0},caseSensitiveTags:{type:Boolean,default:!1},beforeAddingTag:{type:Function,default:function(){return!0}},beforeRemovingTag:{type:Function,default:function(){return!0}}},data:function(){return{badgeId:0,tags:[],input:"",oldInput:"",hiddenInput:"",searchResults:[],searchSelection:0,selectedTag:-1,isActive:!1,composing:!1}},created:function(){this.typeaheadTags=this.cloneArray(this.existingTags),this.tagsFromValue(),this.typeaheadAlwaysShow&&this.searchTag(!1)},mounted:function(){var e=this;this.$emit("initialized"),document.addEventListener("click",(function(t){t.target!==e.$refs.taginput&&e.clearSearchResults()}))},computed:{hideInputField:function(){return this.hideInputOnLimit&&this.limit>0&&this.tags.length>=this.limit||this.disabled}},watch:{input:function(e,t){if(this.searchTag(!1),e.length&&e!=t){e.substring(t.length,e.length);this.addTagsOnSpace&&e.endsWith(" ")&&(this.input=e.trim(),this.tagFromInput(!0)),this.addTagsOnComma&&(e=e.trim()).endsWith(",")&&(this.input=e.substring(0,e.length-1),this.tagFromInput(!0)),this.$emit("change",e)}},existingTags:function(e){this.typeaheadTags.splice(0),this.typeaheadTags=this.cloneArray(e),this.searchTag()},tags:function(){this.hiddenInput=JSON.stringify(this.tags),this.$emit("input",this.tags)},value:function(){this.tagsFromValue()},typeaheadAlwaysShow:function(e){e?this.searchTag(!1):this.clearSearchResults()}},methods:{escapeRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},tagFromInput:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.composing)if(this.searchResults.length&&this.searchSelection>=0&&!e)this.tagFromSearch(this.searchResults[this.searchSelection]),this.input="";else{var t=this.input.trim();if(!this.onlyExistingTags&&t.length&&this.validate(t)){var i;this.input="";var s=(a(i={},this.idField,""),a(i,this.textField,t),i),n=this.escapeRegExp(this.caseSensitiveTags?s[this.textField]:s[this.textField].toLowerCase()),r=!0,l=!1,o=void 0;try{for(var h,u=this.typeaheadTags[Symbol.iterator]();!(r=(h=u.next()).done);r=!0){var d=h.value,c=this.escapeRegExp(this.caseSensitiveTags?d[this.textField]:d[this.textField].toLowerCase());if(n===c){s=Object.assign({},d);break}}}catch(e){l=!0,o=e}finally{try{!r&&u.return&&u.return()}finally{if(l)throw o}}this.addTag(s)}}},tagFromSearchOnClick:function(e){this.tagFromSearch(e),this.$refs.taginput.blur()},tagFromSearch:function(e){var t=this;this.clearSearchResults(),this.addTag(e),this.$nextTick((function(){t.input="",t.oldInput=""}))},addTag:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.disabled||i)return!!this.beforeAddingTag(e)&&(this.limit>0&&this.tags.length>=this.limit?(this.$emit("limit-reached"),!1):void(this.tagSelected(e)||(this.tags.push(e),this.$nextTick((function(){t.$emit("tag-added",e),t.$emit("tags-updated")})))))},removeLastTag:function(){!this.input.length&&this.deleteOnBackspace&&this.tags.length&&this.removeTag(this.tags.length-1)},removeTag:function(e){var t=this;if(!this.disabled){var i=this.tags[e];if(!this.beforeRemovingTag(i))return!1;this.tags.splice(e,1),this.$nextTick((function(){t.$emit("tag-removed",i),t.$emit("tags-updated"),t.typeaheadAlwaysShow&&t.searchTag()}))}},searchTag:function(){if(!0!==this.typeahead)return!1;if(this.oldInput!=this.input||!this.searchResults.length&&0==this.typeaheadActivationThreshold||this.typeaheadAlwaysShow||this.typeaheadShowOnFocus){this.typeaheadUrl.length||(this.searchResults=[]),this.searchSelection=0;var e=this.input.trim();if(e.length&&e.length>=this.typeaheadActivationThreshold||0==this.typeaheadActivationThreshold||this.typeaheadAlwaysShow){var t=this.escapeRegExp(this.caseSensitiveTags?e:e.toLowerCase());if(this.typeaheadUrl.length>0){this.typeaheadTags.splice(0);var i=new XMLHttpRequest,a=this;i.onreadystatechange=function(){4==this.readyState&&200==this.status&&(a.typeaheadTags=JSON.parse(i.responseText),a.doSearch(t))};var s=this.typeaheadUrl.replace(":search",t);i.open("GET",s,!0),i.send()}else this.doSearch(t)}this.oldInput=this.input}},doSearch:function(e){var t=this;this.searchResults=[];var i=!0,a=!1,s=void 0;try{for(var n,r=this.typeaheadTags[Symbol.iterator]();!(i=(n=r.next()).done);i=!0){var l=n.value,o=this.caseSensitiveTags?l[this.textField]:l[this.textField].toLowerCase(),h=this.searchResults.map((function(e){return e[t.idField]}));o.search(e)>-1&&!this.tagSelected(l)&&!h.includes(l[this.idField])&&this.searchResults.push(l)}}catch(e){a=!0,s=e}finally{try{!i&&r.return&&r.return()}finally{if(a)throw s}}this.sortSearchResults&&this.searchResults.sort((function(e,i){return e[t.textField]i[t.textField]?1:0})),this.typeaheadMaxResults>0&&(this.searchResults=this.searchResults.slice(0,this.typeaheadMaxResults))},hideTypeahead:function(){var e=this;this.input.length||this.$nextTick((function(){e.clearSearchResults()}))},nextSearchResult:function(){this.searchSelection+1<=this.searchResults.length-1&&this.searchSelection++},prevSearchResult:function(){this.searchSelection>0&&this.searchSelection--},clearSearchResults:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.searchResults=[],this.searchSelection=0,this.typeaheadAlwaysShow&&this.$nextTick((function(){e.searchTag()})),t&&this.$refs.taginput.focus()},clearTags:function(){this.tags.splice(0,this.tags.length)},tagsFromValue:function(){if(this.value&&this.value.length){if(!Array.isArray(this.value))return void console.error("Voerro Tags Input: the v-model value must be an array!");var e=this.value;if(this.tags==e)return;this.clearTags();var t=!0,i=!1,a=void 0;try{for(var s,n=e[Symbol.iterator]();!(t=(s=n.next()).done);t=!0){var r=s.value;this.addTag(r,!0)}}catch(e){i=!0,a=e}finally{try{!t&&n.return&&n.return()}finally{if(i)throw a}}}else{if(0==this.tags.length)return;this.clearTags()}},tagSelected:function(e){if(this.allowDuplicates)return!1;if(!e)return!1;var t=this.escapeRegExp(this.caseSensitiveTags?e[this.textField]:e[this.textField].toLowerCase()),i=!0,a=!1,s=void 0;try{for(var n,r=this.tags[Symbol.iterator]();!(i=(n=r.next()).done);i=!0){var l=n.value,o=this.caseSensitiveTags?l[this.textField]:l[this.textField].toLowerCase();if(l[this.idField]===e[this.idField]&&this.escapeRegExp(o).length==t.length&&o.search(t)>-1)return!0}}catch(e){a=!0,s=e}finally{try{!i&&r.return&&r.return()}finally{if(a)throw s}}return!1},clearInput:function(){this.input=""},onKeyUp:function(e){this.$emit("keyup",e)},onKeyDown:function(e){this.$emit("keydown",e)},onFocus:function(e){this.$emit("focus",e),this.isActive=!0},onClick:function(e){this.$emit("click",e),this.isActive=!0,this.searchTag()},onBlur:function(e){this.$emit("blur",e),this.addTagsOnBlur&&this.tagFromInput(!0),this.typeaheadAlwaysShow?this.searchTag():this.hideTypeahead(),this.isActive=!1},hiddenInputValue:function(e){if(!this.valueFields)return JSON.stringify(e);var t=this.valueFields.replace(/\s/,"").split(",");return 1===t.length?e[t[0]]:JSON.stringify(Object.assign.apply(Object,[{}].concat(function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t0&&this.tags.length>=this.limit||this.disabled}},watch:{input:function(e,t){if(this.searchTag(!1),e.length&&e!=t){e.substring(t.length,e.length);this.addTagsOnSpace&&e.endsWith(" ")&&(this.input=e.trim(),this.tagFromInput(!0)),this.addTagsOnComma&&(e=e.trim()).endsWith(",")&&(this.input=e.substring(0,e.length-1),this.tagFromInput(!0)),this.$emit("change",e)}},existingTags:function(e){this.typeaheadTags.splice(0),this.typeaheadTags=this.cloneArray(e),this.searchTag()},tags:function(){this.hiddenInput=JSON.stringify(this.tags),this.$emit("input",this.tags)},value:function(){this.tagsFromValue()},typeaheadAlwaysShow:function(e){e?this.searchTag(!1):this.clearSearchResults()}},methods:{escapeRegExp:function(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")},tagFromInput:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!this.composing)if(this.searchResults.length&&this.searchSelection>=0&&!e)this.tagFromSearch(this.searchResults[this.searchSelection]),this.input="";else{var t=this.input.trim();if(!this.onlyExistingTags&&t.length&&this.validate(t)){var i;this.input="";var s=(a(i={},this.idField,""),a(i,this.textField,t),i),n=this.escapeRegExp(this.caseSensitiveTags?s[this.textField]:s[this.textField].toLowerCase()),r=!0,l=!1,h=void 0;try{for(var o,u=this.typeaheadTags[Symbol.iterator]();!(r=(o=u.next()).done);r=!0){var d=o.value,c=this.escapeRegExp(this.caseSensitiveTags?d[this.textField]:d[this.textField].toLowerCase());if(n===c){s=Object.assign({},d);break}}}catch(e){l=!0,h=e}finally{try{!r&&u.return&&u.return()}finally{if(l)throw h}}this.addTag(s)}}},tagFromSearchOnClick:function(e){this.tagFromSearch(e),this.$refs.taginput.blur()},tagFromSearch:function(e){var t=this;this.clearSearchResults(),this.addTag(e),this.$nextTick((function(){t.input="",t.oldInput=""}))},addTag:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!this.disabled||i)return!!this.beforeAddingTag(e)&&(this.limit>0&&this.tags.length>=this.limit?(this.$emit("limit-reached"),!1):void(this.tagSelected(e)||(this.tags.push(e),this.$nextTick((function(){t.$emit("tag-added",e),t.$emit("tags-updated")})))))},removeLastTag:function(){!this.input.length&&this.deleteOnBackspace&&this.tags.length&&this.removeTag(this.tags.length-1)},removeTag:function(e){var t=this;if(!this.disabled){var i=this.tags[e];if(!this.beforeRemovingTag(i))return!1;this.tags.splice(e,1),this.$nextTick((function(){t.$emit("tag-removed",i),t.$emit("tags-updated"),t.typeaheadAlwaysShow&&t.searchTag()}))}},searchTag:function(){var e=this;if(!0!==this.typeahead)return!1;if(this.oldInput!=this.input||!this.searchResults.length&&0==this.typeaheadActivationThreshold||this.typeaheadAlwaysShow||this.typeaheadShowOnFocus){this.typeaheadUrl.length||this.typeaheadCallback||(this.searchResults=[]),this.searchSelection=0;var t=this.input.trim();if(t.length&&t.length>=this.typeaheadActivationThreshold||0==this.typeaheadActivationThreshold||this.typeaheadAlwaysShow){var i=this.escapeRegExp(this.caseSensitiveTags?t:t.toLowerCase());if(this.typeaheadCallback)this.typeaheadCallback(i).then((function(t){e.typeaheadTags=t}));else if(this.typeaheadUrl.length>0){this.typeaheadTags.splice(0);var a=new XMLHttpRequest,s=this;a.onreadystatechange=function(){4==this.readyState&&200==this.status&&(s.typeaheadTags=JSON.parse(a.responseText),s.doSearch(i))};var n=this.typeaheadUrl.replace(":search",i);a.open("GET",n,!0),a.send()}else this.doSearch(i)}this.oldInput=this.input}},doSearch:function(e){var t=this;this.searchResults=[];var i=!0,a=!1,s=void 0;try{for(var n,r=this.typeaheadTags[Symbol.iterator]();!(i=(n=r.next()).done);i=!0){var l=n.value,h=this.caseSensitiveTags?l[this.textField]:l[this.textField].toLowerCase(),o=this.searchResults.map((function(e){return e[t.idField]}));h.search(e)>-1&&!this.tagSelected(l)&&!o.includes(l[this.idField])&&this.searchResults.push(l)}}catch(e){a=!0,s=e}finally{try{!i&&r.return&&r.return()}finally{if(a)throw s}}this.sortSearchResults&&this.searchResults.sort((function(e,i){return e[t.textField]i[t.textField]?1:0})),this.typeaheadMaxResults>0&&(this.searchResults=this.searchResults.slice(0,this.typeaheadMaxResults))},hideTypeahead:function(){var e=this;this.input.length||this.$nextTick((function(){e.clearSearchResults()}))},nextSearchResult:function(){this.searchSelection+1<=this.searchResults.length-1&&this.searchSelection++},prevSearchResult:function(){this.searchSelection>0&&this.searchSelection--},clearSearchResults:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.searchResults=[],this.searchSelection=0,this.typeaheadAlwaysShow&&this.$nextTick((function(){e.searchTag()})),t&&this.$refs.taginput.focus()},clearTags:function(){this.tags.splice(0,this.tags.length)},tagsFromValue:function(){if(this.value&&this.value.length){if(!Array.isArray(this.value))return void console.error("Voerro Tags Input: the v-model value must be an array!");var e=this.value;if(this.tags==e)return;this.clearTags();var t=!0,i=!1,a=void 0;try{for(var s,n=e[Symbol.iterator]();!(t=(s=n.next()).done);t=!0){var r=s.value;this.addTag(r,!0)}}catch(e){i=!0,a=e}finally{try{!t&&n.return&&n.return()}finally{if(i)throw a}}}else{if(0==this.tags.length)return;this.clearTags()}},tagSelected:function(e){if(this.allowDuplicates)return!1;if(!e)return!1;var t=this.escapeRegExp(this.caseSensitiveTags?e[this.textField]:e[this.textField].toLowerCase()),i=!0,a=!1,s=void 0;try{for(var n,r=this.tags[Symbol.iterator]();!(i=(n=r.next()).done);i=!0){var l=n.value,h=this.caseSensitiveTags?l[this.textField]:l[this.textField].toLowerCase();if(l[this.idField]===e[this.idField]&&this.escapeRegExp(h).length==t.length&&h.search(t)>-1)return!0}}catch(e){a=!0,s=e}finally{try{!i&&r.return&&r.return()}finally{if(a)throw s}}return!1},clearInput:function(){this.input=""},onKeyUp:function(e){this.$emit("keyup",e)},onKeyDown:function(e){this.$emit("keydown",e)},onFocus:function(e){this.$emit("focus",e),this.isActive=!0},onClick:function(e){this.$emit("click",e),this.isActive=!0,this.searchTag()},onBlur:function(e){this.$emit("blur",e),this.addTagsOnBlur&&this.tagFromInput(!0),this.typeaheadAlwaysShow?this.searchTag():this.hideTypeahead(),this.isActive=!1},hiddenInputValue:function(e){if(!this.valueFields)return JSON.stringify(e);var t=this.valueFields.replace(/\s/,"").split(",");return 1===t.length?e[t[0]]:JSON.stringify(Object.assign.apply(Object,[{}].concat(function(e){if(Array.isArray(e)){for(var t=0,i=Array(e.length);t\n
\n
\n \n \n \n\n \n \n \n\n input = e.target.value\"\n v-show=\"!hideInputField\"\n @compositionstart=\"composing=true\"\n @compositionend=\"composing=false\"\n @keydown.enter.prevent=\"tagFromInput(false)\"\n @keydown.8=\"removeLastTag\"\n @keydown.down=\"nextSearchResult\"\n @keydown.up=\"prevSearchResult\"\n @keydown=\"onKeyDown\"\n @keyup=\"onKeyUp\"\n @keyup.esc=\"clearSearchResults\"\n @focus=\"onFocus\"\n @click=\"onClick\"\n @blur=\"onBlur\"\n @value=\"tags\">\n\n
\n \n
\n
\n\n \n
\n

\n \n\n \n

\n\n
    \n
  • \n\n
  • \n
\n
\n
\n\n\n\n","var render = function () {\nvar _obj;\nvar _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"tags-input-root\",staticStyle:{\"position\":\"relative\"}},[_c('div',{class:( _obj = {}, _obj[_vm.wrapperClass + ' tags-input'] = true, _obj['active'] = _vm.isActive, _obj['disabled'] = _vm.disabled, _obj )},[_vm._l((_vm.tags),function(tag,index){return _c('span',{key:index,staticClass:\"tags-input-badge tags-input-badge-pill tags-input-badge-selected-default\",class:{ 'disabled': _vm.disabled }},[_vm._t(\"selected-tag\",[_c('span',{domProps:{\"innerHTML\":_vm._s(tag[_vm.textField])}}),_vm._v(\" \"),_c('a',{directives:[{name:\"show\",rawName:\"v-show\",value:(!_vm.disabled),expression:\"!disabled\"}],staticClass:\"tags-input-remove\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.removeTag(index)}}})],{\"tag\":tag,\"index\":index,\"removeTag\":_vm.removeTag})],2)}),_vm._v(\" \"),_c('input',{directives:[{name:\"show\",rawName:\"v-show\",value:(!_vm.hideInputField),expression:\"!hideInputField\"}],ref:\"taginput\",attrs:{\"type\":\"text\",\"id\":_vm.inputId,\"name\":_vm.inputId,\"placeholder\":_vm.placeholder},domProps:{\"value\":_vm.input},on:{\"input\":function (e) { return _vm.input = e.target.value; },\"compositionstart\":function($event){_vm.composing=true},\"compositionend\":function($event){_vm.composing=false},\"keydown\":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }$event.preventDefault();return _vm.tagFromInput(false)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==8){ return null; }return _vm.removeLastTag($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"down\",40,$event.key,[\"Down\",\"ArrowDown\"])){ return null; }return _vm.nextSearchResult($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"up\",38,$event.key,[\"Up\",\"ArrowUp\"])){ return null; }return _vm.prevSearchResult($event)},_vm.onKeyDown],\"keyup\":[_vm.onKeyUp,function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"esc\",27,$event.key,[\"Esc\",\"Escape\"])){ return null; }return _vm.clearSearchResults($event)}],\"focus\":_vm.onFocus,\"click\":_vm.onClick,\"blur\":_vm.onBlur,\"value\":_vm.tags}}),_vm._v(\" \"),(_vm.elementId)?_c('div',{staticStyle:{\"display\":\"none\"}},_vm._l((_vm.tags),function(tag,index){return _c('input',{key:index,attrs:{\"type\":\"hidden\",\"name\":(_vm.elementId + \"[]\")},domProps:{\"value\":_vm.hiddenInputValue(tag)}})}),0):_vm._e()],2),_vm._v(\" \"),_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.searchResults.length),expression:\"searchResults.length\"}]},[(_vm.typeaheadStyle === 'badges')?_c('p',{class:(\"typeahead-\" + _vm.typeaheadStyle)},[(!_vm.typeaheadHideDiscard)?_c('span',{staticClass:\"tags-input-badge typeahead-hide-btn tags-input-typeahead-item-default\",domProps:{\"textContent\":_vm._s(_vm.discardSearchText)},on:{\"click\":function($event){$event.preventDefault();return _vm.clearSearchResults(true)}}}):_vm._e(),_vm._v(\" \"),_vm._l((_vm.searchResults),function(tag,index){return _c('span',{key:index,staticClass:\"tags-input-badge\",class:{\n 'tags-input-typeahead-item-default': index != _vm.searchSelection,\n 'tags-input-typeahead-item-highlighted-default': index == _vm.searchSelection\n },domProps:{\"innerHTML\":_vm._s(tag[_vm.textField])},on:{\"mouseover\":function($event){_vm.searchSelection = index},\"mousedown\":function($event){$event.preventDefault();return _vm.tagFromSearchOnClick(tag)}}})})],2):(_vm.typeaheadStyle === 'dropdown')?_c('ul',{class:(\"typeahead-\" + _vm.typeaheadStyle)},[(!_vm.typeaheadHideDiscard)?_c('li',{staticClass:\"tags-input-typeahead-item-default typeahead-hide-btn\",domProps:{\"textContent\":_vm._s(_vm.discardSearchText)},on:{\"click\":function($event){$event.preventDefault();return _vm.clearSearchResults(true)}}}):_vm._e(),_vm._v(\" \"),_vm._l((_vm.searchResults),function(tag,index){return _c('li',{key:index,class:{\n 'tags-input-typeahead-item-default': index != _vm.searchSelection,\n 'tags-input-typeahead-item-highlighted-default': index == _vm.searchSelection\n },domProps:{\"innerHTML\":_vm._s(_vm.getDisplayField(tag))},on:{\"mouseover\":function($event){_vm.searchSelection = index},\"mousedown\":function($event){$event.preventDefault();return _vm.tagFromSearchOnClick(tag)}}})})],2):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import VoerroTagsInput from './VoerroTagsInput.vue'\n\nwindow.VoerroTagsInput = VoerroTagsInput;\n\nexport default VoerroTagsInput;"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./src/VoerroTagsInput.vue","webpack:///./node_modules/vue-loader/lib/runtime/componentNormalizer.js","webpack:///src/VoerroTagsInput.vue","webpack:///./src/VoerroTagsInput.vue?fa3a","webpack:///./src/main.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","scriptExports","render","staticRenderFns","functionalTemplate","injectStyles","scopeId","moduleIdentifier","shadowMode","hook","options","_compiled","functional","_scopeId","context","this","$vnode","ssrContext","parent","__VUE_SSR_CONTEXT__","_registeredComponents","add","_ssrRegister","$root","$options","shadowRoot","_injectStyles","originalRender","h","existing","beforeCreate","concat","props","elementId","String","inputId","existingTags","type","Array","default","idField","textField","displayField","valueFields","disabled","Boolean","typeahead","typeaheadStyle","typeaheadActivationThreshold","Number","typeaheadMaxResults","typeaheadAlwaysShow","typeaheadShowOnFocus","typeaheadHideDiscard","typeaheadUrl","typeaheadCallback","Function","placeholder","discardSearchText","limit","hideInputOnLimit","onlyExistingTags","deleteOnBackspace","allowDuplicates","validate","addTagsOnComma","addTagsOnSpace","addTagsOnBlur","wrapperClass","sortSearchResults","caseSensitiveTags","beforeAddingTag","beforeRemovingTag","data","badgeId","tags","input","oldInput","hiddenInput","searchResults","searchSelection","selectedTag","isActive","composing","created","typeaheadTags","cloneArray","tagsFromValue","searchTag","mounted","$emit","document","addEventListener","e","target","computed","hideInputField","watch","newVal","length","oldVal","endsWith","trim","tagFromInput","substring","splice","JSON","stringify","newValue","clearSearchResults","methods","escapeRegExp","string","replace","ignoreSearchResults","tagFromSearch","text","addTag","newTag","tagFromSearchOnClick","tag","$refs","blur","$nextTick","force","tagSelected","push","removeLastTag","removeTag","index","searchQuery","xhttp","onreadystatechange","readyState","status","that","parse","responseText","doSearch","open","endpoint","send","sort","a","slice","hideTypeahead","nextSearchResult","prevSearchResult","returnFocus","focus","clearTags","isArray","console","error","clearInput","onKeyUp","onKeyDown","onFocus","onClick","onBlur","hiddenInputValue","fields","getDisplayField","arr","map","_obj","_vm","_h","$createElement","_c","_self","staticClass","staticStyle","class","_l","_t","domProps","_s","_v","directives","rawName","expression","attrs","on","$event","preventDefault","ref","indexOf","_k","keyCode","_e","window","VoerroTagsInput"],"mappings":"aACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QAKfF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb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,GAASqC,EAAItF,gBAClD,gDAAiDiD,GAASqC,EAAItF,iBAChEgG,SAAS,CAAC,UAAYV,EAAIW,GAAGX,EAAIJ,gBAAgB1C,KAAO+D,GAAG,CAAC,UAAY,SAASC,GAAQlB,EAAItF,gBAAkBiD,GAAO,UAAY,SAASuD,GAAgC,OAAxBA,EAAOC,iBAAwBnB,EAAI/C,qBAAqBC,WAAY,GAAG8C,EAAIwB,WAC1N,IHEpB,EACA,KACA,KACA,M,QIZFC,OAAOC,gBAAkBA,EAEVA","file":"voerro-vue-tagsinput.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/dist/\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 0);\n","import { render, staticRenderFns } from \"./VoerroTagsInput.vue?vue&type=template&id=35deda5a&\"\nimport script from \"./VoerroTagsInput.vue?vue&type=script&lang=js&\"\nexport * from \"./VoerroTagsInput.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","/* globals __VUE_SSR_CONTEXT__ */\n\n// IMPORTANT: Do NOT use ES2015 features in this file (except for modules).\n// This module is a runtime utility for cleaner component module output and will\n// be included in the final webpack user bundle.\n\nexport default function normalizeComponent (\n scriptExports,\n render,\n staticRenderFns,\n functionalTemplate,\n injectStyles,\n scopeId,\n moduleIdentifier, /* server only */\n shadowMode /* vue-cli only */\n) {\n // Vue.extend constructor export interop\n var options = typeof scriptExports === 'function'\n ? scriptExports.options\n : scriptExports\n\n // render functions\n if (render) {\n options.render = render\n options.staticRenderFns = staticRenderFns\n options._compiled = true\n }\n\n // functional template\n if (functionalTemplate) {\n options.functional = true\n }\n\n // scopedId\n if (scopeId) {\n options._scopeId = 'data-v-' + scopeId\n }\n\n var hook\n if (moduleIdentifier) { // server build\n hook = function (context) {\n // 2.3 injection\n context =\n context || // cached call\n (this.$vnode && this.$vnode.ssrContext) || // stateful\n (this.parent && this.parent.$vnode && this.parent.$vnode.ssrContext) // functional\n // 2.2 with runInNewContext: true\n if (!context && typeof __VUE_SSR_CONTEXT__ !== 'undefined') {\n context = __VUE_SSR_CONTEXT__\n }\n // inject component styles\n if (injectStyles) {\n injectStyles.call(this, context)\n }\n // register component module identifier for async chunk inferrence\n if (context && context._registeredComponents) {\n context._registeredComponents.add(moduleIdentifier)\n }\n }\n // used by ssr in case component is cached and beforeCreate\n // never gets called\n options._ssrRegister = hook\n } else if (injectStyles) {\n hook = shadowMode\n ? function () {\n injectStyles.call(\n this,\n (options.functional ? this.parent : this).$root.$options.shadowRoot\n )\n }\n : injectStyles\n }\n\n if (hook) {\n if (options.functional) {\n // for template-only hot-reload because in that case the render fn doesn't\n // go through the normalizer\n options._injectStyles = hook\n // register for functional component in vue file\n var originalRender = options.render\n options.render = function renderWithStyleInjection (h, context) {\n hook.call(context)\n return originalRender(h, context)\n }\n } else {\n // inject component registration as beforeCreate hook\n var existing = options.beforeCreate\n options.beforeCreate = existing\n ? [].concat(existing, hook)\n : [hook]\n }\n }\n\n return {\n exports: scriptExports,\n options: options\n }\n}\n","\n\n\n","var render = function () {\nvar _obj;\nvar _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',{staticClass:\"tags-input-root\",staticStyle:{\"position\":\"relative\"}},[_c('div',{class:( _obj = {}, _obj[_vm.wrapperClass + ' tags-input'] = true, _obj['active'] = _vm.isActive, _obj['disabled'] = _vm.disabled, _obj )},[_vm._l((_vm.tags),function(tag,index){return _c('span',{key:index,staticClass:\"tags-input-badge tags-input-badge-pill tags-input-badge-selected-default\",class:{ 'disabled': _vm.disabled }},[_vm._t(\"selected-tag\",[_c('span',{domProps:{\"innerHTML\":_vm._s(tag[_vm.textField])}}),_vm._v(\" \"),_c('a',{directives:[{name:\"show\",rawName:\"v-show\",value:(!_vm.disabled),expression:\"!disabled\"}],staticClass:\"tags-input-remove\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){$event.preventDefault();return _vm.removeTag(index)}}})],{\"tag\":tag,\"index\":index,\"removeTag\":_vm.removeTag})],2)}),_vm._v(\" \"),_c('input',{directives:[{name:\"show\",rawName:\"v-show\",value:(!_vm.hideInputField),expression:\"!hideInputField\"}],ref:\"taginput\",attrs:{\"type\":\"text\",\"id\":_vm.inputId,\"name\":_vm.inputId,\"placeholder\":_vm.placeholder},domProps:{\"value\":_vm.input},on:{\"input\":function (e) { return _vm.input = e.target.value; },\"compositionstart\":function($event){_vm.composing=true},\"compositionend\":function($event){_vm.composing=false},\"keydown\":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\")){ return null; }$event.preventDefault();return _vm.tagFromInput(false)},function($event){if(!$event.type.indexOf('key')&&$event.keyCode!==8){ return null; }return _vm.removeLastTag($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"down\",40,$event.key,[\"Down\",\"ArrowDown\"])){ return null; }return _vm.nextSearchResult($event)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"up\",38,$event.key,[\"Up\",\"ArrowUp\"])){ return null; }return _vm.prevSearchResult($event)},_vm.onKeyDown],\"keyup\":[_vm.onKeyUp,function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"esc\",27,$event.key,[\"Esc\",\"Escape\"])){ return null; }return _vm.clearSearchResults($event)}],\"focus\":_vm.onFocus,\"click\":_vm.onClick,\"blur\":_vm.onBlur,\"value\":_vm.tags}}),_vm._v(\" \"),(_vm.elementId)?_c('div',{staticStyle:{\"display\":\"none\"}},_vm._l((_vm.tags),function(tag,index){return _c('input',{key:index,attrs:{\"type\":\"hidden\",\"name\":(_vm.elementId + \"[]\")},domProps:{\"value\":_vm.hiddenInputValue(tag)}})}),0):_vm._e()],2),_vm._v(\" \"),_c('div',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.searchResults.length),expression:\"searchResults.length\"}]},[(_vm.typeaheadStyle === 'badges')?_c('p',{class:(\"typeahead-\" + _vm.typeaheadStyle)},[(!_vm.typeaheadHideDiscard)?_c('span',{staticClass:\"tags-input-badge typeahead-hide-btn tags-input-typeahead-item-default\",domProps:{\"textContent\":_vm._s(_vm.discardSearchText)},on:{\"click\":function($event){$event.preventDefault();return _vm.clearSearchResults(true)}}}):_vm._e(),_vm._v(\" \"),_vm._l((_vm.searchResults),function(tag,index){return _c('span',{key:index,staticClass:\"tags-input-badge\",class:{\n 'tags-input-typeahead-item-default': index != _vm.searchSelection,\n 'tags-input-typeahead-item-highlighted-default': index == _vm.searchSelection\n },domProps:{\"innerHTML\":_vm._s(tag[_vm.textField])},on:{\"mouseover\":function($event){_vm.searchSelection = index},\"mousedown\":function($event){$event.preventDefault();return _vm.tagFromSearchOnClick(tag)}}})})],2):(_vm.typeaheadStyle === 'dropdown')?_c('ul',{class:(\"typeahead-\" + _vm.typeaheadStyle)},[(!_vm.typeaheadHideDiscard)?_c('li',{staticClass:\"tags-input-typeahead-item-default typeahead-hide-btn\",domProps:{\"textContent\":_vm._s(_vm.discardSearchText)},on:{\"click\":function($event){$event.preventDefault();return _vm.clearSearchResults(true)}}}):_vm._e(),_vm._v(\" \"),_vm._l((_vm.searchResults),function(tag,index){return _c('li',{key:index,class:{\n 'tags-input-typeahead-item-default': index != _vm.searchSelection,\n 'tags-input-typeahead-item-highlighted-default': index == _vm.searchSelection\n },domProps:{\"innerHTML\":_vm._s(_vm.getDisplayField(tag))},on:{\"mouseover\":function($event){_vm.searchSelection = index},\"mousedown\":function($event){$event.preventDefault();return _vm.tagFromSearchOnClick(tag)}}})})],2):_vm._e()])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import VoerroTagsInput from './VoerroTagsInput.vue'\n\nwindow.VoerroTagsInput = VoerroTagsInput;\n\nexport default VoerroTagsInput;"],"sourceRoot":""} \ No newline at end of file diff --git a/index.html b/index.html index 2155084..1a5dd9f 100644 --- a/index.html +++ b/index.html @@ -174,6 +174,15 @@

Options

+
+
+ +
+
+