@ldmjs/ui 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (function webpackUniversalModuleDefinition(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define(["vue"],t):"object"===typeof exports?exports["ldmui"]=t(require("vue")):e["ldmui"]=t(e["vue"])})(self,(e=>(()=>{"use strict";var t={6262:(e,t)=>{t.A=(e,t)=>{const i=e.__vccOpts||e;for(const[e,s]of t)i[e]=s;return i}},2380:t=>{t.exports=e}},i={};function __webpack_require__(e){var s=i[e];if(void 0!==s)return s.exports;var l=i[e]={exports:{}};return t[e](l,l.exports,__webpack_require__),l.exports}(()=>{__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var s={};return(()=>{__webpack_require__.r(s),__webpack_require__.d(s,{default:()=>x});var e=__webpack_require__(2380);const t=["tabindex","aria-owns"],i={ref:"tags",class:"multiselect__tags"},l={class:"multiselect__tags-wrap"},o=["textContent"],r=["onKeypress","onMousedown"],n=["textContent"],a={class:"multiselect__spinner"},h=["name","id","placeholder","value","disabled","tabindex","aria-controls"],p=["id"],c={key:0},u={class:"multiselect__option"},d=["id","role"],m=["onClick","onMouseenter","data-select","data-selected","data-deselect"],g=["data-select","data-deselect","onMouseenter","onMousedown"],f={class:"multiselect__option"},b={class:"multiselect__option"};function render(s,y,w,V,v,_){return(0,e.openBlock)(),(0,e.createElementBlock)("div",{tabindex:s.searchable?-1:w.tabindex,class:(0,e.normalizeClass)([{"multiselect--active":s.isOpen,"multiselect--disabled":w.disabled,"multiselect--above":_.isAbove,"multiselect--has-options-group":_.hasOptionGroup,"multiselect--list-empty":s.isOpen&&!_.showNoResultsSlot&&!_.showNoOptionsSlot&&0===s.filteredOptions.length},"multiselect"]),onFocus:y[13]||(y[13]=e=>s.activate()),onBlur:y[14]||(y[14]=e=>!s.searchable&&s.deactivate()),onKeydown:[y[15]||(y[15]=(0,e.withKeys)((0,e.withModifiers)((e=>s.pointerForward()),["self","prevent"]),["down"])),y[16]||(y[16]=(0,e.withKeys)((0,e.withModifiers)((e=>s.pointerBackward()),["self","prevent"]),["up"]))],onKeypress:y[17]||(y[17]=(0,e.withKeys)((0,e.withModifiers)((e=>s.addPointerElement(e)),["stop","self"]),["enter","tab"])),onKeyup:y[18]||(y[18]=(0,e.withKeys)((e=>s.deactivate()),["esc"])),role:"combobox","aria-owns":"listbox-"+s.id},[(0,e.renderSlot)(s.$slots,"caret",{toggle:s.toggle},(()=>[(0,e.createElementVNode)("div",{onMousedown:y[0]||(y[0]=(0,e.withModifiers)((e=>s.toggle()),["prevent","stop"])),class:"multiselect__select"},null,32)])),(0,e.createTextVNode)(),(0,e.renderSlot)(s.$slots,"clear",{search:s.search}),(0,e.createTextVNode)(),(0,e.createElementVNode)("div",i,[(0,e.renderSlot)(s.$slots,"selection",{search:s.search,remove:s.removeElement,values:_.visibleValues,isOpen:s.isOpen},(()=>[(0,e.withDirectives)((0,e.createElementVNode)("div",l,[((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,null,(0,e.renderList)(_.visibleValues,((t,i)=>(0,e.renderSlot)(s.$slots,"tag",{option:t,search:s.search,remove:s.removeElement},(()=>[((0,e.openBlock)(),(0,e.createElementBlock)("span",{class:"multiselect__tag",key:i},[(0,e.createElementVNode)("span",{textContent:(0,e.toDisplayString)(s.getOptionLabel(t))},null,8,o),(0,e.createTextVNode)(),(0,e.createElementVNode)("i",{tabindex:"1",onKeypress:(0,e.withKeys)((0,e.withModifiers)((e=>s.removeElement(t)),["prevent"]),["enter"]),onMousedown:(0,e.withModifiers)((e=>s.removeElement(t)),["prevent"]),class:"multiselect__tag-icon"},null,40,r)]))])))),256))],512),[[e.vShow,_.visibleValues.length>0]]),(0,e.createTextVNode)(),s.internalValue&&s.internalValue.length>w.limit?(0,e.renderSlot)(s.$slots,"limit",{key:0},(()=>[(0,e.createElementVNode)("strong",{class:"multiselect__strong",textContent:(0,e.toDisplayString)(w.limitText(s.internalValue.length-w.limit))},null,8,n)])):(0,e.createCommentVNode)("",!0)])),(0,e.createTextVNode)(),(0,e.createVNode)(e.Transition,{name:"multiselect__loading"},{default:(0,e.withCtx)((()=>[(0,e.renderSlot)(s.$slots,"loading",{},(()=>[(0,e.withDirectives)((0,e.createElementVNode)("div",a,null,512),[[e.vShow,w.loading]])]))])),_:3}),(0,e.createTextVNode)(),s.searchable?((0,e.openBlock)(),(0,e.createElementBlock)("input",{key:0,ref:"search",name:w.name,id:s.id,type:"text",autocomplete:"off",spellcheck:"false",placeholder:s.placeholder,style:(0,e.normalizeStyle)(_.inputStyle),value:s.search,disabled:w.disabled,tabindex:w.tabindex,class:"multiselect__input","aria-controls":"listbox-"+s.id,onInput:y[1]||(y[1]=e=>s.updateSearch(e.target.value)),onFocus:y[2]||(y[2]=(0,e.withModifiers)((e=>s.activate()),["prevent"])),onBlur:y[3]||(y[3]=(0,e.withModifiers)((e=>s.deactivate()),["prevent"])),onKeyup:y[4]||(y[4]=(0,e.withKeys)((e=>s.deactivate()),["esc"])),onKeydown:[y[5]||(y[5]=(0,e.withKeys)((0,e.withModifiers)((e=>s.pointerForward()),["prevent"]),["down"])),y[6]||(y[6]=(0,e.withKeys)((0,e.withModifiers)((e=>s.pointerBackward()),["prevent"]),["up"])),y[8]||(y[8]=(0,e.withKeys)((0,e.withModifiers)((e=>s.removeLastElement()),["stop"]),["delete"]))],onKeypress:y[7]||(y[7]=(0,e.withKeys)((0,e.withModifiers)((e=>s.addPointerElement(e)),["prevent","stop","self"]),["enter"]))},null,44,h)):(0,e.createCommentVNode)("",!0),(0,e.createTextVNode)(),_.isSingleLabelVisible?((0,e.openBlock)(),(0,e.createElementBlock)("span",{key:1,class:"multiselect__single",onMousedown:y[9]||(y[9]=(0,e.withModifiers)(((...e)=>s.toggle&&s.toggle(...e)),["prevent"]))},[(0,e.renderSlot)(s.$slots,"singleLabel",{option:_.singleValue},(()=>[(0,e.createTextVNode)((0,e.toDisplayString)(s.currentOptionLabel),1)]))],32)):(0,e.createCommentVNode)("",!0),(0,e.createTextVNode)(),_.isPlaceholderVisible?((0,e.openBlock)(),(0,e.createElementBlock)("span",{key:2,class:"multiselect__placeholder",onMousedown:y[10]||(y[10]=(0,e.withModifiers)(((...e)=>s.toggle&&s.toggle(...e)),["prevent"]))},[(0,e.renderSlot)(s.$slots,"placeholder",{},(()=>[(0,e.createTextVNode)((0,e.toDisplayString)(s.placeholder),1)]))],32)):(0,e.createCommentVNode)("",!0)],512),(0,e.createTextVNode)(),(0,e.createVNode)(e.Transition,{name:"multiselect"},{default:(0,e.withCtx)((()=>[(0,e.withDirectives)((0,e.createElementVNode)("div",{class:"multiselect__content-wrapper",onFocus:y[11]||(y[11]=(...e)=>s.activate&&s.activate(...e)),tabindex:"-1",onMousedown:y[12]||(y[12]=(0,e.withModifiers)((()=>{}),["prevent"])),style:(0,e.normalizeStyle)({maxHeight:s.optimizedHeight+"px"}),ref:"list"},[(0,e.createElementVNode)("ul",{class:"multiselect__content",style:(0,e.normalizeStyle)(_.contentStyle),role:"listbox",id:"listbox-"+s.id},[(0,e.renderSlot)(s.$slots,"beforeList"),(0,e.createTextVNode)(),s.multiple&&s.max===s.internalValue.length?((0,e.openBlock)(),(0,e.createElementBlock)("li",c,[(0,e.createElementVNode)("span",u,[(0,e.renderSlot)(s.$slots,"maxElements",{},(()=>[(0,e.createTextVNode)("Maximum of "+(0,e.toDisplayString)(s.max)+" options selected. First remove a selected option to select another.",1)]))])])):(0,e.createCommentVNode)("",!0),(0,e.createTextVNode)(),!s.max||s.internalValue.length<s.max?((0,e.openBlock)(!0),(0,e.createElementBlock)(e.Fragment,{key:1},(0,e.renderList)(s.filteredOptions,((t,i)=>((0,e.openBlock)(),(0,e.createElementBlock)("li",{class:"multiselect__element",key:i,id:s.id+"-"+i,role:t&&(t.$isLabel||t.$isDisabled)?null:"option"},[t&&(t.$isLabel||t.$isDisabled)?(0,e.createCommentVNode)("",!0):((0,e.openBlock)(),(0,e.createElementBlock)("span",{key:0,class:(0,e.normalizeClass)([s.optionHighlight(i,t),"multiselect__option"]),onClick:(0,e.withModifiers)((e=>s.select(t)),["stop"]),onMouseenter:(0,e.withModifiers)((e=>s.pointerSet(i)),["self"]),"data-select":t&&t.isTag?s.tagPlaceholder:_.selectLabelText,"data-selected":_.selectedLabelText,"data-deselect":_.deselectLabelText},[(0,e.renderSlot)(s.$slots,"option",{option:t,search:s.search,index:i},(()=>[(0,e.createElementVNode)("span",null,(0,e.toDisplayString)(s.getOptionLabel(t)),1)]))],42,m)),(0,e.createTextVNode)(),t&&(t.$isLabel||t.$isDisabled)?((0,e.openBlock)(),(0,e.createElementBlock)("span",{key:1,"data-select":s.groupSelect&&_.selectGroupLabelText,"data-deselect":s.groupSelect&&_.deselectGroupLabelText,class:(0,e.normalizeClass)([s.groupHighlight(i,t),"multiselect__option"]),onMouseenter:(0,e.withModifiers)((e=>s.groupSelect&&s.pointerSet(i)),["self"]),onMousedown:(0,e.withModifiers)((e=>s.selectGroup(t)),["prevent"])},[(0,e.renderSlot)(s.$slots,"option",{option:t,search:s.search,index:i},(()=>[(0,e.createElementVNode)("span",null,(0,e.toDisplayString)(s.getOptionLabel(t)),1)]))],42,g)):(0,e.createCommentVNode)("",!0)],8,d)))),128)):(0,e.createCommentVNode)("",!0),(0,e.createTextVNode)(),(0,e.withDirectives)((0,e.createElementVNode)("li",null,[(0,e.createElementVNode)("span",f,[(0,e.renderSlot)(s.$slots,"noResult",{search:s.search},(()=>[(0,e.createTextVNode)("No elements found. Consider changing the search query.")]))])],512),[[e.vShow,_.showNoResultsSlot]]),(0,e.createTextVNode)(),(0,e.withDirectives)((0,e.createElementVNode)("li",null,[(0,e.createElementVNode)("span",b,[(0,e.renderSlot)(s.$slots,"noOptions",{},(()=>[(0,e.createTextVNode)("List is empty.")]))])],512),[[e.vShow,_.showNoOptionsSlot]]),(0,e.createTextVNode)(),(0,e.renderSlot)(s.$slots,"afterList")],12,p)],36),[[e.vShow,s.isOpen]])])),_:3})],42,t)}function isEmpty(e){return 0!==e&&(!(!Array.isArray(e)||0!==e.length)||!e)}function not(e){return(...t)=>!e(...t)}function includes(e,t){void 0===e&&(e="undefined"),null===e&&(e="null"),!1===e&&(e="false");const i=e.toString().toLowerCase();return-1!==i.indexOf(t.trim())}function filterOptions(e,t,i,s){return t?e.filter((e=>includes(s(e,i),t))).sort(((e,t)=>s(e,i).length-s(t,i).length)):e}function stripGroups(e){return e.filter((e=>!e.$isLabel))}function flattenOptions(e,t){return i=>i.reduce(((i,s)=>s[e]&&s[e].length?(i.push({$groupLabel:s[t],$isLabel:!0}),i.concat(s[e])):i),[])}function filterGroups(e,t,i,s,l){return o=>o.map((o=>{if(!o[i])return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."),[];const r=filterOptions(o[i],e,t,l);return r.length?{[s]:o[s],[i]:r}:[]}))}const flow=(...e)=>t=>e.reduce(((e,t)=>t(e)),t),y={data(){return{search:"",isOpen:!1,preferredOpenDirection:"below",optimizedHeight:this.maxHeight}},props:{internalSearch:{type:Boolean,default:!0},options:{type:Array,required:!0},multiple:{type:Boolean,default:!1},trackBy:{type:String},label:{type:String},searchable:{type:Boolean,default:!0},clearOnSelect:{type:Boolean,default:!0},hideSelected:{type:Boolean,default:!1},placeholder:{type:String,default:"Select option"},allowEmpty:{type:Boolean,default:!0},resetAfter:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!0},customLabel:{type:Function,default(e,t){return isEmpty(e)?"":t?e[t]:e}},taggable:{type:Boolean,default:!1},tagPlaceholder:{type:String,default:"Press enter to create a tag"},tagPosition:{type:String,default:"top"},max:{type:[Number,Boolean],default:!1},id:{default:null},optionsLimit:{type:Number,default:1e3},groupValues:{type:String},groupLabel:{type:String},groupSelect:{type:Boolean,default:!1},blockKeys:{type:Array,default(){return[]}},preserveSearch:{type:Boolean,default:!1},preselectFirst:{type:Boolean,default:!1},preventAutofocus:{type:Boolean,default:!1}},mounted(){!this.multiple&&this.max&&console.warn("[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false."),this.preselectFirst&&!this.internalValue.length&&this.options.length&&this.select(this.filteredOptions[0])},computed:{internalValue(){return this.modelValue||0===this.modelValue?Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:[]},filteredOptions(){const e=this.search||"",t=e.toLowerCase().trim();let i=this.options.concat();return i=this.internalSearch?this.groupValues?this.filterAndFlat(i,t,this.label):filterOptions(i,t,this.label,this.customLabel):this.groupValues?flattenOptions(this.groupValues,this.groupLabel)(i):i,i=this.hideSelected?i.filter(not(this.isSelected)):i,this.taggable&&t.length&&!this.isExistingOption(t)&&("bottom"===this.tagPosition?i.push({isTag:!0,label:e}):i.unshift({isTag:!0,label:e})),i.slice(0,this.optionsLimit)},valueKeys(){return this.trackBy?this.internalValue.map((e=>e[this.trackBy])):this.internalValue},optionKeys(){const e=this.groupValues?this.flatAndStrip(this.options):this.options;return e.map((e=>this.customLabel(e,this.label).toString().toLowerCase()))},currentOptionLabel(){return this.multiple?this.searchable?"":this.placeholder:this.internalValue.length?this.getOptionLabel(this.internalValue[0]):this.searchable?"":this.placeholder}},watch:{internalValue:{handler(){this.resetAfter&&this.internalValue.length&&(this.search="",this.$emit("update:modelValue",this.multiple?[]:null))},deep:!0},search(){this.$emit("search-change",this.search)}},emits:["open","search-change","close","select","update:modelValue","remove","tag"],methods:{getValue(){return this.multiple?this.internalValue:0===this.internalValue.length?null:this.internalValue[0]},filterAndFlat(e,t,i){return flow(filterGroups(t,i,this.groupValues,this.groupLabel,this.customLabel),flattenOptions(this.groupValues,this.groupLabel))(e)},flatAndStrip(e){return flow(flattenOptions(this.groupValues,this.groupLabel),stripGroups)(e)},updateSearch(e){this.search=e},isExistingOption(e){return!!this.options&&this.optionKeys.indexOf(e)>-1},isSelected(e){const t=this.trackBy?e[this.trackBy]:e;return this.valueKeys.indexOf(t)>-1},isOptionDisabled(e){return!!e.$isDisabled},getOptionLabel(e){if(isEmpty(e))return"";if(e.isTag)return e.label;if(e.$isLabel)return e.$groupLabel;const t=this.customLabel(e,this.label);return isEmpty(t)?"":t},select(e,t){if(e.$isLabel&&this.groupSelect)this.selectGroup(e);else if(!(-1!==this.blockKeys.indexOf(t)||this.disabled||e.$isDisabled||e.$isLabel)&&(!this.max||!this.multiple||this.internalValue.length!==this.max)&&("Tab"!==t||this.pointerDirty)){if(e.isTag)this.$emit("tag",e.label,this.id),this.search="",this.closeOnSelect&&!this.multiple&&this.deactivate();else{const i=this.isSelected(e);if(i)return void("Tab"!==t&&this.removeElement(e));this.multiple?this.$emit("update:modelValue",this.internalValue.concat([e])):this.$emit("update:modelValue",e),this.$emit("select",e,this.id),this.clearOnSelect&&(this.search="")}this.closeOnSelect&&this.deactivate()}},selectGroup(e){const t=this.options.find((t=>t[this.groupLabel]===e.$groupLabel));if(t){if(this.wholeGroupSelected(t)){this.$emit("remove",t[this.groupValues],this.id);const e=this.internalValue.filter((e=>-1===t[this.groupValues].indexOf(e)));this.$emit("update:modelValue",e)}else{let e=t[this.groupValues].filter((e=>!(this.isOptionDisabled(e)||this.isSelected(e))));this.max&&e.splice(this.max-this.internalValue.length),this.$emit("select",e,this.id),this.$emit("update:modelValue",this.internalValue.concat(e))}this.closeOnSelect&&this.deactivate()}},wholeGroupSelected(e){return e[this.groupValues].every((e=>this.isSelected(e)||this.isOptionDisabled(e)))},wholeGroupDisabled(e){return e[this.groupValues].every(this.isOptionDisabled)},removeElement(e,t=!0){if(this.disabled)return;if(e.$isDisabled)return;if(!this.allowEmpty&&this.internalValue.length<=1)return void this.deactivate();const i="object"===typeof e?this.valueKeys.indexOf(e[this.trackBy]):this.valueKeys.indexOf(e);if(this.multiple){const e=this.internalValue.slice(0,i).concat(this.internalValue.slice(i+1));this.$emit("update:modelValue",e)}else this.$emit("update:modelValue",null);this.$emit("remove",e,this.id),this.closeOnSelect&&t&&this.deactivate()},removeLastElement(){-1===this.blockKeys.indexOf("Delete")&&0===this.search.length&&Array.isArray(this.internalValue)&&this.internalValue.length&&this.removeElement(this.internalValue[this.internalValue.length-1],!1)},activate(){this.isOpen||this.disabled||(this.adjustPosition(),this.groupValues&&0===this.pointer&&this.filteredOptions.length&&(this.pointer=1),this.isOpen=!0,this.searchable?(this.preserveSearch||(this.search=""),this.preventAutofocus||this.$nextTick((()=>this.$refs.search&&this.$refs.search.focus()))):this.preventAutofocus||"undefined"!==typeof this.$el&&this.$el.focus(),this.$emit("open",this.id))},deactivate(){this.isOpen&&(this.isOpen=!1,this.searchable?this.$refs.search&&this.$refs.search.blur():tthis.$el&&this.$el.blur(),this.preserveSearch||(this.search=""),this.$emit("close",this.getValue(),this.id))},toggle(){this.isOpen?this.deactivate():this.activate()},adjustPosition(){if("undefined"===typeof window)return;const e=this.$el.getBoundingClientRect().top,t=window.innerHeight-this.$el.getBoundingClientRect().bottom,i=t>this.maxHeight;i||t>e||"below"===this.openDirection||"bottom"===this.openDirection?(this.preferredOpenDirection="below",this.optimizedHeight=Math.min(t-40,this.maxHeight)):(this.preferredOpenDirection="above",this.optimizedHeight=Math.min(e-40,this.maxHeight))}}},w={data(){return{pointer:0,pointerDirty:!1}},props:{showPointer:{type:Boolean,default:!0},optionHeight:{type:Number,default:40}},computed:{pointerPosition(){return this.pointer*this.optionHeight},visibleElements(){return this.optimizedHeight/this.optionHeight}},watch:{filteredOptions(){this.pointerAdjust()},isOpen(){this.pointerDirty=!1},pointer(){this.$refs.search&&this.$refs.search.setAttribute("aria-activedescendant",this.id+"-"+this.pointer.toString())}},methods:{optionHighlight(e,t){return{"multiselect__option--highlight":e===this.pointer&&this.showPointer,"multiselect__option--selected":this.isSelected(t)}},groupHighlight(e,t){if(!this.groupSelect)return["multiselect__option--disabled",{"multiselect__option--group":t.$isLabel}];const i=this.options.find((e=>e[this.groupLabel]===t.$groupLabel));return i&&!this.wholeGroupDisabled(i)?["multiselect__option--group",{"multiselect__option--highlight":e===this.pointer&&this.showPointer},{"multiselect__option--group-selected":this.wholeGroupSelected(i)}]:"multiselect__option--disabled"},addPointerElement({key:e}="Enter"){this.filteredOptions.length>0&&this.select(this.filteredOptions[this.pointer],e),this.pointerReset()},pointerForward(){this.pointer<this.filteredOptions.length-1&&(this.pointer++,this.$refs.list.scrollTop<=this.pointerPosition-(this.visibleElements-1)*this.optionHeight&&(this.$refs.list.scrollTop=this.pointerPosition-(this.visibleElements-1)*this.optionHeight),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()),this.pointerDirty=!0},pointerBackward(){this.pointer>0?(this.pointer--,this.$refs.list.scrollTop>=this.pointerPosition&&(this.$refs.list.scrollTop=this.pointerPosition),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerBackward()):this.filteredOptions[this.pointer]&&this.filteredOptions[0].$isLabel&&!this.groupSelect&&this.pointerForward(),this.pointerDirty=!0},pointerReset(){this.closeOnSelect&&(this.pointer=0,this.$refs.list&&(this.$refs.list.scrollTop=0))},pointerAdjust(){this.pointer>=this.filteredOptions.length-1&&(this.pointer=this.filteredOptions.length?this.filteredOptions.length-1:0),this.filteredOptions.length>0&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()},pointerSet(e){this.pointer=e,this.pointerDirty=!0}}},V={name:"vue-multiselect",mixins:[y,w],compatConfig:{MODE:3,ATTR_ENUMERATED_COERCION:!1},props:{name:{type:String,default:""},modelValue:{type:null,default(){return[]}},selectLabel:{type:String,default:"Press enter to select"},selectGroupLabel:{type:String,default:"Press enter to select group"},selectedLabel:{type:String,default:"Selected"},deselectLabel:{type:String,default:"Press enter to remove"},deselectGroupLabel:{type:String,default:"Press enter to deselect group"},showLabels:{type:Boolean,default:!0},limit:{type:Number,default:99999},maxHeight:{type:Number,default:300},limitText:{type:Function,default:e=>`and ${e} more`},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},openDirection:{type:String,default:""},showNoOptions:{type:Boolean,default:!0},showNoResults:{type:Boolean,default:!0},tabindex:{type:Number,default:0}},computed:{hasOptionGroup(){return this.groupValues&&this.groupLabel&&this.groupSelect},isSingleLabelVisible(){return!1},isPlaceholderVisible(){return!this.internalValue.length&&(!this.searchable||!this.isOpen)},visibleValues(){return this.internalValue.slice(0,this.limit)},singleValue(){return this.internalValue[0]},deselectLabelText(){return this.showLabels?this.deselectLabel:""},deselectGroupLabelText(){return this.showLabels?this.deselectGroupLabel:""},selectLabelText(){return this.showLabels?this.selectLabel:""},selectGroupLabelText(){return this.showLabels?this.selectGroupLabel:""},selectedLabelText(){return this.showLabels?this.selectedLabel:""},inputStyle(){return this.searchable||this.multiple&&this.modelValue&&this.modelValue.length?this.isOpen?{width:"100%"}:{width:"0",position:"absolute",padding:"0"}:""},contentStyle(){return this.options.length?{display:"inline-block"}:{display:"block"}},isAbove(){return"above"===this.openDirection||"top"===this.openDirection||"below"!==this.openDirection&&"bottom"!==this.openDirection&&"above"===this.preferredOpenDirection},showSearchInput(){return this.searchable&&(!this.hasSingleSelectedSlot||!this.visibleSingleValue&&0!==this.visibleSingleValue||this.isOpen)},showNoResultsSlot(){return this.showNoResults&&0===this.filteredOptions.length&&this.search&&!this.loading},showNoOptionsSlot(){return this.showNoOptions&&(0===this.options.length||!0===this.hasOptionGroup&&0===this.filteredOptions.length)&&!this.search&&!this.loading}}};var v=__webpack_require__(6262);const _=(0,v.A)(V,[["render",render]]),S=_,x=S})(),s})()));
1
+ (function webpackUniversalModuleDefinition(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define(["vue"],t):"object"===typeof exports?exports["ldmui"]=t(require("vue")):e["ldmui"]=t(e["vue"])})(self,(e=>(()=>{"use strict";var t={6262:(e,t)=>{t.A=(e,t)=>{const i=e.__vccOpts||e;for(const[e,s]of t)i[e]=s;return i}},2380:t=>{t.exports=e}},i={};function __webpack_require__(e){var s=i[e];if(void 0!==s)return s.exports;var l=i[e]={exports:{}};return t[e](l,l.exports,__webpack_require__),l.exports}(()=>{__webpack_require__.d=(e,t)=>{for(var i in t)__webpack_require__.o(t,i)&&!__webpack_require__.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})}})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var s={};__webpack_require__.r(s),__webpack_require__.d(s,{default:()=>N});var l=__webpack_require__(2380);const o=["tabindex","aria-owns"],r={ref:"tags",class:"multiselect__tags"},n={class:"multiselect__tags-wrap"},a=["textContent"],h=["onKeypress","onMousedown"],p={class:"multiselect__tag"},c=["textContent"],u={class:"multiselect__spinner"},d=["name","id","placeholder","value","disabled","tabindex","aria-controls"],m=["id"],g={key:0},f={class:"multiselect__option"},b=["id","role"],y=["onClick","onMouseenter","data-select","data-selected","data-deselect"],w=["data-select","data-deselect","onMouseenter","onMousedown"],V={class:"multiselect__option"},_={class:"multiselect__option"};function render(e,t,i,s,v,S){return(0,l.openBlock)(),(0,l.createElementBlock)("div",{tabindex:e.searchable?-1:i.tabindex,class:(0,l.normalizeClass)([{"multiselect--active":e.isOpen,"multiselect--disabled":i.disabled,"multiselect--above":S.isAbove,"multiselect--has-options-group":S.hasOptionGroup,"multiselect--list-empty":e.isOpen&&!S.showNoResultsSlot&&!S.showNoOptionsSlot&&0===e.filteredOptions.length},"multiselect"]),onFocus:t[13]||(t[13]=t=>e.activate()),onBlur:t[14]||(t[14]=t=>!e.searchable&&e.deactivate()),onKeydown:[t[15]||(t[15]=(0,l.withKeys)((0,l.withModifiers)((t=>e.pointerForward()),["self","prevent"]),["down"])),t[16]||(t[16]=(0,l.withKeys)((0,l.withModifiers)((t=>e.pointerBackward()),["self","prevent"]),["up"]))],onKeypress:t[17]||(t[17]=(0,l.withKeys)((0,l.withModifiers)((t=>e.addPointerElement(t)),["stop","self"]),["enter","tab"])),onKeyup:t[18]||(t[18]=(0,l.withKeys)((t=>e.deactivate()),["esc"])),role:"combobox","aria-owns":"listbox-"+e.id},[(0,l.renderSlot)(e.$slots,"caret",{toggle:e.toggle},(()=>[(0,l.createElementVNode)("div",{onMousedown:t[0]||(t[0]=(0,l.withModifiers)((t=>e.toggle()),["prevent","stop"])),class:"multiselect__select"},null,32)])),(0,l.createTextVNode)(),(0,l.renderSlot)(e.$slots,"clear",{search:e.search}),(0,l.createTextVNode)(),(0,l.createElementVNode)("div",r,[(0,l.renderSlot)(e.$slots,"selection",{search:e.search,remove:e.removeElement,values:S.visibleValues,isOpen:e.isOpen},(()=>[(0,l.withDirectives)((0,l.createElementVNode)("div",n,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(S.visibleValues,((t,i)=>(0,l.renderSlot)(e.$slots,"tag",{option:t,search:e.search,remove:e.removeElement},(()=>[((0,l.openBlock)(),(0,l.createElementBlock)("span",{class:"multiselect__tag",key:i},[(0,l.createElementVNode)("span",{textContent:(0,l.toDisplayString)(e.getOptionLabel(t))},null,8,a),(0,l.createTextVNode)(),(0,l.createElementVNode)("i",{tabindex:"1",onKeypress:(0,l.withKeys)((0,l.withModifiers)((i=>e.removeElement(t)),["prevent"]),["enter"]),onMousedown:(0,l.withModifiers)((i=>e.removeElement(t)),["prevent"]),class:"multiselect__tag-icon"},null,40,h)]))])))),256)),(0,l.createTextVNode)(),e.internalValue&&e.internalValue.length>i.limit?(0,l.renderSlot)(e.$slots,"tag-overflow",{key:0,limit:i.limit,count:e.internalValue.length},(()=>[(0,l.createElementVNode)("span",p,[(0,l.createElementVNode)("strong",{class:"multiselect__strong",textContent:(0,l.toDisplayString)(i.limitText(e.internalValue.length-i.limit))},null,8,c)])])):(0,l.createCommentVNode)("",!0)],512),[[l.vShow,S.visibleValues.length>0]])])),(0,l.createTextVNode)(),(0,l.createVNode)(l.Transition,{name:"multiselect__loading"},{default:(0,l.withCtx)((()=>[(0,l.renderSlot)(e.$slots,"loading",{},(()=>[(0,l.withDirectives)((0,l.createElementVNode)("div",u,null,512),[[l.vShow,i.loading]])]))])),_:3}),(0,l.createTextVNode)(),e.searchable?((0,l.openBlock)(),(0,l.createElementBlock)("input",{key:0,ref:"search",name:i.name,id:e.id,type:"text",autocomplete:"off",spellcheck:"false",placeholder:e.placeholder,style:(0,l.normalizeStyle)(S.inputStyle),value:e.search,disabled:i.disabled,tabindex:i.tabindex,class:"multiselect__input","aria-controls":"listbox-"+e.id,onInput:t[1]||(t[1]=t=>e.updateSearch(t.target.value)),onFocus:t[2]||(t[2]=(0,l.withModifiers)((t=>e.activate()),["prevent"])),onBlur:t[3]||(t[3]=(0,l.withModifiers)((t=>e.deactivate()),["prevent"])),onKeyup:t[4]||(t[4]=(0,l.withKeys)((t=>e.deactivate()),["esc"])),onKeydown:[t[5]||(t[5]=(0,l.withKeys)((0,l.withModifiers)((t=>e.pointerForward()),["prevent"]),["down"])),t[6]||(t[6]=(0,l.withKeys)((0,l.withModifiers)((t=>e.pointerBackward()),["prevent"]),["up"])),t[8]||(t[8]=(0,l.withKeys)((0,l.withModifiers)((t=>e.removeLastElement()),["stop"]),["delete"]))],onKeypress:t[7]||(t[7]=(0,l.withKeys)((0,l.withModifiers)((t=>e.addPointerElement(t)),["prevent","stop","self"]),["enter"]))},null,44,d)):(0,l.createCommentVNode)("",!0),(0,l.createTextVNode)(),S.isSingleLabelVisible?((0,l.openBlock)(),(0,l.createElementBlock)("span",{key:1,class:"multiselect__single",onMousedown:t[9]||(t[9]=(0,l.withModifiers)(((...t)=>e.toggle&&e.toggle(...t)),["prevent"]))},[(0,l.renderSlot)(e.$slots,"singleLabel",{option:S.singleValue},(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(e.currentOptionLabel),1)]))],32)):(0,l.createCommentVNode)("",!0),(0,l.createTextVNode)(),S.isPlaceholderVisible?((0,l.openBlock)(),(0,l.createElementBlock)("span",{key:2,class:"multiselect__placeholder",onMousedown:t[10]||(t[10]=(0,l.withModifiers)(((...t)=>e.toggle&&e.toggle(...t)),["prevent"]))},[(0,l.renderSlot)(e.$slots,"placeholder",{},(()=>[(0,l.createTextVNode)((0,l.toDisplayString)(e.placeholder),1)]))],32)):(0,l.createCommentVNode)("",!0)],512),(0,l.createTextVNode)(),(0,l.createVNode)(l.Transition,{name:"multiselect"},{default:(0,l.withCtx)((()=>[(0,l.withDirectives)((0,l.createElementVNode)("div",{class:"multiselect__content-wrapper",onFocus:t[11]||(t[11]=(...t)=>e.activate&&e.activate(...t)),tabindex:"-1",onMousedown:t[12]||(t[12]=(0,l.withModifiers)((()=>{}),["prevent"])),style:(0,l.normalizeStyle)({maxHeight:e.optimizedHeight+"px"}),ref:"list"},[(0,l.createElementVNode)("ul",{class:"multiselect__content",style:(0,l.normalizeStyle)(S.contentStyle),role:"listbox",id:"listbox-"+e.id},[(0,l.renderSlot)(e.$slots,"beforeList"),(0,l.createTextVNode)(),e.multiple&&e.max===e.internalValue.length?((0,l.openBlock)(),(0,l.createElementBlock)("li",g,[(0,l.createElementVNode)("span",f,[(0,l.renderSlot)(e.$slots,"maxElements",{},(()=>[(0,l.createTextVNode)("Maximum of "+(0,l.toDisplayString)(e.max)+" options selected. First remove a selected option to select another.",1)]))])])):(0,l.createCommentVNode)("",!0),(0,l.createTextVNode)(),!e.max||e.internalValue.length<e.max?((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,{key:1},(0,l.renderList)(e.filteredOptions,((t,i)=>((0,l.openBlock)(),(0,l.createElementBlock)("li",{class:"multiselect__element",key:i,id:e.id+"-"+i,role:t&&(t.$isLabel||t.$isDisabled)?null:"option"},[t&&(t.$isLabel||t.$isDisabled)?(0,l.createCommentVNode)("",!0):((0,l.openBlock)(),(0,l.createElementBlock)("span",{key:0,class:(0,l.normalizeClass)([e.optionHighlight(i,t),"multiselect__option"]),onClick:(0,l.withModifiers)((i=>e.select(t)),["stop"]),onMouseenter:(0,l.withModifiers)((t=>e.pointerSet(i)),["self"]),"data-select":t&&t.isTag?e.tagPlaceholder:S.selectLabelText,"data-selected":S.selectedLabelText,"data-deselect":S.deselectLabelText},[(0,l.renderSlot)(e.$slots,"option",{option:t,search:e.search,index:i},(()=>[(0,l.createElementVNode)("span",null,(0,l.toDisplayString)(e.getOptionLabel(t)),1)]))],42,y)),(0,l.createTextVNode)(),t&&(t.$isLabel||t.$isDisabled)?((0,l.openBlock)(),(0,l.createElementBlock)("span",{key:1,"data-select":e.groupSelect&&S.selectGroupLabelText,"data-deselect":e.groupSelect&&S.deselectGroupLabelText,class:(0,l.normalizeClass)([e.groupHighlight(i,t),"multiselect__option"]),onMouseenter:(0,l.withModifiers)((t=>e.groupSelect&&e.pointerSet(i)),["self"]),onMousedown:(0,l.withModifiers)((i=>e.selectGroup(t)),["prevent"])},[(0,l.renderSlot)(e.$slots,"option",{option:t,search:e.search,index:i},(()=>[(0,l.createElementVNode)("span",null,(0,l.toDisplayString)(e.getOptionLabel(t)),1)]))],42,w)):(0,l.createCommentVNode)("",!0)],8,b)))),128)):(0,l.createCommentVNode)("",!0),(0,l.createTextVNode)(),(0,l.withDirectives)((0,l.createElementVNode)("li",null,[(0,l.createElementVNode)("span",V,[(0,l.renderSlot)(e.$slots,"noResult",{search:e.search},(()=>[(0,l.createTextVNode)("No elements found. Consider changing the search query.")]))])],512),[[l.vShow,S.showNoResultsSlot]]),(0,l.createTextVNode)(),(0,l.withDirectives)((0,l.createElementVNode)("li",null,[(0,l.createElementVNode)("span",_,[(0,l.renderSlot)(e.$slots,"noOptions",{},(()=>[(0,l.createTextVNode)("List is empty.")]))])],512),[[l.vShow,S.showNoOptionsSlot]]),(0,l.createTextVNode)(),(0,l.renderSlot)(e.$slots,"afterList")],12,m)],36),[[l.vShow,e.isOpen]])])),_:3})],42,o)}function isEmpty(e){return 0!==e&&(!(!Array.isArray(e)||0!==e.length)||!e)}function not(e){return(...t)=>!e(...t)}function includes(e,t){void 0===e&&(e="undefined"),null===e&&(e="null"),!1===e&&(e="false");const i=e.toString().toLowerCase();return-1!==i.indexOf(t.trim())}function filterOptions(e,t,i,s){return t?e.filter((e=>includes(s(e,i),t))).sort(((e,t)=>s(e,i).length-s(t,i).length)):e}function stripGroups(e){return e.filter((e=>!e.$isLabel))}function flattenOptions(e,t){return i=>i.reduce(((i,s)=>s[e]&&s[e].length?(i.push({$groupLabel:s[t],$isLabel:!0}),i.concat(s[e])):i),[])}function filterGroups(e,t,i,s,l){return o=>o.map((o=>{if(!o[i])return console.warn("Options passed to vue-multiselect do not contain groups, despite the config."),[];const r=filterOptions(o[i],e,t,l);return r.length?{[s]:o[s],[i]:r}:[]}))}const flow=(...e)=>t=>e.reduce(((e,t)=>t(e)),t),v={data(){return{search:"",isOpen:!1,preferredOpenDirection:"below",optimizedHeight:this.maxHeight}},props:{internalSearch:{type:Boolean,default:!0},options:{type:Array,required:!0},multiple:{type:Boolean,default:!1},trackBy:{type:String},label:{type:String},searchable:{type:Boolean,default:!0},clearOnSelect:{type:Boolean,default:!0},hideSelected:{type:Boolean,default:!1},placeholder:{type:String,default:"Select option"},allowEmpty:{type:Boolean,default:!0},resetAfter:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!0},customLabel:{type:Function,default(e,t){return isEmpty(e)?"":t?e[t]:e}},taggable:{type:Boolean,default:!1},tagPlaceholder:{type:String,default:"Press enter to create a tag"},tagPosition:{type:String,default:"top"},max:{type:[Number,Boolean],default:!1},id:{default:null},optionsLimit:{type:Number,default:1e3},groupValues:{type:String},groupLabel:{type:String},groupSelect:{type:Boolean,default:!1},blockKeys:{type:Array,default(){return[]}},preserveSearch:{type:Boolean,default:!1},preselectFirst:{type:Boolean,default:!1},preventAutofocus:{type:Boolean,default:!1}},mounted(){!this.multiple&&this.max&&console.warn("[Vue-Multiselect warn]: Max prop should not be used when prop Multiple equals false."),this.preselectFirst&&!this.internalValue.length&&this.options.length&&this.select(this.filteredOptions[0])},computed:{internalValue(){return this.modelValue||0===this.modelValue?Array.isArray(this.modelValue)?this.modelValue:[this.modelValue]:[]},filteredOptions(){const e=this.search||"",t=e.toLowerCase().trim();let i=this.options.concat();return i=this.internalSearch?this.groupValues?this.filterAndFlat(i,t,this.label):filterOptions(i,t,this.label,this.customLabel):this.groupValues?flattenOptions(this.groupValues,this.groupLabel)(i):i,i=this.hideSelected?i.filter(not(this.isSelected)):i,this.taggable&&t.length&&!this.isExistingOption(t)&&("bottom"===this.tagPosition?i.push({isTag:!0,label:e}):i.unshift({isTag:!0,label:e})),i.slice(0,this.optionsLimit)},valueKeys(){return this.trackBy?this.internalValue.map((e=>e[this.trackBy])):this.internalValue},optionKeys(){const e=this.groupValues?this.flatAndStrip(this.options):this.options;return e.map((e=>this.customLabel(e,this.label).toString().toLowerCase()))},currentOptionLabel(){return this.multiple?this.searchable?"":this.placeholder:this.internalValue.length?this.getOptionLabel(this.internalValue[0]):this.searchable?"":this.placeholder}},watch:{internalValue:{handler(){this.resetAfter&&this.internalValue.length&&(this.search="",this.$emit("update:modelValue",this.multiple?[]:null))},deep:!0},search(){this.$emit("search-change",this.search)}},emits:["open","search-change","close","select","update:modelValue","remove","tag"],methods:{getValue(){return this.multiple?this.internalValue:0===this.internalValue.length?null:this.internalValue[0]},filterAndFlat(e,t,i){return flow(filterGroups(t,i,this.groupValues,this.groupLabel,this.customLabel),flattenOptions(this.groupValues,this.groupLabel))(e)},flatAndStrip(e){return flow(flattenOptions(this.groupValues,this.groupLabel),stripGroups)(e)},updateSearch(e){this.search=e},isExistingOption(e){return!!this.options&&this.optionKeys.indexOf(e)>-1},isSelected(e){const t=this.trackBy?e[this.trackBy]:e;return this.valueKeys.indexOf(t)>-1},isOptionDisabled(e){return!!e.$isDisabled},getOptionLabel(e){if(isEmpty(e))return"";if(e.isTag)return e.label;if(e.$isLabel)return e.$groupLabel;const t=this.customLabel(e,this.label);return isEmpty(t)?"":t},select(e,t){if(e.$isLabel&&this.groupSelect)this.selectGroup(e);else if(!(-1!==this.blockKeys.indexOf(t)||this.disabled||e.$isDisabled||e.$isLabel)&&(!this.max||!this.multiple||this.internalValue.length!==this.max)&&("Tab"!==t||this.pointerDirty)){if(e.isTag)this.$emit("tag",e.label,this.id),this.search="",this.closeOnSelect&&!this.multiple&&this.deactivate();else{const i=this.isSelected(e);if(i)return void("Tab"!==t&&this.removeElement(e));this.multiple?this.$emit("update:modelValue",this.internalValue.concat([e])):this.$emit("update:modelValue",e),this.$emit("select",e,this.id),this.clearOnSelect&&(this.search="")}this.closeOnSelect&&this.deactivate()}},selectGroup(e){const t=this.options.find((t=>t[this.groupLabel]===e.$groupLabel));if(t){if(this.wholeGroupSelected(t)){this.$emit("remove",t[this.groupValues],this.id);const e=this.internalValue.filter((e=>-1===t[this.groupValues].indexOf(e)));this.$emit("update:modelValue",e)}else{let e=t[this.groupValues].filter((e=>!(this.isOptionDisabled(e)||this.isSelected(e))));this.max&&e.splice(this.max-this.internalValue.length),this.$emit("select",e,this.id),this.$emit("update:modelValue",this.internalValue.concat(e))}this.closeOnSelect&&this.deactivate()}},wholeGroupSelected(e){return e[this.groupValues].every((e=>this.isSelected(e)||this.isOptionDisabled(e)))},wholeGroupDisabled(e){return e[this.groupValues].every(this.isOptionDisabled)},removeElement(e,t=!0){if(this.disabled)return;if(e.$isDisabled)return;if(!this.allowEmpty&&this.internalValue.length<=1)return void this.deactivate();const i="object"===typeof e?this.valueKeys.indexOf(e[this.trackBy]):this.valueKeys.indexOf(e);if(this.multiple){const e=this.internalValue.slice(0,i).concat(this.internalValue.slice(i+1));this.$emit("update:modelValue",e)}else this.$emit("update:modelValue",null);this.$emit("remove",e,this.id),this.closeOnSelect&&t&&this.deactivate()},removeLastElement(){-1===this.blockKeys.indexOf("Delete")&&0===this.search.length&&Array.isArray(this.internalValue)&&this.internalValue.length&&this.removeElement(this.internalValue[this.internalValue.length-1],!1)},activate(){this.isOpen||this.disabled||(this.adjustPosition(),this.groupValues&&0===this.pointer&&this.filteredOptions.length&&(this.pointer=1),this.isOpen=!0,this.searchable?(this.preserveSearch||(this.search=""),this.preventAutofocus||this.$nextTick((()=>this.$refs.search&&this.$refs.search.focus()))):this.preventAutofocus||"undefined"!==typeof this.$el&&this.$el.focus(),this.$emit("open",this.id))},deactivate(){this.isOpen&&(this.isOpen=!1,this.searchable?this.$refs.search&&this.$refs.search.blur():tthis.$el&&this.$el.blur(),this.preserveSearch||(this.search=""),this.$emit("close",this.getValue(),this.id))},toggle(){this.isOpen?this.deactivate():this.activate()},adjustPosition(){if("undefined"===typeof window)return;const e=this.$el.getBoundingClientRect().top,t=window.innerHeight-this.$el.getBoundingClientRect().bottom,i=t>this.maxHeight;i||t>e||"below"===this.openDirection||"bottom"===this.openDirection?(this.preferredOpenDirection="below",this.optimizedHeight=Math.min(t-40,this.maxHeight)):(this.preferredOpenDirection="above",this.optimizedHeight=Math.min(e-40,this.maxHeight))}}},S={data(){return{pointer:0,pointerDirty:!1}},props:{showPointer:{type:Boolean,default:!0},optionHeight:{type:Number,default:40}},computed:{pointerPosition(){return this.pointer*this.optionHeight},visibleElements(){return this.optimizedHeight/this.optionHeight}},watch:{filteredOptions(){this.pointerAdjust()},isOpen(){this.pointerDirty=!1},pointer(){this.$refs.search&&this.$refs.search.setAttribute("aria-activedescendant",this.id+"-"+this.pointer.toString())}},methods:{optionHighlight(e,t){return{"multiselect__option--highlight":e===this.pointer&&this.showPointer,"multiselect__option--selected":this.isSelected(t)}},groupHighlight(e,t){if(!this.groupSelect)return["multiselect__option--disabled",{"multiselect__option--group":t.$isLabel}];const i=this.options.find((e=>e[this.groupLabel]===t.$groupLabel));return i&&!this.wholeGroupDisabled(i)?["multiselect__option--group",{"multiselect__option--highlight":e===this.pointer&&this.showPointer},{"multiselect__option--group-selected":this.wholeGroupSelected(i)}]:"multiselect__option--disabled"},addPointerElement({key:e}="Enter"){this.filteredOptions.length>0&&this.select(this.filteredOptions[this.pointer],e),this.pointerReset()},pointerForward(){this.pointer<this.filteredOptions.length-1&&(this.pointer++,this.$refs.list.scrollTop<=this.pointerPosition-(this.visibleElements-1)*this.optionHeight&&(this.$refs.list.scrollTop=this.pointerPosition-(this.visibleElements-1)*this.optionHeight),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()),this.pointerDirty=!0},pointerBackward(){this.pointer>0?(this.pointer--,this.$refs.list.scrollTop>=this.pointerPosition&&(this.$refs.list.scrollTop=this.pointerPosition),this.filteredOptions[this.pointer]&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerBackward()):this.filteredOptions[this.pointer]&&this.filteredOptions[0].$isLabel&&!this.groupSelect&&this.pointerForward(),this.pointerDirty=!0},pointerReset(){this.closeOnSelect&&(this.pointer=0,this.$refs.list&&(this.$refs.list.scrollTop=0))},pointerAdjust(){this.pointer>=this.filteredOptions.length-1&&(this.pointer=this.filteredOptions.length?this.filteredOptions.length-1:0),this.filteredOptions.length>0&&this.filteredOptions[this.pointer].$isLabel&&!this.groupSelect&&this.pointerForward()},pointerSet(e){this.pointer=e,this.pointerDirty=!0}}},x={name:"vue-multiselect",mixins:[v,S],compatConfig:{MODE:3,ATTR_ENUMERATED_COERCION:!1},props:{name:{type:String,default:""},modelValue:{type:null,default(){return[]}},selectLabel:{type:String,default:"Press enter to select"},selectGroupLabel:{type:String,default:"Press enter to select group"},selectedLabel:{type:String,default:"Selected"},deselectLabel:{type:String,default:"Press enter to remove"},deselectGroupLabel:{type:String,default:"Press enter to deselect group"},showLabels:{type:Boolean,default:!0},limit:{type:Number,default:99999},maxHeight:{type:Number,default:300},limitText:{type:Function,default:e=>`and ${e} more`},loading:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},openDirection:{type:String,default:""},showNoOptions:{type:Boolean,default:!0},showNoResults:{type:Boolean,default:!0},tabindex:{type:Number,default:0}},computed:{hasOptionGroup(){return this.groupValues&&this.groupLabel&&this.groupSelect},isSingleLabelVisible(){return!1},isPlaceholderVisible(){return!this.internalValue.length&&(!this.searchable||!this.isOpen)},visibleValues(){return this.internalValue.slice(0,this.limit)},singleValue(){return this.internalValue[0]},deselectLabelText(){return this.showLabels?this.deselectLabel:""},deselectGroupLabelText(){return this.showLabels?this.deselectGroupLabel:""},selectLabelText(){return this.showLabels?this.selectLabel:""},selectGroupLabelText(){return this.showLabels?this.selectGroupLabel:""},selectedLabelText(){return this.showLabels?this.selectedLabel:""},inputStyle(){return this.searchable||this.multiple&&this.modelValue&&this.modelValue.length?this.isOpen?{width:"100%"}:{width:"0",position:"absolute",padding:"0"}:""},contentStyle(){return this.options.length?{display:"inline-block"}:{display:"block"}},isAbove(){return"above"===this.openDirection||"top"===this.openDirection||"below"!==this.openDirection&&"bottom"!==this.openDirection&&"above"===this.preferredOpenDirection},showSearchInput(){return this.searchable&&(!this.hasSingleSelectedSlot||!this.visibleSingleValue&&0!==this.visibleSingleValue||this.isOpen)},showNoResultsSlot(){return this.showNoResults&&0===this.filteredOptions.length&&this.search&&!this.loading},showNoOptionsSlot(){return this.showNoOptions&&(0===this.options.length||!0===this.hasOptionGroup&&0===this.filteredOptions.length)&&!this.search&&!this.loading}}};var O=__webpack_require__(6262);const L=(0,O.A)(x,[["render",render]]),$=L,N=$;return s})()));
@@ -1 +1 @@
1
- (function webpackUniversalModuleDefinition(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define(["vue"],t):"object"===typeof exports?exports["ldmui"]=t(require("vue")):e["ldmui"]=t(e["vue"])})(self,(e=>(()=>{"use strict";var t={6262:(e,t)=>{t.A=(e,t)=>{const o=e.__vccOpts||e;for(const[e,n]of t)o[e]=n;return o}},2380:t=>{t.exports=e}},o={};function __webpack_require__(e){var n=o[e];if(void 0!==n)return n.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,__webpack_require__),r.exports}(()=>{__webpack_require__.d=(e,t)=>{for(var o in t)__webpack_require__.o(t,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};return(()=>{__webpack_require__.r(n),__webpack_require__.d(n,{default:()=>i});var e=__webpack_require__(2380);function render(t,o,n,r,s,c){return t.componentName?((0,e.openBlock)(),(0,e.createBlock)((0,e.resolveDynamicComponent)(t.componentName),{key:0})):(0,e.createCommentVNode)("",!0)}const defineDescriptor=(e,t,o)=>{if(!t.hasOwnProperty(o)){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n)}},merge=e=>{const t={};return e.forEach((e=>{e&&Object.getOwnPropertyNames(e).forEach((o=>defineDescriptor(e,t,o)))})),t},buildFromProps=(e,t)=>{const o={};return t.forEach((t=>defineDescriptor(e,o,t))),o},{defineComponent:t}=__webpack_require__(2380),o={props:{template:String,parentComp:Object},data(){return{componentName:"",dynamic:null}},created(){const e="runtime-template-"+Math.floor(1e4*Math.random());if(this.template){if(this.dynamic&&this.$parent){const{$data:o,$props:n}=this.$parent;let r={$data:{},$props:{}};Object.keys(o||{}).forEach((e=>{void 0===this.$data[e]&&(r.$data[e]=o[e])})),Object.keys(n||{}).forEach((e=>r.$props[e]=n[e]));const s=merge([r.$data,r.$props,this.methodsFromProps]);return this.$options.components[e]=t(this.dynamic,{props:s}),void(this.componentName=e)}const o=this.parentComp||this.$parent;this.$options.methods||(this.$options.methods={}),this.$options.computed||(this.$options.computed={}),this.$options.components||(this.$options.components={});const{$data:n,$props:r,$options:s}=o,{components:c,computed:p,methods:i}=s;let a={$data:{},$props:{},$options:{},components:{},computed:{},methods:{}};Object.keys(n||{}).forEach((e=>{void 0===this.$data[e]&&(a.$data[e]=n[e])})),Object.keys(r||{}).forEach((e=>{void 0===this.$props[e]&&(a.$props[e]=r[e])})),Object.keys(i||{}).forEach((e=>{void 0===this.$options.methods[e]&&(a.methods[e]=i[e])})),Object.keys(p||{}).forEach((e=>{void 0===this.$options.computed[e]&&(a.computed[e]=p[e])})),Object.keys(c||{}).forEach((e=>{void 0===this.$options.components[e]&&(a.components[e]=c[e])}));const d=Object.keys(a.methods||{}),_=Object.keys(a.$data||{}),m=Object.keys(a.$props||{}),h=_.concat(m).concat(d);this.methodsFromProps=buildFromProps(o,d);const u=merge([a.$data,a.$props,this.methodsFromProps]),f={},b={};let $=this.template||"<div></div>";_.forEach((e=>{const t=new RegExp(`[^"{\\s=]?${e}["}\\s]*?(?=["}\\s])`,"g"),n=t.exec($);if(n===e){const n=`${e}_ld`;b[n]=a.$data[e],$=$.replace(t,n);const r=o._watchers.find((t=>t.expression===e));if(r){const e=r.cb;r.cb=function(t,r){const s=this.__renderFn__.componentInstance;s[n]=t,e.call(o,t,r)}.bind(this)}else{const t=function(e){const t=this.__renderFn__.componentInstance;t[n]=e}.bind(this);o.$watch(e,t)}f[n]=function(t,n){o[e]=t}}})),this.$options.components[e]=t({template:$,props:h,data:()=>b,computed:a.computed,components:a.components,watch:f},{props:u}),this.componentName=e}}},r={components:{},mixins:[o]};var s=__webpack_require__(6262);const c=(0,s.A)(r,[["render",render]]),p=c,i=p})(),n})()));
1
+ (function webpackUniversalModuleDefinition(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("vue")):"function"===typeof define&&define.amd?define(["vue"],t):"object"===typeof exports?exports["ldmui"]=t(require("vue")):e["ldmui"]=t(e["vue"])})(self,(e=>(()=>{"use strict";var t={6262:(e,t)=>{t.A=(e,t)=>{const o=e.__vccOpts||e;for(const[e,n]of t)o[e]=n;return o}},2380:t=>{t.exports=e}},o={};function __webpack_require__(e){var n=o[e];if(void 0!==n)return n.exports;var r=o[e]={exports:{}};return t[e](r,r.exports,__webpack_require__),r.exports}(()=>{__webpack_require__.d=(e,t)=>{for(var o in t)__webpack_require__.o(t,o)&&!__webpack_require__.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})}})(),(()=>{__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)})(),(()=>{__webpack_require__.r=e=>{"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}})();var n={};__webpack_require__.r(n),__webpack_require__.d(n,{default:()=>_});var r=__webpack_require__(2380);function render(e,t,o,n,s,c){return e.componentName?((0,r.openBlock)(),(0,r.createBlock)((0,r.resolveDynamicComponent)(e.componentName),{key:0})):(0,r.createCommentVNode)("",!0)}const defineDescriptor=(e,t,o)=>{if(!t.hasOwnProperty(o)){const n=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,n)}},merge=e=>{const t={};return e.forEach((e=>{e&&Object.getOwnPropertyNames(e).forEach((o=>defineDescriptor(e,t,o)))})),t},buildFromProps=(e,t)=>{const o={};return t.forEach((t=>defineDescriptor(e,o,t))),o},{defineComponent:s}=__webpack_require__(2380),c={props:{template:String,parentComp:Object},data(){return{componentName:"",dynamic:null}},created(){const e="runtime-template-"+Math.floor(1e4*Math.random());if(this.template){if(this.dynamic&&this.$parent){const{$data:t,$props:o}=this.$parent;let n={$data:{},$props:{}};Object.keys(t||{}).forEach((e=>{void 0===this.$data[e]&&(n.$data[e]=t[e])})),Object.keys(o||{}).forEach((e=>n.$props[e]=o[e]));const r=merge([n.$data,n.$props,this.methodsFromProps]);return this.$options.components[e]=s(this.dynamic,{props:r}),void(this.componentName=e)}const t=this.parentComp||this.$parent;this.$options.methods||(this.$options.methods={}),this.$options.computed||(this.$options.computed={}),this.$options.components||(this.$options.components={});const{$data:o,$props:n,$options:r}=t,{components:c,computed:p,methods:i}=r;let a={$data:{},$props:{},$options:{},components:{},computed:{},methods:{}};Object.keys(o||{}).forEach((e=>{void 0===this.$data[e]&&(a.$data[e]=o[e])})),Object.keys(n||{}).forEach((e=>{void 0===this.$props[e]&&(a.$props[e]=n[e])})),Object.keys(i||{}).forEach((e=>{void 0===this.$options.methods[e]&&(a.methods[e]=i[e])})),Object.keys(p||{}).forEach((e=>{void 0===this.$options.computed[e]&&(a.computed[e]=p[e])})),Object.keys(c||{}).forEach((e=>{void 0===this.$options.components[e]&&(a.components[e]=c[e])}));const d=Object.keys(a.methods||{}),_=Object.keys(a.$data||{}),m=Object.keys(a.$props||{}),h=_.concat(m).concat(d);this.methodsFromProps=buildFromProps(t,d);const u=merge([a.$data,a.$props,this.methodsFromProps]),f={},b={};let $=this.template||"<div></div>";_.forEach((e=>{const o=new RegExp(`[^"{\\s=]?${e}["}\\s]*?(?=["}\\s])`,"g"),n=o.exec($);if(n===e){const n=`${e}_ld`;b[n]=a.$data[e],$=$.replace(o,n);const r=t._watchers.find((t=>t.expression===e));if(r){const e=r.cb;r.cb=function(o,r){const s=this.__renderFn__.componentInstance;s[n]=o,e.call(t,o,r)}.bind(this)}else{const o=function(e){const t=this.__renderFn__.componentInstance;t[n]=e}.bind(this);t.$watch(e,o)}f[n]=function(o,n){t[e]=o}}})),this.$options.components[e]=s({template:$,props:h,data:()=>b,computed:a.computed,components:a.components,watch:f},{props:u}),this.componentName=e}}},p={components:{},mixins:[c]};var i=__webpack_require__(6262);const a=(0,i.A)(p,[["render",render]]),d=a,_=d;return n})()));
@@ -85,6 +85,25 @@ body {
85
85
  }
86
86
  }
87
87
 
88
+ &.bg-gray {
89
+ background-color: var(--grey-l-6) !important;
90
+ color: var(--text);
91
+
92
+ &:hover {
93
+ color: var(--grey) !important;
94
+ }
95
+
96
+ &:active {
97
+ background-color: var(--grey-l-4) !important;
98
+ color: var(--text) !important;
99
+ }
100
+
101
+ &[disabled] {
102
+ background-color: var(--grey-l-5) !important;
103
+ color: var(--grey) !important;
104
+ }
105
+ }
106
+
88
107
  &.text-primary {
89
108
  color: var(--primary) !important;
90
109
  &:hover {
@@ -102,6 +121,22 @@ body {
102
121
  }
103
122
  }
104
123
 
124
+ &.text-success {
125
+ &.v-btn--variant-outlined {
126
+ color: var(--success-d-1) !important;
127
+ .v-icon {
128
+ color: var(--success-d-1) !important;
129
+ }
130
+ }
131
+ &:hover {
132
+ background-color: var(--success-l-6) !important;
133
+ }
134
+
135
+ &:active {
136
+ background-color: var(--success-l-5) !important;
137
+ }
138
+ }
139
+
105
140
  &.text-grey {
106
141
  &.v-btn--variant-outlined {
107
142
  border-color: var(--grey-l-5) !important;
@@ -127,22 +162,6 @@ body {
127
162
  }
128
163
  }
129
164
 
130
- &.text-success {
131
- &.v-btn--variant-outlined {
132
- color: var(--success-d-1) !important;
133
- .v-icon {
134
- color: var(--success-d-1) !important;
135
- }
136
- }
137
- &:hover {
138
- background-color: var(--success-l-6) !important;
139
- }
140
-
141
- &:active {
142
- background-color: var(--success-l-5) !important;
143
- }
144
- }
145
-
146
165
  &.text-error {
147
166
  &.v-btn--variant-outlined {
148
167
  color: var(--error);
@@ -194,6 +213,58 @@ body {
194
213
  &.bg-primary {
195
214
  color: var(--white) !important;
196
215
  background-color: var(--primary-l-2) !important;
216
+
217
+ &:hover {
218
+ background-color: var(--primary-l-1) !important;
219
+ }
220
+
221
+ &:active {
222
+ background-color: var(--primary) !important;
223
+ }
224
+ }
225
+
226
+ &.bg-success {
227
+ background-color: var(--success) !important;
228
+ color: var(--white) !important;
229
+
230
+ &:hover {
231
+ background-color: var(--success-d-1) !important;
232
+ }
233
+
234
+ &:active {
235
+ background-color: var(--success-d-2) !important;
236
+ }
237
+
238
+ &[disabled] {
239
+ background-color: var(--grey-l-5) !important;
240
+ color: var(--grey) !important;
241
+ }
242
+ }
243
+
244
+ &.bg-grey {
245
+ background-color: var(--grey-l-6) !important;
246
+
247
+ svg {
248
+ color: var(--grey);
249
+ }
250
+
251
+ &:hover {
252
+ svg {
253
+ color: var(--grey-l-1) !important;
254
+ }
255
+ }
256
+
257
+ &:active {
258
+ background-color: var(--grey-l-4) !important;
259
+ svg {
260
+ color: var(--text) !important;
261
+ }
262
+ }
263
+
264
+ &[disabled] {
265
+ background-color: var(--grey-l-5) !important;
266
+ color: var(--grey) !important;
267
+ }
197
268
  }
198
269
 
199
270
  &.text-primary {
@@ -274,6 +345,12 @@ body {
274
345
  svg {
275
346
  color: var(--success-d-1) !important;
276
347
  }
348
+
349
+ &:not(.v-btn--icon) {
350
+ &:hover {
351
+ background-color: var(--success-l-6);
352
+ }
353
+ }
277
354
  }
278
355
  }
279
356
 
@@ -1,7 +1,8 @@
1
1
  .small-input {
2
2
  .v-text-field__prefix {
3
3
  min-height: var(--input-height);
4
- padding: 0 0 0 8px;
4
+ padding: 0 4px 0 8px;
5
+ opacity: 1 !important;
5
6
 
6
7
  .v-text-field__prefix__text {
7
8
  margin: 0;
@@ -12,6 +13,12 @@
12
13
  }
13
14
  }
14
15
 
16
+ .v-text-field__suffix {
17
+ min-height: var(--input-height);
18
+ padding: 0 8px 0 4px;
19
+ opacity: 1 !important;
20
+ }
21
+
15
22
  &.v-field {
16
23
  background-color: var(--white);
17
24
  }
@@ -22,7 +29,7 @@
22
29
 
23
30
  &.password {
24
31
  .v-field__input {
25
- font-size: var(--title-font-size) !important;
32
+ font-size: calc(var(--font-size) + 6px) !important;
26
33
  }
27
34
  }
28
35
 
@@ -120,6 +127,9 @@ body {
120
127
  margin: 0 !important;
121
128
  z-index: 1;
122
129
  height: 20px;
130
+ align-items: center;
131
+ font-size: calc(var(--font-size) - 1px) !important;
132
+
123
133
  .v-messages {
124
134
  font-size: calc(var(--font-size) - 1px) !important;
125
135
  }
@@ -117,10 +117,11 @@
117
117
  text-transform: none;
118
118
  position: relative;
119
119
  cursor: pointer;
120
+ transition: all 0.2s;
120
121
  }
121
122
 
122
123
  & .multiselect__option--highlight {
123
- background-color: var(--grey-l-4);
124
+ background-color: var(--grey-l-6);
124
125
  }
125
126
  }
126
127
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ldmjs/ui",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "ldm ui",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -10,7 +10,7 @@
10
10
  "scripts": {
11
11
  "dev": "cross-env NODE_ENV=development webpack serve --config config/webpack.config.dev.js --progress --profile --stats-error-details",
12
12
  "build": "cross-env NODE_ENV=production webpack --config config/webpack.config.build.js --stats-error-details",
13
- "serve": "cross-env NODE_ENV=development webpack serve --config config/webpack.config.serve.js --progress --profile",
13
+ "build:demo": "cross-env NODE_ENV=production webpack --config config/webpack.config.build.demo.js --stats-error-details",
14
14
  "demo": "cross-env NODE_ENV=development webpack serve --config config/webpack.config.demo.js --progress --profile",
15
15
  "test": "jest --runInBand --no-cache",
16
16
  "pub": "node config/publish.js && npm publish --access=public"
@@ -64,6 +64,7 @@
64
64
  "css-loader": "6.8.1",
65
65
  "eslint": "8.56.0",
66
66
  "html-webpack-plugin": "5.6.0",
67
+ "imask": "7.6.1",
67
68
  "jest": "29.2.2",
68
69
  "jest-environment-jsdom": "29.2.2",
69
70
  "jest-transform-stub": "2.0.0",
@@ -84,12 +85,12 @@
84
85
  "vue": "3.4.21",
85
86
  "vue-class-component": "8.0.0-rc.1",
86
87
  "vue-eslint-parser": "9.4.2",
87
- "vue-imask": "6.6.1",
88
+ "vue-imask": "7.6.1",
88
89
  "vue-loader": "17.3.1",
89
90
  "vue-property-decorator": "10.0.0-rc.3",
90
91
  "vue-screen-utils": "1.0.0-beta.13",
91
92
  "vuetify": "3.6.8",
92
- "webpack": "5.90.2",
93
+ "webpack": "5.92.0",
93
94
  "webpack-cli": "5.1.4",
94
95
  "webpack-dev-server": "4.15.1",
95
96
  "webpack-plugin-vuetify": "2.0.1"