From 6ce7c224502fe3975c08ca1cc5859124a325bbd1 Mon Sep 17 00:00:00 2001 From: Adam Berecz Date: Mon, 17 May 2021 15:11:44 +0200 Subject: [PATCH] 1.5.0 release --- CHANGELOG.md | 14 ++++++++++++++ dist/multiselect.global.js | 2 +- dist/multiselect.js | 2 +- dist/multiselect.vue2.global.js | 2 +- dist/multiselect.vue2.js | 2 +- package.json | 2 +- themes/default.css | 2 +- 7 files changed, 20 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8ed2307..054d924 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +## v1.5.0 + +> `2021-05-17` + +### 🎉 Feature + - Added native input support [#48](https://github.com/vueform/multiselect/issues/48). + - Added `openDirection` prop [#52](https://github.com/vueform/multiselect/issues/52). + - Added `option` as second param for `select` and `deselect` events. + - Added `@clear` event [#68](https://github.com/vueform/multiselect/issues/68). + +### 🐞 Bug Fixes + - Clear icon CSS fix. + - Fixed unintendeed clear button showing up when `canDeselect` is `false` [#61](https://github.com/vueform/multiselect/issues/61). + ## v1.4.0 > `2021-04-06` diff --git a/dist/multiselect.global.js b/dist/multiselect.global.js index 2a33069..fd96a12 100644 --- a/dist/multiselect.global.js +++ b/dist/multiselect.global.js @@ -1 +1 @@ -var VueformMultiselect=function(e,t){"use strict";function l(e){return-1!==[null,void 0,!1].indexOf(e)}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function r(e){return function(e){if(Array.isArray(e))return u(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var l=Object.prototype.toString.call(e).slice(8,-1);"Object"===l&&e.constructor&&(l=e.constructor.name);if("Map"===l||"Set"===l)return Array.from(e);if("Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return u(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=new Array(t);l0&&(e=e.slice(0,v.value)),e})),H=e.computed((function(){switch(s.value){case"single":return!l(x.value[O.value]);case"multiple":case"tags":return!l(x.value)&&x.value.length>0}})),F=e.computed((function(){return void 0!==y&&void 0!==y.value?y.value(x.value):x.value&&x.value.length>1?"".concat(x.value.length," options selected"):"1 option selected"})),_=e.computed((function(){return!$.value.length&&!E.value})),W=e.computed((function(){return $.value.length>0&&0==L.value.length})),U=e.computed((function(){var e;return!1!==f.value&&P.value?-1!==ae(P.value)?[]:[(e={},a(e,O.value,P.value),a(e,h.value,P.value),a(e,d.value,P.value),e)]:[]})),z=e.computed((function(){switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),G=e.computed((function(){return b.value||E.value})),J=function(e){switch("object"!==n(e)&&(e=ne(e)),s.value){case"single":I(e);break;case"multiple":case"tags":I(x.value.concat(e))}r.emit("select",X(e))},Q=function(e){switch("object"!==n(e)&&(e=ne(e)),s.value){case"single":Z();break;case"tags":case"multiple":I(x.value.filter((function(t){return t[O.value]!=e[O.value]})))}r.emit("deselect",X(e))},X=function(e){return g.value?e:e[O.value]},Y=function(e){Q(e)},Z=function(){I(z.value)},ee=function(e){switch(s.value){case"single":return!l(x.value)&&x.value[O.value]==e[O.value];case"tags":case"multiple":return!l(x.value)&&-1!==x.value.map((function(e){return e[O.value]})).indexOf(e[O.value])}},te=function(e){return!0===e.disabled},le=function(){return!(void 0===T||-1===T.value||!H.value&&T.value>0)&&x.value.length>=T.value},ne=function(e){return $.value[$.value.map((function(e){return String(e[O.value])})).indexOf(String(e))]},ae=function(e){return $.value.map((function(e){return o(e[d.value])})).indexOf(o(e))},re=function(e){return"tags"===s.value&&p.value&&ee(e)},ue=function(e){j.value.push(e)},oe=function(){l(M.value)||(x.value=ce(M.value))},ie=function(e){E.value=!0,c.value(P.value).then((function(t){R.value=t,"function"==typeof e&&e(t),E.value=!1}))},ce=function(e){return l(e)?"single"===s.value?{}:[]:g.value?e:"single"===s.value?ne(e)||{}:e.filter((function(e){return!!ne(e)})).map((function(e){return ne(e)}))};if("single"!==s.value&&!l(M.value)&&!Array.isArray(M.value))throw new Error('v-model must be an array when using "'.concat(s.value,'" mode'));return c&&"function"==typeof c.value?S.value?ie(oe):1==g.value&&oe():(R.value=c.value,oe()),w.value>-1&&e.watch(P,(function(e){e.length[]},id:{type:[String,Number],required:!1,default:"multiselect"},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},maxHeight:{type:Number,required:!1,default:160},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:!1},appendNewTag:{type:Boolean,required:!1,default:!0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},addTagOn:{type:Array,required:!1,default:()=>["enter"]},required:{type:Boolean,required:!1,default:!1}},setup(t,n){const a=function(t,l){var n=e.toRefs(t),a=n.value,r=n.modelValue,u=n.mode,o=n.valueProp,i=e.ref("single"!==u.value?[]:{}),c=void 0!==l.expose?r:a,s=e.computed((function(){return"single"!==u.value?i.value.map((function(e){return e[o.value]})).join(","):i.value[o.value]}));return{iv:i,ev:c,textValue:s}}(t,n),u=function(t,l,n){var a=e.toRefs(t),r=a.searchable,u=(a.id,e.ref(null)),o=e.computed((function(){return r.value?-1:0}));return{multiselect:u,tabindex:o,focusInput:function(){u.value.querySelector(".multiselect-input").focus()},blurInput:function(){u.value.querySelector(".multiselect-input").blur()}}}(t),o={pointer:e.ref(null)},c=function(t,n,a){var r=e.toRefs(t),u=r.object,o=r.valueProp,i=r.mode,c=a.iv,s=function(e){return u.value||l(e)?e:Array.isArray(e)?e.map((function(e){return e[o.value]})):e[o.value]},d=function(e){return l(e)?"single"===i.value?{}:[]:e};return{update:function(e){c.value=d(e);var t=s(e);n.emit("change",t),n.emit("input",t),n.emit("update:modelValue",t)}}}(t,n,{iv:a.iv}),s=function(t,l,n){var a=e.toRefs(t),r=a.searchable,u=a.mode,o=n.iv,i=e.ref(null),c=e.ref(null),s=e.computed((function(){return i.value?"".concat(i.value.length,"ch"):"tags"===u.value&&-1===[null,void 0].indexOf(o.value)&&o.value.length?"1ch":"100%"}));return e.watch(i,(function(e){l.emit("search-change",e)})),{search:i,input:c,tagsSearchWidth:s,clearSearch:function(){i.value=""},focusSearch:function(){c.value.focus()},blurSearch:function(){r.value&&c.value.blur()}}}(t,n,{iv:a.iv}),d=function(t,l,n){var a=e.toRefs(t),r=a.maxHeight,u=a.disabled,o=a.searchable,i=n.multiselect,c=n.blurInput,s=n.blurSearch,d=n.focusInput,v=n.focusSearch,p=e.ref(!1),f=e.computed((function(){return"".concat(r.value,"px")}));return{isOpen:p,contentMaxHeight:f,openDropdown:function(){u.value||(p.value=!0,l.emit("open"))},closeDropdown:function(){p.value=!1,l.emit("close")},open:function(){o&&o.value?v():d()},close:function(){o&&o.value?s():c()},handleInputMousedown:function(e){p.value&&!o.value&&(i.value.querySelector(".multiselect-input").dispatchEvent(new Event("blur")),i.value.querySelector(".multiselect-input").blur(),e.preventDefault())}}}(t,n,{multiselect:u.multiselect,blurInput:u.blurInput,blurSearch:s.blurSearch,focusInput:u.focusInput,focusSearch:s.focusSearch}),v=i(t,n,{ev:a.ev,iv:a.iv,search:s.search,blurSearch:s.blurSearch,clearSearch:s.clearSearch,update:c.update,blurInput:u.blurInput,pointer:o.pointer}),p=function(t,l,n){var a=e.toRefs(t),r=a.id,u=a.valueProp,o=n.fo,i=n.handleOptionClick,c=n.search,s=n.pointer,d=e.computed((function(){return o.value.filter((function(e){return!0!==e.disabled}))})),v=function(e){s.value=e},p=function(){s.value=d.value[0]||null},f=function(){s.value=null},h=function(){var e=document.getElementById(r.value).querySelector(".is-pointed");if(e){var t=e.parentElement;e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{}),["prevent"]),["enter"])),ref:"multiselect"},[t.createVNode("div",{class:"multiselect-input",tabindex:e.tabindex,onMousedown:l[20]||(l[20]=(...t)=>e.handleInputMousedown&&e.handleInputMousedown(...t)),onFocus:l[21]||(l[21]=(...t)=>e.openDropdown&&e.openDropdown(...t)),onBlur:l[22]||(l[22]=(...t)=>e.closeDropdown&&e.closeDropdown(...t)),onKeyup:[l[23]||(l[23]=t.withKeys(((...t)=>e.handleEsc&&e.handleEsc(...t)),["esc"])),l[24]||(l[24]=t.withKeys(((...t)=>e.selectPointer&&e.selectPointer(...t)),["enter"]))],onKeydown:[l[25]||(l[25]=t.withKeys(t.withModifiers(((...t)=>e.handleBackspace&&e.handleBackspace(...t)),["prevent"]),["delete"])),l[26]||(l[26]=t.withKeys(t.withModifiers(((...t)=>e.backwardPointer&&e.backwardPointer(...t)),["prevent"]),["up"])),l[27]||(l[27]=t.withKeys(t.withModifiers(((...t)=>e.forwardPointer&&e.forwardPointer(...t)),["prevent"]),["down"]))]},[t.createCommentVNode(" Single label "),"single"==n.mode&&e.hasSelected&&!e.search&&e.iv?t.renderSlot(e.$slots,"singlelabel",{key:0,value:e.iv},(()=>[t.createVNode("div",s,t.toDisplayString(e.iv[n.label]),1)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Multiple label "),"multiple"==n.mode&&e.hasSelected&&!e.search?t.renderSlot(e.$slots,"multiplelabel",{key:1,values:e.iv},(()=>[t.createVNode("div",d,t.toDisplayString(e.multipleLabelText),1)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Search "),"tags"!==n.mode&&n.searchable&&!n.disabled?(t.openBlock(),t.createBlock("div",v,[t.createVNode("input",{modelValue:e.search,value:e.search,onFocus:l[1]||(l[1]=t.withModifiers(((...t)=>e.openDropdown&&e.openDropdown(...t)),["stop"])),onBlur:l[2]||(l[2]=t.withModifiers(((...t)=>e.closeDropdown&&e.closeDropdown(...t)),["stop"])),onKeyup:[l[3]||(l[3]=t.withKeys(t.withModifiers(((...t)=>e.handleEsc&&e.handleEsc(...t)),["stop"]),["esc"])),l[4]||(l[4]=t.withKeys(t.withModifiers(((...t)=>e.selectPointer&&e.selectPointer(...t)),["stop"]),["enter"]))],onKeydown:[l[5]||(l[5]=t.withKeys(((...t)=>e.handleSearchBackspace&&e.handleSearchBackspace(...t)),["delete"])),l[6]||(l[6]=t.withKeys(t.withModifiers(((...t)=>e.backwardPointer&&e.backwardPointer(...t)),["stop"]),["up"])),l[7]||(l[7]=t.withKeys(t.withModifiers(((...t)=>e.forwardPointer&&e.forwardPointer(...t)),["stop"]),["down"]))],onInput:l[8]||(l[8]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),ref:"input"},null,40,["modelValue","value"])])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Tags (with search) "),"tags"==n.mode?(t.openBlock(),t.createBlock("div",p,[(t.openBlock(!0),t.createBlock(t.Fragment,null,t.renderList(e.iv,((a,r,u)=>(t.openBlock(),t.createBlock("span",{key:u},[t.renderSlot(e.$slots,"tag",{option:a,handleTagRemove:e.handleTagRemove,disabled:n.disabled},(()=>[t.createVNode("div",f,[t.createTextVNode(t.toDisplayString(a[n.label])+" ",1),n.disabled?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createBlock("i",{key:0,onClick:l[9]||(l[9]=t.withModifiers((()=>{}),["prevent"])),onMousedown:t.withModifiers((t=>e.handleTagRemove(a,t)),["prevent","stop"])},null,40,["onMousedown"]))])]))])))),128)),n.searchable&&!n.disabled?(t.openBlock(),t.createBlock("div",{key:0,class:"multiselect-search",style:{width:e.tagsSearchWidth}},[t.createVNode("input",{modelValue:e.search,value:e.search,onFocus:l[10]||(l[10]=t.withModifiers(((...t)=>e.openDropdown&&e.openDropdown(...t)),["stop"])),onBlur:l[11]||(l[11]=t.withModifiers(((...t)=>e.closeDropdown&&e.closeDropdown(...t)),["stop"])),onKeyup:[l[12]||(l[12]=t.withKeys(t.withModifiers(((...t)=>e.handleEsc&&e.handleEsc(...t)),["stop"]),["esc"])),l[13]||(l[13]=t.withKeys(t.withModifiers(((...t)=>e.handleAddTag&&e.handleAddTag(...t)),["stop"]),["enter"])),l[14]||(l[14]=t.withKeys(t.withModifiers(((...t)=>e.handleAddTag&&e.handleAddTag(...t)),["stop"]),["space"]))],onKeydown:[l[15]||(l[15]=t.withKeys(((...t)=>e.handleSearchBackspace&&e.handleSearchBackspace(...t)),["delete"])),l[16]||(l[16]=t.withKeys(t.withModifiers(((...t)=>e.backwardPointer&&e.backwardPointer(...t)),["stop"]),["up"])),l[17]||(l[17]=t.withKeys(t.withModifiers(((...t)=>e.forwardPointer&&e.forwardPointer(...t)),["stop"]),["down"]))],onInput:l[18]||(l[18]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),style:{width:e.tagsSearchWidth},ref:"input"},null,44,["modelValue","value"])],4)):t.createCommentVNode("v-if",!0)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Placeholder "),!n.placeholder||e.hasSelected||e.search?t.createCommentVNode("v-if",!0):t.renderSlot(e.$slots,"placeholder",{key:4},(()=>[t.createVNode("div",h,t.toDisplayString(n.placeholder),1)])),n.caret&&!e.busy?t.renderSlot(e.$slots,"caret",{key:5},(()=>[m])):t.createCommentVNode("v-if",!0),t.createVNode(t.Transition,{name:"multiselect-loading"},{default:t.withCtx((()=>[e.busy?(t.openBlock(),t.createBlock("span",y,[t.renderSlot(e.$slots,"spinner",{},(()=>[g]))])):t.createCommentVNode("v-if",!0)])),_:1}),e.hasSelected&&!n.disabled?t.renderSlot(e.$slots,"clear",{key:6,clear:e.clear},(()=>[t.createVNode("a",{class:"multiselect-clear",onClick:l[19]||(l[19]=t.withModifiers(((...t)=>e.clear&&e.clear(...t)),["prevent"]))})])):t.createCommentVNode("v-if",!0)],40,["tabindex"]),t.createCommentVNode(" Options "),e.resolving&&n.clearOnSearch?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createBlock(t.Transition,{key:0,name:"multiselect",onAfterLeave:e.clearSearch},{default:t.withCtx((()=>[t.withDirectives(t.createVNode("div",{class:"multiselect-options",style:{maxHeight:e.contentMaxHeight}},[t.renderSlot(e.$slots,"beforelist"),(t.openBlock(!0),t.createBlock(t.Fragment,null,t.renderList(e.fo,((a,r,u)=>(t.openBlock(),t.createBlock("span",{tabindex:-1,class:["multiselect-option",{"is-pointed":e.isPointed(a),"is-selected":e.isSelected(a),"is-disabled":e.isDisabled(a)}],key:u,onMousedown:l[28]||(l[28]=t.withModifiers((()=>{}),["prevent"])),onMouseenter:t=>e.setPointer(a),onClick:t.withModifiers((t=>e.handleOptionClick(a)),["stop","prevent"])},[t.renderSlot(e.$slots,"option",{option:a,search:e.search},(()=>[t.createVNode("span",null,t.toDisplayString(a[n.label]),1)]))],42,["onMouseenter","onClick"])))),128)),t.withDirectives(t.createVNode("span",null,[t.renderSlot(e.$slots,"nooptions",{},(()=>[t.createVNode("div",b,t.toDisplayString(n.noOptionsText),1)]))],512),[[t.vShow,e.noOptions]]),t.withDirectives(t.createVNode("span",null,[t.renderSlot(e.$slots,"noresults",{},(()=>[t.createVNode("div",w,t.toDisplayString(n.noResultsText),1)]))],512),[[t.vShow,e.noResults]]),t.renderSlot(e.$slots,"afterlist")],4),[[t.vShow,e.isOpen&&n.showOptions]])])),_:3},8,["onAfterLeave"])),t.createCommentVNode(" Hacky input element to show HTML5 required warning "),n.required?(t.openBlock(),t.createBlock("input",{key:1,class:"multiselect-fake-input",tabindex:"-1",value:e.textValue,required:""},null,8,["value"])):t.createCommentVNode("v-if",!0)],42,["id"])},c.__file="src/Multiselect.vue",c}(Vue,Vue); +var VueformMultiselect=function(e,t){"use strict";function l(e){return-1!==[null,void 0,!1].indexOf(e)}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,l){return t in e?Object.defineProperty(e,t,{value:l,enumerable:!0,configurable:!0,writable:!0}):e[t]=l,e}function o(e){return function(e){if(Array.isArray(e))return r(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var l=Object.prototype.toString.call(e).slice(8,-1);"Object"===l&&e.constructor&&(l=e.constructor.name);if("Map"===l||"Set"===l)return Array.from(e);if("Arguments"===l||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return r(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var l=0,n=new Array(t);l0&&(e=e.slice(0,v.value)),e})),H=e.computed((function(){switch(s.value){case"single":return!l(D.value[O.value]);case"multiple":case"tags":return!l(D.value)&&D.value.length>0}})),F=e.computed((function(){return void 0!==y&&void 0!==y.value?y.value(D.value):D.value&&D.value.length>1?"".concat(D.value.length," options selected"):"1 option selected"})),_=e.computed((function(){return!E.value.length&&!$.value})),W=e.computed((function(){return E.value.length>0&&0==L.value.length})),U=e.computed((function(){var e;return!1!==f.value&&M.value?-1!==ae(M.value)?[]:[(e={},a(e,O.value,M.value),a(e,h.value,M.value),a(e,d.value,M.value),e)]:[]})),z=e.computed((function(){switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),G=e.computed((function(){return b.value||$.value})),J=function(e){switch("object"!==n(e)&&(e=ne(e)),s.value){case"single":I(e);break;case"multiple":case"tags":I(D.value.concat(e))}o.emit("select",X(e),e)},Q=function(e){switch("object"!==n(e)&&(e=ne(e)),s.value){case"single":Z();break;case"tags":case"multiple":I(D.value.filter((function(t){return t[O.value]!=e[O.value]})))}o.emit("deselect",X(e),e)},X=function(e){return g.value?e:e[O.value]},Y=function(e){Q(e)},Z=function(){o.emit("clear"),I(z.value)},ee=function(e){switch(s.value){case"single":return!l(D.value)&&D.value[O.value]==e[O.value];case"tags":case"multiple":return!l(D.value)&&-1!==D.value.map((function(e){return e[O.value]})).indexOf(e[O.value])}},te=function(e){return!0===e.disabled},le=function(){return!(void 0===x||-1===x.value||!H.value&&x.value>0)&&D.value.length>=x.value},ne=function(e){return E.value[E.value.map((function(e){return String(e[O.value])})).indexOf(String(e))]},ae=function(e){return E.value.map((function(e){return u(e[d.value])})).indexOf(u(e))},oe=function(e){return"tags"===s.value&&p.value&&ee(e)},re=function(e){j.value.push(e)},ue=function(){l(T.value)||(D.value=ce(T.value))},ie=function(e){$.value=!0,c.value(M.value).then((function(t){R.value=t,"function"==typeof e&&e(t),$.value=!1}))},ce=function(e){return l(e)?"single"===s.value?{}:[]:g.value?e:"single"===s.value?ne(e)||{}:e.filter((function(e){return!!ne(e)})).map((function(e){return ne(e)}))};if("single"!==s.value&&!l(T.value)&&!Array.isArray(T.value))throw new Error('v-model must be an array when using "'.concat(s.value,'" mode'));return c&&"function"==typeof c.value?S.value?ie(ue):1==g.value&&ue():(R.value=c.value,ue()),w.value>-1&&e.watch(M,(function(e){e.length[]},id:{type:[String,Number],required:!1,default:"multiselect"},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},maxHeight:{type:Number,required:!1,default:160},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:!1},appendNewTag:{type:Boolean,required:!1,default:!0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},addTagOn:{type:Array,required:!1,default:()=>["enter"]},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1}},setup(t,n){const a=function(t,l){var n=e.toRefs(t),a=n.value,o=n.modelValue,r=n.mode,u=n.valueProp,i=e.ref("single"!==r.value?[]:{}),c=void 0!==l.expose?o:a,s=e.computed((function(){return"single"===r.value?i.value[u.value]:i.value.map((function(e){return e[u.value]}))})),d=e.computed((function(){return"single"!==r.value?i.value.map((function(e){return e[u.value]})).join(","):i.value[u.value]}));return{iv:i,internalValue:i,ev:c,externalValue:c,textValue:d,plainValue:s}}(t,n),r=function(t,l,n){var a=e.toRefs(t),o=a.searchable,r=(a.id,e.ref(null)),u=e.computed((function(){return o.value?-1:0}));return{multiselect:r,tabindex:u,focusInput:function(){r.value.querySelector(".multiselect-input").focus()},blurInput:function(){r.value.querySelector(".multiselect-input").blur()}}}(t),u={pointer:e.ref(null)},c=function(t,n,a){var o=e.toRefs(t),r=o.object,u=o.valueProp,i=o.mode,c=a.iv,s=function(e){return r.value||l(e)?e:Array.isArray(e)?e.map((function(e){return e[u.value]})):e[u.value]},d=function(e){return l(e)?"single"===i.value?{}:[]:e};return{update:function(e){c.value=d(e);var t=s(e);n.emit("change",t),n.emit("input",t),n.emit("update:modelValue",t)}}}(t,n,{iv:a.iv}),s=function(t,l,n){var a=e.toRefs(t),o=a.searchable,r=a.mode,u=n.iv,i=e.ref(null),c=e.ref(null),s=e.computed((function(){return i.value?"".concat(i.value.length,"ch"):"tags"===r.value&&-1===[null,void 0].indexOf(u.value)&&u.value.length?"1ch":"100%"}));return e.watch(i,(function(e){l.emit("search-change",e)})),{search:i,input:c,tagsSearchWidth:s,clearSearch:function(){i.value=""},focusSearch:function(){c.value.focus()},blurSearch:function(){o.value&&c.value.blur()}}}(t,n,{iv:a.iv}),d=function(t,l,n){var a=e.toRefs(t),o=a.maxHeight,r=a.disabled,u=a.searchable,i=n.multiselect,c=n.blurInput,s=n.blurSearch,d=n.focusInput,v=n.focusSearch,p=e.ref(!1),f=e.computed((function(){return"".concat(o.value,"px")}));return{isOpen:p,contentMaxHeight:f,openDropdown:function(){r.value||(p.value=!0,l.emit("open"))},closeDropdown:function(){p.value=!1,l.emit("close")},open:function(){u&&u.value?v():d()},close:function(){u&&u.value?s():c()},handleInputMousedown:function(e){p.value&&!u.value&&(i.value.querySelector(".multiselect-input").dispatchEvent(new Event("blur")),i.value.querySelector(".multiselect-input").blur(),e.preventDefault())}}}(t,n,{multiselect:r.multiselect,blurInput:r.blurInput,blurSearch:s.blurSearch,focusInput:r.focusInput,focusSearch:s.focusSearch}),v=i(t,n,{ev:a.ev,iv:a.iv,search:s.search,blurSearch:s.blurSearch,clearSearch:s.clearSearch,update:c.update,blurInput:r.blurInput,pointer:u.pointer}),p=function(t,l,n){var a=e.toRefs(t),o=a.id,r=a.valueProp,u=n.fo,i=n.handleOptionClick,c=n.search,s=n.pointer,d=e.computed((function(){return u.value.filter((function(e){return!0!==e.disabled}))})),v=function(e){s.value=e},p=function(){s.value=d.value[0]||null},f=function(){s.value=null},h=function(){var e=document.getElementById(o.value).querySelector(".is-pointed");if(e){var t=e.parentElement;e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop{}),["prevent"]),["enter"])),ref:"multiselect"},[t.createVNode("div",{class:"multiselect-input",tabindex:e.tabindex,onMousedown:l[20]||(l[20]=(...t)=>e.handleInputMousedown&&e.handleInputMousedown(...t)),onFocus:l[21]||(l[21]=(...t)=>e.openDropdown&&e.openDropdown(...t)),onBlur:l[22]||(l[22]=(...t)=>e.closeDropdown&&e.closeDropdown(...t)),onKeyup:[l[23]||(l[23]=t.withKeys(((...t)=>e.handleEsc&&e.handleEsc(...t)),["esc"])),l[24]||(l[24]=t.withKeys(((...t)=>e.selectPointer&&e.selectPointer(...t)),["enter"]))],onKeydown:[l[25]||(l[25]=t.withKeys(t.withModifiers(((...t)=>e.handleBackspace&&e.handleBackspace(...t)),["prevent"]),["delete"])),l[26]||(l[26]=t.withKeys(t.withModifiers((t=>"top"===n.openDirection?e.forwardPointer():e.backwardPointer()),["prevent"]),["up"])),l[27]||(l[27]=t.withKeys(t.withModifiers((t=>"top"===n.openDirection?e.backwardPointer():e.forwardPointer()),["prevent"]),["down"]))]},[t.createCommentVNode(" Single label "),"single"==n.mode&&e.hasSelected&&!e.search&&e.iv?t.renderSlot(e.$slots,"singlelabel",{key:0,value:e.iv},(()=>[t.createVNode("div",s,t.toDisplayString(e.iv[n.label]),1)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Multiple label "),"multiple"==n.mode&&e.hasSelected&&!e.search?t.renderSlot(e.$slots,"multiplelabel",{key:1,values:e.iv},(()=>[t.createVNode("div",d,t.toDisplayString(e.multipleLabelText),1)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Search "),"tags"!==n.mode&&n.searchable&&!n.disabled?(t.openBlock(),t.createBlock("div",v,[t.createVNode("input",{modelValue:e.search,value:e.search,onFocus:l[1]||(l[1]=t.withModifiers(((...t)=>e.openDropdown&&e.openDropdown(...t)),["stop"])),onBlur:l[2]||(l[2]=t.withModifiers(((...t)=>e.closeDropdown&&e.closeDropdown(...t)),["stop"])),onKeyup:[l[3]||(l[3]=t.withKeys(t.withModifiers(((...t)=>e.handleEsc&&e.handleEsc(...t)),["stop"]),["esc"])),l[4]||(l[4]=t.withKeys(t.withModifiers(((...t)=>e.selectPointer&&e.selectPointer(...t)),["stop"]),["enter"]))],onKeydown:[l[5]||(l[5]=t.withKeys(((...t)=>e.handleSearchBackspace&&e.handleSearchBackspace(...t)),["delete"])),l[6]||(l[6]=t.withKeys(t.withModifiers((t=>"top"===n.openDirection?e.forwardPointer():e.backwardPointer()),["stop"]),["up"])),l[7]||(l[7]=t.withKeys(t.withModifiers((t=>"top"===n.openDirection?e.backwardPointer():e.forwardPointer()),["stop"]),["down"]))],onInput:l[8]||(l[8]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),ref:"input"},null,40,["modelValue","value"])])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Tags (with search) "),"tags"==n.mode?(t.openBlock(),t.createBlock("div",p,[(t.openBlock(!0),t.createBlock(t.Fragment,null,t.renderList(e.iv,((a,o,r)=>(t.openBlock(),t.createBlock("span",{key:r},[t.renderSlot(e.$slots,"tag",{option:a,handleTagRemove:e.handleTagRemove,disabled:n.disabled},(()=>[t.createVNode("div",f,[t.createTextVNode(t.toDisplayString(a[n.label])+" ",1),n.disabled?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createBlock("i",{key:0,onClick:l[9]||(l[9]=t.withModifiers((()=>{}),["prevent"])),onMousedown:t.withModifiers((t=>e.handleTagRemove(a,t)),["prevent","stop"])},null,40,["onMousedown"]))])]))])))),128)),n.searchable&&!n.disabled?(t.openBlock(),t.createBlock("div",{key:0,class:"multiselect-search",style:{width:e.tagsSearchWidth}},[t.createVNode("input",{modelValue:e.search,value:e.search,onFocus:l[10]||(l[10]=t.withModifiers(((...t)=>e.openDropdown&&e.openDropdown(...t)),["stop"])),onBlur:l[11]||(l[11]=t.withModifiers(((...t)=>e.closeDropdown&&e.closeDropdown(...t)),["stop"])),onKeyup:[l[12]||(l[12]=t.withKeys(t.withModifiers(((...t)=>e.handleEsc&&e.handleEsc(...t)),["stop"]),["esc"])),l[13]||(l[13]=t.withKeys(t.withModifiers(((...t)=>e.handleAddTag&&e.handleAddTag(...t)),["stop"]),["enter"])),l[14]||(l[14]=t.withKeys(t.withModifiers(((...t)=>e.handleAddTag&&e.handleAddTag(...t)),["stop"]),["space"]))],onKeydown:[l[15]||(l[15]=t.withKeys(((...t)=>e.handleSearchBackspace&&e.handleSearchBackspace(...t)),["delete"])),l[16]||(l[16]=t.withKeys(t.withModifiers((t=>"top"===n.openDirection?e.forwardPointer():e.backwardPointer()),["stop"]),["up"])),l[17]||(l[17]=t.withKeys(t.withModifiers((t=>"top"===n.openDirection?e.backwardPointer():e.forwardPointer()),["stop"]),["down"]))],onInput:l[18]||(l[18]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),style:{width:e.tagsSearchWidth},ref:"input"},null,44,["modelValue","value"])],4)):t.createCommentVNode("v-if",!0)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Placeholder "),!n.placeholder||e.hasSelected||e.search?t.createCommentVNode("v-if",!0):t.renderSlot(e.$slots,"placeholder",{key:4},(()=>[t.createVNode("div",h,t.toDisplayString(n.placeholder),1)])),e.hasSelected||!n.caret||e.busy?t.createCommentVNode("v-if",!0):t.renderSlot(e.$slots,"caret",{key:5},(()=>[m])),e.hasSelected&&!n.disabled&&!e.busy&&n.canDeselect?t.renderSlot(e.$slots,"clear",{key:6,clear:e.clear},(()=>[t.createVNode("a",{class:"multiselect-clear",onClick:l[19]||(l[19]=t.withModifiers(((...t)=>e.clear&&e.clear(...t)),["prevent"]))})])):t.createCommentVNode("v-if",!0),t.createVNode(t.Transition,{name:"multiselect-loading"},{default:t.withCtx((()=>[e.busy?(t.openBlock(),t.createBlock("span",y,[t.renderSlot(e.$slots,"spinner",{},(()=>[g]))])):t.createCommentVNode("v-if",!0)])),_:1})],40,["tabindex"]),t.createCommentVNode(" Options "),e.resolving&&n.clearOnSearch?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createBlock(t.Transition,{key:0,name:"multiselect",onAfterLeave:e.clearSearch},{default:t.withCtx((()=>[t.withDirectives(t.createVNode("div",{class:"multiselect-options",style:{maxHeight:e.contentMaxHeight}},[t.renderSlot(e.$slots,"beforelist"),(t.openBlock(!0),t.createBlock(t.Fragment,null,t.renderList(e.fo,((a,o,r)=>(t.openBlock(),t.createBlock("span",{tabindex:-1,class:["multiselect-option",{"is-pointed":e.isPointed(a),"is-selected":e.isSelected(a),"is-disabled":e.isDisabled(a)}],key:r,onMousedown:l[28]||(l[28]=t.withModifiers((()=>{}),["prevent"])),onMouseenter:t=>e.setPointer(a),onClick:t.withModifiers((t=>e.handleOptionClick(a)),["stop","prevent"])},[t.renderSlot(e.$slots,"option",{option:a,search:e.search},(()=>[t.createVNode("span",null,t.toDisplayString(a[n.label]),1)]))],42,["onMouseenter","onClick"])))),128)),t.withDirectives(t.createVNode("span",null,[t.renderSlot(e.$slots,"nooptions",{},(()=>[t.createVNode("div",b,t.toDisplayString(n.noOptionsText),1)]))],512),[[t.vShow,e.noOptions]]),t.withDirectives(t.createVNode("span",null,[t.renderSlot(e.$slots,"noresults",{},(()=>[t.createVNode("div",w,t.toDisplayString(n.noResultsText),1)]))],512),[[t.vShow,e.noResults]]),t.renderSlot(e.$slots,"afterlist")],4),[[t.vShow,e.isOpen&&n.showOptions]])])),_:3},8,["onAfterLeave"])),t.createCommentVNode(" Hacky input element to show HTML5 required warning "),n.required?(t.openBlock(),t.createBlock("input",{key:1,class:"multiselect-fake-input",tabindex:"-1",value:e.textValue,required:""},null,8,["value"])):t.createCommentVNode("v-if",!0),n.nativeSupport?(t.openBlock(),t.createBlock(t.Fragment,{key:2},["single"==n.mode?(t.openBlock(),t.createBlock("input",{key:0,type:"hidden",name:n.name,value:void 0!==e.plainValue?e.plainValue:""},null,8,["name","value"])):(t.openBlock(!0),t.createBlock(t.Fragment,{key:1},t.renderList(e.plainValue,((e,l)=>(t.openBlock(),t.createBlock("input",{type:"hidden",name:`${n.name}[]`,value:e,key:l},null,8,["name","value"])))),128))],64)):t.createCommentVNode("v-if",!0)],42,["id"])},c.__file="src/Multiselect.vue",c}(Vue,Vue); diff --git a/dist/multiselect.js b/dist/multiselect.js index 7b833f9..05d506d 100644 --- a/dist/multiselect.js +++ b/dist/multiselect.js @@ -1 +1 @@ -import{toRefs as e,ref as l,computed as t,watch as n,nextTick as a,openBlock as u,createBlock as r,withKeys as o,withModifiers as i,createVNode as c,createCommentVNode as s,renderSlot as v,toDisplayString as d,Fragment as p,renderList as f,createTextVNode as h,Transition as m,withCtx as b,withDirectives as g,vShow as y}from"vue";function S(e){return-1!==[null,void 0,!1].indexOf(e)}function w(e){return String(e).toLowerCase().trim()}function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,l,t){return l in e?Object.defineProperty(e,l,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[l]=t,e}function q(a,u,r){var o=e(a),i=o.options,c=o.mode,s=o.trackBy,v=o.limit,d=o.hideSelected,p=o.createTag,f=o.label,h=o.appendNewTag,m=o.multipleLabel,b=o.object,g=o.loading,y=o.delay,q=o.resolveOnLoad,P=o.minChars,x=o.filterResults,T=o.clearOnSearch,B=o.clearOnSelect,I=o.valueProp,D=o.canDeselect,A=o.max,j=r.iv,M=r.ev,C=r.search,E=r.blurSearch,$=r.clearSearch,H=r.update,L=r.blurInput,N=r.pointer,R=l([]),V=l([]),K=l(!1),F=t((function(){var e,l=V.value||[];return e=l,"[object Object]"===Object.prototype.toString.call(e)&&(l=Object.keys(l).map((function(e){var t,n=l[e];return O(t={},I.value,e),O(t,s.value,n),O(t,f.value,n),t}))),l=l.map((function(e,l){var t;return"object"===k(e)?e:(O(t={},I.value,e),O(t,s.value,e),O(t,f.value,e),t)})),R.value.length&&(l=l.concat(R.value)),l})),_=t((function(){var e=F.value;return J.value.length&&(e=J.value.concat(e)),C.value&&x.value&&(e=e.filter((function(e){return-1!==w(e[s.value]).indexOf(w(C.value))}))),d.value&&(e=e.filter((function(e){return!ie(e)}))),v.value>0&&(e=e.slice(0,v.value)),e})),W=t((function(){switch(c.value){case"single":return!S(j.value[I.value]);case"multiple":case"tags":return!S(j.value)&&j.value.length>0}})),U=t((function(){return void 0!==m&&void 0!==m.value?m.value(j.value):j.value&&j.value.length>1?"".concat(j.value.length," options selected"):"1 option selected"})),z=t((function(){return!F.value.length&&!K.value})),G=t((function(){return F.value.length>0&&0==_.value.length})),J=t((function(){var e;return!1!==p.value&&C.value?-1!==oe(C.value)?[]:[(e={},O(e,I.value,C.value),O(e,f.value,C.value),O(e,s.value,C.value),e)]:[]})),Q=t((function(){switch(c.value){case"single":return null;case"multiple":case"tags":return[]}})),X=t((function(){return g.value||K.value})),Y=function(e){switch("object"!==k(e)&&(e=re(e)),c.value){case"single":H(e);break;case"multiple":case"tags":H(j.value.concat(e))}u.emit("select",ee(e))},Z=function(e){switch("object"!==k(e)&&(e=re(e)),c.value){case"single":te();break;case"tags":case"multiple":H(j.value.filter((function(l){return l[I.value]!=e[I.value]})))}u.emit("deselect",ee(e))},ee=function(e){return b.value?e:e[I.value]},le=function(e){Z(e)},te=function(){H(Q.value)},ne=function(e){switch(c.value){case"single":return!S(j.value)&&j.value[I.value]==e[I.value];case"tags":case"multiple":return!S(j.value)&&-1!==j.value.map((function(e){return e[I.value]})).indexOf(e[I.value])}},ae=function(e){return!0===e.disabled},ue=function(){return!(void 0===A||-1===A.value||!W.value&&A.value>0)&&j.value.length>=A.value},re=function(e){return F.value[F.value.map((function(e){return String(e[I.value])})).indexOf(String(e))]},oe=function(e){return F.value.map((function(e){return w(e[s.value])})).indexOf(w(e))},ie=function(e){return"tags"===c.value&&d.value&&ne(e)},ce=function(e){R.value.push(e)},se=function(){S(M.value)||(j.value=de(M.value))},ve=function(e){K.value=!0,i.value(C.value).then((function(l){V.value=l,"function"==typeof e&&e(l),K.value=!1}))},de=function(e){return S(e)?"single"===c.value?{}:[]:b.value?e:"single"===c.value?re(e)||{}:e.filter((function(e){return!!re(e)})).map((function(e){return re(e)}))};if("single"!==c.value&&!S(M.value)&&!Array.isArray(M.value))throw new Error('v-model must be an array when using "'.concat(c.value,'" mode'));return i&&"function"==typeof i.value?q.value?ve(se):1==b.value&&se():(V.value=i.value,se()),y.value>-1&&n(C,(function(e){e.lengthe.length)&&(l=e.length);for(var t=0,n=new Array(l);t[]},id:{type:[String,Number],required:!1,default:"multiselect"},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},maxHeight:{type:Number,required:!1,default:160},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:!1},appendNewTag:{type:Boolean,required:!1,default:!0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},addTagOn:{type:Array,required:!1,default:()=>["enter"]},required:{type:Boolean,required:!1,default:!1}},setup(u,r){const o=function(n,a){var u=e(n),r=u.value,o=u.modelValue,i=u.mode,c=u.valueProp,s=l("single"!==i.value?[]:{}),v=void 0!==a.expose?o:r,d=t((function(){return"single"!==i.value?s.value.map((function(e){return e[c.value]})).join(","):s.value[c.value]}));return{iv:s,ev:v,textValue:d}}(u,r),i=function(n,a,u){var r=e(n),o=r.searchable,i=(r.id,l(null)),c=t((function(){return o.value?-1:0}));return{multiselect:i,tabindex:c,focusInput:function(){i.value.querySelector(".multiselect-input").focus()},blurInput:function(){i.value.querySelector(".multiselect-input").blur()}}}(u),c={pointer:l(null)},s=function(l,t,n){var a=e(l),u=a.object,r=a.valueProp,o=a.mode,i=n.iv,c=function(e){return u.value||S(e)?e:Array.isArray(e)?e.map((function(e){return e[r.value]})):e[r.value]},s=function(e){return S(e)?"single"===o.value?{}:[]:e};return{update:function(e){i.value=s(e);var l=c(e);t.emit("change",l),t.emit("input",l),t.emit("update:modelValue",l)}}}(u,r,{iv:o.iv}),v=function(a,u,r){var o=e(a),i=o.searchable,c=o.mode,s=r.iv,v=l(null),d=l(null),p=t((function(){return v.value?"".concat(v.value.length,"ch"):"tags"===c.value&&-1===[null,void 0].indexOf(s.value)&&s.value.length?"1ch":"100%"}));return n(v,(function(e){u.emit("search-change",e)})),{search:v,input:d,tagsSearchWidth:p,clearSearch:function(){v.value=""},focusSearch:function(){d.value.focus()},blurSearch:function(){i.value&&d.value.blur()}}}(u,r,{iv:o.iv}),d=function(n,a,u){var r=e(n),o=r.maxHeight,i=r.disabled,c=r.searchable,s=u.multiselect,v=u.blurInput,d=u.blurSearch,p=u.focusInput,f=u.focusSearch,h=l(!1),m=t((function(){return"".concat(o.value,"px")}));return{isOpen:h,contentMaxHeight:m,openDropdown:function(){i.value||(h.value=!0,a.emit("open"))},closeDropdown:function(){h.value=!1,a.emit("close")},open:function(){c&&c.value?f():p()},close:function(){c&&c.value?d():v()},handleInputMousedown:function(e){h.value&&!c.value&&(s.value.querySelector(".multiselect-input").dispatchEvent(new Event("blur")),s.value.querySelector(".multiselect-input").blur(),e.preventDefault())}}}(u,r,{multiselect:i.multiselect,blurInput:i.blurInput,blurSearch:v.blurSearch,focusInput:i.focusInput,focusSearch:v.focusSearch}),p=q(u,r,{ev:o.ev,iv:o.iv,search:v.search,blurSearch:v.blurSearch,clearSearch:v.clearSearch,update:s.update,blurInput:i.blurInput,pointer:c.pointer}),f=function(l,u,r){var o=e(l),i=o.id,c=o.valueProp,s=r.fo,v=r.handleOptionClick,d=r.search,p=r.pointer,f=t((function(){return s.value.filter((function(e){return!0!==e.disabled}))})),h=function(e){p.value=e},m=function(){p.value=f.value[0]||null},b=function(){p.value=null},g=function(){var e=document.getElementById(i.value).querySelector(".is-pointed");if(e){var l=e.parentElement;e.offsetTop+e.offsetHeight>l.clientHeight+l.scrollTop&&(l.scrollTop=e.offsetTop+e.offsetHeight-l.clientHeight),e.offsetTop{}),["prevent"]),["enter"])),ref:"multiselect"},[c("div",{class:"multiselect-input",tabindex:e.tabindex,onMousedown:l[20]||(l[20]=(...l)=>e.handleInputMousedown&&e.handleInputMousedown(...l)),onFocus:l[21]||(l[21]=(...l)=>e.openDropdown&&e.openDropdown(...l)),onBlur:l[22]||(l[22]=(...l)=>e.closeDropdown&&e.closeDropdown(...l)),onKeyup:[l[23]||(l[23]=o(((...l)=>e.handleEsc&&e.handleEsc(...l)),["esc"])),l[24]||(l[24]=o(((...l)=>e.selectPointer&&e.selectPointer(...l)),["enter"]))],onKeydown:[l[25]||(l[25]=o(i(((...l)=>e.handleBackspace&&e.handleBackspace(...l)),["prevent"]),["delete"])),l[26]||(l[26]=o(i(((...l)=>e.backwardPointer&&e.backwardPointer(...l)),["prevent"]),["up"])),l[27]||(l[27]=o(i(((...l)=>e.forwardPointer&&e.forwardPointer(...l)),["prevent"]),["down"]))]},[s(" Single label "),"single"==t.mode&&e.hasSelected&&!e.search&&e.iv?v(e.$slots,"singlelabel",{key:0,value:e.iv},(()=>[c("div",B,d(e.iv[t.label]),1)])):s("v-if",!0),s(" Multiple label "),"multiple"==t.mode&&e.hasSelected&&!e.search?v(e.$slots,"multiplelabel",{key:1,values:e.iv},(()=>[c("div",I,d(e.multipleLabelText),1)])):s("v-if",!0),s(" Search "),"tags"!==t.mode&&t.searchable&&!t.disabled?(u(),r("div",D,[c("input",{modelValue:e.search,value:e.search,onFocus:l[1]||(l[1]=i(((...l)=>e.openDropdown&&e.openDropdown(...l)),["stop"])),onBlur:l[2]||(l[2]=i(((...l)=>e.closeDropdown&&e.closeDropdown(...l)),["stop"])),onKeyup:[l[3]||(l[3]=o(i(((...l)=>e.handleEsc&&e.handleEsc(...l)),["stop"]),["esc"])),l[4]||(l[4]=o(i(((...l)=>e.selectPointer&&e.selectPointer(...l)),["stop"]),["enter"]))],onKeydown:[l[5]||(l[5]=o(((...l)=>e.handleSearchBackspace&&e.handleSearchBackspace(...l)),["delete"])),l[6]||(l[6]=o(i(((...l)=>e.backwardPointer&&e.backwardPointer(...l)),["stop"]),["up"])),l[7]||(l[7]=o(i(((...l)=>e.forwardPointer&&e.forwardPointer(...l)),["stop"]),["down"]))],onInput:l[8]||(l[8]=(...l)=>e.handleSearchInput&&e.handleSearchInput(...l)),ref:"input"},null,40,["modelValue","value"])])):s("v-if",!0),s(" Tags (with search) "),"tags"==t.mode?(u(),r("div",A,[(u(!0),r(p,null,f(e.iv,((n,a,o)=>(u(),r("span",{key:o},[v(e.$slots,"tag",{option:n,handleTagRemove:e.handleTagRemove,disabled:t.disabled},(()=>[c("div",j,[h(d(n[t.label])+" ",1),t.disabled?s("v-if",!0):(u(),r("i",{key:0,onClick:l[9]||(l[9]=i((()=>{}),["prevent"])),onMousedown:i((l=>e.handleTagRemove(n,l)),["prevent","stop"])},null,40,["onMousedown"]))])]))])))),128)),t.searchable&&!t.disabled?(u(),r("div",{key:0,class:"multiselect-search",style:{width:e.tagsSearchWidth}},[c("input",{modelValue:e.search,value:e.search,onFocus:l[10]||(l[10]=i(((...l)=>e.openDropdown&&e.openDropdown(...l)),["stop"])),onBlur:l[11]||(l[11]=i(((...l)=>e.closeDropdown&&e.closeDropdown(...l)),["stop"])),onKeyup:[l[12]||(l[12]=o(i(((...l)=>e.handleEsc&&e.handleEsc(...l)),["stop"]),["esc"])),l[13]||(l[13]=o(i(((...l)=>e.handleAddTag&&e.handleAddTag(...l)),["stop"]),["enter"])),l[14]||(l[14]=o(i(((...l)=>e.handleAddTag&&e.handleAddTag(...l)),["stop"]),["space"]))],onKeydown:[l[15]||(l[15]=o(((...l)=>e.handleSearchBackspace&&e.handleSearchBackspace(...l)),["delete"])),l[16]||(l[16]=o(i(((...l)=>e.backwardPointer&&e.backwardPointer(...l)),["stop"]),["up"])),l[17]||(l[17]=o(i(((...l)=>e.forwardPointer&&e.forwardPointer(...l)),["stop"]),["down"]))],onInput:l[18]||(l[18]=(...l)=>e.handleSearchInput&&e.handleSearchInput(...l)),style:{width:e.tagsSearchWidth},ref:"input"},null,44,["modelValue","value"])],4)):s("v-if",!0)])):s("v-if",!0),s(" Placeholder "),!t.placeholder||e.hasSelected||e.search?s("v-if",!0):v(e.$slots,"placeholder",{key:4},(()=>[c("div",M,d(t.placeholder),1)])),t.caret&&!e.busy?v(e.$slots,"caret",{key:5},(()=>[C])):s("v-if",!0),c(m,{name:"multiselect-loading"},{default:b((()=>[e.busy?(u(),r("span",E,[v(e.$slots,"spinner",{},(()=>[$]))])):s("v-if",!0)])),_:1}),e.hasSelected&&!t.disabled?v(e.$slots,"clear",{key:6,clear:e.clear},(()=>[c("a",{class:"multiselect-clear",onClick:l[19]||(l[19]=i(((...l)=>e.clear&&e.clear(...l)),["prevent"]))})])):s("v-if",!0)],40,["tabindex"]),s(" Options "),e.resolving&&t.clearOnSearch?s("v-if",!0):(u(),r(m,{key:0,name:"multiselect",onAfterLeave:e.clearSearch},{default:b((()=>[g(c("div",{class:"multiselect-options",style:{maxHeight:e.contentMaxHeight}},[v(e.$slots,"beforelist"),(u(!0),r(p,null,f(e.fo,((n,a,o)=>(u(),r("span",{tabindex:-1,class:["multiselect-option",{"is-pointed":e.isPointed(n),"is-selected":e.isSelected(n),"is-disabled":e.isDisabled(n)}],key:o,onMousedown:l[28]||(l[28]=i((()=>{}),["prevent"])),onMouseenter:l=>e.setPointer(n),onClick:i((l=>e.handleOptionClick(n)),["stop","prevent"])},[v(e.$slots,"option",{option:n,search:e.search},(()=>[c("span",null,d(n[t.label]),1)]))],42,["onMouseenter","onClick"])))),128)),g(c("span",null,[v(e.$slots,"nooptions",{},(()=>[c("div",H,d(t.noOptionsText),1)]))],512),[[y,e.noOptions]]),g(c("span",null,[v(e.$slots,"noresults",{},(()=>[c("div",L,d(t.noResultsText),1)]))],512),[[y,e.noResults]]),v(e.$slots,"afterlist")],4),[[y,e.isOpen&&t.showOptions]])])),_:3},8,["onAfterLeave"])),s(" Hacky input element to show HTML5 required warning "),t.required?(u(),r("input",{key:1,class:"multiselect-fake-input",tabindex:"-1",value:e.textValue,required:""},null,8,["value"])):s("v-if",!0)],42,["id"])},T.__file="src/Multiselect.vue";export default T; +import{toRefs as e,ref as l,computed as t,watch as n,nextTick as a,openBlock as u,createBlock as r,withKeys as o,withModifiers as i,createVNode as c,createCommentVNode as s,renderSlot as v,toDisplayString as d,Fragment as p,renderList as f,createTextVNode as h,Transition as m,withCtx as b,withDirectives as y,vShow as g}from"vue";function S(e){return-1!==[null,void 0,!1].indexOf(e)}function w(e){return String(e).toLowerCase().trim()}function k(e){return(k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e,l,t){return l in e?Object.defineProperty(e,l,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[l]=t,e}function q(a,u,r){var o=e(a),i=o.options,c=o.mode,s=o.trackBy,v=o.limit,d=o.hideSelected,p=o.createTag,f=o.label,h=o.appendNewTag,m=o.multipleLabel,b=o.object,y=o.loading,g=o.delay,q=o.resolveOnLoad,P=o.minChars,x=o.filterResults,T=o.clearOnSearch,D=o.clearOnSelect,B=o.valueProp,I=o.canDeselect,A=o.max,j=r.iv,M=r.ev,V=r.search,C=r.blurSearch,$=r.clearSearch,E=r.update,H=r.blurInput,L=r.pointer,N=l([]),R=l([]),K=l(!1),F=t((function(){var e,l=R.value||[];return e=l,"[object Object]"===Object.prototype.toString.call(e)&&(l=Object.keys(l).map((function(e){var t,n=l[e];return O(t={},B.value,e),O(t,s.value,n),O(t,f.value,n),t}))),l=l.map((function(e,l){var t;return"object"===k(e)?e:(O(t={},B.value,e),O(t,s.value,e),O(t,f.value,e),t)})),N.value.length&&(l=l.concat(N.value)),l})),_=t((function(){var e=F.value;return J.value.length&&(e=J.value.concat(e)),V.value&&x.value&&(e=e.filter((function(e){return-1!==w(e[s.value]).indexOf(w(V.value))}))),d.value&&(e=e.filter((function(e){return!ie(e)}))),v.value>0&&(e=e.slice(0,v.value)),e})),W=t((function(){switch(c.value){case"single":return!S(j.value[B.value]);case"multiple":case"tags":return!S(j.value)&&j.value.length>0}})),U=t((function(){return void 0!==m&&void 0!==m.value?m.value(j.value):j.value&&j.value.length>1?"".concat(j.value.length," options selected"):"1 option selected"})),z=t((function(){return!F.value.length&&!K.value})),G=t((function(){return F.value.length>0&&0==_.value.length})),J=t((function(){var e;return!1!==p.value&&V.value?-1!==oe(V.value)?[]:[(e={},O(e,B.value,V.value),O(e,f.value,V.value),O(e,s.value,V.value),e)]:[]})),Q=t((function(){switch(c.value){case"single":return null;case"multiple":case"tags":return[]}})),X=t((function(){return y.value||K.value})),Y=function(e){switch("object"!==k(e)&&(e=re(e)),c.value){case"single":E(e);break;case"multiple":case"tags":E(j.value.concat(e))}u.emit("select",ee(e),e)},Z=function(e){switch("object"!==k(e)&&(e=re(e)),c.value){case"single":te();break;case"tags":case"multiple":E(j.value.filter((function(l){return l[B.value]!=e[B.value]})))}u.emit("deselect",ee(e),e)},ee=function(e){return b.value?e:e[B.value]},le=function(e){Z(e)},te=function(){u.emit("clear"),E(Q.value)},ne=function(e){switch(c.value){case"single":return!S(j.value)&&j.value[B.value]==e[B.value];case"tags":case"multiple":return!S(j.value)&&-1!==j.value.map((function(e){return e[B.value]})).indexOf(e[B.value])}},ae=function(e){return!0===e.disabled},ue=function(){return!(void 0===A||-1===A.value||!W.value&&A.value>0)&&j.value.length>=A.value},re=function(e){return F.value[F.value.map((function(e){return String(e[B.value])})).indexOf(String(e))]},oe=function(e){return F.value.map((function(e){return w(e[s.value])})).indexOf(w(e))},ie=function(e){return"tags"===c.value&&d.value&&ne(e)},ce=function(e){N.value.push(e)},se=function(){S(M.value)||(j.value=de(M.value))},ve=function(e){K.value=!0,i.value(V.value).then((function(l){R.value=l,"function"==typeof e&&e(l),K.value=!1}))},de=function(e){return S(e)?"single"===c.value?{}:[]:b.value?e:"single"===c.value?re(e)||{}:e.filter((function(e){return!!re(e)})).map((function(e){return re(e)}))};if("single"!==c.value&&!S(M.value)&&!Array.isArray(M.value))throw new Error('v-model must be an array when using "'.concat(c.value,'" mode'));return i&&"function"==typeof i.value?q.value?ve(se):1==b.value&&se():(R.value=i.value,se()),g.value>-1&&n(V,(function(e){e.lengthe.length)&&(l=e.length);for(var t=0,n=new Array(l);t[]},id:{type:[String,Number],required:!1,default:"multiselect"},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},maxHeight:{type:Number,required:!1,default:160},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:!1},appendNewTag:{type:Boolean,required:!1,default:!0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},addTagOn:{type:Array,required:!1,default:()=>["enter"]},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1}},setup(u,r){const o=function(n,a){var u=e(n),r=u.value,o=u.modelValue,i=u.mode,c=u.valueProp,s=l("single"!==i.value?[]:{}),v=void 0!==a.expose?o:r,d=t((function(){return"single"===i.value?s.value[c.value]:s.value.map((function(e){return e[c.value]}))})),p=t((function(){return"single"!==i.value?s.value.map((function(e){return e[c.value]})).join(","):s.value[c.value]}));return{iv:s,internalValue:s,ev:v,externalValue:v,textValue:p,plainValue:d}}(u,r),i=function(n,a,u){var r=e(n),o=r.searchable,i=(r.id,l(null)),c=t((function(){return o.value?-1:0}));return{multiselect:i,tabindex:c,focusInput:function(){i.value.querySelector(".multiselect-input").focus()},blurInput:function(){i.value.querySelector(".multiselect-input").blur()}}}(u),c={pointer:l(null)},s=function(l,t,n){var a=e(l),u=a.object,r=a.valueProp,o=a.mode,i=n.iv,c=function(e){return u.value||S(e)?e:Array.isArray(e)?e.map((function(e){return e[r.value]})):e[r.value]},s=function(e){return S(e)?"single"===o.value?{}:[]:e};return{update:function(e){i.value=s(e);var l=c(e);t.emit("change",l),t.emit("input",l),t.emit("update:modelValue",l)}}}(u,r,{iv:o.iv}),v=function(a,u,r){var o=e(a),i=o.searchable,c=o.mode,s=r.iv,v=l(null),d=l(null),p=t((function(){return v.value?"".concat(v.value.length,"ch"):"tags"===c.value&&-1===[null,void 0].indexOf(s.value)&&s.value.length?"1ch":"100%"}));return n(v,(function(e){u.emit("search-change",e)})),{search:v,input:d,tagsSearchWidth:p,clearSearch:function(){v.value=""},focusSearch:function(){d.value.focus()},blurSearch:function(){i.value&&d.value.blur()}}}(u,r,{iv:o.iv}),d=function(n,a,u){var r=e(n),o=r.maxHeight,i=r.disabled,c=r.searchable,s=u.multiselect,v=u.blurInput,d=u.blurSearch,p=u.focusInput,f=u.focusSearch,h=l(!1),m=t((function(){return"".concat(o.value,"px")}));return{isOpen:h,contentMaxHeight:m,openDropdown:function(){i.value||(h.value=!0,a.emit("open"))},closeDropdown:function(){h.value=!1,a.emit("close")},open:function(){c&&c.value?f():p()},close:function(){c&&c.value?d():v()},handleInputMousedown:function(e){h.value&&!c.value&&(s.value.querySelector(".multiselect-input").dispatchEvent(new Event("blur")),s.value.querySelector(".multiselect-input").blur(),e.preventDefault())}}}(u,r,{multiselect:i.multiselect,blurInput:i.blurInput,blurSearch:v.blurSearch,focusInput:i.focusInput,focusSearch:v.focusSearch}),p=q(u,r,{ev:o.ev,iv:o.iv,search:v.search,blurSearch:v.blurSearch,clearSearch:v.clearSearch,update:s.update,blurInput:i.blurInput,pointer:c.pointer}),f=function(l,u,r){var o=e(l),i=o.id,c=o.valueProp,s=r.fo,v=r.handleOptionClick,d=r.search,p=r.pointer,f=t((function(){return s.value.filter((function(e){return!0!==e.disabled}))})),h=function(e){p.value=e},m=function(){p.value=f.value[0]||null},b=function(){p.value=null},y=function(){var e=document.getElementById(i.value).querySelector(".is-pointed");if(e){var l=e.parentElement;e.offsetTop+e.offsetHeight>l.clientHeight+l.scrollTop&&(l.scrollTop=e.offsetTop+e.offsetHeight-l.clientHeight),e.offsetTop{}),["prevent"]),["enter"])),ref:"multiselect"},[c("div",{class:"multiselect-input",tabindex:e.tabindex,onMousedown:l[20]||(l[20]=(...l)=>e.handleInputMousedown&&e.handleInputMousedown(...l)),onFocus:l[21]||(l[21]=(...l)=>e.openDropdown&&e.openDropdown(...l)),onBlur:l[22]||(l[22]=(...l)=>e.closeDropdown&&e.closeDropdown(...l)),onKeyup:[l[23]||(l[23]=o(((...l)=>e.handleEsc&&e.handleEsc(...l)),["esc"])),l[24]||(l[24]=o(((...l)=>e.selectPointer&&e.selectPointer(...l)),["enter"]))],onKeydown:[l[25]||(l[25]=o(i(((...l)=>e.handleBackspace&&e.handleBackspace(...l)),["prevent"]),["delete"])),l[26]||(l[26]=o(i((l=>"top"===t.openDirection?e.forwardPointer():e.backwardPointer()),["prevent"]),["up"])),l[27]||(l[27]=o(i((l=>"top"===t.openDirection?e.backwardPointer():e.forwardPointer()),["prevent"]),["down"]))]},[s(" Single label "),"single"==t.mode&&e.hasSelected&&!e.search&&e.iv?v(e.$slots,"singlelabel",{key:0,value:e.iv},(()=>[c("div",D,d(e.iv[t.label]),1)])):s("v-if",!0),s(" Multiple label "),"multiple"==t.mode&&e.hasSelected&&!e.search?v(e.$slots,"multiplelabel",{key:1,values:e.iv},(()=>[c("div",B,d(e.multipleLabelText),1)])):s("v-if",!0),s(" Search "),"tags"!==t.mode&&t.searchable&&!t.disabled?(u(),r("div",I,[c("input",{modelValue:e.search,value:e.search,onFocus:l[1]||(l[1]=i(((...l)=>e.openDropdown&&e.openDropdown(...l)),["stop"])),onBlur:l[2]||(l[2]=i(((...l)=>e.closeDropdown&&e.closeDropdown(...l)),["stop"])),onKeyup:[l[3]||(l[3]=o(i(((...l)=>e.handleEsc&&e.handleEsc(...l)),["stop"]),["esc"])),l[4]||(l[4]=o(i(((...l)=>e.selectPointer&&e.selectPointer(...l)),["stop"]),["enter"]))],onKeydown:[l[5]||(l[5]=o(((...l)=>e.handleSearchBackspace&&e.handleSearchBackspace(...l)),["delete"])),l[6]||(l[6]=o(i((l=>"top"===t.openDirection?e.forwardPointer():e.backwardPointer()),["stop"]),["up"])),l[7]||(l[7]=o(i((l=>"top"===t.openDirection?e.backwardPointer():e.forwardPointer()),["stop"]),["down"]))],onInput:l[8]||(l[8]=(...l)=>e.handleSearchInput&&e.handleSearchInput(...l)),ref:"input"},null,40,["modelValue","value"])])):s("v-if",!0),s(" Tags (with search) "),"tags"==t.mode?(u(),r("div",A,[(u(!0),r(p,null,f(e.iv,((n,a,o)=>(u(),r("span",{key:o},[v(e.$slots,"tag",{option:n,handleTagRemove:e.handleTagRemove,disabled:t.disabled},(()=>[c("div",j,[h(d(n[t.label])+" ",1),t.disabled?s("v-if",!0):(u(),r("i",{key:0,onClick:l[9]||(l[9]=i((()=>{}),["prevent"])),onMousedown:i((l=>e.handleTagRemove(n,l)),["prevent","stop"])},null,40,["onMousedown"]))])]))])))),128)),t.searchable&&!t.disabled?(u(),r("div",{key:0,class:"multiselect-search",style:{width:e.tagsSearchWidth}},[c("input",{modelValue:e.search,value:e.search,onFocus:l[10]||(l[10]=i(((...l)=>e.openDropdown&&e.openDropdown(...l)),["stop"])),onBlur:l[11]||(l[11]=i(((...l)=>e.closeDropdown&&e.closeDropdown(...l)),["stop"])),onKeyup:[l[12]||(l[12]=o(i(((...l)=>e.handleEsc&&e.handleEsc(...l)),["stop"]),["esc"])),l[13]||(l[13]=o(i(((...l)=>e.handleAddTag&&e.handleAddTag(...l)),["stop"]),["enter"])),l[14]||(l[14]=o(i(((...l)=>e.handleAddTag&&e.handleAddTag(...l)),["stop"]),["space"]))],onKeydown:[l[15]||(l[15]=o(((...l)=>e.handleSearchBackspace&&e.handleSearchBackspace(...l)),["delete"])),l[16]||(l[16]=o(i((l=>"top"===t.openDirection?e.forwardPointer():e.backwardPointer()),["stop"]),["up"])),l[17]||(l[17]=o(i((l=>"top"===t.openDirection?e.backwardPointer():e.forwardPointer()),["stop"]),["down"]))],onInput:l[18]||(l[18]=(...l)=>e.handleSearchInput&&e.handleSearchInput(...l)),style:{width:e.tagsSearchWidth},ref:"input"},null,44,["modelValue","value"])],4)):s("v-if",!0)])):s("v-if",!0),s(" Placeholder "),!t.placeholder||e.hasSelected||e.search?s("v-if",!0):v(e.$slots,"placeholder",{key:4},(()=>[c("div",M,d(t.placeholder),1)])),e.hasSelected||!t.caret||e.busy?s("v-if",!0):v(e.$slots,"caret",{key:5},(()=>[V])),e.hasSelected&&!t.disabled&&!e.busy&&t.canDeselect?v(e.$slots,"clear",{key:6,clear:e.clear},(()=>[c("a",{class:"multiselect-clear",onClick:l[19]||(l[19]=i(((...l)=>e.clear&&e.clear(...l)),["prevent"]))})])):s("v-if",!0),c(m,{name:"multiselect-loading"},{default:b((()=>[e.busy?(u(),r("span",C,[v(e.$slots,"spinner",{},(()=>[$]))])):s("v-if",!0)])),_:1})],40,["tabindex"]),s(" Options "),e.resolving&&t.clearOnSearch?s("v-if",!0):(u(),r(m,{key:0,name:"multiselect",onAfterLeave:e.clearSearch},{default:b((()=>[y(c("div",{class:"multiselect-options",style:{maxHeight:e.contentMaxHeight}},[v(e.$slots,"beforelist"),(u(!0),r(p,null,f(e.fo,((n,a,o)=>(u(),r("span",{tabindex:-1,class:["multiselect-option",{"is-pointed":e.isPointed(n),"is-selected":e.isSelected(n),"is-disabled":e.isDisabled(n)}],key:o,onMousedown:l[28]||(l[28]=i((()=>{}),["prevent"])),onMouseenter:l=>e.setPointer(n),onClick:i((l=>e.handleOptionClick(n)),["stop","prevent"])},[v(e.$slots,"option",{option:n,search:e.search},(()=>[c("span",null,d(n[t.label]),1)]))],42,["onMouseenter","onClick"])))),128)),y(c("span",null,[v(e.$slots,"nooptions",{},(()=>[c("div",E,d(t.noOptionsText),1)]))],512),[[g,e.noOptions]]),y(c("span",null,[v(e.$slots,"noresults",{},(()=>[c("div",H,d(t.noResultsText),1)]))],512),[[g,e.noResults]]),v(e.$slots,"afterlist")],4),[[g,e.isOpen&&t.showOptions]])])),_:3},8,["onAfterLeave"])),s(" Hacky input element to show HTML5 required warning "),t.required?(u(),r("input",{key:1,class:"multiselect-fake-input",tabindex:"-1",value:e.textValue,required:""},null,8,["value"])):s("v-if",!0),t.nativeSupport?(u(),r(p,{key:2},["single"==t.mode?(u(),r("input",{key:0,type:"hidden",name:t.name,value:void 0!==e.plainValue?e.plainValue:""},null,8,["name","value"])):(u(!0),r(p,{key:1},f(e.plainValue,((e,l)=>(u(),r("input",{type:"hidden",name:`${t.name}[]`,value:e,key:l},null,8,["name","value"])))),128))],64)):s("v-if",!0)],42,["id"])},T.__file="src/Multiselect.vue";export default T; diff --git a/dist/multiselect.vue2.global.js b/dist/multiselect.vue2.global.js index 10a1e72..6127ca7 100644 --- a/dist/multiselect.vue2.global.js +++ b/dist/multiselect.vue2.global.js @@ -1 +1 @@ -var VueformMultiselect=function(e){"use strict";function t(e){return-1!==[null,void 0,!1].indexOf(e)}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return l(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return l(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n0&&(e=e.slice(0,v.value)),e})),$=e.computed((function(){switch(s.value){case"single":return!t(D.value[C.value]);case"multiple":case"tags":return!t(D.value)&&D.value.length>0}})),L=e.computed((function(){return void 0!==m&&void 0!==m.value?m.value(D.value):D.value&&D.value.length>1?"".concat(D.value.length," options selected"):"1 option selected"})),F=e.computed((function(){return!U.value.length&&!H.value})),W=e.computed((function(){return U.value.length>0&&0==M.value.length})),X=e.computed((function(){var e;return!1!==f.value&&B.value?-1!==ue(B.value)?[]:[(e={},a(e,C.value,B.value),a(e,h.value,B.value),a(e,d.value,B.value),e)]:[]})),z=e.computed((function(){switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),G=e.computed((function(){return b.value||H.value})),J=function(e){switch("object"!==n(e)&&(e=ae(e)),s.value){case"single":A(e);break;case"multiple":case"tags":A(D.value.concat(e))}l.emit("select",Q(e))},K=function(e){switch("object"!==n(e)&&(e=ae(e)),s.value){case"single":Z();break;case"tags":case"multiple":A(D.value.filter((function(t){return t[C.value]!=e[C.value]})))}l.emit("deselect",Q(e))},Q=function(e){return g.value?e:e[C.value]},Y=function(e){K(e)},Z=function(){A(z.value)},ee=function(e){switch(s.value){case"single":return!t(D.value)&&D.value[C.value]==e[C.value];case"tags":case"multiple":return!t(D.value)&&-1!==D.value.map((function(e){return e[C.value]})).indexOf(e[C.value])}},te=function(e){return!0===e.disabled},ne=function(){return!(void 0===q||-1===q.value||!$.value&&q.value>0)&&D.value.length>=q.value},ae=function(e){return U.value[U.value.map((function(e){return String(e[C.value])})).indexOf(String(e))]},ue=function(e){return U.value.map((function(e){return r(e[d.value])})).indexOf(r(e))},le=function(e){return"tags"===s.value&&p.value&&ee(e)},re=function(e){N.value.push(e)},oe=function(){t(T.value)||(D.value=ce(T.value))},ie=function(e){H.value=!0,c.value(B.value).then((function(t){V.value=t,"function"==typeof e&&e(t),H.value=!1}))},ce=function(e){return t(e)?"single"===s.value?{}:[]:g.value?e:"single"===s.value?ae(e)||{}:e.filter((function(e){return!!ae(e)})).map((function(e){return ae(e)}))};if("single"!==s.value&&!t(T.value)&&!Array.isArray(T.value))throw new Error('v-model must be an array when using "'.concat(s.value,'" mode'));return c&&"function"==typeof c.value?_.value?ie(oe):1==g.value&&oe():(V.value=c.value,oe()),k.value>-1&&e.watch(B,(function(e){e.length[]},id:{type:[String,Number],required:!1,default:"multiselect"},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},maxHeight:{type:Number,required:!1,default:160},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:!1},appendNewTag:{type:Boolean,required:!1,default:!0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},addTagOn:{type:Array,required:!1,default:()=>["enter"]},required:{type:Boolean,required:!1,default:!1}},setup(n,a){const l=function(t,n){var a=e.toRefs(t),u=a.value,l=a.modelValue,r=a.mode,o=a.valueProp,i=e.ref("single"!==r.value?[]:{}),c=void 0!==n.expose?l:u,s=e.computed((function(){return"single"!==r.value?i.value.map((function(e){return e[o.value]})).join(","):i.value[o.value]}));return{iv:i,ev:c,textValue:s}}(n,a),r=function(t,n,a){var u=e.toRefs(t),l=u.searchable,r=(u.id,e.ref(null)),o=e.computed((function(){return l.value?-1:0}));return{multiselect:r,tabindex:o,focusInput:function(){r.value.querySelector(".multiselect-input").focus()},blurInput:function(){r.value.querySelector(".multiselect-input").blur()}}}(n),i={pointer:e.ref(null)},c=function(n,a,u){var l=e.toRefs(n),r=l.object,o=l.valueProp,i=l.mode,c=u.iv,s=function(e){return r.value||t(e)?e:Array.isArray(e)?e.map((function(e){return e[o.value]})):e[o.value]},d=function(e){return t(e)?"single"===i.value?{}:[]:e};return{update:function(e){c.value=d(e);var t=s(e);a.emit("change",t),a.emit("input",t),a.emit("update:modelValue",t)}}}(n,a,{iv:l.iv}),s=function(t,n,a){var u=e.toRefs(t),l=u.searchable,r=u.mode,o=a.iv,i=e.ref(null),c=e.ref(null),s=e.computed((function(){return i.value?"".concat(i.value.length,"ch"):"tags"===r.value&&-1===[null,void 0].indexOf(o.value)&&o.value.length?"1ch":"100%"}));return e.watch(i,(function(e){n.emit("search-change",e)})),{search:i,input:c,tagsSearchWidth:s,clearSearch:function(){i.value=""},focusSearch:function(){c.value.focus()},blurSearch:function(){l.value&&c.value.blur()}}}(n,a,{iv:l.iv}),d=function(t,n,a){var u=e.toRefs(t),l=u.maxHeight,r=u.disabled,o=u.searchable,i=a.multiselect,c=a.blurInput,s=a.blurSearch,d=a.focusInput,v=a.focusSearch,p=e.ref(!1),f=e.computed((function(){return"".concat(l.value,"px")}));return{isOpen:p,contentMaxHeight:f,openDropdown:function(){r.value||(p.value=!0,n.emit("open"))},closeDropdown:function(){p.value=!1,n.emit("close")},open:function(){o&&o.value?v():d()},close:function(){o&&o.value?s():c()},handleInputMousedown:function(e){p.value&&!o.value&&(i.value.querySelector(".multiselect-input").dispatchEvent(new Event("blur")),i.value.querySelector(".multiselect-input").blur(),e.preventDefault())}}}(n,a,{multiselect:r.multiselect,blurInput:r.blurInput,blurSearch:s.blurSearch,focusInput:r.focusInput,focusSearch:s.focusSearch}),v=o(n,a,{ev:l.ev,iv:l.iv,search:s.search,blurSearch:s.blurSearch,clearSearch:s.clearSearch,update:c.update,blurInput:r.blurInput,pointer:i.pointer}),p=function(t,n,a){var u=e.toRefs(t),l=u.id,r=u.valueProp,o=a.fo,i=a.handleOptionClick,c=a.search,s=a.pointer,d=e.computed((function(){return o.value.filter((function(e){return!0!==e.disabled}))})),v=function(e){s.value=e},p=function(){s.value=d.value[0]||null},f=function(){s.value=null},h=function(){var e=document.getElementById(l.value).querySelector(".is-pointed");if(e){var t=e.parentElement;e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTope.length)&&(t=e.length);for(var n=0,a=new Array(t);n0&&(e=e.slice(0,v.value)),e})),$=e.computed((function(){switch(s.value){case"single":return!t(q.value[P.value]);case"multiple":case"tags":return!t(q.value)&&q.value.length>0}})),L=e.computed((function(){return void 0!==y&&void 0!==y.value?y.value(q.value):q.value&&q.value.length>1?"".concat(q.value.length," options selected"):"1 option selected"})),F=e.computed((function(){return!U.value.length&&!H.value})),W=e.computed((function(){return U.value.length>0&&0==M.value.length})),X=e.computed((function(){var e;return!1!==f.value&&B.value?-1!==ue(B.value)?[]:[(e={},a(e,P.value,B.value),a(e,h.value,B.value),a(e,d.value,B.value),e)]:[]})),z=e.computed((function(){switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),G=e.computed((function(){return b.value||H.value})),J=function(e){switch("object"!==n(e)&&(e=ae(e)),s.value){case"single":A(e);break;case"multiple":case"tags":A(q.value.concat(e))}l.emit("select",Q(e),e)},K=function(e){switch("object"!==n(e)&&(e=ae(e)),s.value){case"single":Z();break;case"tags":case"multiple":A(q.value.filter((function(t){return t[P.value]!=e[P.value]})))}l.emit("deselect",Q(e),e)},Q=function(e){return g.value?e:e[P.value]},Y=function(e){K(e)},Z=function(){l.emit("clear"),A(z.value)},ee=function(e){switch(s.value){case"single":return!t(q.value)&&q.value[P.value]==e[P.value];case"tags":case"multiple":return!t(q.value)&&-1!==q.value.map((function(e){return e[P.value]})).indexOf(e[P.value])}},te=function(e){return!0===e.disabled},ne=function(){return!(void 0===D||-1===D.value||!$.value&&D.value>0)&&q.value.length>=D.value},ae=function(e){return U.value[U.value.map((function(e){return String(e[P.value])})).indexOf(String(e))]},ue=function(e){return U.value.map((function(e){return r(e[d.value])})).indexOf(r(e))},le=function(e){return"tags"===s.value&&p.value&&ee(e)},re=function(e){V.value.push(e)},oe=function(){t(T.value)||(q.value=ce(T.value))},ie=function(e){H.value=!0,c.value(B.value).then((function(t){N.value=t,"function"==typeof e&&e(t),H.value=!1}))},ce=function(e){return t(e)?"single"===s.value?{}:[]:g.value?e:"single"===s.value?ae(e)||{}:e.filter((function(e){return!!ae(e)})).map((function(e){return ae(e)}))};if("single"!==s.value&&!t(T.value)&&!Array.isArray(T.value))throw new Error('v-model must be an array when using "'.concat(s.value,'" mode'));return c&&"function"==typeof c.value?_.value?ie(oe):1==g.value&&oe():(N.value=c.value,oe()),k.value>-1&&e.watch(B,(function(e){e.length[]},id:{type:[String,Number],required:!1,default:"multiselect"},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},maxHeight:{type:Number,required:!1,default:160},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:!1},appendNewTag:{type:Boolean,required:!1,default:!0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},addTagOn:{type:Array,required:!1,default:()=>["enter"]},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1}},setup(n,a){const l=function(t,n){var a=e.toRefs(t),u=a.value,l=a.modelValue,r=a.mode,o=a.valueProp,i=e.ref("single"!==r.value?[]:{}),c=void 0!==n.expose?l:u,s=e.computed((function(){return"single"===r.value?i.value[o.value]:i.value.map((function(e){return e[o.value]}))})),d=e.computed((function(){return"single"!==r.value?i.value.map((function(e){return e[o.value]})).join(","):i.value[o.value]}));return{iv:i,internalValue:i,ev:c,externalValue:c,textValue:d,plainValue:s}}(n,a),r=function(t,n,a){var u=e.toRefs(t),l=u.searchable,r=(u.id,e.ref(null)),o=e.computed((function(){return l.value?-1:0}));return{multiselect:r,tabindex:o,focusInput:function(){r.value.querySelector(".multiselect-input").focus()},blurInput:function(){r.value.querySelector(".multiselect-input").blur()}}}(n),i={pointer:e.ref(null)},c=function(n,a,u){var l=e.toRefs(n),r=l.object,o=l.valueProp,i=l.mode,c=u.iv,s=function(e){return r.value||t(e)?e:Array.isArray(e)?e.map((function(e){return e[o.value]})):e[o.value]},d=function(e){return t(e)?"single"===i.value?{}:[]:e};return{update:function(e){c.value=d(e);var t=s(e);a.emit("change",t),a.emit("input",t),a.emit("update:modelValue",t)}}}(n,a,{iv:l.iv}),s=function(t,n,a){var u=e.toRefs(t),l=u.searchable,r=u.mode,o=a.iv,i=e.ref(null),c=e.ref(null),s=e.computed((function(){return i.value?"".concat(i.value.length,"ch"):"tags"===r.value&&-1===[null,void 0].indexOf(o.value)&&o.value.length?"1ch":"100%"}));return e.watch(i,(function(e){n.emit("search-change",e)})),{search:i,input:c,tagsSearchWidth:s,clearSearch:function(){i.value=""},focusSearch:function(){c.value.focus()},blurSearch:function(){l.value&&c.value.blur()}}}(n,a,{iv:l.iv}),d=function(t,n,a){var u=e.toRefs(t),l=u.maxHeight,r=u.disabled,o=u.searchable,i=a.multiselect,c=a.blurInput,s=a.blurSearch,d=a.focusInput,v=a.focusSearch,p=e.ref(!1),f=e.computed((function(){return"".concat(l.value,"px")}));return{isOpen:p,contentMaxHeight:f,openDropdown:function(){r.value||(p.value=!0,n.emit("open"))},closeDropdown:function(){p.value=!1,n.emit("close")},open:function(){o&&o.value?v():d()},close:function(){o&&o.value?s():c()},handleInputMousedown:function(e){p.value&&!o.value&&(i.value.querySelector(".multiselect-input").dispatchEvent(new Event("blur")),i.value.querySelector(".multiselect-input").blur(),e.preventDefault())}}}(n,a,{multiselect:r.multiselect,blurInput:r.blurInput,blurSearch:s.blurSearch,focusInput:r.focusInput,focusSearch:s.focusSearch}),v=o(n,a,{ev:l.ev,iv:l.iv,search:s.search,blurSearch:s.blurSearch,clearSearch:s.clearSearch,update:c.update,blurInput:r.blurInput,pointer:i.pointer}),p=function(t,n,a){var u=e.toRefs(t),l=u.id,r=u.valueProp,o=a.fo,i=a.handleOptionClick,c=a.search,s=a.pointer,d=e.computed((function(){return o.value.filter((function(e){return!0!==e.disabled}))})),v=function(e){s.value=e},p=function(){s.value=d.value[0]||null},f=function(){s.value=null},h=function(){var e=document.getElementById(l.value).querySelector(".is-pointed");if(e){var t=e.parentElement;e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop0&&(e=e.slice(0,h.value)),e})),W=n((function(){switch(p.value){case"single":return!u(E.value[D.value]);case"multiple":case"tags":return!u(E.value)&&E.value.length>0}})),X=n((function(){return void 0!==k&&void 0!==k.value?k.value(E.value):E.value&&E.value.length>1?"".concat(E.value.length," options selected"):"1 option selected"})),z=n((function(){return!M.value.length&&!L.value})),G=n((function(){return M.value.length>0&&0==F.value.length})),J=n((function(){var e;return!1!==m.value&&I.value?-1!==oe(I.value)?[]:[(e={},i(e,D.value,I.value),i(e,g.value,I.value),i(e,f.value,I.value),e)]:[]})),K=n((function(){switch(p.value){case"single":return null;case"multiple":case"tags":return[]}})),Q=n((function(){return w.value||L.value})),Y=function(e){switch("object"!==o(e)&&(e=re(e)),p.value){case"single":N(e);break;case"multiple":case"tags":N(E.value.concat(e))}c.emit("select",ee(e))},Z=function(e){switch("object"!==o(e)&&(e=re(e)),p.value){case"single":ne();break;case"tags":case"multiple":N(E.value.filter((function(t){return t[D.value]!=e[D.value]})))}c.emit("deselect",ee(e))},ee=function(e){return _.value?e:e[D.value]},te=function(e){Z(e)},ne=function(){N(K.value)},ae=function(e){switch(p.value){case"single":return!u(E.value)&&E.value[D.value]==e[D.value];case"tags":case"multiple":return!u(E.value)&&-1!==E.value.map((function(e){return e[D.value]})).indexOf(e[D.value])}},le=function(e){return!0===e.disabled},ue=function(){return!(void 0===B||-1===B.value||!W.value&&B.value>0)&&E.value.length>=B.value},re=function(e){return M.value[M.value.map((function(e){return String(e[D.value])})).indexOf(String(e))]},oe=function(e){return M.value.map((function(e){return r(e[f.value])})).indexOf(r(e))},ie=function(e){return"tags"===p.value&&y.value&&ae(e)},ce=function(e){U.value.push(e)},se=function(){u(A.value)||(E.value=de(A.value))},ve=function(e){L.value=!0,d.value(I.value).then((function(t){$.value=t,"function"==typeof e&&e(t),L.value=!1}))},de=function(e){return u(e)?"single"===p.value?{}:[]:_.value?e:"single"===p.value?re(e)||{}:e.filter((function(e){return!!re(e)})).map((function(e){return re(e)}))};if("single"!==p.value&&!u(A.value)&&!Array.isArray(A.value))throw new Error('v-model must be an array when using "'.concat(p.value,'" mode'));return d&&"function"==typeof d.value?O.value?ve(se):1==_.value&&se():($.value=d.value,se()),S.value>-1&&a(I,(function(e){e.lengthe.length)&&(t=e.length);for(var n=0,a=new Array(t);n[]},id:{type:[String,Number],required:!1,default:"multiselect"},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},maxHeight:{type:Number,required:!1,default:160},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:!1},appendNewTag:{type:Boolean,required:!1,default:!0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},addTagOn:{type:Array,required:!1,default:()=>["enter"]},required:{type:Boolean,required:!1,default:!1}},setup(r,o){const i=function(a,l){var u=e(a),r=u.value,o=u.modelValue,i=u.mode,c=u.valueProp,s=t("single"!==i.value?[]:{}),v=void 0!==l.expose?o:r,d=n((function(){return"single"!==i.value?s.value.map((function(e){return e[c.value]})).join(","):s.value[c.value]}));return{iv:s,ev:v,textValue:d}}(r,o),v=function(a,l,u){var r=e(a),o=r.searchable,i=(r.id,t(null)),c=n((function(){return o.value?-1:0}));return{multiselect:i,tabindex:c,focusInput:function(){i.value.querySelector(".multiselect-input").focus()},blurInput:function(){i.value.querySelector(".multiselect-input").blur()}}}(r),d={pointer:t(null)},p=function(t,n,a){var l=e(t),r=l.object,o=l.valueProp,i=l.mode,c=a.iv,s=function(e){return r.value||u(e)?e:Array.isArray(e)?e.map((function(e){return e[o.value]})):e[o.value]},v=function(e){return u(e)?"single"===i.value?{}:[]:e};return{update:function(e){c.value=v(e);var t=s(e);n.emit("change",t),n.emit("input",t),n.emit("update:modelValue",t)}}}(r,o,{iv:i.iv}),f=function(l,u,r){var o=e(l),i=o.searchable,c=o.mode,s=r.iv,v=t(null),d=t(null),p=n((function(){return v.value?"".concat(v.value.length,"ch"):"tags"===c.value&&-1===[null,void 0].indexOf(s.value)&&s.value.length?"1ch":"100%"}));return a(v,(function(e){u.emit("search-change",e)})),{search:v,input:d,tagsSearchWidth:p,clearSearch:function(){v.value=""},focusSearch:function(){d.value.focus()},blurSearch:function(){i.value&&d.value.blur()}}}(r,o,{iv:i.iv}),h=function(a,l,u){var r=e(a),o=r.maxHeight,i=r.disabled,c=r.searchable,s=u.multiselect,v=u.blurInput,d=u.blurSearch,p=u.focusInput,f=u.focusSearch,h=t(!1),y=n((function(){return"".concat(o.value,"px")}));return{isOpen:h,contentMaxHeight:y,openDropdown:function(){i.value||(h.value=!0,l.emit("open"))},closeDropdown:function(){h.value=!1,l.emit("close")},open:function(){c&&c.value?f():p()},close:function(){c&&c.value?d():v()},handleInputMousedown:function(e){h.value&&!c.value&&(s.value.querySelector(".multiselect-input").dispatchEvent(new Event("blur")),s.value.querySelector(".multiselect-input").blur(),e.preventDefault())}}}(r,o,{multiselect:v.multiselect,blurInput:v.blurInput,blurSearch:f.blurSearch,focusInput:v.focusInput,focusSearch:f.focusSearch}),y=c(r,o,{ev:i.ev,iv:i.iv,search:f.search,blurSearch:f.blurSearch,clearSearch:f.clearSearch,update:p.update,blurInput:v.blurInput,pointer:d.pointer}),m=function(t,u,r){var o=e(t),i=o.id,c=o.valueProp,s=r.fo,v=r.handleOptionClick,d=r.search,p=r.pointer,f=n((function(){return s.value.filter((function(e){return!0!==e.disabled}))})),h=function(e){p.value=e},y=function(){p.value=f.value[0]||null},m=function(){p.value=null},g=function(){var e=document.getElementById(i.value).querySelector(".is-pointed");if(e){var t=e.parentElement;e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop0&&(e=e.slice(0,h.value)),e})),W=n((function(){switch(p.value){case"single":return!u(E.value[q.value]);case"multiple":case"tags":return!u(E.value)&&E.value.length>0}})),X=n((function(){return void 0!==k&&void 0!==k.value?k.value(E.value):E.value&&E.value.length>1?"".concat(E.value.length," options selected"):"1 option selected"})),z=n((function(){return!M.value.length&&!L.value})),G=n((function(){return M.value.length>0&&0==F.value.length})),J=n((function(){var e;return!1!==m.value&&I.value?-1!==oe(I.value)?[]:[(e={},i(e,q.value,I.value),i(e,g.value,I.value),i(e,f.value,I.value),e)]:[]})),K=n((function(){switch(p.value){case"single":return null;case"multiple":case"tags":return[]}})),Q=n((function(){return w.value||L.value})),Y=function(e){switch("object"!==o(e)&&(e=re(e)),p.value){case"single":V(e);break;case"multiple":case"tags":V(E.value.concat(e))}c.emit("select",ee(e),e)},Z=function(e){switch("object"!==o(e)&&(e=re(e)),p.value){case"single":ne();break;case"tags":case"multiple":V(E.value.filter((function(t){return t[q.value]!=e[q.value]})))}c.emit("deselect",ee(e),e)},ee=function(e){return _.value?e:e[q.value]},te=function(e){Z(e)},ne=function(){c.emit("clear"),V(K.value)},ae=function(e){switch(p.value){case"single":return!u(E.value)&&E.value[q.value]==e[q.value];case"tags":case"multiple":return!u(E.value)&&-1!==E.value.map((function(e){return e[q.value]})).indexOf(e[q.value])}},le=function(e){return!0===e.disabled},ue=function(){return!(void 0===B||-1===B.value||!W.value&&B.value>0)&&E.value.length>=B.value},re=function(e){return M.value[M.value.map((function(e){return String(e[q.value])})).indexOf(String(e))]},oe=function(e){return M.value.map((function(e){return r(e[f.value])})).indexOf(r(e))},ie=function(e){return"tags"===p.value&&y.value&&ae(e)},ce=function(e){U.value.push(e)},se=function(){u(A.value)||(E.value=de(A.value))},ve=function(e){L.value=!0,d.value(I.value).then((function(t){$.value=t,"function"==typeof e&&e(t),L.value=!1}))},de=function(e){return u(e)?"single"===p.value?{}:[]:_.value?e:"single"===p.value?re(e)||{}:e.filter((function(e){return!!re(e)})).map((function(e){return re(e)}))};if("single"!==p.value&&!u(A.value)&&!Array.isArray(A.value))throw new Error('v-model must be an array when using "'.concat(p.value,'" mode'));return d&&"function"==typeof d.value?O.value?ve(se):1==_.value&&se():($.value=d.value,se()),S.value>-1&&a(I,(function(e){e.lengthe.length)&&(t=e.length);for(var n=0,a=new Array(t);n[]},id:{type:[String,Number],required:!1,default:"multiselect"},name:{type:[String,Number],required:!1,default:"multiselect"},disabled:{type:Boolean,required:!1,default:!1},label:{type:String,required:!1,default:"label"},trackBy:{type:String,required:!1,default:"label"},valueProp:{type:String,required:!1,default:"value"},placeholder:{type:String,required:!1,default:null},mode:{type:String,required:!1,default:"single"},searchable:{type:Boolean,required:!1,default:!1},limit:{type:Number,required:!1,default:-1},maxHeight:{type:Number,required:!1,default:160},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:!1},appendNewTag:{type:Boolean,required:!1,default:!0},caret:{type:Boolean,required:!1,default:!0},loading:{type:Boolean,required:!1,default:!1},noOptionsText:{type:String,required:!1,default:"The list is empty"},noResultsText:{type:String,required:!1,default:"No results found"},multipleLabel:{type:Function,required:!1},object:{type:Boolean,required:!1,default:!1},delay:{type:Number,required:!1,default:-1},minChars:{type:Number,required:!1,default:0},resolveOnLoad:{type:Boolean,required:!1,default:!0},filterResults:{type:Boolean,required:!1,default:!0},clearOnSearch:{type:Boolean,required:!1,default:!1},clearOnSelect:{type:Boolean,required:!1,default:!0},canDeselect:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},addTagOn:{type:Array,required:!1,default:()=>["enter"]},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1}},setup(r,o){const i=function(a,l){var u=e(a),r=u.value,o=u.modelValue,i=u.mode,c=u.valueProp,s=t("single"!==i.value?[]:{}),v=void 0!==l.expose?o:r,d=n((function(){return"single"===i.value?s.value[c.value]:s.value.map((function(e){return e[c.value]}))})),p=n((function(){return"single"!==i.value?s.value.map((function(e){return e[c.value]})).join(","):s.value[c.value]}));return{iv:s,internalValue:s,ev:v,externalValue:v,textValue:p,plainValue:d}}(r,o),v=function(a,l,u){var r=e(a),o=r.searchable,i=(r.id,t(null)),c=n((function(){return o.value?-1:0}));return{multiselect:i,tabindex:c,focusInput:function(){i.value.querySelector(".multiselect-input").focus()},blurInput:function(){i.value.querySelector(".multiselect-input").blur()}}}(r),d={pointer:t(null)},p=function(t,n,a){var l=e(t),r=l.object,o=l.valueProp,i=l.mode,c=a.iv,s=function(e){return r.value||u(e)?e:Array.isArray(e)?e.map((function(e){return e[o.value]})):e[o.value]},v=function(e){return u(e)?"single"===i.value?{}:[]:e};return{update:function(e){c.value=v(e);var t=s(e);n.emit("change",t),n.emit("input",t),n.emit("update:modelValue",t)}}}(r,o,{iv:i.iv}),f=function(l,u,r){var o=e(l),i=o.searchable,c=o.mode,s=r.iv,v=t(null),d=t(null),p=n((function(){return v.value?"".concat(v.value.length,"ch"):"tags"===c.value&&-1===[null,void 0].indexOf(s.value)&&s.value.length?"1ch":"100%"}));return a(v,(function(e){u.emit("search-change",e)})),{search:v,input:d,tagsSearchWidth:p,clearSearch:function(){v.value=""},focusSearch:function(){d.value.focus()},blurSearch:function(){i.value&&d.value.blur()}}}(r,o,{iv:i.iv}),h=function(a,l,u){var r=e(a),o=r.maxHeight,i=r.disabled,c=r.searchable,s=u.multiselect,v=u.blurInput,d=u.blurSearch,p=u.focusInput,f=u.focusSearch,h=t(!1),y=n((function(){return"".concat(o.value,"px")}));return{isOpen:h,contentMaxHeight:y,openDropdown:function(){i.value||(h.value=!0,l.emit("open"))},closeDropdown:function(){h.value=!1,l.emit("close")},open:function(){c&&c.value?f():p()},close:function(){c&&c.value?d():v()},handleInputMousedown:function(e){h.value&&!c.value&&(s.value.querySelector(".multiselect-input").dispatchEvent(new Event("blur")),s.value.querySelector(".multiselect-input").blur(),e.preventDefault())}}}(r,o,{multiselect:v.multiselect,blurInput:v.blurInput,blurSearch:f.blurSearch,focusInput:v.focusInput,focusSearch:f.focusSearch}),y=c(r,o,{ev:i.ev,iv:i.iv,search:f.search,blurSearch:f.blurSearch,clearSearch:f.clearSearch,update:p.update,blurInput:v.blurInput,pointer:d.pointer}),m=function(t,u,r){var o=e(t),i=o.id,c=o.valueProp,s=r.fo,v=r.handleOptionClick,d=r.search,p=r.pointer,f=n((function(){return s.value.filter((function(e){return!0!==e.disabled}))})),h=function(e){p.value=e},y=function(){p.value=f.value[0]||null},m=function(){p.value=null},g=function(){var e=document.getElementById(i.value).querySelector(".is-pointed");if(e){var t=e.parentElement;e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop*{font-size:medium}.multiselect.is-searchable{cursor:auto}.multiselect-input{width:100%;display:flex;align-items:center;min-height:40px;border:1px solid #e7e7e7;border-radius:3px;box-sizing:border-box;cursor:pointer;position:relative;outline:none}.multiselect-caret{position:absolute;right:12px;top:50%;color:#999;border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 0;content:"";transform:translateY(-50%);transition:transform .3s}.is-disabled .multiselect-input{background:#f9f9f9}.is-open .multiselect-input{border-radius:3px 3px 0 0}.is-open .multiselect-caret{transform:translateY(-50%) rotate(180deg)}.multiselect-multiple-label,.multiselect-placeholder,.multiselect-single-label{display:flex;align-items:center;height:100%;padding-left:14px;position:absolute;left:0;top:0;pointer-events:none;background:transparent}.multiselect-placeholder{color:#777}.is-multiple .multiselect-search,.is-single .multiselect-search{display:flex;height:100%;width:100%;background:transparent}.is-multiple .multiselect-search input,.is-single .multiselect-search input{width:100%;border:0;padding:8px 35px 8px 14px;outline:none;background:transparent;font-size:16px;font-family:inherit}.is-multiple.no-caret .multiselect-search input,.is-single.no-caret .multiselect-search input{padding:8px 14px}.is-tags .multiselect-search{flex-grow:1}.is-tags .multiselect-search input{outline:none;border:0;margin:0 0 5px 3px;flex-grow:1;min-width:100%;font-size:16px;font-family:inherit}.multiselect-clear{position:absolute;right:0;top:1px;width:36px;height:36px;background:#fff}.multiselect-clear:after,.multiselect-clear:before{position:absolute;top:12px;left:16px;content:" ";height:12px;width:2px;background-color:#999}.multiselect-clear:before{transform:rotate(45deg)}.multiselect-clear:after{transform:rotate(-45deg)}.multiselect-clear:hover:after,.multiselect-clear:hover:before{background-color:#555}.multiselect-tags{display:flex;height:100%;width:100%;align-items:center;justify-content:flex-start;padding-left:9px;margin-top:5px;flex-wrap:wrap;padding-right:36px}.no-caret .multiselect-tags{padding-right:9px}.multiselect-tag{background:#41b883;color:#fff;font-size:14px;font-weight:600;padding:0 0 0 8px;border-radius:3px;margin-right:5px;margin-bottom:5px;display:flex;align-items:center;cursor:text;white-space:nowrap}.multiselect-tag i{cursor:pointer}.multiselect-tag i:before{content:"\D7";color:#266d4d;font-size:14px;font-weight:700;padding:1px 5px;margin-left:3px;display:flex;font-style:normal}.multiselect-tag i:hover:before{color:#fff;background:hsla(0,0%,100%,.2)}.is-disabled .multiselect-tag{background:#a0a0a0;padding:1px 8px}.multiselect-fake-input{background:transparent;width:100%;height:1px;border:0;padding:0;font-size:0;margin-top:-1px;outline:none}.multiselect-fake-input:active,.multiselect-fake-input:focus{outline:none}.multiselect-options{position:absolute;left:0;right:0;border:1px solid #e8e8e8;margin-top:-1px;max-height:160px;overflow-y:scroll;-webkit-overflow-scrolling:touch;z-index:100;background:#fff}.multiselect-option{display:flex;min-height:40px;padding:9px 12px;box-sizing:border-box;color:#222;text-decoration:none;align-items:center;justify-content:flex-start;text-align:left}.multiselect-option.is-pointed{background:#e6e6e6}.multiselect-option.is-disabled{background:#f9f9f9;color:#a6a6a6;cursor:not-allowed}.multiselect-option.is-selected{background:#41b883;color:#fff}.multiselect-option.is-selected.is-pointed{background:#4fbd8c}.is-multiple .multiselect-option.is-selected,.is-tags .multiselect-option.is-selected{color:#999;background:transparent}.is-multiple .multiselect-option.is-selected.is-pointed,.is-tags .multiselect-option.is-selected.is-pointed{background:#f1f1f1}.multiselect-no-options,.multiselect-no-results{display:flex;padding:10px 12px;color:#777}.multiselect-spinner{position:absolute;right:12px;top:0;width:16px;height:16px;background:#fff;display:block;transform:translateY(50%)}.multiselect-spinner:after,.multiselect-spinner:before{position:absolute;content:"";top:50%;left:50%;margin:-8px 0 0 -8px;width:16px;height:16px;border-radius:100%;border:2px solid transparent;border-top-color:#41b883;box-shadow:0 0 0 1px transparent}.is-disabled .multiselect-spinner{background:#f9f9f9}.is-disabled .multiselect-spinner:after,.is-disabled .multiselect-spinner:before{border-color:#999 transparent transparent}.multiselect-spinner:before{-webkit-animation:spinning 2.4s cubic-bezier(.41,.26,.2,.62);animation:spinning 2.4s cubic-bezier(.41,.26,.2,.62);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.multiselect-spinner:after{-webkit-animation:spinning 2.4s cubic-bezier(.51,.09,.21,.8);animation:spinning 2.4s cubic-bezier(.51,.09,.21,.8);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.multiselect-enter-active{transition:all .15s ease}.multiselect-leave-active{transition:all 0s}.multiselect-enter,.multiselect-leave-active{opacity:0}.multiselect-loading-enter-active,.multiselect-loading-leave-active{transition:opacity .4s ease-in-out;opacity:1}.multiselect-loading-enter,.multiselect-loading-leave-active{opacity:0}@-webkit-keyframes spinning{0%{transform:rotate(0)}to{transform:rotate(2turn)}}@keyframes spinning{0%{transform:rotate(0)}to{transform:rotate(2turn)}} \ No newline at end of file +@charset "UTF-8";.multiselect{position:relative;margin:0 auto;font-size:0}.multiselect>*{font-size:medium}.multiselect.is-searchable{cursor:auto}.multiselect-input{width:100%;display:flex;align-items:center;min-height:40px;border:1px solid #e7e7e7;border-radius:3px;box-sizing:border-box;cursor:pointer;position:relative;outline:none}.multiselect-caret{position:absolute;right:12px;top:50%;color:#999;border-color:#999 transparent transparent;border-style:solid;border-width:5px 5px 0;content:"";transform:translateY(-50%);transition:transform .3s}.is-disabled .multiselect-input{background:#f9f9f9}.is-open .multiselect-input{border-radius:3px 3px 0 0}.is-open .multiselect-caret{transform:translateY(-50%) rotate(180deg)}.multiselect-multiple-label,.multiselect-placeholder,.multiselect-single-label{display:flex;align-items:center;height:100%;padding-left:14px;position:absolute;left:0;top:0;pointer-events:none;background:transparent}.multiselect-placeholder{color:#777}.is-multiple .multiselect-search,.is-single .multiselect-search{display:flex;height:100%;width:100%;background:transparent}.is-multiple .multiselect-search input,.is-single .multiselect-search input{width:100%;border:0;padding:8px 35px 8px 14px;outline:none;background:transparent;font-size:16px;font-family:inherit}.is-multiple.no-caret .multiselect-search input,.is-single.no-caret .multiselect-search input{padding:8px 14px}.is-tags .multiselect-search{flex-grow:1}.is-tags .multiselect-search input{outline:none;border:0;margin:0 0 5px 3px;flex-grow:1;min-width:100%;font-size:16px;font-family:inherit}.multiselect-clear{position:absolute;right:0;top:50%;width:36px;height:36px;background:#fff;transform:translateY(-50%)}.multiselect-clear:after,.multiselect-clear:before{position:absolute;top:12px;left:16px;content:" ";height:12px;width:2px;background-color:#999}.multiselect-clear:before{transform:rotate(45deg)}.multiselect-clear:after{transform:rotate(-45deg)}.multiselect-clear:hover:after,.multiselect-clear:hover:before{background-color:#555}.multiselect-tags{display:flex;height:100%;width:100%;align-items:center;justify-content:flex-start;padding-left:9px;margin-top:5px;flex-wrap:wrap;padding-right:36px}.no-caret .multiselect-tags{padding-right:9px}.multiselect-tag{background:#41b883;color:#fff;font-size:14px;font-weight:600;padding:0 0 0 8px;border-radius:3px;margin-right:5px;margin-bottom:5px;display:flex;align-items:center;cursor:text;white-space:nowrap}.multiselect-tag i{cursor:pointer}.multiselect-tag i:before{content:"×";color:#266d4d;font-size:14px;font-weight:700;padding:1px 5px;margin-left:3px;display:flex;font-style:normal}.multiselect-tag i:hover:before{color:#fff;background:hsla(0,0%,100%,.2)}.is-disabled .multiselect-tag{background:#a0a0a0;padding:1px 8px}.multiselect-fake-input{background:transparent;width:100%;height:1px;border:0;padding:0;font-size:0;margin-top:-1px;outline:none}.multiselect-fake-input:active,.multiselect-fake-input:focus{outline:none}.multiselect-options{position:absolute;left:0;right:0;border:1px solid #e8e8e8;margin-top:-1px;max-height:160px;overflow-y:scroll;-webkit-overflow-scrolling:touch;z-index:100;background:#fff;display:flex;flex-direction:column}.open-top .multiselect-options{transform:translateY(-100%);top:2px;flex-direction:column-reverse}.multiselect-option{display:flex;min-height:40px;padding:9px 12px;box-sizing:border-box;color:#222;text-decoration:none;align-items:center;justify-content:flex-start;text-align:left;cursor:pointer}.multiselect-option.is-pointed{background:#e6e6e6}.multiselect-option.is-disabled{background:#f9f9f9;color:#a6a6a6;cursor:not-allowed}.multiselect-option.is-selected{background:#41b883;color:#fff}.multiselect-option.is-selected.is-pointed{background:#4fbd8c}.is-multiple .multiselect-option.is-selected,.is-tags .multiselect-option.is-selected{color:#999;background:transparent}.is-multiple .multiselect-option.is-selected.is-pointed,.is-tags .multiselect-option.is-selected.is-pointed{background:#f1f1f1}.multiselect-no-options,.multiselect-no-results{display:flex;padding:10px 12px;color:#777}.multiselect-spinner{position:absolute;right:12px;top:0;width:16px;height:16px;background:#fff;display:block;transform:translateY(50%)}.multiselect-spinner:after,.multiselect-spinner:before{position:absolute;content:"";top:50%;left:50%;margin:-8px 0 0 -8px;width:16px;height:16px;border-radius:100%;border:2px solid transparent;border-top-color:#41b883;box-shadow:0 0 0 1px transparent}.is-disabled .multiselect-spinner{background:#f9f9f9}.is-disabled .multiselect-spinner:after,.is-disabled .multiselect-spinner:before{border-color:#999 transparent transparent}.multiselect-spinner:before{-webkit-animation:spinning 2.4s cubic-bezier(.41,.26,.2,.62);animation:spinning 2.4s cubic-bezier(.41,.26,.2,.62);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.multiselect-spinner:after{-webkit-animation:spinning 2.4s cubic-bezier(.51,.09,.21,.8);animation:spinning 2.4s cubic-bezier(.51,.09,.21,.8);-webkit-animation-iteration-count:infinite;animation-iteration-count:infinite}.multiselect-enter-active{transition:all .15s ease}.multiselect-leave-active{transition:all 0s}.multiselect-enter,.multiselect-leave-active{opacity:0}.multiselect-loading-enter-active,.multiselect-loading-leave-active{transition:opacity .4s ease-in-out;opacity:1}.multiselect-loading-enter,.multiselect-loading-leave-active{opacity:0}@-webkit-keyframes spinning{0%{transform:rotate(0)}to{transform:rotate(2turn)}}@keyframes spinning{0%{transform:rotate(0)}to{transform:rotate(2turn)}} \ No newline at end of file