@vueform/multiselect
Advanced tools
Comparing version 2.3.3 to 2.3.4
@@ -0,1 +1,10 @@ | ||
## v2.3.4 | ||
> `2021-05-11` | ||
### 🎉 Feature | ||
- Async options change detectiion. | ||
- Label prop change detection. | ||
- Option & label texts can contain HTML. | ||
## v2.3.3 | ||
@@ -5,3 +14,3 @@ | ||
### 🐞 Bug Fixes | ||
### 🎉 Feature | ||
- Added `attrs` prop. | ||
@@ -8,0 +17,0 @@ |
@@ -1,1 +0,1 @@ | ||
var VueformMultiselect=function(e,t){"use strict";function u(e){return-1!==[null,void 0,!1].indexOf(e)}function a(e){return(a="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 l(e,t,u){return t in e?Object.defineProperty(e,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):e[t]=u,e}function n(e,t){var u=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),u.push.apply(u,a)}return u}function r(e){for(var t=1;t<arguments.length;t++){var u=null!=arguments[t]?arguments[t]:{};t%2?n(Object(u),!0).forEach((function(t){l(e,t,u[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(u)):n(Object(u)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))}))}return e}function o(e){return function(e){if(Array.isArray(e))return i(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 i(e,t);var u=Object.prototype.toString.call(e).slice(8,-1);"Object"===u&&e.constructor&&(u=e.constructor.name);if("Map"===u||"Set"===u)return Array.from(e);if("Arguments"===u||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return i(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 i(e,t){(null==t||t>e.length)&&(t=e.length);for(var u=0,a=new Array(t);u<t;u++)a[u]=e[u];return a}function c(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?String(e).toLowerCase().trim():String(e).normalize("NFD").replace(/(?:[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0B55\u0BCD\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E47-\u0E4C\u0E4E\u0EBA\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1063\u1064\u1069-\u106D\u1087-\u108D\u108F\u109A\u109B\u135D-\u135F\u17C9-\u17D3\u17DD\u1939-\u193B\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DF9\u1DFD-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA700-\uA721\uA788-\uA78A\uA7F8\uA7F9\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uAB69-\uAB6B\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3]|\uD800\uDEE0|\uD802[\uDEE5\uDEE6]|\uD803[\uDD22-\uDD27\uDF46-\uDF50]|\uD804[\uDCB9\uDCBA\uDD33\uDD34\uDD73\uDDC0\uDDCA-\uDDCC\uDE35\uDE36\uDEE9\uDEEA\uDF3C\uDF4D\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC42\uDC46\uDCC2\uDCC3\uDDBF\uDDC0\uDE3F\uDEB6\uDEB7\uDF2B]|\uD806[\uDC39\uDC3A\uDD3D\uDD3E\uDD43\uDDE0\uDE34\uDE47\uDE99]|\uD807[\uDC3F\uDD42\uDD44\uDD45\uDD97]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF9F\uDFF0\uDFF1]|\uD834[\uDD67-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD838[\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD46\uDD48-\uDD4A])/g,"").toLowerCase().trim()}function s(t,n,o){var i=e.toRefs(t),s=i.options,d=i.mode,v=i.trackBy,p=i.limit,f=i.hideSelected,m=i.createTag,g=i.createOption,D=i.label,h=i.appendNewTag,b=i.appendNewOption,y=i.multipleLabel,C=i.object,B=i.loading,S=i.delay,F=i.resolveOnLoad,k=i.minChars,O=i.filterResults,A=i.clearOnSearch,E=i.clearOnSelect,L=i.valueProp,V=i.canDeselect,P=i.max,w=i.strict,N=i.closeOnSelect,q=i.groups,x=(i.groupLabel,i.groupOptions),T=i.groupHideEmpty,I=i.groupSelect,_=o.iv,j=o.ev,R=o.search,M=o.clearSearch,$=o.update,H=o.pointer,G=o.clearPointer,K=o.blur,W=o.focus,U=o.deactivate,z=e.ref([]),J=e.ref([]),Q=e.ref(!1),X=e.computed((function(){return m.value||g.value||!1})),Y=e.computed((function(){return void 0!==h.value?h.value:void 0===b.value||b.value})),Z=e.computed((function(){if(q.value){var e=J.value||[],t=[];return e.forEach((function(e){Ae(e[x.value]).forEach((function(u){t.push(Object.assign({},u,e.disabled?{disabled:!0}:{}))}))})),t}var u=Ae(J.value||[]);return z.value.length&&(u=u.concat(z.value)),u})),ee=e.computed((function(){return q.value?ke((J.value||[]).map((function(e){var t,u=Ae(e[x.value]);return r(r({},e),{},(l(t={group:!0},x.value,Oe(u,!1).map((function(t){return Object.assign({},t,e.disabled?{disabled:!0}:{})}))),l(t,"__VISIBLE__",Oe(u).map((function(t){return Object.assign({},t,e.disabled?{disabled:!0}:{})}))),t))}))):[]})),te=e.computed((function(){var e=Z.value;return re.value.length&&(e=re.value.concat(e)),e=Oe(e),p.value>0&&(e=e.slice(0,p.value)),e})),ue=e.computed((function(){switch(d.value){case"single":return!u(_.value[L.value]);case"multiple":case"tags":return!u(_.value)&&_.value.length>0}})),ae=e.computed((function(){return void 0!==y&&void 0!==y.value?y.value(_.value):_.value&&_.value.length>1?"".concat(_.value.length," options selected"):"1 option selected"})),le=e.computed((function(){return!Z.value.length&&!Q.value&&!re.value.length})),ne=e.computed((function(){return Z.value.length>0&&0==te.value.length&&(R.value&&q.value||!q.value)})),re=e.computed((function(){var e;return!1!==X.value&&R.value?-1!==Be(R.value)?[]:[(e={},l(e,L.value,R.value),l(e,D.value,R.value),l(e,oe.value,R.value),e)]:[]})),oe=e.computed((function(){return v.value||D.value})),ie=e.computed((function(){switch(d.value){case"single":return null;case"multiple":case"tags":return[]}})),ce=e.computed((function(){return B.value||Q.value})),se=function(e){switch("object"!==a(e)&&(e=Ce(e)),d.value){case"single":$(e);break;case"multiple":case"tags":$(_.value.concat(e))}n.emit("select",ve(e),e)},de=function(e){switch("object"!==a(e)&&(e=Ce(e)),d.value){case"single":fe();break;case"tags":case"multiple":$(Array.isArray(e)?_.value.filter((function(t){return-1===e.map((function(e){return e[L.value]})).indexOf(t[L.value])})):_.value.filter((function(t){return t[L.value]!=e[L.value]})))}n.emit("deselect",ve(e),e)},ve=function(e){return C.value?e:e[L.value]},pe=function(e){de(e)},fe=function(){n.emit("clear"),$(ie.value)},me=function(e){if(void 0!==e.group)return"single"!==d.value&&(ye(e[x.value])&&e[x.value].length);switch(d.value){case"single":return!u(_.value)&&_.value[L.value]==e[L.value];case"tags":case"multiple":return!u(_.value)&&-1!==_.value.map((function(e){return e[L.value]})).indexOf(e[L.value])}},ge=function(e){return!0===e.disabled},De=function(){return!(void 0===P||-1===P.value||!ue.value&&P.value>0)&&_.value.length>=P.value},he=function(e){void 0===Ce(e[L.value])&&X.value&&(n.emit("tag",e[L.value]),n.emit("option",e[L.value]),Y.value&&Fe(e),M())},be=function(e){return void 0===e.find((function(e){return!me(e)&&!e.disabled}))},ye=function(e){return void 0===e.find((function(e){return!me(e)}))},Ce=function(e){return Z.value[Z.value.map((function(e){return String(e[L.value])})).indexOf(String(e))]},Be=function(e){return Z.value.map((function(e){return e[oe.value]})).indexOf(e)},Se=function(e){return-1!==["tags","multiple"].indexOf(d.value)&&f.value&&me(e)},Fe=function(e){z.value.push(e)},ke=function(e){return T.value?e.filter((function(e){return R.value?e.__VISIBLE__.length:e[x.value].length})):e.filter((function(e){return!R.value||e.__VISIBLE__.length}))},Oe=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],u=e;return R.value&&O.value&&(u=u.filter((function(e){return-1!==c(e[oe.value],w.value).indexOf(c(R.value,w.value))}))),f.value&&t&&(u=u.filter((function(e){return!Se(e)}))),u},Ae=function(e){var t,u=e;return t=u,"[object Object]"===Object.prototype.toString.call(t)&&(u=Object.keys(u).map((function(e){var t,a=u[e];return l(t={},L.value,e),l(t,oe.value,a),l(t,D.value,a),t}))),u=u.map((function(e){var t;return"object"===a(e)?e:(l(t={},L.value,e),l(t,oe.value,e),l(t,D.value,e),t)}))},Ee=function(){u(j.value)||(_.value=Ve(j.value))},Le=function(e){Q.value=!0,s.value(R.value).then((function(t){J.value=t,"function"==typeof e&&e(t),Q.value=!1}))},Ve=function(e){return u(e)?"single"===d.value?{}:[]:C.value?e:"single"===d.value?Ce(e)||{}:e.filter((function(e){return!!Ce(e)})).map((function(e){return Ce(e)}))};if("single"!==d.value&&!u(j.value)&&!Array.isArray(j.value))throw new Error('v-model must be an array when using "'.concat(d.value,'" mode'));return s&&"function"==typeof s.value?F.value?Le(Ee):1==C.value&&Ee():(J.value=s.value,Ee()),S.value>-1&&e.watch(R,(function(e){e.length<k.value||(Q.value=!0,A.value&&(J.value=[]),setTimeout((function(){e==R.value&&s.value(R.value).then((function(t){e!=R.value&&R.value||(J.value=t,H.value=te.value.filter((function(e){return!0!==e.disabled}))[0]||null,Q.value=!1)}))}),S.value))}),{flush:"sync"}),e.watch(j,(function(e){var t,a,l;if(u(e))_.value=Ve(e);else switch(d.value){case"single":(C.value?e[L.value]!=_.value[L.value]:e!=_.value[L.value])&&(_.value=Ve(e));break;case"multiple":case"tags":t=C.value?e.map((function(e){return e[L.value]})):e,a=_.value.map((function(e){return e[L.value]})),l=a.slice().sort(),t.length===a.length&&t.slice().sort().every((function(e,t){return e===l[t]}))||(_.value=Ve(e))}}),{deep:!0}),"function"!=typeof t.options&&e.watch(s,(function(e,u){J.value=t.options,Object.keys(_.value).length||Ee(),function(){if(ue.value)if("single"===d.value){var e=Ce(_.value[L.value])[D.value];_.value[D.value]=e,C.value&&(j.value[D.value]=e)}else _.value.forEach((function(e,t){var u=Ce(_.value[t][L.value])[D.value];_.value[t][D.value]=u,C.value&&(j.value[t][D.value]=u)}))}()})),{fo:te,filteredOptions:te,hasSelected:ue,multipleLabelText:ae,eo:Z,extendedOptions:Z,fg:ee,filteredGroups:ee,noOptions:le,noResults:ne,resolving:Q,busy:ce,select:se,deselect:de,remove:pe,selectAll:function(){"single"!==d.value&&se(te.value)},clear:fe,isSelected:me,isDisabled:ge,isMax:De,getOption:Ce,handleOptionClick:function(e){if(!ge(e)){switch(d.value){case"single":if(me(e))return void(V.value&&de(e));he(e),K(),se(e);break;case"multiple":if(me(e))return void de(e);if(De())return;he(e),se(e),E.value&&M(),f.value&&G(),N.value&&K();break;case"tags":if(me(e))return void de(e);if(De())return;he(e),E.value&&M(),se(e),f.value&&G(),N.value&&K()}N.value?U():W()}},handleGroupClick:function(e){if(!ge(e)&&"single"!==d.value&&I.value){switch(d.value){case"multiple":case"tags":be(e[x.value])?de(e[x.value]):se(e[x.value].filter((function(e){return-1===_.value.map((function(e){return e[L.value]})).indexOf(e[L.value])})).filter((function(e){return!e.disabled})).filter((function(e,t){return _.value.length+1+t<=P.value||-1===P.value})))}N.value&&U()}},handleTagRemove:function(e,t){0===t.button?pe(e):t.preventDefault()},refreshOptions:function(e){Le(e)},resolveOptions:Le}}var d={name:"Multiselect",emits:["open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},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:void 0},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},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 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},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:[Object],default:()=>({})}},setup(t,a){const l=function(t,u){var a=e.toRefs(t),l=a.value,n=a.modelValue,r=a.mode,o=a.valueProp,i=e.ref("single"!==r.value?[]:{}),c=void 0!==u.expose?n:l,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}}(t,a),n=function(t,u,a){var l=e.toRefs(t),n=l.groupSelect,r=l.mode,o=l.groups,i=e.ref(null),c=function(e){void 0===e||null!==e&&e.disabled||o.value&&e&&e.group&&("single"===r.value||!n.value)||(i.value=e)};return{pointer:i,setPointer:c,clearPointer:function(){c(null)}}}(t),i=function(t,u,a){var l=e.toRefs(t).disabled,n=e.ref(!1);return{isOpen:n,open:function(){n.value||l.value||(n.value=!0,u.emit("open"))},close:function(){n.value&&(n.value=!1,u.emit("close"))}}}(t,a),c=function(t,u,a){var l=e.ref(null),n=e.ref(null);return e.watch(l,(function(e){u.emit("search-change",e)})),{search:l,input:n,clearSearch:function(){l.value=""},handleSearchInput:function(e){l.value=e.target.value},handlePaste:function(e){u.emit("paste",e)}}}(0,a),d=function(t,a,l){var n=e.toRefs(t),r=n.object,o=n.valueProp,i=n.mode,c=l.iv,s=function(e){return r.value||u(e)?e:Array.isArray(e)?e.map((function(e){return e[o.value]})):e[o.value]},d=function(e){return u(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)}}}(t,a,{iv:l.iv}),v=function(t,u,a){var l=e.toRefs(t),n=l.searchable,r=l.disabled,o=a.input,i=a.open,c=a.close,s=a.clearSearch,d=e.ref(null),v=e.ref(!1),p=e.computed((function(){return n.value||r.value?-1:0})),f=function(){n.value&&o.value.blur(),d.value.blur()},m=function(){n.value&&!r.value&&o.value.focus()},g=function(){v.value=!1,setTimeout((function(){v.value||(c(),s())}),1)};return{multiselect:d,tabindex:p,isActive:v,blur:f,focus:m,handleFocus:function(){m()},activate:function(){r.value||(v.value=!0,i())},deactivate:g,handleCaretClick:function(){g(),f()}}}(t,0,{input:c.input,open:i.open,close:i.close,clearSearch:c.clearSearch}),p=s(t,a,{ev:l.ev,iv:l.iv,search:c.search,clearSearch:c.clearSearch,update:d.update,pointer:n.pointer,clearPointer:n.clearPointer,blur:v.blur,focus:v.focus,deactivate:v.deactivate}),f=function(t,u,a){var l=e.toRefs(t),n=l.valueProp,r=l.showOptions,i=l.searchable,c=l.groupLabel,s=l.groups,d=l.mode,v=l.groupSelect,p=a.fo,f=a.fg,m=a.handleOptionClick,g=a.handleGroupClick,D=a.search,h=a.pointer,b=a.setPointer,y=a.clearPointer,C=a.multiselect,B=e.computed((function(){return p.value.filter((function(e){return!e.disabled}))})),S=e.computed((function(){return f.value.filter((function(e){return!e.disabled}))})),F=e.computed((function(){return"single"!==d.value&&v.value})),k=e.computed((function(){return h.value&&h.value.group})),O=e.computed((function(){return T(h.value)})),A=e.computed((function(){var e=k.value?h.value:T(h.value),t=S.value.map((function(e){return e[c.value]})).indexOf(e[c.value]),u=S.value[t-1];return void 0===u&&(u=L.value),u})),E=e.computed((function(){var e=S.value.map((function(e){return e.label})).indexOf(k.value?h.value[c.value]:T(h.value)[c.value])+1;return S.value.length<=e&&(e=0),S.value[e]})),L=e.computed((function(){return o(S.value).slice(-1)[0]})),V=e.computed((function(){return h.value.__VISIBLE__.filter((function(e){return!e.disabled}))[0]})),P=e.computed((function(){var e=O.value.__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[n.value]})).indexOf(h.value[n.value])-1]})),w=e.computed((function(){var e=T(h.value).__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[n.value]})).indexOf(h.value[n.value])+1]})),N=e.computed((function(){return o(A.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),q=e.computed((function(){return o(L.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),x=function(){b(B.value[0]||null)},T=function(e){return S.value.find((function(t){return-1!==t.__VISIBLE__.map((function(e){return e[n.value]})).indexOf(e[n.value])}))},I=function(){var e=C.value.querySelector("[data-pointed]");if(e){var t=e.parentElement.parentElement;s.value&&(t=k.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop<t.scrollTop&&(t.scrollTop=e.offsetTop)}};return e.watch(D,(function(e){i.value&&(e.length&&r.value?x():y())})),{pointer:h,canPointGroups:F,isPointed:function(e){return!(!h.value||!(!e.group&&h.value[n.value]==e[n.value]||void 0!==e.group&&h.value[c.value]==e[c.value]))||void 0},setPointerFirst:x,selectPointer:function(){h.value&&!0!==h.value.disabled&&(k.value?g(h.value):m(h.value))},forwardPointer:function(){if(null===h.value)b((s.value&&F.value?S.value[0]:B.value[0])||null);else if(s.value&&F.value){var t=k.value?V.value:w.value;void 0===t&&(t=E.value),b(t||null)}else{var u=B.value.map((function(e){return e[n.value]})).indexOf(h.value[n.value])+1;B.value.length<=u&&(u=0),b(B.value[u]||null)}e.nextTick((function(){I()}))},backwardPointer:function(){if(null===h.value){var t=B.value[B.value.length-1];s.value&&F.value&&void 0===(t=q.value)&&(t=L.value),b(t||null)}else if(s.value&&F.value){var u=k.value?N.value:P.value;void 0===u&&(u=k.value?A.value:O.value),b(u||null)}else{var a=B.value.map((function(e){return e[n.value]})).indexOf(h.value[n.value])-1;a<0&&(a=B.value.length-1),b(B.value[a]||null)}e.nextTick((function(){I()}))}}}(t,0,{fo:p.fo,fg:p.fg,handleOptionClick:p.handleOptionClick,handleGroupClick:p.handleGroupClick,search:c.search,pointer:n.pointer,setPointer:n.setPointer,clearPointer:n.clearPointer,multiselect:v.multiselect}),m=function(t,u,a){var l=e.toRefs(t),n=l.mode,r=l.addTagOn,i=l.openDirection,c=l.searchable,s=l.showOptions,d=l.valueProp,v=l.groups,p=l.addOptionOn,f=l.createTag,m=l.createOption,g=a.iv,D=a.update,h=a.search,b=a.setPointer,y=a.selectPointer,C=a.backwardPointer,B=a.forwardPointer,S=a.blur,F=a.fo,k=e.computed((function(){return f.value||m.value||!1})),O=e.computed((function(){return void 0!==r.value?r.value:void 0!==p.value?p.value:["enter"]})),A=function(){"tags"===n.value&&!s.value&&k.value&&c.value&&!v.value&&b(F.value[F.value.map((function(e){return e[d.value]})).indexOf(h.value)])};return{handleKeydown:function(e){switch(e.key){case"Backspace":if("single"===n.value)return;if(c.value&&-1===[null,""].indexOf(h.value))return;if(0===g.value.length)return;D(o(g.value).slice(0,-1));break;case"Enter":if(e.preventDefault(),-1===O.value.indexOf("enter")&&k.value)return;A(),y();break;case" ":if(!k.value&&!c.value)return e.preventDefault(),A(),void y();if(!k.value)return!1;if(-1===O.value.indexOf("space")&&k.value)return;e.preventDefault(),A(),y();break;case"Tab":case";":case",":if(-1===O.value.indexOf(e.key.toLowerCase())||!k.value)return;A(),y(),e.preventDefault();break;case"Escape":S();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;"top"===i.value?B():C();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;"top"===i.value?C():B()}},preparePointer:A}}(t,0,{iv:l.iv,update:d.update,search:c.search,setPointer:n.setPointer,selectPointer:f.selectPointer,backwardPointer:f.backwardPointer,forwardPointer:f.forwardPointer,blur:v.blur,fo:p.fo}),g=function(t,u,a){var l=e.toRefs(t),n=l.classes,o=l.disabled,i=l.openDirection,c=l.showOptions,s=a.isOpen,d=a.isPointed,v=a.isSelected,p=a.isDisabled,f=a.isActive,m=a.canPointGroups,g=a.resolving,D=a.fo,h=e.computed((function(){return r({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",spacer:"multiselect-spacer"},n.value)})),b=e.computed((function(){return!!(s.value&&c.value&&(!g.value||g.value&&D.value.length))}));return{classList:e.computed((function(){var e=h.value;return{container:[e.container].concat(o.value?e.containerDisabled:[]).concat(b.value&&"top"===i.value?e.containerOpenTop:[]).concat(b.value&&"top"!==i.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(o.value?e.tagDisabled:[]),tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,dropdown:[e.dropdown].concat("top"===i.value?e.dropdownTop:[]).concat(s.value&&c.value&&b.value?[]:e.dropdownHidden),options:[e.options].concat("top"===i.value?e.optionsTop:[]),group:e.group,groupLabel:function(t){var u=[e.groupLabel];return d(t)?u.push(v(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):v(t)&&m.value?u.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&u.push(e.groupLabelDisabled),m.value&&u.push(e.groupLabelPointable),u},groupOptions:e.groupOptions,option:function(t,u){var a=[e.option];return d(t)?a.push(v(t)?e.optionSelectedPointed:e.optionPointed):v(t)?a.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||u&&p(u))&&a.push(e.optionDisabled),a},noOptions:e.noOptions,noResults:e.noResults,fakeInput:e.fakeInput}})),showDropdown:b}}(t,0,{isOpen:i.isOpen,isPointed:f.isPointed,canPointGroups:f.canPointGroups,isSelected:p.isSelected,isDisabled:p.isDisabled,isActive:v.isActive,resolving:p.resolving,fo:p.fo});return{...l,...i,...v,...n,...d,...c,...p,...f,...m,...g}}};return d.render=function(e,u,a,l,n,r){return t.openBlock(),t.createBlock("div",{ref:"multiselect",tabindex:e.tabindex,class:e.classList.container,id:a.id,onFocusin:u[7]||(u[7]=(...t)=>e.activate&&e.activate(...t)),onFocusout:u[8]||(u[8]=(...t)=>e.deactivate&&e.deactivate(...t)),onKeydown:u[9]||(u[9]=(...t)=>e.handleKeydown&&e.handleKeydown(...t)),onFocus:u[10]||(u[10]=(...t)=>e.handleFocus&&e.handleFocus(...t))},[t.createCommentVNode(" Search "),"tags"!==a.mode&&a.searchable&&!a.disabled?(t.openBlock(),t.createBlock("input",t.mergeProps({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:a.autocomplete},a.attrs,{onInput:u[1]||(u[1]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onPaste:u[2]||(u[2]=t.withModifiers(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input"}),null,16,["type","modelValue","value","autocomplete"])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Tags (with search) "),"tags"==a.mode?(t.openBlock(),t.createBlock("div",{key:1,class:e.classList.tags},[(t.openBlock(!0),t.createBlock(t.Fragment,null,t.renderList(e.iv,((u,l,n)=>t.renderSlot(e.$slots,"tag",{option:u,handleTagRemove:e.handleTagRemove,disabled:a.disabled},(()=>[(t.openBlock(),t.createBlock("span",{class:e.classList.tag,key:n},[t.createTextVNode(t.toDisplayString(u[a.label])+" ",1),a.disabled?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createBlock("span",{key:0,class:e.classList.tagRemove,onClick:t=>e.handleTagRemove(u,t)},[t.createVNode("span",{class:e.classList.tagRemoveIcon},null,2)],10,["onClick"]))],2))])))),256)),t.createVNode("div",{class:e.classList.tagsSearchWrapper},[t.createCommentVNode(" Used for measuring search width "),t.createVNode("span",{class:e.classList.tagsSearchCopy},t.toDisplayString(e.search),3),t.createCommentVNode(" Actual search input "),a.searchable&&!a.disabled?(t.openBlock(),t.createBlock("input",t.mergeProps({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,autocomplete:a.autocomplete},a.attrs,{onInput:u[3]||(u[3]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onPaste:u[4]||(u[4]=t.withModifiers(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input"}),null,16,["type","modelValue","value","autocomplete"])):t.createCommentVNode("v-if",!0)],2)],2)):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Single label "),"single"==a.mode&&e.hasSelected&&!e.search&&e.iv?t.renderSlot(e.$slots,"singlelabel",{key:2,value:e.iv},(()=>[t.createVNode("div",{class:e.classList.singleLabel},[t.createVNode("span",{class:e.classList.singleLabelText},t.toDisplayString(e.iv[a.label]),3)],2)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Multiple label "),"multiple"==a.mode&&e.hasSelected&&!e.search?t.renderSlot(e.$slots,"multiplelabel",{key:3,values:e.iv},(()=>[t.createVNode("div",{class:e.classList.multipleLabel},t.toDisplayString(e.multipleLabelText),3)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Placeholder "),!a.placeholder||e.hasSelected||e.search?t.createCommentVNode("v-if",!0):t.renderSlot(e.$slots,"placeholder",{key:4},(()=>[t.createVNode("div",{class:e.classList.placeholder},t.toDisplayString(a.placeholder),3)])),t.createCommentVNode(" Spinner "),e.busy&&e.isActive?t.renderSlot(e.$slots,"spinner",{key:5},(()=>[t.createVNode("span",{class:e.classList.spinner},null,2)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Clear "),e.hasSelected&&!a.disabled&&a.canClear&&!e.busy?t.renderSlot(e.$slots,"clear",{key:6,clear:e.clear},(()=>[t.createVNode("span",{class:e.classList.clear,onMousedown:u[5]||(u[5]=(...t)=>e.clear&&e.clear(...t))},[t.createVNode("span",{class:e.classList.clearIcon},null,2)],34)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Caret "),a.caret&&a.showOptions?t.renderSlot(e.$slots,"caret",{key:7},(()=>[t.createVNode("span",{class:e.classList.caret,onClick:u[6]||(u[6]=(...t)=>e.handleCaretClick&&e.handleCaretClick(...t))},null,2)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Options "),t.createVNode("div",{class:e.classList.dropdown,tabindex:"-1"},[t.renderSlot(e.$slots,"beforelist",{options:e.fo}),t.createVNode("ul",{class:e.classList.options},[a.groups?(t.openBlock(!0),t.createBlock(t.Fragment,{key:0},t.renderList(e.fg,((u,l,n)=>(t.openBlock(),t.createBlock("li",{class:e.classList.group,key:n},[t.createVNode("div",{class:e.classList.groupLabel(u),"data-pointed":e.isPointed(u),onMouseenter:t=>e.setPointer(u),onClick:t=>e.handleGroupClick(u)},[t.renderSlot(e.$slots,"grouplabel",{group:u},(()=>[t.createVNode("span",null,t.toDisplayString(u[a.groupLabel]),1)]))],42,["data-pointed","onMouseenter","onClick"]),t.createVNode("ul",{class:e.classList.groupOptions},[(t.openBlock(!0),t.createBlock(t.Fragment,null,t.renderList(u.__VISIBLE__,((l,n,r)=>(t.openBlock(),t.createBlock("li",{class:e.classList.option(l,u),key:r,"data-pointed":e.isPointed(l),onMouseenter:t=>e.setPointer(l),onClick:t=>e.handleOptionClick(l)},[t.renderSlot(e.$slots,"option",{option:l,search:e.search},(()=>[t.createVNode("span",null,t.toDisplayString(l[a.label]),1)]))],42,["data-pointed","onMouseenter","onClick"])))),128))],2)],2)))),128)):(t.openBlock(!0),t.createBlock(t.Fragment,{key:1},t.renderList(e.fo,((u,l,n)=>(t.openBlock(),t.createBlock("li",{class:e.classList.option(u),key:n,"data-pointed":e.isPointed(u),onMouseenter:t=>e.setPointer(u),onClick:t=>e.handleOptionClick(u)},[t.renderSlot(e.$slots,"option",{option:u,search:e.search},(()=>[t.createVNode("span",null,t.toDisplayString(u[a.label]),1)]))],42,["data-pointed","onMouseenter","onClick"])))),128))],2),e.noOptions?t.renderSlot(e.$slots,"nooptions",{key:0},(()=>[t.createVNode("div",{class:e.classList.noOptions,innerHTML:a.noOptionsText},null,10,["innerHTML"])])):t.createCommentVNode("v-if",!0),e.noResults?t.renderSlot(e.$slots,"noresults",{key:1},(()=>[t.createVNode("div",{class:e.classList.noResults,innerHTML:a.noResultsText},null,10,["innerHTML"])])):t.createCommentVNode("v-if",!0),t.renderSlot(e.$slots,"afterlist",{options:e.fo})],2),t.createCommentVNode(" Hacky input element to show HTML5 required warning "),a.required?(t.openBlock(),t.createBlock("input",{key:8,class:e.classList.fakeInput,tabindex:"-1",value:e.textValue,required:""},null,10,["value"])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Native input support "),a.nativeSupport?(t.openBlock(),t.createBlock(t.Fragment,{key:9},["single"==a.mode?(t.openBlock(),t.createBlock("input",{key:0,type:"hidden",name:a.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,u)=>(t.openBlock(),t.createBlock("input",{type:"hidden",name:`${a.name}[]`,value:e,key:u},null,8,["name","value"])))),128))],64)):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Create height for empty input "),t.createVNode("div",{class:e.classList.spacer},null,2)],42,["tabindex","id"])},d.__file="src/Multiselect.vue",d}(Vue,Vue); | ||
var VueformMultiselect=function(e,t){"use strict";function u(e){return-1!==[null,void 0,!1].indexOf(e)}function a(e){return(a="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 l(e,t,u){return t in e?Object.defineProperty(e,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):e[t]=u,e}function n(e,t){var u=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),u.push.apply(u,a)}return u}function r(e){for(var t=1;t<arguments.length;t++){var u=null!=arguments[t]?arguments[t]:{};t%2?n(Object(u),!0).forEach((function(t){l(e,t,u[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(u)):n(Object(u)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))}))}return e}function o(e){return function(e){if(Array.isArray(e))return i(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 i(e,t);var u=Object.prototype.toString.call(e).slice(8,-1);"Object"===u&&e.constructor&&(u=e.constructor.name);if("Map"===u||"Set"===u)return Array.from(e);if("Arguments"===u||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return i(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 i(e,t){(null==t||t>e.length)&&(t=e.length);for(var u=0,a=new Array(t);u<t;u++)a[u]=e[u];return a}function c(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?String(e).toLowerCase().trim():String(e).normalize("NFD").replace(/(?:[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0B55\u0BCD\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E47-\u0E4C\u0E4E\u0EBA\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1063\u1064\u1069-\u106D\u1087-\u108D\u108F\u109A\u109B\u135D-\u135F\u17C9-\u17D3\u17DD\u1939-\u193B\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DF9\u1DFD-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA700-\uA721\uA788-\uA78A\uA7F8\uA7F9\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uAB69-\uAB6B\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3]|\uD800\uDEE0|\uD802[\uDEE5\uDEE6]|\uD803[\uDD22-\uDD27\uDF46-\uDF50]|\uD804[\uDCB9\uDCBA\uDD33\uDD34\uDD73\uDDC0\uDDCA-\uDDCC\uDE35\uDE36\uDEE9\uDEEA\uDF3C\uDF4D\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC42\uDC46\uDCC2\uDCC3\uDDBF\uDDC0\uDE3F\uDEB6\uDEB7\uDF2B]|\uD806[\uDC39\uDC3A\uDD3D\uDD3E\uDD43\uDDE0\uDE34\uDE47\uDE99]|\uD807[\uDC3F\uDD42\uDD44\uDD45\uDD97]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF9F\uDFF0\uDFF1]|\uD834[\uDD67-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD838[\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD46\uDD48-\uDD4A])/g,"").toLowerCase().trim()}function s(t,n,o){var i=e.toRefs(t),s=i.options,v=i.mode,d=i.trackBy,p=i.limit,f=i.hideSelected,m=i.createTag,g=i.createOption,h=i.label,D=i.appendNewTag,b=i.appendNewOption,y=i.multipleLabel,C=i.object,B=i.loading,F=i.delay,S=i.resolveOnLoad,k=i.minChars,O=i.filterResults,A=i.clearOnSearch,L=i.clearOnSelect,E=i.valueProp,V=i.canDeselect,P=i.max,w=i.strict,N=i.closeOnSelect,T=i.groups,q=(i.groupLabel,i.groupOptions),x=i.groupHideEmpty,I=i.groupSelect,_=e.getCurrentInstance().proxy,j=o.iv,R=o.ev,M=o.search,H=o.clearSearch,$=o.update,G=o.pointer,K=o.clearPointer,W=o.blur,U=o.focus,z=o.deactivate,J=e.ref([]),Q=e.ref([]),X=e.ref(!1),Y=e.ref(null),Z=e.computed((function(){return m.value||g.value||!1})),ee=e.computed((function(){return void 0!==D.value?D.value:void 0===b.value||b.value})),te=e.computed((function(){if(T.value){var e=Q.value||[],t=[];return e.forEach((function(e){Ee(e[q.value]).forEach((function(u){t.push(Object.assign({},u,e.disabled?{disabled:!0}:{}))}))})),t}var u=Ee(Q.value||[]);return J.value.length&&(u=u.concat(J.value)),u})),ue=e.computed((function(){return T.value?Ae((Q.value||[]).map((function(e){var t,u=Ee(e[q.value]);return r(r({},e),{},(l(t={group:!0},q.value,Le(u,!1).map((function(t){return Object.assign({},t,e.disabled?{disabled:!0}:{})}))),l(t,"__VISIBLE__",Le(u).map((function(t){return Object.assign({},t,e.disabled?{disabled:!0}:{})}))),t))}))):[]})),ae=e.computed((function(){var e=te.value;return ie.value.length&&(e=ie.value.concat(e)),e=Le(e),p.value>0&&(e=e.slice(0,p.value)),e})),le=e.computed((function(){switch(v.value){case"single":return!u(j.value[E.value]);case"multiple":case"tags":return!u(j.value)&&j.value.length>0}})),ne=e.computed((function(){return void 0!==y&&void 0!==y.value?y.value(j.value,_):j.value&&j.value.length>1?"".concat(j.value.length," options selected"):"1 option selected"})),re=e.computed((function(){return!te.value.length&&!X.value&&!ie.value.length})),oe=e.computed((function(){return te.value.length>0&&0==ae.value.length&&(M.value&&T.value||!T.value)})),ie=e.computed((function(){var e;return!1!==Z.value&&M.value?-1!==Se(M.value)?[]:[(e={},l(e,E.value,M.value),l(e,h.value,M.value),l(e,ce.value,M.value),e)]:[]})),ce=e.computed((function(){return d.value||h.value})),se=e.computed((function(){switch(v.value){case"single":return null;case"multiple":case"tags":return[]}})),ve=e.computed((function(){return B.value||X.value})),de=function(e){switch("object"!==a(e)&&(e=Fe(e)),v.value){case"single":$(e);break;case"multiple":case"tags":$(j.value.concat(e))}n.emit("select",fe(e),e)},pe=function(e){switch("object"!==a(e)&&(e=Fe(e)),v.value){case"single":ge();break;case"tags":case"multiple":$(Array.isArray(e)?j.value.filter((function(t){return-1===e.map((function(e){return e[E.value]})).indexOf(t[E.value])})):j.value.filter((function(t){return t[E.value]!=e[E.value]})))}n.emit("deselect",fe(e),e)},fe=function(e){return C.value?e:e[E.value]},me=function(e){pe(e)},ge=function(){n.emit("clear"),$(se.value)},he=function(e){if(void 0!==e.group)return"single"!==v.value&&(Be(e[q.value])&&e[q.value].length);switch(v.value){case"single":return!u(j.value)&&j.value[E.value]==e[E.value];case"tags":case"multiple":return!u(j.value)&&-1!==j.value.map((function(e){return e[E.value]})).indexOf(e[E.value])}},De=function(e){return!0===e.disabled},be=function(){return!(void 0===P||-1===P.value||!le.value&&P.value>0)&&j.value.length>=P.value},ye=function(e){void 0===Fe(e[E.value])&&Z.value&&(n.emit("tag",e[E.value]),n.emit("option",e[E.value]),ee.value&&Oe(e),H())},Ce=function(e){return void 0===e.find((function(e){return!he(e)&&!e.disabled}))},Be=function(e){return void 0===e.find((function(e){return!he(e)}))},Fe=function(e){return te.value[te.value.map((function(e){return String(e[E.value])})).indexOf(String(e))]},Se=function(e){return te.value.map((function(e){return e[ce.value]})).indexOf(e)},ke=function(e){return-1!==["tags","multiple"].indexOf(v.value)&&f.value&&he(e)},Oe=function(e){J.value.push(e)},Ae=function(e){return x.value?e.filter((function(e){return M.value?e.__VISIBLE__.length:e[q.value].length})):e.filter((function(e){return!M.value||e.__VISIBLE__.length}))},Le=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],u=e;return M.value&&O.value&&(u=u.filter((function(e){return-1!==c(e[ce.value],w.value).indexOf(c(M.value,w.value))}))),f.value&&t&&(u=u.filter((function(e){return!ke(e)}))),u},Ee=function(e){var t,u=e;return t=u,"[object Object]"===Object.prototype.toString.call(t)&&(u=Object.keys(u).map((function(e){var t,a=u[e];return l(t={},E.value,e),l(t,ce.value,a),l(t,h.value,a),t}))),u=u.map((function(e){var t;return"object"===a(e)?e:(l(t={},E.value,e),l(t,ce.value,e),l(t,h.value,e),t)}))},Ve=function(){u(R.value)||(j.value=Ne(R.value))},Pe=function(e){return X.value=!0,new Promise((function(t,u){s.value(M.value,_).then((function(t){Q.value=t||[],"function"==typeof e&&e(t),X.value=!1})).catch((function(e){console.error(e),Q.value=[],X.value=!1})).finally((function(){t()}))}))},we=function(){if(le.value)if("single"===v.value){var e=Fe(j.value[E.value]);if(void 0!==e){var t=e[h.value];j.value[h.value]=t,C.value&&(R.value[h.value]=t)}}else j.value.forEach((function(e,t){var u=Fe(j.value[t][E.value]);if(void 0!==u){var a=u[h.value];j.value[t][h.value]=a,C.value&&(R.value[t][h.value]=a)}}))},Ne=function(e){return u(e)?"single"===v.value?{}:[]:C.value?e:"single"===v.value?Fe(e)||{}:e.filter((function(e){return!!Fe(e)})).map((function(e){return Fe(e)}))},Te=function(){Y.value=e.watch(M,(function(e){e.length<k.value||!e||(X.value=!0,A.value&&(Q.value=[]),setTimeout((function(){e==M.value&&s.value(M.value,_).then((function(t){e!=M.value&&M.value||(Q.value=t,G.value=ae.value.filter((function(e){return!0!==e.disabled}))[0]||null,X.value=!1)})).catch((function(e){console.error(e)}))}),F.value))}),{flush:"sync"})};if("single"!==v.value&&!u(R.value)&&!Array.isArray(R.value))throw new Error('v-model must be an array when using "'.concat(v.value,'" mode'));return s&&"function"==typeof s.value?S.value?Pe(Ve):1==C.value&&Ve():(Q.value=s.value,Ve()),F.value>-1&&Te(),e.watch(F,(function(e,t){Y.value&&Y.value(),e>=0&&Te()})),e.watch(R,(function(e){var t,a,l;if(u(e))j.value=Ne(e);else switch(v.value){case"single":(C.value?e[E.value]!=j.value[E.value]:e!=j.value[E.value])&&(j.value=Ne(e));break;case"multiple":case"tags":t=C.value?e.map((function(e){return e[E.value]})):e,a=j.value.map((function(e){return e[E.value]})),l=a.slice().sort(),t.length===a.length&&t.slice().sort().every((function(e,t){return e===l[t]}))||(j.value=Ne(e))}}),{deep:!0}),e.watch(s,(function(e,u){"function"==typeof t.options?S.value&&Pe((function(){Object.keys(j.value).length&&Ve()})):(Q.value=t.options,Object.keys(j.value).length||Ve(),we())})),e.watch(h,we),{fo:ae,filteredOptions:ae,hasSelected:le,multipleLabelText:ne,eo:te,extendedOptions:te,fg:ue,filteredGroups:ue,noOptions:re,noResults:oe,resolving:X,busy:ve,select:de,deselect:pe,remove:me,selectAll:function(){"single"!==v.value&&de(ae.value)},clear:ge,isSelected:he,isDisabled:De,isMax:be,getOption:Fe,handleOptionClick:function(e){if(!De(e)){switch(v.value){case"single":if(he(e))return void(V.value&&pe(e));ye(e),W(),de(e);break;case"multiple":if(he(e))return void pe(e);if(be())return;ye(e),de(e),L.value&&H(),f.value&&K(),N.value&&W();break;case"tags":if(he(e))return void pe(e);if(be())return;ye(e),L.value&&H(),de(e),f.value&&K(),N.value&&W()}N.value?z():U()}},handleGroupClick:function(e){if(!De(e)&&"single"!==v.value&&I.value){switch(v.value){case"multiple":case"tags":Ce(e[q.value])?pe(e[q.value]):de(e[q.value].filter((function(e){return-1===j.value.map((function(e){return e[E.value]})).indexOf(e[E.value])})).filter((function(e){return!e.disabled})).filter((function(e,t){return j.value.length+1+t<=P.value||-1===P.value})))}N.value&&z()}},handleTagRemove:function(e,t){0===t.button?me(e):t.preventDefault()},refreshOptions:function(e){Pe(e)},resolveOptions:Pe,refreshLabels:we}}var v={name:"Multiselect",emits:["open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},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:void 0},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},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 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},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:[Object],default:()=>({})}},setup(t,a){const l=function(t,u){var a=e.toRefs(t),l=a.value,n=a.modelValue,r=a.mode,o=a.valueProp,i=e.ref("single"!==r.value?[]:{}),c=void 0!==u.expose?n:l,s=e.computed((function(){return"single"===r.value?i.value[o.value]:i.value.map((function(e){return e[o.value]}))})),v=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:v,plainValue:s}}(t,a),n=function(t,u,a){var l=e.toRefs(t),n=l.groupSelect,r=l.mode,o=l.groups,i=e.ref(null),c=function(e){void 0===e||null!==e&&e.disabled||o.value&&e&&e.group&&("single"===r.value||!n.value)||(i.value=e)};return{pointer:i,setPointer:c,clearPointer:function(){c(null)}}}(t),i=function(t,u,a){var l=e.toRefs(t).disabled,n=e.ref(!1);return{isOpen:n,open:function(){n.value||l.value||(n.value=!0,u.emit("open"))},close:function(){n.value&&(n.value=!1,u.emit("close"))}}}(t,a),c=function(t,u,a){var l=e.ref(null),n=e.ref(null);return e.watch(l,(function(e){u.emit("search-change",e)})),{search:l,input:n,clearSearch:function(){l.value=""},handleSearchInput:function(e){l.value=e.target.value},handlePaste:function(e){u.emit("paste",e)}}}(0,a),v=function(t,a,l){var n=e.toRefs(t),r=n.object,o=n.valueProp,i=n.mode,c=l.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);a.emit("change",t),a.emit("input",t),a.emit("update:modelValue",t)}}}(t,a,{iv:l.iv}),d=function(t,u,a){var l=e.toRefs(t),n=l.searchable,r=l.disabled,o=a.input,i=a.open,c=a.close,s=a.clearSearch,v=e.ref(null),d=e.ref(!1),p=e.computed((function(){return n.value||r.value?-1:0})),f=function(){n.value&&o.value.blur(),v.value.blur()},m=function(){n.value&&!r.value&&o.value.focus()},g=function(){d.value=!1,setTimeout((function(){d.value||(c(),s())}),1)};return{multiselect:v,tabindex:p,isActive:d,blur:f,focus:m,handleFocus:function(){m()},activate:function(){r.value||(d.value=!0,i())},deactivate:g,handleCaretClick:function(){g(),f()}}}(t,0,{input:c.input,open:i.open,close:i.close,clearSearch:c.clearSearch}),p=s(t,a,{ev:l.ev,iv:l.iv,search:c.search,clearSearch:c.clearSearch,update:v.update,pointer:n.pointer,clearPointer:n.clearPointer,blur:d.blur,focus:d.focus,deactivate:d.deactivate}),f=function(t,u,a){var l=e.toRefs(t),n=l.valueProp,r=l.showOptions,i=l.searchable,c=l.groupLabel,s=l.groups,v=l.mode,d=l.groupSelect,p=a.fo,f=a.fg,m=a.handleOptionClick,g=a.handleGroupClick,h=a.search,D=a.pointer,b=a.setPointer,y=a.clearPointer,C=a.multiselect,B=e.computed((function(){return p.value.filter((function(e){return!e.disabled}))})),F=e.computed((function(){return f.value.filter((function(e){return!e.disabled}))})),S=e.computed((function(){return"single"!==v.value&&d.value})),k=e.computed((function(){return D.value&&D.value.group})),O=e.computed((function(){return x(D.value)})),A=e.computed((function(){var e=k.value?D.value:x(D.value),t=F.value.map((function(e){return e[c.value]})).indexOf(e[c.value]),u=F.value[t-1];return void 0===u&&(u=E.value),u})),L=e.computed((function(){var e=F.value.map((function(e){return e.label})).indexOf(k.value?D.value[c.value]:x(D.value)[c.value])+1;return F.value.length<=e&&(e=0),F.value[e]})),E=e.computed((function(){return o(F.value).slice(-1)[0]})),V=e.computed((function(){return D.value.__VISIBLE__.filter((function(e){return!e.disabled}))[0]})),P=e.computed((function(){var e=O.value.__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[n.value]})).indexOf(D.value[n.value])-1]})),w=e.computed((function(){var e=x(D.value).__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[n.value]})).indexOf(D.value[n.value])+1]})),N=e.computed((function(){return o(A.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),T=e.computed((function(){return o(E.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),q=function(){b(B.value[0]||null)},x=function(e){return F.value.find((function(t){return-1!==t.__VISIBLE__.map((function(e){return e[n.value]})).indexOf(e[n.value])}))},I=function(){var e=C.value.querySelector("[data-pointed]");if(e){var t=e.parentElement.parentElement;s.value&&(t=k.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop<t.scrollTop&&(t.scrollTop=e.offsetTop)}};return e.watch(h,(function(e){i.value&&(e.length&&r.value?q():y())})),{pointer:D,canPointGroups:S,isPointed:function(e){return!(!D.value||!(!e.group&&D.value[n.value]==e[n.value]||void 0!==e.group&&D.value[c.value]==e[c.value]))||void 0},setPointerFirst:q,selectPointer:function(){D.value&&!0!==D.value.disabled&&(k.value?g(D.value):m(D.value))},forwardPointer:function(){if(null===D.value)b((s.value&&S.value?F.value[0]:B.value[0])||null);else if(s.value&&S.value){var t=k.value?V.value:w.value;void 0===t&&(t=L.value),b(t||null)}else{var u=B.value.map((function(e){return e[n.value]})).indexOf(D.value[n.value])+1;B.value.length<=u&&(u=0),b(B.value[u]||null)}e.nextTick((function(){I()}))},backwardPointer:function(){if(null===D.value){var t=B.value[B.value.length-1];s.value&&S.value&&void 0===(t=T.value)&&(t=E.value),b(t||null)}else if(s.value&&S.value){var u=k.value?N.value:P.value;void 0===u&&(u=k.value?A.value:O.value),b(u||null)}else{var a=B.value.map((function(e){return e[n.value]})).indexOf(D.value[n.value])-1;a<0&&(a=B.value.length-1),b(B.value[a]||null)}e.nextTick((function(){I()}))}}}(t,0,{fo:p.fo,fg:p.fg,handleOptionClick:p.handleOptionClick,handleGroupClick:p.handleGroupClick,search:c.search,pointer:n.pointer,setPointer:n.setPointer,clearPointer:n.clearPointer,multiselect:d.multiselect}),m=function(t,u,a){var l=e.toRefs(t),n=l.mode,r=l.addTagOn,i=l.openDirection,c=l.searchable,s=l.showOptions,v=l.valueProp,d=l.groups,p=l.addOptionOn,f=l.createTag,m=l.createOption,g=a.iv,h=a.update,D=a.search,b=a.setPointer,y=a.selectPointer,C=a.backwardPointer,B=a.forwardPointer,F=a.blur,S=a.fo,k=e.computed((function(){return f.value||m.value||!1})),O=e.computed((function(){return void 0!==r.value?r.value:void 0!==p.value?p.value:["enter"]})),A=function(){"tags"===n.value&&!s.value&&k.value&&c.value&&!d.value&&b(S.value[S.value.map((function(e){return e[v.value]})).indexOf(D.value)])};return{handleKeydown:function(e){switch(e.key){case"Backspace":if("single"===n.value)return;if(c.value&&-1===[null,""].indexOf(D.value))return;if(0===g.value.length)return;h(o(g.value).slice(0,-1));break;case"Enter":if(e.preventDefault(),-1===O.value.indexOf("enter")&&k.value)return;A(),y();break;case" ":if(!k.value&&!c.value)return e.preventDefault(),A(),void y();if(!k.value)return!1;if(-1===O.value.indexOf("space")&&k.value)return;e.preventDefault(),A(),y();break;case"Tab":case";":case",":if(-1===O.value.indexOf(e.key.toLowerCase())||!k.value)return;A(),y(),e.preventDefault();break;case"Escape":F();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;"top"===i.value?B():C();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;"top"===i.value?C():B()}},preparePointer:A}}(t,0,{iv:l.iv,update:v.update,search:c.search,setPointer:n.setPointer,selectPointer:f.selectPointer,backwardPointer:f.backwardPointer,forwardPointer:f.forwardPointer,blur:d.blur,fo:p.fo}),g=function(t,u,a){var l=e.toRefs(t),n=l.classes,o=l.disabled,i=l.openDirection,c=l.showOptions,s=a.isOpen,v=a.isPointed,d=a.isSelected,p=a.isDisabled,f=a.isActive,m=a.canPointGroups,g=a.resolving,h=a.fo,D=e.computed((function(){return r({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",spacer:"multiselect-spacer"},n.value)})),b=e.computed((function(){return!!(s.value&&c.value&&(!g.value||g.value&&h.value.length))}));return{classList:e.computed((function(){var e=D.value;return{container:[e.container].concat(o.value?e.containerDisabled:[]).concat(b.value&&"top"===i.value?e.containerOpenTop:[]).concat(b.value&&"top"!==i.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(o.value?e.tagDisabled:[]),tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,dropdown:[e.dropdown].concat("top"===i.value?e.dropdownTop:[]).concat(s.value&&c.value&&b.value?[]:e.dropdownHidden),options:[e.options].concat("top"===i.value?e.optionsTop:[]),group:e.group,groupLabel:function(t){var u=[e.groupLabel];return v(t)?u.push(d(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):d(t)&&m.value?u.push(p(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):p(t)&&u.push(e.groupLabelDisabled),m.value&&u.push(e.groupLabelPointable),u},groupOptions:e.groupOptions,option:function(t,u){var a=[e.option];return v(t)?a.push(d(t)?e.optionSelectedPointed:e.optionPointed):d(t)?a.push(p(t)?e.optionSelectedDisabled:e.optionSelected):(p(t)||u&&p(u))&&a.push(e.optionDisabled),a},noOptions:e.noOptions,noResults:e.noResults,fakeInput:e.fakeInput}})),showDropdown:b}}(t,0,{isOpen:i.isOpen,isPointed:f.isPointed,canPointGroups:f.canPointGroups,isSelected:p.isSelected,isDisabled:p.isDisabled,isActive:d.isActive,resolving:p.resolving,fo:p.fo});return{...l,...i,...d,...n,...v,...c,...p,...f,...m,...g}}};return v.render=function(e,u,a,l,n,r){return t.openBlock(),t.createBlock("div",{ref:"multiselect",tabindex:e.tabindex,class:e.classList.container,id:a.id,onFocusin:u[7]||(u[7]=(...t)=>e.activate&&e.activate(...t)),onFocusout:u[8]||(u[8]=(...t)=>e.deactivate&&e.deactivate(...t)),onKeydown:u[9]||(u[9]=(...t)=>e.handleKeydown&&e.handleKeydown(...t)),onFocus:u[10]||(u[10]=(...t)=>e.handleFocus&&e.handleFocus(...t))},[t.createCommentVNode(" Search "),"tags"!==a.mode&&a.searchable&&!a.disabled?(t.openBlock(),t.createBlock("input",t.mergeProps({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:a.autocomplete},a.attrs,{onInput:u[1]||(u[1]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onPaste:u[2]||(u[2]=t.withModifiers(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input"}),null,16,["type","modelValue","value","autocomplete"])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Tags (with search) "),"tags"==a.mode?(t.openBlock(),t.createBlock("div",{key:1,class:e.classList.tags},[(t.openBlock(!0),t.createBlock(t.Fragment,null,t.renderList(e.iv,((u,l,n)=>t.renderSlot(e.$slots,"tag",{option:u,handleTagRemove:e.handleTagRemove,disabled:a.disabled},(()=>[(t.openBlock(),t.createBlock("span",{class:e.classList.tag,key:n},[t.createTextVNode(t.toDisplayString(u[a.label])+" ",1),a.disabled?t.createCommentVNode("v-if",!0):(t.openBlock(),t.createBlock("span",{key:0,class:e.classList.tagRemove,onClick:t=>e.handleTagRemove(u,t)},[t.createVNode("span",{class:e.classList.tagRemoveIcon},null,2)],10,["onClick"]))],2))])))),256)),t.createVNode("div",{class:e.classList.tagsSearchWrapper},[t.createCommentVNode(" Used for measuring search width "),t.createVNode("span",{class:e.classList.tagsSearchCopy},t.toDisplayString(e.search),3),t.createCommentVNode(" Actual search input "),a.searchable&&!a.disabled?(t.openBlock(),t.createBlock("input",t.mergeProps({key:0,type:a.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,autocomplete:a.autocomplete},a.attrs,{onInput:u[3]||(u[3]=(...t)=>e.handleSearchInput&&e.handleSearchInput(...t)),onPaste:u[4]||(u[4]=t.withModifiers(((...t)=>e.handlePaste&&e.handlePaste(...t)),["stop"])),ref:"input"}),null,16,["type","modelValue","value","autocomplete"])):t.createCommentVNode("v-if",!0)],2)],2)):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Single label "),"single"==a.mode&&e.hasSelected&&!e.search&&e.iv?t.renderSlot(e.$slots,"singlelabel",{key:2,value:e.iv},(()=>[t.createVNode("div",{class:e.classList.singleLabel},[t.createVNode("span",{class:e.classList.singleLabelText,innerHTML:e.iv[a.label]},null,10,["innerHTML"])],2)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Multiple label "),"multiple"==a.mode&&e.hasSelected&&!e.search?t.renderSlot(e.$slots,"multiplelabel",{key:3,values:e.iv},(()=>[t.createVNode("div",{class:e.classList.multipleLabel,innerHTML:e.multipleLabelText},null,10,["innerHTML"])])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Placeholder "),!a.placeholder||e.hasSelected||e.search?t.createCommentVNode("v-if",!0):t.renderSlot(e.$slots,"placeholder",{key:4},(()=>[t.createVNode("div",{class:e.classList.placeholder},t.toDisplayString(a.placeholder),3)])),t.createCommentVNode(" Spinner "),e.busy&&e.isActive?t.renderSlot(e.$slots,"spinner",{key:5},(()=>[t.createVNode("span",{class:e.classList.spinner},null,2)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Clear "),e.hasSelected&&!a.disabled&&a.canClear&&!e.busy?t.renderSlot(e.$slots,"clear",{key:6,clear:e.clear},(()=>[t.createVNode("span",{class:e.classList.clear,onMousedown:u[5]||(u[5]=(...t)=>e.clear&&e.clear(...t))},[t.createVNode("span",{class:e.classList.clearIcon},null,2)],34)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Caret "),a.caret&&a.showOptions?t.renderSlot(e.$slots,"caret",{key:7},(()=>[t.createVNode("span",{class:e.classList.caret,onClick:u[6]||(u[6]=(...t)=>e.handleCaretClick&&e.handleCaretClick(...t))},null,2)])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Options "),t.createVNode("div",{class:e.classList.dropdown,tabindex:"-1"},[t.renderSlot(e.$slots,"beforelist",{options:e.fo}),t.createVNode("ul",{class:e.classList.options},[a.groups?(t.openBlock(!0),t.createBlock(t.Fragment,{key:0},t.renderList(e.fg,((u,l,n)=>(t.openBlock(),t.createBlock("li",{class:e.classList.group,key:n},[t.createVNode("div",{class:e.classList.groupLabel(u),"data-pointed":e.isPointed(u),onMouseenter:t=>e.setPointer(u),onClick:t=>e.handleGroupClick(u)},[t.renderSlot(e.$slots,"grouplabel",{group:u},(()=>[t.createVNode("span",{innerHTML:u[a.groupLabel]},null,8,["innerHTML"])]))],42,["data-pointed","onMouseenter","onClick"]),t.createVNode("ul",{class:e.classList.groupOptions},[(t.openBlock(!0),t.createBlock(t.Fragment,null,t.renderList(u.__VISIBLE__,((l,n,r)=>(t.openBlock(),t.createBlock("li",{class:e.classList.option(l,u),key:r,"data-pointed":e.isPointed(l),onMouseenter:t=>e.setPointer(l),onClick:t=>e.handleOptionClick(l)},[t.renderSlot(e.$slots,"option",{option:l,search:e.search},(()=>[t.createVNode("span",{innerHTML:l[a.label]},null,8,["innerHTML"])]))],42,["data-pointed","onMouseenter","onClick"])))),128))],2)],2)))),128)):(t.openBlock(!0),t.createBlock(t.Fragment,{key:1},t.renderList(e.fo,((u,l,n)=>(t.openBlock(),t.createBlock("li",{class:e.classList.option(u),key:n,"data-pointed":e.isPointed(u),onMouseenter:t=>e.setPointer(u),onClick:t=>e.handleOptionClick(u)},[t.renderSlot(e.$slots,"option",{option:u,search:e.search},(()=>[t.createVNode("span",{innerHTML:u[a.label]},null,8,["innerHTML"])]))],42,["data-pointed","onMouseenter","onClick"])))),128))],2),e.noOptions?t.renderSlot(e.$slots,"nooptions",{key:0},(()=>[t.createVNode("div",{class:e.classList.noOptions,innerHTML:a.noOptionsText},null,10,["innerHTML"])])):t.createCommentVNode("v-if",!0),e.noResults?t.renderSlot(e.$slots,"noresults",{key:1},(()=>[t.createVNode("div",{class:e.classList.noResults,innerHTML:a.noResultsText},null,10,["innerHTML"])])):t.createCommentVNode("v-if",!0),t.renderSlot(e.$slots,"afterlist",{options:e.fo})],2),t.createCommentVNode(" Hacky input element to show HTML5 required warning "),a.required?(t.openBlock(),t.createBlock("input",{key:8,class:e.classList.fakeInput,tabindex:"-1",value:e.textValue,required:""},null,10,["value"])):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Native input support "),a.nativeSupport?(t.openBlock(),t.createBlock(t.Fragment,{key:9},["single"==a.mode?(t.openBlock(),t.createBlock("input",{key:0,type:"hidden",name:a.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,u)=>(t.openBlock(),t.createBlock("input",{type:"hidden",name:`${a.name}[]`,value:e,key:u},null,8,["name","value"])))),128))],64)):t.createCommentVNode("v-if",!0),t.createCommentVNode(" Create height for empty input "),t.createVNode("div",{class:e.classList.spacer},null,2)],42,["tabindex","id"])},v.__file="src/Multiselect.vue",v}(Vue,Vue); |
@@ -1,1 +0,1 @@ | ||
import{toRefs as e,ref as u,computed as t,watch as l,nextTick as a,openBlock as n,createBlock as r,createCommentVNode as i,mergeProps as o,withModifiers as s,Fragment as c,renderList as v,renderSlot as p,createTextVNode as d,toDisplayString as f,createVNode as g}from"vue";function b(e){return-1!==[null,void 0,!1].indexOf(e)}function h(e){var u=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return u?String(e).toLowerCase().trim():String(e).normalize("NFD").replace(/(?:[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0B55\u0BCD\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E47-\u0E4C\u0E4E\u0EBA\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1063\u1064\u1069-\u106D\u1087-\u108D\u108F\u109A\u109B\u135D-\u135F\u17C9-\u17D3\u17DD\u1939-\u193B\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DF9\u1DFD-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA700-\uA721\uA788-\uA78A\uA7F8\uA7F9\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uAB69-\uAB6B\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3]|\uD800\uDEE0|\uD802[\uDEE5\uDEE6]|\uD803[\uDD22-\uDD27\uDF46-\uDF50]|\uD804[\uDCB9\uDCBA\uDD33\uDD34\uDD73\uDDC0\uDDCA-\uDDCC\uDE35\uDE36\uDEE9\uDEEA\uDF3C\uDF4D\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC42\uDC46\uDCC2\uDCC3\uDDBF\uDDC0\uDE3F\uDEB6\uDEB7\uDF2B]|\uD806[\uDC39\uDC3A\uDD3D\uDD3E\uDD43\uDDE0\uDE34\uDE47\uDE99]|\uD807[\uDC3F\uDD42\uDD44\uDD45\uDD97]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF9F\uDFF0\uDFF1]|\uD834[\uDD67-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD838[\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD46\uDD48-\uDD4A])/g,"").toLowerCase().trim()}function m(e){return(m="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 D(e,u){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);u&&(l=l.filter((function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable}))),t.push.apply(t,l)}return t}function y(e){for(var u=1;u<arguments.length;u++){var t=null!=arguments[u]?arguments[u]:{};u%2?D(Object(t),!0).forEach((function(u){O(e,u,t[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):D(Object(t)).forEach((function(u){Object.defineProperty(e,u,Object.getOwnPropertyDescriptor(t,u))}))}return e}function O(e,u,t){return u in e?Object.defineProperty(e,u,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[u]=t,e}function F(a,n,r){var i=e(a),o=i.options,s=i.mode,c=i.trackBy,v=i.limit,p=i.hideSelected,d=i.createTag,f=i.createOption,g=i.label,D=i.appendNewTag,F=i.appendNewOption,C=i.multipleLabel,A=i.object,S=i.loading,E=i.delay,B=i.resolveOnLoad,L=i.minChars,P=i.filterResults,k=i.clearOnSearch,w=i.clearOnSelect,q=i.valueProp,x=i.canDeselect,j=i.max,T=i.strict,I=i.closeOnSelect,_=i.groups,V=(i.groupLabel,i.groupOptions),R=i.groupHideEmpty,M=i.groupSelect,$=r.iv,H=r.ev,N=r.search,G=r.clearSearch,K=r.update,U=r.pointer,W=r.clearPointer,z=r.blur,J=r.focus,Q=r.deactivate,X=u([]),Y=u([]),Z=u(!1),ee=t((function(){return d.value||f.value||!1})),ue=t((function(){return void 0!==D.value?D.value:void 0===F.value||F.value})),te=t((function(){if(_.value){var e=Y.value||[],u=[];return e.forEach((function(e){ke(e[V.value]).forEach((function(t){u.push(Object.assign({},t,e.disabled?{disabled:!0}:{}))}))})),u}var t=ke(Y.value||[]);return X.value.length&&(t=t.concat(X.value)),t})),le=t((function(){return _.value?Le((Y.value||[]).map((function(e){var u,t=ke(e[V.value]);return y(y({},e),{},(O(u={group:!0},V.value,Pe(t,!1).map((function(u){return Object.assign({},u,e.disabled?{disabled:!0}:{})}))),O(u,"__VISIBLE__",Pe(t).map((function(u){return Object.assign({},u,e.disabled?{disabled:!0}:{})}))),u))}))):[]})),ae=t((function(){var e=te.value;return se.value.length&&(e=se.value.concat(e)),e=Pe(e),v.value>0&&(e=e.slice(0,v.value)),e})),ne=t((function(){switch(s.value){case"single":return!b($.value[q.value]);case"multiple":case"tags":return!b($.value)&&$.value.length>0}})),re=t((function(){return void 0!==C&&void 0!==C.value?C.value($.value):$.value&&$.value.length>1?"".concat($.value.length," options selected"):"1 option selected"})),ie=t((function(){return!te.value.length&&!Z.value&&!se.value.length})),oe=t((function(){return te.value.length>0&&0==ae.value.length&&(N.value&&_.value||!_.value)})),se=t((function(){var e;return!1!==ee.value&&N.value?-1!==Se(N.value)?[]:[(e={},O(e,q.value,N.value),O(e,g.value,N.value),O(e,ce.value,N.value),e)]:[]})),ce=t((function(){return c.value||g.value})),ve=t((function(){switch(s.value){case"single":return null;case"multiple":case"tags":return[]}})),pe=t((function(){return S.value||Z.value})),de=function(e){switch("object"!==m(e)&&(e=Ae(e)),s.value){case"single":K(e);break;case"multiple":case"tags":K($.value.concat(e))}n.emit("select",ge(e),e)},fe=function(e){switch("object"!==m(e)&&(e=Ae(e)),s.value){case"single":he();break;case"tags":case"multiple":K(Array.isArray(e)?$.value.filter((function(u){return-1===e.map((function(e){return e[q.value]})).indexOf(u[q.value])})):$.value.filter((function(u){return u[q.value]!=e[q.value]})))}n.emit("deselect",ge(e),e)},ge=function(e){return A.value?e:e[q.value]},be=function(e){fe(e)},he=function(){n.emit("clear"),K(ve.value)},me=function(e){if(void 0!==e.group)return"single"!==s.value&&(Ce(e[V.value])&&e[V.value].length);switch(s.value){case"single":return!b($.value)&&$.value[q.value]==e[q.value];case"tags":case"multiple":return!b($.value)&&-1!==$.value.map((function(e){return e[q.value]})).indexOf(e[q.value])}},De=function(e){return!0===e.disabled},ye=function(){return!(void 0===j||-1===j.value||!ne.value&&j.value>0)&&$.value.length>=j.value},Oe=function(e){void 0===Ae(e[q.value])&&ee.value&&(n.emit("tag",e[q.value]),n.emit("option",e[q.value]),ue.value&&Be(e),G())},Fe=function(e){return void 0===e.find((function(e){return!me(e)&&!e.disabled}))},Ce=function(e){return void 0===e.find((function(e){return!me(e)}))},Ae=function(e){return te.value[te.value.map((function(e){return String(e[q.value])})).indexOf(String(e))]},Se=function(e){return te.value.map((function(e){return e[ce.value]})).indexOf(e)},Ee=function(e){return-1!==["tags","multiple"].indexOf(s.value)&&p.value&&me(e)},Be=function(e){X.value.push(e)},Le=function(e){return R.value?e.filter((function(e){return N.value?e.__VISIBLE__.length:e[V.value].length})):e.filter((function(e){return!N.value||e.__VISIBLE__.length}))},Pe=function(e){var u=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=e;return N.value&&P.value&&(t=t.filter((function(e){return-1!==h(e[ce.value],T.value).indexOf(h(N.value,T.value))}))),p.value&&u&&(t=t.filter((function(e){return!Ee(e)}))),t},ke=function(e){var u,t=e;return u=t,"[object Object]"===Object.prototype.toString.call(u)&&(t=Object.keys(t).map((function(e){var u,l=t[e];return O(u={},q.value,e),O(u,ce.value,l),O(u,g.value,l),u}))),t=t.map((function(e){var u;return"object"===m(e)?e:(O(u={},q.value,e),O(u,ce.value,e),O(u,g.value,e),u)}))},we=function(){b(H.value)||($.value=xe(H.value))},qe=function(e){Z.value=!0,o.value(N.value).then((function(u){Y.value=u,"function"==typeof e&&e(u),Z.value=!1}))},xe=function(e){return b(e)?"single"===s.value?{}:[]:A.value?e:"single"===s.value?Ae(e)||{}:e.filter((function(e){return!!Ae(e)})).map((function(e){return Ae(e)}))};if("single"!==s.value&&!b(H.value)&&!Array.isArray(H.value))throw new Error('v-model must be an array when using "'.concat(s.value,'" mode'));return o&&"function"==typeof o.value?B.value?qe(we):1==A.value&&we():(Y.value=o.value,we()),E.value>-1&&l(N,(function(e){e.length<L.value||(Z.value=!0,k.value&&(Y.value=[]),setTimeout((function(){e==N.value&&o.value(N.value).then((function(u){e!=N.value&&N.value||(Y.value=u,U.value=ae.value.filter((function(e){return!0!==e.disabled}))[0]||null,Z.value=!1)}))}),E.value))}),{flush:"sync"}),l(H,(function(e){var u,t,l;if(b(e))$.value=xe(e);else switch(s.value){case"single":(A.value?e[q.value]!=$.value[q.value]:e!=$.value[q.value])&&($.value=xe(e));break;case"multiple":case"tags":u=A.value?e.map((function(e){return e[q.value]})):e,t=$.value.map((function(e){return e[q.value]})),l=t.slice().sort(),u.length===t.length&&u.slice().sort().every((function(e,u){return e===l[u]}))||($.value=xe(e))}}),{deep:!0}),"function"!=typeof a.options&&l(o,(function(e,u){Y.value=a.options,Object.keys($.value).length||we(),function(){if(ne.value)if("single"===s.value){var e=Ae($.value[q.value])[g.value];$.value[g.value]=e,A.value&&(H.value[g.value]=e)}else $.value.forEach((function(e,u){var t=Ae($.value[u][q.value])[g.value];$.value[u][g.value]=t,A.value&&(H.value[u][g.value]=t)}))}()})),{fo:ae,filteredOptions:ae,hasSelected:ne,multipleLabelText:re,eo:te,extendedOptions:te,fg:le,filteredGroups:le,noOptions:ie,noResults:oe,resolving:Z,busy:pe,select:de,deselect:fe,remove:be,selectAll:function(){"single"!==s.value&&de(ae.value)},clear:he,isSelected:me,isDisabled:De,isMax:ye,getOption:Ae,handleOptionClick:function(e){if(!De(e)){switch(s.value){case"single":if(me(e))return void(x.value&&fe(e));Oe(e),z(),de(e);break;case"multiple":if(me(e))return void fe(e);if(ye())return;Oe(e),de(e),w.value&&G(),p.value&&W(),I.value&&z();break;case"tags":if(me(e))return void fe(e);if(ye())return;Oe(e),w.value&&G(),de(e),p.value&&W(),I.value&&z()}I.value?Q():J()}},handleGroupClick:function(e){if(!De(e)&&"single"!==s.value&&M.value){switch(s.value){case"multiple":case"tags":Fe(e[V.value])?fe(e[V.value]):de(e[V.value].filter((function(e){return-1===$.value.map((function(e){return e[q.value]})).indexOf(e[q.value])})).filter((function(e){return!e.disabled})).filter((function(e,u){return $.value.length+1+u<=j.value||-1===j.value})))}I.value&&Q()}},handleTagRemove:function(e,u){0===u.button?be(e):u.preventDefault()},refreshOptions:function(e){qe(e)},resolveOptions:qe}}function C(e){return function(e){if(Array.isArray(e))return A(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,u){if(!e)return;if("string"==typeof e)return A(e,u);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return A(e,u)}(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 A(e,u){(null==u||u>e.length)&&(u=e.length);for(var t=0,l=new Array(u);t<u;t++)l[t]=e[t];return l}function S(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,u){if(!e)return;if("string"==typeof e)return E(e,u);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return E(e,u)}(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 E(e,u){(null==u||u>e.length)&&(u=e.length);for(var t=0,l=new Array(u);t<u;t++)l[t]=e[t];return l}function B(e,u){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);u&&(l=l.filter((function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable}))),t.push.apply(t,l)}return t}function L(e,u,t){return u in e?Object.defineProperty(e,u,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[u]=t,e}function P(u,l,a){var n=e(u),r=n.classes,i=n.disabled,o=n.openDirection,s=n.showOptions,c=a.isOpen,v=a.isPointed,p=a.isSelected,d=a.isDisabled,f=a.isActive,g=a.canPointGroups,b=a.resolving,h=a.fo,m=t((function(){return function(e){for(var u=1;u<arguments.length;u++){var t=null!=arguments[u]?arguments[u]:{};u%2?B(Object(t),!0).forEach((function(u){L(e,u,t[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach((function(u){Object.defineProperty(e,u,Object.getOwnPropertyDescriptor(t,u))}))}return e}({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",spacer:"multiselect-spacer"},r.value)})),D=t((function(){return!!(c.value&&s.value&&(!b.value||b.value&&h.value.length))}));return{classList:t((function(){var e=m.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(D.value&&"top"===o.value?e.containerOpenTop:[]).concat(D.value&&"top"!==o.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(c.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,dropdown:[e.dropdown].concat("top"===o.value?e.dropdownTop:[]).concat(c.value&&s.value&&D.value?[]:e.dropdownHidden),options:[e.options].concat("top"===o.value?e.optionsTop:[]),group:e.group,groupLabel:function(u){var t=[e.groupLabel];return v(u)?t.push(p(u)?e.groupLabelSelectedPointed:e.groupLabelPointed):p(u)&&g.value?t.push(d(u)?e.groupLabelSelectedDisabled:e.groupLabelSelected):d(u)&&t.push(e.groupLabelDisabled),g.value&&t.push(e.groupLabelPointable),t},groupOptions:e.groupOptions,option:function(u,t){var l=[e.option];return v(u)?l.push(p(u)?e.optionSelectedPointed:e.optionPointed):p(u)?l.push(d(u)?e.optionSelectedDisabled:e.optionSelected):(d(u)||t&&d(t))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,fakeInput:e.fakeInput}})),showDropdown:D}}var k={name:"Multiselect",emits:["open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},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:void 0},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},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 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},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:[Object],default:()=>({})}},setup(n,r){const i=function(l,a){var n=e(l),r=n.value,i=n.modelValue,o=n.mode,s=n.valueProp,c=u("single"!==o.value?[]:{}),v=void 0!==a.expose?i:r,p=t((function(){return"single"===o.value?c.value[s.value]:c.value.map((function(e){return e[s.value]}))})),d=t((function(){return"single"!==o.value?c.value.map((function(e){return e[s.value]})).join(","):c.value[s.value]}));return{iv:c,internalValue:c,ev:v,externalValue:v,textValue:d,plainValue:p}}(n,r),o=function(t,l,a){var n=e(t),r=n.groupSelect,i=n.mode,o=n.groups,s=u(null),c=function(e){void 0===e||null!==e&&e.disabled||o.value&&e&&e.group&&("single"===i.value||!r.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:function(){c(null)}}}(n),s=function(t,l,a){var n=e(t).disabled,r=u(!1);return{isOpen:r,open:function(){r.value||n.value||(r.value=!0,l.emit("open"))},close:function(){r.value&&(r.value=!1,l.emit("close"))}}}(n,r),c=function(e,t,a){var n=u(null),r=u(null);return l(n,(function(e){t.emit("search-change",e)})),{search:n,input:r,clearSearch:function(){n.value=""},handleSearchInput:function(e){n.value=e.target.value},handlePaste:function(e){t.emit("paste",e)}}}(0,r),v=function(u,t,l){var a=e(u),n=a.object,r=a.valueProp,i=a.mode,o=l.iv,s=function(e){return n.value||b(e)?e:Array.isArray(e)?e.map((function(e){return e[r.value]})):e[r.value]},c=function(e){return b(e)?"single"===i.value?{}:[]:e};return{update:function(e){o.value=c(e);var u=s(e);t.emit("change",u),t.emit("input",u),t.emit("update:modelValue",u)}}}(n,r,{iv:i.iv}),p=function(l,a,n){var r=e(l),i=r.searchable,o=r.disabled,s=n.input,c=n.open,v=n.close,p=n.clearSearch,d=u(null),f=u(!1),g=t((function(){return i.value||o.value?-1:0})),b=function(){i.value&&s.value.blur(),d.value.blur()},h=function(){i.value&&!o.value&&s.value.focus()},m=function(){f.value=!1,setTimeout((function(){f.value||(v(),p())}),1)};return{multiselect:d,tabindex:g,isActive:f,blur:b,focus:h,handleFocus:function(){h()},activate:function(){o.value||(f.value=!0,c())},deactivate:m,handleCaretClick:function(){m(),b()}}}(n,0,{input:c.input,open:s.open,close:s.close,clearSearch:c.clearSearch}),d=F(n,r,{ev:i.ev,iv:i.iv,search:c.search,clearSearch:c.clearSearch,update:v.update,pointer:o.pointer,clearPointer:o.clearPointer,blur:p.blur,focus:p.focus,deactivate:p.deactivate}),f=function(u,n,r){var i=e(u),o=i.valueProp,s=i.showOptions,c=i.searchable,v=i.groupLabel,p=i.groups,d=i.mode,f=i.groupSelect,g=r.fo,b=r.fg,h=r.handleOptionClick,m=r.handleGroupClick,D=r.search,y=r.pointer,O=r.setPointer,F=r.clearPointer,A=r.multiselect,S=t((function(){return g.value.filter((function(e){return!e.disabled}))})),E=t((function(){return b.value.filter((function(e){return!e.disabled}))})),B=t((function(){return"single"!==d.value&&f.value})),L=t((function(){return y.value&&y.value.group})),P=t((function(){return R(y.value)})),k=t((function(){var e=L.value?y.value:R(y.value),u=E.value.map((function(e){return e[v.value]})).indexOf(e[v.value]),t=E.value[u-1];return void 0===t&&(t=q.value),t})),w=t((function(){var e=E.value.map((function(e){return e.label})).indexOf(L.value?y.value[v.value]:R(y.value)[v.value])+1;return E.value.length<=e&&(e=0),E.value[e]})),q=t((function(){return C(E.value).slice(-1)[0]})),x=t((function(){return y.value.__VISIBLE__.filter((function(e){return!e.disabled}))[0]})),j=t((function(){var e=P.value.__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[o.value]})).indexOf(y.value[o.value])-1]})),T=t((function(){var e=R(y.value).__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[o.value]})).indexOf(y.value[o.value])+1]})),I=t((function(){return C(k.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),_=t((function(){return C(q.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),V=function(){O(S.value[0]||null)},R=function(e){return E.value.find((function(u){return-1!==u.__VISIBLE__.map((function(e){return e[o.value]})).indexOf(e[o.value])}))},M=function(){var e=A.value.querySelector("[data-pointed]");if(e){var u=e.parentElement.parentElement;p.value&&(u=L.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>u.clientHeight+u.scrollTop&&(u.scrollTop=e.offsetTop+e.offsetHeight-u.clientHeight),e.offsetTop<u.scrollTop&&(u.scrollTop=e.offsetTop)}};return l(D,(function(e){c.value&&(e.length&&s.value?V():F())})),{pointer:y,canPointGroups:B,isPointed:function(e){return!(!y.value||!(!e.group&&y.value[o.value]==e[o.value]||void 0!==e.group&&y.value[v.value]==e[v.value]))||void 0},setPointerFirst:V,selectPointer:function(){y.value&&!0!==y.value.disabled&&(L.value?m(y.value):h(y.value))},forwardPointer:function(){if(null===y.value)O((p.value&&B.value?E.value[0]:S.value[0])||null);else if(p.value&&B.value){var e=L.value?x.value:T.value;void 0===e&&(e=w.value),O(e||null)}else{var u=S.value.map((function(e){return e[o.value]})).indexOf(y.value[o.value])+1;S.value.length<=u&&(u=0),O(S.value[u]||null)}a((function(){M()}))},backwardPointer:function(){if(null===y.value){var e=S.value[S.value.length-1];p.value&&B.value&&void 0===(e=_.value)&&(e=q.value),O(e||null)}else if(p.value&&B.value){var u=L.value?I.value:j.value;void 0===u&&(u=L.value?k.value:P.value),O(u||null)}else{var t=S.value.map((function(e){return e[o.value]})).indexOf(y.value[o.value])-1;t<0&&(t=S.value.length-1),O(S.value[t]||null)}a((function(){M()}))}}}(n,0,{fo:d.fo,fg:d.fg,handleOptionClick:d.handleOptionClick,handleGroupClick:d.handleGroupClick,search:c.search,pointer:o.pointer,setPointer:o.setPointer,clearPointer:o.clearPointer,multiselect:p.multiselect}),g=function(u,l,a){var n=e(u),r=n.mode,i=n.addTagOn,o=n.openDirection,s=n.searchable,c=n.showOptions,v=n.valueProp,p=n.groups,d=n.addOptionOn,f=n.createTag,g=n.createOption,b=a.iv,h=a.update,m=a.search,D=a.setPointer,y=a.selectPointer,O=a.backwardPointer,F=a.forwardPointer,C=a.blur,A=a.fo,E=t((function(){return f.value||g.value||!1})),B=t((function(){return void 0!==i.value?i.value:void 0!==d.value?d.value:["enter"]})),L=function(){"tags"===r.value&&!c.value&&E.value&&s.value&&!p.value&&D(A.value[A.value.map((function(e){return e[v.value]})).indexOf(m.value)])};return{handleKeydown:function(e){switch(e.key){case"Backspace":if("single"===r.value)return;if(s.value&&-1===[null,""].indexOf(m.value))return;if(0===b.value.length)return;h(S(b.value).slice(0,-1));break;case"Enter":if(e.preventDefault(),-1===B.value.indexOf("enter")&&E.value)return;L(),y();break;case" ":if(!E.value&&!s.value)return e.preventDefault(),L(),void y();if(!E.value)return!1;if(-1===B.value.indexOf("space")&&E.value)return;e.preventDefault(),L(),y();break;case"Tab":case";":case",":if(-1===B.value.indexOf(e.key.toLowerCase())||!E.value)return;L(),y(),e.preventDefault();break;case"Escape":C();break;case"ArrowUp":if(e.preventDefault(),!c.value)return;"top"===o.value?F():O();break;case"ArrowDown":if(e.preventDefault(),!c.value)return;"top"===o.value?O():F()}},preparePointer:L}}(n,0,{iv:i.iv,update:v.update,search:c.search,setPointer:o.setPointer,selectPointer:f.selectPointer,backwardPointer:f.backwardPointer,forwardPointer:f.forwardPointer,blur:p.blur,fo:d.fo}),h=P(n,0,{isOpen:s.isOpen,isPointed:f.isPointed,canPointGroups:f.canPointGroups,isSelected:d.isSelected,isDisabled:d.isDisabled,isActive:p.isActive,resolving:d.resolving,fo:d.fo});return{...i,...s,...p,...o,...v,...c,...d,...f,...g,...h}}};k.render=function(e,u,t,l,a,b){return n(),r("div",{ref:"multiselect",tabindex:e.tabindex,class:e.classList.container,id:t.id,onFocusin:u[7]||(u[7]=(...u)=>e.activate&&e.activate(...u)),onFocusout:u[8]||(u[8]=(...u)=>e.deactivate&&e.deactivate(...u)),onKeydown:u[9]||(u[9]=(...u)=>e.handleKeydown&&e.handleKeydown(...u)),onFocus:u[10]||(u[10]=(...u)=>e.handleFocus&&e.handleFocus(...u))},[i(" Search "),"tags"!==t.mode&&t.searchable&&!t.disabled?(n(),r("input",o({key:0,type:t.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:t.autocomplete},t.attrs,{onInput:u[1]||(u[1]=(...u)=>e.handleSearchInput&&e.handleSearchInput(...u)),onPaste:u[2]||(u[2]=s(((...u)=>e.handlePaste&&e.handlePaste(...u)),["stop"])),ref:"input"}),null,16,["type","modelValue","value","autocomplete"])):i("v-if",!0),i(" Tags (with search) "),"tags"==t.mode?(n(),r("div",{key:1,class:e.classList.tags},[(n(!0),r(c,null,v(e.iv,((u,l,a)=>p(e.$slots,"tag",{option:u,handleTagRemove:e.handleTagRemove,disabled:t.disabled},(()=>[(n(),r("span",{class:e.classList.tag,key:a},[d(f(u[t.label])+" ",1),t.disabled?i("v-if",!0):(n(),r("span",{key:0,class:e.classList.tagRemove,onClick:t=>e.handleTagRemove(u,t)},[g("span",{class:e.classList.tagRemoveIcon},null,2)],10,["onClick"]))],2))])))),256)),g("div",{class:e.classList.tagsSearchWrapper},[i(" Used for measuring search width "),g("span",{class:e.classList.tagsSearchCopy},f(e.search),3),i(" Actual search input "),t.searchable&&!t.disabled?(n(),r("input",o({key:0,type:t.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,autocomplete:t.autocomplete},t.attrs,{onInput:u[3]||(u[3]=(...u)=>e.handleSearchInput&&e.handleSearchInput(...u)),onPaste:u[4]||(u[4]=s(((...u)=>e.handlePaste&&e.handlePaste(...u)),["stop"])),ref:"input"}),null,16,["type","modelValue","value","autocomplete"])):i("v-if",!0)],2)],2)):i("v-if",!0),i(" Single label "),"single"==t.mode&&e.hasSelected&&!e.search&&e.iv?p(e.$slots,"singlelabel",{key:2,value:e.iv},(()=>[g("div",{class:e.classList.singleLabel},[g("span",{class:e.classList.singleLabelText},f(e.iv[t.label]),3)],2)])):i("v-if",!0),i(" Multiple label "),"multiple"==t.mode&&e.hasSelected&&!e.search?p(e.$slots,"multiplelabel",{key:3,values:e.iv},(()=>[g("div",{class:e.classList.multipleLabel},f(e.multipleLabelText),3)])):i("v-if",!0),i(" Placeholder "),!t.placeholder||e.hasSelected||e.search?i("v-if",!0):p(e.$slots,"placeholder",{key:4},(()=>[g("div",{class:e.classList.placeholder},f(t.placeholder),3)])),i(" Spinner "),e.busy&&e.isActive?p(e.$slots,"spinner",{key:5},(()=>[g("span",{class:e.classList.spinner},null,2)])):i("v-if",!0),i(" Clear "),e.hasSelected&&!t.disabled&&t.canClear&&!e.busy?p(e.$slots,"clear",{key:6,clear:e.clear},(()=>[g("span",{class:e.classList.clear,onMousedown:u[5]||(u[5]=(...u)=>e.clear&&e.clear(...u))},[g("span",{class:e.classList.clearIcon},null,2)],34)])):i("v-if",!0),i(" Caret "),t.caret&&t.showOptions?p(e.$slots,"caret",{key:7},(()=>[g("span",{class:e.classList.caret,onClick:u[6]||(u[6]=(...u)=>e.handleCaretClick&&e.handleCaretClick(...u))},null,2)])):i("v-if",!0),i(" Options "),g("div",{class:e.classList.dropdown,tabindex:"-1"},[p(e.$slots,"beforelist",{options:e.fo}),g("ul",{class:e.classList.options},[t.groups?(n(!0),r(c,{key:0},v(e.fg,((u,l,a)=>(n(),r("li",{class:e.classList.group,key:a},[g("div",{class:e.classList.groupLabel(u),"data-pointed":e.isPointed(u),onMouseenter:t=>e.setPointer(u),onClick:t=>e.handleGroupClick(u)},[p(e.$slots,"grouplabel",{group:u},(()=>[g("span",null,f(u[t.groupLabel]),1)]))],42,["data-pointed","onMouseenter","onClick"]),g("ul",{class:e.classList.groupOptions},[(n(!0),r(c,null,v(u.__VISIBLE__,((l,a,i)=>(n(),r("li",{class:e.classList.option(l,u),key:i,"data-pointed":e.isPointed(l),onMouseenter:u=>e.setPointer(l),onClick:u=>e.handleOptionClick(l)},[p(e.$slots,"option",{option:l,search:e.search},(()=>[g("span",null,f(l[t.label]),1)]))],42,["data-pointed","onMouseenter","onClick"])))),128))],2)],2)))),128)):(n(!0),r(c,{key:1},v(e.fo,((u,l,a)=>(n(),r("li",{class:e.classList.option(u),key:a,"data-pointed":e.isPointed(u),onMouseenter:t=>e.setPointer(u),onClick:t=>e.handleOptionClick(u)},[p(e.$slots,"option",{option:u,search:e.search},(()=>[g("span",null,f(u[t.label]),1)]))],42,["data-pointed","onMouseenter","onClick"])))),128))],2),e.noOptions?p(e.$slots,"nooptions",{key:0},(()=>[g("div",{class:e.classList.noOptions,innerHTML:t.noOptionsText},null,10,["innerHTML"])])):i("v-if",!0),e.noResults?p(e.$slots,"noresults",{key:1},(()=>[g("div",{class:e.classList.noResults,innerHTML:t.noResultsText},null,10,["innerHTML"])])):i("v-if",!0),p(e.$slots,"afterlist",{options:e.fo})],2),i(" Hacky input element to show HTML5 required warning "),t.required?(n(),r("input",{key:8,class:e.classList.fakeInput,tabindex:"-1",value:e.textValue,required:""},null,10,["value"])):i("v-if",!0),i(" Native input support "),t.nativeSupport?(n(),r(c,{key:9},["single"==t.mode?(n(),r("input",{key:0,type:"hidden",name:t.name,value:void 0!==e.plainValue?e.plainValue:""},null,8,["name","value"])):(n(!0),r(c,{key:1},v(e.plainValue,((e,u)=>(n(),r("input",{type:"hidden",name:`${t.name}[]`,value:e,key:u},null,8,["name","value"])))),128))],64)):i("v-if",!0),i(" Create height for empty input "),g("div",{class:e.classList.spacer},null,2)],42,["tabindex","id"])},k.__file="src/Multiselect.vue";export default k; | ||
import{toRefs as e,ref as u,computed as t,watch as l,getCurrentInstance as n,nextTick as a,openBlock as r,createBlock as i,createCommentVNode as o,mergeProps as s,withModifiers as c,Fragment as v,renderList as p,renderSlot as d,createTextVNode as f,toDisplayString as g,createVNode as b}from"vue";function h(e){return-1!==[null,void 0,!1].indexOf(e)}function m(e){var u=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return u?String(e).toLowerCase().trim():String(e).normalize("NFD").replace(/(?:[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0B55\u0BCD\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E47-\u0E4C\u0E4E\u0EBA\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1063\u1064\u1069-\u106D\u1087-\u108D\u108F\u109A\u109B\u135D-\u135F\u17C9-\u17D3\u17DD\u1939-\u193B\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DF9\u1DFD-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA700-\uA721\uA788-\uA78A\uA7F8\uA7F9\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uAB69-\uAB6B\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3]|\uD800\uDEE0|\uD802[\uDEE5\uDEE6]|\uD803[\uDD22-\uDD27\uDF46-\uDF50]|\uD804[\uDCB9\uDCBA\uDD33\uDD34\uDD73\uDDC0\uDDCA-\uDDCC\uDE35\uDE36\uDEE9\uDEEA\uDF3C\uDF4D\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC42\uDC46\uDCC2\uDCC3\uDDBF\uDDC0\uDE3F\uDEB6\uDEB7\uDF2B]|\uD806[\uDC39\uDC3A\uDD3D\uDD3E\uDD43\uDDE0\uDE34\uDE47\uDE99]|\uD807[\uDC3F\uDD42\uDD44\uDD45\uDD97]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF9F\uDFF0\uDFF1]|\uD834[\uDD67-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD838[\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD46\uDD48-\uDD4A])/g,"").toLowerCase().trim()}function D(e){return(D="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 y(e,u){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);u&&(l=l.filter((function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable}))),t.push.apply(t,l)}return t}function O(e){for(var u=1;u<arguments.length;u++){var t=null!=arguments[u]?arguments[u]:{};u%2?y(Object(t),!0).forEach((function(u){F(e,u,t[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):y(Object(t)).forEach((function(u){Object.defineProperty(e,u,Object.getOwnPropertyDescriptor(t,u))}))}return e}function F(e,u,t){return u in e?Object.defineProperty(e,u,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[u]=t,e}function C(a,r,i){var o=e(a),s=o.options,c=o.mode,v=o.trackBy,p=o.limit,d=o.hideSelected,f=o.createTag,g=o.createOption,b=o.label,y=o.appendNewTag,C=o.appendNewOption,A=o.multipleLabel,S=o.object,L=o.loading,E=o.delay,B=o.resolveOnLoad,P=o.minChars,k=o.filterResults,w=o.clearOnSearch,T=o.clearOnSelect,q=o.valueProp,x=o.canDeselect,j=o.max,I=o.strict,_=o.closeOnSelect,M=o.groups,V=(o.groupLabel,o.groupOptions),H=o.groupHideEmpty,R=o.groupSelect,$=n().proxy,N=i.iv,G=i.ev,K=i.search,U=i.clearSearch,W=i.update,z=i.pointer,J=i.clearPointer,Q=i.blur,X=i.focus,Y=i.deactivate,Z=u([]),ee=u([]),ue=u(!1),te=u(null),le=t((function(){return f.value||g.value||!1})),ne=t((function(){return void 0!==y.value?y.value:void 0===C.value||C.value})),ae=t((function(){if(M.value){var e=ee.value||[],u=[];return e.forEach((function(e){qe(e[V.value]).forEach((function(t){u.push(Object.assign({},t,e.disabled?{disabled:!0}:{}))}))})),u}var t=qe(ee.value||[]);return Z.value.length&&(t=t.concat(Z.value)),t})),re=t((function(){return M.value?we((ee.value||[]).map((function(e){var u,t=qe(e[V.value]);return O(O({},e),{},(F(u={group:!0},V.value,Te(t,!1).map((function(u){return Object.assign({},u,e.disabled?{disabled:!0}:{})}))),F(u,"__VISIBLE__",Te(t).map((function(u){return Object.assign({},u,e.disabled?{disabled:!0}:{})}))),u))}))):[]})),ie=t((function(){var e=ae.value;return pe.value.length&&(e=pe.value.concat(e)),e=Te(e),p.value>0&&(e=e.slice(0,p.value)),e})),oe=t((function(){switch(c.value){case"single":return!h(N.value[q.value]);case"multiple":case"tags":return!h(N.value)&&N.value.length>0}})),se=t((function(){return void 0!==A&&void 0!==A.value?A.value(N.value,$):N.value&&N.value.length>1?"".concat(N.value.length," options selected"):"1 option selected"})),ce=t((function(){return!ae.value.length&&!ue.value&&!pe.value.length})),ve=t((function(){return ae.value.length>0&&0==ie.value.length&&(K.value&&M.value||!M.value)})),pe=t((function(){var e;return!1!==le.value&&K.value?-1!==Be(K.value)?[]:[(e={},F(e,q.value,K.value),F(e,b.value,K.value),F(e,de.value,K.value),e)]:[]})),de=t((function(){return v.value||b.value})),fe=t((function(){switch(c.value){case"single":return null;case"multiple":case"tags":return[]}})),ge=t((function(){return L.value||ue.value})),be=function(e){switch("object"!==D(e)&&(e=Ee(e)),c.value){case"single":W(e);break;case"multiple":case"tags":W(N.value.concat(e))}r.emit("select",me(e),e)},he=function(e){switch("object"!==D(e)&&(e=Ee(e)),c.value){case"single":ye();break;case"tags":case"multiple":W(Array.isArray(e)?N.value.filter((function(u){return-1===e.map((function(e){return e[q.value]})).indexOf(u[q.value])})):N.value.filter((function(u){return u[q.value]!=e[q.value]})))}r.emit("deselect",me(e),e)},me=function(e){return S.value?e:e[q.value]},De=function(e){he(e)},ye=function(){r.emit("clear"),W(fe.value)},Oe=function(e){if(void 0!==e.group)return"single"!==c.value&&(Le(e[V.value])&&e[V.value].length);switch(c.value){case"single":return!h(N.value)&&N.value[q.value]==e[q.value];case"tags":case"multiple":return!h(N.value)&&-1!==N.value.map((function(e){return e[q.value]})).indexOf(e[q.value])}},Fe=function(e){return!0===e.disabled},Ce=function(){return!(void 0===j||-1===j.value||!oe.value&&j.value>0)&&N.value.length>=j.value},Ae=function(e){void 0===Ee(e[q.value])&&le.value&&(r.emit("tag",e[q.value]),r.emit("option",e[q.value]),ne.value&&ke(e),U())},Se=function(e){return void 0===e.find((function(e){return!Oe(e)&&!e.disabled}))},Le=function(e){return void 0===e.find((function(e){return!Oe(e)}))},Ee=function(e){return ae.value[ae.value.map((function(e){return String(e[q.value])})).indexOf(String(e))]},Be=function(e){return ae.value.map((function(e){return e[de.value]})).indexOf(e)},Pe=function(e){return-1!==["tags","multiple"].indexOf(c.value)&&d.value&&Oe(e)},ke=function(e){Z.value.push(e)},we=function(e){return H.value?e.filter((function(e){return K.value?e.__VISIBLE__.length:e[V.value].length})):e.filter((function(e){return!K.value||e.__VISIBLE__.length}))},Te=function(e){var u=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=e;return K.value&&k.value&&(t=t.filter((function(e){return-1!==m(e[de.value],I.value).indexOf(m(K.value,I.value))}))),d.value&&u&&(t=t.filter((function(e){return!Pe(e)}))),t},qe=function(e){var u,t=e;return u=t,"[object Object]"===Object.prototype.toString.call(u)&&(t=Object.keys(t).map((function(e){var u,l=t[e];return F(u={},q.value,e),F(u,de.value,l),F(u,b.value,l),u}))),t=t.map((function(e){var u;return"object"===D(e)?e:(F(u={},q.value,e),F(u,de.value,e),F(u,b.value,e),u)}))},xe=function(){h(G.value)||(N.value=_e(G.value))},je=function(e){return ue.value=!0,new Promise((function(u,t){s.value(K.value,$).then((function(u){ee.value=u||[],"function"==typeof e&&e(u),ue.value=!1})).catch((function(e){console.error(e),ee.value=[],ue.value=!1})).finally((function(){u()}))}))},Ie=function(){if(oe.value)if("single"===c.value){var e=Ee(N.value[q.value]);if(void 0!==e){var u=e[b.value];N.value[b.value]=u,S.value&&(G.value[b.value]=u)}}else N.value.forEach((function(e,u){var t=Ee(N.value[u][q.value]);if(void 0!==t){var l=t[b.value];N.value[u][b.value]=l,S.value&&(G.value[u][b.value]=l)}}))},_e=function(e){return h(e)?"single"===c.value?{}:[]:S.value?e:"single"===c.value?Ee(e)||{}:e.filter((function(e){return!!Ee(e)})).map((function(e){return Ee(e)}))},Me=function(){te.value=l(K,(function(e){e.length<P.value||!e||(ue.value=!0,w.value&&(ee.value=[]),setTimeout((function(){e==K.value&&s.value(K.value,$).then((function(u){e!=K.value&&K.value||(ee.value=u,z.value=ie.value.filter((function(e){return!0!==e.disabled}))[0]||null,ue.value=!1)})).catch((function(e){console.error(e)}))}),E.value))}),{flush:"sync"})};if("single"!==c.value&&!h(G.value)&&!Array.isArray(G.value))throw new Error('v-model must be an array when using "'.concat(c.value,'" mode'));return s&&"function"==typeof s.value?B.value?je(xe):1==S.value&&xe():(ee.value=s.value,xe()),E.value>-1&&Me(),l(E,(function(e,u){te.value&&te.value(),e>=0&&Me()})),l(G,(function(e){var u,t,l;if(h(e))N.value=_e(e);else switch(c.value){case"single":(S.value?e[q.value]!=N.value[q.value]:e!=N.value[q.value])&&(N.value=_e(e));break;case"multiple":case"tags":u=S.value?e.map((function(e){return e[q.value]})):e,t=N.value.map((function(e){return e[q.value]})),l=t.slice().sort(),u.length===t.length&&u.slice().sort().every((function(e,u){return e===l[u]}))||(N.value=_e(e))}}),{deep:!0}),l(s,(function(e,u){"function"==typeof a.options?B.value&&je((function(){Object.keys(N.value).length&&xe()})):(ee.value=a.options,Object.keys(N.value).length||xe(),Ie())})),l(b,Ie),{fo:ie,filteredOptions:ie,hasSelected:oe,multipleLabelText:se,eo:ae,extendedOptions:ae,fg:re,filteredGroups:re,noOptions:ce,noResults:ve,resolving:ue,busy:ge,select:be,deselect:he,remove:De,selectAll:function(){"single"!==c.value&&be(ie.value)},clear:ye,isSelected:Oe,isDisabled:Fe,isMax:Ce,getOption:Ee,handleOptionClick:function(e){if(!Fe(e)){switch(c.value){case"single":if(Oe(e))return void(x.value&&he(e));Ae(e),Q(),be(e);break;case"multiple":if(Oe(e))return void he(e);if(Ce())return;Ae(e),be(e),T.value&&U(),d.value&&J(),_.value&&Q();break;case"tags":if(Oe(e))return void he(e);if(Ce())return;Ae(e),T.value&&U(),be(e),d.value&&J(),_.value&&Q()}_.value?Y():X()}},handleGroupClick:function(e){if(!Fe(e)&&"single"!==c.value&&R.value){switch(c.value){case"multiple":case"tags":Se(e[V.value])?he(e[V.value]):be(e[V.value].filter((function(e){return-1===N.value.map((function(e){return e[q.value]})).indexOf(e[q.value])})).filter((function(e){return!e.disabled})).filter((function(e,u){return N.value.length+1+u<=j.value||-1===j.value})))}_.value&&Y()}},handleTagRemove:function(e,u){0===u.button?De(e):u.preventDefault()},refreshOptions:function(e){je(e)},resolveOptions:je,refreshLabels:Ie}}function A(e){return function(e){if(Array.isArray(e))return S(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,u){if(!e)return;if("string"==typeof e)return S(e,u);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return S(e,u)}(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 S(e,u){(null==u||u>e.length)&&(u=e.length);for(var t=0,l=new Array(u);t<u;t++)l[t]=e[t];return l}function L(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,u){if(!e)return;if("string"==typeof e)return E(e,u);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return E(e,u)}(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 E(e,u){(null==u||u>e.length)&&(u=e.length);for(var t=0,l=new Array(u);t<u;t++)l[t]=e[t];return l}function B(e,u){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);u&&(l=l.filter((function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable}))),t.push.apply(t,l)}return t}function P(e,u,t){return u in e?Object.defineProperty(e,u,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[u]=t,e}function k(u,l,n){var a=e(u),r=a.classes,i=a.disabled,o=a.openDirection,s=a.showOptions,c=n.isOpen,v=n.isPointed,p=n.isSelected,d=n.isDisabled,f=n.isActive,g=n.canPointGroups,b=n.resolving,h=n.fo,m=t((function(){return function(e){for(var u=1;u<arguments.length;u++){var t=null!=arguments[u]?arguments[u]:{};u%2?B(Object(t),!0).forEach((function(u){P(e,u,t[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach((function(u){Object.defineProperty(e,u,Object.getOwnPropertyDescriptor(t,u))}))}return e}({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",spacer:"multiselect-spacer"},r.value)})),D=t((function(){return!!(c.value&&s.value&&(!b.value||b.value&&h.value.length))}));return{classList:t((function(){var e=m.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(D.value&&"top"===o.value?e.containerOpenTop:[]).concat(D.value&&"top"!==o.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(c.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,dropdown:[e.dropdown].concat("top"===o.value?e.dropdownTop:[]).concat(c.value&&s.value&&D.value?[]:e.dropdownHidden),options:[e.options].concat("top"===o.value?e.optionsTop:[]),group:e.group,groupLabel:function(u){var t=[e.groupLabel];return v(u)?t.push(p(u)?e.groupLabelSelectedPointed:e.groupLabelPointed):p(u)&&g.value?t.push(d(u)?e.groupLabelSelectedDisabled:e.groupLabelSelected):d(u)&&t.push(e.groupLabelDisabled),g.value&&t.push(e.groupLabelPointable),t},groupOptions:e.groupOptions,option:function(u,t){var l=[e.option];return v(u)?l.push(p(u)?e.optionSelectedPointed:e.optionPointed):p(u)?l.push(d(u)?e.optionSelectedDisabled:e.optionSelected):(d(u)||t&&d(t))&&l.push(e.optionDisabled),l},noOptions:e.noOptions,noResults:e.noResults,fakeInput:e.fakeInput}})),showDropdown:D}}var w={name:"Multiselect",emits:["open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},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:void 0},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},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 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},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:[Object],default:()=>({})}},setup(n,r){const i=function(l,n){var a=e(l),r=a.value,i=a.modelValue,o=a.mode,s=a.valueProp,c=u("single"!==o.value?[]:{}),v=void 0!==n.expose?i:r,p=t((function(){return"single"===o.value?c.value[s.value]:c.value.map((function(e){return e[s.value]}))})),d=t((function(){return"single"!==o.value?c.value.map((function(e){return e[s.value]})).join(","):c.value[s.value]}));return{iv:c,internalValue:c,ev:v,externalValue:v,textValue:d,plainValue:p}}(n,r),o=function(t,l,n){var a=e(t),r=a.groupSelect,i=a.mode,o=a.groups,s=u(null),c=function(e){void 0===e||null!==e&&e.disabled||o.value&&e&&e.group&&("single"===i.value||!r.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:function(){c(null)}}}(n),s=function(t,l,n){var a=e(t).disabled,r=u(!1);return{isOpen:r,open:function(){r.value||a.value||(r.value=!0,l.emit("open"))},close:function(){r.value&&(r.value=!1,l.emit("close"))}}}(n,r),c=function(e,t,n){var a=u(null),r=u(null);return l(a,(function(e){t.emit("search-change",e)})),{search:a,input:r,clearSearch:function(){a.value=""},handleSearchInput:function(e){a.value=e.target.value},handlePaste:function(e){t.emit("paste",e)}}}(0,r),v=function(u,t,l){var n=e(u),a=n.object,r=n.valueProp,i=n.mode,o=l.iv,s=function(e){return a.value||h(e)?e:Array.isArray(e)?e.map((function(e){return e[r.value]})):e[r.value]},c=function(e){return h(e)?"single"===i.value?{}:[]:e};return{update:function(e){o.value=c(e);var u=s(e);t.emit("change",u),t.emit("input",u),t.emit("update:modelValue",u)}}}(n,r,{iv:i.iv}),p=function(l,n,a){var r=e(l),i=r.searchable,o=r.disabled,s=a.input,c=a.open,v=a.close,p=a.clearSearch,d=u(null),f=u(!1),g=t((function(){return i.value||o.value?-1:0})),b=function(){i.value&&s.value.blur(),d.value.blur()},h=function(){i.value&&!o.value&&s.value.focus()},m=function(){f.value=!1,setTimeout((function(){f.value||(v(),p())}),1)};return{multiselect:d,tabindex:g,isActive:f,blur:b,focus:h,handleFocus:function(){h()},activate:function(){o.value||(f.value=!0,c())},deactivate:m,handleCaretClick:function(){m(),b()}}}(n,0,{input:c.input,open:s.open,close:s.close,clearSearch:c.clearSearch}),d=C(n,r,{ev:i.ev,iv:i.iv,search:c.search,clearSearch:c.clearSearch,update:v.update,pointer:o.pointer,clearPointer:o.clearPointer,blur:p.blur,focus:p.focus,deactivate:p.deactivate}),f=function(u,n,r){var i=e(u),o=i.valueProp,s=i.showOptions,c=i.searchable,v=i.groupLabel,p=i.groups,d=i.mode,f=i.groupSelect,g=r.fo,b=r.fg,h=r.handleOptionClick,m=r.handleGroupClick,D=r.search,y=r.pointer,O=r.setPointer,F=r.clearPointer,C=r.multiselect,S=t((function(){return g.value.filter((function(e){return!e.disabled}))})),L=t((function(){return b.value.filter((function(e){return!e.disabled}))})),E=t((function(){return"single"!==d.value&&f.value})),B=t((function(){return y.value&&y.value.group})),P=t((function(){return V(y.value)})),k=t((function(){var e=B.value?y.value:V(y.value),u=L.value.map((function(e){return e[v.value]})).indexOf(e[v.value]),t=L.value[u-1];return void 0===t&&(t=T.value),t})),w=t((function(){var e=L.value.map((function(e){return e.label})).indexOf(B.value?y.value[v.value]:V(y.value)[v.value])+1;return L.value.length<=e&&(e=0),L.value[e]})),T=t((function(){return A(L.value).slice(-1)[0]})),q=t((function(){return y.value.__VISIBLE__.filter((function(e){return!e.disabled}))[0]})),x=t((function(){var e=P.value.__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[o.value]})).indexOf(y.value[o.value])-1]})),j=t((function(){var e=V(y.value).__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[o.value]})).indexOf(y.value[o.value])+1]})),I=t((function(){return A(k.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),_=t((function(){return A(T.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),M=function(){O(S.value[0]||null)},V=function(e){return L.value.find((function(u){return-1!==u.__VISIBLE__.map((function(e){return e[o.value]})).indexOf(e[o.value])}))},H=function(){var e=C.value.querySelector("[data-pointed]");if(e){var u=e.parentElement.parentElement;p.value&&(u=B.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>u.clientHeight+u.scrollTop&&(u.scrollTop=e.offsetTop+e.offsetHeight-u.clientHeight),e.offsetTop<u.scrollTop&&(u.scrollTop=e.offsetTop)}};return l(D,(function(e){c.value&&(e.length&&s.value?M():F())})),{pointer:y,canPointGroups:E,isPointed:function(e){return!(!y.value||!(!e.group&&y.value[o.value]==e[o.value]||void 0!==e.group&&y.value[v.value]==e[v.value]))||void 0},setPointerFirst:M,selectPointer:function(){y.value&&!0!==y.value.disabled&&(B.value?m(y.value):h(y.value))},forwardPointer:function(){if(null===y.value)O((p.value&&E.value?L.value[0]:S.value[0])||null);else if(p.value&&E.value){var e=B.value?q.value:j.value;void 0===e&&(e=w.value),O(e||null)}else{var u=S.value.map((function(e){return e[o.value]})).indexOf(y.value[o.value])+1;S.value.length<=u&&(u=0),O(S.value[u]||null)}a((function(){H()}))},backwardPointer:function(){if(null===y.value){var e=S.value[S.value.length-1];p.value&&E.value&&void 0===(e=_.value)&&(e=T.value),O(e||null)}else if(p.value&&E.value){var u=B.value?I.value:x.value;void 0===u&&(u=B.value?k.value:P.value),O(u||null)}else{var t=S.value.map((function(e){return e[o.value]})).indexOf(y.value[o.value])-1;t<0&&(t=S.value.length-1),O(S.value[t]||null)}a((function(){H()}))}}}(n,0,{fo:d.fo,fg:d.fg,handleOptionClick:d.handleOptionClick,handleGroupClick:d.handleGroupClick,search:c.search,pointer:o.pointer,setPointer:o.setPointer,clearPointer:o.clearPointer,multiselect:p.multiselect}),g=function(u,l,n){var a=e(u),r=a.mode,i=a.addTagOn,o=a.openDirection,s=a.searchable,c=a.showOptions,v=a.valueProp,p=a.groups,d=a.addOptionOn,f=a.createTag,g=a.createOption,b=n.iv,h=n.update,m=n.search,D=n.setPointer,y=n.selectPointer,O=n.backwardPointer,F=n.forwardPointer,C=n.blur,A=n.fo,S=t((function(){return f.value||g.value||!1})),E=t((function(){return void 0!==i.value?i.value:void 0!==d.value?d.value:["enter"]})),B=function(){"tags"===r.value&&!c.value&&S.value&&s.value&&!p.value&&D(A.value[A.value.map((function(e){return e[v.value]})).indexOf(m.value)])};return{handleKeydown:function(e){switch(e.key){case"Backspace":if("single"===r.value)return;if(s.value&&-1===[null,""].indexOf(m.value))return;if(0===b.value.length)return;h(L(b.value).slice(0,-1));break;case"Enter":if(e.preventDefault(),-1===E.value.indexOf("enter")&&S.value)return;B(),y();break;case" ":if(!S.value&&!s.value)return e.preventDefault(),B(),void y();if(!S.value)return!1;if(-1===E.value.indexOf("space")&&S.value)return;e.preventDefault(),B(),y();break;case"Tab":case";":case",":if(-1===E.value.indexOf(e.key.toLowerCase())||!S.value)return;B(),y(),e.preventDefault();break;case"Escape":C();break;case"ArrowUp":if(e.preventDefault(),!c.value)return;"top"===o.value?F():O();break;case"ArrowDown":if(e.preventDefault(),!c.value)return;"top"===o.value?O():F()}},preparePointer:B}}(n,0,{iv:i.iv,update:v.update,search:c.search,setPointer:o.setPointer,selectPointer:f.selectPointer,backwardPointer:f.backwardPointer,forwardPointer:f.forwardPointer,blur:p.blur,fo:d.fo}),b=k(n,0,{isOpen:s.isOpen,isPointed:f.isPointed,canPointGroups:f.canPointGroups,isSelected:d.isSelected,isDisabled:d.isDisabled,isActive:p.isActive,resolving:d.resolving,fo:d.fo});return{...i,...s,...p,...o,...v,...c,...d,...f,...g,...b}}};w.render=function(e,u,t,l,n,a){return r(),i("div",{ref:"multiselect",tabindex:e.tabindex,class:e.classList.container,id:t.id,onFocusin:u[7]||(u[7]=(...u)=>e.activate&&e.activate(...u)),onFocusout:u[8]||(u[8]=(...u)=>e.deactivate&&e.deactivate(...u)),onKeydown:u[9]||(u[9]=(...u)=>e.handleKeydown&&e.handleKeydown(...u)),onFocus:u[10]||(u[10]=(...u)=>e.handleFocus&&e.handleFocus(...u))},[o(" Search "),"tags"!==t.mode&&t.searchable&&!t.disabled?(r(),i("input",s({key:0,type:t.inputType,modelValue:e.search,value:e.search,class:e.classList.search,autocomplete:t.autocomplete},t.attrs,{onInput:u[1]||(u[1]=(...u)=>e.handleSearchInput&&e.handleSearchInput(...u)),onPaste:u[2]||(u[2]=c(((...u)=>e.handlePaste&&e.handlePaste(...u)),["stop"])),ref:"input"}),null,16,["type","modelValue","value","autocomplete"])):o("v-if",!0),o(" Tags (with search) "),"tags"==t.mode?(r(),i("div",{key:1,class:e.classList.tags},[(r(!0),i(v,null,p(e.iv,((u,l,n)=>d(e.$slots,"tag",{option:u,handleTagRemove:e.handleTagRemove,disabled:t.disabled},(()=>[(r(),i("span",{class:e.classList.tag,key:n},[f(g(u[t.label])+" ",1),t.disabled?o("v-if",!0):(r(),i("span",{key:0,class:e.classList.tagRemove,onClick:t=>e.handleTagRemove(u,t)},[b("span",{class:e.classList.tagRemoveIcon},null,2)],10,["onClick"]))],2))])))),256)),b("div",{class:e.classList.tagsSearchWrapper},[o(" Used for measuring search width "),b("span",{class:e.classList.tagsSearchCopy},g(e.search),3),o(" Actual search input "),t.searchable&&!t.disabled?(r(),i("input",s({key:0,type:t.inputType,modelValue:e.search,value:e.search,class:e.classList.tagsSearch,autocomplete:t.autocomplete},t.attrs,{onInput:u[3]||(u[3]=(...u)=>e.handleSearchInput&&e.handleSearchInput(...u)),onPaste:u[4]||(u[4]=c(((...u)=>e.handlePaste&&e.handlePaste(...u)),["stop"])),ref:"input"}),null,16,["type","modelValue","value","autocomplete"])):o("v-if",!0)],2)],2)):o("v-if",!0),o(" Single label "),"single"==t.mode&&e.hasSelected&&!e.search&&e.iv?d(e.$slots,"singlelabel",{key:2,value:e.iv},(()=>[b("div",{class:e.classList.singleLabel},[b("span",{class:e.classList.singleLabelText,innerHTML:e.iv[t.label]},null,10,["innerHTML"])],2)])):o("v-if",!0),o(" Multiple label "),"multiple"==t.mode&&e.hasSelected&&!e.search?d(e.$slots,"multiplelabel",{key:3,values:e.iv},(()=>[b("div",{class:e.classList.multipleLabel,innerHTML:e.multipleLabelText},null,10,["innerHTML"])])):o("v-if",!0),o(" Placeholder "),!t.placeholder||e.hasSelected||e.search?o("v-if",!0):d(e.$slots,"placeholder",{key:4},(()=>[b("div",{class:e.classList.placeholder},g(t.placeholder),3)])),o(" Spinner "),e.busy&&e.isActive?d(e.$slots,"spinner",{key:5},(()=>[b("span",{class:e.classList.spinner},null,2)])):o("v-if",!0),o(" Clear "),e.hasSelected&&!t.disabled&&t.canClear&&!e.busy?d(e.$slots,"clear",{key:6,clear:e.clear},(()=>[b("span",{class:e.classList.clear,onMousedown:u[5]||(u[5]=(...u)=>e.clear&&e.clear(...u))},[b("span",{class:e.classList.clearIcon},null,2)],34)])):o("v-if",!0),o(" Caret "),t.caret&&t.showOptions?d(e.$slots,"caret",{key:7},(()=>[b("span",{class:e.classList.caret,onClick:u[6]||(u[6]=(...u)=>e.handleCaretClick&&e.handleCaretClick(...u))},null,2)])):o("v-if",!0),o(" Options "),b("div",{class:e.classList.dropdown,tabindex:"-1"},[d(e.$slots,"beforelist",{options:e.fo}),b("ul",{class:e.classList.options},[t.groups?(r(!0),i(v,{key:0},p(e.fg,((u,l,n)=>(r(),i("li",{class:e.classList.group,key:n},[b("div",{class:e.classList.groupLabel(u),"data-pointed":e.isPointed(u),onMouseenter:t=>e.setPointer(u),onClick:t=>e.handleGroupClick(u)},[d(e.$slots,"grouplabel",{group:u},(()=>[b("span",{innerHTML:u[t.groupLabel]},null,8,["innerHTML"])]))],42,["data-pointed","onMouseenter","onClick"]),b("ul",{class:e.classList.groupOptions},[(r(!0),i(v,null,p(u.__VISIBLE__,((l,n,a)=>(r(),i("li",{class:e.classList.option(l,u),key:a,"data-pointed":e.isPointed(l),onMouseenter:u=>e.setPointer(l),onClick:u=>e.handleOptionClick(l)},[d(e.$slots,"option",{option:l,search:e.search},(()=>[b("span",{innerHTML:l[t.label]},null,8,["innerHTML"])]))],42,["data-pointed","onMouseenter","onClick"])))),128))],2)],2)))),128)):(r(!0),i(v,{key:1},p(e.fo,((u,l,n)=>(r(),i("li",{class:e.classList.option(u),key:n,"data-pointed":e.isPointed(u),onMouseenter:t=>e.setPointer(u),onClick:t=>e.handleOptionClick(u)},[d(e.$slots,"option",{option:u,search:e.search},(()=>[b("span",{innerHTML:u[t.label]},null,8,["innerHTML"])]))],42,["data-pointed","onMouseenter","onClick"])))),128))],2),e.noOptions?d(e.$slots,"nooptions",{key:0},(()=>[b("div",{class:e.classList.noOptions,innerHTML:t.noOptionsText},null,10,["innerHTML"])])):o("v-if",!0),e.noResults?d(e.$slots,"noresults",{key:1},(()=>[b("div",{class:e.classList.noResults,innerHTML:t.noResultsText},null,10,["innerHTML"])])):o("v-if",!0),d(e.$slots,"afterlist",{options:e.fo})],2),o(" Hacky input element to show HTML5 required warning "),t.required?(r(),i("input",{key:8,class:e.classList.fakeInput,tabindex:"-1",value:e.textValue,required:""},null,10,["value"])):o("v-if",!0),o(" Native input support "),t.nativeSupport?(r(),i(v,{key:9},["single"==t.mode?(r(),i("input",{key:0,type:"hidden",name:t.name,value:void 0!==e.plainValue?e.plainValue:""},null,8,["name","value"])):(r(!0),i(v,{key:1},p(e.plainValue,((e,u)=>(r(),i("input",{type:"hidden",name:`${t.name}[]`,value:e,key:u},null,8,["name","value"])))),128))],64)):o("v-if",!0),o(" Create height for empty input "),b("div",{class:e.classList.spacer},null,2)],42,["tabindex","id"])},w.__file="src/Multiselect.vue";export default w; |
@@ -1,1 +0,1 @@ | ||
var VueformMultiselect=function(e){"use strict";function u(e){return-1!==[null,void 0,!1].indexOf(e)}function t(e){return(t="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,u,t){return u in e?Object.defineProperty(e,u,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[u]=t,e}function n(e,u){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);u&&(a=a.filter((function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable}))),t.push.apply(t,a)}return t}function l(e){for(var u=1;u<arguments.length;u++){var t=null!=arguments[u]?arguments[u]:{};u%2?n(Object(t),!0).forEach((function(u){a(e,u,t[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):n(Object(t)).forEach((function(u){Object.defineProperty(e,u,Object.getOwnPropertyDescriptor(t,u))}))}return e}function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,u){if(!e)return;if("string"==typeof e)return i(e,u);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,u)}(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 i(e,u){(null==u||u>e.length)&&(u=e.length);for(var t=0,a=new Array(u);t<u;t++)a[t]=e[t];return a}function o(e){var u=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return u?String(e).toLowerCase().trim():String(e).normalize("NFD").replace(/(?:[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0B55\u0BCD\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E47-\u0E4C\u0E4E\u0EBA\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1063\u1064\u1069-\u106D\u1087-\u108D\u108F\u109A\u109B\u135D-\u135F\u17C9-\u17D3\u17DD\u1939-\u193B\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DF9\u1DFD-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA700-\uA721\uA788-\uA78A\uA7F8\uA7F9\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uAB69-\uAB6B\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3]|\uD800\uDEE0|\uD802[\uDEE5\uDEE6]|\uD803[\uDD22-\uDD27\uDF46-\uDF50]|\uD804[\uDCB9\uDCBA\uDD33\uDD34\uDD73\uDDC0\uDDCA-\uDDCC\uDE35\uDE36\uDEE9\uDEEA\uDF3C\uDF4D\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC42\uDC46\uDCC2\uDCC3\uDDBF\uDDC0\uDE3F\uDEB6\uDEB7\uDF2B]|\uD806[\uDC39\uDC3A\uDD3D\uDD3E\uDD43\uDDE0\uDE34\uDE47\uDE99]|\uD807[\uDC3F\uDD42\uDD44\uDD45\uDD97]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF9F\uDFF0\uDFF1]|\uD834[\uDD67-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD838[\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD46\uDD48-\uDD4A])/g,"").toLowerCase().trim()}function s(n,r,i){var s=e.toRefs(n),c=s.options,v=s.mode,p=s.trackBy,d=s.limit,f=s.hideSelected,g=s.createTag,m=s.createOption,b=s.label,D=s.appendNewTag,h=s.appendNewOption,y=s.multipleLabel,_=s.object,F=s.loading,O=s.delay,C=s.resolveOnLoad,A=s.minChars,S=s.filterResults,E=s.clearOnSearch,B=s.clearOnSelect,L=s.valueProp,P=s.canDeselect,w=s.max,k=s.strict,q=s.closeOnSelect,x=s.groups,T=(s.groupLabel,s.groupOptions),I=s.groupHideEmpty,R=s.groupSelect,j=i.iv,V=i.ev,N=i.search,G=i.clearSearch,H=i.update,$=i.pointer,M=i.clearPointer,U=i.blur,W=i.focus,K=i.deactivate,X=e.ref([]),z=e.ref([]),J=e.ref(!1),Q=e.computed((function(){return g.value||m.value||!1})),Y=e.computed((function(){return void 0!==D.value?D.value:void 0===h.value||h.value})),Z=e.computed((function(){if(x.value){var e=z.value||[],u=[];return e.forEach((function(e){Ee(e[T.value]).forEach((function(t){u.push(Object.assign({},t,e.disabled?{disabled:!0}:{}))}))})),u}var t=Ee(z.value||[]);return X.value.length&&(t=t.concat(X.value)),t})),ee=e.computed((function(){return x.value?Ae((z.value||[]).map((function(e){var u,t=Ee(e[T.value]);return l(l({},e),{},(a(u={group:!0},T.value,Se(t,!1).map((function(u){return Object.assign({},u,e.disabled?{disabled:!0}:{})}))),a(u,"__VISIBLE__",Se(t).map((function(u){return Object.assign({},u,e.disabled?{disabled:!0}:{})}))),u))}))):[]})),ue=e.computed((function(){var e=Z.value;return re.value.length&&(e=re.value.concat(e)),e=Se(e),d.value>0&&(e=e.slice(0,d.value)),e})),te=e.computed((function(){switch(v.value){case"single":return!u(j.value[L.value]);case"multiple":case"tags":return!u(j.value)&&j.value.length>0}})),ae=e.computed((function(){return void 0!==y&&void 0!==y.value?y.value(j.value):j.value&&j.value.length>1?"".concat(j.value.length," options selected"):"1 option selected"})),ne=e.computed((function(){return!Z.value.length&&!J.value&&!re.value.length})),le=e.computed((function(){return Z.value.length>0&&0==ue.value.length&&(N.value&&x.value||!x.value)})),re=e.computed((function(){var e;return!1!==Q.value&&N.value?-1!==Fe(N.value)?[]:[(e={},a(e,L.value,N.value),a(e,b.value,N.value),a(e,ie.value,N.value),e)]:[]})),ie=e.computed((function(){return p.value||b.value})),oe=e.computed((function(){switch(v.value){case"single":return null;case"multiple":case"tags":return[]}})),se=e.computed((function(){return F.value||J.value})),ce=function(e){switch("object"!==t(e)&&(e=_e(e)),v.value){case"single":H(e);break;case"multiple":case"tags":H(j.value.concat(e))}r.emit("select",pe(e),e)},ve=function(e){switch("object"!==t(e)&&(e=_e(e)),v.value){case"single":fe();break;case"tags":case"multiple":H(Array.isArray(e)?j.value.filter((function(u){return-1===e.map((function(e){return e[L.value]})).indexOf(u[L.value])})):j.value.filter((function(u){return u[L.value]!=e[L.value]})))}r.emit("deselect",pe(e),e)},pe=function(e){return _.value?e:e[L.value]},de=function(e){ve(e)},fe=function(){r.emit("clear"),H(oe.value)},ge=function(e){if(void 0!==e.group)return"single"!==v.value&&(ye(e[T.value])&&e[T.value].length);switch(v.value){case"single":return!u(j.value)&&j.value[L.value]==e[L.value];case"tags":case"multiple":return!u(j.value)&&-1!==j.value.map((function(e){return e[L.value]})).indexOf(e[L.value])}},me=function(e){return!0===e.disabled},be=function(){return!(void 0===w||-1===w.value||!te.value&&w.value>0)&&j.value.length>=w.value},De=function(e){void 0===_e(e[L.value])&&Q.value&&(r.emit("tag",e[L.value]),r.emit("option",e[L.value]),Y.value&&Ce(e),G())},he=function(e){return void 0===e.find((function(e){return!ge(e)&&!e.disabled}))},ye=function(e){return void 0===e.find((function(e){return!ge(e)}))},_e=function(e){return Z.value[Z.value.map((function(e){return String(e[L.value])})).indexOf(String(e))]},Fe=function(e){return Z.value.map((function(e){return e[ie.value]})).indexOf(e)},Oe=function(e){return-1!==["tags","multiple"].indexOf(v.value)&&f.value&&ge(e)},Ce=function(e){X.value.push(e)},Ae=function(e){return I.value?e.filter((function(e){return N.value?e.__VISIBLE__.length:e[T.value].length})):e.filter((function(e){return!N.value||e.__VISIBLE__.length}))},Se=function(e){var u=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=e;return N.value&&S.value&&(t=t.filter((function(e){return-1!==o(e[ie.value],k.value).indexOf(o(N.value,k.value))}))),f.value&&u&&(t=t.filter((function(e){return!Oe(e)}))),t},Ee=function(e){var u,n=e;return u=n,"[object Object]"===Object.prototype.toString.call(u)&&(n=Object.keys(n).map((function(e){var u,t=n[e];return a(u={},L.value,e),a(u,ie.value,t),a(u,b.value,t),u}))),n=n.map((function(e){var u;return"object"===t(e)?e:(a(u={},L.value,e),a(u,ie.value,e),a(u,b.value,e),u)}))},Be=function(){u(V.value)||(j.value=Pe(V.value))},Le=function(e){J.value=!0,c.value(N.value).then((function(u){z.value=u,"function"==typeof e&&e(u),J.value=!1}))},Pe=function(e){return u(e)?"single"===v.value?{}:[]:_.value?e:"single"===v.value?_e(e)||{}:e.filter((function(e){return!!_e(e)})).map((function(e){return _e(e)}))};if("single"!==v.value&&!u(V.value)&&!Array.isArray(V.value))throw new Error('v-model must be an array when using "'.concat(v.value,'" mode'));return c&&"function"==typeof c.value?C.value?Le(Be):1==_.value&&Be():(z.value=c.value,Be()),O.value>-1&&e.watch(N,(function(e){e.length<A.value||(J.value=!0,E.value&&(z.value=[]),setTimeout((function(){e==N.value&&c.value(N.value).then((function(u){e!=N.value&&N.value||(z.value=u,$.value=ue.value.filter((function(e){return!0!==e.disabled}))[0]||null,J.value=!1)}))}),O.value))}),{flush:"sync"}),e.watch(V,(function(e){var t,a,n;if(u(e))j.value=Pe(e);else switch(v.value){case"single":(_.value?e[L.value]!=j.value[L.value]:e!=j.value[L.value])&&(j.value=Pe(e));break;case"multiple":case"tags":t=_.value?e.map((function(e){return e[L.value]})):e,a=j.value.map((function(e){return e[L.value]})),n=a.slice().sort(),t.length===a.length&&t.slice().sort().every((function(e,u){return e===n[u]}))||(j.value=Pe(e))}}),{deep:!0}),"function"!=typeof n.options&&e.watch(c,(function(e,u){z.value=n.options,Object.keys(j.value).length||Be(),function(){if(te.value)if("single"===v.value){var e=_e(j.value[L.value])[b.value];j.value[b.value]=e,_.value&&(V.value[b.value]=e)}else j.value.forEach((function(e,u){var t=_e(j.value[u][L.value])[b.value];j.value[u][b.value]=t,_.value&&(V.value[u][b.value]=t)}))}()})),{fo:ue,filteredOptions:ue,hasSelected:te,multipleLabelText:ae,eo:Z,extendedOptions:Z,fg:ee,filteredGroups:ee,noOptions:ne,noResults:le,resolving:J,busy:se,select:ce,deselect:ve,remove:de,selectAll:function(){"single"!==v.value&&ce(ue.value)},clear:fe,isSelected:ge,isDisabled:me,isMax:be,getOption:_e,handleOptionClick:function(e){if(!me(e)){switch(v.value){case"single":if(ge(e))return void(P.value&&ve(e));De(e),U(),ce(e);break;case"multiple":if(ge(e))return void ve(e);if(be())return;De(e),ce(e),B.value&&G(),f.value&&M(),q.value&&U();break;case"tags":if(ge(e))return void ve(e);if(be())return;De(e),B.value&&G(),ce(e),f.value&&M(),q.value&&U()}q.value?K():W()}},handleGroupClick:function(e){if(!me(e)&&"single"!==v.value&&R.value){switch(v.value){case"multiple":case"tags":he(e[T.value])?ve(e[T.value]):ce(e[T.value].filter((function(e){return-1===j.value.map((function(e){return e[L.value]})).indexOf(e[L.value])})).filter((function(e){return!e.disabled})).filter((function(e,u){return j.value.length+1+u<=w.value||-1===w.value})))}q.value&&K()}},handleTagRemove:function(e,u){0===u.button?de(e):u.preventDefault()},refreshOptions:function(e){Le(e)},resolveOptions:Le}}function c(e,u,t,a,n,l,r,i,o,s){"boolean"!=typeof r&&(o=i,i=r,r=!1);var c,v="function"==typeof t?t.options:t;if(e&&e.render&&(v.render=e.render,v.staticRenderFns=e.staticRenderFns,v._compiled=!0,n&&(v.functional=!0)),a&&(v._scopeId=a),l?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),u&&u.call(this,o(e)),e&&e._registeredComponents&&e._registeredComponents.add(l)},v._ssrRegister=c):u&&(c=r?function(e){u.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){u.call(this,i(e))}),c)if(v.functional){var p=v.render;v.render=function(e,u){return c.call(u),p(e,u)}}else{var d=v.beforeCreate;v.beforeCreate=d?[].concat(d,c):[c]}return t}const v={name:"Multiselect",emits:["open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},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:void 0},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},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 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},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:[Object],default:()=>({})}},setup(t,a){const n=function(u,t){var a=e.toRefs(u),n=a.value,l=a.modelValue,r=a.mode,i=a.valueProp,o=e.ref("single"!==r.value?[]:{}),s=void 0!==t.expose?l:n,c=e.computed((function(){return"single"===r.value?o.value[i.value]:o.value.map((function(e){return e[i.value]}))})),v=e.computed((function(){return"single"!==r.value?o.value.map((function(e){return e[i.value]})).join(","):o.value[i.value]}));return{iv:o,internalValue:o,ev:s,externalValue:s,textValue:v,plainValue:c}}(t,a),i=function(u,t,a){var n=e.toRefs(u),l=n.groupSelect,r=n.mode,i=n.groups,o=e.ref(null),s=function(e){void 0===e||null!==e&&e.disabled||i.value&&e&&e.group&&("single"===r.value||!l.value)||(o.value=e)};return{pointer:o,setPointer:s,clearPointer:function(){s(null)}}}(t),o=function(u,t,a){var n=e.toRefs(u).disabled,l=e.ref(!1);return{isOpen:l,open:function(){l.value||n.value||(l.value=!0,t.emit("open"))},close:function(){l.value&&(l.value=!1,t.emit("close"))}}}(t,a),c=function(u,t,a){var n=e.ref(null),l=e.ref(null);return e.watch(n,(function(e){t.emit("search-change",e)})),{search:n,input:l,clearSearch:function(){n.value=""},handleSearchInput:function(e){n.value=e.target.value},handlePaste:function(e){t.emit("paste",e)}}}(0,a),v=function(t,a,n){var l=e.toRefs(t),r=l.object,i=l.valueProp,o=l.mode,s=n.iv,c=function(e){return r.value||u(e)?e:Array.isArray(e)?e.map((function(e){return e[i.value]})):e[i.value]},v=function(e){return u(e)?"single"===o.value?{}:[]:e};return{update:function(e){s.value=v(e);var u=c(e);a.emit("change",u),a.emit("input",u),a.emit("update:modelValue",u)}}}(t,a,{iv:n.iv}),p=function(u,t,a){var n=e.toRefs(u),l=n.searchable,r=n.disabled,i=a.input,o=a.open,s=a.close,c=a.clearSearch,v=e.ref(null),p=e.ref(!1),d=e.computed((function(){return l.value||r.value?-1:0})),f=function(){l.value&&i.value.blur(),v.value.blur()},g=function(){l.value&&!r.value&&i.value.focus()},m=function(){p.value=!1,setTimeout((function(){p.value||(s(),c())}),1)};return{multiselect:v,tabindex:d,isActive:p,blur:f,focus:g,handleFocus:function(){g()},activate:function(){r.value||(p.value=!0,o())},deactivate:m,handleCaretClick:function(){m(),f()}}}(t,0,{input:c.input,open:o.open,close:o.close,clearSearch:c.clearSearch}),d=s(t,a,{ev:n.ev,iv:n.iv,search:c.search,clearSearch:c.clearSearch,update:v.update,pointer:i.pointer,clearPointer:i.clearPointer,blur:p.blur,focus:p.focus,deactivate:p.deactivate}),f=function(u,t,a){var n=e.toRefs(u),l=n.valueProp,i=n.showOptions,o=n.searchable,s=n.groupLabel,c=n.groups,v=n.mode,p=n.groupSelect,d=a.fo,f=a.fg,g=a.handleOptionClick,m=a.handleGroupClick,b=a.search,D=a.pointer,h=a.setPointer,y=a.clearPointer,_=a.multiselect,F=e.computed((function(){return d.value.filter((function(e){return!e.disabled}))})),O=e.computed((function(){return f.value.filter((function(e){return!e.disabled}))})),C=e.computed((function(){return"single"!==v.value&&p.value})),A=e.computed((function(){return D.value&&D.value.group})),S=e.computed((function(){return I(D.value)})),E=e.computed((function(){var e=A.value?D.value:I(D.value),u=O.value.map((function(e){return e[s.value]})).indexOf(e[s.value]),t=O.value[u-1];return void 0===t&&(t=L.value),t})),B=e.computed((function(){var e=O.value.map((function(e){return e.label})).indexOf(A.value?D.value[s.value]:I(D.value)[s.value])+1;return O.value.length<=e&&(e=0),O.value[e]})),L=e.computed((function(){return r(O.value).slice(-1)[0]})),P=e.computed((function(){return D.value.__VISIBLE__.filter((function(e){return!e.disabled}))[0]})),w=e.computed((function(){var e=S.value.__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[l.value]})).indexOf(D.value[l.value])-1]})),k=e.computed((function(){var e=I(D.value).__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[l.value]})).indexOf(D.value[l.value])+1]})),q=e.computed((function(){return r(E.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),x=e.computed((function(){return r(L.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),T=function(){h(F.value[0]||null)},I=function(e){return O.value.find((function(u){return-1!==u.__VISIBLE__.map((function(e){return e[l.value]})).indexOf(e[l.value])}))},R=function(){var e=_.value.querySelector("[data-pointed]");if(e){var u=e.parentElement.parentElement;c.value&&(u=A.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>u.clientHeight+u.scrollTop&&(u.scrollTop=e.offsetTop+e.offsetHeight-u.clientHeight),e.offsetTop<u.scrollTop&&(u.scrollTop=e.offsetTop)}};return e.watch(b,(function(e){o.value&&(e.length&&i.value?T():y())})),{pointer:D,canPointGroups:C,isPointed:function(e){return!(!D.value||!(!e.group&&D.value[l.value]==e[l.value]||void 0!==e.group&&D.value[s.value]==e[s.value]))||void 0},setPointerFirst:T,selectPointer:function(){D.value&&!0!==D.value.disabled&&(A.value?m(D.value):g(D.value))},forwardPointer:function(){if(null===D.value)h((c.value&&C.value?O.value[0]:F.value[0])||null);else if(c.value&&C.value){var u=A.value?P.value:k.value;void 0===u&&(u=B.value),h(u||null)}else{var t=F.value.map((function(e){return e[l.value]})).indexOf(D.value[l.value])+1;F.value.length<=t&&(t=0),h(F.value[t]||null)}e.nextTick((function(){R()}))},backwardPointer:function(){if(null===D.value){var u=F.value[F.value.length-1];c.value&&C.value&&void 0===(u=x.value)&&(u=L.value),h(u||null)}else if(c.value&&C.value){var t=A.value?q.value:w.value;void 0===t&&(t=A.value?E.value:S.value),h(t||null)}else{var a=F.value.map((function(e){return e[l.value]})).indexOf(D.value[l.value])-1;a<0&&(a=F.value.length-1),h(F.value[a]||null)}e.nextTick((function(){R()}))}}}(t,0,{fo:d.fo,fg:d.fg,handleOptionClick:d.handleOptionClick,handleGroupClick:d.handleGroupClick,search:c.search,pointer:i.pointer,setPointer:i.setPointer,clearPointer:i.clearPointer,multiselect:p.multiselect}),g=function(u,t,a){var n=e.toRefs(u),l=n.mode,i=n.addTagOn,o=n.openDirection,s=n.searchable,c=n.showOptions,v=n.valueProp,p=n.groups,d=n.addOptionOn,f=n.createTag,g=n.createOption,m=a.iv,b=a.update,D=a.search,h=a.setPointer,y=a.selectPointer,_=a.backwardPointer,F=a.forwardPointer,O=a.blur,C=a.fo,A=e.computed((function(){return f.value||g.value||!1})),S=e.computed((function(){return void 0!==i.value?i.value:void 0!==d.value?d.value:["enter"]})),E=function(){"tags"===l.value&&!c.value&&A.value&&s.value&&!p.value&&h(C.value[C.value.map((function(e){return e[v.value]})).indexOf(D.value)])};return{handleKeydown:function(e){switch(e.key){case"Backspace":if("single"===l.value)return;if(s.value&&-1===[null,""].indexOf(D.value))return;if(0===m.value.length)return;b(r(m.value).slice(0,-1));break;case"Enter":if(e.preventDefault(),-1===S.value.indexOf("enter")&&A.value)return;E(),y();break;case" ":if(!A.value&&!s.value)return e.preventDefault(),E(),void y();if(!A.value)return!1;if(-1===S.value.indexOf("space")&&A.value)return;e.preventDefault(),E(),y();break;case"Tab":case";":case",":if(-1===S.value.indexOf(e.key.toLowerCase())||!A.value)return;E(),y(),e.preventDefault();break;case"Escape":O();break;case"ArrowUp":if(e.preventDefault(),!c.value)return;"top"===o.value?F():_();break;case"ArrowDown":if(e.preventDefault(),!c.value)return;"top"===o.value?_():F()}},preparePointer:E}}(t,0,{iv:n.iv,update:v.update,search:c.search,setPointer:i.setPointer,selectPointer:f.selectPointer,backwardPointer:f.backwardPointer,forwardPointer:f.forwardPointer,blur:p.blur,fo:d.fo}),m=function(u,t,a){var n=e.toRefs(u),r=n.classes,i=n.disabled,o=n.openDirection,s=n.showOptions,c=a.isOpen,v=a.isPointed,p=a.isSelected,d=a.isDisabled,f=a.isActive,g=a.canPointGroups,m=a.resolving,b=a.fo,D=e.computed((function(){return l({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",spacer:"multiselect-spacer"},r.value)})),h=e.computed((function(){return!!(c.value&&s.value&&(!m.value||m.value&&b.value.length))}));return{classList:e.computed((function(){var e=D.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(h.value&&"top"===o.value?e.containerOpenTop:[]).concat(h.value&&"top"!==o.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(c.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,dropdown:[e.dropdown].concat("top"===o.value?e.dropdownTop:[]).concat(c.value&&s.value&&h.value?[]:e.dropdownHidden),options:[e.options].concat("top"===o.value?e.optionsTop:[]),group:e.group,groupLabel:function(u){var t=[e.groupLabel];return v(u)?t.push(p(u)?e.groupLabelSelectedPointed:e.groupLabelPointed):p(u)&&g.value?t.push(d(u)?e.groupLabelSelectedDisabled:e.groupLabelSelected):d(u)&&t.push(e.groupLabelDisabled),g.value&&t.push(e.groupLabelPointable),t},groupOptions:e.groupOptions,option:function(u,t){var a=[e.option];return v(u)?a.push(p(u)?e.optionSelectedPointed:e.optionPointed):p(u)?a.push(d(u)?e.optionSelectedDisabled:e.optionSelected):(d(u)||t&&d(t))&&a.push(e.optionDisabled),a},noOptions:e.noOptions,noResults:e.noResults,fakeInput:e.fakeInput}})),showDropdown:h}}(t,0,{isOpen:o.isOpen,isPointed:f.isPointed,canPointGroups:f.canPointGroups,isSelected:d.isSelected,isDisabled:d.isDisabled,isActive:p.isActive,resolving:d.resolving,fo:d.fo});return{...n,...o,...p,...i,...v,...c,...d,...f,...g,...m}}};var p=function(){var e=this,u=e.$createElement,t=e._self._c||u;return t("div",{ref:"multiselect",class:e.classList.container,attrs:{tabindex:e.tabindex,id:e.id},on:{focusin:e.activate,focusout:e.deactivate,keydown:e.handleKeydown,focus:e.handleFocus}},["tags"!==e.mode&&e.searchable&&!e.disabled?[t("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete},domProps:{value:e.search},on:{input:e.handleSearchInput,paste:function(u){return u.stopPropagation(),e.handlePaste(u)}}},"input",e.attrs,!1))]:e._e(),e._v(" "),"tags"==e.mode?[t("div",{class:e.classList.tags},[e._l(e.iv,(function(u,a,n){return e._t("tag",[t("span",{key:n,class:e.classList.tag},[e._v("\n "+e._s(u[e.label])+"\n "),e.disabled?e._e():t("span",{class:e.classList.tagRemove,on:{click:function(t){return e.handleTagRemove(u,t)}}},[t("span",{class:e.classList.tagRemoveIcon})])])],{option:u,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),t("div",{class:e.classList.tagsSearchWrapper},[t("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?t("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete},domProps:{value:e.search},on:{input:e.handleSearchInput,paste:function(u){return u.stopPropagation(),e.handlePaste(u)}}},"input",e.attrs,!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",[t("div",{class:e.classList.singleLabel},[t("span",{class:e.classList.singleLabelText},[e._v(e._s(e.iv[e.label]))])])],{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",[t("div",{class:e.classList.multipleLabel},[e._v("\n "+e._s(e.multipleLabelText)+"\n ")])],{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",[t("div",{class:e.classList.placeholder},[e._v("\n "+e._s(e.placeholder)+"\n ")])])],e._v(" "),e.busy&&e.isActive?e._t("spinner",[t("span",{class:e.classList.spinner})]):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",[t("span",{class:e.classList.clear,on:{mousedown:e.clear}},[t("span",{class:e.classList.clearIcon})])],{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",[t("span",{class:e.classList.caret,on:{click:e.handleCaretClick}})]):e._e(),e._v(" "),t("div",{class:e.classList.dropdown,attrs:{tabindex:"-1"}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),t("ul",{class:e.classList.options},[e.groups?e._l(e.fg,(function(u,a,n){return t("li",{key:n,class:e.classList.group},[t("div",{class:e.classList.groupLabel(u),attrs:{"data-pointed":e.isPointed(u)},on:{mouseenter:function(t){return e.setPointer(u)},click:function(t){return e.handleGroupClick(u)}}},[e._t("grouplabel",[t("span",[e._v(e._s(u[e.groupLabel]))])],{group:u})],2),e._v(" "),t("ul",{class:e.classList.groupOptions},e._l(u.__VISIBLE__,(function(a,n,l){return t("li",{key:l,class:e.classList.option(a,u),attrs:{"data-pointed":e.isPointed(a)},on:{mouseenter:function(u){return e.setPointer(a)},click:function(u){return e.handleOptionClick(a)}}},[e._t("option",[t("span",[e._v(e._s(a[e.label]))])],{option:a,search:e.search})],2)})),0)])})):e._l(e.fo,(function(u,a,n){return t("li",{key:n,class:e.classList.option(u),attrs:{"data-pointed":e.isPointed(u)},on:{mouseenter:function(t){return e.setPointer(u)},click:function(t){return e.handleOptionClick(u)}}},[e._t("option",[t("span",[e._v(e._s(u[e.label]))])],{option:u,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",[t("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.noOptionsText)}})]):e._e(),e._v(" "),e.noResults?e._t("noresults",[t("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.noResultsText)}})]):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2),e._v(" "),e.required?t("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?t("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(u,a){return t("input",{key:a,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:u}})}))]:e._e(),e._v(" "),t("div",{class:e.classList.spacer})],2)};p._withStripped=!0;return c({render:p,staticRenderFns:[]},undefined,v,undefined,false,undefined,!1,void 0,void 0,void 0)}(VueCompositionAPI); | ||
var VueformMultiselect=function(e){"use strict";function u(e){return-1!==[null,void 0,!1].indexOf(e)}function t(e){return(t="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 n(e,u,t){return u in e?Object.defineProperty(e,u,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[u]=t,e}function a(e,u){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);u&&(n=n.filter((function(u){return Object.getOwnPropertyDescriptor(e,u).enumerable}))),t.push.apply(t,n)}return t}function l(e){for(var u=1;u<arguments.length;u++){var t=null!=arguments[u]?arguments[u]:{};u%2?a(Object(t),!0).forEach((function(u){n(e,u,t[u])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):a(Object(t)).forEach((function(u){Object.defineProperty(e,u,Object.getOwnPropertyDescriptor(t,u))}))}return e}function r(e){return function(e){if(Array.isArray(e))return i(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,u){if(!e)return;if("string"==typeof e)return i(e,u);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(e);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,u)}(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 i(e,u){(null==u||u>e.length)&&(u=e.length);for(var t=0,n=new Array(u);t<u;t++)n[t]=e[t];return n}function o(e){var u=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return u?String(e).toLowerCase().trim():String(e).normalize("NFD").replace(/(?:[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0B55\u0BCD\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E47-\u0E4C\u0E4E\u0EBA\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1063\u1064\u1069-\u106D\u1087-\u108D\u108F\u109A\u109B\u135D-\u135F\u17C9-\u17D3\u17DD\u1939-\u193B\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DF9\u1DFD-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA700-\uA721\uA788-\uA78A\uA7F8\uA7F9\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uAB69-\uAB6B\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3]|\uD800\uDEE0|\uD802[\uDEE5\uDEE6]|\uD803[\uDD22-\uDD27\uDF46-\uDF50]|\uD804[\uDCB9\uDCBA\uDD33\uDD34\uDD73\uDDC0\uDDCA-\uDDCC\uDE35\uDE36\uDEE9\uDEEA\uDF3C\uDF4D\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC42\uDC46\uDCC2\uDCC3\uDDBF\uDDC0\uDE3F\uDEB6\uDEB7\uDF2B]|\uD806[\uDC39\uDC3A\uDD3D\uDD3E\uDD43\uDDE0\uDE34\uDE47\uDE99]|\uD807[\uDC3F\uDD42\uDD44\uDD45\uDD97]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF9F\uDFF0\uDFF1]|\uD834[\uDD67-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD838[\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD46\uDD48-\uDD4A])/g,"").toLowerCase().trim()}function c(a,r,i){var c=e.toRefs(a),s=c.options,v=c.mode,p=c.trackBy,d=c.limit,f=c.hideSelected,m=c.createTag,g=c.createOption,b=c.label,h=c.appendNewTag,D=c.appendNewOption,y=c.multipleLabel,_=c.object,F=c.loading,O=c.delay,C=c.resolveOnLoad,A=c.minChars,S=c.filterResults,E=c.clearOnSearch,B=c.clearOnSelect,L=c.valueProp,P=c.canDeselect,w=c.max,T=c.strict,k=c.closeOnSelect,x=c.groups,q=(c.groupLabel,c.groupOptions),I=c.groupHideEmpty,R=c.groupSelect,j=e.getCurrentInstance().proxy,V=i.iv,H=i.ev,N=i.search,M=i.clearSearch,G=i.update,$=i.pointer,U=i.clearPointer,W=i.blur,K=i.focus,X=i.deactivate,z=e.ref([]),J=e.ref([]),Q=e.ref(!1),Y=e.ref(null),Z=e.computed((function(){return m.value||g.value||!1})),ee=e.computed((function(){return void 0!==h.value?h.value:void 0===D.value||D.value})),ue=e.computed((function(){if(x.value){var e=J.value||[],u=[];return e.forEach((function(e){Le(e[q.value]).forEach((function(t){u.push(Object.assign({},t,e.disabled?{disabled:!0}:{}))}))})),u}var t=Le(J.value||[]);return z.value.length&&(t=t.concat(z.value)),t})),te=e.computed((function(){return x.value?Ee((J.value||[]).map((function(e){var u,t=Le(e[q.value]);return l(l({},e),{},(n(u={group:!0},q.value,Be(t,!1).map((function(u){return Object.assign({},u,e.disabled?{disabled:!0}:{})}))),n(u,"__VISIBLE__",Be(t).map((function(u){return Object.assign({},u,e.disabled?{disabled:!0}:{})}))),u))}))):[]})),ne=e.computed((function(){var e=ue.value;return oe.value.length&&(e=oe.value.concat(e)),e=Be(e),d.value>0&&(e=e.slice(0,d.value)),e})),ae=e.computed((function(){switch(v.value){case"single":return!u(V.value[L.value]);case"multiple":case"tags":return!u(V.value)&&V.value.length>0}})),le=e.computed((function(){return void 0!==y&&void 0!==y.value?y.value(V.value,j):V.value&&V.value.length>1?"".concat(V.value.length," options selected"):"1 option selected"})),re=e.computed((function(){return!ue.value.length&&!Q.value&&!oe.value.length})),ie=e.computed((function(){return ue.value.length>0&&0==ne.value.length&&(N.value&&x.value||!x.value)})),oe=e.computed((function(){var e;return!1!==Z.value&&N.value?-1!==Ce(N.value)?[]:[(e={},n(e,L.value,N.value),n(e,b.value,N.value),n(e,ce.value,N.value),e)]:[]})),ce=e.computed((function(){return p.value||b.value})),se=e.computed((function(){switch(v.value){case"single":return null;case"multiple":case"tags":return[]}})),ve=e.computed((function(){return F.value||Q.value})),pe=function(e){switch("object"!==t(e)&&(e=Oe(e)),v.value){case"single":G(e);break;case"multiple":case"tags":G(V.value.concat(e))}r.emit("select",fe(e),e)},de=function(e){switch("object"!==t(e)&&(e=Oe(e)),v.value){case"single":ge();break;case"tags":case"multiple":G(Array.isArray(e)?V.value.filter((function(u){return-1===e.map((function(e){return e[L.value]})).indexOf(u[L.value])})):V.value.filter((function(u){return u[L.value]!=e[L.value]})))}r.emit("deselect",fe(e),e)},fe=function(e){return _.value?e:e[L.value]},me=function(e){de(e)},ge=function(){r.emit("clear"),G(se.value)},be=function(e){if(void 0!==e.group)return"single"!==v.value&&(Fe(e[q.value])&&e[q.value].length);switch(v.value){case"single":return!u(V.value)&&V.value[L.value]==e[L.value];case"tags":case"multiple":return!u(V.value)&&-1!==V.value.map((function(e){return e[L.value]})).indexOf(e[L.value])}},he=function(e){return!0===e.disabled},De=function(){return!(void 0===w||-1===w.value||!ae.value&&w.value>0)&&V.value.length>=w.value},ye=function(e){void 0===Oe(e[L.value])&&Z.value&&(r.emit("tag",e[L.value]),r.emit("option",e[L.value]),ee.value&&Se(e),M())},_e=function(e){return void 0===e.find((function(e){return!be(e)&&!e.disabled}))},Fe=function(e){return void 0===e.find((function(e){return!be(e)}))},Oe=function(e){return ue.value[ue.value.map((function(e){return String(e[L.value])})).indexOf(String(e))]},Ce=function(e){return ue.value.map((function(e){return e[ce.value]})).indexOf(e)},Ae=function(e){return-1!==["tags","multiple"].indexOf(v.value)&&f.value&&be(e)},Se=function(e){z.value.push(e)},Ee=function(e){return I.value?e.filter((function(e){return N.value?e.__VISIBLE__.length:e[q.value].length})):e.filter((function(e){return!N.value||e.__VISIBLE__.length}))},Be=function(e){var u=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=e;return N.value&&S.value&&(t=t.filter((function(e){return-1!==o(e[ce.value],T.value).indexOf(o(N.value,T.value))}))),f.value&&u&&(t=t.filter((function(e){return!Ae(e)}))),t},Le=function(e){var u,a=e;return u=a,"[object Object]"===Object.prototype.toString.call(u)&&(a=Object.keys(a).map((function(e){var u,t=a[e];return n(u={},L.value,e),n(u,ce.value,t),n(u,b.value,t),u}))),a=a.map((function(e){var u;return"object"===t(e)?e:(n(u={},L.value,e),n(u,ce.value,e),n(u,b.value,e),u)}))},Pe=function(){u(H.value)||(V.value=ke(H.value))},we=function(e){return Q.value=!0,new Promise((function(u,t){s.value(N.value,j).then((function(u){J.value=u||[],"function"==typeof e&&e(u),Q.value=!1})).catch((function(e){console.error(e),J.value=[],Q.value=!1})).finally((function(){u()}))}))},Te=function(){if(ae.value)if("single"===v.value){var e=Oe(V.value[L.value]);if(void 0!==e){var u=e[b.value];V.value[b.value]=u,_.value&&(H.value[b.value]=u)}}else V.value.forEach((function(e,u){var t=Oe(V.value[u][L.value]);if(void 0!==t){var n=t[b.value];V.value[u][b.value]=n,_.value&&(H.value[u][b.value]=n)}}))},ke=function(e){return u(e)?"single"===v.value?{}:[]:_.value?e:"single"===v.value?Oe(e)||{}:e.filter((function(e){return!!Oe(e)})).map((function(e){return Oe(e)}))},xe=function(){Y.value=e.watch(N,(function(e){e.length<A.value||!e||(Q.value=!0,E.value&&(J.value=[]),setTimeout((function(){e==N.value&&s.value(N.value,j).then((function(u){e!=N.value&&N.value||(J.value=u,$.value=ne.value.filter((function(e){return!0!==e.disabled}))[0]||null,Q.value=!1)})).catch((function(e){console.error(e)}))}),O.value))}),{flush:"sync"})};if("single"!==v.value&&!u(H.value)&&!Array.isArray(H.value))throw new Error('v-model must be an array when using "'.concat(v.value,'" mode'));return s&&"function"==typeof s.value?C.value?we(Pe):1==_.value&&Pe():(J.value=s.value,Pe()),O.value>-1&&xe(),e.watch(O,(function(e,u){Y.value&&Y.value(),e>=0&&xe()})),e.watch(H,(function(e){var t,n,a;if(u(e))V.value=ke(e);else switch(v.value){case"single":(_.value?e[L.value]!=V.value[L.value]:e!=V.value[L.value])&&(V.value=ke(e));break;case"multiple":case"tags":t=_.value?e.map((function(e){return e[L.value]})):e,n=V.value.map((function(e){return e[L.value]})),a=n.slice().sort(),t.length===n.length&&t.slice().sort().every((function(e,u){return e===a[u]}))||(V.value=ke(e))}}),{deep:!0}),e.watch(s,(function(e,u){"function"==typeof a.options?C.value&&we((function(){Object.keys(V.value).length&&Pe()})):(J.value=a.options,Object.keys(V.value).length||Pe(),Te())})),e.watch(b,Te),{fo:ne,filteredOptions:ne,hasSelected:ae,multipleLabelText:le,eo:ue,extendedOptions:ue,fg:te,filteredGroups:te,noOptions:re,noResults:ie,resolving:Q,busy:ve,select:pe,deselect:de,remove:me,selectAll:function(){"single"!==v.value&&pe(ne.value)},clear:ge,isSelected:be,isDisabled:he,isMax:De,getOption:Oe,handleOptionClick:function(e){if(!he(e)){switch(v.value){case"single":if(be(e))return void(P.value&&de(e));ye(e),W(),pe(e);break;case"multiple":if(be(e))return void de(e);if(De())return;ye(e),pe(e),B.value&&M(),f.value&&U(),k.value&&W();break;case"tags":if(be(e))return void de(e);if(De())return;ye(e),B.value&&M(),pe(e),f.value&&U(),k.value&&W()}k.value?X():K()}},handleGroupClick:function(e){if(!he(e)&&"single"!==v.value&&R.value){switch(v.value){case"multiple":case"tags":_e(e[q.value])?de(e[q.value]):pe(e[q.value].filter((function(e){return-1===V.value.map((function(e){return e[L.value]})).indexOf(e[L.value])})).filter((function(e){return!e.disabled})).filter((function(e,u){return V.value.length+1+u<=w.value||-1===w.value})))}k.value&&X()}},handleTagRemove:function(e,u){0===u.button?me(e):u.preventDefault()},refreshOptions:function(e){we(e)},resolveOptions:we,refreshLabels:Te}}function s(e,u,t,n,a,l,r,i,o,c){"boolean"!=typeof r&&(o=i,i=r,r=!1);var s,v="function"==typeof t?t.options:t;if(e&&e.render&&(v.render=e.render,v.staticRenderFns=e.staticRenderFns,v._compiled=!0,a&&(v.functional=!0)),n&&(v._scopeId=n),l?(s=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),u&&u.call(this,o(e)),e&&e._registeredComponents&&e._registeredComponents.add(l)},v._ssrRegister=s):u&&(s=r?function(e){u.call(this,c(e,this.$root.$options.shadowRoot))}:function(e){u.call(this,i(e))}),s)if(v.functional){var p=v.render;v.render=function(e,u){return s.call(u),p(e,u)}}else{var d=v.beforeCreate;v.beforeCreate=d?[].concat(d,s):[s]}return t}const v={name:"Multiselect",emits:["open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},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:void 0},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},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 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},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:[Object],default:()=>({})}},setup(t,n){const a=function(u,t){var n=e.toRefs(u),a=n.value,l=n.modelValue,r=n.mode,i=n.valueProp,o=e.ref("single"!==r.value?[]:{}),c=void 0!==t.expose?l:a,s=e.computed((function(){return"single"===r.value?o.value[i.value]:o.value.map((function(e){return e[i.value]}))})),v=e.computed((function(){return"single"!==r.value?o.value.map((function(e){return e[i.value]})).join(","):o.value[i.value]}));return{iv:o,internalValue:o,ev:c,externalValue:c,textValue:v,plainValue:s}}(t,n),i=function(u,t,n){var a=e.toRefs(u),l=a.groupSelect,r=a.mode,i=a.groups,o=e.ref(null),c=function(e){void 0===e||null!==e&&e.disabled||i.value&&e&&e.group&&("single"===r.value||!l.value)||(o.value=e)};return{pointer:o,setPointer:c,clearPointer:function(){c(null)}}}(t),o=function(u,t,n){var a=e.toRefs(u).disabled,l=e.ref(!1);return{isOpen:l,open:function(){l.value||a.value||(l.value=!0,t.emit("open"))},close:function(){l.value&&(l.value=!1,t.emit("close"))}}}(t,n),s=function(u,t,n){var a=e.ref(null),l=e.ref(null);return e.watch(a,(function(e){t.emit("search-change",e)})),{search:a,input:l,clearSearch:function(){a.value=""},handleSearchInput:function(e){a.value=e.target.value},handlePaste:function(e){t.emit("paste",e)}}}(0,n),v=function(t,n,a){var l=e.toRefs(t),r=l.object,i=l.valueProp,o=l.mode,c=a.iv,s=function(e){return r.value||u(e)?e:Array.isArray(e)?e.map((function(e){return e[i.value]})):e[i.value]},v=function(e){return u(e)?"single"===o.value?{}:[]:e};return{update:function(e){c.value=v(e);var u=s(e);n.emit("change",u),n.emit("input",u),n.emit("update:modelValue",u)}}}(t,n,{iv:a.iv}),p=function(u,t,n){var a=e.toRefs(u),l=a.searchable,r=a.disabled,i=n.input,o=n.open,c=n.close,s=n.clearSearch,v=e.ref(null),p=e.ref(!1),d=e.computed((function(){return l.value||r.value?-1:0})),f=function(){l.value&&i.value.blur(),v.value.blur()},m=function(){l.value&&!r.value&&i.value.focus()},g=function(){p.value=!1,setTimeout((function(){p.value||(c(),s())}),1)};return{multiselect:v,tabindex:d,isActive:p,blur:f,focus:m,handleFocus:function(){m()},activate:function(){r.value||(p.value=!0,o())},deactivate:g,handleCaretClick:function(){g(),f()}}}(t,0,{input:s.input,open:o.open,close:o.close,clearSearch:s.clearSearch}),d=c(t,n,{ev:a.ev,iv:a.iv,search:s.search,clearSearch:s.clearSearch,update:v.update,pointer:i.pointer,clearPointer:i.clearPointer,blur:p.blur,focus:p.focus,deactivate:p.deactivate}),f=function(u,t,n){var a=e.toRefs(u),l=a.valueProp,i=a.showOptions,o=a.searchable,c=a.groupLabel,s=a.groups,v=a.mode,p=a.groupSelect,d=n.fo,f=n.fg,m=n.handleOptionClick,g=n.handleGroupClick,b=n.search,h=n.pointer,D=n.setPointer,y=n.clearPointer,_=n.multiselect,F=e.computed((function(){return d.value.filter((function(e){return!e.disabled}))})),O=e.computed((function(){return f.value.filter((function(e){return!e.disabled}))})),C=e.computed((function(){return"single"!==v.value&&p.value})),A=e.computed((function(){return h.value&&h.value.group})),S=e.computed((function(){return I(h.value)})),E=e.computed((function(){var e=A.value?h.value:I(h.value),u=O.value.map((function(e){return e[c.value]})).indexOf(e[c.value]),t=O.value[u-1];return void 0===t&&(t=L.value),t})),B=e.computed((function(){var e=O.value.map((function(e){return e.label})).indexOf(A.value?h.value[c.value]:I(h.value)[c.value])+1;return O.value.length<=e&&(e=0),O.value[e]})),L=e.computed((function(){return r(O.value).slice(-1)[0]})),P=e.computed((function(){return h.value.__VISIBLE__.filter((function(e){return!e.disabled}))[0]})),w=e.computed((function(){var e=S.value.__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[l.value]})).indexOf(h.value[l.value])-1]})),T=e.computed((function(){var e=I(h.value).__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[l.value]})).indexOf(h.value[l.value])+1]})),k=e.computed((function(){return r(E.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),x=e.computed((function(){return r(L.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),q=function(){D(F.value[0]||null)},I=function(e){return O.value.find((function(u){return-1!==u.__VISIBLE__.map((function(e){return e[l.value]})).indexOf(e[l.value])}))},R=function(){var e=_.value.querySelector("[data-pointed]");if(e){var u=e.parentElement.parentElement;s.value&&(u=A.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>u.clientHeight+u.scrollTop&&(u.scrollTop=e.offsetTop+e.offsetHeight-u.clientHeight),e.offsetTop<u.scrollTop&&(u.scrollTop=e.offsetTop)}};return e.watch(b,(function(e){o.value&&(e.length&&i.value?q():y())})),{pointer:h,canPointGroups:C,isPointed:function(e){return!(!h.value||!(!e.group&&h.value[l.value]==e[l.value]||void 0!==e.group&&h.value[c.value]==e[c.value]))||void 0},setPointerFirst:q,selectPointer:function(){h.value&&!0!==h.value.disabled&&(A.value?g(h.value):m(h.value))},forwardPointer:function(){if(null===h.value)D((s.value&&C.value?O.value[0]:F.value[0])||null);else if(s.value&&C.value){var u=A.value?P.value:T.value;void 0===u&&(u=B.value),D(u||null)}else{var t=F.value.map((function(e){return e[l.value]})).indexOf(h.value[l.value])+1;F.value.length<=t&&(t=0),D(F.value[t]||null)}e.nextTick((function(){R()}))},backwardPointer:function(){if(null===h.value){var u=F.value[F.value.length-1];s.value&&C.value&&void 0===(u=x.value)&&(u=L.value),D(u||null)}else if(s.value&&C.value){var t=A.value?k.value:w.value;void 0===t&&(t=A.value?E.value:S.value),D(t||null)}else{var n=F.value.map((function(e){return e[l.value]})).indexOf(h.value[l.value])-1;n<0&&(n=F.value.length-1),D(F.value[n]||null)}e.nextTick((function(){R()}))}}}(t,0,{fo:d.fo,fg:d.fg,handleOptionClick:d.handleOptionClick,handleGroupClick:d.handleGroupClick,search:s.search,pointer:i.pointer,setPointer:i.setPointer,clearPointer:i.clearPointer,multiselect:p.multiselect}),m=function(u,t,n){var a=e.toRefs(u),l=a.mode,i=a.addTagOn,o=a.openDirection,c=a.searchable,s=a.showOptions,v=a.valueProp,p=a.groups,d=a.addOptionOn,f=a.createTag,m=a.createOption,g=n.iv,b=n.update,h=n.search,D=n.setPointer,y=n.selectPointer,_=n.backwardPointer,F=n.forwardPointer,O=n.blur,C=n.fo,A=e.computed((function(){return f.value||m.value||!1})),S=e.computed((function(){return void 0!==i.value?i.value:void 0!==d.value?d.value:["enter"]})),E=function(){"tags"===l.value&&!s.value&&A.value&&c.value&&!p.value&&D(C.value[C.value.map((function(e){return e[v.value]})).indexOf(h.value)])};return{handleKeydown:function(e){switch(e.key){case"Backspace":if("single"===l.value)return;if(c.value&&-1===[null,""].indexOf(h.value))return;if(0===g.value.length)return;b(r(g.value).slice(0,-1));break;case"Enter":if(e.preventDefault(),-1===S.value.indexOf("enter")&&A.value)return;E(),y();break;case" ":if(!A.value&&!c.value)return e.preventDefault(),E(),void y();if(!A.value)return!1;if(-1===S.value.indexOf("space")&&A.value)return;e.preventDefault(),E(),y();break;case"Tab":case";":case",":if(-1===S.value.indexOf(e.key.toLowerCase())||!A.value)return;E(),y(),e.preventDefault();break;case"Escape":O();break;case"ArrowUp":if(e.preventDefault(),!s.value)return;"top"===o.value?F():_();break;case"ArrowDown":if(e.preventDefault(),!s.value)return;"top"===o.value?_():F()}},preparePointer:E}}(t,0,{iv:a.iv,update:v.update,search:s.search,setPointer:i.setPointer,selectPointer:f.selectPointer,backwardPointer:f.backwardPointer,forwardPointer:f.forwardPointer,blur:p.blur,fo:d.fo}),g=function(u,t,n){var a=e.toRefs(u),r=a.classes,i=a.disabled,o=a.openDirection,c=a.showOptions,s=n.isOpen,v=n.isPointed,p=n.isSelected,d=n.isDisabled,f=n.isActive,m=n.canPointGroups,g=n.resolving,b=n.fo,h=e.computed((function(){return l({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",spacer:"multiselect-spacer"},r.value)})),D=e.computed((function(){return!!(s.value&&c.value&&(!g.value||g.value&&b.value.length))}));return{classList:e.computed((function(){var e=h.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(D.value&&"top"===o.value?e.containerOpenTop:[]).concat(D.value&&"top"!==o.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(s.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,dropdown:[e.dropdown].concat("top"===o.value?e.dropdownTop:[]).concat(s.value&&c.value&&D.value?[]:e.dropdownHidden),options:[e.options].concat("top"===o.value?e.optionsTop:[]),group:e.group,groupLabel:function(u){var t=[e.groupLabel];return v(u)?t.push(p(u)?e.groupLabelSelectedPointed:e.groupLabelPointed):p(u)&&m.value?t.push(d(u)?e.groupLabelSelectedDisabled:e.groupLabelSelected):d(u)&&t.push(e.groupLabelDisabled),m.value&&t.push(e.groupLabelPointable),t},groupOptions:e.groupOptions,option:function(u,t){var n=[e.option];return v(u)?n.push(p(u)?e.optionSelectedPointed:e.optionPointed):p(u)?n.push(d(u)?e.optionSelectedDisabled:e.optionSelected):(d(u)||t&&d(t))&&n.push(e.optionDisabled),n},noOptions:e.noOptions,noResults:e.noResults,fakeInput:e.fakeInput}})),showDropdown:D}}(t,0,{isOpen:o.isOpen,isPointed:f.isPointed,canPointGroups:f.canPointGroups,isSelected:d.isSelected,isDisabled:d.isDisabled,isActive:p.isActive,resolving:d.resolving,fo:d.fo});return{...a,...o,...p,...i,...v,...s,...d,...f,...m,...g}}};var p=function(){var e=this,u=e.$createElement,t=e._self._c||u;return t("div",{ref:"multiselect",class:e.classList.container,attrs:{tabindex:e.tabindex,id:e.id},on:{focusin:e.activate,focusout:e.deactivate,keydown:e.handleKeydown,focus:e.handleFocus}},["tags"!==e.mode&&e.searchable&&!e.disabled?[t("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete},domProps:{value:e.search},on:{input:e.handleSearchInput,paste:function(u){return u.stopPropagation(),e.handlePaste(u)}}},"input",e.attrs,!1))]:e._e(),e._v(" "),"tags"==e.mode?[t("div",{class:e.classList.tags},[e._l(e.iv,(function(u,n,a){return e._t("tag",[t("span",{key:a,class:e.classList.tag},[e._v("\n "+e._s(u[e.label])+"\n "),e.disabled?e._e():t("span",{class:e.classList.tagRemove,on:{click:function(t){return e.handleTagRemove(u,t)}}},[t("span",{class:e.classList.tagRemoveIcon})])])],{option:u,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),t("div",{class:e.classList.tagsSearchWrapper},[t("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?t("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete},domProps:{value:e.search},on:{input:e.handleSearchInput,paste:function(u){return u.stopPropagation(),e.handlePaste(u)}}},"input",e.attrs,!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",[t("div",{class:e.classList.singleLabel},[t("span",{class:e.classList.singleLabelText,domProps:{innerHTML:e._s(e.iv[e.label])}})])],{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",[t("div",{class:e.classList.multipleLabel,domProps:{innerHTML:e._s(e.multipleLabelText)}})],{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",[t("div",{class:e.classList.placeholder},[e._v("\n "+e._s(e.placeholder)+"\n ")])])],e._v(" "),e.busy&&e.isActive?e._t("spinner",[t("span",{class:e.classList.spinner})]):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",[t("span",{class:e.classList.clear,on:{mousedown:e.clear}},[t("span",{class:e.classList.clearIcon})])],{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",[t("span",{class:e.classList.caret,on:{click:e.handleCaretClick}})]):e._e(),e._v(" "),t("div",{class:e.classList.dropdown,attrs:{tabindex:"-1"}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),t("ul",{class:e.classList.options},[e.groups?e._l(e.fg,(function(u,n,a){return t("li",{key:a,class:e.classList.group},[t("div",{class:e.classList.groupLabel(u),attrs:{"data-pointed":e.isPointed(u)},on:{mouseenter:function(t){return e.setPointer(u)},click:function(t){return e.handleGroupClick(u)}}},[e._t("grouplabel",[t("span",{domProps:{innerHTML:e._s(u[e.groupLabel])}})],{group:u})],2),e._v(" "),t("ul",{class:e.classList.groupOptions},e._l(u.__VISIBLE__,(function(n,a,l){return t("li",{key:l,class:e.classList.option(n,u),attrs:{"data-pointed":e.isPointed(n)},on:{mouseenter:function(u){return e.setPointer(n)},click:function(u){return e.handleOptionClick(n)}}},[e._t("option",[t("span",{domProps:{innerHTML:e._s(n[e.label])}})],{option:n,search:e.search})],2)})),0)])})):e._l(e.fo,(function(u,n,a){return t("li",{key:a,class:e.classList.option(u),attrs:{"data-pointed":e.isPointed(u)},on:{mouseenter:function(t){return e.setPointer(u)},click:function(t){return e.handleOptionClick(u)}}},[e._t("option",[t("span",{domProps:{innerHTML:e._s(u[e.label])}})],{option:u,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",[t("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.noOptionsText)}})]):e._e(),e._v(" "),e.noResults?e._t("noresults",[t("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.noResultsText)}})]):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2),e._v(" "),e.required?t("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?t("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(u,n){return t("input",{key:n,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:u}})}))]:e._e(),e._v(" "),t("div",{class:e.classList.spacer})],2)};p._withStripped=!0;return s({render:p,staticRenderFns:[]},undefined,v,undefined,false,undefined,!1,void 0,void 0,void 0)}(VueCompositionAPI); |
@@ -1,1 +0,1 @@ | ||
import{toRefs as e,ref as t,computed as u,watch as n,nextTick as a}from"@vue/composition-api";function l(e){return-1!==[null,void 0,!1].indexOf(e)}function r(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?String(e).toLowerCase().trim():String(e).normalize("NFD").replace(/(?:[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0B55\u0BCD\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E47-\u0E4C\u0E4E\u0EBA\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1063\u1064\u1069-\u106D\u1087-\u108D\u108F\u109A\u109B\u135D-\u135F\u17C9-\u17D3\u17DD\u1939-\u193B\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DF9\u1DFD-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA700-\uA721\uA788-\uA78A\uA7F8\uA7F9\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uAB69-\uAB6B\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3]|\uD800\uDEE0|\uD802[\uDEE5\uDEE6]|\uD803[\uDD22-\uDD27\uDF46-\uDF50]|\uD804[\uDCB9\uDCBA\uDD33\uDD34\uDD73\uDDC0\uDDCA-\uDDCC\uDE35\uDE36\uDEE9\uDEEA\uDF3C\uDF4D\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC42\uDC46\uDCC2\uDCC3\uDDBF\uDDC0\uDE3F\uDEB6\uDEB7\uDF2B]|\uD806[\uDC39\uDC3A\uDD3D\uDD3E\uDD43\uDDE0\uDE34\uDE47\uDE99]|\uD807[\uDC3F\uDD42\uDD44\uDD45\uDD97]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF9F\uDFF0\uDFF1]|\uD834[\uDD67-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD838[\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD46\uDD48-\uDD4A])/g,"").toLowerCase().trim()}function i(e){return(i="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,t){var u=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),u.push.apply(u,n)}return u}function s(e){for(var t=1;t<arguments.length;t++){var u=null!=arguments[t]?arguments[t]:{};t%2?o(Object(u),!0).forEach((function(t){c(e,t,u[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(u)):o(Object(u)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))}))}return e}function c(e,t,u){return t in e?Object.defineProperty(e,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):e[t]=u,e}function v(a,o,v){var p=e(a),d=p.options,f=p.mode,g=p.trackBy,b=p.limit,m=p.hideSelected,D=p.createTag,h=p.createOption,y=p.label,O=p.appendNewTag,_=p.appendNewOption,F=p.multipleLabel,A=p.object,S=p.loading,C=p.delay,E=p.resolveOnLoad,B=p.minChars,P=p.filterResults,L=p.clearOnSearch,w=p.clearOnSelect,q=p.valueProp,k=p.canDeselect,x=p.max,j=p.strict,T=p.closeOnSelect,I=p.groups,R=(p.groupLabel,p.groupOptions),V=p.groupHideEmpty,N=p.groupSelect,G=v.iv,H=v.ev,$=v.search,M=v.clearSearch,U=v.update,W=v.pointer,K=v.clearPointer,X=v.blur,z=v.focus,J=v.deactivate,Q=t([]),Y=t([]),Z=t(!1),ee=u((function(){return D.value||h.value||!1})),te=u((function(){return void 0!==O.value?O.value:void 0===_.value||_.value})),ue=u((function(){if(I.value){var e=Y.value||[],t=[];return e.forEach((function(e){Le(e[R.value]).forEach((function(u){t.push(Object.assign({},u,e.disabled?{disabled:!0}:{}))}))})),t}var u=Le(Y.value||[]);return Q.value.length&&(u=u.concat(Q.value)),u})),ne=u((function(){return I.value?Be((Y.value||[]).map((function(e){var t,u=Le(e[R.value]);return s(s({},e),{},(c(t={group:!0},R.value,Pe(u,!1).map((function(t){return Object.assign({},t,e.disabled?{disabled:!0}:{})}))),c(t,"__VISIBLE__",Pe(u).map((function(t){return Object.assign({},t,e.disabled?{disabled:!0}:{})}))),t))}))):[]})),ae=u((function(){var e=ue.value;return se.value.length&&(e=se.value.concat(e)),e=Pe(e),b.value>0&&(e=e.slice(0,b.value)),e})),le=u((function(){switch(f.value){case"single":return!l(G.value[q.value]);case"multiple":case"tags":return!l(G.value)&&G.value.length>0}})),re=u((function(){return void 0!==F&&void 0!==F.value?F.value(G.value):G.value&&G.value.length>1?"".concat(G.value.length," options selected"):"1 option selected"})),ie=u((function(){return!ue.value.length&&!Z.value&&!se.value.length})),oe=u((function(){return ue.value.length>0&&0==ae.value.length&&($.value&&I.value||!I.value)})),se=u((function(){var e;return!1!==ee.value&&$.value?-1!==Se($.value)?[]:[(e={},c(e,q.value,$.value),c(e,y.value,$.value),c(e,ce.value,$.value),e)]:[]})),ce=u((function(){return g.value||y.value})),ve=u((function(){switch(f.value){case"single":return null;case"multiple":case"tags":return[]}})),pe=u((function(){return S.value||Z.value})),de=function(e){switch("object"!==i(e)&&(e=Ae(e)),f.value){case"single":U(e);break;case"multiple":case"tags":U(G.value.concat(e))}o.emit("select",ge(e),e)},fe=function(e){switch("object"!==i(e)&&(e=Ae(e)),f.value){case"single":me();break;case"tags":case"multiple":U(Array.isArray(e)?G.value.filter((function(t){return-1===e.map((function(e){return e[q.value]})).indexOf(t[q.value])})):G.value.filter((function(t){return t[q.value]!=e[q.value]})))}o.emit("deselect",ge(e),e)},ge=function(e){return A.value?e:e[q.value]},be=function(e){fe(e)},me=function(){o.emit("clear"),U(ve.value)},De=function(e){if(void 0!==e.group)return"single"!==f.value&&(Fe(e[R.value])&&e[R.value].length);switch(f.value){case"single":return!l(G.value)&&G.value[q.value]==e[q.value];case"tags":case"multiple":return!l(G.value)&&-1!==G.value.map((function(e){return e[q.value]})).indexOf(e[q.value])}},he=function(e){return!0===e.disabled},ye=function(){return!(void 0===x||-1===x.value||!le.value&&x.value>0)&&G.value.length>=x.value},Oe=function(e){void 0===Ae(e[q.value])&&ee.value&&(o.emit("tag",e[q.value]),o.emit("option",e[q.value]),te.value&&Ee(e),M())},_e=function(e){return void 0===e.find((function(e){return!De(e)&&!e.disabled}))},Fe=function(e){return void 0===e.find((function(e){return!De(e)}))},Ae=function(e){return ue.value[ue.value.map((function(e){return String(e[q.value])})).indexOf(String(e))]},Se=function(e){return ue.value.map((function(e){return e[ce.value]})).indexOf(e)},Ce=function(e){return-1!==["tags","multiple"].indexOf(f.value)&&m.value&&De(e)},Ee=function(e){Q.value.push(e)},Be=function(e){return V.value?e.filter((function(e){return $.value?e.__VISIBLE__.length:e[R.value].length})):e.filter((function(e){return!$.value||e.__VISIBLE__.length}))},Pe=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],u=e;return $.value&&P.value&&(u=u.filter((function(e){return-1!==r(e[ce.value],j.value).indexOf(r($.value,j.value))}))),m.value&&t&&(u=u.filter((function(e){return!Ce(e)}))),u},Le=function(e){var t,u=e;return t=u,"[object Object]"===Object.prototype.toString.call(t)&&(u=Object.keys(u).map((function(e){var t,n=u[e];return c(t={},q.value,e),c(t,ce.value,n),c(t,y.value,n),t}))),u=u.map((function(e){var t;return"object"===i(e)?e:(c(t={},q.value,e),c(t,ce.value,e),c(t,y.value,e),t)}))},we=function(){l(H.value)||(G.value=ke(H.value))},qe=function(e){Z.value=!0,d.value($.value).then((function(t){Y.value=t,"function"==typeof e&&e(t),Z.value=!1}))},ke=function(e){return l(e)?"single"===f.value?{}:[]:A.value?e:"single"===f.value?Ae(e)||{}:e.filter((function(e){return!!Ae(e)})).map((function(e){return Ae(e)}))};if("single"!==f.value&&!l(H.value)&&!Array.isArray(H.value))throw new Error('v-model must be an array when using "'.concat(f.value,'" mode'));return d&&"function"==typeof d.value?E.value?qe(we):1==A.value&&we():(Y.value=d.value,we()),C.value>-1&&n($,(function(e){e.length<B.value||(Z.value=!0,L.value&&(Y.value=[]),setTimeout((function(){e==$.value&&d.value($.value).then((function(t){e!=$.value&&$.value||(Y.value=t,W.value=ae.value.filter((function(e){return!0!==e.disabled}))[0]||null,Z.value=!1)}))}),C.value))}),{flush:"sync"}),n(H,(function(e){var t,u,n;if(l(e))G.value=ke(e);else switch(f.value){case"single":(A.value?e[q.value]!=G.value[q.value]:e!=G.value[q.value])&&(G.value=ke(e));break;case"multiple":case"tags":t=A.value?e.map((function(e){return e[q.value]})):e,u=G.value.map((function(e){return e[q.value]})),n=u.slice().sort(),t.length===u.length&&t.slice().sort().every((function(e,t){return e===n[t]}))||(G.value=ke(e))}}),{deep:!0}),"function"!=typeof a.options&&n(d,(function(e,t){Y.value=a.options,Object.keys(G.value).length||we(),function(){if(le.value)if("single"===f.value){var e=Ae(G.value[q.value])[y.value];G.value[y.value]=e,A.value&&(H.value[y.value]=e)}else G.value.forEach((function(e,t){var u=Ae(G.value[t][q.value])[y.value];G.value[t][y.value]=u,A.value&&(H.value[t][y.value]=u)}))}()})),{fo:ae,filteredOptions:ae,hasSelected:le,multipleLabelText:re,eo:ue,extendedOptions:ue,fg:ne,filteredGroups:ne,noOptions:ie,noResults:oe,resolving:Z,busy:pe,select:de,deselect:fe,remove:be,selectAll:function(){"single"!==f.value&&de(ae.value)},clear:me,isSelected:De,isDisabled:he,isMax:ye,getOption:Ae,handleOptionClick:function(e){if(!he(e)){switch(f.value){case"single":if(De(e))return void(k.value&&fe(e));Oe(e),X(),de(e);break;case"multiple":if(De(e))return void fe(e);if(ye())return;Oe(e),de(e),w.value&&M(),m.value&&K(),T.value&&X();break;case"tags":if(De(e))return void fe(e);if(ye())return;Oe(e),w.value&&M(),de(e),m.value&&K(),T.value&&X()}T.value?J():z()}},handleGroupClick:function(e){if(!he(e)&&"single"!==f.value&&N.value){switch(f.value){case"multiple":case"tags":_e(e[R.value])?fe(e[R.value]):de(e[R.value].filter((function(e){return-1===G.value.map((function(e){return e[q.value]})).indexOf(e[q.value])})).filter((function(e){return!e.disabled})).filter((function(e,t){return G.value.length+1+t<=x.value||-1===x.value})))}T.value&&J()}},handleTagRemove:function(e,t){0===t.button?be(e):t.preventDefault()},refreshOptions:function(e){qe(e)},resolveOptions:qe}}function p(e){return function(e){if(Array.isArray(e))return d(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 d(e,t);var u=Object.prototype.toString.call(e).slice(8,-1);"Object"===u&&e.constructor&&(u=e.constructor.name);if("Map"===u||"Set"===u)return Array.from(e);if("Arguments"===u||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return d(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 d(e,t){(null==t||t>e.length)&&(t=e.length);for(var u=0,n=new Array(t);u<t;u++)n[u]=e[u];return n}function f(e){return function(e){if(Array.isArray(e))return g(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 g(e,t);var u=Object.prototype.toString.call(e).slice(8,-1);"Object"===u&&e.constructor&&(u=e.constructor.name);if("Map"===u||"Set"===u)return Array.from(e);if("Arguments"===u||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return g(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 g(e,t){(null==t||t>e.length)&&(t=e.length);for(var u=0,n=new Array(t);u<t;u++)n[u]=e[u];return n}function b(e,t){var u=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),u.push.apply(u,n)}return u}function m(e,t,u){return t in e?Object.defineProperty(e,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):e[t]=u,e}function D(t,n,a){var l=e(t),r=l.classes,i=l.disabled,o=l.openDirection,s=l.showOptions,c=a.isOpen,v=a.isPointed,p=a.isSelected,d=a.isDisabled,f=a.isActive,g=a.canPointGroups,D=a.resolving,h=a.fo,y=u((function(){return function(e){for(var t=1;t<arguments.length;t++){var u=null!=arguments[t]?arguments[t]:{};t%2?b(Object(u),!0).forEach((function(t){m(e,t,u[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(u)):b(Object(u)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))}))}return e}({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",spacer:"multiselect-spacer"},r.value)})),O=u((function(){return!!(c.value&&s.value&&(!D.value||D.value&&h.value.length))}));return{classList:u((function(){var e=y.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(O.value&&"top"===o.value?e.containerOpenTop:[]).concat(O.value&&"top"!==o.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(c.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,dropdown:[e.dropdown].concat("top"===o.value?e.dropdownTop:[]).concat(c.value&&s.value&&O.value?[]:e.dropdownHidden),options:[e.options].concat("top"===o.value?e.optionsTop:[]),group:e.group,groupLabel:function(t){var u=[e.groupLabel];return v(t)?u.push(p(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):p(t)&&g.value?u.push(d(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):d(t)&&u.push(e.groupLabelDisabled),g.value&&u.push(e.groupLabelPointable),u},groupOptions:e.groupOptions,option:function(t,u){var n=[e.option];return v(t)?n.push(p(t)?e.optionSelectedPointed:e.optionPointed):p(t)?n.push(d(t)?e.optionSelectedDisabled:e.optionSelected):(d(t)||u&&d(u))&&n.push(e.optionDisabled),n},noOptions:e.noOptions,noResults:e.noResults,fakeInput:e.fakeInput}})),showDropdown:O}}function h(e,t,u,n,a,l,r,i,o,s){"boolean"!=typeof r&&(o=i,i=r,r=!1);var c,v="function"==typeof u?u.options:u;if(e&&e.render&&(v.render=e.render,v.staticRenderFns=e.staticRenderFns,v._compiled=!0,a&&(v.functional=!0)),n&&(v._scopeId=n),l?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,o(e)),e&&e._registeredComponents&&e._registeredComponents.add(l)},v._ssrRegister=c):t&&(c=r?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,i(e))}),c)if(v.functional){var p=v.render;v.render=function(e,t){return c.call(t),p(e,t)}}else{var d=v.beforeCreate;v.beforeCreate=d?[].concat(d,c):[c]}return u}const y={name:"Multiselect",emits:["open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},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:void 0},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},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 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},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:[Object],default:()=>({})}},setup(r,i){const o=function(n,a){var l=e(n),r=l.value,i=l.modelValue,o=l.mode,s=l.valueProp,c=t("single"!==o.value?[]:{}),v=void 0!==a.expose?i:r,p=u((function(){return"single"===o.value?c.value[s.value]:c.value.map((function(e){return e[s.value]}))})),d=u((function(){return"single"!==o.value?c.value.map((function(e){return e[s.value]})).join(","):c.value[s.value]}));return{iv:c,internalValue:c,ev:v,externalValue:v,textValue:d,plainValue:p}}(r,i),s=function(u,n,a){var l=e(u),r=l.groupSelect,i=l.mode,o=l.groups,s=t(null),c=function(e){void 0===e||null!==e&&e.disabled||o.value&&e&&e.group&&("single"===i.value||!r.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:function(){c(null)}}}(r),c=function(u,n,a){var l=e(u).disabled,r=t(!1);return{isOpen:r,open:function(){r.value||l.value||(r.value=!0,n.emit("open"))},close:function(){r.value&&(r.value=!1,n.emit("close"))}}}(r,i),d=function(e,u,a){var l=t(null),r=t(null);return n(l,(function(e){u.emit("search-change",e)})),{search:l,input:r,clearSearch:function(){l.value=""},handleSearchInput:function(e){l.value=e.target.value},handlePaste:function(e){u.emit("paste",e)}}}(0,i),g=function(t,u,n){var a=e(t),r=a.object,i=a.valueProp,o=a.mode,s=n.iv,c=function(e){return r.value||l(e)?e:Array.isArray(e)?e.map((function(e){return e[i.value]})):e[i.value]},v=function(e){return l(e)?"single"===o.value?{}:[]:e};return{update:function(e){s.value=v(e);var t=c(e);u.emit("change",t),u.emit("input",t),u.emit("update:modelValue",t)}}}(r,i,{iv:o.iv}),b=function(n,a,l){var r=e(n),i=r.searchable,o=r.disabled,s=l.input,c=l.open,v=l.close,p=l.clearSearch,d=t(null),f=t(!1),g=u((function(){return i.value||o.value?-1:0})),b=function(){i.value&&s.value.blur(),d.value.blur()},m=function(){i.value&&!o.value&&s.value.focus()},D=function(){f.value=!1,setTimeout((function(){f.value||(v(),p())}),1)};return{multiselect:d,tabindex:g,isActive:f,blur:b,focus:m,handleFocus:function(){m()},activate:function(){o.value||(f.value=!0,c())},deactivate:D,handleCaretClick:function(){D(),b()}}}(r,0,{input:d.input,open:c.open,close:c.close,clearSearch:d.clearSearch}),m=v(r,i,{ev:o.ev,iv:o.iv,search:d.search,clearSearch:d.clearSearch,update:g.update,pointer:s.pointer,clearPointer:s.clearPointer,blur:b.blur,focus:b.focus,deactivate:b.deactivate}),h=function(t,l,r){var i=e(t),o=i.valueProp,s=i.showOptions,c=i.searchable,v=i.groupLabel,d=i.groups,f=i.mode,g=i.groupSelect,b=r.fo,m=r.fg,D=r.handleOptionClick,h=r.handleGroupClick,y=r.search,O=r.pointer,_=r.setPointer,F=r.clearPointer,A=r.multiselect,S=u((function(){return b.value.filter((function(e){return!e.disabled}))})),C=u((function(){return m.value.filter((function(e){return!e.disabled}))})),E=u((function(){return"single"!==f.value&&g.value})),B=u((function(){return O.value&&O.value.group})),P=u((function(){return V(O.value)})),L=u((function(){var e=B.value?O.value:V(O.value),t=C.value.map((function(e){return e[v.value]})).indexOf(e[v.value]),u=C.value[t-1];return void 0===u&&(u=q.value),u})),w=u((function(){var e=C.value.map((function(e){return e.label})).indexOf(B.value?O.value[v.value]:V(O.value)[v.value])+1;return C.value.length<=e&&(e=0),C.value[e]})),q=u((function(){return p(C.value).slice(-1)[0]})),k=u((function(){return O.value.__VISIBLE__.filter((function(e){return!e.disabled}))[0]})),x=u((function(){var e=P.value.__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[o.value]})).indexOf(O.value[o.value])-1]})),j=u((function(){var e=V(O.value).__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[o.value]})).indexOf(O.value[o.value])+1]})),T=u((function(){return p(L.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),I=u((function(){return p(q.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),R=function(){_(S.value[0]||null)},V=function(e){return C.value.find((function(t){return-1!==t.__VISIBLE__.map((function(e){return e[o.value]})).indexOf(e[o.value])}))},N=function(){var e=A.value.querySelector("[data-pointed]");if(e){var t=e.parentElement.parentElement;d.value&&(t=B.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop<t.scrollTop&&(t.scrollTop=e.offsetTop)}};return n(y,(function(e){c.value&&(e.length&&s.value?R():F())})),{pointer:O,canPointGroups:E,isPointed:function(e){return!(!O.value||!(!e.group&&O.value[o.value]==e[o.value]||void 0!==e.group&&O.value[v.value]==e[v.value]))||void 0},setPointerFirst:R,selectPointer:function(){O.value&&!0!==O.value.disabled&&(B.value?h(O.value):D(O.value))},forwardPointer:function(){if(null===O.value)_((d.value&&E.value?C.value[0]:S.value[0])||null);else if(d.value&&E.value){var e=B.value?k.value:j.value;void 0===e&&(e=w.value),_(e||null)}else{var t=S.value.map((function(e){return e[o.value]})).indexOf(O.value[o.value])+1;S.value.length<=t&&(t=0),_(S.value[t]||null)}a((function(){N()}))},backwardPointer:function(){if(null===O.value){var e=S.value[S.value.length-1];d.value&&E.value&&void 0===(e=I.value)&&(e=q.value),_(e||null)}else if(d.value&&E.value){var t=B.value?T.value:x.value;void 0===t&&(t=B.value?L.value:P.value),_(t||null)}else{var u=S.value.map((function(e){return e[o.value]})).indexOf(O.value[o.value])-1;u<0&&(u=S.value.length-1),_(S.value[u]||null)}a((function(){N()}))}}}(r,0,{fo:m.fo,fg:m.fg,handleOptionClick:m.handleOptionClick,handleGroupClick:m.handleGroupClick,search:d.search,pointer:s.pointer,setPointer:s.setPointer,clearPointer:s.clearPointer,multiselect:b.multiselect}),y=function(t,n,a){var l=e(t),r=l.mode,i=l.addTagOn,o=l.openDirection,s=l.searchable,c=l.showOptions,v=l.valueProp,p=l.groups,d=l.addOptionOn,g=l.createTag,b=l.createOption,m=a.iv,D=a.update,h=a.search,y=a.setPointer,O=a.selectPointer,_=a.backwardPointer,F=a.forwardPointer,A=a.blur,S=a.fo,C=u((function(){return g.value||b.value||!1})),E=u((function(){return void 0!==i.value?i.value:void 0!==d.value?d.value:["enter"]})),B=function(){"tags"===r.value&&!c.value&&C.value&&s.value&&!p.value&&y(S.value[S.value.map((function(e){return e[v.value]})).indexOf(h.value)])};return{handleKeydown:function(e){switch(e.key){case"Backspace":if("single"===r.value)return;if(s.value&&-1===[null,""].indexOf(h.value))return;if(0===m.value.length)return;D(f(m.value).slice(0,-1));break;case"Enter":if(e.preventDefault(),-1===E.value.indexOf("enter")&&C.value)return;B(),O();break;case" ":if(!C.value&&!s.value)return e.preventDefault(),B(),void O();if(!C.value)return!1;if(-1===E.value.indexOf("space")&&C.value)return;e.preventDefault(),B(),O();break;case"Tab":case";":case",":if(-1===E.value.indexOf(e.key.toLowerCase())||!C.value)return;B(),O(),e.preventDefault();break;case"Escape":A();break;case"ArrowUp":if(e.preventDefault(),!c.value)return;"top"===o.value?F():_();break;case"ArrowDown":if(e.preventDefault(),!c.value)return;"top"===o.value?_():F()}},preparePointer:B}}(r,0,{iv:o.iv,update:g.update,search:d.search,setPointer:s.setPointer,selectPointer:h.selectPointer,backwardPointer:h.backwardPointer,forwardPointer:h.forwardPointer,blur:b.blur,fo:m.fo}),O=D(r,0,{isOpen:c.isOpen,isPointed:h.isPointed,canPointGroups:h.canPointGroups,isSelected:m.isSelected,isDisabled:m.isDisabled,isActive:b.isActive,resolving:m.resolving,fo:m.fo});return{...o,...c,...b,...s,...g,...d,...m,...h,...y,...O}}};var O=function(){var e=this,t=e.$createElement,u=e._self._c||t;return u("div",{ref:"multiselect",class:e.classList.container,attrs:{tabindex:e.tabindex,id:e.id},on:{focusin:e.activate,focusout:e.deactivate,keydown:e.handleKeydown,focus:e.handleFocus}},["tags"!==e.mode&&e.searchable&&!e.disabled?[u("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete},domProps:{value:e.search},on:{input:e.handleSearchInput,paste:function(t){return t.stopPropagation(),e.handlePaste(t)}}},"input",e.attrs,!1))]:e._e(),e._v(" "),"tags"==e.mode?[u("div",{class:e.classList.tags},[e._l(e.iv,(function(t,n,a){return e._t("tag",[u("span",{key:a,class:e.classList.tag},[e._v("\n "+e._s(t[e.label])+"\n "),e.disabled?e._e():u("span",{class:e.classList.tagRemove,on:{click:function(u){return e.handleTagRemove(t,u)}}},[u("span",{class:e.classList.tagRemoveIcon})])])],{option:t,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),u("div",{class:e.classList.tagsSearchWrapper},[u("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?u("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete},domProps:{value:e.search},on:{input:e.handleSearchInput,paste:function(t){return t.stopPropagation(),e.handlePaste(t)}}},"input",e.attrs,!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",[u("div",{class:e.classList.singleLabel},[u("span",{class:e.classList.singleLabelText},[e._v(e._s(e.iv[e.label]))])])],{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",[u("div",{class:e.classList.multipleLabel},[e._v("\n "+e._s(e.multipleLabelText)+"\n ")])],{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",[u("div",{class:e.classList.placeholder},[e._v("\n "+e._s(e.placeholder)+"\n ")])])],e._v(" "),e.busy&&e.isActive?e._t("spinner",[u("span",{class:e.classList.spinner})]):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",[u("span",{class:e.classList.clear,on:{mousedown:e.clear}},[u("span",{class:e.classList.clearIcon})])],{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",[u("span",{class:e.classList.caret,on:{click:e.handleCaretClick}})]):e._e(),e._v(" "),u("div",{class:e.classList.dropdown,attrs:{tabindex:"-1"}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),u("ul",{class:e.classList.options},[e.groups?e._l(e.fg,(function(t,n,a){return u("li",{key:a,class:e.classList.group},[u("div",{class:e.classList.groupLabel(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(u){return e.setPointer(t)},click:function(u){return e.handleGroupClick(t)}}},[e._t("grouplabel",[u("span",[e._v(e._s(t[e.groupLabel]))])],{group:t})],2),e._v(" "),u("ul",{class:e.classList.groupOptions},e._l(t.__VISIBLE__,(function(n,a,l){return u("li",{key:l,class:e.classList.option(n,t),attrs:{"data-pointed":e.isPointed(n)},on:{mouseenter:function(t){return e.setPointer(n)},click:function(t){return e.handleOptionClick(n)}}},[e._t("option",[u("span",[e._v(e._s(n[e.label]))])],{option:n,search:e.search})],2)})),0)])})):e._l(e.fo,(function(t,n,a){return u("li",{key:a,class:e.classList.option(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(u){return e.setPointer(t)},click:function(u){return e.handleOptionClick(t)}}},[e._t("option",[u("span",[e._v(e._s(t[e.label]))])],{option:t,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",[u("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.noOptionsText)}})]):e._e(),e._v(" "),e.noResults?e._t("noresults",[u("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.noResultsText)}})]):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2),e._v(" "),e.required?u("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?u("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(t,n){return u("input",{key:n,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:t}})}))]:e._e(),e._v(" "),u("div",{class:e.classList.spacer})],2)};O._withStripped=!0;const _=h({render:O,staticRenderFns:[]},undefined,y,undefined,false,undefined,!1,void 0,void 0,void 0);export default _; | ||
import{toRefs as e,ref as t,computed as u,watch as n,getCurrentInstance as a,nextTick as l}from"@vue/composition-api";function r(e){return-1!==[null,void 0,!1].indexOf(e)}function i(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return t?String(e).toLowerCase().trim():String(e).normalize("NFD").replace(/(?:[\^`\xA8\xAF\xB4\xB7\xB8\u02B0-\u034E\u0350-\u0357\u035D-\u0362\u0374\u0375\u037A\u0384\u0385\u0483-\u0487\u0559\u0591-\u05A1\u05A3-\u05BD\u05BF\u05C1\u05C2\u05C4\u064B-\u0652\u0657\u0658\u06DF\u06E0\u06E5\u06E6\u06EA-\u06EC\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F5\u0818\u0819\u08E3-\u08FE\u093C\u094D\u0951-\u0954\u0971\u09BC\u09CD\u0A3C\u0A4D\u0ABC\u0ACD\u0AFD-\u0AFF\u0B3C\u0B4D\u0B55\u0BCD\u0C4D\u0CBC\u0CCD\u0D3B\u0D3C\u0D4D\u0DCA\u0E47-\u0E4C\u0E4E\u0EBA\u0EC8-\u0ECC\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F82-\u0F84\u0F86\u0F87\u0FC6\u1037\u1039\u103A\u1063\u1064\u1069-\u106D\u1087-\u108D\u108F\u109A\u109B\u135D-\u135F\u17C9-\u17D3\u17DD\u1939-\u193B\u1A75-\u1A7C\u1A7F\u1AB0-\u1ABD\u1B34\u1B44\u1B6B-\u1B73\u1BAA\u1BAB\u1C36\u1C37\u1C78-\u1C7D\u1CD0-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1D2C-\u1D6A\u1DC4-\u1DCF\u1DF5-\u1DF9\u1DFD-\u1DFF\u1FBD\u1FBF-\u1FC1\u1FCD-\u1FCF\u1FDD-\u1FDF\u1FED-\u1FEF\u1FFD\u1FFE\u2CEF-\u2CF1\u2E2F\u302A-\u302F\u3099-\u309C\u30FC\uA66F\uA67C\uA67D\uA67F\uA69C\uA69D\uA6F0\uA6F1\uA700-\uA721\uA788-\uA78A\uA7F8\uA7F9\uA8C4\uA8E0-\uA8F1\uA92B-\uA92E\uA953\uA9B3\uA9C0\uA9E5\uAA7B-\uAA7D\uAABF-\uAAC2\uAAF6\uAB5B-\uAB5F\uAB69-\uAB6B\uABEC\uABED\uFB1E\uFE20-\uFE2F\uFF3E\uFF40\uFF70\uFF9E\uFF9F\uFFE3]|\uD800\uDEE0|\uD802[\uDEE5\uDEE6]|\uD803[\uDD22-\uDD27\uDF46-\uDF50]|\uD804[\uDCB9\uDCBA\uDD33\uDD34\uDD73\uDDC0\uDDCA-\uDDCC\uDE35\uDE36\uDEE9\uDEEA\uDF3C\uDF4D\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC42\uDC46\uDCC2\uDCC3\uDDBF\uDDC0\uDE3F\uDEB6\uDEB7\uDF2B]|\uD806[\uDC39\uDC3A\uDD3D\uDD3E\uDD43\uDDE0\uDE34\uDE47\uDE99]|\uD807[\uDC3F\uDD42\uDD44\uDD45\uDD97]|\uD81A[\uDEF0-\uDEF4\uDF30-\uDF36]|\uD81B[\uDF8F-\uDF9F\uDFF0\uDFF1]|\uD834[\uDD67-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD]|\uD838[\uDD30-\uDD36\uDEEC-\uDEEF]|\uD83A[\uDCD0-\uDCD6\uDD44-\uDD46\uDD48-\uDD4A])/g,"").toLowerCase().trim()}function o(e){return(o="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 s(e,t){var u=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),u.push.apply(u,n)}return u}function c(e){for(var t=1;t<arguments.length;t++){var u=null!=arguments[t]?arguments[t]:{};t%2?s(Object(u),!0).forEach((function(t){v(e,t,u[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(u)):s(Object(u)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))}))}return e}function v(e,t,u){return t in e?Object.defineProperty(e,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):e[t]=u,e}function p(l,s,p){var d=e(l),f=d.options,g=d.mode,b=d.trackBy,m=d.limit,D=d.hideSelected,h=d.createTag,y=d.createOption,O=d.label,_=d.appendNewTag,F=d.appendNewOption,A=d.multipleLabel,S=d.object,C=d.loading,E=d.delay,P=d.resolveOnLoad,B=d.minChars,L=d.filterResults,w=d.clearOnSearch,T=d.clearOnSelect,k=d.valueProp,q=d.canDeselect,x=d.max,j=d.strict,I=d.closeOnSelect,R=d.groups,V=(d.groupLabel,d.groupOptions),H=d.groupHideEmpty,N=d.groupSelect,M=a().proxy,G=p.iv,$=p.ev,U=p.search,W=p.clearSearch,K=p.update,X=p.pointer,z=p.clearPointer,J=p.blur,Q=p.focus,Y=p.deactivate,Z=t([]),ee=t([]),te=t(!1),ue=t(null),ne=u((function(){return h.value||y.value||!1})),ae=u((function(){return void 0!==_.value?_.value:void 0===F.value||F.value})),le=u((function(){if(R.value){var e=ee.value||[],t=[];return e.forEach((function(e){ke(e[V.value]).forEach((function(u){t.push(Object.assign({},u,e.disabled?{disabled:!0}:{}))}))})),t}var u=ke(ee.value||[]);return Z.value.length&&(u=u.concat(Z.value)),u})),re=u((function(){return R.value?we((ee.value||[]).map((function(e){var t,u=ke(e[V.value]);return c(c({},e),{},(v(t={group:!0},V.value,Te(u,!1).map((function(t){return Object.assign({},t,e.disabled?{disabled:!0}:{})}))),v(t,"__VISIBLE__",Te(u).map((function(t){return Object.assign({},t,e.disabled?{disabled:!0}:{})}))),t))}))):[]})),ie=u((function(){var e=le.value;return pe.value.length&&(e=pe.value.concat(e)),e=Te(e),m.value>0&&(e=e.slice(0,m.value)),e})),oe=u((function(){switch(g.value){case"single":return!r(G.value[k.value]);case"multiple":case"tags":return!r(G.value)&&G.value.length>0}})),se=u((function(){return void 0!==A&&void 0!==A.value?A.value(G.value,M):G.value&&G.value.length>1?"".concat(G.value.length," options selected"):"1 option selected"})),ce=u((function(){return!le.value.length&&!te.value&&!pe.value.length})),ve=u((function(){return le.value.length>0&&0==ie.value.length&&(U.value&&R.value||!R.value)})),pe=u((function(){var e;return!1!==ne.value&&U.value?-1!==Pe(U.value)?[]:[(e={},v(e,k.value,U.value),v(e,O.value,U.value),v(e,de.value,U.value),e)]:[]})),de=u((function(){return b.value||O.value})),fe=u((function(){switch(g.value){case"single":return null;case"multiple":case"tags":return[]}})),ge=u((function(){return C.value||te.value})),be=function(e){switch("object"!==o(e)&&(e=Ee(e)),g.value){case"single":K(e);break;case"multiple":case"tags":K(G.value.concat(e))}s.emit("select",De(e),e)},me=function(e){switch("object"!==o(e)&&(e=Ee(e)),g.value){case"single":ye();break;case"tags":case"multiple":K(Array.isArray(e)?G.value.filter((function(t){return-1===e.map((function(e){return e[k.value]})).indexOf(t[k.value])})):G.value.filter((function(t){return t[k.value]!=e[k.value]})))}s.emit("deselect",De(e),e)},De=function(e){return S.value?e:e[k.value]},he=function(e){me(e)},ye=function(){s.emit("clear"),K(fe.value)},Oe=function(e){if(void 0!==e.group)return"single"!==g.value&&(Ce(e[V.value])&&e[V.value].length);switch(g.value){case"single":return!r(G.value)&&G.value[k.value]==e[k.value];case"tags":case"multiple":return!r(G.value)&&-1!==G.value.map((function(e){return e[k.value]})).indexOf(e[k.value])}},_e=function(e){return!0===e.disabled},Fe=function(){return!(void 0===x||-1===x.value||!oe.value&&x.value>0)&&G.value.length>=x.value},Ae=function(e){void 0===Ee(e[k.value])&&ne.value&&(s.emit("tag",e[k.value]),s.emit("option",e[k.value]),ae.value&&Le(e),W())},Se=function(e){return void 0===e.find((function(e){return!Oe(e)&&!e.disabled}))},Ce=function(e){return void 0===e.find((function(e){return!Oe(e)}))},Ee=function(e){return le.value[le.value.map((function(e){return String(e[k.value])})).indexOf(String(e))]},Pe=function(e){return le.value.map((function(e){return e[de.value]})).indexOf(e)},Be=function(e){return-1!==["tags","multiple"].indexOf(g.value)&&D.value&&Oe(e)},Le=function(e){Z.value.push(e)},we=function(e){return H.value?e.filter((function(e){return U.value?e.__VISIBLE__.length:e[V.value].length})):e.filter((function(e){return!U.value||e.__VISIBLE__.length}))},Te=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],u=e;return U.value&&L.value&&(u=u.filter((function(e){return-1!==i(e[de.value],j.value).indexOf(i(U.value,j.value))}))),D.value&&t&&(u=u.filter((function(e){return!Be(e)}))),u},ke=function(e){var t,u=e;return t=u,"[object Object]"===Object.prototype.toString.call(t)&&(u=Object.keys(u).map((function(e){var t,n=u[e];return v(t={},k.value,e),v(t,de.value,n),v(t,O.value,n),t}))),u=u.map((function(e){var t;return"object"===o(e)?e:(v(t={},k.value,e),v(t,de.value,e),v(t,O.value,e),t)}))},qe=function(){r($.value)||(G.value=Ie($.value))},xe=function(e){return te.value=!0,new Promise((function(t,u){f.value(U.value,M).then((function(t){ee.value=t||[],"function"==typeof e&&e(t),te.value=!1})).catch((function(e){console.error(e),ee.value=[],te.value=!1})).finally((function(){t()}))}))},je=function(){if(oe.value)if("single"===g.value){var e=Ee(G.value[k.value]);if(void 0!==e){var t=e[O.value];G.value[O.value]=t,S.value&&($.value[O.value]=t)}}else G.value.forEach((function(e,t){var u=Ee(G.value[t][k.value]);if(void 0!==u){var n=u[O.value];G.value[t][O.value]=n,S.value&&($.value[t][O.value]=n)}}))},Ie=function(e){return r(e)?"single"===g.value?{}:[]:S.value?e:"single"===g.value?Ee(e)||{}:e.filter((function(e){return!!Ee(e)})).map((function(e){return Ee(e)}))},Re=function(){ue.value=n(U,(function(e){e.length<B.value||!e||(te.value=!0,w.value&&(ee.value=[]),setTimeout((function(){e==U.value&&f.value(U.value,M).then((function(t){e!=U.value&&U.value||(ee.value=t,X.value=ie.value.filter((function(e){return!0!==e.disabled}))[0]||null,te.value=!1)})).catch((function(e){console.error(e)}))}),E.value))}),{flush:"sync"})};if("single"!==g.value&&!r($.value)&&!Array.isArray($.value))throw new Error('v-model must be an array when using "'.concat(g.value,'" mode'));return f&&"function"==typeof f.value?P.value?xe(qe):1==S.value&&qe():(ee.value=f.value,qe()),E.value>-1&&Re(),n(E,(function(e,t){ue.value&&ue.value(),e>=0&&Re()})),n($,(function(e){var t,u,n;if(r(e))G.value=Ie(e);else switch(g.value){case"single":(S.value?e[k.value]!=G.value[k.value]:e!=G.value[k.value])&&(G.value=Ie(e));break;case"multiple":case"tags":t=S.value?e.map((function(e){return e[k.value]})):e,u=G.value.map((function(e){return e[k.value]})),n=u.slice().sort(),t.length===u.length&&t.slice().sort().every((function(e,t){return e===n[t]}))||(G.value=Ie(e))}}),{deep:!0}),n(f,(function(e,t){"function"==typeof l.options?P.value&&xe((function(){Object.keys(G.value).length&&qe()})):(ee.value=l.options,Object.keys(G.value).length||qe(),je())})),n(O,je),{fo:ie,filteredOptions:ie,hasSelected:oe,multipleLabelText:se,eo:le,extendedOptions:le,fg:re,filteredGroups:re,noOptions:ce,noResults:ve,resolving:te,busy:ge,select:be,deselect:me,remove:he,selectAll:function(){"single"!==g.value&&be(ie.value)},clear:ye,isSelected:Oe,isDisabled:_e,isMax:Fe,getOption:Ee,handleOptionClick:function(e){if(!_e(e)){switch(g.value){case"single":if(Oe(e))return void(q.value&&me(e));Ae(e),J(),be(e);break;case"multiple":if(Oe(e))return void me(e);if(Fe())return;Ae(e),be(e),T.value&&W(),D.value&&z(),I.value&&J();break;case"tags":if(Oe(e))return void me(e);if(Fe())return;Ae(e),T.value&&W(),be(e),D.value&&z(),I.value&&J()}I.value?Y():Q()}},handleGroupClick:function(e){if(!_e(e)&&"single"!==g.value&&N.value){switch(g.value){case"multiple":case"tags":Se(e[V.value])?me(e[V.value]):be(e[V.value].filter((function(e){return-1===G.value.map((function(e){return e[k.value]})).indexOf(e[k.value])})).filter((function(e){return!e.disabled})).filter((function(e,t){return G.value.length+1+t<=x.value||-1===x.value})))}I.value&&Y()}},handleTagRemove:function(e,t){0===t.button?he(e):t.preventDefault()},refreshOptions:function(e){xe(e)},resolveOptions:xe,refreshLabels:je}}function d(e){return function(e){if(Array.isArray(e))return f(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 f(e,t);var u=Object.prototype.toString.call(e).slice(8,-1);"Object"===u&&e.constructor&&(u=e.constructor.name);if("Map"===u||"Set"===u)return Array.from(e);if("Arguments"===u||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return f(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 f(e,t){(null==t||t>e.length)&&(t=e.length);for(var u=0,n=new Array(t);u<t;u++)n[u]=e[u];return n}function g(e){return function(e){if(Array.isArray(e))return b(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 b(e,t);var u=Object.prototype.toString.call(e).slice(8,-1);"Object"===u&&e.constructor&&(u=e.constructor.name);if("Map"===u||"Set"===u)return Array.from(e);if("Arguments"===u||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return b(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 b(e,t){(null==t||t>e.length)&&(t=e.length);for(var u=0,n=new Array(t);u<t;u++)n[u]=e[u];return n}function m(e,t){var u=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),u.push.apply(u,n)}return u}function D(e,t,u){return t in e?Object.defineProperty(e,t,{value:u,enumerable:!0,configurable:!0,writable:!0}):e[t]=u,e}function h(t,n,a){var l=e(t),r=l.classes,i=l.disabled,o=l.openDirection,s=l.showOptions,c=a.isOpen,v=a.isPointed,p=a.isSelected,d=a.isDisabled,f=a.isActive,g=a.canPointGroups,b=a.resolving,h=a.fo,y=u((function(){return function(e){for(var t=1;t<arguments.length;t++){var u=null!=arguments[t]?arguments[t]:{};t%2?m(Object(u),!0).forEach((function(t){D(e,t,u[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(u)):m(Object(u)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(u,t))}))}return e}({container:"multiselect",containerDisabled:"is-disabled",containerOpen:"is-open",containerOpenTop:"is-open-top",containerActive:"is-active",singleLabel:"multiselect-single-label",singleLabelText:"multiselect-single-label-text",multipleLabel:"multiselect-multiple-label",search:"multiselect-search",tags:"multiselect-tags",tag:"multiselect-tag",tagDisabled:"is-disabled",tagRemove:"multiselect-tag-remove",tagRemoveIcon:"multiselect-tag-remove-icon",tagsSearchWrapper:"multiselect-tags-search-wrapper",tagsSearch:"multiselect-tags-search",tagsSearchCopy:"multiselect-tags-search-copy",placeholder:"multiselect-placeholder",caret:"multiselect-caret",caretOpen:"is-open",clear:"multiselect-clear",clearIcon:"multiselect-clear-icon",spinner:"multiselect-spinner",dropdown:"multiselect-dropdown",dropdownTop:"is-top",dropdownHidden:"is-hidden",options:"multiselect-options",optionsTop:"is-top",group:"multiselect-group",groupLabel:"multiselect-group-label",groupLabelPointable:"is-pointable",groupLabelPointed:"is-pointed",groupLabelSelected:"is-selected",groupLabelDisabled:"is-disabled",groupLabelSelectedPointed:"is-selected is-pointed",groupLabelSelectedDisabled:"is-selected is-disabled",groupOptions:"multiselect-group-options",option:"multiselect-option",optionPointed:"is-pointed",optionSelected:"is-selected",optionDisabled:"is-disabled",optionSelectedPointed:"is-selected is-pointed",optionSelectedDisabled:"is-selected is-disabled",noOptions:"multiselect-no-options",noResults:"multiselect-no-results",fakeInput:"multiselect-fake-input",spacer:"multiselect-spacer"},r.value)})),O=u((function(){return!!(c.value&&s.value&&(!b.value||b.value&&h.value.length))}));return{classList:u((function(){var e=y.value;return{container:[e.container].concat(i.value?e.containerDisabled:[]).concat(O.value&&"top"===o.value?e.containerOpenTop:[]).concat(O.value&&"top"!==o.value?e.containerOpen:[]).concat(f.value?e.containerActive:[]),spacer:e.spacer,singleLabel:e.singleLabel,singleLabelText:e.singleLabelText,multipleLabel:e.multipleLabel,search:e.search,tags:e.tags,tag:[e.tag].concat(i.value?e.tagDisabled:[]),tagRemove:e.tagRemove,tagRemoveIcon:e.tagRemoveIcon,tagsSearchWrapper:e.tagsSearchWrapper,tagsSearch:e.tagsSearch,tagsSearchCopy:e.tagsSearchCopy,placeholder:e.placeholder,caret:[e.caret].concat(c.value?e.caretOpen:[]),clear:e.clear,clearIcon:e.clearIcon,spinner:e.spinner,dropdown:[e.dropdown].concat("top"===o.value?e.dropdownTop:[]).concat(c.value&&s.value&&O.value?[]:e.dropdownHidden),options:[e.options].concat("top"===o.value?e.optionsTop:[]),group:e.group,groupLabel:function(t){var u=[e.groupLabel];return v(t)?u.push(p(t)?e.groupLabelSelectedPointed:e.groupLabelPointed):p(t)&&g.value?u.push(d(t)?e.groupLabelSelectedDisabled:e.groupLabelSelected):d(t)&&u.push(e.groupLabelDisabled),g.value&&u.push(e.groupLabelPointable),u},groupOptions:e.groupOptions,option:function(t,u){var n=[e.option];return v(t)?n.push(p(t)?e.optionSelectedPointed:e.optionPointed):p(t)?n.push(d(t)?e.optionSelectedDisabled:e.optionSelected):(d(t)||u&&d(u))&&n.push(e.optionDisabled),n},noOptions:e.noOptions,noResults:e.noResults,fakeInput:e.fakeInput}})),showDropdown:O}}function y(e,t,u,n,a,l,r,i,o,s){"boolean"!=typeof r&&(o=i,i=r,r=!1);var c,v="function"==typeof u?u.options:u;if(e&&e.render&&(v.render=e.render,v.staticRenderFns=e.staticRenderFns,v._compiled=!0,a&&(v.functional=!0)),n&&(v._scopeId=n),l?(c=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,o(e)),e&&e._registeredComponents&&e._registeredComponents.add(l)},v._ssrRegister=c):t&&(c=r?function(e){t.call(this,s(e,this.$root.$options.shadowRoot))}:function(e){t.call(this,i(e))}),c)if(v.functional){var p=v.render;v.render=function(e,t){return c.call(t),p(e,t)}}else{var d=v.beforeCreate;v.beforeCreate=d?[].concat(d,c):[c]}return u}const O={name:"Multiselect",emits:["open","close","select","deselect","input","search-change","tag","option","update:modelValue","change","clear"],props:{value:{required:!1},modelValue:{required:!1},options:{type:[Array,Object,Function],required:!1,default:()=>[]},id:{type:[String,Number],required:!1},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:void 0},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},hideSelected:{type:Boolean,required:!1,default:!0},createTag:{type:Boolean,required:!1,default:void 0},createOption:{type:Boolean,required:!1,default:void 0},appendNewTag:{type:Boolean,required:!1,default:void 0},appendNewOption:{type:Boolean,required:!1,default:void 0},addTagOn:{type:Array,required:!1,default:void 0},addOptionOn:{type:Array,required:!1,default:void 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},canClear:{type:Boolean,required:!1,default:!0},max:{type:Number,required:!1,default:-1},showOptions:{type:Boolean,required:!1,default:!0},required:{type:Boolean,required:!1,default:!1},openDirection:{type:String,required:!1,default:"bottom"},nativeSupport:{type:Boolean,required:!1,default:!1},classes:{type:Object,required:!1,default:()=>({})},strict:{type:Boolean,required:!1,default:!0},closeOnSelect:{type:Boolean,required:!1,default:!0},autocomplete:{type:String,required:!1},groups:{type:Boolean,required:!1,default:!1},groupLabel:{type:String,required:!1,default:"label"},groupOptions:{type:String,required:!1,default:"options"},groupHideEmpty:{type:Boolean,required:!1,default:!1},groupSelect:{type:Boolean,required:!1,default:!0},inputType:{type:String,required:!1,default:"text"},attrs:{required:!1,type:[Object],default:()=>({})}},setup(a,i){const o=function(n,a){var l=e(n),r=l.value,i=l.modelValue,o=l.mode,s=l.valueProp,c=t("single"!==o.value?[]:{}),v=void 0!==a.expose?i:r,p=u((function(){return"single"===o.value?c.value[s.value]:c.value.map((function(e){return e[s.value]}))})),d=u((function(){return"single"!==o.value?c.value.map((function(e){return e[s.value]})).join(","):c.value[s.value]}));return{iv:c,internalValue:c,ev:v,externalValue:v,textValue:d,plainValue:p}}(a,i),s=function(u,n,a){var l=e(u),r=l.groupSelect,i=l.mode,o=l.groups,s=t(null),c=function(e){void 0===e||null!==e&&e.disabled||o.value&&e&&e.group&&("single"===i.value||!r.value)||(s.value=e)};return{pointer:s,setPointer:c,clearPointer:function(){c(null)}}}(a),c=function(u,n,a){var l=e(u).disabled,r=t(!1);return{isOpen:r,open:function(){r.value||l.value||(r.value=!0,n.emit("open"))},close:function(){r.value&&(r.value=!1,n.emit("close"))}}}(a,i),v=function(e,u,a){var l=t(null),r=t(null);return n(l,(function(e){u.emit("search-change",e)})),{search:l,input:r,clearSearch:function(){l.value=""},handleSearchInput:function(e){l.value=e.target.value},handlePaste:function(e){u.emit("paste",e)}}}(0,i),f=function(t,u,n){var a=e(t),l=a.object,i=a.valueProp,o=a.mode,s=n.iv,c=function(e){return l.value||r(e)?e:Array.isArray(e)?e.map((function(e){return e[i.value]})):e[i.value]},v=function(e){return r(e)?"single"===o.value?{}:[]:e};return{update:function(e){s.value=v(e);var t=c(e);u.emit("change",t),u.emit("input",t),u.emit("update:modelValue",t)}}}(a,i,{iv:o.iv}),b=function(n,a,l){var r=e(n),i=r.searchable,o=r.disabled,s=l.input,c=l.open,v=l.close,p=l.clearSearch,d=t(null),f=t(!1),g=u((function(){return i.value||o.value?-1:0})),b=function(){i.value&&s.value.blur(),d.value.blur()},m=function(){i.value&&!o.value&&s.value.focus()},D=function(){f.value=!1,setTimeout((function(){f.value||(v(),p())}),1)};return{multiselect:d,tabindex:g,isActive:f,blur:b,focus:m,handleFocus:function(){m()},activate:function(){o.value||(f.value=!0,c())},deactivate:D,handleCaretClick:function(){D(),b()}}}(a,0,{input:v.input,open:c.open,close:c.close,clearSearch:v.clearSearch}),m=p(a,i,{ev:o.ev,iv:o.iv,search:v.search,clearSearch:v.clearSearch,update:f.update,pointer:s.pointer,clearPointer:s.clearPointer,blur:b.blur,focus:b.focus,deactivate:b.deactivate}),D=function(t,a,r){var i=e(t),o=i.valueProp,s=i.showOptions,c=i.searchable,v=i.groupLabel,p=i.groups,f=i.mode,g=i.groupSelect,b=r.fo,m=r.fg,D=r.handleOptionClick,h=r.handleGroupClick,y=r.search,O=r.pointer,_=r.setPointer,F=r.clearPointer,A=r.multiselect,S=u((function(){return b.value.filter((function(e){return!e.disabled}))})),C=u((function(){return m.value.filter((function(e){return!e.disabled}))})),E=u((function(){return"single"!==f.value&&g.value})),P=u((function(){return O.value&&O.value.group})),B=u((function(){return V(O.value)})),L=u((function(){var e=P.value?O.value:V(O.value),t=C.value.map((function(e){return e[v.value]})).indexOf(e[v.value]),u=C.value[t-1];return void 0===u&&(u=T.value),u})),w=u((function(){var e=C.value.map((function(e){return e.label})).indexOf(P.value?O.value[v.value]:V(O.value)[v.value])+1;return C.value.length<=e&&(e=0),C.value[e]})),T=u((function(){return d(C.value).slice(-1)[0]})),k=u((function(){return O.value.__VISIBLE__.filter((function(e){return!e.disabled}))[0]})),q=u((function(){var e=B.value.__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[o.value]})).indexOf(O.value[o.value])-1]})),x=u((function(){var e=V(O.value).__VISIBLE__.filter((function(e){return!e.disabled}));return e[e.map((function(e){return e[o.value]})).indexOf(O.value[o.value])+1]})),j=u((function(){return d(L.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),I=u((function(){return d(T.value.__VISIBLE__.filter((function(e){return!e.disabled}))).slice(-1)[0]})),R=function(){_(S.value[0]||null)},V=function(e){return C.value.find((function(t){return-1!==t.__VISIBLE__.map((function(e){return e[o.value]})).indexOf(e[o.value])}))},H=function(){var e=A.value.querySelector("[data-pointed]");if(e){var t=e.parentElement.parentElement;p.value&&(t=P.value?e.parentElement.parentElement.parentElement:e.parentElement.parentElement.parentElement.parentElement),e.offsetTop+e.offsetHeight>t.clientHeight+t.scrollTop&&(t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight),e.offsetTop<t.scrollTop&&(t.scrollTop=e.offsetTop)}};return n(y,(function(e){c.value&&(e.length&&s.value?R():F())})),{pointer:O,canPointGroups:E,isPointed:function(e){return!(!O.value||!(!e.group&&O.value[o.value]==e[o.value]||void 0!==e.group&&O.value[v.value]==e[v.value]))||void 0},setPointerFirst:R,selectPointer:function(){O.value&&!0!==O.value.disabled&&(P.value?h(O.value):D(O.value))},forwardPointer:function(){if(null===O.value)_((p.value&&E.value?C.value[0]:S.value[0])||null);else if(p.value&&E.value){var e=P.value?k.value:x.value;void 0===e&&(e=w.value),_(e||null)}else{var t=S.value.map((function(e){return e[o.value]})).indexOf(O.value[o.value])+1;S.value.length<=t&&(t=0),_(S.value[t]||null)}l((function(){H()}))},backwardPointer:function(){if(null===O.value){var e=S.value[S.value.length-1];p.value&&E.value&&void 0===(e=I.value)&&(e=T.value),_(e||null)}else if(p.value&&E.value){var t=P.value?j.value:q.value;void 0===t&&(t=P.value?L.value:B.value),_(t||null)}else{var u=S.value.map((function(e){return e[o.value]})).indexOf(O.value[o.value])-1;u<0&&(u=S.value.length-1),_(S.value[u]||null)}l((function(){H()}))}}}(a,0,{fo:m.fo,fg:m.fg,handleOptionClick:m.handleOptionClick,handleGroupClick:m.handleGroupClick,search:v.search,pointer:s.pointer,setPointer:s.setPointer,clearPointer:s.clearPointer,multiselect:b.multiselect}),y=function(t,n,a){var l=e(t),r=l.mode,i=l.addTagOn,o=l.openDirection,s=l.searchable,c=l.showOptions,v=l.valueProp,p=l.groups,d=l.addOptionOn,f=l.createTag,b=l.createOption,m=a.iv,D=a.update,h=a.search,y=a.setPointer,O=a.selectPointer,_=a.backwardPointer,F=a.forwardPointer,A=a.blur,S=a.fo,C=u((function(){return f.value||b.value||!1})),E=u((function(){return void 0!==i.value?i.value:void 0!==d.value?d.value:["enter"]})),P=function(){"tags"===r.value&&!c.value&&C.value&&s.value&&!p.value&&y(S.value[S.value.map((function(e){return e[v.value]})).indexOf(h.value)])};return{handleKeydown:function(e){switch(e.key){case"Backspace":if("single"===r.value)return;if(s.value&&-1===[null,""].indexOf(h.value))return;if(0===m.value.length)return;D(g(m.value).slice(0,-1));break;case"Enter":if(e.preventDefault(),-1===E.value.indexOf("enter")&&C.value)return;P(),O();break;case" ":if(!C.value&&!s.value)return e.preventDefault(),P(),void O();if(!C.value)return!1;if(-1===E.value.indexOf("space")&&C.value)return;e.preventDefault(),P(),O();break;case"Tab":case";":case",":if(-1===E.value.indexOf(e.key.toLowerCase())||!C.value)return;P(),O(),e.preventDefault();break;case"Escape":A();break;case"ArrowUp":if(e.preventDefault(),!c.value)return;"top"===o.value?F():_();break;case"ArrowDown":if(e.preventDefault(),!c.value)return;"top"===o.value?_():F()}},preparePointer:P}}(a,0,{iv:o.iv,update:f.update,search:v.search,setPointer:s.setPointer,selectPointer:D.selectPointer,backwardPointer:D.backwardPointer,forwardPointer:D.forwardPointer,blur:b.blur,fo:m.fo}),O=h(a,0,{isOpen:c.isOpen,isPointed:D.isPointed,canPointGroups:D.canPointGroups,isSelected:m.isSelected,isDisabled:m.isDisabled,isActive:b.isActive,resolving:m.resolving,fo:m.fo});return{...o,...c,...b,...s,...f,...v,...m,...D,...y,...O}}};var _=function(){var e=this,t=e.$createElement,u=e._self._c||t;return u("div",{ref:"multiselect",class:e.classList.container,attrs:{tabindex:e.tabindex,id:e.id},on:{focusin:e.activate,focusout:e.deactivate,keydown:e.handleKeydown,focus:e.handleFocus}},["tags"!==e.mode&&e.searchable&&!e.disabled?[u("input",e._b({ref:"input",class:e.classList.search,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete},domProps:{value:e.search},on:{input:e.handleSearchInput,paste:function(t){return t.stopPropagation(),e.handlePaste(t)}}},"input",e.attrs,!1))]:e._e(),e._v(" "),"tags"==e.mode?[u("div",{class:e.classList.tags},[e._l(e.iv,(function(t,n,a){return e._t("tag",[u("span",{key:a,class:e.classList.tag},[e._v("\n "+e._s(t[e.label])+"\n "),e.disabled?e._e():u("span",{class:e.classList.tagRemove,on:{click:function(u){return e.handleTagRemove(t,u)}}},[u("span",{class:e.classList.tagRemoveIcon})])])],{option:t,handleTagRemove:e.handleTagRemove,disabled:e.disabled})})),e._v(" "),u("div",{class:e.classList.tagsSearchWrapper},[u("span",{class:e.classList.tagsSearchCopy},[e._v(e._s(e.search))]),e._v(" "),e.searchable&&!e.disabled?u("input",e._b({ref:"input",class:e.classList.tagsSearch,attrs:{type:e.inputType,modelValue:e.search,autocomplete:e.autocomplete},domProps:{value:e.search},on:{input:e.handleSearchInput,paste:function(t){return t.stopPropagation(),e.handlePaste(t)}}},"input",e.attrs,!1)):e._e()])],2)]:e._e(),e._v(" "),"single"==e.mode&&e.hasSelected&&!e.search&&e.iv?[e._t("singlelabel",[u("div",{class:e.classList.singleLabel},[u("span",{class:e.classList.singleLabelText,domProps:{innerHTML:e._s(e.iv[e.label])}})])],{value:e.iv})]:e._e(),e._v(" "),"multiple"==e.mode&&e.hasSelected&&!e.search?[e._t("multiplelabel",[u("div",{class:e.classList.multipleLabel,domProps:{innerHTML:e._s(e.multipleLabelText)}})],{values:e.iv})]:e._e(),e._v(" "),!e.placeholder||e.hasSelected||e.search?e._e():[e._t("placeholder",[u("div",{class:e.classList.placeholder},[e._v("\n "+e._s(e.placeholder)+"\n ")])])],e._v(" "),e.busy&&e.isActive?e._t("spinner",[u("span",{class:e.classList.spinner})]):e._e(),e._v(" "),e.hasSelected&&!e.disabled&&e.canClear&&!e.busy?e._t("clear",[u("span",{class:e.classList.clear,on:{mousedown:e.clear}},[u("span",{class:e.classList.clearIcon})])],{clear:e.clear}):e._e(),e._v(" "),e.caret&&e.showOptions?e._t("caret",[u("span",{class:e.classList.caret,on:{click:e.handleCaretClick}})]):e._e(),e._v(" "),u("div",{class:e.classList.dropdown,attrs:{tabindex:"-1"}},[e._t("beforelist",null,{options:e.fo}),e._v(" "),u("ul",{class:e.classList.options},[e.groups?e._l(e.fg,(function(t,n,a){return u("li",{key:a,class:e.classList.group},[u("div",{class:e.classList.groupLabel(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(u){return e.setPointer(t)},click:function(u){return e.handleGroupClick(t)}}},[e._t("grouplabel",[u("span",{domProps:{innerHTML:e._s(t[e.groupLabel])}})],{group:t})],2),e._v(" "),u("ul",{class:e.classList.groupOptions},e._l(t.__VISIBLE__,(function(n,a,l){return u("li",{key:l,class:e.classList.option(n,t),attrs:{"data-pointed":e.isPointed(n)},on:{mouseenter:function(t){return e.setPointer(n)},click:function(t){return e.handleOptionClick(n)}}},[e._t("option",[u("span",{domProps:{innerHTML:e._s(n[e.label])}})],{option:n,search:e.search})],2)})),0)])})):e._l(e.fo,(function(t,n,a){return u("li",{key:a,class:e.classList.option(t),attrs:{"data-pointed":e.isPointed(t)},on:{mouseenter:function(u){return e.setPointer(t)},click:function(u){return e.handleOptionClick(t)}}},[e._t("option",[u("span",{domProps:{innerHTML:e._s(t[e.label])}})],{option:t,search:e.search})],2)}))],2),e._v(" "),e.noOptions?e._t("nooptions",[u("div",{class:e.classList.noOptions,domProps:{innerHTML:e._s(e.noOptionsText)}})]):e._e(),e._v(" "),e.noResults?e._t("noresults",[u("div",{class:e.classList.noResults,domProps:{innerHTML:e._s(e.noResultsText)}})]):e._e(),e._v(" "),e._t("afterlist",null,{options:e.fo})],2),e._v(" "),e.required?u("input",{class:e.classList.fakeInput,attrs:{tabindex:"-1",required:""},domProps:{value:e.textValue}}):e._e(),e._v(" "),e.nativeSupport?["single"==e.mode?u("input",{attrs:{type:"hidden",name:e.name},domProps:{value:void 0!==e.plainValue?e.plainValue:""}}):e._l(e.plainValue,(function(t,n){return u("input",{key:n,attrs:{type:"hidden",name:e.name+"[]"},domProps:{value:t}})}))]:e._e(),e._v(" "),u("div",{class:e.classList.spacer})],2)};_._withStripped=!0;const F=y({render:_,staticRenderFns:[]},undefined,O,undefined,false,undefined,!1,void 0,void 0,void 0);export default F; |
{ | ||
"name": "@vueform/multiselect", | ||
"version": "2.3.3", | ||
"version": "2.3.4", | ||
"private": false, | ||
@@ -5,0 +5,0 @@ "description": "Vue 3 multiselect component with single select, multiselect and tagging options.", |
@@ -1,2 +0,2 @@ | ||
import { ref, toRefs, computed, watch, nextTick } from 'composition-api' | ||
import { ref, toRefs, computed, watch, nextTick, getCurrentInstance } from 'composition-api' | ||
import normalize from './../utils/normalize' | ||
@@ -17,2 +17,4 @@ import isObject from './../utils/isObject' | ||
const $this = getCurrentInstance().proxy | ||
// ============ DEPENDENCIES ============ | ||
@@ -43,2 +45,5 @@ | ||
// no export | ||
const searchWatcher = ref(null) | ||
// ============== COMPUTED ============== | ||
@@ -78,3 +83,3 @@ | ||
} else { | ||
let eo = optionsToArray(ro.value || []) | ||
let eo = optionsToArray(ro.value || /* istanbul ignore next */ []) | ||
@@ -137,3 +142,3 @@ if (ap.value.length) { | ||
return multipleLabel !== undefined && multipleLabel.value !== undefined | ||
? multipleLabel.value(iv.value) | ||
? multipleLabel.value(iv.value, $this) | ||
: (iv.value && iv.value.length > 1 ? `${iv.value.length} options selected` : `1 option selected`) | ||
@@ -504,10 +509,20 @@ }) | ||
options.value(search.value).then((response) => { | ||
ro.value = response | ||
return new Promise((resolve, reject) => { | ||
options.value(search.value, $this).then((response) => { | ||
ro.value = response || [] | ||
if (typeof callback == 'function') { | ||
callback(response) | ||
} | ||
if (typeof callback == 'function') { | ||
callback(response) | ||
} | ||
resolving.value = false | ||
resolving.value = false | ||
}).catch((e) => { | ||
console.error(e) | ||
ro.value = [] | ||
resolving.value = false | ||
}).finally(() => { | ||
resolve() | ||
}) | ||
}) | ||
@@ -523,17 +538,27 @@ } | ||
if (mode.value === 'single') { | ||
let newLabel = getOption(iv.value[valueProp.value])[label.value] | ||
let option = getOption(iv.value[valueProp.value]) | ||
iv.value[label.value] = newLabel | ||
/* istanbul ignore else */ | ||
if (option !== undefined) { | ||
let newLabel = option[label.value] | ||
if (object.value) { | ||
ev.value[label.value] = newLabel | ||
iv.value[label.value] = newLabel | ||
if (object.value) { | ||
ev.value[label.value] = newLabel | ||
} | ||
} | ||
} else { | ||
iv.value.forEach((val, i) => { | ||
let newLabel = getOption(iv.value[i][valueProp.value])[label.value] | ||
let option = getOption(iv.value[i][valueProp.value]) | ||
iv.value[i][label.value] = newLabel | ||
/* istanbul ignore else */ | ||
if (option !== undefined) { | ||
let newLabel = option[label.value] | ||
if (object.value) { | ||
ev.value[i][label.value] = newLabel | ||
iv.value[i][label.value] = newLabel | ||
if (object.value) { | ||
ev.value[i][label.value] = newLabel | ||
} | ||
} | ||
@@ -563,2 +588,33 @@ }) | ||
// no export | ||
const initSearchWatcher = () => { | ||
searchWatcher.value = watch(search, (query) => { | ||
if (query.length < minChars.value || !query) { | ||
return | ||
} | ||
resolving.value = true | ||
if (clearOnSearch.value) { | ||
ro.value = [] | ||
} | ||
setTimeout(() => { | ||
if (query != search.value) { | ||
return | ||
} | ||
options.value(search.value, $this).then((response) => { | ||
if (query == search.value || !search.value) { | ||
ro.value = response | ||
pointer.value = fo.value.filter(o => o.disabled !== true)[0] || null | ||
resolving.value = false | ||
} | ||
}).catch( /* istanbul ignore next */ (e) => { | ||
console.error(e) | ||
}) | ||
}, delay.value) | ||
}, { flush: 'sync' }) | ||
} | ||
// ================ HOOKS =============== | ||
@@ -586,29 +642,16 @@ | ||
if (delay.value > -1) { | ||
watch(search, (query) => { | ||
if (query.length < minChars.value) { | ||
return | ||
} | ||
initSearchWatcher() | ||
} | ||
resolving.value = true | ||
watch(delay, (value, old) => { | ||
/* istanbul ignore else */ | ||
if (searchWatcher.value) { | ||
searchWatcher.value() | ||
} | ||
if (clearOnSearch.value) { | ||
ro.value = [] | ||
} | ||
setTimeout(() => { | ||
if (query != search.value) { | ||
return | ||
} | ||
if (value >= 0) { | ||
initSearchWatcher() | ||
} | ||
}) | ||
options.value(search.value).then((response) => { | ||
if (query == search.value || !search.value) { | ||
ro.value = response | ||
pointer.value = fo.value.filter(o => o.disabled !== true)[0] || null | ||
resolving.value = false | ||
} | ||
}) | ||
}, delay.value) | ||
}, { flush: 'sync' }) | ||
} | ||
watch(ev, (newValue) => { | ||
@@ -636,4 +679,12 @@ if (isNullish(newValue)) { | ||
if (typeof props.options !== 'function') { | ||
watch(options, (n, o) => { | ||
watch(options, (n, o) => { | ||
if (typeof props.options === 'function') { | ||
if (resolveOnLoad.value) { | ||
resolveOptions(() => { | ||
if (Object.keys(iv.value).length) { | ||
initInternalValue() | ||
} | ||
}) | ||
} | ||
} else { | ||
ro.value = props.options | ||
@@ -646,5 +697,7 @@ | ||
refreshLabels() | ||
}) | ||
} | ||
} | ||
}) | ||
watch(label, refreshLabels) | ||
return { | ||
@@ -677,3 +730,4 @@ fo, | ||
resolveOptions, | ||
refreshLabels, | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
272428
1808